@rongcloud/engine 5.32.0 → 5.32.1-c-test-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1 -1
- package/index.cjs.js +1 -1
- package/index.d.ts +8 -1
- package/index.esm.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -12,4 +12,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
12
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
14
14
|
***************************************************************************** */
|
|
15
|
-
var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n,r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function o(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function a(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function c(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function d(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!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"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}!function(e){e[e.QINIU=1]="QINIU",e[e.ALI=2]="ALI",e[e.AWS=3]="AWS",e[e.STC=4]="STC",e[e.MINIO=5]="MINIO"}(n||(n={}));var _,f,h,g,p,E,b,T,v,R,I,m,y,A,S,O,N,C,P,L,w,M,U,D,G,V,j,k,x,F,B={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",A_SEND_TYPING_STATUS_T:"A-send_typing_status-T",A_SEND_TYPING_STATUS_R:"A-send_typing_status-R",A_SEND_READ_RECEIPT_REQ_T:"A-send_read_receipt_req-T",A_SEND_READ_RECEIPT_REQ_R:"A-send_read_receipt_req-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_LOCAL_MSGS_T:"A-delete_local_msgs-T",A_DELETE_LOCAL_MSGS_R:"A-delete_local_msgs-R",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_REJOIN_CHATROOM_T:"L-rejoin_chatroom-T",L_REJOIN_CHATROOM_R:"L-rejoin_chatroom-R",A_QUIT_CHATROOM_T:"A-quit_chatroom-T",A_QUIT_CHATROOM_R:"A-quit_chatroom-R",A_GET_CHATROOM_INFO_T:"A-get_chatroom_info-T",A_GET_CHATROOM_INFO_R:"A-get_chatroom_info-R",A_SET_CHATROOM_ENTRY_T:"A-set_chatroom_entry-T",A_SET_CHATROOM_ENTRY_R:"A-set_chatroom_entry-R",A_SET_CHATROOM_ENTRIES_T:"A-set_chatroom_entries-T",A_SET_CHATROOM_ENTRIES_R:"A-set_chatroom_entries-R",A_REMOVE_CHATROOM_ENTRY_T:"A-remove_chatroom_entry-T",A_REMOVE_CHATROOM_ENTRY_R:"A-remove_chatroom_entry-R",A_REMOVE_CHATROOM_ENTRIES_T:"A-remove_chatroom_entries-T",A_REMOVE_CHATROOM_ENTRIES_R:"A-remove_chatroom_entries-R",A_GET_CHATROOM_ENTRY_T:"A-get_chatroom_entry-T",A_GET_CHATROOM_ENTRY_R:"A-get_chatroom_entry-R",A_GET_CHATROOM_ENTRIES_T:"A-get_chatroom_entries-T",A_GET_CHATROOM_ENTRIES_R:"A-get_chatroom_entries-R",A_BIND_RTC_FOR_CHATROOM_T:"A-bind_rtc_for_chatroom-T",A_BIND_RTC_FOR_CHATROOM_R:"A-bind_rtc_for_chatroom-R",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",A_GET_REMOTE_HISTORY_MSG_T:"A-get_remote_history_msg-T",A_GET_REMOTE_HISTORY_MSG_R:"A-get_remote_history_msg-R",L_CALLBACK_E:"L-callback-E",A_SEND_READ_RECEIPT_T:"A-send_read_receipt-T",A_SEND_READ_RECEIPT_R:"A-send_read_receipt-R",A_SEND_READ_RECEIPT_V2_T:"A-send_read_receipt_v2-T",A_SEND_READ_RECEIPT_V2_R:"A-send_read_receipt_v2-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_SEND_RMTP_E:"L-send-rmtp-E",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_REMOVE_PROXY_O:"A-remove_proxy-O",L_SET_PROXY_O:"L-set_proxy-O",L_TEST_PROXY_T:"L-test_proxy-T",L_TEST_PROXY_R:"L-test_proxy-R",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_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_convers_notification_level-T",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R:"A-batch_set_convers_notification_level-R",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T:"A-batch_set_convers_translate_strategy-T",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R:"A-batch_set_convers_translate_strategy-R",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_DEL_REMOTE_MSGS_T:"A-del_remote_msgs-T",A_DEL_REMOTE_MSGS_R:"A-del_remote_msgs-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",A_LOAD_CONVERSATION_LIST_T:"A-load_conversation_list-T",A_LOAD_CONVERSATION_LIST_R:"A-load_conversation_list-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",A_GET_CHATROOM_HISTORY_MESSAGES_T:"A-get_chatroom_history_messages-T",A_GET_CHATROOM_HISTORY_MESSAGES_R:"A-get_chatroom_history_messages-R",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T:"A-request_speech_to_text_for_message-T",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R:"A-request_speech_to_text_for_message-R",L_SYNC_USER_SETTINGS_T:"L-sync_user_settings-T",L_SYNC_USER_SETTINGS_R:"L-sync_user_settings-R",A_ADD_TAG_T:"A-add_tag-T",A_ADD_TAG_R:"A-add_tag-R",A_REMOVE_TAG_T:"A-remove_tag-T",A_REMOVE_TAG_R:"A-remove_tag-R",A_UPDATE_TAG_T:"A-update_tag-T",A_UPDATE_TAG_R:"A-update_tag-R",A_GET_TAGS_T:"A-get_tags-T",A_GET_TAGS_R:"A-get_tags-R",A_ADD_TAG_FOR_CONVERSATIONS_T:"A-add_tag_for_conversations-T",A_ADD_TAG_FOR_CONVERSATIONS_R:"A-add_tag_for_conversations-R",A_GET_TAGS_OF_CONVERSATION_T:"A-get_tags_of_conversation-T",A_GET_TAGS_OF_CONVERSATION_R:"A-get_tags_of_conversation-R",A_SET_CONVER_TO_TOP_IN_TAG_T:"A-set_conver_to_top_in_tag-T",A_SET_CONVER_TO_TOP_IN_TAG_R:"A-set_conver_to_top_in_tag-R",A_REMOVE_TAG_FOR_CONVERS_T:"A-remove_tag_for_conversations-T",A_REMOVE_TAG_FOR_CONVERS_R:"A-remove_tag_for_conversations-R",A_REMOVE_TAGS_FOR_CONVER_T:"A-remove_tags_for_conversation-T",A_REMOVE_TAGS_FOR_CONVER_R:"A-remove_tags_for_conversation-R",A_GET_UNREAD_COUNT_BY_TAG_T:"A-get_unread_count_by_tag-T",A_GET_UNREAD_COUNT_BY_TAG_R:"A-get_unread_count_by_tag-R",A_GET_UNREAD_COUNT_T:"A-get_unread_count-T",A_GET_UNREAD_COUNT_R:"A-get_unread_count-R",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T:"A-get_untagged_conversation_list_by_page-T",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R:"A-get_untagged_conversation_list_by_page-R",A_SET_TRANSLATION_LANGUAGE_T:"A-set_translation_language-T",A_SET_TRANSLATION_LANGUAGE_R:"A-set_translation_language-R",A_GET_TRANSLATION_LANGUAGE_T:"A-get_translation_language-T",A_GET_TRANSLATION_LANGUAGE_R:"A-get_translation_language-R",A_SET_AUTO_TRANSLATE_ENABLED_T:"A-set_auto_translate_enabled-T",A_SET_AUTO_TRANSLATE_ENABLED_R:"A-set_auto_translate_enabled-R",A_GET_AUTO_TRANSLATE_ENABLED_T:"A-get_auto_translate_enabled-T",A_GET_AUTO_TRANSLATE_ENABLED_R:"A-get_auto_translate_enabled-R",L_PULL_OFFLINE_MESSAGE_FINISHED_S:"L-pull_offline_message_finished-S",A_MODIFY_MESSAGE_WITH_PARAMS_T:"A-modify_msg_with_params-T",A_MODIFY_MESSAGE_WITH_PARAMS_R:"A-modify_msg_with_params-R",A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T:"A-refresh_refer_msg_with_params-T",A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R:"A-refresh_refer_msg_with_params-R",L_PULL_MODIFY_MSG_T:"L-pull_modify_msg-T",L_PULL_MODIFY_MSG_R:"L-pull_modify_msg-R",A_BATCH_DEL_CONVERS_T:"A-batch_del_conversation-T",A_BATCH_DEL_CONVERS_R:"A-batch_del_conversation-R",A_SYNC_REMOTE_CONVERSATIONS_T:"A-e_sync_remote_conversations-T",A_SYNC_REMOTE_CONVERSATIONS_R:"A-e_sync_remote_conversations-R",L_UPDATE_MSG_BOX_TIME_O:"L-update_msg_box_time-O",A_SEND_UG_TYPING_T:"A-send_ug_typing-T",A_SEND_UG_TYPING_R:"A-send_ug_typing-R",A_GET_UG_LIST_T:"A-get_ug_list-T",A_GET_UG_LIST_R:"A-get_ug_list-R",A_GET_UG_MSGS_BY_UID_T:"A-get_ug_msgs_by_uid-T",A_GET_UG_MSGS_BY_UID_R:"A-get_ug_msgs_by_uid-R",A_GET_UG_UNREAD_MENTIONED_DIGEST_T:"A-get_ug_unread_mentioned_digest-T",A_GET_UG_UNREAD_MENTIONED_DIGEST_R:"A-get_ug_unread_mentioned_digest-R",A_GET_HIS_MSGS_BY_OBJ_NAMES_T:"A-get_his_msgs_by_obj_names-T",A_GET_HIS_MSGS_BY_OBJ_NAMES_R:"A-get_his_msgs_by_obj_names-R",A_GET_CONTINUOUS_MSGS_T:"A-get_continuous_msgs-T",A_GET_CONTINUOUS_MSGS_R:"A-get_continuous_msgs-R",A_GET_MSGS_AROUND_TIMESTAMP_T:"A-get_msgs_around_timestamp-T",A_GET_MSGS_AROUND_TIMESTAMP_R:"A-get_msgs_around_timestamp-R",A_CLEAR_LOCAL_MSG_T:"A-clear_local_msg-T",A_CLEAR_LOCAL_MSG_R:"A-clear_local_msg-R",A_DEL_LOCAL_MSGS_BY_TIME_T:"A-del_local_msgs_by_time-T",A_DEL_LOCAL_MSGS_BY_TIME_R:"A-del_local_msgs_by_time-R",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T:"A-batch_clear_local_msgs_by_time-T",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R:"A-batch_clear_local_msgs_by_time-R",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T:"A-del_local_ug_msgs_for_all_channel-T",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R:"A-del_local_ug_msgs_for_all_channel-R",A_UPDATE_MSG_EXPANSION_T:"A-update_msg_expansion-T",A_UPDATE_MSG_EXPANSION_R:"A-update_msg_expansion-R",A_REMOVE_MSG_EXPANSION_T:"A-remove_msg_expansion-T",A_REMOVE_MSG_EXPANSION_R:"A-remove_msg_expansion-R",A_REMOVE_ALL_MSG_EXPANSION_T:"A-remove_all_msg_expansion-T",A_REMOVE_ALL_MSG_EXPANSION_R:"A-remove_all_msg_expansion-R",A_INSERT_MSG_T:"A-insert_msg-T",A_INSERT_MSG_R:"A-insert_msg-R",A_BATCH_INSERT_MSGS_T:"A-batch_insert_msgs-T",A_BATCH_INSERT_MSGS_R:"A-batch_insert_msgs-R",A_SET_MSG_CONTENT_T:"A-set_msg_content-T",A_SET_MSG_CONTENT_R:"A-set_msg_content-R",A_SET_UG_DEFAULT_NTF_LEVEL_T:"A-set_ug_default_ntf_level-T",A_SET_UG_DEFAULT_NTF_LEVEL_R:"A-set_ug_default_ntf_level-R",A_GET_UG_DEFAULT_NTF_LEVEL_T:"A-get_ug_default_ntf_level-T",A_GET_UG_DEFAULT_NTF_LEVEL_R:"A-get_ug_default_ntf_level-R",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T:"A-get_ug_unread_count_for_all_channels-T",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R:"A-get_ug_unread_count_for_all_channels-R",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T:"A-get_total_unread_count_by_levels-T",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R:"A-get_total_unread_count_by_levels-R",A_GET_TOTAL_UNREAD_COUNT_T:"A-get_total_unread_count-T",A_GET_TOTAL_UNREAD_COUNT_R:"A-get_total_unread_count-R",A_GET_FIRST_UNREAD_MEG_T:"A-get_first_unread_msg-T",A_GET_FIRST_UNREAD_MSG_R:"A-get_first_unread_msg-R",A_GET_FIRST_UNREAD_MSG_DIGEST_T:"A-get_first_unread_msg_digest-T",A_GET_FIRST_UNREAD_MSG_DIGEST_R:"A-get_first_unread_msg_digest-R",A_GET_UNREAD_MENTIONED_MSGS_T:"A-get_unread_mentioned_msgs-T",A_GET_UNREAD_MENTIONED_MSGS_R:"A-get_unread_mentioned_msgs-R",A_GET_UG_UNREAD_INFO_LIST_T:"A-get_ug_unread_info_list-T",A_GET_UG_UNREAD_INFO_LIST_R:"A-get_ug_unread_info_list-R",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T:"A-get_ug_first_unread_msg_digest-T",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R:"A-get_ug_first_unread_msg_digest-R",A_GET_LOCAL_MSG_COUNT_T:"A-get_local_msg_count-T",A_GET_LOCAL_MSG_COUNT_R:"A-get_local_msg_count-R",A_GET_CONVERSATIONS_T:"A-get_conversations-T",A_GET_CONVERSATIONS_R:"A-get_conversations-R",A_GET_BLOCKED_UG_LIST_T:"A-get_blocked_ug_list-T",A_GET_BLOCKED_UG_LIST_R:"A-get_blocked_ug_list-R",A_CLEAR_UNREAD_COUNT_T:"A-clear_unread_count-T",A_CLEAR_UNREAD_COUNT_R:"A-clear_unread_count-R",A_CLEAR_ALL_UNREAD_COUNT_T:"A-clear_all_unread_count-T",A_CLEAR_ALL_UNREAD_COUNT_R:"A-clear_all_unread_count-R",A_GET_TOP_CONVERSATION_LIST_T:"A-get_top_conversation_list-T",A_GET_TOP_CONVERSATION_LIST_R:"A-get_top_conversation_list-R",A_GET_UNREAD_CONVERSATION_LIST_T:"A-get_unread_conversation_list-T",A_GET_UNREAD_CONVERSATION_LIST_R:"A-get_unread_conversation_list-R",A_GET_BLOCKED_CONVERSATION_LIST_T:"A-get_blocked_conversation_list-T",A_GET_BLOCKED_CONVERSATION_LIST_R:"A-get_blocked_conversation_list-R",A_GET_ALL_CONVERSATION_LIST_T:"A-get_all_conversation_list-T",A_GET_ALL_CONVERSATION_LIST_R:"A-get_all_conversation_list-R",A_GET_CONVERSATION_LIST_BY_TIME_T:"A-get_conversation_list_by_time-T",A_GET_CONVERSATION_LIST_BY_TIME_R:"A-get_conversation_list_by_time-R",A_GET_CONVERSATION_LIST_OLD_T:"A-get_conversation_list_old-T",A_GET_CONVERSATION_LIST_OLD_R:"A-get_conversation_list_old-R",A_GET_UNREAD_MENTIONED_COUNT_T:"A-get_unread_mentioned_count-T",A_GET_UNREAD_MENTIONED_COUNT_R:"A-get_unread_mentioned_count-R",A_GET_ALL_UNREAD_MENTIONED_COUNT_T:"A-get_all_unread_mentioned_count-T",A_GET_ALL_UNREAD_MENTIONED_COUNT_R:"A-get_all_unread_mentioned_count-R",A_GET_REALTIME_CONVERSATIONS_T:"A-get_realtime_conversations-T",A_GET_REALTIME_CONVERSATIONS_R:"A-get_realtime_conversations-R",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T:"A-get_realtime_con_total_unread_count-T",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R:"A-get_realtime_con_total_unread_count-R",A_CLEAR_REALTIME_CON_UNREAD_COUNT_T:"A-clear_realtime_con_unread_count-T",A_CLEAR_REALTIME_CON_UNREAD_COUNT_R:"A-clear_realtime_con_unread_count-R",A_REMOVE_REALTIME_CONVERSATIONS_T:"A-remove_realtime_conversations-T",A_REMOVE_REALTIME_CONVERSATIONS_R:"A-remove_realtime_conversations-R",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T:"A-batch_get_realtime_con_unread_count-T",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R:"A-batch_get_realtime_con_unread_count-R",A_GET_SUB_USERS_STATUS_T:"A-get_sub_users_status-T",A_GET_SUB_USERS_STATUS_R:"A-get_sub_users_status-R",A_GET_SUB_USERS_ONLINE_STATUS_T:"A-get_sub_users_online_status-T",A_GET_SUB_USERS_ONLINE_STATUS_R:"A-get_sub_users_online_status-R",A_SAVE_EDITED_MSG_DRAFT_T:"A-save_edited_msg_draft-T",A_SAVE_EDITED_MSG_DRAFT_R:"A-save_edited_msg_draft-R",A_GET_EDITED_MSG_DRAFT_T:"A-get_edited_msg_draft-T",A_GET_EDITED_MSG_DRAFT_R:"A-get_edited_msg_draft-R",A_CLEAR_EDITED_MSG_DRAFT_T:"A-clear_edited_msg_draft-T",A_CLEAR_EDITED_MSG_DRAFT_R:"A-clear_edited_msg_draft-R",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T:"A-get_unread_mention_me_conversation_list-T",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R:"A-get_unread_mention_me_conversation_list-R",A_GET_USER_PROFILES_T:"A-get_user_profiles-T",A_GET_USER_PROFILES_R:"A-get_user_profiles-R",A_ADD_TO_BLACKLIST_T:"A-add_to_blacklist-T",A_ADD_TO_BLACKLIST_R:"A-add_to_blacklist-R",A_REMOVE_FROM_BLACKLIST_T:"A-remove_from_blacklist-T",A_REMOVE_FROM_BLACKLIST_R:"A-remove_from_blacklist-R",A_GET_BLACKLIST_T:"A-get_blacklist-T",A_GET_BLACKLIST_R:"A-get_blacklist-R",A_GET_BLACKLIST_STATUS_T:"A-get_blacklist_status-T",A_GET_BLACKLIST_STATUS_R:"A-get_blacklist_status-R",A_E_SET_MSG_RECEIVED_STATUS_T:"A-e_set_msg_received_status-T",A_E_SET_MSG_RECEIVED_STATUS_R:"A-e_set_msg_received_status-R",A_E_SET_MSG_SENT_STATUS_T:"A-e_set_msg_sent_status-T",A_E_SET_MSG_SENT_STATUS_R:"A-e_set_msg_sent_status-R",A_E_SET_CHECK_DUPLICATE_MSG_T:"A-e_set_check_duplicate_msg-T",A_E_SET_CHECK_DUPLICATE_MSG_R:"A-e_set_check_duplicate_msg-R",A_SET_PROXY_T:"A-set_proxy-T",A_SET_PROXY_R:"A-set_proxy-R",A_GET_PROXY_T:"A-get_proxy-T",A_GET_PROXY_R:"A-get_proxy-R",A_TEST_PROXY_T:"A-test_proxy-T",A_TEST_PROXY_R:"A-test_proxy-R",A_CLEAR_UNREAD_COUNT_BY_TIME_T:"A-clear_unread_count_by_time-T",A_CLEAR_UNREAD_COUNT_BY_TIME_R:"A-clear_unread_count_by_time-R",A_GET_MSG_READER_T:"A-get_msg_reader-T",A_GET_MSG_READER_R:"A-get_msg_reader-R",A_SEND_READ_RECEIPT_V4_T:"A-send_read_receipt_v4-T",A_SEND_READ_RECEIPT_V4_R:"A-send_read_receipt_v4-R",A_GET_READ_RECEIPT_V4_T:"A-get_read_receipt_V4-T",A_GET_READ_RECEIPT_V4_R:"A-get_read_receipt_V4-R",A_BATCH_GET_READ_RECEIPT_INFO_V4_T:"A-batch_get_read_receipt_info_V4-T",A_BATCH_GET_READ_RECEIPT_INFO_V4_R:"A-batch_get_read_receipt_info_V4-R",A_GET_ALL_ROBOTS_T:"A-get_all_robots-T",A_GET_ALL_ROBOTS_R:"A-get_all_robots-R",A_GET_ROBOT_BY_ID_T:"A-get_robot_by_id-T",A_GET_ROBOT_BY_ID_R:"A-get_robot_by_id-R",A_ADD_FRIEND_T:"A-add_friend-T",A_ADD_FRIEND_R:"A-add_friend-R",A_DELETE_FRIENDS_T:"A-delete_friends-T",A_DELETE_FRIENDS_R:"A-delete_friends-R",A_ACCEPT_FRIEND_REQUEST_T:"A-accept_friend_request-T",A_ACCEPT_FRIEND_REQUEST_R:"A-accept_friend_request-R",A_REFUSE_FRIEND_REQUEST_T:"A-refuse_friend_request-T",A_REFUSE_FRIEND_REQUEST_R:"A-refuse_friend_request-R",A_SET_FRIEND_INFO_T:"A-set_friend_info-T",A_SET_FRIEND_INFO_R:"A-set_friend_info-R",A_CHECK_FRIENDS_T:"A-check_friends-T",A_CHECK_FRIENDS_R:"A-check_friends-R",A_GET_FRIENDS_T:"A-get_friends-T",A_GET_FRIENDS_R:"A-get_friends-R",A_GET_FRIEND_APPLICATIONS_T:"A-get_friend_applications-T",A_GET_FRIEND_APPLICATIONS_R:"A-get_friend_applications-R",A_GET_FRIENDS_INFO_T:"A-get_friends_info-T",A_GET_FRIENDS_INFO_R:"A-get_friends_info-R",A_SEARCH_FRIENDS_INFO_T:"A-search_friends_info-T",A_SEARCH_FRIENDS_INFO_R:"A-search_friends_info-R",A_SET_FRIEND_ADD_PERMISSION_T:"A-set_friend_add_permission-T",A_SET_FRIEND_ADD_PERMISSION_R:"A-set_friend_add_permission-R",A_GET_FRIEND_ADD_PERMISSION_T:"A-get_friend_add_permission-T",A_GET_FRIEND_ADD_PERMISSION_R:"A-get_friend_add_permission-R",A_CREATE_GROUP_T:"A-create_group-T",A_CREATE_GROUP_R:"A-create_group-R",A_UPDATE_GROUP_INFO_T:"A-update_group_info-T",A_UPDATE_GROUP_INFO_R:"A-update_group_info-R",A_GET_GROUPS_INFO_T:"A-get_groups_info-T",A_GET_GROUPS_INFO_R:"A-get_groups_info-R",A_KICK_GROUP_MEMBERS_T:"A-kick_group_members-T",A_KICK_GROUP_MEMBERS_R:"A-kick_group_members-R",A_QUIT_GROUP_T:"A-quit_group-T",A_QUIT_GROUP_R:"A-quit_group-R",A_DISMISS_GROUP_T:"A-dismiss_group-T",A_DISMISS_GROUP_R:"A-dismiss_group-R",A_TRANSFER_GROUP_OWNER_T:"A-transfer_group_owner-T",A_TRANSFER_GROUP_OWNER_R:"A-transfer_group_owner-R",A_ADD_GROUP_MANAGERS_T:"A-add_group_managers-T",A_ADD_GROUP_MANAGERS_R:"A-add_group_managers-R",A_REMOVE_GROUP_MANAGERS_T:"A-remove_group_managers-T",A_REMOVE_GROUP_MANAGERS_R:"A-remove_group_managers-R",A_GET_GROUP_MEMBERS_T:"A-get_group_members-T",A_GET_GROUP_MEMBERS_R:"A-get_group_members-R",A_SET_GROUP_MEMBER_INFO_T:"A-set_group_member_info-T",A_SET_GROUP_MEMBER_INFO_R:"A-set_group_member_info-R",A_SEARCH_GROUP_MEMBERS_T:"A-search_group_members-T",A_SEARCH_GROUP_MEMBERS_R:"A-search_group_members-R",A_JOIN_GROUP_T:"A-join_group-T",A_JOIN_GROUP_R:"A-join_group-R",A_INVITE_USERS_TO_GROUP_T:"A-invite_users_to_group-T",A_INVITE_USERS_TO_GROUP_R:"A-invite_users_to_group-R",A_ADD_GROUP_FOLLOWS_T:"A-add_group_follows-T",A_ADD_GROUP_FOLLOWS_R:"A-add_group_follows-R",A_REMOVE_GROUP_FOLLOWS_T:"A-remove_group_follows-T",A_REMOVE_GROUP_FOLLOWS_R:"A-remove_group_follows-R",A_GET_GROUP_FOLLOWS_T:"A-get_group_follows-T",A_GET_GROUP_FOLLOWS_R:"A-get_group_follows-R",A_SET_GROUP_REMARK_T:"A-set_group_remark-T",A_SET_GROUP_REMARK_R:"A-set_group_remark-R",A_GET_GROUP_MEMBERS_BY_ROLE_T:"A-get_group_members_by_role-T",A_GET_GROUP_MEMBERS_BY_ROLE_R:"A-get_group_members_by_role-R",A_ACCEPT_GROUP_INVITE_T:"A-accept_group_invite-T",A_ACCEPT_GROUP_INVITE_R:"A-accept_group_invite-R",A_REFUSE_GROUP_INVITE_T:"A-refuse_group_invite-T",A_REFUSE_GROUP_INVITE_R:"A-refuse_group_invite-R",A_ACCEPT_GROUP_APPLICATION_T:"A-accept_group_application-T",A_ACCEPT_GROUP_APPLICATION_R:"A-accept_group_application-R",A_REFUSE_GROUP_APPLICATION_T:"A-refuse_group_application-T",A_REFUSE_GROUP_APPLICATION_R:"A-refuse_group_application-R",A_GET_GROUP_APPLICATIONS_T:"A-get_group_applications-T",A_GET_GROUP_APPLICATIONS_R:"A-get_group_applications-R",A_GET_JOINED_GROUPS_BY_ROLES_T:"A-get_joined_groups_by_roles-T",A_GET_JOINED_GROUPS_BY_ROLES_R:"A-get_joined_groups_by_roles-R",A_SEARCH_JOINED_GROUPS_T:"A-search_joined_groups-T",A_SEARCH_JOINED_GROUPS_R:"A-search_joined_groups-R",A_GET_JOINED_GROUPS_T:"A-get_joined_groups-T",A_GET_JOINED_GROUPS_R:"A-get_joined_groups-R",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T:"A-search_user_profile_by_unique_id-T",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R:"A-search_user_profile_by_unique_id-R",A_UPDATE_MY_USER_PROFILE_VISIBILITY_T:"A-update_my_user_profile_visibility-T",A_UPDATE_MY_USER_PROFILE_VISIBILITY_R:"A-update_my_user_profile_visibility-R",A_GET_MY_USER_PROFILE_VISIBILITY_T:"A-get_my_user_profile_visibility-T",A_GET_MY_USER_PROFILE_VISIBILITY_R:"A-get_my_user_profile_visibility-R",A_SUBSCRIBE_USER_STATUS_T:"A-subscribe_user_status-T",A_SUBSCRIBE_USER_STATUS_R:"A-subscribe_user_status-R",A_UNSUBSCRIBE_USER_STATUS_T:"A-unsubscribe_user_status-T",A_UNSUBSCRIBE_USER_STATUS_R:"A-unsubscribe_user_status-R",A_GET_SUBSCRIBE_USER_STATUS_LIST_T:"A-get_subscribe_user_status_list-T",A_GET_SUBSCRIBE_USER_STATUS_LIST_R:"A-get_subscribe_user_status_list-R",A_GET_MY_USER_PROFILE_T:"A-get_my_user_profile-T",A_GET_MY_USER_PROFILE_R:"A-get_my_user_profile-R",A_UPDATE_MY_USER_PROFILE_T:"A-update_my_user_profile-T",A_UPDATE_MY_USER_PROFILE_R:"A-update_my_user_profile-R",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T:"A-get_conversations_including_robots-T",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R:"A-get_conversations_including_robots-R"};!function(e){e[e.BOTH=2]="BOTH"}(_||(_={})),function(e){e[e.BOTH=2]="BOTH"}(f||(f={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(h||(h={})),function(e){e[e.NONE=0]="NONE",e[e.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",e[e.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",e[e.BOTH_WAY=3]="BOTH_WAY"}(g||(g={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(p||(p={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(E||(E={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(b||(b={})),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"}(T||(T={})),function(e){e[e.OWNER_VERIFY=0]="OWNER_VERIFY",e[e.FREE=1]="FREE",e[e.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(v||(v={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(R||(R={})),function(e){e[e.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",e[e.OWNER_OR_SELF=1]="OWNER_OR_SELF",e[e.SELF=2]="SELF"}(I||(I={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(m||(m={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(y||(y={})),function(e){e[e.CREATE=0]="CREATE",e[e.JOIN=1]="JOIN",e[e.KICK=2]="KICK",e[e.QUIT=3]="QUIT",e[e.DISMISS=4]="DISMISS",e[e.ADD_MANAGER=5]="ADD_MANAGER",e[e.REMOVE_MANAGER=6]="REMOVE_MANAGER",e[e.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER"}(A||(A={})),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={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(O||(O={})),function(e){e[e.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",e[e.MANAGER_REFUSED=1]="MANAGER_REFUSED",e[e.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",e[e.INVITEE_REFUSED=3]="INVITEE_REFUSED",e[e.JOINED=4]="JOINED",e[e.EXPIRED=5]="EXPIRED"}(N||(N={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(C||(C={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(P||(P={})),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"}(L||(L={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(w||(w={})),function(e){e[e.APPLICATION_SENT=0]="APPLICATION_SENT",e[e.INVITATION_SENT=1]="INVITATION_SENT",e[e.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",e[e.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED"}(M||(M={})),function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(U||(U={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(D||(D={})),function(e){e[e.LeaveOnMyOwn=0]="LeaveOnMyOwn",e[e.OtherDeviceLogin=1]="OtherDeviceLogin"}(G||(G={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(V||(V={})),function(e){e[e.UnmuteUsers=0]="UnmuteUsers",e[e.MuteUsers=1]="MuteUsers",e[e.UnmuteAll=2]="UnmuteAll",e[e.MuteAll=3]="MuteAll",e[e.RemoveWhitelist=4]="RemoveWhitelist",e[e.AddWhitelist=5]="AddWhitelist",e[e.UnmuteGloble=6]="UnmuteGloble",e[e.MuteGloble=7]="MuteGloble"}(j||(j={})),function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(k||(k={})),function(e){e[e.SUCCESS=0]="SUCCESS",e[e.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.NOT_IN_WHITELIST=407]="NOT_IN_WHITELIST",e[e.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",e[e.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",e[e.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",e[e.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",e[e.MESSAGE_OVER_MODIFY_TIME_FAIL=20114]="MESSAGE_OVER_MODIFY_TIME_FAIL",e[e.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",e[e.MESSAGE_UNSUPPORTED_MODIFY=20116]="MESSAGE_UNSUPPORTED_MODIFY",e[e.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",e[e.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",e[e.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",e[e.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",e[e.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",e[e.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",e[e.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",e[e.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",e[e.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",e[e.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",e[e.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",e[e.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",e[e.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",e[e.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",e[e.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",e[e.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",e[e.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",e[e.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",e[e.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",e[e.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",e[e.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",e[e.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",e[e.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",e[e.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",e[e.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",e[e.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",e[e.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",e[e.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",e[e.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",e[e.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",e[e.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",e[e.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",e[e.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",e[e.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",e[e.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",e[e.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",e[e.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",e[e.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",e[e.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",e[e.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",e[e.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",e[e.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",e[e.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",e[e.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",e[e.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",e[e.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",e[e.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",e[e.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",e[e.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",e[e.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",e[e.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",e[e.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",e[e.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",e[e.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",e[e.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",e[e.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",e[e.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",e[e.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",e[e.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",e[e.RC_FRIEND_NOT_SUPPORT_ROBOT=25474]="RC_FRIEND_NOT_SUPPORT_ROBOT",e[e.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",e[e.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",e[e.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",e[e.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",e[e.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",e[e.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",e[e.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",e[e.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",e[e.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",e[e.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",e[e.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",e[e.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",e[e.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",e[e.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",e[e.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",e[e.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",e[e.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",e[e.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",e[e.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",e[e.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",e[e.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",e[e.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",e[e.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",e[e.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",e[e.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",e[e.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",e[e.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",e[e.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",e[e.TRANS_FAILED=28401]="TRANS_FAILED",e[e.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",e[e.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",e[e.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",e[e.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",e[e.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",e[e.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",e[e.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",e[e.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",e[e.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",e[e.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",e[e.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",e[e.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",e[e.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",e[e.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",e[e.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",e[e.RC_TCP_RESET=32054]="RC_TCP_RESET",e[e.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",e[e.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.METHOD_BUSY=33103]="METHOD_BUSY",e[e.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",e[e.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",e[e.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",e[e.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",e[e.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.UPLOAD_FAIL=34011]="UPLOAD_FAIL",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",e[e.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",e[e.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",e[e.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",e[e.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",e[e.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",e[e.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",e[e.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",e[e.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",e[e.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",e[e.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",e[e.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",e[e.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",e[e.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",e[e.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",e[e.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",e[e.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",e[e.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",e[e.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",e[e.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",e[e.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",e[e.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",e[e.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",e[e.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",e[e.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",e[e.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",e[e.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",e[e.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",e[e.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",e[e.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",e[e.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",e[e.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",e[e.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",e[e.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",e[e.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",e[e.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",e[e.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",e[e.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",e[e.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",e[e.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",e[e.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",e[e.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",e[e.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",e[e.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",e[e.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",e[e.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",e[e.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",e[e.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",e[e.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",e[e.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",e[e.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",e[e.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",e[e.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",e[e.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",e[e.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",e[e.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",e[e.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",e[e.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",e[e.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",e[e.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",e[e.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",e[e.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",e[e.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",e[e.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",e[e.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",e[e.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",e[e.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",e[e.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",e[e.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",e[e.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",e[e.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",e[e.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",e[e.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",e[e.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",e[e.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",e[e.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",e[e.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",e[e.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",e[e.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",e[e.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",e[e.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",e[e.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",e[e.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",e[e.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",e[e.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",e[e.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",e[e.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",e[e.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",e[e.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",e[e.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",e[e.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",e[e.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",e[e.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",e[e.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",e[e.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",e[e.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",e[e.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.NOT_SUPPORT=35004]="NOT_SUPPORT",e[e.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",e[e.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",e[e.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",e[e.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",e[e.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",e[e.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",e[e.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",e[e.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",e[e.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",e[e.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",e[e.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",e[e.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",e[e.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",e[e.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",e[e.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",e[e.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",e[e.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",e[e.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",e[e.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",e[e.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",e[e.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",e[e.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",e[e.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",e[e.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",e[e.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",e[e.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",e[e.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",e[e.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",e[e.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",e[e.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",e[e.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",e[e.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",e[e.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",e[e.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",e[e.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",e[e.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",e[e.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",e[e.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",e[e.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",e[e.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",e[e.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",e[e.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",e[e.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",e[e.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",e[e.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",e[e.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",e[e.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.TIMEOUT=-1]="TIMEOUT"}(x||(x={})),function(e){e[e.NONE=0]="NONE",e[e.PRIVATE=1]="PRIVATE",e[e.DISCUSSION=2]="DISCUSSION",e[e.GROUP=3]="GROUP",e[e.CHATROOM=4]="CHATROOM",e[e.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",e[e.SYSTEM=6]="SYSTEM",e[e.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",e[e.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",e[e.ULTRA_GROUP=10]="ULTRA_GROUP",e[e.RTC_ROOM=12]="RTC_ROOM"}(F||(F={}));var H,q,Y,W=0,K=1,J=2,Q=3,X=4,Z=5,z=6,$=7,ee=function(e){var t=[F.PRIVATE,F.GROUP,F.SYSTEM,F.PUBLIC_SERVICE,F.APP_PUBLIC_SERVICE];switch(e){case W:return t;case K:return[F.PRIVATE,F.GROUP];case J:return l(l([],u(t),!1),[F.ULTRA_GROUP],!1);case Q:return l(l([],u(t),!1),[F.ULTRA_GROUP,F.CHATROOM],!1);case X:return l(l([],u(t),!1),[F.ULTRA_GROUP,F.CHATROOM,F.RTC_ROOM,F.CUSTOMER_SERVICE,F.DISCUSSION],!1);case Z:return[F.PRIVATE,F.GROUP,F.ULTRA_GROUP];case z:return[F.GROUP];case $:return[F.PRIVATE]}},te=function(e,t){return ee(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"}(H||(H={})),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"}(q||(q={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(Y||(Y={}));var ne,re,ie,oe,ae,se,ue,le,ce,de,_e,fe,he,ge,pe,Ee,be,Te,ve,Re,Ie,me={TextMessage:"RC:TxtMsg",TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL:"RC:RcCmd",RECALL_MESSAGE_TYPE:"RC:RcCmd",RECALL_NOTIFICATION_MESSAGE:"RC:RcNtf",READ_RECEIPT:"RC:ReadNtf",READ_RECEIPT_REQUEST:"RC:RRReqMsg",READ_RECEIPT_RESPONSE:"RC:RRRspMsg",SYNC_READ_STATUS:"RC:SRSMsg",GROUP_READ_RECEIPT_REQUEST:"RC:RRMsg",READ_STATE:"RC:RSMsg",DELIVERED:"RC:Delivered",DELIVERED_MSG:"RC:DRMsg",CHATROOM_MERGE_CHANGE:"RC:ChrmMemChange",CHATROOM_SYNC_MSG:"RC:ChrmSyncMsg",CHATROOM_MERGE_BLOCK:"RC:ChrmBlockMsg",CHATROOM_MERGE_BAN:"RC:ChrmBanMsg",TYPING_STATUS:"RC:TypSts",INTERCEPT:"RC:InterceptMsg",CLOUD_CONTROL:"RC:CCConfigChangeRequestMsg",STREAM_MESSAGE:"RC:StreamMsg"};!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(ne||(ne={})),function(e){e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(re||(re={})),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"}(ie||(ie={})),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"}(oe||(oe={})),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"}(ae||(ae={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(se||(se={})),function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(ue||(ue={})),function(e){e[e.typing=0]="typing"}(le||(le={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(ce||(ce={})),function(e){e[e.Other=0]="Other",e[e.iOS=1]="iOS",e[e.Android=2]="Android",e[e.Web=3]="Web",e[e.PC=4]="PC",e[e.Mini=5]="Mini",e[e.HarmonyOS=6]="HarmonyOS"}(de||(de={})),function(e){e[e.ONLINE_STATUS=1]="ONLINE_STATUS",e[e.USER_PROFILE=2]="USER_PROFILE",e[e.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",e[e.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE"}(_e||(_e={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(fe||(fe={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(he||(he={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(ge||(ge={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(pe||(pe={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(Ee||(Ee={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(be||(be={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(Te||(Te={})),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"}(ve||(ve={})),function(e){e[e.ALL_MESSAGE=-1]="ALL_MESSAGE",e[e.NOT_SET=0]="NOT_SET",e[e.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",e[e.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",e[e.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",e[e.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION"}(Re||(Re={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(Ie||(Ie={}));var ye,Ae,Se,Oe,Ne,Ce,Pe,Le,we,Me=function(e){return e===Ie.OPEN?Re.AT_MESSAGE_NOTIFICATION:Re.NOT_SET},Ue=function(e){return e<=Re.NOT_SET?Ie.CLOSE:Ie.OPEN};!function(e){e[e.READ=1]="READ",e[e.LISTENED=2]="LISTENED",e[e.DOWNLOADED=4]="DOWNLOADED",e[e.RETRIEVED=8]="RETRIEVED",e[e.UNREAD=0]="UNREAD"}(ye||(ye={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(Ae||(Ae={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(Se||(Se={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Oe||(Oe={})),function(e){e[e.CURRENT=2]="CURRENT"}(Ne||(Ne={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Ce||(Ce={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Pe||(Pe={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(Le||(Le={})),function(e){e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED"}(we||(we={}));var De,Ge,Ve={ALL:0,EXCLUDE_ROBOT:1,ROBOT_ONLY:2},je={DISALLOW:0,ALLOW:1},ke={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},xe={NORMAL:0,ROBOT:1},Fe={UNKNOWN:-1,V1:0,V2:1,V4:3,V5:4};!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"}(De||(De={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(Ge||(Ge={}));var Be=72e5,He=6e4,qe=131072,Ye="5.32.0".replace(/-.+$/,""),We=5368709120,Ke=10485760,Je="rongcloudsystem",Qe=864e5,Xe=function(e){return"navi_".concat(e)},Ze=function(e,t){return"RC-con-s-ver-".concat(e,"-").concat(t)},ze=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},$e=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},et=function(e,t){return"RC-con-type-settings-".concat(e,"-").concat(t)},nt=function(e,t){return"outbox_".concat(e,"_").concat(t)},rt=function(e,t){return"inbox_".concat(e,"_").concat(t)},it=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},ot=function(e,t){return"send_msg_".concat(e,"_").concat(t)},at=function(e,t){return"RC-us-".concat(e,"-").concat(t)},st=function(e){return"rc-static-config-".concat(e)},ut=function(e){return"RC-cc-".concat(e)},lt=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},ct=function(e){return"RC-LI-".concat(e)},dt=Math.pow(2,31)-1,_t="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};_t.engine="5.32.0";var ft=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)&&(_t[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 n=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return _t.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=n}}),Object.defineProperty(e,"getInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _t}}),e}();var ht={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,n=Date.now(),r=n.toString(36),i=Math.floor(Math.random()*n).toString(36),o=e-r.length-i.length;return[i,r,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},gt=ht.genWithLen(22),pt=Date.now(),Et=function(e){return"string"==typeof e},bt=function(e){return"boolean"==typeof e},Tt=function(e){return"number"==typeof e&&!Number.isNaN(e)},vt=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},Rt=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},It=function(e){return function(t){return Et(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))}},mt=function(e){return Et(e)&&e.length>0},yt=function(e){return Rt(e)&&e.length>0},At=function(e){return"[object Object]"===Object.prototype.toString.call(e)},St=function(e){return"function"==typeof e},Ot=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Nt=function(e){return Et(e)&&/https?:\/\//.test(e)},Ct=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},Pt=function(e){return Tt(e)&&Object.prototype.hasOwnProperty.call(F,e)},Lt=function(e){return Tt(e)&&Object.prototype.hasOwnProperty.call(Re,e)},wt=function(e){var t=!1;return Et(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},Mt=function(e){return Object.values(e.type).includes(e.value)},Ut=function(e){return It({minLength:1,maxLength:64})(e)},Dt=function(e){return It({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},Gt=function(e){return Tt(e)&&Object.prototype.hasOwnProperty.call(q,e)},Vt=function(){return"undefined"!=typeof RCCppEngine},jt=function(e){return{isRead:(e&ye.READ)===ye.READ,isListened:(e&ye.LISTENED)===ye.LISTENED,isDownload:(e&ye.DOWNLOADED)===ye.DOWNLOADED,isRetrieved:(e&ye.RETRIEVED)===ye.RETRIEVED}},kt=function(e){var t=ye.UNREAD;return(null==e?void 0:e.isRead)&&(t|=ye.READ),(null==e?void 0:e.isListened)&&(t|=ye.LISTENED),(null==e?void 0:e.isDownload)&&(t|=ye.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=ye.RETRIEVED),t},xt=function(e){return[de.iOS,de.Android,de.Web,de.PC,de.Mini,de.HarmonyOS].map((function(t){var n=e.findIndex((function(e){return e.platform===t}));return-1===n?{platform:t,changeTime:0,eventValue:0}:e[n]}))},Ft=function(e,t,n){var r=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 r.userId=e,n.forEach((function(e){r.extraProfile=r.extraProfile||{},r.extraProfile[e.key]=e.value})),r},Bt=function(e,t,n){return t?1===n?H.TLS:H.RMTP:"http"===e?H.WS:H.WSS},Ht=function(e,t){var n=e.server,r=e.backupServer,i=e.bs,o=e.serverAddr,a=e.protocol,s=e.openTLS;if(o)return l([],u(o.filter((function(e){return e.addr}))),!1);var c=[],d=[];return n&&d.push(n),(r||i||"").split(",").forEach((function(e){d.indexOf(e)<0&&d.push(e)})),d.forEach((function(e,r){e&&c.push({addr:e,protocol:Bt(a,t,s),weight:n.length-r,race:!1})})),l([],u(c),!1)},qt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Jt(e.settingProfile),n=e.extProfile||[],i=e.targetId,o=e.baseInfo,a=e.userInfo;return JSON.parse(JSON.stringify(r(r({groupId:i},Wt(t)),{extProfile:n.length>0?Jt(n):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:null==o?void 0:o.createTime,membersCount:null==o?void 0:o.memberCount,remark:null==a?void 0:a.remarkName})))}))},Yt=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},Wt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Yt(e.joinPerm),removeMemberPermission:Yt(e.removePerm),invitePermission:Yt(e.memInvitePerm),inviteHandlePermission:Yt(e.invitePerm),groupInfoEditPermission:Yt(e.profilePerm),memberInfoEditPermission:Yt(e.memProfilePerm)}))},Kt=function(e){return void 0===e&&(e=[]),e.map(Qt)},Jt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Qt=function(e){var t=e.userId,n=e.name,r=e.portraitUrl,i=e.ext||{},o=i.role,a=i.joinTime,s=i.channelNickName,u=i.additional,l=i.isBot;return{userId:t,name:n||"",portraitUri:r||"",nickname:s||"",extra:u||"",role:o||y.UNDEF,joinedTime:a||0,isRobot:!!l}},Xt=function(e){var t=e.joinUserInfo,n=e.inviterInfo,r=e.processInfo;return{groupId:e.targetId,joinMemberInfo:Qt(t),inviterInfo:n&&n.userId?Qt(n):void 0,operatorInfo:r&&r.userId?Qt(r):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},Zt=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},zt=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var n=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return n.length?[e,n.join("&")].join("?"):e};function $t(e){for(var t=null===window||void 0===window?void 0:window.atob(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n.buffer}var en,tn=function(e,t){var n=Math.floor(1e3*Math.random()%1e4),r=ht.gen(),i=function(e){e=e||"-";var t=new Date,n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate();return"".concat(n).concat(e).concat(r).concat(e).concat(i)}(),o=(new Date).getTime(),a="";if(t){var s=t.split(".");a=".".concat(s[s.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(n,"_").concat(o).concat(r).concat(a)},nn=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t={}),void 0===n&&(n={});var r=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,a=t.typeVivo,s=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,d=t.importanceHonor,_=t.imageUrlHonor,f=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.threadId,r=e.apnsCollapseId,i=e.category,o=e.richMediaUri,a=e.interruptionLevel,s=t.googleConfig,u={};u["thread-id"]=n||"",u["apns-collapse-id"]=r||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=a||"active";var l={};l.collapse_key=null==s?void 0:s.collapseKey,l.imageUrl=null==s?void 0:s.imageUrl;var c=null==s?void 0:s.priority;return c&&!["high","normal"].includes(c)&&(c="normal"),l.priority=c,{APNS:u,FCM:l}}(e,t),h=[{HW:{channelId:i||"",importance:s||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:r||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:a||"",category:c||""}},{APNS:f.APNS},{FCM:f.FCM},{HONOR:{importance:d||Te.NORMAL,image:_||""}},{OHOS:{category:n.category||null,image:n.image||""}}];return JSON.stringify(h)},rn=function(e,t){var n={},r={notificationId:t||""},i={};if(!e)return{iOSConfig:n,androidConfig:r,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,a,s,u,l,c,d,_,f,h,g,p=Object.keys(e);if(0!==p.length){var E=p[0];switch(E){case"HW":return r.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,r.importanceHW=null===(o=e[E])||void 0===o?void 0:o.importance,r.imageUrlHW=null===(a=e[E])||void 0===a?void 0:a.image,void(r.categoryHW=null===(s=e[E])||void 0===s?void 0:s.category);case"MI":return void(r.channelIdMi=null===(u=e[E])||void 0===u?void 0:u.channelId);case"OPPO":return void(r.channelIdOPPO=null===(l=e[E])||void 0===l?void 0:l.channelId);case"VIVO":return r.typeVivo=null===(c=e[E])||void 0===c?void 0:c.classification,void(r.categoryVivo=null===(d=e[E])||void 0===d?void 0:d.category);case"APNS":return n.threadId=e[E]["thread-id"],n.apnsCollapseId=e[E]["apns-collapse-id"],n.category=e[E].category,n.richMediaUri=e[E].richMediaUri,void(n.interruptionLevel=e[E]["interruption-level"]);case"FCM":return void(r.googleConfig={collapseKey:e[E].collapse_key||"",imageUrl:e[E].imageUrl||"",priority:e[E].priority||""});case"HONOR":return r.importanceHonor=null===(_=e[E])||void 0===_?void 0:_.importance,void(r.imageUrlHonor=null===(f=e[E])||void 0===f?void 0:f.image);case"OHOS":i.category=null===(h=e[E])||void 0===h?void 0:h.category,i.image=null===(g=e[E])||void 0===g?void 0:g.image}}}))}catch(e){}return{iOSConfig:n,androidConfig:r,harmonyOSConfig:i}},on=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),n=e.length;return t&&(n<=128&&n>=1)},an=function(e){var t=e.length;return t<=4096&&t>=1},sn=(en=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),n=e+en.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return en=2047&++en,parseInt(n,2)}),un=function(){var e=ft.getInfo(),t="electron";for(var n in e)"engine"!==n&&(t=["imlib-v2-adapter","imlib-next"].includes(n)?n:"electron");return t},ln=function(e,t,n){return o(void 0,void 0,void 0,(function(){var r,i;return a(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 r=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(n)},r,$t(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function cn(e,t){var n;if(!e)return"";var r="undefined"!=typeof window&&"https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol);return/^https?:\/\//.test(e)?r?e.replace(/^https?:\/\//i,"https://"):e:t!==H.HTTP||r?"https://".concat(e):"http://".concat(e)}var dn=function(e,t){if(!e)return"";var n=e.ossConfig,r=void 0===n?"":n,i="";try{var o=JSON.parse(r);if(o.length>0){var a=o.find((function(e){return e.minio}));a&&(i=a.minio)}}catch(e){t.warn(B.L_PARSE_JSON_E,JSON.stringify({ossConfig:r,error:e}))}return i};var _n,fn=function(e){function n(t){var n=e.call(this,t)||this;return n.name="RCError",n}return t(n,e),Object.defineProperty(n,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new n("Invalid parameter -> ".concat(e)):new n("Invalid parameters.")}}),Object.defineProperty(n,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new n("Wrong parameter type")}}),n}(Error),hn=function(){function e(){_n.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){d(this,_n,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return c(this,_n,"f")},enumerable:!1,configurable:!0}),e}();_n=new WeakMap;var gn=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,n,r,i){void 0===i&&(i=0);var o=Symbol(),a=this._map.get(e)||this._map.set(e,[]).get(e),s={symbol:o,priority:Math.min(i,100),listener:t.bind(r),once:n},u=a.findIndex((function(e){return e.priority>i}));return-1===u?a.push(s):a.splice(u,0,s),o}}),Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=0),this._addItem(e,t,!1,n,r)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=0),this._addItem(e,t,!0,n,r)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;try{for(var r=s(this._map),i=r.next();!i.done;i=r.next()){var o=u(i.value,2),a=(o[0],o[1]),l=a.findIndex((function(t){return t.symbol===e}));if(-1!==l)return void a.splice(l,1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map.get(e);if(r&&r.length>0)for(var i=new hn,o=0;o<r.length;o+=1){var a=r[o],s=a.once,c=a.listener;s&&r.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(n){return n.emit.apply(n,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}(),pn=function(e){function n(t){var n=e.call(this)||this;return Object.defineProperty(n,"_name",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(n,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(n,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(n,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(n,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),n}return t(n,e),Object.defineProperty(n.prototype,"length",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"setInitVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,(function(){return a(this,(function(n){return-1!==this._dataVersion||(this._dataVersion=e,t&&this._execPulling()),[2]}))}))}}),Object.defineProperty(n.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(n.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return this._pullingPromise?[2]:(this._pullingPromise=this._handleSyncData(this._dataVersion),[4,this._pullingPromise]);case 1:if(e=a.sent(),t=e.isOk,n=e.data,this._pullingPromise=null,!t)return[2];if(void 0===(null==n?void 0:n.version)||n.version<this._dataVersion)throw new Error("".concat(this._name,": version error, please check: lastVersion: ").concat(this._dataVersion,", newVersion: ").concat(null==n?void 0:n.version));return r=n.version,i=n.hasNext,o=this._versionQueue.filter((function(e){return e>r})),this._versionQueue=l([],u(o),!1),this._dataVersion=r,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[2,this._execPulling()]):[2]}}))}))}}),Object.defineProperty(n.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((function(){return n._execPulling()}),e))}}),Object.defineProperty(n.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(n.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}),n}(gn),En=function(){function e(e,t){var n=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){n._resolve=t,e(n._onResolve.bind(n))})),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}(),bn=function(){function e(e,t,n){Object.defineProperty(this,"isOk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"msg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isOk=0===e,this.code=e,this.msg=t,this.data=n}return Object.defineProperty(e,"from",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r){return new e(t,n||"fail: ".concat(t),r)}}),Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(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 a(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?Tn(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?Tn(void 0,this.msg):vn(this.code,this.msg)}}),e}(),Tn=function(e,t){return new bn(0,t||"success",e)},vn=function(e,t,n){return new bn(e,t||"fail: ".concat(e),n)},Rn=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,"isFailed",{get:function(){return!this._isValid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.isFailed&&(0===this._code||n)&&(this._code=e,this._errmsg=t||this._errmsg),this}}),Object.defineProperty(e.prototype,"setFailed",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isValid=!1,this.fail(e,t)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.isFailed&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this.isFailed?vn(this._code,this._errmsg):Tn()}}),Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isFailed||e(this),this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(void 0===r&&(r=!1),this.isFailed)return this;var i=r?n(t):null==t||n(t);return this._isValid=i,this.isFailed&&(this._errmsg="param '".concat(e,"' is invalid")),this}}),Object.defineProperty(e.prototype,"assert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(void 0===r&&(r=!1),this.isFailed)return this;if(this.validate(e,t,n,r),this.isFailed)throw fn.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(){return"string"==typeof t}),n)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return"string"==typeof t}),n)}}),Object.defineProperty(e.prototype,"isHttpUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.isNotEmptyString(e,t,n).validate(e,t,(function(e){return/^https?:\/\//.test(e)}))}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.isString(e,t,n).validate(e,t,(function(e){return e.trim().length>0}),n)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assertString(e,t,n),this.assert(e,t,(function(e){return e.trim().length>0}),n)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=n&&e.length<=r}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=n&&e.length<=r}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),n)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),n)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),n)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),n)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"isTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.isLimitedInteger(e,t,0,Number.MAX_SAFE_INTEGER,n)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===r&&(r=!1),void 0===i&&(i=1),this.isArray(e,t,r).validate(e,t,(function(e){return e.length>=i&&e.length<=n}),r)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===r&&(r=!1),void 0===i&&(i=1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.length>=i&&e.length<=n}),r)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.isArray(e,t,r).validate(e,t,(function(e){return e.every(n)}),r)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.every(n)}),r)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,n,i,o).validate(e,t,(function(e){return e.every(r)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,n,i,o),this.assert(e,t,(function(e){return e.every(r)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)}}),Object.defineProperty(e.prototype,"isStringEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.isString(e,t,r).validate(e,t,(function(e){return Object.values(n).includes(e)}),r)}}),Object.defineProperty(e.prototype,"isNumberEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.isNumber(e,t,r).validate(e,t,(function(e){return Object.values(n).includes(e)}),r)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return Object.values(n).includes(t)}),r)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"function"==typeof e}),n)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"function"==typeof e}),n)}}),e}(),In="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function mn(e){var t,n,r,i,o,a,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=In.indexOf(e.charAt(u++))<<2|(i=In.indexOf(e.charAt(u++)))>>4,n=(15&i)<<4|(o=In.indexOf(e.charAt(u++)))>>2,r=(3&o)<<6|(a=In.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==o&&(s+=String.fromCharCode(n)),64!==a&&(s+=String.fromCharCode(r));return s}var yn,An=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},Sn=1732584193,On=4023233417,Nn=2562383102,Cn=271733878,Pn=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],Ln=[3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745];function wn(e,t){return e<<t|e>>>32-t}function Mn(e,t,n){return e&n|t&~n}function Un(e,t,n){return e^t^n}function Dn(e,t,n){return t^(e|~n)}function Gn(e){for(var t=[],n=0;n<e.length;n+=4)t.push((e[n]||0)|(e[n+1]||0)<<8|(e[n+2]||0)<<16|(e[n+3]||0)<<24);return t}function Vn(e){var t=new Uint8Array(4);return t[0]=255&e,t[1]=e>>8&255,t[2]=e>>16&255,t[3]=e>>24&255,t}function jn(e){var t=8*e.length,n=e.length%64<56?56-e.length%64:120-e.length%64,r=new Uint8Array(e.length+n+8);r.set(e),r[e.length]=128;for(var i=1;i<n;i++)r[e.length+i]=0;var o=new Uint8Array(8),a=4294967295&t,s=4294967295&Math.floor(t/4294967296);o.set(Vn(a),0),o.set(Vn(s),4),r.set(o,e.length+n);var u,l=Sn,c=On,d=Nn,_=Cn;for(i=0;i<r.length;i+=64){for(var f=Gn(r.slice(i,i+64)),h=l,g=c,p=d,E=_,b=0;b<64;b++){var T=void 0,v=void 0;b<16?(T=(u=c)&d|~u&_,v=b):b<32?(T=Mn(c,d,_),v=(5*b+1)%16):b<48?(T=Un(c,d,_),v=(3*b+5)%16):(T=Dn(c,d,_),v=7*b%16);var R=_;_=d,d=c,c+=wn(l+T+Ln[b]+f[v]&4294967295,Pn[b]),l=R}l=l+h&4294967295,c=c+g&4294967295,d=d+p&4294967295,_=_+E&4294967295}var I=new Uint8Array(16);return I.set(Vn(l),0),I.set(Vn(c),4),I.set(Vn(d),8),I.set(Vn(_),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(I)}function kn(e){var t=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);var t=unescape(encodeURIComponent(e)).split("").map((function(e){return e.charCodeAt(0)}));return new Uint8Array(t)}(e);return jn(t)}function xn(e){var t=e.method||Ge.GET,n=e.timeout||He,r=e.headers,i=e.query,o=e.body,a=e.onProgress,s=zt(e.url,i),u=new XMLHttpRequest;if(u.open(t,s),r&&u.setRequestHeader)for(var l in r)u.setRequestHeader(l,r[l]);return function(e,t,n,r){return new En((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},r&&(e.upload.onprogress=function(e){return r(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(n)}),(function(t){e.abort(),t({status:-1})}))}(u,n,o,a)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(yn||(yn={}));var Fn,Bn,Hn=0,qn={DEFAULT:0,MODIFIED:1,RECALLED:2,DELETE:3},Yn={TranslationLanguage:0,AutoTranslateEnable:1};!function(e){e[e.BJ=1]="BJ",e[e.SG=2]="SG",e[e.NA=3]="NA",e[e.SG_A=4]="SG_A",e[e.SG_B=4]="SG_B",e[e.SA=5]="SA",e[e.OM=6]="OM"}(Bn||(Bn={}));var Wn=((Fn={})[Bn.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Fn[Bn.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Fn[Bn.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Fn[Bn.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Fn[Bn.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Fn[Bn.OM]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]},Fn);function Kn(e){return Bn[e]?e:Bn.BJ}var Jn,Qn=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 n,r=this.initOption||{},i=r.areaCode,o=r.navigators,a=(n=i,void 0===n&&(n=Bn.BJ),Wn[Kn(n)].naviUrlBase64).map((function(e){return mn(e)})),s=[],c=u(e.split("@"),2)[1];t&&(s=c?c.split(";"):[]);var d=o&&o.length>0?l(l([],u(s),!1),u(o),!1):l(l([],u(s),!1),u(a),!1);return d.filter((function(e,t){return d.indexOf(e)===t})).map((function(e){return cn(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,i=e||{},o=i.log,a=i.logPolicy,s=this.initOption||{},c=s.areaCode,d=s.logServerUrl,_=(n=c,void 0===n&&(n=Bn.BJ),Wn[Kn(n)].logUrlBase64).map((function(e){return r(r({},e),{addr:mn(e.addr)})})),f=[],h={level:1,itv:6,times:5};if(o)f.push.apply(f,l([],u(o.addrs),!1)),Object.assign(h,o.policy);else if(a)try{var g=JSON.parse(a);f.push({addr:g.url,protocol:H.HTTPS,weight:1}),h.level=g.level,h.itv=g.itv,h.times=g.times}catch(n){t.warn(B.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var p=d?l([{addr:d,protocol:H.HTTPS,weight:101}],u(f),!1):l(l([],u(f),!1),u(_),!1);return{policy:h,addrs:p.filter((function(e,t){return p.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return r(r({},e),{addr:cn(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,n=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=Bn.BJ),Wn[Kn(t)].miniCmpBase64).map((function(e){return mn(e)})),r=(this.initOption||{}).miniCMPProxy;return r&&r.length>0?r:n}}),Object.defineProperty(e.prototype,"getStaticConfigUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=Bn.BJ),Wn[Kn(t)].staticConfigUrlBase64).map((function(e){return mn(e)}))}}),Object.defineProperty(e.prototype,"getCloudControllerUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(n=r,void 0===n&&(n=Bn.BJ),Wn[Kn(n)].cloudControllerUrlBase64).map((function(e){return mn(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:Bn.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!Bn[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,n,r=e||{},i=r.active,o=r.activeServer,a=(null==i?void 0:i.addrs)||[],s=(n=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===n&&(n=Bn.BJ),Wn[Kn(n)].statsUrlBase64).map((function(e){return mn(e)})),c=[];return 0!==a.length?c.push.apply(c,l([],u(a.sort((function(e,t){return t.weight-e.weight})).map((function(e){return cn(e.addr,e.protocol)}))),!1)):o&&c.push(cn(o,H.HTTPS)),s.forEach((function(e){c.includes(e)||c.push(e)})),c}}),e}(),Xn=new Qn,Zn=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,n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:if(!(t=this.getCache()))return[3,6];a.label=1;case 1:return a.trys.push([1,4,,5]),n=JSON.parse(t),Date.now()-(null==n?void 0:n.time)<18e5?[4,this.decryptData(n.val)]:[3,3];case 2:return r=a.sent(),(i=r.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return cn(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=a.sent(),this.logger.error(B.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),a.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=a.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(u=a.sent())?void 0:u.areaCode)!==Xn.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),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 cn(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,n,r,i,o,c,d,_,f,h;return a(this,(function(a){switch(a.label){case 0:e=(e=l(l([],u(this.staticUrls),!1),u(Xn.getStaticConfigUrl()),!1).map((function(e){return cn(e)}))).filter((function(t,n){return e.indexOf(t)===n})),a.label=1;case 1:a.trys.push([1,6,7,8]),t=s(e),n=t.next(),a.label=2;case 2:return n.done?[3,5]:(r=n.value,this.logger.info(B.L_GET_STATIC_CONF_T,JSON.stringify({url:r})),i=Date.now(),[4,this.sendRequest("".concat(r,"/").concat(this.appkey))]);case 3:if(o=a.sent(),c=o.code,d=o.data,200===c)return this.logger.info(B.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:c,duration:Date.now()-i})),[2,d];this.logger.warn(B.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:c,duration:Date.now()-i})),a.label=4;case 4:return n=t.next(),[3,2];case 5:return[3,8];case 6:return _=a.sent(),f={error:_},[3,8];case 7:try{n&&!n.done&&(h=t.return)&&h.call(t)}finally{if(f)throw f.error}return[7];case 8:return[2]}}))}))}}),e}();!function(e){e[e.STATISTICS=-2]="STATISTICS",e[e.RECORD=-1]="RECORD",e[e.FATAL=0]="FATAL",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG"}(Jn||(Jn={}));var zn,$n,er=function(){function e(e,t,n,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:n}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:Jn.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Jn.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Jn.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Jn.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Jn.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Jn.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,n=e.level,r=e.content,i=e.traceId;/^[\w-]+$/.test(t)?n!==Jn.DEBUG&&this.logDB.write(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(r," | ").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 gt}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,n=e.tag,r=e.content,i=e.traceId,o=e.level,a=e.loggerId;if(console&&!(o<=Jn.FATAL||o>this.outputLevel)){var s=["error","warn","info","debug"][o-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=a?a:this._id,"][").concat((s||"stat").toUpperCase(),"]: ").concat(n," | ").concat(r," | ").concat(i);console[s||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[Jn.DEBUG,Jn.INFO,Jn.WARN,Jn.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,n,r){var i={time:Date.now(),level:e,tag:t,content:n,traceId:r,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,n,i,o,a){if(void 0===i&&(i={}),t.isOk){var s=null==o?void 0:o(t.data);this.info(e,JSON.stringify(r(r({isOk:!0},i),s)),n)}else{s=null==a?void 0:a(t.data);this.warn(e,JSON.stringify(r(r({code:t.code,msg:t.msg},i),s)),n)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),tr=function(){function e(e,t,n,r,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:n}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),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,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:i=[],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.logDB.read(e,t,n,r,s)];case 2:return o=a.sent(),Rt(o.logs)&&(i=o.logs.filter((function(e){return!(!e||"object"!=typeof e)}))),[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{logs:i}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(n=Xn.getLogUrlPolicyList(e,this.logger),r=n.policy,i=n.addrs,this.started=!0,this.itvByNavi=r.itv,this.timesByNavi=r.times,i.length>0&&this.realtimeReport(i[0].addr,r.level,r.itv,t)),[2])}))}))}}),Object.defineProperty(e.prototype,"_sendLogs2Realtime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,_,f,h;return a(this,(function(a){switch(a.label){case 0:return[4,this.compressLogs(e)];case 1:return i=a.sent(),o=i.success,s=i.data,o?(u=Nt(n)?n:"https://".concat(n),u+="?version=".concat("5.32.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:u,body:s,method:"POST"})]):[2,{isOk:!1,itv:r}];case 2:if(l=a.sent(),c=l.status,d=l.data,200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(r+=r),this.reportFailedNumber++,[2,{isOk:!1,itv:r}];if(this.reportFailedNumber=0,d)try{(h=JSON.parse(d)).nextTime&&(r=h.nextTime),_=h.level,f=h.logSwitch}catch(e){this.logger.warn(B.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:r,level:_,logSwitch:f}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,c,d,_,f,h,g,p,E=this;return a(this,(function(a){switch(a.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||pt,s=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),[4,this._getLogs(o,s,t,!0,c,r)];case 1:return 0!==(d=a.sent().logs).length?[3,2]:[3,4];case 2:return d.length>0?[4,this._sendLogs2Realtime(d,c,e,n)]:[3,4];case 3:_=a.sent(),f=_.itv,h=_.level,g=_.logSwitch,_.isOk&&(p=Math.max.apply(Math,l([],u(d.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(p+1),0===g&&(this.started=!1),void 0!==h&&(t=h)),n=f,a.label=4;case 4:return this.started&&(n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return E.realtimeReport(e,t,n,r)}),1e3*n)),[2]}}))}))}}),Object.defineProperty(e.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s,u){return void 0===u&&(u=!1),o(this,void 0,void 0,(function(){var o,l,c,d,_,f,h,g;return a(this,(function(a){switch(a.label){case 0:return"web"!==n.toLowerCase()||this.disableLogReport?[2]:(o=this.logger.createTraceId(),this.logger.info(B.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:s,isCloudControl:u}),o),[4,this._getLogs(e,t,Jn.DEBUG,!1,o)]);case 1:return l=a.sent().logs,this.logger.info(B.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),o),c=Nt(r)?r:"https://".concat(r),c+="?version=".concat("5.32.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),l.length>0?[4,this.compressLogs(l)]:[3,3];case 2:return _=a.sent(),f=_.success,h=_.data,d=f?h:"compress failed",[3,4];case 3:d="no data or no database",a.label=4;case 4:return this.logger.debug(B.L_REPORT_FULL_LOG_O,"compress done",o),u&&(c+="&source=cloud"),[4,this.send({url:c,body:d,method:"POST"})];case 5:return g=a.sent().status,this.logger.info(B.L_REPORT_FULL_LOG_R,JSON.stringify({status:g}),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}(),nr=function(e){var t=e.sessionId,n=e.level,r=e.loggerId,i=e.traceId,o=e.time,a=e.tag,s=e.type,u=e.content;Et(u)||(u=JSON.stringify(u));var l=n<0?u||"":JSON.stringify({content:u,traceId:i,from:r});return l='"'.concat(l.replace(/"/g,'""'),'"'),"".concat(t,",").concat(o,",").concat(s,",").concat(n,",").concat(a,",").concat(l,"\n")};function rr(e){try{return!(!e||"object"!=typeof e)&&("number"==typeof e.time&&("string"==typeof e.tag&&("string"==typeof e.sessionId&&("string"==typeof e.type&&"number"==typeof e.level))))}catch(e){return!1}}function ir(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{logs:[]}]}))}))}function or(){}var ar=function(){function e(e,t){zn.set(this,void 0),$n.set(this,void 0),d(this,zn,e,"f"),d(this,$n,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,c(this,zn,"f").call(this,e,t,n,r,i)];case 1:return(o=a.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(rr)}]:[2,{logs:[]}];case 2:return s=a.sent(),console.error("[LogDBProxy] read error",s),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{c(this,$n,"f").call(this,e)}catch(e){console.error("[LogDBProxy] write error",e)}}}),Object.defineProperty(e.prototype,"setLogReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&d(this,zn,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&d(this,$n,e,"f"),this}}),e}();function sr(){return new ar(ir,or)}zn=new WeakMap,$n=new WeakMap;var ur,lr=function(){function e(){}var t,n,r,i,o,a;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,t,"f",n)||(d(this,t,e,"f",n),e.info(B.L_EVENT_LOOP_BLOCKING_S,"start"),c(this,t,"m",a).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,t,"f",n)&&(c(this,t,"f",n).info(B.L_EVENT_LOOP_BLOCKING_S,"stop"),d(this,t,null,"f",n),c(this,t,"f",r)&&(clearTimeout(c(this,t,"f",r)),d(this,t,null,"f",r)))}}),t=e,a=function e(){var a=this,s=Date.now();d(this,t,setTimeout((function(){var r=Date.now()-s;r>=c(a,t,"f",o)&&c(a,t,"f",n).warn(B.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(r,"ms")),c(a,t,"m",e).call(a)}),c(this,t,"f",i)),"f",r)},n={value:null},r={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"}(ur||(ur={}));var cr=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,n,r,i,o=this;this.taskLock=!1;var a=null!==(t=e.startTime)&&void 0!==t?t:0,s=null!==(n=e.endTime)&&void 0!==n?n:0,u=null!==(r=e.platform)&&void 0!==r?r:"",l=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==l&&(this.logId=e.logId,this.reporter.report(a,s,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 dr,_r,fr,hr,gr=function(){function e(e,t,n){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:n}),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 cr(n)}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===me.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,Ct(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,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,_,f;return a(this,(function(a){switch(a.label){case 0:return!this.isEable&&t===ur.init&&this.isExire()?(this.logger.info(B.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===ur.newWorkChange&&this.isOverclock()?(this.logger.info(B.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(r=cn(e),this.lastRequestTime=(new Date).getTime(),i="".concat(r,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},n&&(o["RC-Token"]=n),s={platform:"web",version:"5.32.0",timestamp:this.timestamp},this.logger.record(ve.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!n,uri:i})),[4,this.httpRequest(i,Ge.POST,o,s)]);case 1:return u=a.sent(),l=u.code,c=u.data,this.logger.record(ve.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===x.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(d=c.targetRegion,this.changeAreaCode===d?[2,this.timestamp]:(_=Xn.setAreaCode(d),this.logger.info(B.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:_,originAreaCode:Xn.getAreaCode(),newAreaCode:d})),this.changeAreaCode=d,(f=Xn.getCloudControllerUrl(d))[0]?[2,this.request(f[0],ur.other)]:(this.logger.info(B.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}(),pr=function(e){return e===x.RC_CONN_REDIRECTED},Er=function(e){function n(t,n,r){var i=e.call(this)||this;return dr.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:n}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),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:""}),hr.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:De.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:ge.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(n,e),Object.defineProperty(n.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(n.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(n.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===ge.DISCONNECTED&&e===ge.CONNECTING&&(this._doConnectReason=Pe.CONNECT,c(this,dr,"m",fr).call(this)),this._crtConnectionStatus===ge.CONNECTED&&e===ge.SUSPENDED&&(t===x.RC_PING_EXCEED_LIMIT?this._doConnectReason=Pe.TIMEOUT:t===x.RC_CONN_REDIRECTED?this._doConnectReason=Pe.REDIRECTED:this._doConnectReason=Pe.RECONNECT),this._crtConnectionStatus===ge.CONNECTED){var n={bid:un(),cod:t,net:this.getNetwork().type,dur:Date.now()-c(this,hr,"f"),cid:this.cid};this.logger.record(ve.IM_CONNECTION_DURATION,JSON.stringify(n)),e===ge.SUSPENDED&&c(this,dr,"m",fr).call(this)}switch(this._crtConnectionStatus=e,e){case ge.CONNECTED:this.logger.info(B.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),c(this,dr,"m",_r).call(this).emit("onConnected",this._fromSuspend);break;case ge.CONNECTING:this.logger.warn(B.L_CONNECT_S,"status: ".concat(e)),c(this,dr,"m",_r).call(this).emit("onConnecting");break;case ge.SUSPENDED:this._fromSuspend=!0,this.logger.warn(B.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),pr(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,dr,"m",_r).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(B.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,dr,"m",_r).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(n.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(n.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===ge.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t){var n={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(ve.IM_NETWORK_CHANGE,JSON.stringify(n))}this._network=e}}),Object.defineProperty(n.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(n.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus===ge.CONNECTED?[2,Tn(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=n,this.token=e,this.setConnectionStatus(ge.CONNECTING),[4,this.try2Connect(e,t,!1,r,!0)]);case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?(this.setConnectionStatus(ge.DISCONNECTED,o),[2,vn(o)]):(this.setConnectionStatus(ge.CONNECTED),[2,Tn(s)])}}))}))}}),Object.defineProperty(n.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,n,r,i),[4,this._crtConnectionTask]);case 1:return o=a.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(n.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c,_,f,h,g,p;return a(this,(function(a){switch(a.label){case 0:return o={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(ve.IM_STATS_CS,JSON.stringify(o)),s={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,n,!1,r,s)];case 1:return u=a.sent(),l=u.code,c=u.data,l!==x.SUCCESS?[2,vn(l)]:1===(_=c).type?[2,vn(x.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(B.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,this._connectWithToken(e.replace(/@.+$/,"@"),_,t,r)]);case 2:return f=a.sent(),h=f.code,g=f.data,i||h===x.SUCCESS||(this.retryCount+=1),pr(h)?(this.logger.warn(B.L_CONNECT_R,"redirect code: ".concat(h),r),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,r,i)]):[x.RC_TCP_RESET,x.RC_CONN_ACK_TIMEOUT,x.RC_TCP_DISCONNECTED_NO_RMTP,x.CONNECTION_REFUSED].includes(h)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),p=this.cmpWeightCache.every((function(e){return e.failed})),i&&p?(this.logger.warn(B.L_CONNECT_R,"cpp code:".concat(h,",reture code:").concat(x.SERVER_UNAVAILABLE),r),[2,vn(x.SERVER_UNAVAILABLE)]):(this.logger.warn(B.L_CONNECT_R,"cmp ack timeout, code: ".concat(h),r),this.setConnectionStatus(ge.SUSPENDED,h),this.setConnectionStatus(ge.CONNECTING),[2,this.createConnectionTask(e,t,!1,r,i)])):h!==x.SUCCESS?(this.logger.warn(B.L_CONNECT_R,"code: ".concat(h),r),[2,vn(h)]):(this.logger.info(B.L_CONNECT_R,"userId: ".concat(g),r),d(this,hr,Date.now(),"f"),this._crtUserId=g,[2,Tn(g)])}}))}))}}),Object.defineProperty(n.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){return n=this.logger.createTraceId(),this.logger.debug(B.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),n),this.stopReconnectTimer(),r=function(){return o(i,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus!==ge.SUSPENDED?[2]:(this.setConnectionStatus(ge.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,n,!1)]);case 1:return i=a.sent(),o=i.code,s=i.isOk,this.reconnectTimer=null,s?(this.setConnectionStatus(ge.CONNECTED),[2]):[x.SERVER_UNAVAILABLE,x.TIMEOUT,x.RC_SOCKET_DISCONNECTED,x.RC_SOCKET_NOT_CREATED,x.RC_CONN_ACK_TIMEOUT,x.RC_TCP_RESET,x.RC_NAVI_REQ_FAILED,x.RC_NETWORK_DOWN,x.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==ge.CONNECTING||(this.setConnectionStatus(ge.SUSPENDED,o),this.reconnectTimer=setTimeout(r,5e3)),[2]):(this.setConnectionStatus(ge.DISCONNECTED,o),[2])}}))}))},r(),[2]}))}))}}),Object.defineProperty(n.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;return pr(e)?(this.setConnectionStatus(ge.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===x.RC_UDP_DISCONNECTED?(this.setConnectionStatus(ge.SUSPENDED,e),void setTimeout((function(){n.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(ge.DISCONNECTED,e)}}),Object.defineProperty(n.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(ge.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(n.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return this._crtConnectionStatus!==ge.CONNECTED?(this._failedCount=0,this.logger.debug(B.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(B.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=r.sent())===x.SUCCESS?(this.logger.debug(B.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return n.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==ge.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(B.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(B.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return r.sent(),this.setConnectionStatus(ge.SUSPENDED,x.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,x.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(n.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:n.sent(),n.label=2;case 2:return this.setConnectionStatus(ge.DISCONNECTED,x.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(n.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(n.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 n=Ht(e,t);return this.cmpWeightCache=l([],u(n),!1),l([],u(n),!1)}}),Object.defineProperty(n.prototype,"updateCmpWeight",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(this.cmpWeightCache){var r=this.cmpWeightCache.find((function(t){return n?t.addr===e&&t.protocol===H.QUIC:t.addr===e}));if(r)if(t){var i=Math.max.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==i&&(r.weight=i+1)}else{var o=Math.min.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==o&&(r.weight=o-1),r.failed=!0}}}}),Object.defineProperty(n.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(n.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){this.token=e,this._openCallPlus=n,this.onDisconenctUnusual(r)}}),n}(gn);hr=new WeakMap,dr=new WeakSet,_r=function(){return this},fr=function(){this.uuid=ht.gen(),this.retryCount=0};var br=function(e){return e.replace(/@.+$/,"@")},Tr=function(){function e(e,t,n,r,i,o){void 0===r&&(r=!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:n}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:r}),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,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,n,r,i),[4,this.crtRequest]);case 1:return o=a.sent(),this.crtRequest=null,[2,o]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){var s;return o(this,void 0,void 0,(function(){var o,u,l,c,d,_,f,h,g,p,E,b,T,v,R,I,m;return a(this,(function(a){switch(a.label){case 0:return o=br(e),u=this.getNaviCache(o),!t&&u&&(l=u.timestamp,c=u.naviInfo,n||Date.now()-l<Be)?(this.logger.info(B.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),r),i&&(d=i.uuid,_=i.retryCount,f=i.reason,h={bid:un(),ptc:Se.NAVI,cod:x.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(s=c.type)&&void 0!==s?s:0,hos:"",cache:Oe.LOCAL,v:Ne.CURRENT,rsn:f,cid:"".concat(d,"_").concat(_),count:_},this.logger.record(ve.IM_NAVI,JSON.stringify(h),r)),[2,Tn(c)]):(g=Xn.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(B.L_GET_NAVI_T,JSON.stringify({token:e,uris:g}),r),[4,this.requestHandler(g,e,r,i)]);case 1:return p=a.sent(),E=p.code,b=p.data,E===x.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(T=a.sent())?void 0:T.navi)&&(null==T?void 0:T.navi.length)>0?(v=T.navi,[4,this.requestHandler(v,e,r,i)]):[3,4];case 3:R=a.sent(),E=R.code,b=R.data,a.label=4;case 4:return E!==x.SUCCESS?(this.logger.warn(B.L_GET_NAVI_R,E,r),[2,vn(E)]):(I=b).code&&200!==I.code?(this.logger.warn(B.L_GET_NAVI_R,I.code,r),[2,vn(this.transHttpCode(I.code))]):Ht(I).length>0?(this.logger.info(B.L_GET_NAVI_R,JSON.stringify({naviInfo:I}),r),this.setNaviCache(o,I),[2,Tn(I)]):(m={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(B.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(m)),r),[2,vn(x.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,_,f;return a(this,(function(a){switch(a.label){case 0:i=0,o=e.length,a.label=1;case 1:return i<o?(s=i===e.length-1,u=this.useV2Navi()?this.httpRequestV2:this.httpRequest,l=Date.now(),[4,u.call(this,e[i],this.appkey,t,n,s)]):[3,4];case 2:if(c=a.sent(),d=c.code,_=c.data,f={bid:un(),ptc:Se.NAVI,cod:d,net:null==r?void 0:r.type,dur:Date.now()-l,spr:0,pr:(null==_?void 0:_.type)||0,hos:e[i],cache:Oe.REQUEST,v:Ne.CURRENT,rsn:null==r?void 0:r.reason,cid:"".concat(null==r?void 0:r.uuid,"_").concat(null==r?void 0:r.retryCount),count:null==r?void 0:r.retryCount},this.logger.record(ve.IM_NAVI,JSON.stringify(f),n),[x.SUCCESS,x.RC_CONN_TOKEN_INCORRECT,x.RC_LICENSE_EXPIRED].includes(d))return[2,d===x.SUCCESS?Tn(_):vn(d)];a.label=3;case 3:return i+=1,[3,1];case 4:return[2,vn(x.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 x.RC_CONN_TOKEN_INCORRECT;case 416:return x.RC_LICENSE_EXPIRED;default:return x.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(br(e));return t?t.naviInfo:null}}),Object.defineProperty(e.prototype,"updateVoipCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.getNaviInfoFromCache(e);n&&this.setNaviCache(br(e),r(r({},n),{voipCallInfo:t}))}}),Object.defineProperty(e.prototype,"getNaviV2RequestOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=e.uri,r=e.token,i=e.platform,o=e.protocol,a=e.mac;t="".concat(n,"/v2/navi.json?cloud=").concat(0);var s="token=".concat(encodeURIComponent(r),"&v=").concat(Ye,"&platfrom=").concat(i);return a&&(s+="&m=".concat(a)),{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:s,url:t,timeout:1e4}}}),Object.defineProperty(e.prototype,"useV2Navi",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),vr=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 Rr(e){return vr.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function Ir(e){return vr.has(e)}var mr,yr,Ar,Sr={MECHANICAL:0,INTELLIGENT:1},Or=function(){function e(e,t,n,r){Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sourceLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"targetLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.identifier=e,this.sourceLanguage=t||"auto",this.targetLanguage=n,this.text=r}return Object.defineProperty(e.prototype,"isValid",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"string"==typeof this.identifier&&this.identifier.length>0&&"string"==typeof this.sourceLanguage&&(void 0===this.targetLanguage||"string"==typeof this.targetLanguage)&&(e?"string"==typeof this.text:void 0===this.text||"string"==typeof this.text)}}),Object.defineProperty(e.prototype,"toInnerParam",{enumerable:!1,configurable:!0,writable:!0,value:function(){return{identifier:this.identifier,sourceLanguage:this.sourceLanguage,targetLanguage:this.targetLanguage,content:this.text}}}),e}(),Nr=function(e){function n(t,n,r,i){return e.call(this,t,n,r,i)||this}return t(n,e),n}(Or),Cr=function(e){function n(t,n,r){return e.call(this,kn(t),n,r,t)||this}return t(n,e),n}(Or),Pr={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},Lr={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2},wr=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,r=t.length;n<r;n++)if(!e[t[n]])return!1;return!0}(uni))},Mr=function(){function e(e){mr.add(this),yr.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(this,yr,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 a(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,c(this,mr,"m",Ar).call(this,e,c(this,yr,"f"))]}))}))}}),e}();yr=new WeakMap,mr=new WeakSet,Ar=function e(t,n){return o(this,void 0,void 0,(function(){var r,i,s,u=this;return a(this,(function(l){switch(l.label){case 0:return 0===t.length?[2,vn(x.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(r=t.shift(),i=cn(r.addr,r.protocol),i="".concat(i,"/v3/message/get_stream.json?sdkVersion=").concat("5.32.0","&platform=Websocket&messageUID=").concat(n.msgUId),this._logger.info(B.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(i)),[4,this._openHandler(i,n)]);case 1:return[2,(s=l.sent()).or((function(r){return o(u,void 0,void 0,(function(){return a(this,(function(i){return-1===r?[2,c(this,mr,"m",e).call(this,t,n)]:[2,s]}))}))}))]}}))}))};var Ur=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s=this;return a(this,(function(a){return n=An(),r=n.resolve,i=n.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){s._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),r(vn(-1,"timeout"))},o.onreadystatechange=function(n){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),a=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&a){r(Tn());var u=0;o.onprogress=function(e){var n=o.response.slice(u);u=o.response.length,t.onRawContent(n)},o.onerror=function(n){s._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(x.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);r(vn(e.code,e.message))}}},o.onerror=function(t){s._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),r(vn(-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]}))}))}}),n}(Mr),Dr=wr();var Gr=null,Vr=function(e){return o(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return[4,kr.getNetworkType()];case 1:return t=n.sent(),Gr({status:"online"===e.type,type:t}),[2]}}))}))};var jr,kr={tag:"browser",httpReq:function(e){return xn(e).result()},get localStorage(){return localStorage},get sessionStorage(){return sessionStorage},useNavi:!0,connectPlatform:"",isFromUniapp:Dr,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",Promise.resolve(Tn({id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,r=t.reason;e(n,r)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}))},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:De.UNKONWN},t=e.type,n=e.effectiveType,r=t||n||De.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){Gr=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",Vr),window.addEventListener("online",Vr))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",Vr),window.removeEventListener("online",Vr)),Gr=null},createSSEClient:function(e){return Tn(new Ur(e))},getApiVer:function(){var e=kr.runtimeInfo,t=e.type,n=e.version;return"|".concat(t,"|").concat(n)},get runtimeInfo(){var e,t,n=navigator.userAgent,r={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 r)if(r.hasOwnProperty(i)){var o=n.match(r[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.transLan=24]="transLan",e[e.autoTrans=25]="autoTrans",e[e.pullUS=26]="pullUS",e[e.sendMsgRead=27]="sendMsgRead",e[e.qryMsgRead=28]="qryMsgRead",e[e.qryMsgReadCntBatch=29]="qryMsgReadCntBatch",e[e.updRTime=30]="updRTime",e[e.qryRLBatch=31]="qryRLBatch",e[e.chatMsgS=32]="chatMsgS",e[e.qrySessionsAtt=33]="qrySessionsAtt",e[e.pullMsg=34]="pullMsg",e[e.qrySessions=35]="qrySessions",e[e.delSessions=36]="delSessions",e[e.delMsg=37]="delMsg",e[e.delUgMsg=38]="delUgMsg",e[e.delUgSe=39]="delUgSe",e[e.updRRTime=40]="updRRTime",e[e.qrySessionsUnread=41]="qrySessionsUnread",e[e.setTypeUnpush=42]="setTypeUnpush",e[e.chrmPull=43]="chrmPull",e[e.joinChrm=44]="joinChrm",e[e.joinChrmR=45]="joinChrmR",e[e.exitChrm=46]="exitChrm",e[e.queryChrmI=47]="queryChrmI",e[e.setKV=48]="setKV",e[e.delKV=49]="delKV",e[e.setKVS=50]="setKVS",e[e.delKVS=51]="delKVS",e[e.pullKV=52]="pullKV",e[e.qryRelation=53]="qryRelation",e[e.qryRelationR=54]="qryRelationR",e[e.qryRelationFilter=55]="qryRelationFilter",e[e.delRelation=56]="delRelation",e[e.delRelationBatch=57]="delRelationBatch",e[e.pullSeAtts=58]="pullSeAtts",e[e.setSeAtt=59]="setSeAtt",e[e.qnTkn=60]="qnTkn",e[e.qnUrl=61]="qnUrl",e[e.aliUrl=62]="aliUrl",e[e.s3Url=63]="s3Url",e[e.stcUrl=64]="stcUrl",e[e.minioUrl=65]="minioUrl",e[e.cleanPMsg=66]="cleanPMsg",e[e.cleanGMsg=67]="cleanGMsg",e[e.cleanCMsg=68]="cleanCMsg",e[e.cleanSMsg=69]="cleanSMsg",e[e.cleanMCMsg=70]="cleanMCMsg",e[e.cleanMPMsg=71]="cleanMPMsg",e[e.cleanMsgBatch=72]="cleanMsgBatch",e[e.rtcPing=73]="rtcPing",e[e.rtc_ntf=74]="rtc_ntf",e[e.rtcSetOutData=75]="rtcSetOutData",e[e.rtcQryUserOutData=76]="rtcQryUserOutData",e[e.addSeTag=77]="addSeTag",e[e.delSeTag=78]="delSeTag",e[e.addTag=79]="addTag",e[e.delTag=80]="delTag",e[e.reportsdk=81]="reportsdk",e[e.pullUgSes=82]="pullUgSes",e[e.pullUgMsg=83]="pullUgMsg",e[e.ugMsg=84]="ugMsg",e[e.qryUgMsg=85]="qryUgMsg",e[e.updUgRTime=86]="updUgRTime",e[e.upMsgEx=87]="upMsgEx",e[e.modifyMsg=88]="modifyMsg",e[e.qryMsgChange=89]="qryMsgChange",e[e.qryMsg=90]="qryMsg",e[e.operate=91]="operate",e[e.s_opNtf=92]="s_opNtf",e[e.ugUnpushQuery=93]="ugUnpushQuery",e[e.ugUnpushSet=94]="ugUnpushSet",e[e.setRtcRoomId=95]="setRtcRoomId",e[e.qryUgUal=96]="qryUgUal",e[e.updUserSub=97]="updUserSub",e[e.pullUserSub=98]="pullUserSub",e[e.pullSubData=99]="pullSubData",e[e.qrySubData=100]="qrySubData",e[e.pullUserProfile=101]="pullUserProfile",e[e.pullOwnProfile=102]="pullOwnProfile",e[e.updProfilePermiss=103]="updProfilePermiss",e[e.qProfilePermiss=104]="qProfilePermiss",e[e.searchUserProfile=105]="searchUserProfile",e[e.updUserProfile=106]="updUserProfile",e[e.pullEventChange=107]="pullEventChange",e[e.channelCreate=108]="channelCreate",e[e.upChannelInfo=109]="upChannelInfo",e[e.qChannelInfo=110]="qChannelInfo",e[e.channelMemKick=111]="channelMemKick",e[e.channelMemQuit=112]="channelMemQuit",e[e.channelDismiss=113]="channelDismiss",e[e.channelTransfer=114]="channelTransfer",e[e.upChannelManager=115]="upChannelManager",e[e.qChannelMem=116]="qChannelMem",e[e.qChannelSpeMem=117]="qChannelSpeMem",e[e.upChannelMem=118]="upChannelMem",e[e.channelMemJoin=119]="channelMemJoin",e[e.channelMemInvite=120]="channelMemInvite",e[e.channelApplyResp=121]="channelApplyResp",e[e.qChannelApplyList=122]="qChannelApplyList",e[e.qChannelMemJoin=123]="qChannelMemJoin",e[e.qChannelMemSpeJoin=124]="qChannelMemSpeJoin",e[e.upChannelRemark=125]="upChannelRemark",e[e.qChannelRemark=126]="qChannelRemark",e[e.upChannelFollow=127]="upChannelFollow",e[e.qChannelFollow=128]="qChannelFollow",e[e.qSimpleUserProfile=129]="qSimpleUserProfile",e[e.friendAdd=130]="friendAdd",e[e.friendDel=131]="friendDel",e[e.friendHandle=132]="friendHandle",e[e.friendSetPf=133]="friendSetPf",e[e.friendCheck=134]="friendCheck",e[e.friendsQuery=135]="friendsQuery",e[e.friendApplyDel=136]="friendApplyDel",e[e.friendsInfoQry=137]="friendsInfoQry",e[e.friendAuthSet=138]="friendAuthSet",e[e.friendAuthGet=139]="friendAuthGet",e[e.addUnpush=140]="addUnpush",e[e.qryUnpush=141]="qryUnpush",e[e.delUnpush=142]="delUnpush",e[e.s_pubCall=143]="s_pubCall",e[e.reqCall=144]="reqCall",e[e.pullKvMsg=145]="pullKvMsg",e[e.readReceipt=146]="readReceipt",e[e.qryReceipt=147]="qryReceipt",e[e.qryReceiptBatch=148]="qryReceiptBatch",e[e.upConvertMsg=149]="upConvertMsg",e[e.pullModifyMsg=150]="pullModifyMsg",e[e.qAppBot=151]="qAppBot",e[e.qBot=152]="qBot"}(jr||(jr={}));var xr=function(e){var t=jr[e];return t},Fr=function(e){return jr[e]},Br=0,Hr=1,qr=2,Yr=3,Wr=4,Kr=5,Jr=6,Qr=7,Xr=12,Zr=13,zr=14,$r=4,ei=3,ti="rtcRJoin_data",ni="rtcRExit",ri="rtcUPut",ii="rtcUDel",oi="rtcSetData",ai="userSetData",si="rtcQryData",ui="rtcDelData",li="rtcToken",ci="rtcUserState",di="rtcUList",_i="viewerJoinR",fi="viewerExitR",hi="rtcPullKv",gi="rtcIdentityChange",pi="rtcInvite",Ei="rtcCancelInvite",bi="rtcInviteAnswer",Ti="rtcEndInvite",vi="rtcQueryJoined",Ri=0,Ii=1,mi=2,yi=3,Ai=4,Si=5,Oi=6,Ni=7,Ci=8,Pi=9,Li=10,wi=11,Mi=12,Ui=13,Di=14,Gi=15,Vi=16,ji=17,ki=18,xi=19,Fi=20,Bi=1,Hi=2,qi=4,Yi=5,Wi=6,Ki=7,Ji=8,Qi=9,Xi=function(){function e(){}return Object.defineProperty(e,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this._getBackAndByteSize(e),n=t.back,r=t.byteSize,i=0,o=n.length;i<o;i++)n[i]>255&&(n[i]&=255);return r<=255?[0,r].concat(n):[r>>8,255&r].concat(n)}}),Object.defineProperty(e,"_getBackAndByteSize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],n=0;if("string"==typeof e)for(var r=0,i=e.length;r<i;r++){var o=e.charCodeAt(r);o>=0&&o<=127?(n+=1,t.push(o)):o>=128&&o<=2047?(n+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(n+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:n,back:t}}}),Object.defineProperty(e,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,n,r=[],i=-1,o=e,a="";++i<o.length;){var s=Number(o[i]);if(s===(127&s)||(240&~s?224&~s?192&~s||(s=(s^=192)<<6|128^o[++i]):s=(s=(s^=224)<<6|128^o[++i])<<6|128^o[++i]:s=(s=(s=(s^=240)<<6|128^o[++i])<<6|128^o[++i])<<6|128^o[++i]),!Number.isFinite(s)||s<0||s>1114111||Math.floor(s)!==s)throw RangeError("Invalid code point: ".concat(s));s<=65535?r.push(s):(t=(s-=65536)>>10|55296,n=s%1024|56320,r.push(t,n)),(i+1===o.length||r.length>16384)&&(a+=String.fromCharCode.apply(null,r),r.length=0)}return a}}),e}(),Zi=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="",n=0;n<2;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r.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="",n=0;n<8;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r}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 n=this._pool.subarray(t,this._position);return Xi.readUTF(n)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),zi=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=Xi.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}(),$i=function(){function e(e,t,n,r){void 0===t&&(t=Hr),void 0===n&&(n=!1),void 0===r&&(r=!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:n}),Object.defineProperty(this,"dup",{enumerable:!0,configurable:!0,writable:!0,value:r})}return Object.defineProperty(e,"parse",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t>>4,(6&t)>>1,!(1&~t),(8&t)>0)}}),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}(),eo=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,n){this.readMessage(e,t,n)}}),Object.defineProperty(e.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return{stream:e,length:t}}}),e}(),to=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 $i(e,Br)}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 zi;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),no=function(e){function n(){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(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(e.readByte(),this.status=e.readByte(),t<=n.MESSAGE_LENGTH)return{stream:e,length:t};if(r===$r){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(n,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),n}(eo),ro=function(e){function n(t){var n=e.call(this,zr)||this;return Object.defineProperty(n,"status",{enumerable:!0,configurable:!0,writable:!0,value:t}),n}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.writeArr([0,this.status])}}),n}(to),io=function(e){function n(){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(n,e),Object.defineProperty(n.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(n,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),n}(eo),oo=function(e){function n(){return e.call(this,Xr)||this}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),n}(to),ao=function(e){function n(t){return e.call(this,t)||this}return t(n,e),n}(eo),so=function(e){function n(){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(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=256*e.readByte()+e.readByte();return this.messageId=parseInt(n.toString(),10),{stream:e,length:t}}}),n}(eo),uo=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.messageId,n=255&t,r=(65280&t)>>8;e.writeByte(r),e.writeByte(n)}}),n}(to),lo=function(e){function n(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(n,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(n,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(n,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),n.syncMsg=t.dup,n}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,n),this.pbData=t.readAll(),{stream:t,length:n}}}),n}(so),co=function(e){function n(t,n,r,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:r}),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 n?n:Fr(n),o}return t(n,e),Object.defineProperty(n.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)}}),n}(uo),_o=function(e){function n(t,n,r){return e.call(this,Kr,t,r,n)||this}return t(n,e),n}(co),fo=function(e){function n(t,n,r){return e.call(this,Yr,t,r,n)||this}return t(n,e),n}(co),ho=function(e){function n(){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(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.readMessage.call(this,t,n),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:n}}}),n}(so),go=function(e){function n(t){var n=e.call(this,Wr)||this;return n.messageId=t,n}return t(n,e),n}(uo),po=function(e){function n(t){var n=e.call(this,Qr)||this;return n.messageId=t,n}return t(n,e),n}(uo),Eo=function(e){function n(){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(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.readMessage.call(this,t,n),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:n}}}),n}(so),bo=function(e,t){var n=new Uint8Array(e),r=new Zi(n),i=r.readByte(),o=function(e){var t,n=e.command;switch(n){case qr:t=new no(e);break;case Yr:t=new lo(e);break;case Wr:t=new ho(e);break;case Jr:t=new Eo(e);break;case Zr:t=new ao(e);break;case zr:t=new io(e);break;default:console.error("No support for deserializing ".concat(n," messages"))}return t}($i.parse(i));return o&&o.read(r,n.length-1,t),o},To=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=An(),r=n.resolve,i=n.promise,o=this._logger,a=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")))r(Tn());else{var n=JSON.parse(e.data),i=n.code,o=n.message;r(vn(i,o))}},fail:function(t){var n=t.errMsg,i=t.errno;o.warn(B.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:n,errno:i})),r(vn(-1,t.errMsg))},complete:function(){o.debug(B.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return a.onChunkReceived((function(e){var n=Xi.readUTF(new Uint8Array(e.data));o.debug(B.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(n)),t.onRawContent(n)})),i}}),n}(Mr),vo=wr(),Ro=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Io={setItem:Ro("setStorageSync"),getItem:Ro("getStorageSync"),removeItem:Ro("removeStorageSync"),clear:Ro("clearStorageSync")},mo=null,yo=function(e){var t=e.isConnected,n=e.networkType;mo({status:t,type:n})};var Ao={tag:"wechat",httpReq:function(e){var t=e.method||Ge.GET,n=e.timeout||He,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i);return new Promise((function(e){wx.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:Io,sessionStorage:Io,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:vo,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return Promise.resolve(Tn({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),n.close()}))},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){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){mo=e,wx.onNetworkStatusChange(yo)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(yo),mo=null},createSSEClient:function(e){return Tn(new To(e))},get runtimeInfo(){return{type:Ao.tag,version:"Unknown"}}},So=wr(),Oo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var r=my[e]({key:t[0]}).data;return r?JSON.stringify(r):r}catch(e){}}},No={setItem:Oo("setStorageSync"),getItem:Oo("getStorageSync"),removeItem:Oo("removeStorageSync"),clear:Oo("clearStorageSync")},Co=null,Po=function(e){var t=e.isConnected,n=e.networkType;Co({status:t,type:n})};var Lo={tag:"alipay",httpReq:function(e){var t=e.method||Ge.GET,n=e.timeout||He,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i),s=e.dataType||"json";return new Promise((function(e){my.request({url:a,method:t,headers:r,timeout:n,data:o,dataType:s,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:No,sessionStorage:No,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:So,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return Promise.resolve(Tn({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 n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){Co=e,my.onNetworkStatusChange(Po)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Po),Co=null},createSSEClient:function(e){return vn(x.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:Lo.tag,version:"Unknown"}}},wo=wr(),Mo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,l([],u(t),!1))}catch(e){}}},Uo={setItem:Mo("setStorageSync"),getItem:Mo("getStorageSync"),removeItem:Mo("removeStorageSync"),clear:Mo("clearStorageSync")},Do=null,Go=function(e){var t=e.isConnected,n=e.networkType;Do({status:t,type:n})};var Vo={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:wo,localStorage:Uo,sessionStorage:Uo,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:x.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){return new Promise((function(n){var r=tt.connectSocket({url:e,protocols:t,fail:function(e){return n(vn(x.RC_SOCKET_DISCONNECTED,e.errMsg))}});n(Tn({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){r.close(),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 n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){Do=e,tt.onNetworkStatusChange(Go)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Go),Do=null},createSSEClient:function(e){return vn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:Vo.tag,version:"Unknown"}}},jo=wr(),ko=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,l([],u(t),!1))}catch(e){}}},xo={setItem:ko("setStorageSync"),getItem:ko("getStorageSync"),removeItem:ko("removeStorageSync"),clear:ko("clearStorageSync")},Fo=null,Bo=function(e){var t=e.isConnected,n=e.networkType;Fo({status:t,type:n})};var Ho={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:jo,localStorage:xo,sessionStorage:xo,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 n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:x.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return Promise.resolve(Tn({id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}))},getNetworkType:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Fo=e,swan.onNetworkStatusChange(Bo)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Bo),Fo=null},createSSEClient:function(e){return vn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:Ho.tag,version:"Unknown"}}},qo=wr(),Yo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Wo={setItem:Yo("setStorageSync"),getItem:Yo("getStorageSync"),removeItem:Yo("removeStorageSync"),clear:Yo("clearStorageSync")},Ko=null,Jo=function(e){var t=e.isConnected,n=e.networkType;Ko({status:t,type:n})};var Qo={tag:"jingdong",httpReq:function(e){var t=e.method||Ge.GET,n=e.timeout||He,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i);return new Promise((function(e){jd.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:Wo,sessionStorage:Wo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:qo,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),Promise.resolve(Tn({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 n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ko=e,jd.onNetworkStatusChange(Jo)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Jo),Ko=null},createSSEClient:function(e){return vn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:Qo.tag,version:"Unknown"}}},Xo=wr(),Zo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return ks[e].apply(ks,l([],u(t),!1))}catch(e){}}},zo={setItem:Zo("setStorageSync"),getItem:Zo("getStorageSync"),removeItem:Zo("removeStorageSync"),clear:Zo("clearStorageSync")},$o=null,ea=function(e){var t=e.isConnected,n=e.networkType;$o({status:t,type:n})};var ta={tag:"kuaishou",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Xo,localStorage:zo,sessionStorage:zo,httpReq:function(e){return new Promise((function(t){ks.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:x.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=ks.connectSocket({url:e,protocols:t});return Promise.resolve(Tn({id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){ks.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){$o=e,ks.onNetworkStatusChange(ea)},removeNetworkStatusListener:function(){ks.offNetworkStatusChange(ea),$o=null},createSSEClient:function(e){return vn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:ta.tag,version:"Unknown"}}},na=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},ra={setItem:na("setStorageSync"),getItem:na("getStorageSync"),removeItem:na("removeStorageSync"),clear:na("clearStorageSync")},ia=null,oa=function(e){var t=e.isConnected,n=e.networkType;ia({status:t,type:n})};var aa={tag:"uniapp",httpReq:function(e){var t=e.method||Ge.GET,n=e.timeout||He,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i);return new Promise((function(e){uni.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:ra,sessionStorage:ra,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,n=e.osName;return["app","app-plus"].includes(t)&&n||""},isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},r=uni.connectSocket(n);return Promise.resolve(Tn({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){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){ia=e,uni.onNetworkStatusChange(oa)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(oa),ia=null},createSSEClient:function(e){return vn(x.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,n=e.deviceModel,r=e.deviceBrand,i=e.osVersion,o="android"===e.osName?t:i;return"".concat(r||"","|").concat(n||"","|").concat(o||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:aa.tag,version:"Unknown"}}},sa=function(e){return e&&e.request&&e.getSystemInfo},ua="undefined"!=typeof uni&&sa(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return aa;case"mp-jd":return Qo;case"mp-baidu":return Ho;case"mp-toutiao":return Vo;case"mp-alipay":return Lo;case"mp-weixin":return Ao;case"mp-kuaishou":return ta;default:return kr}}():"undefined"!=typeof jd&&sa(jd)?Qo:"undefined"!=typeof my&&sa(my)?Lo:"undefined"!=typeof tt&&sa(tt)?Vo:"undefined"!=typeof ks&&sa(ks)?ta:"undefined"!=typeof swan&&sa(swan)?Ho:"undefined"!=typeof wx&&sa(wx)?Ao:kr;const la=function(){var e,t={},n=function(e){var t=function(e,n,i){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===n&&(n=t.DEFAULT_ENDIAN),void 0===i&&(i=t.DEFAULT_NOASSERT),!i){if((e|=0)<0)throw RangeError("Illegal capacity");n=!!n,i=!!i}this.buffer=0===e?r:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=n,this.noAssert=i};t.VERSION="5.0.1",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var n=t.prototype;n.__isByteBuffer__,Object.defineProperty(n,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var r=new ArrayBuffer(0),i=String.fromCharCode;function o(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function a(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+i.apply(String,e);e.length+arguments.length>1024&&(t.push(i.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function s(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,d=n?i-1:0,_=n?-1:1,f=e[t+d];for(d+=_,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+d],d+=_,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+d],d+=_,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=l}return(f?-1:1)*a*Math.pow(2,o-r)}function u(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,d=c>>1,_=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,h=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?_/u:_*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=h,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[n+f]=255&a,f+=h,a/=256,l-=8);e[n+f-h]|=128*g}t.accessor=function(){return Uint8Array},t.allocate=function(e,n,r){return new t(e,n,r)},t.concat=function(e,n,r,i){"boolean"!=typeof n&&"string"==typeof n||(i=r,r=n,n=void 0);for(var o,a=0,s=0,u=e.length;s<u;++s)t.isByteBuffer(e[s])||(e[s]=t.wrap(e[s],n)),(o=e[s].limit-e[s].offset)>0&&(a+=o);if(0===a)return new t(0,r,i);var l,c=new t(a,r,i);for(s=0;s<u;)(o=(l=e[s++]).limit-l.offset)<=0||(c.view.set(l.view.subarray(l.offset,l.limit),c.offset),c.offset+=o);return c.limit=c.offset,c.offset=0,c},t.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},t.type=function(){return ArrayBuffer},t.wrap=function(e,r,i,o){if("string"!=typeof r&&(o=i,i=r,r=void 0),"string"==typeof e)switch(void 0===r&&(r="utf8"),r){case"base64":return t.fromBase64(e,i);case"hex":return t.fromHex(e,i);case"binary":return t.fromBinary(e,i);case"utf8":return t.fromUTF8(e,i);case"debug":return t.fromDebug(e,i);default:throw Error("Unsupported encoding: "+r)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var a;if(t.isByteBuffer(e))return(a=n.clone.call(e)).markedOffset=-1,a;if(e instanceof Uint8Array)a=new t(0,i,o),e.length>0&&(a.buffer=e.buffer,a.offset=e.byteOffset,a.limit=e.byteOffset+e.byteLength,a.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)a=new t(0,i,o),e.byteLength>0&&(a.buffer=e,a.offset=0,a.limit=e.byteLength,a.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(a=new t(e.length,i,o)).limit=e.length;for(var s=0;s<e.length;++s)a.view[s]=e[s]}return a},n.writeBitSet=function(e,t){var n=void 0===t;if(n&&(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)}var r,i=t,o=e.length,a=o>>3,s=0;for(t+=this.writeVarint32(o,t);a--;)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(s<o){var u=0;for(r=0;s<o;)r|=(1&!!e[s++])<<u++;this.writeByte(r,t++)}return n?(this.offset=t,this):t-i},n.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var n,r=this.readVarint32(e),i=r.value,o=i>>3,a=0,s=[];for(e+=r.length;o--;)n=this.readByte(e++),s[a++]=!!(1&n),s[a++]=!!(2&n),s[a++]=!!(4&n),s[a++]=!!(8&n),s[a++]=!!(16&n),s[a++]=!!(32&n),s[a++]=!!(64&n),s[a++]=!!(128&n);if(a<i){var u=0;for(n=this.readByte(e++);a<i;)s[a++]=!!(n>>u++&1)}return t&&(this.offset=e),s},n.readBytes=function(e,t){var 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)}var r=this.slice(t,t+e);return n&&(this.offset+=e),r},n.writeBytes=n.append,n.writeInt8=function(e,t){var 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)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},n.writeByte=n.writeInt8,n.readInt8=function(e){var t=void 0===e;if(t&&(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)}var n=this.view[e];return 128&~n||(n=-(255-n+1)),t&&(this.offset+=1),n},n.readByte=n.readInt8,n.writeUint8=function(e,t){var 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)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},n.writeUInt8=n.writeUint8,n.readUint8=function(e){var t=void 0===e;if(t&&(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)}var n=this.view[e];return t&&(this.offset+=1),n},n.readUInt8=n.readUint8,n.writeInt16=function(e,t){var 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)}t+=2;var r=this.buffer.byteLength;return t>r&&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},n.writeShort=n.writeInt16,n.readInt16=function(e){var t=void 0===e;if(t&&(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)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),32768&~n||(n=-(65535-n+1)),t&&(this.offset+=2),n},n.readShort=n.readInt16,n.writeUint16=function(e,t){var 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)}t+=2;var r=this.buffer.byteLength;return t>r&&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},n.writeUInt16=n.writeUint16,n.readUint16=function(e){var t=void 0===e;if(t&&(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)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),t&&(this.offset+=2),n},n.readUInt16=n.readUint16,n.writeInt32=function(e,t){var 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)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},n.writeInt=n.writeInt32,n.readInt32=function(e){var t=void 0===e;if(t&&(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)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),n|=0,t&&(this.offset+=4),n},n.readInt=n.readInt32,n.writeUint32=function(e,t){var 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)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},n.writeUInt32=n.writeUint32,n.readUint32=function(e){var t=void 0===e;if(t&&(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)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),t&&(this.offset+=4),n},n.readUInt32=n.readUint32,e&&(n.writeInt64=function(t,n){var r=void 0===n;if(r&&(n=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 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)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=t.low,a=t.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},n.writeLong=n.writeInt64,n.readInt64=function(t){var 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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=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,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=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);var o=new e(r,i,!1);return n&&(this.offset+=8),o},n.readLong=n.readInt64,n.writeUint64=function(t,n){var r=void 0===n;if(r&&(n=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 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)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=t.low,a=t.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},n.writeUInt64=n.writeUint64,n.readUint64=function(t){var 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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=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,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=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);var o=new e(r,i,!0);return n&&(this.offset+=8),o},n.readUInt64=n.readUint64),n.writeFloat32=function(e,t){var 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)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,u(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},n.writeFloat=n.writeFloat32,n.readFloat32=function(e){var t=void 0===e;if(t&&(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)}var n=s(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),n},n.readFloat=n.readFloat32,n.writeFloat64=function(e,t){var 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)}t+=8;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=8,u(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},n.writeDouble=n.writeFloat64,n.readFloat64=function(e){var t=void 0===e;if(t&&(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)}var n=s(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),n},n.readDouble=n.readFloat64,t.MAX_VARINT32_BYTES=5,t.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},t.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},t.zigZagDecode32=function(e){return e>>>1^-(1&e)},n.writeVarint32=function(e,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+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)}var i,o=t.calculateVarint32(e);n+=o;var a=this.buffer.byteLength;for(n>a&&this.resize((a*=2)>n?a:n),n-=o,e>>>=0;e>=128;)i=127&e|128,this.view[n++]=i,e>>>=7;return this.view[n++]=e,r?(this.offset=n,this):o},n.writeVarint32ZigZag=function(e,n){return this.writeVarint32(t.zigZagEncode32(e),n)},n.readVarint32=function(e){var t=void 0===e;if(t&&(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)}var n,r=0,i=0;do{if(!this.noAssert&&e>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}n=this.view[e++],r<5&&(i|=(127&n)<<7*r),++r}while(128&n);return i|=0,t?(this.offset=e,i):{value:i,length:r}},n.readVarint32ZigZag=function(e){var n=this.readVarint32(e);return"object"==typeof n?n.value=t.zigZagDecode32(n.value):n=t.zigZagDecode32(n),n},e&&(t.MAX_VARINT64_BYTES=10,t.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:n<1<<21?3:4:r<16384?r<128?5:6:r<1<<21?7:8:i<128?9:10},t.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()},t.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()},n.writeVarint64=function(n,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof n)n=e.fromNumber(n);else if("string"==typeof n)n=e.fromString(n);else if(!(n&&n instanceof e))throw TypeError("Illegal value: "+n+" (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)}"number"==typeof n?n=e.fromNumber(n,!1):"string"==typeof n?n=e.fromString(n,!1):!1!==n.unsigned&&(n=n.toSigned());var o=t.calculateVarint64(n),a=n.toInt()>>>0,s=n.shiftRightUnsigned(28).toInt()>>>0,u=n.shiftRightUnsigned(56).toInt()>>>0;r+=o;var l=this.buffer.byteLength;switch(r>l&&this.resize((l*=2)>r?l:r),r-=o,o){case 10:this.view[r+9]=u>>>7&1;case 9:this.view[r+8]=9!==o?128|u:127&u;case 8:this.view[r+7]=8!==o?s>>>21|128:s>>>21&127;case 7:this.view[r+6]=7!==o?s>>>14|128:s>>>14&127;case 6:this.view[r+5]=6!==o?s>>>7|128:s>>>7&127;case 5:this.view[r+4]=5!==o?128|s:127&s;case 4:this.view[r+3]=4!==o?a>>>21|128:a>>>21&127;case 3:this.view[r+2]=3!==o?a>>>14|128:a>>>14&127;case 2:this.view[r+1]=2!==o?a>>>7|128:a>>>7&127;case 1:this.view[r]=1!==o?128|a:127&a}return i?(this.offset+=o,this):o},n.writeVarint64ZigZag=function(e,n){return this.writeVarint64(t.zigZagEncode64(e),n)},n.readVarint64=function(t){var 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+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=t,i=0,o=0,a=0,s=0;if(i=127&(s=this.view[t++]),128&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)&&(o|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(a=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(a|=(127&(s=this.view[t++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|o<<28,o>>>4|a<<24,!1);return n?(this.offset=t,u):{value:u,length:t-r}},n.readVarint64ZigZag=function(n){var r=this.readVarint64(n);return r&&r.value instanceof e?r.value=t.zigZagDecode64(r.value):r=t.zigZagDecode64(r),r}),n.writeCString=function(e,t){var n=void 0===t;n&&(t=this.offset);var r,i=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;r<i;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");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)}i=c.calculateUTF16asUTF8(o(e))[1],t+=i+1;var a=this.buffer.byteLength;return t>a&&this.resize((a*=2)>t?a:t),t-=i+1,c.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,n?(this.offset=t,this):i},n.readCString=function(e){var t=void 0===e;if(t&&(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)}var n,r=e,i=-1;return c.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=a(),!0),t?(this.offset=e,n()):{string:n(),length:e-r}},n.writeIString=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");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)}var r,i=t;r=c.calculateUTF16asUTF8(o(e),this.noAssert)[1],t+=4+r;var a=this.buffer.byteLength;if(t>a&&this.resize((a*=2)>t?a:t),t-=4+r,this.littleEndian?(this.view[t+3]=r>>>24&255,this.view[t+2]=r>>>16&255,this.view[t+1]=r>>>8&255,this.view[t]=255&r):(this.view[t]=r>>>24&255,this.view[t+1]=r>>>16&255,this.view[t+2]=r>>>8&255,this.view[t+3]=255&r),t+=4,c.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),t!==i+4+r)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+r));return n?(this.offset=t,this):t-i},n.readIString=function(e){var n=void 0===e;if(n&&(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)}var r=e,i=this.readUint32(e),o=this.readUTF8String(i,t.METRICS_BYTES,e+=4);return e+=o.length,n?(this.offset=e,o.string):{string:o.string,length:e-r}},t.METRICS_CHARS="c",t.METRICS_BYTES="b",n.writeUTF8String=function(e,t){var n,r=void 0===t;if(r&&(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+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i=t;n=c.calculateUTF16asUTF8(o(e))[1],t+=n;var a=this.buffer.byteLength;return t>a&&this.resize((a*=2)>t?a:t),t-=n,c.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),r?(this.offset=t,this):t-i},n.writeString=n.writeUTF8String,t.calculateUTF8Chars=function(e){return c.calculateUTF16asUTF8(o(e))[0]},t.calculateUTF8Bytes=function(e){return c.calculateUTF16asUTF8(o(e))[1]},t.calculateString=t.calculateUTF8Bytes,n.readUTF8String=function(e,n,r){"number"==typeof n&&(r=n,n=void 0);var i=void 0===r;if(i&&(r=this.offset),void 0===n&&(n=t.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"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)}var o,s=0,u=r;if(n===t.METRICS_CHARS){if(o=a(),c.decodeUTF8(function(){return s<e&&r<this.limit?this.view[r++]:null}.bind(this),(function(e){++s,c.UTF8toUTF16(e,o)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=r,o()):{string:o(),length:r-u}}if(n===t.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}var l=r+e;if(c.decodeUTF8toUTF16(function(){return r<l?this.view[r++]:null}.bind(this),o=a(),this.noAssert),r!==l)throw RangeError("Illegal range: Truncated data, "+r+" == "+l);return i?(this.offset=r,o()):{string:o(),length:r-u}}throw TypeError("Unsupported metrics: "+n)},n.readString=n.readUTF8String,n.writeVString=function(e,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("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)}var i,a,s=n;i=c.calculateUTF16asUTF8(o(e),this.noAssert)[1],a=t.calculateVarint32(i),n+=a+i;var u=this.buffer.byteLength;if(n>u&&this.resize((u*=2)>n?u:n),n-=a+i,n+=this.writeVarint32(i,n),c.encodeUTF16toUTF8(o(e),function(e){this.view[n++]=e}.bind(this)),n!==s+i+a)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+i+a));return r?(this.offset=n,this):n-s},n.readVString=function(e){var n=void 0===e;if(n&&(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)}var r=e,i=this.readVarint32(e),o=this.readUTF8String(i.value,t.METRICS_BYTES,e+=i.length);return e+=o.length,n?(this.offset=e,o.string):{string:o.string,length:e-r}},n.append=function(e,n,r){"number"!=typeof n&&"string"==typeof n||(r=n,n=void 0);var i=void 0===r;if(i&&(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)}e instanceof t||(e=t.wrap(e,n));var o=e.limit-e.offset;if(o<=0)return this;r+=o;var a=this.buffer.byteLength;return r>a&&this.resize((a*=2)>r?a:r),r-=o,this.view.set(e.view.subarray(e.offset,e.limit),r),e.offset+=o,i&&(this.offset+=o),this},n.appendTo=function(e,t){return e.append(this,t),this},n.assert=function(e){return this.noAssert=!e,this},n.capacity=function(){return this.buffer.byteLength},n.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},n.clone=function(e){var n=new t(0,this.littleEndian,this.noAssert);return e?(n.buffer=new ArrayBuffer(this.buffer.byteLength),n.view=new Uint8Array(n.buffer)):(n.buffer=this.buffer,n.view=this.view),n.offset=this.offset,n.markedOffset=this.markedOffset,n.limit=this.limit,n},n.compact=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(0===e&&t===this.buffer.byteLength)return this;var n=t-e;if(0===n)return this.buffer=r,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var i=new ArrayBuffer(n),o=new Uint8Array(i);return o.set(this.view.subarray(e,t)),this.buffer=i,this.view=o,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this},n.copy=function(e,n){if(void 0===e&&(e=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,e<0||e>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+n+" <= "+this.buffer.byteLength)}if(e===n)return new t(0,this.littleEndian,this.noAssert);var r=n-e,i=new t(r,this.littleEndian,this.noAssert);return i.offset=0,i.limit=r,i.markedOffset>=0&&(i.markedOffset-=e),this.copyTo(i,0,e,n),i},n.copyTo=function(e,n,r,i){var o,a;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(n=(a=void 0===n)?e.offset:0|n,r=(o=void 0===r)?this.offset:0|r,i=void 0===i?this.limit:0|i,n<0||n>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+n+" <= "+e.buffer.byteLength);if(r<0||i>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+r+" <= "+this.buffer.byteLength);var s=i-r;return 0===s?e:(e.ensureCapacity(n+s),e.view.set(this.view.subarray(r,i),n),o&&(this.offset+=s),a&&(e.offset+=s),this)},n.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},n.fill=function(e,t,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=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 n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;t<n;)this.view[t++]=e;return r&&(this.offset=t),this},n.flip=function(){return this.limit=this.offset,this.offset=0,this},n.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},n.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},n.LE=function(e){return this.littleEndian=void 0===e||!!e,this},n.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},n.prepend=function(e,n,r){"number"!=typeof n&&"string"==typeof n||(r=n,n=void 0);var i=void 0===r;if(i&&(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)}e instanceof t||(e=t.wrap(e,n));var o=e.limit-e.offset;if(o<=0)return this;var a=o-r;if(a>0){var s=new ArrayBuffer(this.buffer.byteLength+a),u=new Uint8Array(s);u.set(this.view.subarray(r,this.buffer.byteLength),o),this.buffer=s,this.view=u,this.offset+=a,this.markedOffset>=0&&(this.markedOffset+=a),this.limit+=a,r+=a}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),r-o),e.offset=e.limit,i&&(this.offset-=o),this},n.prependTo=function(e,t){return e.prepend(this,t),this},n.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},n.remaining=function(){return this.limit-this.offset},n.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},n.resize=function(e){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)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),n=new Uint8Array(t);n.set(this.view),this.buffer=t,this.view=n}return this},n.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},n.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},n.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 n=this.clone();return n.offset=e,n.limit=t,n},n.toBuffer=function(e){var t=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(!e&&0===t&&n===this.buffer.byteLength)return this.buffer;if(t===n)return r;var i=new ArrayBuffer(n-t);return new Uint8Array(i).set(new Uint8Array(this.buffer).subarray(t,n),0),i},n.toArrayBuffer=n.toBuffer,n.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(n=t=e="utf8"),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var l=function(){for(var e={},t=[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],n=[],r=0,i=t.length;r<i;++r)n[t[r]]=r;return e.encode=function(e,n){for(var r,i;null!==(r=e());)n(t[r>>2&63]),i=(3&r)<<4,null!==(r=e())?(n(t[63&((i|=r>>4&15)|r>>4&15)]),i=(15&r)<<2,null!==(r=e())?(n(t[63&(i|r>>6&3)]),n(t[63&r])):(n(t[63&i]),n(61))):(n(t[63&i]),n(61),n(61))},e.decode=function(e,t){var r,i,o;function a(e){throw Error("Illegal character code: "+e)}for(;null!==(r=e());)if(void 0===(i=n[r])&&a(r),null!==(r=e())&&(void 0===(o=n[r])&&a(r),t(i<<2>>>0|(48&o)>>4),null!==(r=e()))){if(void 0===(i=n[r])){if(61===r)break;a(r)}if(t((15&o)<<4>>>0|(60&i)>>2),null!==(r=e())){if(void 0===(o=n[r])){if(61===r)break;a(r)}t((3&i)<<6>>>0|o)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();n.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 l.encode(function(){return e<t?this.view[e++]:null}.bind(this),n=a()),n()},t.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new t(e.length/4*3,n),i=0;return l.decode(o(e),(function(e){r.view[i++]=e})),r.limit=i,r},t.btoa=function(e){return t.fromBinary(e).toBase64()},t.atob=function(e){return t.fromBase64(e).toBinary()},n.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 n=[],r=[];e<t;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},t.fromBinary=function(e,n){if("string"!=typeof e)throw TypeError("str");for(var r,i=0,o=e.length,a=new t(o,n);i<o;){if((r=e.charCodeAt(i))>255)throw RangeError("illegal char code: "+r);a.view[i++]=r}return a.limit=o,a},n.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",a="";n<r;){if(-1!==n&&(i+=(t=this.view[n])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";a+=i+o+"\n",i=o=""}n===this.offset&&n===this.limit?i+=n===this.markedOffset?"!":"|":n===this.offset?i+=n===this.markedOffset?"[":"<":n===this.limit?i+=n===this.markedOffset?"]":">":i+=n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";a+=i+o+"\n"}return e?a:i},t.fromDebug=function(e,n,r){for(var i,o,a=e.length,s=new t((a+1)/3|0,n,r),u=0,l=0,c=!1,d=!1,_=!1,f=!1,h=!1;u<a;){switch(i=e.charAt(u++)){case"!":if(!r){if(d||_||f){h=!0;break}d=_=f=!0}s.offset=s.markedOffset=s.limit=l,c=!1;break;case"|":if(!r){if(d||f){h=!0;break}d=f=!0}s.offset=s.limit=l,c=!1;break;case"[":if(!r){if(d||_){h=!0;break}d=_=!0}s.offset=s.markedOffset=l,c=!1;break;case"<":if(!r){if(d){h=!0;break}d=!0}s.offset=l,c=!1;break;case"]":if(!r){if(f||_){h=!0;break}f=_=!0}s.limit=s.markedOffset=l,c=!1;break;case">":if(!r){if(f){h=!0;break}f=!0}s.limit=l,c=!1;break;case"'":if(!r){if(_){h=!0;break}_=!0}s.markedOffset=l,c=!1;break;case" ":c=!1;break;default:if(!r&&c){h=!0;break}if(o=parseInt(i+e.charAt(u++),16),!r&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[l++]=o,c=!0}if(h)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!r){if(!d||!f)throw TypeError("Illegal str: Missing offset or limit");if(l<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+a)}return s},n.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 n,r=new Array(t-e);e<t;)(n=this.view[e++])<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},t.fromHex=function(e,n,r){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(var i,o=e.length,a=new t(o/2|0,n),s=0,u=0;s<o;s+=2){if(i=parseInt(e.substring(s,s+2),16),!r&&(!isFinite(i)||i<0||i>255))throw TypeError("Illegal str: Contains non-hex characters");a.view[u++]=i}return a.limit=u,a};var c=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(n>>6&31|192),t(63&n|128)):n<65536?(t(n>>12&15|224),t(n>>6&63|128),t(63&n|128)):(t(n>>18&7|240),t(n>>12&63|128),t(n>>6&63|128),t(63&n|128)),n=null},decodeUTF8:function(e,t){for(var n,r,i,o,a=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(128&n)if(192==(224&n))null===(r=e())&&a([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))(null===(r=e())||null===(i=e()))&&a([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(o=e()))&&a([n,r,i,o]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}else t(n)},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(t(55296+((n-=65536)>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,n)}))},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,n)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,(function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4})),[n,r]}};return e}();return n.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{c.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),n=a())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return n()},t.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new t(c.calculateUTF16asUTF8(o(e),!0)[1],n,r),a=0;return c.encodeUTF16toUTF8(o(e),(function(e){i.view[a++]=e})),i.limit=a,i},t}(function(){function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var n={},r={};function i(e,t){var i,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=r[e])?o:(i=a(e,(0|e)<0?-1:0,!0),s&&(r[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(o=n[e])?o:(i=a(e,e<0?-1:0,!1),s&&(n[e]=i),i)}function o(e,t){if(isNaN(e)||!isFinite(e))return t?g:h;if(t){if(e<0)return g;if(e>=d)return v}else{if(e<=-_)return R;if(e+1>=_)return T}return e<0?o(-e,t).neg():a(e%c|0,e/c|0,t)}function a(t,n,r){return new e(t,n,r)}e.fromInt=i,e.fromNumber=o,e.fromBits=a;var s=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return h;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return u(e.substring(1),t,n).neg();for(var i=o(s(n,8)),a=h,l=0;l<e.length;l+=8){var c=Math.min(8,e.length-l),d=parseInt(e.substring(l,l+c),n);if(c<8){var _=o(s(n,c));a=a.mul(_).add(o(d))}else a=(a=a.mul(i)).add(o(d))}return a.unsigned=t,a}function l(t){return t instanceof e?t:"number"==typeof t?o(t):"string"==typeof t?u(t):a(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=l;var c=4294967296,d=c*c,_=d/2,f=i(1<<24),h=i(0);e.ZERO=h;var g=i(0,!0);e.UZERO=g;var p=i(1);e.ONE=p;var E=i(1,!0);e.UONE=E;var b=i(-1);e.NEG_ONE=b;var T=a(-1,2147483647,!1);e.MAX_VALUE=T;var v=a(-1,-1,!0);e.MAX_UNSIGNED_VALUE=v;var R=a(0,-2147483648,!1);e.MIN_VALUE=R;var I=e.prototype;return I.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){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(R)){var t=o(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=o(s(e,6),this.unsigned),a=this,u="";;){var l=a.div(i),c=(a.sub(l.mul(i)).toInt()>>>0).toString(e);if((a=l).isZero())return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}},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(){if(this.isNegative())return this.eq(R)?64:this.neg().getNumBitsAbs();for(var 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=l(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=l(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?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(R)?R:this.not().add(p)},I.neg=I.negate,I.add=function(e){t(e)||(e=l(e));var n=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,u=65535&e.high,c=e.low>>>16,d=0,_=0,f=0,h=0;return f+=(h+=o+(65535&e.low))>>>16,_+=(f+=i+c)>>>16,d+=(_+=r+u)>>>16,d+=n+s,a((f&=65535)<<16|(h&=65535),(d&=65535)<<16|(_&=65535),this.unsigned)},I.subtract=function(e){return t(e)||(e=l(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){if(this.isZero())return h;if(t(e)||(e=l(e)),e.isZero())return h;if(this.eq(R))return e.isOdd()?R:h;if(e.eq(R))return this.isOdd()?R:h;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(f)&&e.lt(f))return o(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,c=65535&e.high,d=e.low>>>16,_=65535&e.low,g=0,p=0,E=0,b=0;return E+=(b+=s*_)>>>16,p+=(E+=i*_)>>>16,E&=65535,p+=(E+=s*d)>>>16,g+=(p+=r*_)>>>16,p&=65535,g+=(p+=i*d)>>>16,p&=65535,g+=(p+=s*c)>>>16,g+=n*_+r*d+i*c+s*u,a((E&=65535)<<16|(b&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(e){if(t(e)||(e=l(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:h;var n,r,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return E;i=g}else{if(this.eq(R))return e.eq(p)||e.eq(b)?R:e.eq(R)?p:(n=this.shr(1).div(e).shl(1)).eq(h)?e.isNegative()?p:b:(r=this.sub(e.mul(n)),i=n.add(r.div(e)));if(e.eq(R))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();i=h}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),u=a<=48?1:s(2,a-48),c=o(n),d=c.mul(e);d.isNegative()||d.gt(r);)d=(c=o(n-=u,this.unsigned)).mul(e);c.isZero()&&(c=p),i=i.add(c),r=r.sub(d)}return i},I.div=I.divide,I.modulo=function(e){return t(e)||(e=l(e)),this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.not=function(){return a(~this.low,~this.high,this.unsigned)},I.and=function(e){return t(e)||(e=l(e)),a(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return t(e)||(e=l(e)),a(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return t(e)||(e=l(e)),a(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?a(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):a(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?a(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):a(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var n=this.high;return e<32?a(this.low>>>e|n<<32-e,n>>>e,this.unsigned):a(32===e?n:n>>>e-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:a(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,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},I.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e}());return t.ByteBuffer=n,t.Long=n.Long||null,t.VERSION="5.0.3",t.WIRE_TYPES={},t.WIRE_TYPES.VARINT=0,t.WIRE_TYPES.BITS64=1,t.WIRE_TYPES.LDELIM=2,t.WIRE_TYPES.STARTGROUP=3,t.WIRE_TYPES.ENDGROUP=4,t.WIRE_TYPES.BITS32=5,t.PACKABLE_WIRE_TYPES=[t.WIRE_TYPES.VARINT,t.WIRE_TYPES.BITS64,t.WIRE_TYPES.BITS32],t.TYPES={int32:{name:"int32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},uint64:{name:"uint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.UZERO:void 0},sint64:{name:"sint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},bool:{name:"bool",wireType:t.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:t.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:t.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.ZERO:void 0},float:{name:"float",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:t.WIRE_TYPES.STARTGROUP,defaultValue:null}},t.MAP_KEY_TYPES=[t.TYPES.int32,t.TYPES.sint32,t.TYPES.sfixed32,t.TYPES.uint32,t.TYPES.fixed32,t.TYPES.int64,t.TYPES.sint64,t.TYPES.sfixed64,t.TYPES.uint64,t.TYPES.fixed64,t.TYPES.bool,t.TYPES.string,t.TYPES.bytes],t.ID_MIN=1,t.ID_MAX=536870911,t.convertFieldsToCamelCase=!1,t.populateAccessors=!0,t.populateDefaults=!0,t.Util=((e={}).IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e),t.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]*)(?:\.[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},t.DotProto=function(e,t){var n={},r=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},i=r.prototype;i._readString=function(){var e='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;e.lastIndex=this.index-1;var n=e.exec(this.source);if(!n)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,n[1]},i.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,n,r;do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++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("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var i=this.index;if(t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;var o=this.source.substring(this.index,this.index=i);return'"'!==o&&"'"!==o||(this._stringOpen=o),o},i.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},i.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},i.omit=function(e){return this.peek()===e&&(this.next(),!0)},i.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},n.Tokenizer=r;var o=function(e){this.tn=new r(e),this.proto3=!1},a=o.prototype;function s(e,n){var r=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=i*r|0,!n&&r<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return r}function u(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return n*(1/0);if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function l(e,t,n){void 0===e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}return a.parse=function(){var e,n,r={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},i=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!i||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(!i)throw Error("unexpected 'import'");("public"===(e=this.tn.peek())||(n="weak"===e))&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n||r.imports.push(e);break;case"syntax":if(!i)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),i=!1;break;case"enum":this._parseEnum(r),i=!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()},a._readString=function(){var e,t,n="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},a._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return u(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},a._parseOption=function(e,n){var r=this.tn.next(),i=!1;if("("===r&&(i=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal option name: "+r);var o=r;i&&(this.tn.skip(")"),o="("+o+")",r=this.tn.peek(),t.FQTYPEREF.test(r)&&(o+=r,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,o),n||this.tn.skip(";")},a._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)l(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?l(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},a._parseService=function(e){var n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal service name at line "+this.tn.line+": "+n);var r={name:n,rpc:{},options:{}};for(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)},a._parseServiceRPC=function(e){var n="rpc",r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal rpc service method name: "+r);var i=r,o={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),"stream"===(r=this.tn.next()).toLowerCase()&&(o.request_stream=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal rpc service request type: "+r);if(o.request=r,this.tn.skip(")"),"returns"!==(r=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+r);if(this.tn.skip("("),"stream"===(r=this.tn.next()).toLowerCase()&&(o.response_stream=!0,r=this.tn.next()),o.response=r,this.tn.skip(")"),"{"===(r=this.tn.peek())){for(this.tn.next();"}"!==(r=this.tn.next());){if("option"!==r)throw Error("illegal rpc service token: "+r);this._parseOption(o)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[n]&&(e[n]={}),e[n][i]=o},a._parseMessage=function(e,n){var r=!!n,i=this.tn.next(),o={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(i))throw Error("illegal "+(r?"group":"message")+" name: "+i);for(o.name=i,r&&(this.tn.skip("="),n.id=s(this.tn.next()),o.isGroup=!0),"["===(i=this.tn.peek())&&n&&this._parseFieldOptions(n),this.tn.skip("{");"}"!==(i=this.tn.next());)if(t.RULE.test(i))this._parseMessageField(o,i);else if("oneof"===i)this._parseMessageOneOf(o);else if("enum"===i)this._parseEnum(o);else if("message"===i)this._parseMessage(o);else if("option"===i)this._parseOption(o);else if("service"===i)this._parseService(o);else if("extensions"===i)o.hasOwnProperty("extensions")?o.extensions=o.extensions.concat(this._parseExtensionRanges()):o.extensions=this._parseExtensionRanges();else if("reserved"===i)this._parseIgnored();else if("extend"===i)this._parseExtend(o);else{if(!t.TYPEREF.test(i))throw Error("illegal message token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(o,"optional",i)}return this.tn.omit(";"),e.messages.push(o),o},a._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},a._parseMessageField=function(e,n,r){if(!t.RULE.test(n))throw Error("illegal message field rule: "+n);var i,o={rule:n,type:"",name:"",options:{},id:0};if("map"===n){if(r)throw Error("illegal type: "+r);if(this.tn.skip("<"),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(o.keytype=i,this.tn.skip(","),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field: "+i);if(o.type=i,this.tn.skip(">"),i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);o.name=i,this.tn.skip("="),o.id=s(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(r=void 0!==r?r:this.tn.next())){var a=this._parseMessage(e,o);if(!/^[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(r)&&!t.TYPEREF.test(r))throw Error("illegal message field type: "+r);if(o.type=r,i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);o.name=i,this.tn.skip("="),o.id=s(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},a._parseMessageOneOf=function(e){var n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal oneof name: "+n);var r,i=n,o=[];for(this.tn.skip("{");"}"!==(n=this.tn.next());)(r=this._parseMessageField(e,"optional",n)).oneof=i,o.push(r.id);this.tn.omit(";"),e.oneofs[i]=o},a._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()},a._parseEnum=function(e){var n={name:"",values:[],options:{}},r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal name: "+r);for(n.name=r,this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if(!t.NAME.test(r))throw Error("illegal name: "+r);this.tn.skip("=");var i={name:r,id:s(this.tn.next(),!0)};"["===(r=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),n.values.push(i)}this.tn.omit(";"),e.enums.push(n)},a._parseExtensionRanges=function(){var t,n,r,i=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":r=e.ID_MIN;break;case"max":r=e.ID_MAX;break;default:r=u(t)}if(n.push(r),2===n.length)break;if("to"!==this.tn.peek()){n.push(r);break}this.tn.next()}i.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),i},a._parseExtend=function(e){var n=this.tn.next();if(!t.TYPEREF.test(n))throw Error("illegal extend reference: "+n);var r={ref:n,fields:[]};for(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},a.toString=function(){return"Parser at line "+this.tn.line},n.Parser=o,n}(t,t.Lang),t.Reflect=function(e){var t={},r=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},i=r.prototype;i.fqn=function(){for(var e=this.name,t=this;;){if(null==(t=t.parent))break;e=t.name+"."+e}return e},i.toString=function(e){return(e?this.className+" ":"")+this.fqn()},i.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},t.T=r;var o=function(e,t,n,i,o){r.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=i||{},this.syntax=o||"proto2"},a=o.prototype=Object.create(r.prototype);a.getChildren=function(e){if(null==(e=e||null))return this.children.slice();for(var t=[],n=0,r=this.children.length;n<r;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},a.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof c.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof c.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)},a.getChild=function(e){for(var t="number"==typeof e?"id":"name",n=0,r=this.children.length;n<r;++n)if(this.children[n][t]===e)return this.children[n];return null},a.resolve=function(e,n){var r,i="string"==typeof e?e.split("."):e,o=this,a=0;if(""===i[a]){for(;null!==o.parent;)o=o.parent;a++}do{do{if(!(o instanceof t.Namespace)){o=null;break}if(!(r=o.getChild(i[a]))||!(r instanceof t.T)||n&&!(r instanceof t.Namespace)){o=null;break}o=r,a++}while(a<i.length);if(null!=o)break;if(null!==this.parent)return this.parent.resolve(e,n)}while(null!=o);return o},a.qn=function(e){var n=[],r=e;do{n.unshift(r.name),r=r.parent}while(null!==r);for(var i=1;i<=n.length;i++){var o=n.slice(n.length-i);if(e===this.resolve(o,e instanceof t.Namespace))return o.join(".")}return e.fqn()},a.build=function(){for(var e,t={},n=this.children,r=0,i=n.length;r<i;++r)(e=n[r])instanceof o&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},a.buildOpt=function(){for(var e={},t=Object.keys(this.options),n=0,r=t.length;n<r;++n){var i=t[n],o=this.options[t[n]];e[i]=o}return e},a.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},t.Namespace=o;var s=function(t,n,r,i,o){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=i,this.name=o,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=s.prototype;function l(t,n){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===n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}s.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.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"},u.verifyValue=function(t){var r=this;function i(e,t){throw Error("Illegal value for "+r.toString(!0)+" of type "+r.type.name+": "+e+" ("+t+")")}switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),t>4294967295?0|t:t;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),t<0?t>>>0:t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return l(t,!1)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return l(t,!0)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof t&&i(typeof t,"not a boolean"),t;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof t&&i(typeof t,"not a number"),t;case e.TYPES.string:return"string"==typeof t||t&&t instanceof String||i(typeof t,"not a string"),""+t;case e.TYPES.bytes:return n.isByteBuffer(t)?t:n.wrap(t,"base64");case e.TYPES.enum:var o=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(s=0;s<o.length;s++){if(o[s].name==t)return o[s].id;if(o[s].id==t)return o[s].id}if("proto3"===this.syntax)return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),(t>4294967295||t<0)&&i(typeof t,"not in range for uint32"),t;i(t,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(t&&"object"==typeof t||i(typeof t,"object expected"),t instanceof this.resolvedType.clazz)return t;if(t instanceof e.Builder.Message){var a={};for(var s in t)t.hasOwnProperty(s)&&(a[s]=t[s]);t=a}return new this.resolvedType.clazz(t)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+t+" (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){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");var o=r.offset;i.writeVarint32(r.remaining()),i.append(r),r.offset=o;break;case e.TYPES.message:var a=(new n).LE();this.resolvedType.encode(r,a),i.writeVarint32(a.offset),i.append(a.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,n,r){if(n!=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,r)}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()},t.Element=s;var c=function(e,t,n,r,i,a){o.call(this,e,t,n,r,a),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},d=c.prototype=Object.create(o.prototype);function _(t,n){var r=n.readVarint32(),i=7&r,o=r>>>3;switch(i){case e.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(!(128&~r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:_(o,n);break;case e.WIRE_TYPES.ENDGROUP:if(o===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+o+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+i)}return!0}d.build=function(t){if(this.clazz&&!t)return this.clazz;var r=function(e,t){var r=t.getChildren(e.Reflect.Message.Field),i=t.getChildren(e.Reflect.Message.OneOf),o=function(a,s){e.Builder.Message.call(this);for(var u=0,l=i.length;u<l;++u)this[i[u].name]=null;for(u=0,l=r.length;u<l;++u){var c=r[u];this[c.name]=c.repeated?[]:c.map?new e.Map(c):null,!c.required&&"proto3"!==t.syntax||null===c.defaultValue||(this[c.name]=c.defaultValue)}var d;if(arguments.length>0)if(1!==arguments.length||null===a||"object"!=typeof a||!("function"!=typeof a.encode||a instanceof o)||Array.isArray(a)||a instanceof e.Map||n.isByteBuffer(a)||a instanceof ArrayBuffer||e.Long&&a instanceof e.Long)for(u=0,l=arguments.length;u<l;++u)void 0!==(d=arguments[u])&&this.$set(r[u].name,d);else this.$set(a)},a=o.prototype=Object.create(e.Builder.Message.prototype);a.add=function(n,r,i){var o=t._fieldsByName[n];if(!i){if(!o)throw Error(this+"#"+n+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+n+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+n+" is not a repeated field");r=o.verifyValue(r,!0)}return null===this[n]&&(this[n]=[]),this[n].push(r),this},a.$add=a.add,a.set=function(n,r,i){if(n&&"object"==typeof n){for(var o in i=r,n)n.hasOwnProperty(o)&&void 0!==(r=n[o])&&void 0===t._oneofsByName[o]&&this.$set(o,r,i);return this}var a=t._fieldsByName[n];if(i)this[n]=r;else{if(!a)throw Error(this+"#"+n+" is not a field: undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+n+" is not a field: "+a.toString(!0));this[a.name]=r=a.verifyValue(r)}if(a&&a.oneof){var s=this[a.oneof.name];null!==r?(null!==s&&s!==a.name&&(this[s]=null),this[a.oneof.name]=a.name):s===n&&(this[a.oneof.name]=null)}return this},a.$set=a.set,a.get=function(n,r){if(r)return this[n];var i=t._fieldsByName[n];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+n+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+n+" is not a field: "+i.toString(!0));return this[i.name]},a.$get=a.get;for(var s=0;s<r.length;s++){var u=r[s];u instanceof e.Reflect.Message.ExtensionField||t.builder.options.populateAccessors&&function(e){var n=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));n=n.substring(0,1).toUpperCase()+n.substring(1);var r=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),i=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},o=function(){return this[e.name]};null===t.getChild("set"+n)&&(a["set"+n]=i),null===t.getChild("set_"+r)&&(a["set_"+r]=i),null===t.getChild("get"+n)&&(a["get"+n]=o),null===t.getChild("get_"+r)&&(a["get_"+r]=o)}(u)}function l(t,r,i,o){if(null===t||"object"!=typeof t){if(o&&o instanceof e.Reflect.Enum){var a=e.Reflect.Enum.getName(o.object,t);if(null!==a)return a}return t}if(n.isByteBuffer(t))return r?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return i?t.toString():e.Long.fromValue(t);var s;if(Array.isArray(t))return s=[],t.forEach((function(e,t){s[t]=l(e,r,i,o)})),s;if(s={},t instanceof e.Map){for(var u=t.entries(),c=u.next();!c.done;c=u.next())s[t.keyElem.valueToString(c.value[0])]=l(c.value[1],r,i,t.valueElem.resolvedType);return s}var d=t.$type,_=void 0;for(var f in t)t.hasOwnProperty(f)&&(d&&(_=d.getChild(f))?s[f]=l(t[f],r,i,_.resolvedType):s[f]=l(t[f],r,i));return s}return a.encode=function(e,r){"boolean"==typeof e&&(r=e,e=void 0);var i=!1;e||(e=new n,i=!0);var o=e.littleEndian;try{return t.encode(this,e.LE(),r),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},o.encode=function(e,t,n){return new o(e).encode(t,n)},a.calculate=function(){return t.calculate(this)},a.encodeDelimited=function(e,r){var i=!1;e||(e=new n,i=!0);var o=(new n).LE();return t.encode(this,o,r).flip(),e.writeVarint32(o.remaining()),e.append(o),i?e.flip():e},a.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},a.toArrayBuffer=a.encodeAB,a.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},a.toBuffer=a.encodeNB,a.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},a.toBase64=a.encode64,a.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},a.toHex=a.encodeHex,a.toRaw=function(e,t){return l(this,!!e,!!t,this.$type)},a.encodeJSON=function(){return JSON.stringify(l(this,!0,!0,this.$type))},o.decode=function(e,r,i){"string"==typeof r&&(i=r,r=-1),"string"==typeof e?e=n.wrap(e,i||"base64"):n.isByteBuffer(e)||(e=n.wrap(e));var o=e.littleEndian;try{var a=t.decode(e.LE(),r);return e.LE(o),a}catch(t){throw e.LE(o),t}},o.decodeDelimited=function(e,r){if("string"==typeof e?e=n.wrap(e,r||"base64"):n.isByteBuffer(e)||(e=n.wrap(e)),e.remaining()<1)return null;var i=e.offset,o=e.readVarint32();if(e.remaining()<o)return e.offset=i,null;try{var a=t.decode(e.slice(e.offset,e.offset+o).LE());return e.offset+=o,a}catch(t){throw e.offset+=o,t}},o.decode64=function(e){return o.decode(e,"base64")},o.decodeHex=function(e){return o.decode(e,"hex")},o.decodeJSON=function(e){return new o(JSON.parse(e))},a.toString=function(){return t.toString()},Object.defineProperty&&(Object.defineProperty(o,"$options",{value:t.buildOpt()}),Object.defineProperty(a,"$options",{value:o.$options}),Object.defineProperty(o,"$type",{value:t}),Object.defineProperty(a,"$type",{value:t})),o}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var i,o=0,a=this.children.length;o<a;o++)if((i=this.children[o])instanceof p||i instanceof c||i instanceof T){if(r.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");r[i.name]=i.build()}else if(i instanceof c.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(i instanceof c.OneOf)this._oneofsByName[i.name]=i;else if(!(i instanceof c.OneOf||i instanceof b))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=r},d.encode=function(e,t,n){for(var r,i,o=null,a=0,s=this._fields.length;a<s;++a)i=e[(r=this._fields[a]).name],r.required&&null===i?null===o&&(o=r):r.encode(n?i:r.verifyValue(i),t,e);if(null!==o){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+o);throw u.encoded=t,u}return t},d.calculate=function(e){for(var t,n,r=0,i=0,o=this._fields.length;i<o;++i){if(n=e[(t=this._fields[i]).name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},d.decode=function(t,n,r){"number"!=typeof n&&(n=-1);for(var i,o,a,s,u=t.offset,l=new this.clazz;t.offset<u+n||-1===n&&t.remaining()>0;){if(a=(i=t.readVarint32())>>>3,(o=7&i)===e.WIRE_TYPES.ENDGROUP){if(a!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(r?r+" expected":"not a group")+")");break}if(s=this._fieldsById[a]){if(s.repeated&&!s.options.packed)l[s.name].push(s.decode(o,t));else if(s.map){var c=s.decode(o,t);l[s.name].set(c[0],c[1])}else if(l[s.name]=s.decode(o,t),s.oneof){var d=l[s.oneof.name];null!==d&&d!==s.name&&(l[d]=null),l[s.oneof.name]=s.name}}else switch(o){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:var f=t.readVarint32();t.offset+=f;break;case e.WIRE_TYPES.STARTGROUP:for(;_(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+o)}}for(var h=0,g=this._fields.length;h<g;++h)if(null===l[(s=this._fields[h]).name])if("proto3"===this.syntax)l[s.name]=s.defaultValue;else{if(s.required){var p=Error("Missing at least one required field for "+this.toString(!0)+": "+s.name);throw p.decoded=l,p}e.populateDefaults&&null!==s.defaultValue&&(l[s.name]=s.defaultValue)}return l},t.Message=c;var f=function(t,n,i,o,a,s,u,l,d,_){r.call(this,t,n,s),this.className="Message.Field",this.required="required"===i,this.repeated="repeated"===i,this.map="map"===i,this.keyType=o||null,this.type=a,this.resolvedType=null,this.id=u,this.options=l||{},this.defaultValue=null,this.oneof=d||null,this.syntax=_||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof c.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},h=f.prototype=Object.create(r.prototype);h.build=function(){this.element=new s(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new s(this.keyType,void 0,!0,this.syntax,this.name)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=s.defaultFieldValue(this.type)},h.verifyValue=function(t,n){n=n||!1;var r,i=this;function o(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}if(null===t)return this.required&&o(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&o(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!n){Array.isArray(t)||(t=[t]);var a=[];for(r=0;r<t.length;r++)a.push(this.element.verifyValue(t[r]));return a}return this.map&&!n?t instanceof e.Map?t:(t instanceof Object||o(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&o(typeof t,"no array expected"),this.element.verifyValue(t))},h.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[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}},h.encode=function(t,r,i){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{var o;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1);var a=r.offset;for(o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],r);var s=r.offset-a,u=n.calculateVarint32(s);if(u>1){var l=r.slice(a,r.offset);a+=u-1,r.offset=a,r.append(l)}r.writeVarint32(s,a-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,o){var a=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(a),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},h.calculate=function(t,r){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;var i=0;try{var o,a;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),a=0,o=0;o<t.length;o++)a+=this.element.calculateLength(this.id,t[o]);i+=n.calculateVarint32(a),i+=a}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,o){var a=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(a),i+=a}),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},h.decode=function(t,n,r){var i,o;if(!(!this.map&&t==this.type.wireType||!r&&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&&!r){o=n.readVarint32(),o=n.offset+o;for(var a=[];n.offset<o;)a.push(this.decode(this.type.wireType,n,!0));return a}if(this.map){var u=s.defaultFieldValue(this.keyType);if(i=s.defaultFieldValue(this.type),o=n.readVarint32(),n.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+n.remaining());var l=n.clone();for(l.limit=l.offset+o,n.offset+=o;l.remaining()>0;){var c=l.readVarint32();t=7&c;var d=c>>>3;if(1===d)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(n,t,this.id)},t.Message.Field=f;var g=function(e,t,n,r,i,o,a){f.call(this,e,t,n,null,r,i,o,a),this.extension};g.prototype=Object.create(f.prototype),t.Message.ExtensionField=g;t.Message.OneOf=function(e,t,n){r.call(this,e,t,n),this.fields=[]};var p=function(e,t,n,r,i){o.call(this,e,t,n,r,i),this.className="Enum",this.object=null};p.getName=function(e,t){for(var n,r=Object.keys(e),i=0;i<r.length;++i)if(e[n=r[i]]===t)return n;return null},(p.prototype=Object.create(o.prototype)).build=function(t){if(this.object&&!t)return this.object;for(var n=new e.Builder.Enum,r=this.getChildren(p.Value),i=0,o=r.length;i<o;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},t.Enum=p;var E=function(e,t,n,i){r.call(this,e,t,n),this.className="Enum.Value",this.id=i};E.prototype=Object.create(r.prototype),t.Enum.Value=E;var b=function(e,t,n,i){r.call(this,e,t,n),this.field=i};b.prototype=Object.create(r.prototype),t.Extension=b;var T=function(e,t,n,r){o.call(this,e,t,n,r),this.className="Service",this.clazz=null};(T.prototype=Object.create(o.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){for(var r=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=r.prototype=Object.create(e.Builder.Service.prototype),o=t.getChildren(e.Reflect.Service.RPCMethod),a=0;a<o.length;a++)!function(e){i[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(n,r){if(n)i(n);else{null===r&&(r="");try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}r&&r instanceof e.resolvedResponseType.clazz?i(null,r):i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}}))}catch(e){setTimeout(i.bind(this,e),0)}},r[e.name]=function(t,n,i){new r(t)[e.name](n,i)},Object.defineProperty&&(Object.defineProperty(r[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(i[e.name],"$options",{value:r[e.name].$options}))}(o[a]);return Object.defineProperty&&(Object.defineProperty(r,"$options",{value:t.buildOpt()}),Object.defineProperty(i,"$options",{value:r.$options}),Object.defineProperty(r,"$type",{value:t}),Object.defineProperty(i,"$type",{value:t})),r}(e,this)},t.Service=T;var v=function(e,t,n,i){r.call(this,e,t,n),this.className="Service.Method",this.options=i||{}};(v.prototype=Object.create(r.prototype)).buildOpt=a.buildOpt,t.Service.Method=v;var R=function(e,t,n,r,i,o,a,s){v.call(this,e,t,n,s),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=a,this.resolvedRequestType=null,this.resolvedResponseType=null};return R.prototype=Object.create(v.prototype),t.Service.RPCMethod=R,t}(t),t.Builder=function(e,t,n){var r=function(e){this.ns=new n.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},i=r.prototype;function o(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,o(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}return r.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},r.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},r.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},r.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},r.isExtend=function(e){return"string"==typeof e.ref},i.reset=function(){return this.ptr=this.ns,this},i.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 n.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},i.create=function(t){if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(var i=[t];i.length>0;){if(t=i.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var o=t.shift();if(r.isMessage(o)){var a=new n.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),s={};o.oneofs&&Object.keys(o.oneofs).forEach((function(e){a.addChild(s[e]=new n.Message.OneOf(this,a,e))}),this),o.fields&&o.fields.forEach((function(e){if(null!==a.getChild(0|e.id))throw Error("duplicate or invalid field id in "+a.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+a.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=s[e.oneof]))throw Error("illegal oneof in "+a.name+"#"+e.name+": "+e.oneof);e=new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,o.syntax),t&&t.fields.push(e),a.addChild(e)}),this);var u=[];if(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&&("number"==typeof o.extensions[0]?a.extensions=[o.extensions]:a.extensions=o.extensions),this.ptr.addChild(a),u.length>0){i.push(t),t=u,u=null,this.ptr=a,a=null;continue}u=null}else if(r.isEnum(o))a=new n.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){a.addChild(new n.Enum.Value(this,a,e.name,e.id))}),this),this.ptr.addChild(a);else if(r.isService(o))a=new n.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(a);else{if(!r.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(a=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){if(null!==a.getChild(0|t.id))throw Error("duplicate extended field id in "+a.name+": "+t.id);if(a.extensions){var r=!1;if(a.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(r=!0)})),!r)throw Error("illegal extended field id in "+a.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var o=new n.Message.ExtensionField(this,a,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),s=new n.Extension(this,this.ptr,t.name,o);o.extension=s,this.ptr.addChild(s),a.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,a=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},i.import=function(t,n){var r="/";if("string"==typeof n){if(e.Util.IS_NODE&&(n=require("path").resolve(n)),!0===this.files[n])return this.reset();this.files[n]=!0}else if("object"==typeof n){var i,a=n.root;if(e.Util.IS_NODE&&(a=require("path").resolve(a)),(a.indexOf("\\")>=0||n.file.indexOf("\\")>=0)&&(r="\\"),i=e.Util.IS_NODE?require("path").join(a,n.file):a+r+n.file,!0===this.files[i])return this.reset();this.files[i]=!0}if(t.imports&&t.imports.length>0){var s,u=!1;"object"==typeof n?(this.importRoot=n.root,u=!0,s=this.importRoot,n=n.file,(s.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(r="\\")):"string"==typeof n?this.importRoot?s=this.importRoot:n.indexOf("/")>=0?""===(s=n.replace(/\/[^\/]*$/,""))&&(s="/"):n.indexOf("\\")>=0?(s=n.replace(/\\[^\\]*$/,""),r="\\"):s=".":s=null;for(var l=0;l<t.imports.length;l++)if("string"==typeof t.imports[l]){if(!s)throw Error("cannot determine import root");var c=t.imports[l];if("google/protobuf/descriptor.proto"===c)continue;if(c=e.Util.IS_NODE?require("path").join(s,c):s+r+c,!0===this.files[c])continue;/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json"));var d=e.Util.fetch(c);if(null===d)throw Error("failed to import '"+c+"' in '"+n+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(d+""),c):this.import(e.DotProto.Parser.parse(d),c)}else n?/\.(\w+)$/.test(n)?this.import(t.imports[l],n.replace(/^(.+)\.(\w+)$/,(function(e,t,n){return t+"_import"+l+"."+n}))):this.import(t.imports[l],n+"_import"+l):this.import(t.imports[l]);u&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&o(t);var _=this.ptr;return t.options&&Object.keys(t.options).forEach((function(e){_.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=_),t.enums&&(this.create(t.enums),this.ptr=_),t.services&&(this.create(t.services),this.ptr=_),t.extends&&this.create(t.extends),this.reset()},i.resolveAll=function(){var r;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof n.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof n.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(!(r=(this.ptr instanceof n.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=r,r instanceof n.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==r.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(r instanceof n.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=r.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]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==e.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&(this.ptr.options.packed=!0)}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(!((r=this.ptr.parent.resolve(this.ptr.requestName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=r,!((r=this.ptr.parent.resolve(this.ptr.responseName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=r}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()},i.build=function(e){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(var t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},i.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},i.toString=function(){return"Builder"},r.Message=function(){},r.Enum=function(){},r.Service=function(){},r}(t,t.Lang,t.Reflect),t.Map=function(e,t){var n=function(e,n){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}}),n)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=this.keyElem.valueFromString(r[i]),a=this.valueElem.verifyValue(n[r[i]]);this.map[this.keyElem.valueToString(o)]={key:o,value:a}}},r=n.prototype;function i(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}return r.clear=function(){this.map={}},r.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},r.entries=function(){for(var e,t=[],n=Object.keys(this.map),r=0;r<n.length;r++)t.push([(e=this.map[n[r]]).key,e.value]);return i(t)},r.keys=function(){for(var e=[],t=Object.keys(this.map),n=0;n<t.length;n++)e.push(this.map[t[n]].key);return i(e)},r.values=function(){for(var e=[],t=Object.keys(this.map),n=0;n<t.length;n++)e.push(this.map[t[n]].value);return i(e)},r.forEach=function(e,t){for(var n,r=Object.keys(this.map),i=0;i<r.length;i++)e.call(t,(n=this.map[r[i]]).value,n.key,this)},r.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},r.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},r.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},n}(0,t.Reflect),t.loadProto=function(e,n,r){return("string"==typeof n||n&&"string"==typeof n.file&&"string"==typeof n.root)&&(r=n,n=void 0),t.loadJson(t.DotProto.Parser.parse(e),n,r)},t.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=t.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=t.populateAccessors),new t.Builder(e)},t.loadJson=function(e,n,r){return("string"==typeof n||n&&"string"==typeof n.file&&"string"==typeof n.root)&&(r=n,n=null),n&&"object"==typeof n||(n=t.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),n.import(e,r),n.resolveAll(),n},t}();var ca,da,_a,fa,ha,ga,pa,Ea,ba,Ta="NotifyMsg",va="SyncRequestMsg",Ra="UpStreamMessage",Ia="DownStreamMessages",ma="ChrmDownStreamMessages",ya="DownStreamMessage",Aa="ExtMsgData",Sa="GetQNupTokenInput",Oa="GetDownloadUrlInput",Na="GetQNupTokenOutput",Ca="GetDownloadUrlOutput",Pa="ChrmInput",La="ChrmOutput",wa="ChrmPullMsg",Ma="RelationQryInput",Ua="RelationQryFilter",Da="RelationsOutput",Ga="QryRemindListReq",Va="QryRemindListResp",ja="CleanHisMsgInput",ka="CleanMsgBatchReq",xa="QueryChatRoomInfoInput",Fa="QueryChatRoomInfoOutput",Ba="HistoryMsgInput",Ha="HistoryMsgOuput",qa="SessionsAttQryInput",Ya="SessionsAttOutput",Wa="SessionMsgReadInput",Ka="DeleteSessionsInput",Ja="QuerySessionsInput",Qa="QuerySessionsOutPut",Xa="RelationDelBatchReq",Za="DeleteMsgInput",za="SetChrmKV",$a="SetChrmKVS",es="ChrmKVOutput",ts="ChrmKVSOutput",ns="QueryChrmKV",rs="SetUserSettingInput",is="SetUserSettingOutput",os="PullUserSettingInput",as="PullUserSettingOutput",ss="SessionReq",us="SessionStates",ls="SessionStateModifyReq",cs="GroupUnpushQuery",ds="GroupUnpushSet",_s="GroupUnpushResult",fs="SessionStateModifyResp",hs="TypeUnpushInput",gs="TypeUnpushOutput",ps="GrpReadReceiptMsg",Es="ReadReceipt",bs="QueryReceiptReq",Ts="QueryReceiptBatchReq",vs="ReceiptResp",Rs="QueryReceiptBatchResp",Is="GrpReadReceiptQryResp",ms="SessionTagAddInput",ys="SessionTagDelInput",As="UserSettingNotification",Ss="ReportSDKInput",Os="UltraGrpPullSes",Ns="UltraGrpPullMsg",Cs="MsgChangeReq",Ps="ModifyMsgResp",Ls="QueryMsgChange",ws="EventChangeList",Ms="MsgChangeList",Us="MsgQuery",Ds="MsgQueryAck",Gs="OperateStatus",Vs="OperateStatusNotify",js="SetRtcRoomIdInput",xs="CallInfoUpStream",Fs="CallInfoDownStream",Bs="KvInput",Hs="KvOutput",qs="ReadReceiptMsg",Ys="ReceiptQryReq",Ws="QueryReceiptResp",Ks="ReceiptCntQryReq",Js="ReceiptCntQryResp",Qs="UpdateUserSubReq",Xs="UpdateUserSubResp",Zs="PullUserSubReq",zs="PUllUserSubResp",$s="PullSubDataReq",eu="PullSubDataResp",tu="SubDataDetail",nu="QrySubDataReq",ru="UserProfile",iu="SetUserProfileResp",ou="PullUserProfileReq",au="UserProfiles",su="UserProfileInput",uu="UserProfilePermission",lu="SearchUserProfile",cu="ChannelsInput",du="ChannelsOutput",_u="MultiChannels",fu="ModifyChannelsInput",hu="ChannelsQueryInput",gu="ChannelsListResult",pu="ChannelsInviteStatusInfos",Eu="ChannelsUserInfos",bu="ChannelsJoinedInfos",Tu="ChannelsMemberUpdateInput",vu="ChannelsMemberResponseInput",Ru="ChannelsMembersInput",Iu="FriendInput",mu="FriendsInput",yu="FriendsCheckOutput",Au="FriendProfileInput",Su="FriendProfileOutput",Ou="FriendQueryInput",Nu="FriendsListInput",Cu="FriendLevelSet",Pu="FriendUserInfos",Lu="FriendInviteInfos",wu="ChannelApplyInfo",Mu="AddUnpushPeriodInput",Uu="DeleteUnpushPeriodInput",Du="QueryUnpushPeriodInput",Gu="QueryUnpushPeriodOutput",Vu="MsgReadEvent",ju="ConvertMsgInput",ku="SpeechToTextInfo",xu="ConvertMsgOutput",Fu="SpeechToTextResult",Bu="TransReq",Hu="TransResp",qu="PullModifyMsgReq",Yu="PullModifyMsgResp",Wu="SetUserStatusInput",Ku="MCFollowInput",Ju="RtcQueryListInput",Qu="RtcKeyDeleteInput",Xu="RtcValueInfo",Zu="RtcUserListOutput",zu="RtcInput",$u="RtcQryOutput",el="RtcDataInput",tl="RtcSetDataInput",nl="RtcUserSetDataInput",rl="RtcOutput",il="RtcTokenOutput",ol="RtcNotifyMsg",al="RtcPullKV",sl="RtcKVOutput",ul="RtcQueryUserJoinedInput",ll="RtcQueryUserJoinedOutput",cl="RtcViewerJoinedOutput",dl="RtcInviteInput",_l="RtcCancelInviteInput",fl="RtcInviteAnswerInput",hl="RtcEndInviteInput",gl="BotInput",pl="BotOutput",El=function(){function e(e){ca.add(this),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0});var t=la.loadProto(e);this.pbModules=t.build("Modules").probuf}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.pbModules[e].encode(t).toArrayBuffer()}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{var n=this.pbModules[e].decode(t);return c(this,ca,"m",da).call(this,n)}catch(t){var r="name: ".concat(e,", stack: ").concat(t.stack);throw null===console||void 0===console||console.error("pb decode error!",r),t}}}),e}();ca=new WeakSet,da=function e(t,n){var r,i=this;if(t instanceof Array)return t.map((function(t){return c(i,ca,"m",e).call(i,t)}));if(r=t,"[object Object]"!==Object.prototype.toString.call(r))return t;if(t instanceof la.ByteBuffer)return t.toArrayBuffer();if(t instanceof la.Long)return n?t.toString():t.toNumber();var o={};return Object.keys(t).forEach((function(n){var r=t[n],a=t.$type.name===Aa&&"seqId"===n;o[n]=c(i,ca,"m",e).call(i,r,a)})),o},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"}(_a||(_a={})),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"}(fa||(fa={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(ha||(ha={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(ga||(ga={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(pa||(pa={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(Ea||(Ea={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(ba||(ba={}));var bl,Tl,vl,Rl,Il,ml,yl,Al,Sl,Ol=new El("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 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 optional string convertExt = 24;\n optional ExtMsgData extMsgData = 25;\n }\n message ExtMsgData {\n optional int64 seqId = 1;\n optional int64 sendTime = 2;\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 repeated ChannelType channelType = 9;\n optional int32 botType = 10;\n }\n message RelationQryFilter {\n repeated ChannelType type = 1;\n optional int32 count = 2;\n optional int32 order = 3;\n repeated string tags = 4;\n optional bool isTagTop = 5;\n optional string pageToken = 6;\n optional bool compress = 7;\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 optional string pageToken = 6;\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 optional bool isBot = 12;\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 optional bool ignoreCmd = 10;\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 optional bool cleanMsg = 2;\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 optional bool ignoreVersion = 3;\n }\n message SetUserSettingOutput {\n required int64 version=1;\n required bool reserve=2;\n optional bool updateVersion = 3;\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 required 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 optional int64 time = 4;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n AutoTrans = 4;\n }\n message SessionStateModifyReq {\n required int64 version=1;\n repeated SessionState state= 2;\n optional bool ignoreVersion = 3;\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 optional bool updateVersion = 2;\n }\n message TypeUnpushInput {\n required ChannelType type = 1;\n required int64 version = 2;\n required int32 unpushLevel = 3;\n optional bool ignoreVersion = 4;\n }\n message TypeUnpushOutput {\n required int64 version = 1;\n optional bool updateVersion = 2;\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 QueryReceiptBatchReq {\n repeated QueryReceipt items = 1;\n optional bool compress = 2;\n }\n message QueryReceipt {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated string msgIds = 4;\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 QueryReceiptBatchResp {\n repeated QueryReceiptBatchRespItem item = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n }\n\n message QueryReceiptBatchRespItem {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated QueryReceiptRespItem msg = 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 optional bool ignoreVersion = 3;\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 optional bool ignoreVersion = 3;\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 ModifyMsgResp {\n optional int64 modifyTime = 1;\n optional DownStreamMessage msg = 2;\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 repeated string notExistMsgId = 2;\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 optional int32 botType = 6;\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 optional bool isBan = 6;\n optional int64 banEndTime = 7;\n optional bool isBot = 8;\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 message ConvertMsgInput {\n optional int32 businessType = 1;\n optional bytes businessInfo = 2;\n }\n message SpeechToTextInfo {\n optional string msgId = 1;\n optional string objectName = 2;\n optional string content = 3;\n optional int32 sampleRate = 4;\n optional int32 channelNumber = 5;\n optional string format = 6;\n optional string extra = 7;\n }\n message ConvertMsgOutput {\n optional int32 businessType = 1;\n optional bytes businessResult = 2;\n }\n message SpeechToTextResult {\n optional string result = 1;\n optional string message = 2;\n }\n message TransReq {\n repeated TransInfo transInfos = 1;\n optional int32 model = 2;\n optional bool forceTrans = 3;\n }\n message TransResp {\n repeated TransResult results = 1;\n optional int32 model = 2;\n }\n message TransInfo {\n optional string messageUID = 1;\n optional int32 transType = 2;\n optional string text = 3;\n optional string transFileUrl = 4;\n optional string sourceLan = 5;\n optional string targetLan = 6;\n optional int32 inputSource = 7;\n }\n message TransResult {\n optional string messageUID = 1;\n optional string transResult = 2;\n optional string sourceLan = 3;\n optional string targetLan = 4;\n optional int32 code = 5;\n optional int32 inputSource = 6;\n }\n message PullModifyMsgReq { \n optional int64 pullVersion = 1;\n optional bool compress = 2;\n repeated int32 modifyType = 3;\n }\n message PullModifyMsgResp {\n repeated ModifyMsg msg = 1;\n optional int64 nextVersion = 2;\n optional bool finished = 3;\n optional bool compress = 4;\n optional bytes compressedData = 5;\n }\n message ModifyMsg {\n optional int32 modifyType = 1;\n optional DownStreamMessage msg = 2;\n }\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 SetUserStatusInput {\n optional int32 status=1;\n }\n message MCFollowInput {\n required string state = 1;\n }\n message RtcQueryListInput {\n optional int32 order=1;\n }\n message RtcKeyDeleteInput {\n repeated string key=1;\n }\n message RtcValueInfo {\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo {\n required string userId=1;\n repeated RtcValueInfo userData=2;\n }\n message RtcUserListOutput {\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4;\n repeated RtcKVEntity entries = 5;\n optional int64 syncTime = 6;\n optional int32 offlineKickTime = 7;\n }\n message RtcRoomInfoOutput {\n optional string roomId = 1;\n repeated RtcValueInfo roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message 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 RtcValueInfo innerDatas = 7;\n repeated RtcValueInfo outerDatas = 8;\n }\n message RtcQryOutput {\n repeated RtcValueInfo outInfo=1;\n }\n message 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 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 RtcUserSetDataInput {\n repeated RtcValueInfo valueInfo = 1;\n required string objectName = 2;\n repeated 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 optional int32 nothing=1;\n optional int64 version=2;\n }\n message RtcTokenOutput {\n required string rtcToken=1;\n }\n message RtcSetOutDataInput {\n required TargetType target=1;\n repeated RtcValueInfo valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message RtcQryUserOutDataInput {\n repeated string userId = 1;\n }\n message RtcUserOutDataOutput {\n repeated RtcUserInfo user = 1;\n }\n message RtcNotifyMsg {\n required int32 type= 1;\n optional int64 time= 2;\n optional string roomId=3;\n }\n message RtcPullKV {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity {\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 RtcKVOutput {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType {\n AnchorToViewer = 1;\n ViewerToAnchor = 2;\n }\n message RtcQueryUserJoinedInput {\n required string userId = 1;\n }\n message RtcJoinedInfo {\n required string deviceId = 1;\n required string roomId = 2;\n optional int64 joinTime = 3;\n }\n message RtcQueryUserJoinedOutput {\n repeated RtcJoinedInfo info = 1;\n }\n message RtcViewerJoinedOutput {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;\n optional int64 syncTime = 3;\n }\n message RtcInviteInput {\n required string invitedUserId=1;\n optional int32 timeoutTime=2;\n required string invitedRoomId=3;\n required string inviteInfo=4;\n required string inviteSessionId= 5;\n }\n message RtcCancelInviteInput {\n required string invitedUserId=1;\n required string invitedRoomId=2;\n required string inviteInfo=3;\n required string inviteSessionId=4;\n }\n message RtcInviteAnswerInput {\n required string inviteUserId=1;\n required int32 answerCode=2;\n required string inviteRoomId=3;\n required string inviteSessionId=4;\n required string content=5;\n optional string key=6;\n optional string value=7;\n }\n message RtcEndInviteInput {\n required string inviteRoomId=1;\n required string inviteSessionId=2;\n required string inviteContent=3;\n repeated string inviteRoomKeys=4;\n }\n message BotInput {\n repeated string ids = 1;\n }\n message BotOutput{\n repeated BotInfo bots = 1;\n }\n message BotInfo{\n optional string id = 1; \n optional string name = 2;\n optional string portraitUrl = 3;\n optional string type = 4;\n repeated MetadataInfo metadata = 5;\n optional int64 createTime = 6;\n optional int64 updateTime = 7;\n }\n message MetadataInfo{\n optional string key = 1; \n optional string value = 2;\n }\n}\n");!function(e){e[e.LOG=0]="LOG",e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL",e[e.STATISTICS=6]="STATISTICS",e[e.NONE=1e3]="NONE"}(bl||(bl={})),function(e){e.IM="IM",e.RTC="RTC"}(Tl||(Tl={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",e[e.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",e[e.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",e[e.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",e[e.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",e[e.BLOCKED=9]="BLOCKED",e[e.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",e[e.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",e[e.REDIRECT=14]="REDIRECT",e[e.USER_LOGOUT=19]="USER_LOGOUT",e[e.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",e[e.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",e[e.ULTRALIMIT=1101]="ULTRALIMIT",e[e.REQUEST_NAVI=201]="REQUEST_NAVI",e[e.RESPONSE_NAVI=202]="RESPONSE_NAVI",e[e.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",e[e.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR"}(vl||(vl={})),function(e){e[e.RTC=0]="RTC",e[e.LIVE=2]="LIVE",e[e.SIP=4]="SIP",e[e.CALL=5]="CALL",e[e.MEETING=6]="MEETING",e[e.CROSS_MUTI=7]="CROSS_MUTI",e[e.CROSS_LIVE=8]="CROSS_LIVE"}(Rl||(Rl={})),function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(Il||(Il={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(ml||(ml={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(yl||(yl={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Al||(Al={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(Sl||(Sl={}));var Nl=null;function Cl(e,t,n,r){void 0===n&&(n={});var i=["error","warn","info","debug"][3-e];if(Nl&&e<bl.FATAL)try{var o=JSON.stringify(n);Nl[i](t,o)}catch(e){console.error(e)}}var Pl,Ll,wl,Ml,Ul,Dl,Gl,Vl,jl,kl,xl,Fl=Cl.bind(null,bl.DEBUG),Bl={init:function(e){Nl=e},info:Cl.bind(null,bl.INFO),debug:Fl,warn:Cl.bind(null,bl.WARN),error:Cl.bind(null,bl.ERROR),fatal:Cl.bind(null,bl.FATAL)},Hl=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,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n})}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n,once:!0})}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._map[e];r&&((r=r.filter((function(e){return e.listener!==t||e.target!==n}))).length?this._map[e]=r:delete this._map[e])}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map[e];if(r)for(var i=0;i<r.length;i+=1){var o=r[i],a=o.target,s=o.once,c=o.listener;s&&(r.splice(i,1),i-=1);try{c.call.apply(c,l([a],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}(),ql=function(e,t,n){var r=null==n?void 0:n.isReverse;At(e)&&function(){for(var n in e)t(e[n],n,e)}(),(Rt(e)||Et(e))&&function(){if(r)for(var n=e.length-1;n>=0;n--)t(e[n],n);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},Yl=function(e,t){return ql(e,(function(n,r){e[r]=t(n,r)})),e},Wl=function(e){return"[object Null]"===Object.prototype.toString.call(e)},Kl=function(){function e(e){Object.defineProperty(this,"pbCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbCodec=new El(e)}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return n?t:this.pbCodec.encode(e,t)}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.pbCodec.decode(e,t)}}),e}(),Jl=function(e,t,n,r,i){var o=r?Object.keys(r).map((function(e){return{key:e,value:r[e]}})):void 0,a=i?Object.keys(i).map((function(e){return{key:e,value:i[e]}})):void 0;return Ol.encode(zu,{roomType:e,broadcastType:t,joinType:n,innerDatas:o,outerDatas:a})},Ql=function(e){var t=Ol.decode(Zu,e),n=t.users,r=t.token,i=t.sessionId,o=t.roomInfo,a=t.entries,s=t.offlineKickTime,u={};return ql(n,(function(e){var t=e.userId,n=e.userData,r={};ql(n,(function(e){var t=e.key,n=e.value;r[t]=n})),u[t]=r})),{users:u,token:r,sessionId:i,roomInfo:o,kvEntries:a,offlineKickTime:s}},Xl=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,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,n=e.timestamp,(r=this._pullTime)>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS?(this._isPulling=!1,this._pullTime=s||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}(),Zl=function(){function e(e,t,n){Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:t}),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 Xl(this)}return Object.defineProperty(e.prototype,"appkey",{get:function(){return this._appkey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"initOption",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"logger",{get:function(){return this._logger},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._rtcSignalingListener=e}}),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,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=Ol.encode(al,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,hi,!0,t)];case 1:return(n=a.sent()).isOk?(i=Ol.decode(sl,n.data),o=i.entries,s=i.syncTime,o=(o||[]).map((function(e){return r(r({},e),{timestamp:e.timestamp})})),this._watcher.onRTCDataChange(o,e),[2,Tn(s)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"_receiveRtcKv",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=Ol.decode(ol,e),n=t.time,r=t.type,i=t.roomId;1===r&&this._rtcKVManager.pullEntry(i,n)}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),e}();!function(e){e.INIT="INIT",e.DATA="DATA",e.END="END"}(Pl||(Pl={}));var zl=function(e){function n(t,n){var r=e.call(this)||this;return Ll.add(r),wl.set(r,void 0),Ml.set(r,new Map),Ul.set(r,void 0),d(r,wl,t,"f"),d(r,Ul,n,"f"),r}return t(n,e),Object.defineProperty(n.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=c(this,Ll,"a",Dl).createTraceId(),c(this,Ll,"a",Dl).info(B.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,Rn.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(c(this,wl,"f").validateConnected).tryTrans((function(e){var t,n;return(null===(n=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===n?void 0:n.length)?Tn(e.streamServer.addrs):vn(x.STREAM_MESSAGE_DISABLE)})).next((function(t){return c(r,Ll,"m",xl).call(r,e,t)}))];case 1:return n=i.sent(),c(this,Ll,"a",Dl).summary(B.L_REQ_STREAM_MSG_CONTENT_R,n,t,{messageUId:e}),[2,n.wipe()]}}))}))}}),n}(gn);wl=new WeakMap,Ml=new WeakMap,Ul=new WeakMap,Ll=new WeakSet,Dl=function(){return c(this,wl,"f").logger},Gl=function(e,t,n){var r=c(this,Ml,"f").get(e);r&&(c(this,Ml,"f").delete(e),c(this,Ll,"m",Vl).call(this,e,Pl.END,t,r.msg))},Vl=function(e,t,n,r,i){this.emit("message",{code:n,messageUId:e,type:t,chunk:i,message:r})},jl=function(e,t){e.content=r(r({},e.content),t),c(this,wl,"f")._innerSetMessageContent(e.messageId,JSON.stringify(e.content),e.messageType)},kl=function(e,t,n){var r,i,o=c(this,Ml,"f").get(t);switch(e){case"init":o.msg&&c(this,Ll,"m",jl).call(this,o.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),c(this,Ll,"m",Vl).call(this,t,Pl.INIT,x.SUCCESS,o.msg);break;case"complete":i=(r=n.length?JSON.parse(n):{}).complete||!1,o.msg&&c(this,Ll,"m",jl).call(this,o.msg,{stopReason:r.stopReason||0,completeReason:r.completeReason||0,complete:i,isSynced:i}),c(this,Ll,"m",Gl).call(this,t,r.stopReason||0,i);break;default:r=JSON.parse(n),o.cached+=r.content,o.msg&&c(this,Ll,"m",jl).call(this,o.msg,{content:o.cached}),c(this,Ll,"m",Vl).call(this,t,Pl.DATA,x.SUCCESS,o.msg,{content:r.content,fullContent:o.cached})}},xl=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return c(this,Ml,"f").has(e)?[2,vn(x.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:c(this,Ml,"f").size>=3?[2,vn(x.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(n=ua.createSSEClient({logger:c(this,Ll,"a",Dl),msgUId:e,appkey:c(this,wl,"f").appkey,token:c(this,wl,"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 n=t.indexOf("\n"),r=t.slice(0,n).replace("event:",""),i=t.slice(n+1+5);c(d,Ll,"m",kl).call(d,r,e,i.trim())}}))},onNetworkError:function(t){c(d,Ll,"m",Gl).call(d,e,t,!1)}}),n.isOk?(r=n.data,i={client:r,cached:"",msg:void 0},c(this,Ml,"f").set(e,i),c(this,Ul,"f")?[4,c(this,wl,"f").getLocalMessage(e)]:[3,2]):[2,n.wipe()]);case 1:if(o=a.sent(),s=o.code,!(u=o.data))return c(this,Ml,"f").delete(e),[2,vn(s,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return c(this,Ml,"f").delete(e),[2,vn(x.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,a.label=2;case 2:return[4,r.open(t.slice())];case 3:return(l=a.sent()).isOk||c(this,Ml,"f").delete(e),[2,l.wipe()]}}))}))};var $l,ec,tc=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 Kl(t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new El(e)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(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.32.0"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.32.0"}}),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,n){return console.warn("[PluginContext] sendMessage is deprecated, please use sendMessageTo instead"),this.sendMessageTo({conversationType:e,targetId:t,channelId:n.channelId},n)}}),Object.defineProperty(e.prototype,"sendMessageTo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.innerSendMessage(e,t)}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){void 0===r&&(r=[]),this._context.registerMessageType(e,t,n,r)}}),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,n){return this._context.setCallInfo(e,t,n)}}),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}(),nc=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"joinRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return o=Jl(t,n,r,i,s),[4,this.rtcSignaling(e,ti,!0,o)];case 1:return u=a.sent(),l=u.code,c=u.buffer,l===x.SUCCESS&&c&&(d=Ql(c)),[2,{code:l,data:d}]}}))}))}}),Object.defineProperty(n.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Ol.encode(Wu,{status:0}),[4,this.rtcSignaling(e,ni,!0,t)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._context.rtcPing(e,t,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcPingResVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._context.rtcPing(e,t,n)}}),Object.defineProperty(n.prototype,"getRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("Method not implemented.")}}),Object.defineProperty(n.prototype,"setRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Ol.encode(Xu,{key:t,value:n}),[4,this.rtcSignaling(e,ri,!0,r)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"removeRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Ol.encode(Qu,{key:t}),[4,this.rtcSignaling(e,ii,!1,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return o=Ol.encode(tl,{interior:r,target:i,key:t,value:n,objectName:null==s?void 0:s.name,content:null==s?void 0:s.content}),[4,this.rtcSignaling(e,oi,!1,o)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return o={objectName:r,content:[{key:t.name,value:t.content}],valueInfo:[{key:"uris",value:n},{key:"mcu_uris",value:i}]},s=Ol.encode(nl,o),[4,this.rtcSignaling(e,ai,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Ol.encode(nl,{objectName:t,valueInfo:[{key:"cdn_uris",value:n}]}),[4,this.rtcSignaling(e,ai,!0,r)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"getRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=Ol.encode(el,{interior:n,target:r,key:t}),[4,this.rtcSignaling(e,si,!0,i)];case 1:return o=a.sent(),s=o.code,u=o.buffer,s===x.SUCCESS&&u?(l=Ol.decode($u,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:s,data:c}]):[2,{code:s}]}}))}))}}),Object.defineProperty(n.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return o=Ol.encode(el,{interior:n,target:r,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,ui,!1,o)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(n.prototype,"getRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(n.prototype,"getRTCToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=Jl(t,n),[4,this.rtcSignaling(e,li,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=Ol.decode(il,s).rtcToken,[2,{code:o,data:{rtcToken:u}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"setRTCState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Ol.encode(Ku,{state:t}),[4,this.rtcSignaling(e,ci,!0,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=Ol.encode(Ju,{order:2}),[4,this.rtcSignaling(e,di,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i?(o=Ql(i),[2,{code:r,data:o}]):[2,{code:r}]}}))}))}}),Object.defineProperty(n.prototype,"joinLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return r=Jl(t,n),[4,this.rtcSignaling(e,_i,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=Ol.decode(cl,s),l=u.rtcToken,c=u.entries,[2,{code:o,data:{token:l,kvEntries:c}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"quitLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Ol.encode(Wu,{status:0}),[4,this.rtcSignaling(e,fi,!0,t)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcIdentityChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=Ol.encode(zu,{roomType:Rl.LIVE,broadcastType:n,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,gi,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=Ql(s),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,s=e.roomId,u=Ol.encode(dl,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(s,pi,!0,u)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,s=Ol.encode(_l,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,inviteInfo:i}),[4,this.rtcSignaling(o,Ei,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return t=e.inviteUserId,n=e.inviteRoomId,r=e.inviteSessionId,i=e.content,o=e.key,s=e.value,u=e.agree,l=e.roomId,c=Ol.encode(fl,{inviteUserId:t,inviteRoomId:n,inviteSessionId:r,content:i,key:o,value:s,answerCode:u?1:0}),[4,this.rtcSignaling(l,bi,!0,c)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.endRoomId,n=e.sessionId,r=e.content,i=e.keys,o=e.roomId,s=Ol.encode(hl,{inviteRoomId:t,inviteSessionId:n,inviteContent:r,inviteRoomKeys:i}),[4,this.rtcSignaling(o,Ti,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"registerRTCSignalListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.registerRTCSignalingListener(e)}}),Object.defineProperty(n.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return[4,this._context.rtcSignaling(e,t,n,r)];case 1:return[2,{code:(i=o.sent()).code,buffer:i.data}]}}))}))}}),Object.defineProperty(n.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=Ol.encode(ul,{userId:e}),[4,this.rtcSignaling("",vi,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i?(o=Ol.decode(ll,i).info,[2,{code:r,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:r}]}}))}))}}),n}(tc);!function(e){e[e.STRING=0]="STRING",e[e.ONLY_STRING=1]="ONLY_STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.OBJECT=4]="OBJECT",e[e.ARRAY=5]="ARRAY",e[e.CALLBACK=6]="CALLBACK",e[e.CHANNEL_ID=7]="CHANNEL_ID"}(ec||(ec={}));var rc=(($l={})[ec.STRING]=mt,$l[ec.ONLY_STRING]=Et,$l[ec.NUMBER]=Tt,$l[ec.BOOLEAN]=function(e){return"boolean"==typeof e},$l[ec.OBJECT]=At,$l[ec.ARRAY]=Rt,$l[ec.CALLBACK]=function(e){var t=!0;return At(e)||(t=!1),(e=e||{}).onSuccess&&!St(e.onSuccess)&&(t=!1),e.onError&&!St(e.onError)&&(t=!1),t},$l[ec.CHANNEL_ID]=wt,$l),ic=function(e){function n(t){var n=e.call(this,t)||this;return n.name="RCAssertError",n}return t(n,e),n}(Error),oc=function(e,t,n,r){if(void 0===r&&(r=!1),!ac(e,t,n,r))throw new ic("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},ac=function(e,t,n,r){void 0===r&&(r=!1),n=rc[n]||n;var i=r?n(t):Ot(t)||null==t||n(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},sc=function(e,t){var n=Rr(e).searchProps;return n&&0!==n.length?n.every((function(e){return void 0!==t[e]}))?Tn():vn(x.SEARCH_PROPS_LIMIT_ERROR):Tn()},uc=function(e,t,n){return lc(Rn.create(e),t,n)},lc=function(e,t,n){return e.isFailed||e.isObject("conversation",t,!0).fail(x.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return te(null==t?void 0:t.conversationType,n)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID),e},cc=function(e,t,n){return e.check((function(e){return lc(e,t,Z)})).check((function(e){var r=null==t?void 0:t.messageType;mt(r)?r===me.STREAM_MESSAGE&&n.includes("RC_Ext_StreamMsgSummary")&&e.setFailed(x.STREAM_MESSAGE_EXPANSION_KEY_ERROR):e.setFailed(x.INVALID_PARAMETER_MESSAGE_TYPE)})).check((function(e){(null==t?void 0:t.canIncludeExpansion)||e.setFailed(x.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isNotEmptyString("messageUId",null==t?void 0:t.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isTimestamp("sentTime",null==t?void 0:t.sentTime,!0).fail(x.INVALID_PARAMETER_TIMESTAMP),e},dc=function(e,t,n){return e.check((function(e){n||e.setFailed(x.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isObject("expansion",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_EXPANSION).check((function(e){var n=Object.keys(t);if(n.length>20||0===n.length)e.setFailed(x.EXPANSION_LIMIT_EXCEET);else if(n.some((function(e){return!/^[A-Za-z0-9_=+-]+$/.test(e)||"string"!=typeof t[e]})))e.setFailed(x.INVALID_PARAMETER_MESSAGE_EXPANSION);else{n.some((function(e){return e.length>32||t[e].length>4096}))&&e.setFailed(x.EXPANSION_LIMIT_EXCEET)}})),e},_c=function(e,t){return t?(e.isObject("proxy",t,!0).isString("socketHost",t.socksHost,!0).isNumber("socketPort",t.socksPort,!0).isString("socketUsername",t.socksUsername).isString("socketPassword",t.socksPassword).fail(x.INVALID_PARAMETER_PROXY),e):e};var fc,hc=function(e){return function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);var t=unescape(encodeURIComponent(e)).split("").map((function(e){return e.charCodeAt(0)}));return new Uint8Array(t)}(e).byteLength},gc=function(){return fc||(fc={set:function(e,t){ua.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(ua.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return ua.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in ua.localStorage)e.push(t);return e}}),fc},pc=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}(),Ec=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=gc();var n=this._rootStorage.get(e)||{};this._cache=new pc(((t={})[e]=n,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 n=this._get();n[e]=t,this._set(n)}}),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 n in e)t.push(n);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}(),bc="",Tc=function(){var e="";if(bc)return bc;if("browser"===ua.tag)return gt;var t="RCDeviceId",n=gc(),r=n.get(t);return r?e=r:(e=ht.genWithLen(22),n.set(t,e)),e},vc=function(){return ht.gen()},Rc=function(){return ht.genWithLen(22)},Ic="",mc=function(){return Ic},yc=function(e,t,n,r,i){var o=0;return e&&(o|=16),t&&(o|=32),n&&(o|=64),r&&(o|=512),i&&(o|=1024),o},Ac=function(e){var t;try{t=JSON.parse(e)}catch(n){t=e}if(null==t?void 0:t.user){var n=t.user,r=n.portrait,i=n.portraitUri,o=r||i;o&&(t.user.portrait=t.user.portraitUri=o)}return t},Sc=function(e){var t={};try{var n=JSON.parse(e);Object.entries(n).forEach((function(e){var n=u(e,2),r=n[0],i=n[1];t[r]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},Oc=function(e,t,n,r){var i,o,a=Ol.decode(Ra,e.pbData),s=xr(e.topic);if(s===jr.recallMsg){var u=JSON.parse(a.content);i=u.conversationType,o=u.targetId}else i=function(e){var t;return((t={})[jr.ppMsgP]=F.PRIVATE,t[jr.pgMsgP]=F.GROUP,t[jr.chatMsg]=F.CHATROOM,t[jr.ugMsg]=F.ULTRA_GROUP,t[jr.pcMsgP]=F.CUSTOMER_SERVICE,t[jr.pbMsgP]=F.SYSTEM,t)[e]||F.PRIVATE}(s),o=e.targetId;var l=![F.GROUP,F.CHATROOM,F.RTC_ROOM,F.ULTRA_GROUP].includes(i),c=l?o:t,d=l?"":o,_=Pc(a.sessionId),f=_.isPersited,h=_.isCounted,g=_.isMentioned,p=_.disableNotification,E=_.canIncludeExpansion;return{fromUserId:c,type:i,groupId:d,classname:a.classname,content:a.content,dataTime:n,status:yc(f,h,g,p,E),msgId:r,direction:be.SEND,clientUniqueId:a.clientUniqueId,extraContent:a.extraContent,pushContent:a.pushText,configFlag:a.configFlag,pushExt:a.pushExt,busChannel:a.busChannel,toUserIds:a.toUserIds,optionBits:a.optionBits}},Nc=function(e,t,n,i){void 0===n&&(n=!1);var o,a,s,u=e.type,l=![F.GROUP,F.CHATROOM,F.RTC_ROOM,F.ULTRA_GROUP].includes(u)?i||e.fromUserId:e.groupId||i,c={isPersited:!!(16&(o=e.status)),isCounted:!!(32&o),isMentioned:!!(64&o),disableNotification:!!(512&o),receivedStatus:2&o?ye.RETRIEVED:ye.UNREAD,canIncludeExpansion:!!(1024&o)},d=c.isMentioned,_=c.disableNotification,f=c.receivedStatus,h=c.canIncludeExpansion,g=e.direction===be.SEND?be.SEND:be.RECEIVE,p=function(e,t,n){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,a=i.forceShowDetailContent,s=rn(null==n?void 0:n.pushConfigs,null==n?void 0:n.pushId);return r({pushTitle:(null==n?void 0:n.title)||"",pushContent:t||"",pushData:"",disablePushTitle:o,forceShowDetailContent:a,templateId:null==n?void 0:n.templateId},s)}(e.configFlag||0,e.pushContent,e.pushExt),E=(a=e.extStatus,{isInterrupt:!!(2&(s=a||0)),isModifyMessage:!!(4&s),isPrivateChannel:!!(8&s),isStatusMessage:!!(64&s)}),b=E.isInterrupt,T=E.isModifyMessage,v=E.isPrivateChannel,R=E.isStatusMessage,I=Rr(e.classname),m=I.isCounted,y=I.isPersited,A=I.isStatusMessage;return{conversationType:u,targetId:l,senderUserId:g===be.SEND?t:e.fromUserId,messageType:e.classname,messageUId:e.msgId,isPersited:y,isCounted:m,isMentioned:d,sentTime:e.dataTime,messageDirection:g,receivedTime:Date.now(),disableNotification:_,receivedStatus:f,receivedStatusInfo:jt(f),canIncludeExpansion:h,content:Ac(e.content),expansion:e.extraContent?Sc(e.extraContent):null,pushConfig:p,channelId:e.busChannel||"",isInterrupt:b,isModifyMessage:T,messageId:e.clientUniqueId||0,sentStatus:ue.SENT,isOffLineMessage:n,channelType:v?ne.PRIVATE:ne.PUBLIC,isStatusMessage:R||!!A,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0,modifyInfo:Lc(e.convertExt),extraData:e.extMsgData?{seqId:e.extMsgData.seqId,sentTime:e.extMsgData.sendTime}:void 0}},Cc=function(e,t,n,r,i){var o=0,a=Rr(e),s=a.isPersited,u=a.isCounted,l=a.isStatusMessage,c=i||l;return s&&!c&&(o|=1),u&&!c&&(o|=2),t&&(o|=4),n&&(o|=32),r&&(o|=64),o},Pc=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}},Lc=function(e){if(e)try{var t=JSON.parse(e).modify;if(t.time)return{timestamp:t.time,content:{},status:Hn}}catch(t){console.error("parse message modify info error: ".concat(e),t)}},wc=function(e,t){var n=e.content,i=n.sentTime,o=n.messageUId,a=n.isDelete,s=n.isAdmin,u=n.directionalUserIdList,l=n.extra,c={recallTime:i,recallActionTime:e.sentTime,admin:!!s,delete:!!a,isDelete:!!a,operatorId:e.senderUserId,extra:l},d=r(r({},e),{content:c,messageType:me.RECALL_NOTIFICATION_MESSAGE});return t&&(d.messageUId=o,d.sentTime=i,d.directedUserIds=u),d};function Mc(e){return 1&~((null==e?void 0:e.sessionMode)||0)?vn(x.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):Tn()}function Uc(e){return Math.min(e,999)}var Dc={};function Gc(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:1,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:Xn.getMiniCmpUrlList().join(",")}}var Vc,jc,kc,xc,Fc,Bc,Hc=function(e){function n(t,n,r,i,o){void 0===i&&(i="default");var a=e.call(this,t,n,r,ua.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),ua.useNavi,o)||this;return a._environment=i,a}return t(n,e),Object.defineProperty(n.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return o="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(n),"&callBack=x&v=").concat(Ye,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(ua.tag),this.logger.debug(B.L_REQUEST_T,"req navi => ".concat(o),r),[4,ua.httpReq({url:o,timeout:1e4,dataType:"text"})];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(B.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!ua.useNavi&&i?[2,Tn(Gc())]:[2,vn(this.transHttpCode(s.status))];try{return 0===(u=s.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,vn(this.transHttpCode(l.code))]:(ua.useNavi||(l.server="",l.backupServer=Xn.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,Tn(l)])}catch(e){this.logger.error(B.L_PARSE_NAVI_E,s.data,r)}return[2,vn(x.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(n.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:n,uri:e,platform:ua.tag,protocol:(/^https/.test(e)?H.WSS:H.WS).toString()}),this.logger.debug(B.L_REQUEST_T,"req navi => ".concat(o.url),r),[4,ua.httpReq(o)];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(B.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!ua.useNavi&&i?[2,Tn(Gc())]:[2,vn(this.transHttpCode(s.status))];try{return u=s.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(o.url)?"https":"http",ua.useNavi||(l.logSwitch=0,c=Xn.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?H.WSS:H.WS,weight:c.length-t}}))),[2,Tn(l)]}catch(e){this.logger.error(B.L_PARSE_NAVI_E,s.data,r)}return[2,vn(x.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(n.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=this.getCatchKey(e);if(Dc[n])return Dc[n];var r,i=Xe(this.appkey),o=ua.localStorage;try{var a=o.getItem(i);r=a?JSON.parse(a):[]}catch(e){r=[]}if(0===r.length)return null;var s=r.find((function(n){return n.token===e&&n.environment===t._environment}))||null;return Dc[n]=s,s}}),Object.defineProperty(n.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=this,i=Xe(this.appkey),o=ua.localStorage;try{var a=o.getItem(i);n=a?JSON.parse(a):[]}catch(e){n=[]}var s=Date.now();n.length>0&&(n=n.filter((function(t){return s-t.timestamp<Be&&(e!==t.token||r._environment!==t.environment)})));var u={timestamp:s,naviInfo:t,token:e,environment:this._environment};n.push(u),o.setItem(i,JSON.stringify(n)),Dc[this.getCatchKey(e)]=u}}),n}(Tr),qc=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=ot(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)}}),Object.defineProperty(e.prototype,"_getLocalInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ua.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 n=ot(this._appkey,this._userId),r=this._getLocalInfo(n);r[e]=t,ua.localStorage.setItem(n,JSON.stringify(r))}}),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=ot(this._appkey,this._userId),n=this._getLocalInfo(t);Object.keys(n).forEach((function(t){n[t]<e&&delete n[t]})),ua.localStorage.setItem(t,JSON.stringify(n))}}),e}(),Yc=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[_e.ONLINE_STATUS]={},t[_e.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={})[_e.ONLINE_STATUS]={},e[_e.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===_e.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].statusMap={}})):e===_e.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].profile=void 0}))}}),Object.defineProperty(e.prototype,"getSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.subscribeData[e][t];return n?r({},n):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,n){this.subscribeData[e][t]=n}}),Object.defineProperty(e.prototype,"clearExpiredData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t in this.subscribeData[e]){var n=this.subscribeData[e][t];n.expiry<(Date.now()+this._delayTime-n.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return l([],u(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(n,n+t)}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=r(r({},null===(t=this._ownProfile)||void 0===t?void 0:t.extraProfile),e.extraProfile);this._ownProfile=r(r(r({},this._ownProfile),e),{extraProfile:n})}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ownProfile?r(r({},this._ownProfile),{extraProfile:r({},this._ownProfile.extraProfile)}):null}}),e}(),Wc=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 Yc(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(n){var r=e.find((function(e){return e.subscribeType===t.subType&&e.userId===n.subUserId}));r?r.subscribeTime<t.subTime&&(r.expiry=t.expiry,r.operationType=t.opType,r.subscribeTime=t.subTime):e.push({userId:n.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 n=this;void 0===t&&(t=!1);var r=[],i=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,a,s=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===fe.UNSUBSCRIBE)return n._subStore.removeSubscribeUserData(l,s),void o.push(e);var d=n._subStore.getSubscribeUserData(l,s);if(!(d&&d.subscribeTime>=u)){if(l===_e.ONLINE_STATUS){r.push(s);var _=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};n._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,statusMap:_})}else{i.push(s);var f=null===(a=d)||void 0===a?void 0:a.profile;n._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,profile:f,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:r,newSubscribeUserProfileList:i,subscribeUserChangeList:o}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(_e.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(_e.USER_PROFILE)}}),Object.defineProperty(e.prototype,"updateSubscribeUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[];return e.forEach((function(e){var i=e.subUserId,o=e.data,a=t._subStore.getSubscribeUserData(_e.ONLINE_STATUS,i);if(a){var s=[],u=r({},a.statusMap);o.forEach((function(e){var t=e.platformInfo,n=e.versionTime,i=u[t];if(!(i&&i.changeTime>n)){var o={eventValue:e.value,changeTime:n};u[t]=o,s.push(r(r({},o),{platform:t}))}})),t._subStore.updateSubscribeUserData(_e.ONLINE_STATUS,i,{subscribeTime:a.subscribeTime,expiry:a.expiry,userId:i,subscribeType:_e.ONLINE_STATUS,statusMap:u}),n.push({userId:i,subscribeType:_e.ONLINE_STATUS,subscribeTime:a.subscribeTime,expiry:a.expiry,details:s})}})),n}}),Object.defineProperty(e.prototype,"updateSubscribeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[];return e.forEach((function(e){var i=e.userId,o=e.version,a=e.userProfile,s=e.userExtProfile,u=t._subStore.getSubscribeUserData(_e.USER_PROFILE,i),l=Ft(i,a,s);u?u.profile&&u.profile.version>=o||(t._subStore.updateSubscribeUserData(_e.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:_e.USER_PROFILE,profile:{info:l,version:o},isSubscribed:u.isSubscribed}),u.isSubscribed&&n.push({userId:i,subscribeType:_e.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:r({},l)})):t._subStore.updateSubscribeUserData(_e.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:_e.USER_PROFILE,profile:{info:l,version:o},isSubscribed:!1})})),n}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,i=[];return t.forEach((function(t){var o=n._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+n._delayTime-o.subscribeTime)/1e3)n._subStore.removeSubscribeUserData(e,t);else{var a={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===_e.ONLINE_STATUS){var s=o.statusMap,u=Object.keys(s).map((function(e){return r({platform:~~e},s[~~e])}));a.details=xt(u)}else if(e===_e.USER_PROFILE&&!o.isSubscribed)return;i.push(a)}})),i}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[],i=[];return e.forEach((function(e){var o=t._subStore.getSubscribeUserData(_e.USER_PROFILE,e);if(o&&o.profile){var a=o.profile,s=a.version,u=a.info;if(o.isSubscribed)return t._delayTime+Date.now()-s>6048e5?void i.push(e):void n.push(r(r({},u),{extraProfile:r({},u.extraProfile)}));t._delayTime+Date.now()-s>6e5?i.push(e):n.push(r(r({},u),{extraProfile:r({},u.extraProfile)}))}else i.push(e)})),{list:n,needQueryUserIds:i}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,n).map((function(t){var n={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===_e.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return r({platform:~~e},t.statusMap[~~e])}));n.details=xt(i)}return n}))}}),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}(),Kc=function(){function e(e,t,n,r,i,o,a){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:n}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:r}),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:a}),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 Wc(r)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(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(_e.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(_e.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(_e.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(_e.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 a(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 a(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 n,r,i,o,s,u,l,c,d,_,f,h,g;return a(this,(function(a){switch(a.label){case 0:return n=this._subscribeService.getRelationshipStatusVersion(),r=this._logger.createTraceId(),this._logger.info(B.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:n,_pageToken:t}),r),i=Ol.encode(Zs,{version:n,pageToken:t}),[4,this._connectManager.query(jr.pullUserSub,this._currentUserId,i,zs)];case 1:return o=a.sent(),this._logger.summary(B.L_PULL_SUBSCRIBED_USER_RELATION_R,o,r),o.isOk?(this._pullRelationshipFailTime=0,s=o.data,u=s.list,l=s.version,c=s.hasNext,d=s.pageToken,e?(_=this._subscribeService.updateSubscribeRelation(u),f=_.newSubscribeOnlineStatusList,h=_.newSubscribeUserProfileList,(g=_.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(g),f.length>0&&this._queryAndUpdateUserOnlineStatus(f),h.length>0&&this._queryAndUpdateUserProfile(h)):this._subscribeService.updateSubscribeRelation(u,!t),this._subscribeService.updateRelationshipStatusVersion(l),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>l})),c?[4,this._pullSubscribeRelationship(e,d)]:[3,3]):(this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:a.sent(),a.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 a(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 a(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 n,r,i,o,s,u,l,c,d,_,f,h;return a(this,(function(a){switch(a.label){case 0:return n=this._subscribeService.getSubscribeUserStatusVersion(),r=this._logger.createTraceId(),this._logger.info(B.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:n,_pageToken:t,needAllData:e}),r),i=Ol.encode($s,{versionTime:n,needAllData:e,pageToken:t}),[4,this._connectManager.query(jr.pullSubData,this._currentUserId,i,eu)];case 1:return(o=a.sent()).isOk?(this._pullSubUserStatusFailTime=0,s=o.data,u=s.list,l=s.versionTime,c=s.hasNext,d=s.pageToken,_=s.isFull,this._logger.info(B.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code}),r),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>l})),this._subscribeService.updateSubscribeUserStatusVersion(l),f=[],h=[],u.forEach((function(e){switch(e.subType){case _e.ONLINE_STATUS:f.push(e);break;case _e.USER_PROFILE:h.push(e.subUserId);case _e.FRIEND_ONLINE_STATUS:case _e.FRIEND_USER_PROFILE:}})),_&&""===t&&this._subscribeService.clearSubscribeStatus(),f.length>0&&this._updateUserOnlineStatus(f,!_),h.length>0?[4,this._queryAndUpdateUserProfile(h,!_)]:[3,3]):(this._logger.warn(B.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code,failTime:this._pullSubUserStatusFailTime}),r),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:a.sent(),a.label=3;case 3:return c?[4,this._pullSubscribeUserStatus(e,d)]:[3,5];case 4:a.sent(),a.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,n,r;return a(this,(function(i){switch(i.label){case 0:return t=this._logger.createTraceId(),this._logger.info(B.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),n=Ol.encode(nu,{subType:_e.ONLINE_STATUS,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._connectManager.query(jr.qrySubData,this._currentUserId,n,eu)];case 1:return r=i.sent(),this._logger.summary(B.L_QUERY_SUBSCRIBE_DATA_R,r,t),r.isOk?(this._updateUserOnlineStatus(r.data.list),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"_updateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!0);var n=this._subscribeService.updateSubscribeUserOnlineStatus(e);n=n.filter((function(e){return e.details&&e.details.length>0})),t&&n.length>0&&this._event.subscribeUserStatusChanged(n)}}),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 n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this._logger.createTraceId(),this._logger.info(B.L_PULL_USER_PROFILE_T,JSON.stringify(e),n),r=Ol.encode(ou,{userId:e}),i=new _o(jr.pullUserProfile,r,this._currentUserId),[4,this._connectManager.send(i,au)];case 1:return o=a.sent(),s=o.code,u=o.data,this._logger.info(B.L_PULL_USER_PROFILE_R,JSON.stringify({code:s,data:u}),n),s!==x.SUCCESS?[2,vn(s)]:(l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,Tn(u.UserProfile)])}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return(t=Ol.decode(tu,e.pbData)).subType!==_e.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==_e.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==_e.FRIEND_ONLINE_STATUS?[3,3]:(n=t.data.map((function(e){return{changeTime:e.versionTime,eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:n}]),[3,5]);case 3:return t.subType!==_e.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:r=o.sent(),(i=r.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Ft(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,n){return this._subscribeService.getSubscribeUserList(e,t,n)}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=0),o(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=Ol.encode(Qs,{subType:t,opType:n,expiry:r,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._connectManager.query(jr.updUserSub,this._currentUserId,i,Xs)];case 1:return o=a.sent(),s=o.code,u=o.data,l=o.isOk,s===x.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT?[2,vn(s,"",u.subUsers.map((function(e){return e.subUserId})))]:l?(c=u.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:r,opType:n,subUsers:e.map((function(e){return{subUserId:e}}))}]),n===fe.SUBSCRIBE&&(t===_e.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===_e.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,o.wipe()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._subscribeService.getUserProfiles(e),n=t.needQueryUserIds,r=t.list,0===n.length?[2,Tn(r)]:[4,this._queryAndUpdateUserProfile(n,!1)];case 1:return(i=a.sent()).isOk?(o=i.data.map((function(e){return Ft(e.userId,e.userProfile,e.userExtProfile)})),[2,Tn(l(l([],u(r),!1),u(o),!1))]):[2,i.wipe()]}}))}))}}),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,n,r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(B.L_PULL_OWN_PROFILE_T,"",t),n=Ol.encode(su,{nothing:1}),[4,this._connectManager.query(jr.pullOwnProfile,this._currentUserId,n,ru)]):[2,vn(x.RC_USER_PROFILE_SERVICE_UNAVAILABLE)];case 1:return r=a.sent(),this._logger.summary(B.L_PULL_OWN_PROFILE_R,r,t),r.isOk?(i=r.data,o=i.userExtProfile,s=i.userProfile,u=i.version,l=i.userId,c=Ft(l,s,o),this._subscribeService.updateOwnProfile(c,u),e&&this._event.ownUserProfileChanged(c),[2,Tn(c)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,Tn(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 a(this,(function(n){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),Jc=function(){function e(e,t,n){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 Ec(lt(e,t)),this._delayTime=n,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,n,r=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=s(r),a=o.next();!a.done;a=o.next()){var u=a.value;i[u.key]=u.value}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.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,n,i,o){var a;if(!(i<Date.now()-this._delayTime-Qe)){var s=this._getConversationKey(e),u=this._storage.get(s)||{};if(!u[t]){var l={t:i,d:n};o&&(l.sId=o);var c=r(r({},u),((a={})[t]=l,a));Object.keys(c).length>30&&(c=this._removeExcessData(c)),this._storage.set(s,c)}}}}),Object.defineProperty(e.prototype,"addReadedUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var i,o=this._getConversationKey(e),a=this._storage.get(o)||{},s=a[t];if(s){if(s.us){if(s.us.includes(n))return}else s.us=[];s.us.push(n),this._storage.set(o,r(r({},a),((i={})[t]=s,i)))}}}),Object.defineProperty(e.prototype,"getReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._getConversationKey(e),r=(this._storage.get(n)||{})[t];return r?{time:r.t,direction:r.d,users:r.us||[],senderId:r.sId}:null}}),Object.defineProperty(e.prototype,"getReceiptMessageDic",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._getConversationKey(e),n=this._storage.get(t)||{},r={};for(var i in n){var o=n[i];o.d===be.RECEIVE&&(r[o.sId]||(r[o.sId]=[]),r[o.sId].push(i))}return r}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._getConversationKey(e),r=this._storage.get(n)||{};r[t]&&(delete r[t],0===Object.keys(r).length?this._storage.remove(n):this._storage.set(n,r))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.getValues(),t={};for(var n in e){var r=e[n],i={};for(var o in r){var a=r[o];Date.now()-this._delayTime-a.t<Qe&&(i[o]=a)}Object.keys(i).length&&(t[n]=i)}this._storage.update(t)}}),e}(),Qc=function(e){function n(t,n){var r=e.call(this,t,n)||this;return Object.defineProperty(r,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:""}),r._storageKey=st(t),r}return t(n,e),Object.defineProperty(n.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return ua.localStorage.getItem(this._storageKey)}}),Object.defineProperty(n.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){ua.localStorage.setItem(this._storageKey,e)}}),Object.defineProperty(n.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){ua.localStorage.removeItem(this._storageKey)}}),Object.defineProperty(n.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,ua.httpReq({url:e})];case 1:return t=i.sent(),n=t.status,r=t.data,[2,{code:n,data:r}]}}))}))}}),Object.defineProperty(n.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,ln(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=r.sent(),[2,JSON.parse(t)];case 2:return n=r.sent(),this.logger.error(B.L_GET_STATIC_CONF_E,JSON.stringify({error:null==n?void 0:n.stack})),[3,3];case 3:return[2]}}))}))}}),n}(Zn),Xc=((Vc={})[L.GROUP_OPERATION]=function(e){return"ChannelEventData"},Vc[L.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},Vc[b.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},Vc),Zc=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,n){var r=e,i={}[t];try{r=e.length>0&&Ol.decode(t,e),St(i)&&(r=i.call(this,r,n))}catch(e){this.logger.error(B.L_PB_DECODE_E,t)}return r}}),Object.defineProperty(e.prototype,"formatEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.map((function(e){var n,r=e.businessId,i=e.time,o=e.changeType,a=e.originalId,s=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,d=e.operatorId,_=e.subChangeType,f=e.secondaryType,h=e.remindType,g=e.isRemindMe,p=e.extIds,E=e.eventData;return E&&(n=t._formatEventData(E,o,_)),{businessId:r,changeType:o,originalId:a,time:i,originalTime:s,secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:d,subChangeType:_,userGroupIds:p,secondaryType:f,remindType:h,isRemindMe:g,eventData:n}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r={};return e&&Xc[t]&&Xc[t](n)&&(r=Ol.decode(Xc[t](n),e)||{}),r}}),e}(),zc=((jc={})[Bi]=x.RC_DISCONN_KICK,jc[Hi]=x.RC_DISCONN_EXCEPTION,jc[Yi]=x.RC_DISCONN_EXCEPTION,jc[Wi]=x.RC_CONN_REDIRECTED,jc[Ki]=x.RC_CONN_TOKEN_EXPIRED,jc[Ji]=x.RC_CONN_PROTO_VERSION_ERROR,jc[Qi]=x.RC_ACCOUNT_CANCELLATION,jc),$c=((kc={})[Ri]=x.SUCCESS,kc[Ii]=x.RC_CONN_PROTO_VERSION_ERROR,kc[mi]=x.RC_CONN_IDENTIFIER_REJECTED,kc[yi]=x.RC_CONN_SERVER_UNAVAILABLE,kc[Ai]=x.RC_CONN_TOKEN_INCORRECT,kc[Si]=x.RC_CONN_NOT_AUTHRORIZED,kc[Oi]=x.RC_CONN_REDIRECTED,kc[Ni]=x.RC_CONN_PACKAGE_NAME_INVALID,kc[Ci]=x.RC_CONN_APP_BLOCKED_OR_DELETED,kc[Pi]=x.RC_CONN_USER_BLOCKED,kc[Li]=x.RC_CONN_TOKEN_EXPIRED,kc[wi]=x.RC_CONN_DEVICE_ERROR,kc[Mi]=x.RC_CONN_HOSTNAME_ERROR,kc[Ui]=x.RC_DISCONN_SAME_CLIENT_ON_LINE,kc[Di]=x.RC_LISCENSE_COUNT_OUT_OF_LIMIT,kc[Gi]=x.RC_CONN_WRONG_CLUSTER,kc[Vi]=x.RC_APP_AUTH_NOT_PASS,kc[ji]=x.RC_OTP_USED,kc[ki]=x.RC_PLATFORM_ERROR,kc[xi]=x.RC_ACCOUNT_CANCELLATION,kc[Fi]=x.RC_LICENSE_EXPIRED,kc),ed=function(e){return[jr.ppMsgS,jr.pgMsgS,jr.chatMsgS,jr.prMsgS].includes(e)},td=function(e){function n(t,n,r){var i=e.call(this,t,n,r)||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 Zc(i.logger),i}return t(n,e),Object.defineProperty(n.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(n.prototype,"getLocalConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime}}),Object.defineProperty(n.prototype,"getCrtServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}}),Object.defineProperty(n.prototype,"getDelayTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime-this._connectedTime}}),Object.defineProperty(n.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,d,_,f;return a(this,(function(h){switch(h.label){case 0:if(n=t.openAnti,i=t.type,o=t.baggageEnabled,s=this.getCmpList(t),this.logger.debug(B.L_NAVI_CMP_R,JSON.stringify(s),r),0===(u=s.filter((function(e,t){return s.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(B.L_NAVI_CONF_E,"no service available",r),[2,vn(x.SERVER_UNAVAILABLE)];l=1===n?$r:ei,c=function(t){var n,s,c,_,f,h,g,p,E,b,T;return a(this,(function(a){switch(a.label){case 0:return n=u[t],s=n.protocol,c=n.addr,_=n.weight,f=function(e,t,n,r,i,o,a,s){var u,l=a?"&protocolVer=".concat(a):"",c=Tc(),d=mc();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(n,"&token=").concat(encodeURIComponent(r),"&sdkVer=").concat(Ye,"&pid=").concat(o,"&deviceId=").concat(encodeURIComponent(c)).concat(1===s?"&baggage=".concat(encodeURIComponent("cid=".concat(i))):"","&apiVer=").concat(encodeURIComponent((null===(u=ua.getApiVer)||void 0===u?void 0:u.call(ua))||"||")).concat(ua.connectPlatform?"&platform=".concat(ua.connectPlatform):"").concat(l).concat(ua.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(d)):"")}(s===H.WS?"ws":"wss",c,d.appkey,e,d.cid,"",l,o),h=Date.now(),[4,d.connectWebSocket(f,l,r)];case 1:return g=a.sent(),p=g.code,E=g.data,b=d.cmpWeightCache.findIndex((function(e){return e.addr===c})),T={bid:un(),ptc:Se.WS,cod:p,net:d.getNetwork().type,dur:Date.now()-h,spr:0,pr:i||0,hos:c,idx:b,rct:d.retryCount?Ce.RECONNECT:Ce.CONNECT,cid:d.cid,v:Ne.CURRENT,rsn:d._doConnectReason,count:d.retryCount,weight:_,ssid:d._serverSessionId},d.logger.record(ve.IM_WEBSOCKET,JSON.stringify(T),r),p===x.RC_SOCKET_DISCONNECTED||p===x.TIMEOUT?[2,"continue"]:p!==x.SUCCESS?[2,{value:vn(p)}]:(d._localConnectedTime=Math.floor((Date.now()+h)/2),d._socket=E.socket,d.updateCmpWeight(u[t].addr,!0),d.curCmpUrl=u[t].addr,[2,{value:Tn(E.userId)}])}}))},d=this,_=0,h.label=1;case 1:return _<u.length?[5,c(_)]:[3,4];case 2:if("object"==typeof(f=h.sent()))return[2,f.value];h.label=3;case 3:return _+=1,[3,1];case 4:return[2,vn(x.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(n.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,_,f=this;return a(this,(function(a){switch(a.label){case 0:return this.logger.info(B.L_CONNECT_O,"connect start: ".concat(e),n),r=An(),i=r.resolve,o=r.promise,[4,ua.createWebSocket(e)];case 1:return s=a.sent(),u=s.data,l=s.code,c=s.msg,l===x.SUCCESS&&u?(this._socketIndex=u.id,d=x.SUCCESS,_=setTimeout((function(){f.logger.warn(B.L_CONNECT_S,"timeout",n),d=x.TIMEOUT,u.close()}),5e3),u.onOpen((function(){f.logger.info(B.L_CONNECT_S,"socket opened",n),clearTimeout(_)})),u.onError((function(e){f.logger.info(B.L_CONNECT_S,"socket error",n),clearTimeout(_);var t=x.RC_SOCKET_DISCONNECTED;i(vn(t)),f.onSocketEnd(u,t)})),u.onClose((function(){f.logger.info(B.L_CONNECT_S,"socket close",n);var e=d===x.SUCCESS?x.RC_SOCKET_DISCONNECTED:d;i(vn(e)),f.onSocketEnd(u,e)})),u.onMessage((function(e){if(f._socketIndex===u.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var r=bo(e,t);if(r){if(r instanceof no){var o=r.status;if(o!==Ri)return f.logger.warn(B.L_CONNECT_O,"connect failed: ".concat(o),n),d=$c[o],u.close(),void i(vn(d));f.logger.info(B.L_CONNECT_O,"connect success",n);var a=r.timestamp,s=r.userId,l=r.messageId,c=r.sessionId;return f._serverSessionId=c,f._connectedTime=a,f._idCount=l,void i(Tn({userId:s,socket:u}))}if(r instanceof io){var _=r.status;return f.logger.info(B.T,"recv disconnect signal -> status: ".concat(_)),void f.onRecvDisconnect(_,u)}f._onReceiveSignal(r)}}}else f.logger.warn(B.L_WS_DISACCORD_E,JSON.stringify({socketIndex:f._socketIndex,curSocketId:u.id}))})),[2,o]):[2,vn(l,c)]}}))}))}}),Object.defineProperty(n.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==Br)return e instanceof lo&&!e.syncMsg?(this.logger.debug(B.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new go(e.messageId))):void(e instanceof Eo&&this._messageIds[e.messageId]&&(this.logger.debug(B.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new po(e.messageId))))}}),Object.defineProperty(n.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.syncMsg,n=e.topic,r=e.messageId,this.logger.debug(B.O,"recv PublishReader -> messageId: ".concat(r," ").concat(n)),n===ai?[2]:!t||ed(xr(n))?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[r]=e}))];case 1:return i=a.sent(),delete this._syncMessageIds[r],this.emit("signal",e,i),[2]}}))}))}}),Object.defineProperty(n.prototype,"_onReceiveSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return e instanceof ao&&this._pingResolve?(this._pingResolve(x.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof ho||e instanceof Eo)&&(t=e.messageId,this.logger.debug(B.O,"recv ack -> messageId: ".concat(t)),(n=this._messageIds[t])&&(n(e),delete this._messageIds[t]),(r=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],r(e))),e instanceof lo?[4,this._publishReader(e)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(n.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 zc[e]}(e)))}}),Object.defineProperty(n.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(n.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(x.RC_SOCKET_DISCONNECTED)}}}),Object.defineProperty(n.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(n){t._pingResolve=n,setTimeout((function(){return n(x.TIMEOUT)}),e),t.sendOnly(new oo)}))}}),Object.defineProperty(n.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof fo||e instanceof _o)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(n.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(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(x.TIMEOUT)}),3e4)}))]):[2,vn(x.RC_NET_CHANNEL_INVALID)];case 1:return n=o.sent(),r="number"==typeof n?n:n.status,x.SUCCESS,"number"==typeof n?[2,vn(n)]:[2,r===x.SUCCESS?Tn(n):vn(r,"",n)]}}))}))}}),Object.defineProperty(n.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u;return a(this,(function(a){switch(a.label){case 0:return this.logger.createTraceId(),Fr(e),o=new _o(e,n,t),i&&o.setHeaderQos(i),[4,this._sendHandler(o)];case 1:return s=a.sent(),u=s.data,s.isOk&&void 0!==r?[2,Tn(Ol.decode(r,u.pbData))]:[2,s]}}))}))}}),Object.defineProperty(n.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,this._sendHandler(e)];case 1:return(n=a.sent()).data?n.data instanceof ho?[2,n]:(r=n.data,i=t&&r.pbData&&[x.SUCCESS,x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,x.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,x.RC_USER_PROFILE_KEY_NOT_EXIST,x.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,x.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,x.RC_USER_PROFILE_VALUE_EXCEED_RANGE,x.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(r.status)>=0,o=i?Ol.decode(t,r.pbData):r,0!==r.status?[2,vn(r.status,void 0,t&&r.pbData?o:null)]:[2,Tn(o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return n?[4,this.sendOnly(new ro(qi))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),n}(Er),nd=function(e){function n(t,n,r){var i=e.call(this,n,t,r)||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=ua.runtimeInfo,a=o.type,s=o.version;return i.deviceId=Tc(),i.model="Web|".concat(a,"|").concat(s),i.init(),i}return t(n,e),Object.defineProperty(n.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,_,f;return a(this,(function(a){switch(a.label){case 0:return(i=r).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:n,body:JSON.stringify(i)},s=this.logger.createTraceId(),this.logger.info(B.L_REQUEST_T,JSON.stringify(o),s),[4,ua.httpReq(o)];case 1:u=a.sent(),l=u.status,c=u.data,d=void 0===c?"":c,this.logger.info(B.L_REQUEST_R,JSON.stringify({status:l,data:d}),s);try{return _=JSON.parse(d),f=_.data,[2,{code:parseInt(_.code,10),data:f}]}catch(e){return this.logger.warn(B.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:l,data:d,error:e})),[2,{code:l,msg:e}]}return[2]}}))}))}}),Object.defineProperty(n.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ut(this.appkey);ua.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(B.L_CLOUD_SET_CACHE_O,JSON.stringify(e))}}),Object.defineProperty(n.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=ut(this.appkey),t=ua.localStorage.getItem(e);return this.logger.info(B.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t}}),Object.defineProperty(n.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(B.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}}),Object.defineProperty(n.prototype,"getMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mrtr}}),n}(gr),rd=function(e){function n(t,n,r,i){var o=e.call(this,t,n,r,i)||this;return Object.defineProperty(o,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_id",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:i}),xc.set(o,void 0),Fc.set(o,pt),d(o,xc,new Ec(ct(t)),"f"),o}return t(n,e),Object.defineProperty(n.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){d(this,Fc,e,"f")}}),Object.defineProperty(n.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,Fc,"f")}}),Object.defineProperty(n.prototype,"setConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{return c(this,xc,"f").set(e,t),!0}catch(e){return!1}}}),Object.defineProperty(n.prototype,"getConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return{success:!0,value:c(this,xc,"f").get(e)}}catch(e){return{success:!1}}}}),n}(er);xc=new WeakMap,Fc=new WeakMap;var id=null,od="RC_LOGS",ad="RC_STATISTICS",sd=((Bc={})[od]=["level","time"],Bc[ad]=["level","time"],Bc),ud=function(e,t,n){return new Promise((function(r){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),o=IDBKeyRange.upperBound(Date.now()-n),a=i.openCursor(o);a.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):r()},a.onerror=function(){r()}}))},ld=null,cd=function(e){return o(void 0,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return[4,id];case 1:return(t=r.sent())?(n=t.db,[4,ud(n,od,e)]):[2];case 2:return r.sent(),[4,ud(n,ad,e)];case 3:return r.sent(),ld=setTimeout((function(){return cd(e)}),6e5),[2]}}))}))},dd=function(e,t,n){void 0===n&&(n=168),id||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==ua.runtimeInfo.type?id=new Promise((function(r){var i=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(n){n.forEach((function(n){n.name&&e.includes(n.name)&&t.deleteDatabase(n.name)}))}))}(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var o="RC_LOGS_".concat(e),a=i.open(o,2);a.onerror=function(e){t.error(B.L_LOGDB_OPEN_FAILED_E,e.target.error),r(null)},a.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){id=null,t.warn(B.L_LOGDB_CLOSED_S)},o.onerror=function(e){id=null,t.error(B.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(B.L_LOGDB_ABORT_S,e.target.error)},cd(3600*Math.max(24,Math.min(168,n))*1e3),r({appkey:e,db:o})):r(null)},a.onupgradeneeded=function(e){var t=e.target.result;Object.keys(sd).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var n=t.createObjectStore(e,{autoIncrement:!0});sd[e].forEach((function(e){return n.createIndex(e,e,{unique:!1})}))}))}})):t.warn(B.L_UNSUPPORT_INDEXDB_O))},_d=[],fd=function(e,t,n){return new Promise((function(r){var i=e.transaction(t,"readwrite");i.oncomplete=r,i.onabort=r;var o=i.objectStore(t);n.forEach((function(e){try{o.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},hd=[],gd=!1,pd=function(e){return o(void 0,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return gd||0===hd.length?[2]:(gd=!0,t=hd.filter((function(e){return e.level<Jn.FATAL})),n=hd.filter((function(e){return e.level>=Jn.FATAL})),hd.length=0,[4,fd(e,od,n)]);case 1:return r.sent(),[4,fd(e,ad,t)];case 2:return r.sent(),gd=!1,0===hd.length&&_d.length>0&&(_d.forEach((function(e){return e.close()})),_d.length=0),setTimeout((function(){return pd(e)})),[2]}}))}))},Ed=function(){var e=sr();return e.setLogReader((function(e,t,n,r,i){return void 0===i&&(i=od),o(void 0,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return[4,id];case 1:return(o=a.sent())?[2,new Promise((function(a){var s=o.db.transaction(i,"readonly").objectStore(i),u=[],l=IDBKeyRange.bound(e,t),c=s.index("time").openCursor(l);c.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=n&&(r?i.sessionId===gt:i.level>=0)&&u.push(i),t.continue()}else a({logs:u})},c.onerror=function(){a({logs:[]})}}))]:[2,{logs:[]}]}}))}))})),e.setLogWriter((function(e){!function(e){o(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return[4,id];case 1:if(!(t=n.sent()))return[2];if(e.content&&Et(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return hd.push(e),pd(t.db),[2]}}))}))}(e)})),e},bd="REPORT_SESSION",Td=function(e,t){return o(void 0,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){return n="".concat(bd,"_").concat(e),r=t.getSessionId(),i=t.getConf(n),o=i.success,s=i.value,o?(r===(null==s?void 0:s.sessionId)||t.setConf(n,{sessionId:r}),[2]):[2]}))}))},vd=function(e,t){return o(void 0,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){return n=t.getSessionId(),r=t.getConf("".concat(bd,"_").concat(e)),i=r.success,o=r.value,[2,i&&(null==o?void 0:o.sessionId)===n]}))}))},Rd=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,n){return void 0===t&&(t=Date.now()-Rd),void 0===n&&(n=Date.now()),o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=t<0?Date.now()+t:t,(n=n<=0?Date.now():n)-t>Rd&&(t=n-Rd),r=sr(),(i=new rd(e,"RC-IM","IM",r)).debug(B.T,"get logs: startTime ".concat(t," endTime ").concat(n)),dd(e,i),[4,r.read(t,n,Jn.DEBUG,!1)];case 1:return o=a.sent().logs,i.debug(B.T,"get logs ".concat(o.length)),function(e,t){var n=t.map((function(e){var t=e.sessionId,n=e.time,r=e.type,i=e.level,o=e.tag,a=e.traceId,s=e.loggerId,u=e.content;return"".concat(t,",").concat(n,",").concat(r,",").concat(i,",").concat(o,",").concat(a,",").concat(s,',"').concat(u,'"\n')})),r=new Blob(n,{type:"text/csv"}),i=URL.createObjectURL(r),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(n),o),[2]}}))}))}}}}var Id,md,yd,Ad,Sd,Od=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),Nd=48,Cd=64,Pd=80,Ld=96,wd="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Md=function(e){for(var t={},n=0;n<e.length-1;n++){var r=e.charAt(n)+e.charAt(n+1);t.hasOwnProperty(r)?t[r].push(n):t[r]=[n]}for(var i=[],o=[],a=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=Dd(e.length),n=String.fromCharCode(Pd|t.length);i.push(n+t)}else{var r=String.fromCharCode(Ld|e.length);i.push(r)}i.push(e)}},s=0;s<e.length;){var u=Ud(t,e,s);if(u.length<2)o.push(e.charAt(s++));else if(u.length<4)o.push(e.substr(s,u.length)),s+=u.length;else{var l=Dd(s-u.offset),c=Dd(u.length);if(l.length+c.length>=u.length)o.push(e.substr(s,u.length)),s+=u.length;else{a();var d=String.fromCharCode(Cd|l.length<<2|c.length);i.push(d+l+c),s+=u.length}}}a();var _=Dd(e.length),f=String.fromCharCode(Nd|_.length);return i.push(f+_),i.join("")},Ud=function(e,t,n){var r={length:0,offset:-1};if(t.length,n>=t.length-1)return r;var i=e[t.charAt(n)+t.charAt(n+1)];if(i[0]===n)return r;for(var o=t.length-n,a=0,s=i.length;a<s;a++){var u=i[a],l=n-u;if(!(l>238327)){var c=Math.min(o,l);if(c<=r.length)break;if(!(r.length>2&&t.charAt(u+r.length-1)!==t.charAt(n+r.length-1))){for(var d=2,_=d;_<c&&t.charAt(u+_)===t.charAt(n+_);_++)d++;d>=r.length&&(r.length=d,r.offset=u)}}}return r},Dd=function(e){var t=[],n=0;do{n=e%62,t.push(wd.charAt(n)),e=(e-n)/62}while(e>0);return t.join("")},Gd=function(e){function n(t,n,r,i){var o,a=Tc(),s=ua.runtimeInfo,u=s.type,l=s.version,c="".concat(u,"|").concat(l,"|").concat(n.getSessionId(),"|").concat(ua.connectPlatform);return o=e.call(this,t,a,c,i,n)||this,Object.defineProperty(o,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return t(n,e),Object.defineProperty(n.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return ua.httpReq(e)}}),Object.defineProperty(n.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,Td(t.userId,this.logger)];case 1:return n.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))}}),Object.defineProperty(n.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,{success:!0,data:Md(e.map(nr).join(""))}]}))}))}}),Object.defineProperty(n.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,n,r,this.tableName)]}))}))}}),n}(tr),Vd=function(e){function n(t,n,r){return e.call(this,t,n,od,r)||this}return t(n,e),Object.defineProperty(n.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,vd(this.userId,this.logger)];case 1:return[2,e.sent()]}}))}))}}),Object.defineProperty(n.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r,i,s,u,l){return void 0===l&&(l=!1),o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return[4,this.isReporter()];case 1:return o=a.sent(),this.userId&&!o?[2]:[2,e.prototype.report.call(this,t,n,r,i,s,u,l)]}}))}))}}),n}(Gd),kd=function(e){function n(t,n,r){return e.call(this,t,n,ad,r)||this}return t(n,e),n}(Gd),xd=function(e){function n(t,n){var r=e.call(this,"WebConversationSettings")||this;return Id.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:n}),md.set(r,!1),r._ctx.on("sCmd",c(r,Id,"m",Ad),r),r._ctx.on("onConnected",c(r,Id,"m",yd),r),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,c(this,Id,"m",Sd).call(this,e)];case 1:return[2,t.sent().trans((function(e){return{version:e.version}}))]}}))}))}}),Object.defineProperty(n.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,c(this,Id,"m",Sd).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),n}(pn);md=new WeakMap,Id=new WeakSet,yd=function(){d(this,md,!0,"f")},Ad=function(e,t){var n=t.type,r=t.time;if(3===n)this.push(r),e.stopPropagation()},Sd=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,n=t.createTraceId(),t.info(B.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),n),r=Ol.encode(ss,{time:e}),[4,this._ctx.query(jr.pullSeAtts,this._ctx.currentUserId,r,us)];case 1:return i=a.sent(),t.summary(B.L_PULL_CONVERSATION_SETTINGS_R,i,n,{version:e},(function(t){return{syncTime:t.version,version:e}})),i.isOk&&(o=this._storage.updateBySessionStates(i.data)).length&&this._ctx.emit("conversationStatusChanged",o),c(this,md,"f")&&(d(this,md,!1,"f"),this._ctx.emit("conversationStatusSynced",i.code)),[2,i]}}))}))};var Fd,Bd,Hd,qd,Yd=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 n=this._memData[e],r=n.key,i=n.stringify;n.value=t;var o=i?JSON.stringify(t):t;ua.localStorage.setItem(r,o)}}),e}(),Wd=function(e){var t;return"".concat(null!==(t=e.channelId)&&void 0!==t?t:"","_").concat(e.conversationType,"_").concat(e.targetId)},Kd=function(e){var t=u(e.split("_")),n=t[0],r=t[1],i=t.slice(2);return{channelId:n,conversationType:parseInt(r,10),targetId:i.join("_")}};function Jd(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 Qd=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:Re.NOT_SET,translateStrategy:Lr.DEFAULT,tags:[],channelType:ne.PUBLIC,operationTime:0,draft:"",hidden:!1,includeRobot:!1}},Xd=function(){function e(e){Fd.set(this,void 0),Bd.set(this,void 0),Hd.set(this,void 0),qd.set(this,Qd()),d(this,Fd,e.conversationType,"f"),d(this,Bd,e.targetId,"f"),d(this,Hd,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return c(this,Fd,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return c(this,Bd,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return c(this,Hd,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return c(this,qd,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!c(this,qd,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!c(this,qd,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return c(this,qd,"f").notificationLevel||Re.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateStrategy",{get:function(){return c(this,qd,"f").translateStrategy||Lr.DEFAULT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(c(this,qd,"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,qd,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return c(this,qd,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return c(this,qd,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!c(this,qd,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return c(this,qd,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return c(this,qd,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return c(this,qd,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return c(this,qd,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return c(this,qd,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return c(this,qd,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return c(this,qd,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return c(this,qd,"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,"identifier",{get:function(){return{conversationType:c(this,Fd,"f"),targetId:c(this,Bd,"f"),channelId:c(this,Hd,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return Wd(this.identifier)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"includeRobot",{get:function(){return!!c(this,qd,"f").includeRobot},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){return r(r({},this.identifier),{latestMessage:this.latestMessage,unreadMessageCount:this.unreadCount,unreadMentionedCount:this.unreadMentionedCount,unreadMentionedMeCount:this.unreadMentionedMeCount,hasMentioned:this.hasMentioned,mentionedInfo:this.mentionedInfo,lastUnreadTime:0,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,notificationStatus:Ue(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft,includeRobot:this.includeRobot})}}),Object.defineProperty(e.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};return this.isTop&&(e.to=!0),this.notificationLevel!==Re.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.translateStrategy!==Lr.DEFAULT&&(e.ts=this.translateStrategy),this.hidden&&(e.h=!0),e}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.updateAttrs(r(r({},Qd()),{tags:this.tags,isTop:this.isTop,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,hidden:!0}))}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:e,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0},e)}}),Object.defineProperty(e.prototype,"updateAttrs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;void 0===t&&(t=0);var r={},i={latestMessage:"latestMessage",unreadCount:"unreadMessageCount",hasMentioned:"hasMentioned",mentionedInfo:"mentionedInfo",notificationLevel:"notificationLevel",tags:"tags",isTop:"isTop",translateStrategy:"translateStrategy",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,includeRobot:void 0,hidden:void 0};return Object.entries(i).forEach((function(i){var o=u(i,2),a=o[0],s=o[1],l=a;if(Object.prototype.hasOwnProperty.call(e,l)){var d=e[l];c(n,qd,"f")[l]!==d&&(c(n,qd,"f")[l]=d,s&&(r[s]={time:t,val:d}))}})),Object.keys(r).length>0?r:null}}),e}();Fd=new WeakMap,Bd=new WeakMap,Hd=new WeakMap,qd=new WeakMap;var Zd,zd,$d,e_=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.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}}),n}(Xd),t_=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.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(n.prototype,"isDefaultChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!this.channelId||"RCDefault"===this.channelId}}),n}(Xd),n_=function(e){function n(t){var n=e.call(this)||this;return Zd.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"models",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),n}return t(n,e),Object.defineProperty(n.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ua.localStorage,n=e.appkey,r=e.currentUserId,i=e.isDisableEmptyUGChannelId,o=rt(n,r),a=nt(n,r),s=it(n,r),u=ze(n,r),l=Ze(n,r),d=$e(n,r),_=et(n,r),f=t.getItem(o)||"0",h=t.getItem(a)||"0",g=t.getItem(s)||"1",p=t.getItem(l)||"0",E=JSON.parse(t.getItem(_)||"{}"),b=JSON.parse(t.getItem(u)||"{}"),T=JSON.parse(t.getItem(d)||"{}");return c(this,Zd,"m",zd).call(this,b,T,E,i),{inboxTime:{value:parseInt(f,10)||0,key:o},outboxTime:{value:parseInt(h,10)||0,key:a},broadcastTime:{value:parseInt(g,10)||0,key:s},conversationStatus:{value:b,key:u,stringify:!0},ultraGroupStatus:{value:T,key:d,stringify:!0},conversationStatusVersion:{value:parseInt(p,10)||0,key:l},conversationTypeGlobalSettings:{value:E,key:_,stringify:!0}}}}),Object.defineProperty(n.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),this.models.clear(),c(this,Zd,"m",$d).call(this)}}),Object.defineProperty(n.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("conversationTypeGlobalSettings");t===Re.NOT_SET?delete n[e]:n[e]={nl:t},this.set("conversationTypeGlobalSettings",n)}}),Object.defineProperty(n.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return(null===(t=this.get("conversationTypeGlobalSettings")[e])||void 0===t?void 0:t.nl)||Re.NOT_SET}}),Object.defineProperty(n.prototype,"getOrCreateModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=e.conversationType,r=e.targetId;e.channelId;var i=this.getModel(e);if(!i){i=e.conversationType===F.ULTRA_GROUP?new t_(e):new e_(e);var o=(n===F.PRIVATE||n===F.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===r}));i.updateAttrs({includeRobot:o}),t&&this.models.set(Wd(e),i)}return i}}),Object.defineProperty(n.prototype,"updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("ultraGroupStatus"),n=this.get("conversationStatus");e.forEach((function(e){var r=e.conversationType,i=e.key,o=e.toStoragItem(),a=Object.keys(o),s=0===a.length||1===a.length&&"h"===a[0],u=r===F.ULTRA_GROUP?t:n;s?delete u[i]:u[i]=o})),this.set("conversationStatus",n),this.set("ultraGroupStatus",t)}}),Object.defineProperty(n.prototype,"updateBySessionStates",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=e.version,r=e.state;if(this.set("conversationStatusVersion",n),!(null==r?void 0:r.length))return[];var i=new Map,o=new Set;return r.forEach((function(e){var r=e.channelId,a=e.busChannel,s=e.type,u=e.stateItem;e.time;var l={};if(null==u||u.forEach((function(e){var t=e.tags,n=e.sessionStateType,r=e.value;switch(n){case ga.IsSilent:l.notificationLevel=parseInt(r,10);break;case ga.IsTop:l.isTop="1"===r;break;case ga.Tags:l.tags=t;break;case ga.AutoTrans:l.translateStrategy=parseInt(r,10)}})),r){var c={conversationType:s,targetId:r,channelId:a},d=t.getOrCreateModel(c,!0);o.add(d);var _=d.updateAttrs(l,n);if(_)if(i.has(d)){var f=i.get(d);Object.assign(f,_)}else i.set(d,_)}else void 0!==l.notificationLevel&&t.setConversationTypeNotificationLevel(s,l.notificationLevel)})),this.updateConversationStorage(Array.from(o)),Array.from(i.entries()).map((function(e){var t=u(e,2),n=t[0],r=t[1];return{conversation:n.toIReceivedConversation(),updatedItems:r}}))}}),Object.defineProperty(n.prototype,"addRelations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;e.forEach((function(e){var r=e.userId,i=e.type,o={conversationType:i,targetId:r,channelId:e.busChannel},a=n.getOrCreateModel(o,!0),s=function(e,t){var n,r,i,o=e.msg,a=e.isBot;return{latestMessage:o?Nc(o,t,!1,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===(r=e.msgInfo)||void 0===r?void 0:r.msgId,firstUnreadTime:null===(i=e.msgInfo)||void 0===i?void 0:i.msgTime,includeRobot:!!a}}(e,t);i===F.ULTRA_GROUP?a.updateAttrs(s):a.updateAttrs({latestMessage:s.latestMessage,operationTime:s.operationTime,includeRobot:s.includeRobot,hidden:!1})}))}}),Object.defineProperty(n.prototype,"getDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);return(null==t?void 0:t.draft)||""}}),Object.defineProperty(n.prototype,"setDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}}),Object.defineProperty(n.prototype,"deleteDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);t&&t.updateAttrs({draft:""})}}),Object.defineProperty(n.prototype,"getCachedUGConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n={conversationType:F.ULTRA_GROUP,targetId:e,channelId:t},r=this.getModel(n);return(null==r?void 0:r.toIReceivedConversation())||null}}),Object.defineProperty(n.prototype,"getAllUGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.models.values();return Array.from(e).filter((function(e){return e.conversationType===F.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(n.prototype,"getAllSGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.models.values();return Array.from(e).filter((function(e){return e.conversationType!==F.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(n.prototype,"getAllModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(this.models.values())}}),Object.defineProperty(n.prototype,"getModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,r=Wd(e),i=this.models.get(r);if(!i)return null;var o=(t===F.PRIVATE||t===F.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===n}));return i.updateAttrs({includeRobot:o}),i}}),Object.defineProperty(n.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);t&&(t.remove(),this.updateConversationStorage([t]))}}),Object.defineProperty(n.prototype,"getAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=0;return this.getAllSGModels().forEach((function(r){var i,o=r.conversationType;e.includes(o)&&(r.notificationLevel>Re.NOT_SET&&!t||(n+=null!==(i=r.unreadCount)&&void 0!==i?i:0))})),n}}),Object.defineProperty(n.prototype,"getTagConversationCountMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Map;return this.getAllModels().forEach((function(t){var n=t.tags;n.length>0&&n.forEach((function(n){e.set(n.tagId,(e.get(n.tagId)||[]).concat(t.identifier))}))})),e}}),Object.defineProperty(n.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.getModel(e);if(!n)return null;var r=n.clearUnreadCount(t);return this.updateConversationStorage([n]),r?{conversation:n.toIReceivedConversation(),updatedItems:r}:null}}),n}(Yd);Zd=new WeakSet,zd=function(e,t,n,r){Object.keys(e).forEach((function(t){var r=Kd(t);te(r.conversationType,W)?r.targetId||(n[r.conversationType]={nl:e[t].nl||Re.NOT_SET},delete e[t]):delete e[t]})),Object.keys(t).forEach((function(e){var i=Kd(e);if(i.conversationType===F.ULTRA_GROUP)return i.targetId?void(r&&!i.channelId&&delete t[e]):(n[i.conversationType]={nl:t[e].nl||Re.NOT_SET},void delete t[e]);delete t[e]}))},$d=function(){var e=this,t=Object.entries(this.get("conversationStatus")),n=Object.entries(this.get("ultraGroupStatus"));l(l([],u(t),!1),u(n),!1).forEach((function(t){var n,r,i,o,a,s,l,c,d,_,f,h,g,p,E,b=u(t,2),T=b[0],v=b[1],R=Kd(T);te(R.conversationType,J)&&e.getOrCreateModel(R,!0).updateAttrs((r=(n=v).c,i=n.mc,o=n.mmc,a=n.hm,s=n.m,l=n.fut,c=n.fuid,d=n.fumt,_=n.nl,f=n.to,h=n.tg,g=n.rt,p=n.h,E=n.ts,{isTop:f,notificationLevel:_,tags:Jd(h),unreadCount:r,unreadMentionedCount:i,unreadMentionedMeCount:o,hasMentioned:a,mentionedInfo:s,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:d,lastReadTime:g,hidden:p,translateStrategy:E}),0)}))};function r_(e){let t=e.length;for(;--t>=0;)e[t]=0}const i_=256,o_=286,a_=30,s_=15,u_=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]),l_=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]),c_=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),d_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),__=new Array(576);r_(__);const f_=new Array(60);r_(f_);const h_=new Array(512);r_(h_);const g_=new Array(256);r_(g_);const p_=new Array(29);r_(p_);const E_=new Array(a_);function b_(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let T_,v_,R_;function I_(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}r_(E_);const m_=e=>e<256?h_[e]:h_[256+(e>>>7)],y_=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},A_=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,y_(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},S_=(e,t,n)=>{A_(e,n[2*t],n[2*t+1])},O_=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},N_=(e,t,n)=>{const r=new Array(16);let i,o,a=0;for(i=1;i<=s_;i++)a=a+n[i-1]<<1,r[i]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=O_(r[t]++,t))}},C_=e=>{let t;for(t=0;t<o_;t++)e.dyn_ltree[2*t]=0;for(t=0;t<a_;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},P_=e=>{e.bi_valid>8?y_(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},L_=(e,t,n,r)=>{const i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},w_=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&L_(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!L_(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},M_=(e,t,n)=>{let r,i,o,a,s=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+s++],r+=(255&e.pending_buf[e.sym_buf+s++])<<8,i=e.pending_buf[e.sym_buf+s++],0===r?S_(e,i,t):(o=g_[i],S_(e,o+i_+1,t),a=u_[o],0!==a&&(i-=p_[o],A_(e,i,a)),r--,o=m_(r),S_(e,o,n),a=l_[o],0!==a&&(r-=E_[o],A_(e,r,a)))}while(s<e.sym_next);S_(e,256,t)},U_=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<o;a++)0!==n[2*a]?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[2*a+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,n[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[2*u+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)w_(e,n,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],w_(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[2*u]=n[2*a]+n[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[2*a+1]=n[2*s+1]=u,e.heap[1]=u++,w_(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,d,_,f,h,g=0;for(_=0;_<=s_;_++)e.bl_count[_]=0;for(n[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],_=n[2*n[2*c+1]+1]+1,_>u&&(_=u,g++),n[2*c+1]=_,c>r||(e.bl_count[_]++,f=0,c>=s&&(f=a[c-s]),h=n[2*c],e.opt_len+=h*(_+f),o&&(e.static_len+=h*(i[2*c+1]+f)));if(0!==g){do{for(_=u-1;0===e.bl_count[_];)_--;e.bl_count[_]--,e.bl_count[_+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(_=u;0!==_;_--)for(c=e.bl_count[_];0!==c;)d=e.heap[--l],d>r||(n[2*d+1]!==_&&(e.opt_len+=(_-n[2*d+1])*n[2*d],n[2*d+1]=_),c--)}})(e,t),N_(n,l,e.bl_count)},D_=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<u&&i===a||(s<l?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4))},G_=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<u&&i===a)){if(s<l)do{S_(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(S_(e,i,e.bl_tree),s--),S_(e,16,e.bl_tree),A_(e,s-3,2)):s<=10?(S_(e,17,e.bl_tree),A_(e,s-3,3)):(S_(e,18,e.bl_tree),A_(e,s-11,7));s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4)}};let V_=!1;const j_=(e,t,n,r)=>{A_(e,0+(r?1:0),3),P_(e),y_(e,n),y_(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var k_=(e,t,n,r)=>{let i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&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<i_;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),U_(e,e.l_desc),U_(e,e.d_desc),a=(e=>{let t;for(D_(e,e.dyn_ltree,e.l_desc.max_code),D_(e,e.dyn_dtree,e.d_desc.max_code),U_(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*d_[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=n+5,n+4<=i&&-1!==t?j_(e,t,n,r):4===e.strategy||o===i?(A_(e,2+(r?1:0),3),M_(e,__,f_)):(A_(e,4+(r?1:0),3),((e,t,n,r)=>{let i;for(A_(e,t-257,5),A_(e,n-1,5),A_(e,r-4,4),i=0;i<r;i++)A_(e,e.bl_tree[2*d_[i]+1],3);G_(e,e.dyn_ltree,t-1),G_(e,e.dyn_dtree,n-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),M_(e,e.dyn_ltree,e.dyn_dtree)),C_(e),r&&P_(e)},x_={_tr_init:e=>{V_||((()=>{let e,t,n,r,i;const o=new Array(16);for(n=0,r=0;r<28;r++)for(p_[r]=n,e=0;e<1<<u_[r];e++)g_[n++]=r;for(g_[n-1]=r,i=0,r=0;r<16;r++)for(E_[r]=i,e=0;e<1<<l_[r];e++)h_[i++]=r;for(i>>=7;r<a_;r++)for(E_[r]=i<<7,e=0;e<1<<l_[r]-7;e++)h_[256+i++]=r;for(t=0;t<=s_;t++)o[t]=0;for(e=0;e<=143;)__[2*e+1]=8,e++,o[8]++;for(;e<=255;)__[2*e+1]=9,e++,o[9]++;for(;e<=279;)__[2*e+1]=7,e++,o[7]++;for(;e<=287;)__[2*e+1]=8,e++,o[8]++;for(N_(__,287,o),e=0;e<a_;e++)f_[2*e+1]=5,f_[2*e]=O_(e,5);T_=new b_(__,u_,257,o_,s_),v_=new b_(f_,l_,0,a_,s_),R_=new b_(new Array(0),c_,0,19,7)})(),V_=!0),e.l_desc=new I_(e.dyn_ltree,T_),e.d_desc=new I_(e.dyn_dtree,v_),e.bl_desc=new I_(e.bl_tree,R_),e.bi_buf=0,e.bi_valid=0,C_(e)},_tr_stored_block:j_,_tr_flush_block:k_,_tr_tally:(e,t,n)=>(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++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(g_[n]+i_+1)]++,e.dyn_dtree[2*m_(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{A_(e,2,3),S_(e,256,__),(e=>{16===e.bi_valid?(y_(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 F_=(e,t,n,r)=>{let i=65535&e,o=e>>>16&65535,a=0;for(;0!==n;){a=n>2e3?2e3:n,n-=a;do{i=i+t[r++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16};const B_=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var H_=(e,t,n,r)=>{const i=B_,o=r+n;e^=-1;for(let n=r;n<o;n++)e=e>>>8^i[255&(e^t[n])];return~e},q_={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"},Y_={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:W_,_tr_stored_block:K_,_tr_flush_block:J_,_tr_tally:Q_,_tr_align:X_}=x_,{Z_NO_FLUSH:Z_,Z_PARTIAL_FLUSH:z_,Z_FULL_FLUSH:$_,Z_FINISH:ef,Z_BLOCK:tf,Z_OK:nf,Z_STREAM_END:rf,Z_STREAM_ERROR:of,Z_DATA_ERROR:af,Z_BUF_ERROR:sf,Z_DEFAULT_COMPRESSION:uf,Z_FILTERED:lf,Z_HUFFMAN_ONLY:cf,Z_RLE:df,Z_FIXED:_f,Z_DEFAULT_STRATEGY:ff,Z_UNKNOWN:hf,Z_DEFLATED:gf}=Y_,pf=258,Ef=262,bf=42,Tf=113,vf=666,Rf=(e,t)=>(e.msg=q_[t],t),If=e=>2*e-(e>4?9:0),mf=e=>{let t=e.length;for(;--t>=0;)e[t]=0},yf=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do{n=e.head[--r],e.head[r]=n>=i?n-i:0}while(--t);t=i,r=t;do{n=e.prev[--r],e.prev[r]=n>=i?n-i:0}while(--t)};let Af=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const Sf=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},Of=(e,t)=>{J_(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Sf(e.strm)},Nf=(e,t)=>{e.pending_buf[e.pending++]=t},Cf=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Pf=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=F_(e.adler,t,i,n):2===e.state.wrap&&(e.adler=H_(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Lf=(e,t)=>{let n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-Ef?e.strstart-(e.w_size-Ef):0,l=e.window,c=e.w_mask,d=e.prev,_=e.strstart+pf;let f=l[o+a-1],h=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(n=t,l[n+a]===h&&l[n+a-1]===f&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&o<_);if(r=pf-(_-o),o=_-pf,r>a){if(e.match_start=t,a=r,r>=s)break;f=l[o+a-1],h=l[o+a]}}}while((t=d[t&c])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead},wf=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ef)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),yf(e),r+=t),0===e.strm.avail_in)break;if(n=Pf(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Af(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Af(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<Ef&&0!==e.strm.avail_in)},Mf=(e,t)=>{let n,r,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,s=e.strm.avail_in;do{if(n=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,r=e.strstart-e.block_start,n>r+e.strm.avail_in&&(n=r+e.strm.avail_in),n>i&&(n=i),n<o&&(0===n&&t!==ef||t===Z_||n!==r+e.strm.avail_in))break;a=t===ef&&n===r+e.strm.avail_in?1:0,K_(e,0,0,a),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Sf(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(Pf(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===a);return s-=e.strm.avail_in,s&&(s>=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<=s&&(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-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==Z_&&t!==ef&&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&&(Pf(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,r=e.strstart-e.block_start,(r>=o||(r||t===ef)&&t!==Z_&&0===e.strm.avail_in&&r<=i)&&(n=r>i?i:r,a=t===ef&&0===e.strm.avail_in&&n===r?1:0,K_(e,e.block_start,n,a),e.block_start+=n,Sf(e.strm)),a?3:1)},Uf=(e,t)=>{let n,r;for(;;){if(e.lookahead<Ef){if(wf(e),e.lookahead<Ef&&t===Z_)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Af(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-Ef&&(e.match_length=Lf(e,n)),e.match_length>=3)if(r=Q_(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=Af(e,e.ins_h,e.window[e.strstart+3-1]),n=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=Af(e,e.ins_h,e.window[e.strstart+1]);else r=Q_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Of(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===ef?(Of(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Of(e,!1),0===e.strm.avail_out)?1:2},Df=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Ef){if(wf(e),e.lookahead<Ef&&t===Z_)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Af(e,e.ins_h,e.window[e.strstart+3-1]),n=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!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Ef&&(e.match_length=Lf(e,n),e.match_length<=5&&(e.strategy===lf||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,r=Q_(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=Af(e,e.ins_h,e.window[e.strstart+3-1]),n=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++,r&&(Of(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=Q_(e,0,e.window[e.strstart-1]),r&&Of(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&&(r=Q_(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===ef?(Of(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Of(e,!1),0===e.strm.avail_out)?1:2};function Gf(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const Vf=[new Gf(0,0,0,0,Mf),new Gf(4,4,8,4,Uf),new Gf(4,5,16,8,Uf),new Gf(4,6,32,32,Uf),new Gf(4,4,16,16,Df),new Gf(8,16,32,32,Df),new Gf(8,16,128,128,Df),new Gf(8,32,128,256,Df),new Gf(32,128,258,1024,Df),new Gf(32,258,258,4096,Df)];function jf(){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=gf,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),mf(this.dyn_ltree),mf(this.dyn_dtree),mf(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),mf(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mf(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 kf=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==bf&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Tf&&t.status!==vf?1:0},xf=e=>{if(kf(e))return Rf(e,of);e.total_in=e.total_out=0,e.data_type=hf;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?bf:Tf,e.adler=2===t.wrap?0:1,t.last_flush=-2,W_(t),nf},Ff=e=>{const t=xf(e);var n;return t===nf&&((n=e.state).window_size=2*n.w_size,mf(n.head),n.max_lazy_match=Vf[n.level].max_lazy,n.good_match=Vf[n.level].good_length,n.nice_match=Vf[n.level].nice_length,n.max_chain_length=Vf[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},Bf=(e,t,n,r,i,o)=>{if(!e)return of;let a=1;if(t===uf&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||n!==gf||r<8||r>15||t<0||t>9||o<0||o>_f||8===r&&1!==a)return Rf(e,of);8===r&&(r=9);const s=new jf;return e.state=s,s.strm=e,s.status=bf,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=o,s.method=n,Ff(e)};var Hf={deflateInit:(e,t)=>Bf(e,t,gf,15,8,ff),deflateInit2:Bf,deflateReset:Ff,deflateResetKeep:xf,deflateSetHeader:(e,t)=>kf(e)||2!==e.state.wrap?of:(e.state.gzhead=t,nf),deflate:(e,t)=>{if(kf(e)||t>tf||t<0)return e?Rf(e,of):of;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===vf&&t!==ef)return Rf(e,0===e.avail_out?sf:of);const r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(Sf(e),0===e.avail_out)return n.last_flush=-1,nf}else if(0===e.avail_in&&If(t)<=If(r)&&t!==ef)return Rf(e,sf);if(n.status===vf&&0!==e.avail_in)return Rf(e,sf);if(n.status===bf&&0===n.wrap&&(n.status=Tf),n.status===bf){let t=gf+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=cf||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=r<<6,0!==n.strstart&&(t|=32),t+=31-t%31,Cf(n,t),0!==n.strstart&&(Cf(n,e.adler>>>16),Cf(n,65535&e.adler)),e.adler=1,n.status=Tf,Sf(e),0!==n.pending)return n.last_flush=-1,nf}if(57===n.status)if(e.adler=0,Nf(n,31),Nf(n,139),Nf(n,8),n.gzhead)Nf(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Nf(n,255&n.gzhead.time),Nf(n,n.gzhead.time>>8&255),Nf(n,n.gzhead.time>>16&255),Nf(n,n.gzhead.time>>24&255),Nf(n,9===n.level?2:n.strategy>=cf||n.level<2?4:0),Nf(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Nf(n,255&n.gzhead.extra.length),Nf(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=H_(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(Nf(n,0),Nf(n,0),Nf(n,0),Nf(n,0),Nf(n,0),Nf(n,9===n.level?2:n.strategy>=cf||n.level<2?4:0),Nf(n,3),n.status=Tf,Sf(e),0!==n.pending)return n.last_flush=-1,nf;if(69===n.status){if(n.gzhead.extra){let t=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=H_(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,Sf(e),0!==n.pending)return n.last_flush=-1,nf;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=H_(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=H_(e.adler,n.pending_buf,n.pending-r,r)),Sf(e),0!==n.pending)return n.last_flush=-1,nf;r=0}t=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,Nf(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=H_(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=H_(e.adler,n.pending_buf,n.pending-r,r)),Sf(e),0!==n.pending)return n.last_flush=-1,nf;r=0}t=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,Nf(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=H_(e.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Sf(e),0!==n.pending))return n.last_flush=-1,nf;Nf(n,255&e.adler),Nf(n,e.adler>>8&255),e.adler=0}if(n.status=Tf,Sf(e),0!==n.pending)return n.last_flush=-1,nf}if(0!==e.avail_in||0!==n.lookahead||t!==Z_&&n.status!==vf){let r=0===n.level?Mf(n,t):n.strategy===cf?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(wf(e),0===e.lookahead)){if(t===Z_)return 1;break}if(e.match_length=0,n=Q_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Of(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===ef?(Of(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Of(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===df?((e,t)=>{let n,r,i,o;const a=e.window;for(;;){if(e.lookahead<=pf){if(wf(e),e.lookahead<=pf&&t===Z_)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=e.strstart+pf;do{}while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);e.match_length=pf-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=Q_(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Q_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Of(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===ef?(Of(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Of(e,!1),0===e.strm.avail_out)?1:2})(n,t):Vf[n.level].func(n,t);if(3!==r&&4!==r||(n.status=vf),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),nf;if(2===r&&(t===z_?X_(n):t!==tf&&(K_(n,0,0,!1),t===$_&&(mf(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Sf(e),0===e.avail_out))return n.last_flush=-1,nf}return t!==ef?nf:n.wrap<=0?rf:(2===n.wrap?(Nf(n,255&e.adler),Nf(n,e.adler>>8&255),Nf(n,e.adler>>16&255),Nf(n,e.adler>>24&255),Nf(n,255&e.total_in),Nf(n,e.total_in>>8&255),Nf(n,e.total_in>>16&255),Nf(n,e.total_in>>24&255)):(Cf(n,e.adler>>>16),Cf(n,65535&e.adler)),Sf(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?nf:rf)},deflateEnd:e=>{if(kf(e))return of;const t=e.state.status;return e.state=null,t===Tf?Rf(e,af):nf},deflateSetDictionary:(e,t)=>{let n=t.length;if(kf(e))return of;const r=e.state,i=r.wrap;if(2===i||1===i&&r.status!==bf||r.lookahead)return of;if(1===i&&(e.adler=F_(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===i&&(mf(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,wf(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=Af(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,wf(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,nf},deflateInfo:"pako deflate (from Nodeca project)"};const qf=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Yf={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)qf(n,t)&&(e[t]=n[t])}}return e},flattenChunks:e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;const n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n}};let Wf=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Wf=!1}const Kf=new Uint8Array(256);for(let e=0;e<256;e++)Kf[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Kf[254]=Kf[254]=1;var Jf={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i<a;i++)n=e.charCodeAt(i),55296==(64512&n)&&i+1<a&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)n=e.charCodeAt(i),55296==(64512&n)&&i+1<a&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},buf2string:(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,i;const o=new Array(2*n);for(i=0,r=0;r<n;){let t=e[r++];if(t<128){o[i++]=t;continue}let a=Kf[t];if(a>4)o[i++]=65533,r+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&r<n;)t=t<<6|63&e[r++],a--;a>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&&Wf)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n})(o,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+Kf[e[n]]>t?n:t}};var Qf=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 Xf=Object.prototype.toString,{Z_NO_FLUSH:Zf,Z_SYNC_FLUSH:zf,Z_FULL_FLUSH:$f,Z_FINISH:eh,Z_OK:th,Z_STREAM_END:nh,Z_DEFAULT_COMPRESSION:rh,Z_DEFAULT_STRATEGY:ih,Z_DEFLATED:oh}=Y_;function ah(e){this.options=Yf.assign({level:rh,method:oh,chunkSize:16384,windowBits:15,memLevel:8,strategy:ih},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 Qf,this.strm.avail_out=0;let n=Hf.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==th)throw new Error(q_[n]);if(t.header&&Hf.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Jf.string2buf(t.dictionary):"[object ArrayBuffer]"===Xf.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=Hf.deflateSetDictionary(this.strm,e),n!==th)throw new Error(q_[n]);this._dict_set=!0}}ah.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?eh:Zf,"string"==typeof e?n.input=Jf.string2buf(e):"[object ArrayBuffer]"===Xf.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===zf||o===$f)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(i=Hf.deflate(n,o),i===nh)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Hf.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===th;if(0!==n.avail_out){if(o>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},ah.prototype.onData=function(e){this.chunks.push(e)},ah.prototype.onEnd=function(e){e===th&&(this.result=Yf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const sh=16209;var uh=function(e,t){let n,r,i,o,a,s,u,l,c,d,_,f,h,g,p,E,b,T,v,R,I,m,y,A;const S=e.state;n=e.next_in,y=e.input,r=n+(e.avail_in-5),i=e.next_out,A=e.output,o=i-(t-e.avail_out),a=i+(e.avail_out-257),s=S.dmax,u=S.wsize,l=S.whave,c=S.wnext,d=S.window,_=S.hold,f=S.bits,h=S.lencode,g=S.distcode,p=(1<<S.lenbits)-1,E=(1<<S.distbits)-1;e:do{f<15&&(_+=y[n++]<<f,f+=8,_+=y[n++]<<f,f+=8),b=h[_&p];t:for(;;){if(T=b>>>24,_>>>=T,f-=T,T=b>>>16&255,0===T)A[i++]=65535&b;else{if(!(16&T)){if(64&T){if(32&T){S.mode=16191;break e}e.msg="invalid literal/length code",S.mode=sh;break e}b=h[(65535&b)+(_&(1<<T)-1)];continue t}for(v=65535&b,T&=15,T&&(f<T&&(_+=y[n++]<<f,f+=8),v+=_&(1<<T)-1,_>>>=T,f-=T),f<15&&(_+=y[n++]<<f,f+=8,_+=y[n++]<<f,f+=8),b=g[_&E];;){if(T=b>>>24,_>>>=T,f-=T,T=b>>>16&255,16&T){if(R=65535&b,T&=15,f<T&&(_+=y[n++]<<f,f+=8,f<T&&(_+=y[n++]<<f,f+=8)),R+=_&(1<<T)-1,R>s){e.msg="invalid distance too far back",S.mode=sh;break e}if(_>>>=T,f-=T,T=i-o,R>T){if(T=R-T,T>l&&S.sane){e.msg="invalid distance too far back",S.mode=sh;break e}if(I=0,m=d,0===c){if(I+=u-T,T<v){v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}}else if(c<T){if(I+=u+c-T,T-=c,T<v){v-=T;do{A[i++]=d[I++]}while(--T);if(I=0,c<v){T=c,v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}}}else if(I+=c-T,T<v){v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}for(;v>2;)A[i++]=m[I++],A[i++]=m[I++],A[i++]=m[I++],v-=3;v&&(A[i++]=m[I++],v>1&&(A[i++]=m[I++]))}else{I=i-R;do{A[i++]=A[I++],A[i++]=A[I++],A[i++]=A[I++],v-=3}while(v>2);v&&(A[i++]=A[I++],v>1&&(A[i++]=A[I++]))}break}if(64&T){e.msg="invalid distance code",S.mode=sh;break e}b=g[(65535&b)+(_&(1<<T)-1)]}}break}}while(n<r&&i<a);v=f>>3,n-=v,f-=v<<3,_&=(1<<f)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=i<a?a-i+257:257-(i-a),S.hold=_,S.bits=f};const lh=15,ch=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]),dh=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]),_h=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]),fh=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 hh=(e,t,n,r,i,o,a,s)=>{const u=s.bits;let l,c,d,_,f,h,g=0,p=0,E=0,b=0,T=0,v=0,R=0,I=0,m=0,y=0,A=null;const S=new Uint16Array(16),O=new Uint16Array(16);let N,C,P,L=null;for(g=0;g<=lh;g++)S[g]=0;for(p=0;p<r;p++)S[t[n+p]]++;for(T=u,b=lh;b>=1&&0===S[b];b--);if(T>b&&(T=b),0===b)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(E=1;E<b&&0===S[E];E++);for(T<E&&(T=E),I=1,g=1;g<=lh;g++)if(I<<=1,I-=S[g],I<0)return-1;if(I>0&&(0===e||1!==b))return-1;for(O[1]=0,g=1;g<lh;g++)O[g+1]=O[g]+S[g];for(p=0;p<r;p++)0!==t[n+p]&&(a[O[t[n+p]]++]=p);if(0===e?(A=L=a,h=20):1===e?(A=ch,L=dh,h=257):(A=_h,L=fh,h=0),y=0,p=0,g=E,f=o,v=T,R=0,d=-1,m=1<<T,_=m-1,1===e&&m>852||2===e&&m>592)return 1;for(;;){N=g-R,a[p]+1<h?(C=0,P=a[p]):a[p]>=h?(C=L[a[p]-h],P=A[a[p]-h]):(C=96,P=0),l=1<<g-R,c=1<<v,E=c;do{c-=l,i[f+(y>>R)+c]=N<<24|C<<16|P}while(0!==c);for(l=1<<g-1;y&l;)l>>=1;if(0!==l?(y&=l-1,y+=l):y=0,p++,0==--S[g]){if(g===b)break;g=t[n+a[p]]}if(g>T&&(y&_)!==d){for(0===R&&(R=T),f+=E,v=g-R,I=1<<v;v+R<b&&(I-=S[v+R],!(I<=0));)v++,I<<=1;if(m+=1<<v,1===e&&m>852||2===e&&m>592)return 1;d=y&_,i[d]=T<<24|v<<16|f-o}}return 0!==y&&(i[f+y]=g-R<<24|64<<16),s.bits=T,0};const{Z_FINISH:gh,Z_BLOCK:ph,Z_TREES:Eh,Z_OK:bh,Z_STREAM_END:Th,Z_NEED_DICT:vh,Z_STREAM_ERROR:Rh,Z_DATA_ERROR:Ih,Z_MEM_ERROR:mh,Z_BUF_ERROR:yh,Z_DEFLATED:Ah}=Y_,Sh=16180,Oh=16190,Nh=16191,Ch=16192,Ph=16194,Lh=16199,wh=16200,Mh=16206,Uh=16209,Dh=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Gh(){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 Vh=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Sh||t.mode>16211?1:0},jh=e=>{if(Vh(e))return Rh;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=Sh,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,bh},kh=e=>{if(Vh(e))return Rh;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,jh(e)},xh=(e,t)=>{let n;if(Vh(e))return Rh;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Rh:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,kh(e))},Fh=(e,t)=>{if(!e)return Rh;const n=new Gh;e.state=n,n.strm=e,n.window=null,n.mode=Sh;const r=xh(e,t);return r!==bh&&(e.state=null),r};let Bh,Hh,qh=!0;const Yh=e=>{if(qh){Bh=new Int32Array(512),Hh=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(hh(1,e.lens,0,288,Bh,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;hh(2,e.lens,0,32,Hh,0,e.work,{bits:5}),qh=!1}e.lencode=Bh,e.lenbits=9,e.distcode=Hh,e.distbits=5},Wh=(e,t,n,r)=>{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)),r>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),(r-=i)?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var Kh={inflateReset:kh,inflateReset2:xh,inflateResetKeep:jh,inflateInit:e=>Fh(e,15),inflateInit2:Fh,inflate:(e,t)=>{let n,r,i,o,a,s,u,l,c,d,_,f,h,g,p,E,b,T,v,R,I,m,y=0;const A=new Uint8Array(4);let S,O;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Vh(e)||!e.output||!e.input&&0!==e.avail_in)return Rh;n=e.state,n.mode===Nh&&(n.mode=Ch),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,l=n.hold,c=n.bits,d=s,_=u,m=bh;e:for(;;)switch(n.mode){case Sh:if(0===n.wrap){n.mode=Ch;break}for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,A[0]=255&l,A[1]=l>>>8&255,n.check=H_(n.check,A,2,0),l=0,c=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Uh;break}if((15&l)!==Ah){e.msg="unknown compression method",n.mode=Uh;break}if(l>>>=4,c-=4,I=8+(15&l),0===n.wbits&&(n.wbits=I),I>15||I>n.wbits){e.msg="invalid window size",n.mode=Uh;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:Nh,l=0,c=0;break;case 16181:for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(n.flags=l,(255&n.flags)!==Ah){e.msg="unknown compression method",n.mode=Uh;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Uh;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=H_(n.check,A,2,0)),l=0,c=0,n.mode=16182;case 16182:for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,n.check=H_(n.check,A,4,0)),l=0,c=0,n.mode=16183;case 16183:for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=H_(n.check,A,2,0)),l=0,c=0,n.mode=16184;case 16184:if(1024&n.flags){for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=H_(n.check,A,2,0)),l=0,c=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(f=n.length,f>s&&(f=s),f&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+f),I)),512&n.flags&&4&n.wrap&&(n.check=H_(n.check,r,f,o)),s-=f,o+=f,n.length-=f),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;f=0;do{I=r[o+f++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I))}while(I&&f<s);if(512&n.flags&&4&n.wrap&&(n.check=H_(n.check,r,f,o)),s-=f,o+=f,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;f=0;do{I=r[o+f++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I))}while(I&&f<s);if(512&n.flags&&4&n.wrap&&(n.check=H_(n.check,r,f,o)),s-=f,o+=f,I)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(4&n.wrap&&l!==(65535&n.check)){e.msg="header crc mismatch",n.mode=Uh;break}l=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Nh;break;case 16189:for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}e.adler=n.check=Dh(l),l=0,c=0,n.mode=Oh;case Oh:if(0===n.havedict)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,vh;e.adler=n.check=1,n.mode=Nh;case Nh:if(t===ph||t===Eh)break e;case Ch:if(n.last){l>>>=7&c,c-=7&c,n.mode=Mh;break}for(;c<3;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}switch(n.last=1&l,l>>>=1,c-=1,3&l){case 0:n.mode=16193;break;case 1:if(Yh(n),n.mode=Lh,t===Eh){l>>>=2,c-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=Uh}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Uh;break}if(n.length=65535&l,l=0,c=0,n.mode=Ph,t===Eh)break e;case Ph:n.mode=16195;case 16195:if(f=n.length,f){if(f>s&&(f=s),f>u&&(f=u),0===f)break e;i.set(r.subarray(o,o+f),a),s-=f,o+=f,u-=f,a+=f,n.length-=f;break}n.mode=Nh;break;case 16196:for(;c<14;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(n.nlen=257+(31&l),l>>>=5,c-=5,n.ndist=1+(31&l),l>>>=5,c-=5,n.ncode=4+(15&l),l>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Uh;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;c<3;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.lens[N[n.have++]]=7&l,l>>>=3,c-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},m=hh(0,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,m){e.msg="invalid code lengths set",n.mode=Uh;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;y=n.lencode[l&(1<<n.lenbits)-1],p=y>>>24,E=y>>>16&255,b=65535&y,!(p<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(b<16)l>>>=p,c-=p,n.lens[n.have++]=b;else{if(16===b){for(O=p+2;c<O;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(l>>>=p,c-=p,0===n.have){e.msg="invalid bit length repeat",n.mode=Uh;break}I=n.lens[n.have-1],f=3+(3&l),l>>>=2,c-=2}else if(17===b){for(O=p+3;c<O;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=p,c-=p,I=0,f=3+(7&l),l>>>=3,c-=3}else{for(O=p+7;c<O;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=p,c-=p,I=0,f=11+(127&l),l>>>=7,c-=7}if(n.have+f>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Uh;break}for(;f--;)n.lens[n.have++]=I}}if(n.mode===Uh)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=Uh;break}if(n.lenbits=9,S={bits:n.lenbits},m=hh(1,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,m){e.msg="invalid literal/lengths set",n.mode=Uh;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},m=hh(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,m){e.msg="invalid distances set",n.mode=Uh;break}if(n.mode=Lh,t===Eh)break e;case Lh:n.mode=wh;case wh:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,uh(e,_),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,l=n.hold,c=n.bits,n.mode===Nh&&(n.back=-1);break}for(n.back=0;y=n.lencode[l&(1<<n.lenbits)-1],p=y>>>24,E=y>>>16&255,b=65535&y,!(p<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(E&&!(240&E)){for(T=p,v=E,R=b;y=n.lencode[R+((l&(1<<T+v)-1)>>T)],p=y>>>24,E=y>>>16&255,b=65535&y,!(T+p<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=T,c-=T,n.back+=T}if(l>>>=p,c-=p,n.back+=p,n.length=b,0===E){n.mode=16205;break}if(32&E){n.back=-1,n.mode=Nh;break}if(64&E){e.msg="invalid literal/length code",n.mode=Uh;break}n.extra=15&E,n.mode=16201;case 16201:if(n.extra){for(O=n.extra;c<O;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;y=n.distcode[l&(1<<n.distbits)-1],p=y>>>24,E=y>>>16&255,b=65535&y,!(p<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(!(240&E)){for(T=p,v=E,R=b;y=n.distcode[R+((l&(1<<T+v)-1)>>T)],p=y>>>24,E=y>>>16&255,b=65535&y,!(T+p<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=T,c-=T,n.back+=T}if(l>>>=p,c-=p,n.back+=p,64&E){e.msg="invalid distance code",n.mode=Uh;break}n.offset=b,n.extra=15&E,n.mode=16203;case 16203:if(n.extra){for(O=n.extra;c<O;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Uh;break}n.mode=16204;case 16204:if(0===u)break e;if(f=_-u,n.offset>f){if(f=n.offset-f,f>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Uh;break}f>n.wnext?(f-=n.wnext,h=n.wsize-f):h=n.wnext-f,f>n.length&&(f=n.length),g=n.window}else g=i,h=a-n.offset,f=n.length;f>u&&(f=u),u-=f,n.length-=f;do{i[a++]=g[h++]}while(--f);0===n.length&&(n.mode=wh);break;case 16205:if(0===u)break e;i[a++]=n.length,u--,n.mode=wh;break;case Mh:if(n.wrap){for(;c<32;){if(0===s)break e;s--,l|=r[o++]<<c,c+=8}if(_-=u,e.total_out+=_,n.total+=_,4&n.wrap&&_&&(e.adler=n.check=n.flags?H_(n.check,i,_,a-_):F_(n.check,i,_,a-_)),_=u,4&n.wrap&&(n.flags?l:Dh(l))!==n.check){e.msg="incorrect data check",n.mode=Uh;break}l=0,c=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(4&n.wrap&&l!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=Uh;break}l=0,c=0}n.mode=16208;case 16208:m=Th;break e;case Uh:m=Ih;break e;case 16210:return mh;default:return Rh}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,(n.wsize||_!==e.avail_out&&n.mode<Uh&&(n.mode<Mh||t!==gh))&&Wh(e,e.output,e.next_out,_-e.avail_out),d-=e.avail_in,_-=e.avail_out,e.total_in+=d,e.total_out+=_,n.total+=_,4&n.wrap&&_&&(e.adler=n.check=n.flags?H_(n.check,i,_,e.next_out-_):F_(n.check,i,_,e.next_out-_)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Nh?128:0)+(n.mode===Lh||n.mode===Ph?256:0),(0===d&&0===_||t===gh)&&m===bh&&(m=yh),m},inflateEnd:e=>{if(Vh(e))return Rh;let t=e.state;return t.window&&(t.window=null),e.state=null,bh},inflateGetHeader:(e,t)=>{if(Vh(e))return Rh;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,bh):Rh},inflateSetDictionary:(e,t)=>{const n=t.length;let r,i,o;return Vh(e)?Rh:(r=e.state,0!==r.wrap&&r.mode!==Oh?Rh:r.mode===Oh&&(i=1,i=F_(i,t,n,0),i!==r.check)?Ih:(o=Wh(e,t,n,n),o?(r.mode=16210,mh):(r.havedict=1,bh)))},inflateInfo:"pako inflate (from Nodeca project)"};var Jh=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 Qh=Object.prototype.toString,{Z_NO_FLUSH:Xh,Z_FINISH:Zh,Z_OK:zh,Z_STREAM_END:$h,Z_NEED_DICT:eg,Z_STREAM_ERROR:tg,Z_DATA_ERROR:ng,Z_MEM_ERROR:rg}=Y_;function ig(e){this.options=Yf.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 Qf,this.strm.avail_out=0;let n=Kh.inflateInit2(this.strm,t.windowBits);if(n!==zh)throw new Error(q_[n]);if(this.header=new Jh,Kh.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Jf.string2buf(t.dictionary):"[object ArrayBuffer]"===Qh.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Kh.inflateSetDictionary(this.strm,t.dictionary),n!==zh)))throw new Error(q_[n])}function og(e,t){const n=new ig(t);if(n.push(e),n.err)throw n.msg||q_[n.err];return n.result}ig.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Zh:Xh,"[object ArrayBuffer]"===Qh.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=Kh.inflate(n,a),o===eg&&i&&(o=Kh.inflateSetDictionary(n,i),o===zh?o=Kh.inflate(n,a):o===ng&&(o=eg));n.avail_in>0&&o===$h&&n.state.wrap>0&&0!==e[n.next_in];)Kh.inflateReset(n),o=Kh.inflate(n,a);switch(o){case tg:case ng:case eg:case rg:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||o===$h))if("string"===this.options.to){let e=Jf.utf8border(n.output,n.next_out),t=n.next_out-e,i=Jf.buf2string(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(o!==zh||0!==s){if(o===$h)return o=Kh.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},ig.prototype.onData=function(e){this.chunks.push(e)},ig.prototype.onEnd=function(e){e===zh&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Yf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ag={Inflate:ig,inflate:og,inflateRaw:function(e,t){return(t=t||{}).raw=!0,og(e,t)},ungzip:og,constants:Y_};const{Inflate:sg,inflate:ug,inflateRaw:lg,ungzip:cg}=ag;var dg=cg;function _g(e){return Object.keys(e).map((function(t){var n=e[t];return"string"!=typeof n&&(n="".concat(n)),{key:t,value:n}}))}function fg(e,t,n,r){return Ol.encode(cu,{targetId:e,type:F.GROUP,users:r,extProfile:n?_g(n):void 0,settingProfile:_g(t)})}var hg,gg,pg,Eg,bg,Tg,vg,Rg,Ig,mg=function(e,t){return Ol.encode(Wa,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},yg=function(e){var t=Ol.decode(Da,e),n=t.compressioEnabled,r=t.compressedData,i=t.info,o=t.pullTime,a=t.isFinished,s=t.pageToken;if(n){var u=dg(r);return yg(u)}return{info:i,pullTime:o,isFinished:a,pageToken:s}},Ag=function(e){var t=Ol.decode(Ia,e);if(t.compressioEnabled){var n=dg(t.compressedData);return Ag(n)}return t},Sg=function(e){var t=Ol.decode(ma,e);if(t.compressioEnabled){var n=dg(t.compressedData);return Sg(n)}return{syncTime:t.syncTime,list:t.list.map((function(e){return Ol.decode(ya,new Uint8Array(e))}))}},Og=function(e){return Ol.encode(bs,r(r({},e),{compress:Od.enable()}))},Ng=function(e){var t=Ol.decode(vs,e);if(t.compress){var n=dg(t.compressData);return Ng(n)}return t},Cg=function(e){var t=Ol.decode(Rs,e);if(t.compress){var n=dg(t.compressData);return Cg(n)}return t},Pg=function(e){var t=e.listType,n=e.result,i=e.page,o=new Uint8Array(n),a=[];switch(t){case 1:a=Ol.decode(Eu,o).list;break;case 2:a=Ol.decode(pu,o).list;break;case 3:a=Ol.decode(bu,o).list;break;case 11:a=Ol.decode(Pu,o).list;break;case 12:a=Ol.decode(Lu,o).list}return r(r({},i),{list:a})},Lg=function(e){return Ol.encode(Ba,r(r({},e),{compressioEnabled:Od.enable(),ignoreCmd:!0}))},wg=function(e){var t=Ol.decode(Ha,e);if(t.compressioEnabled){var n=dg(t.compressedData);return wg(n)}return t},Mg=function(e,t){return Ol.encode(ls,{ignoreVersion:!0,version:e,state:t})},Ug=function(e){var t=Ol.decode(Yu,e);if(t.compress){var n=dg(t.compressedData);return Ug(n)}return t},Dg=function(e){return Ol.encode(ns,{timestamp:e,compressioEnabled:Od.enable()})},Gg=function(e){var t=Ol.decode(es,e);if(t.compressioEnabled){var n=dg(t.compressedData);return Gg(n)}return t},Vg=function(e,t){var n,r,i,o,a=e.targetId,l=e.conversationType,c=e.channelId,d=t.messageType,_=t.isMentioned,f=t.disableNotification,h=t.canIncludeExpansion,g=t.pushConfig,p=t.directionalUserIdList,E=t.isVoipPush,b=t.isFilerWhiteBlacklist,T=t.content,v=t.pushContent,R=t.pushData,I=t.expansion,m=t.messageId,y=t.needReceipt,A=t.disableUpdateLastMessage,S=t.isStatusMessage,O=Rr(d).isPersited,N=Cc(d,_,f,h,S),C=function(e,t,n,r){var i=0;return e&&(i|=1),t&&(i|=2),n&&(i|=4),r&&(i|=8),i}(!!E,!b,!!(null==g?void 0:g.disablePushTitle),!!(null==g?void 0:g.forceShowDetailContent));if(T.user&&T.user.portraitUri&&(T.user.portrait=T.user.portraitUri),h&&I){i={};try{for(var P=s(Object.entries(I)),L=P.next();!L.done;L=P.next()){var w=u(L.value,2),M=w[0],U=w[1];i[M]={v:U}}}catch(e){n={error:e}}finally{try{L&&!L.done&&(r=P.return)&&r.call(P)}finally{if(n)throw n.error}}}if(g){var D=g.pushTitle,G=g.iOSConfig,V=g.androidConfig,j=g.templateId,k=g.harmonyOSConfig;o={title:D,pushConfigs:nn(G,V,k),pushId:null==V?void 0:V.notificationId,templateId:j}}var x=l===F.SYSTEM?a:void 0,B=0;return O&&A&&(B|=1),y&&(B|=2),Ol.encode(Ra,{sessionId:N,pushText:(null==g?void 0:g.pushContent)||v,appData:(null==g?void 0:g.pushData)||R,toUserIds:p,configFlag:C,classname:d,content:JSON.stringify(T),extraContent:i?JSON.stringify(i):void 0,pushExt:o,clientUniqueId:m,busChannel:c,systemId:x,optionBits:B})},jg=function(e){return Ol.encode(hu,r(r({},e),{type:F.GROUP}))},kg=function(e){return Ol.encode(Tu,r(r({},e),{type:F.GROUP}))},xg=function(e){return Ol.encode(fu,r(r({},e),{type:F.GROUP}))},Fg=function(e){function n(t,n){var r=e.call(this,"WebSGModule")||this;return hg.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:n}),r._ctx.on("sNtf",c(r,hg,"m",Eg),r),r._ctx.on("sMsg",c(r,hg,"m",pg),r),r._ctx.on("syncMsg",c(r,hg,"m",gg),r),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c,d,_,f,h,g,p,E,b,T,v;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,n=t.logger,r=t.currentUserId,i=t.connectedTime,o=this._storage.get("inboxTime"),s=this._storage.get("outboxTime"),u=this._storage.get("broadcastTime"),l=n.createTraceId(),n.info(B.L_PULL_MSG_T,JSON.stringify({inboxTime:o,outboxTime:s,broadcastTime:u}),l),c=Ol.encode(va,{ispolling:!1,isPullSend:!0,syncTime:o,sendBoxSyncTime:s,broadcastSyncTime:u,compressioEnabled:Od.enable()}),[4,this._ctx.query(jr.pullMsg,this._ctx.currentUserId,c)];case 1:return(d=a.sent()).isOk?(_=Ag(d.data.pbData),h=(f=_).list,g=f.finished,p=f.syncTime,E=f.broadcastSyncTime,b=s,T=h.map((function(e){var t=Nc(e,r,e.dataTime<i);return t.messageDirection===be.SEND&&(b=Math.max(b,t.sentTime)),t})),this._storage.set("inboxTime",p),this._storage.set("broadcastTime",E||1),this._storage.set("outboxTime",b),n.info(B.L_PULL_MSG_R,JSON.stringify({code:0,inboxTime:p,broadcastTime:E,outboxTime:b,msgCount:T.length,hasNext:!!g}),l),v=Math.max(p,E||1,b),this._ctx.emit("messagesFromSG",T,!!g,e),[2,Tn({version:v,hasNext:!g})]):(n.warn(B.L_PULL_MSG_R,JSON.stringify({code:d.code}),l),[2,d.wipe()])}}))}))}}),n}(pn);hg=new WeakSet,gg=function(e,t,n){var r=t.conversationType,i=t.sentTime;r!==F.ULTRA_GROUP&&r!==F.CHATROOM&&(r===F.RTC_ROOM||ed(n)||(e.stopPropagation(),this.push(i)))},pg=function(e,t){var n=t.conversationType,r=t.sentTime,i=t.isStatusMessage;n!==F.CHATROOM&&(e.stopPropagation(),i||n===F.RTC_ROOM?this._ctx.emit("smsgFromSignalGroup",t):this.push(r))},Eg=function(e,t){1===t.type&&(e.stopPropagation(),this.push(t.time))};var Bg,Hg,qg=function(e){function n(t){var n=e.call(this,"WebUGModule")||this;return bg.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),n._ctx.on("syncMsg",c(n,bg,"m",vg),n),n._ctx.on("sCmd",c(n,bg,"m",Tg),n),n}return t(n,e),Object.defineProperty(n.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,bg,"m",Ig).call(this,0)];case 1:return(e=a.sent()).isOk?(this._ctx.logger.info(B.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,c(this,bg,"m",Rg).call(this,0,[])]):(this._ctx.logger.warn(B.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(n=a.sent()).isOk?(r=n.data,i=r.length>0?r[r.length-1].versionTime:0,o=Math.max(t,i),[2,Tn({relations:r,msgVersion:o})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return a(this,(function(n){switch(n.label){case 0:return[4,c(this,bg,"m",Ig).call(this,e)];case 1:return[2,n.sent().trans((function(e){var n=e,r=n.syncTime,i=n.finished,o=n.list;if(null==o?void 0:o.length){var a=t._ctx.currentUserId,s=o.map((function(e){return Nc(e,a,!1)}));t._ctx.emit("messagesFromUG",s,r)}return{version:r,hasNext:!i}}))]}}))}))}}),n}(pn);bg=new WeakSet,Tg=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},vg=function(e,t){t.conversationType===F.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},Rg=function e(t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,d,_,f,h,g;return a(this,(function(a){switch(a.label){case 0:return(r=this._ctx).currentUserId,i=r.logger,o=i.createTraceId(),i.info(B.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),o),s=Ol.encode(Os,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query(jr.pullUgSes,this._ctx.currentUserId,s,void 0)];case 1:return d=a.sent(),i.summary(B.L_PULL_UG_RELATIONS_R,d,o,{ver:t}),d.isOk?(_=yg(d.data.pbData),f=_.info,h=_.isFinished,n.push.apply(n,l([],u(f),!1)),h?[2,Tn(n)]:(g=f[f.length-1].versionTime,[2,c(this,bg,"m",e).call(this,g,n)])):[2,d.wipe()]}}))}))},Ig=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,n=t.currentUserId,r=t.logger,i=r.createTraceId(),r.info(B.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=Ol.encode(Ns,{syncTime:l,compressioEnabled:Od.enable()}),[4,this._ctx.query(jr.pullUgMsg,n,o)];case 1:return s=a.sent(),r.summary(B.L_PULL_ULTRA_MSG_R,s,i,{version:e}),s.isOk?(u=s.data,[2,Tn(Ag(u.pbData))]):[2,s.wipe()]}var l}))}))};var Yg,Wg,Kg,Jg=13,Qg=36,Xg=41,Zg=function(e){function n(t,n){var r=e.call(this,"WebServerEventHandler")||this;return Bg.add(r),Object.defineProperty(r,"_con",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,l,d=this;return a(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(B.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,c(this,Bg,"m",Hg).call(this,e)];case 1:return n=a.sent(),this._logger.summary(B.L_PULL_EVENT_CHANGE_R,n,t,{version:e}),n.isOk?(r=n.data,i=r.list,o=r.syncTime,s=r.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),n=t[0],r=t[1];d.emit("serverEvent",n,r)}))),[2,Tn({version:o,hasNext:s})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(B.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,c(this,Bg,"m",Hg).call(this,0)];case 1:return t=n.sent(),this._logger.summary(B.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),n}(pn);Bg=new WeakSet,Hg=function(e){var t=Ol.encode(Ls,{syncTime:e});return this._con.query(jr.pullEventChange,this._con.getCurrentUserId(),t,ws)};var zg=function(e){function n(t){var n=e.call(this,"WebUGServerEventHandler")||this;return Yg.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),n}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=Ol.encode(Ls,{syncTime:e}),[4,this._ctx.query(jr.qryMsgChange,this._ctx.currentUserId,t,Ms)];case 1:return(n=a.sent()).isOk?(r=n.data,i=r.list,o=r.syncTime,s=r.hasNext,i&&i.length&&c(this,Yg,"m",Wg).call(this,i),[2,Tn({version:o,hasNext:s})]):[2,n.wipe()]}}))}))}}),n}(pn);Yg=new WeakSet,Wg=function(e){var t=[],n=[],r=[],i=[],o=[];e.forEach((function(e){switch(e.changeType){case 1:n.push(e);break;case 2:t.push(e);break;case 3:r.push(e);break;case 4:i.push(e);break;case 5:o.push(e)}})),n.length&&c(this,Yg,"m",Kg).call(this,n,1),t.length&&c(this,Yg,"m",Kg).call(this,t,2),r.length&&this.emit("ugMsgRecalled",e),i.length&&this._ctx.emit("ugChannelChanged",i),o.length&&this._ctx.emit("ugUserGroupChanged",o)},Kg=function(e,t){var n=this,r=new Map;e.forEach((function(e){var t=e.targetId,n=e.busChannel,i=e.msgUID,o="".concat(t,"-").concat(n),a=r.get(o);a?a.messageUIds.push(i):r.set(o,{conversationIdentifier:{conversationType:F.ULTRA_GROUP,targetId:t,channelId:n},messageUIds:[i]})})),Array.from(r.entries()).forEach((function(e){var r=u(e,2);r[0];var i=r[1];1===t?n.emit("ugMsgExpansion",i.conversationIdentifier,i.messageUIds):n.emit("ugMsgModify",i.conversationIdentifier,i.messageUIds)}))};var $g,ep,tp,np,rp,ip,op,ap,sp,up,lp,cp,dp,_p,fp,hp,gp,pp,Ep,bp,Tp,vp,Rp,Ip,mp,yp,Ap,Sp,Op,Np,Cp,Pp,Lp,wp,Mp,Up,Dp,Gp=function(){return o(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,x.NOT_SUPPORT]}))}))},Vp=function(){return o(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,vn(x.NOT_SUPPORT,"Not support")]}))}))},jp=function(e){function n(t,n){var r=e.call(this,"WebSGMsgModifyReceiver")||this;return $g.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"storage",{enumerable:!0,configurable:!0,writable:!0,value:n}),ep.set(r,0),tp.set(r,!0),r._ctx.on("onConnected",c(r,$g,"m",np),r),r._ctx.on("messagesFromSG",c(r,$g,"m",rp),r),r}return t(n,e),Object.defineProperty(n.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.setInitVersion(c(this,ep,"f"),!0)}}),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger.createTraceId(),this._ctx.logger.info(B.L_PULL_MODIFY_MSG_T,JSON.stringify({time:e}),t),_={pullVersion:e},n=Ol.encode(qu,r(r({},_),{modifyType:[1],compress:Od.enable()})),[4,this._ctx.query(jr.pullModifyMsg,this._ctx.currentUserId,n,void 0)];case 1:return i=a.sent(),this._ctx.logger.summary(B.L_PULL_MODIFY_MSG_R,i,t),i.isOk?(o=Ug(i.data.pbData),s=o.msg,u=o.nextVersion,l=o.finished,s&&s.length&&c(this,$g,"m",ip).call(this,s),c(this,tp,"f")&&(this._ctx.emit("messageModifiedSyncCompleted",!l),d(this,tp,!1,"f")),[2,Tn({version:u,hasNext:!l})]):[2,i.wipe()]}var _}))}))}}),n}(pn);ep=new WeakMap,tp=new WeakMap,$g=new WeakSet,np=function(e,t){d(this,tp,!0,"f"),t||(this.reset(),d(this,ep,this._ctx.connectedTime,"f"))},rp=function(e,t,n,r){0===r&&t.length>0&&d(this,ep,t[0].sentTime,"f")},ip=function(e){var t=this,n=[],r=this._ctx.currentUserId;e.forEach((function(e){var i=e.msg;if(1===e.modifyType){var o=Nc(i,r,!1);n.push(o);var a=o.conversationType,s=o.targetId,u=o.channelId,l=t.storage.getModel({conversationType:a,targetId:s,channelId:u});if(l&&l.latestMessage){var c=l.latestMessage,d=c.messageUId,_=c.messageType,f=c.content;if(d!==o.messageUId){if(_===me.REFERENCE){if(f.referMsgUid!==o.messageUId)return;f.referMsg=o.content}}else l.updateAttrs({latestMessage:o})}}})),n.length&&this._ctx.emit("messageModified",n)};var kp=18e4,xp=function(){function e(e,t){ap.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_userSettins",{enumerable:!0,configurable:!0,writable:!0,value:t}),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}),sp.set(this,void 0),up.set(this,void 0),lp.set(this,void 0),cp.set(this,void 0),pp.set(this,1),Object.defineProperty(this,"getConversationListByPageIndex",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Pp.set(this,new Set),Object.defineProperty(this,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"syncRemoteConversations",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"getMessagesAroundTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"deleteLocalUGMessagesForAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"getUnreadMentionedMessages",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"saveEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"getEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"clearEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),this.storage=new n_(e),this.settings=new xd(this._ctx,this.storage),d(this,sp,new qg(this._ctx),"f"),d(this,up,new Fg(this._ctx,this.storage),"f"),d(this,lp,new zg(this._ctx),"f"),d(this,cp,new jp(this._ctx,this.storage),"f"),c(this,lp,"f").on("ugMsgModify",c(this,ap,"m",Tp),this),c(this,lp,"f").on("ugMsgExpansion",c(this,ap,"m",vp),this),c(this,lp,"f").on("ugMsgRecalled",c(this,ap,"m",Rp),this),this._ctx.on("onConnected",c(this,ap,"m",gp),this),this._ctx.on("onDisconnected",c(this,ap,"m",yp),this),this._ctx.on("onSuspend",c(this,ap,"m",yp),this),this._ctx.on("sCmd",c(this,ap,"m",Ap),this),this._ctx.on("signal",c(this,ap,"m",Sp),this),this._ctx.on("serverEvent",c(this,ap,"m",_p),this),this._ctx.on("robotsSynced",c(this,ap,"m",dp),this)}return Object.defineProperty(e.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,cp,"f").startPullModifyMsg()}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,d;return a(this,(function(a){return n=e.count,r=e.startTime,i=e.order,o=e.conversationTypes,t?(s=0!==r||i?r:Number.MAX_SAFE_INTEGER,u=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==F.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>s:e.operationTime<s)})).sort((function(e,t){return e.operationTime-t.operationTime})),l=Math.min(u.length,n),d=i?u.slice(0,l):u.slice(u.length-l),i||d.reverse(),[2,Tn(d.map((function(e){return e.toIReceivedConversation()})))]):[2,c(this,ap,"m",Op).call(this,r,n,i||0,o)]}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){return r=((null==t?void 0:t.length)||0)>0?t:ee(e?J:W),i="string"==typeof n&&""!==n,o=this.storage.getAllModels().filter((function(t){return t.isTop&&!t.hidden&&r.includes(t.conversationType)&&(t.conversationType!==F.ULTRA_GROUP&&(!i||t.channelId===n)||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,ap,"m",Np).call(this,o)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>Re.NOT_SET&&(t.conversationType!==F.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,ap,"m",Np).call(this,t)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){return n=((null==t?void 0:t.length)||0)>0?t:ee(e?J:W),r=this.storage.getAllModels().filter((function(t){return t.unreadCount>0&&n.includes(t.conversationType)&&(t.conversationType!==F.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,ap,"m",Np).call(this,r)]}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n="string"==typeof t,e?(r=this.storage.getAllModels().filter((function(e){return!(e.hidden||(e.conversationType===F.ULTRA_GROUP||n&&e.channelId!==t)&&e.channelId&&"RCDefault"!==e.channelId)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,Tn(r)]):[4,c(this,ap,"m",Op).call(this,0,1e3,0)];case 1:return[2,i.sent().trans((function(e){return e.filter((function(e){return!n||e.channelId===t}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=0,this.storage.getAllModels().forEach((function(i){i.unreadCount>0&&e.includes(i.conversationType)&&(i.conversationType!==F.ULTRA_GROUP&&(!n&&!i.channelId||i.channelId===n)||i.conversationType===F.ULTRA_GROUP&&(""===i.channelId||"RCDefault"===i.channelId))&&(t||i.notificationLevel<=Re.NOT_SET)&&(r+=i.unreadCount)})),[2,Tn(r)]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return t=this.storage.getOrCreateModel(e,!1),n=t.toIReceivedConversation(),[4,c(this,ap,"m",Np).call(this,[n])];case 1:return(r=i.sent()).isOk?[2,r.trans((function(e){return e[0]}))]:[2,Tn(n)]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,ap,"m",Cp).call(this,e,n,t)];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.version,u=o.updateVersion,l=e.map((function(e){var n=d.storage.getOrCreateModel(e,!0);return n.updateAttrs({isTop:t,hidden:!r&&n.hidden,operationTime:n.hidden&&r?Date.now():n.operationTime}),n})),this.storage.updateConversationStorage(l),u&&this.storage.set("conversationStatusVersion",s),[2,Tn()]):[2,i.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 n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,ap,"m",Cp).call(this,e,n,void 0,t)];case 1:return(r=a.sent()).isOk?(i=r.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var n=l.storage.getOrCreateModel(e,!0);return n.updateAttrs({notificationLevel:t}),n})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,Tn()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,ap,"m",Cp).call(this,e,n,void 0,void 0,t)];case 1:return(r=a.sent()).isOk?(i=r.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var n=l.storage.getOrCreateModel(e,!0);return n.updateAttrs({translateStrategy:t}),n})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,Tn()]):[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 a(this,(function(n){return t=this.storage.getOrCreateModel(e,!1),[2,Tn(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 a(this,(function(n){return t=this.storage.getConversationTypeNotificationLevel(e),[2,Tn(t)]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),r=this._ctx.currentUserId,i=Ol.encode(hs,{type:e,unpushLevel:t,version:n,ignoreVersion:!0}),[4,this._ctx.query(jr.setTypeUnpush,r,i,gs)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,this.storage.setConversationTypeNotificationLevel(e,t),l&&this.storage.set("conversationStatusVersion",u),[2,Tn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){return e=this.storage.getAllSGModels(),t=this._ctx.serverTime,e.forEach((function(e){return e.clearUnreadCount(t)})),this.storage.updateConversationStorage(e),[2,Tn()]}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),r=Ol.encode(Za,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:n}),i=e.conversationType===F.ULTRA_GROUP?jr.delUgMsg:jr.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,r)];case 1:return(o=a.sent()).isOk?this._ctx.includeUg?((s=this.storage.getModel(e))&&(u=s.latestMessage)&&t.some((function(e){return e.messageUId===u.messageUId}))&&s.updateAttrs({latestMessage:null}),[2,Tn()]):[2,Tn()]:[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 n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=Ol.encode(ja,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),r=Kp[e.conversationType],[4,this._ctx.query(r,this._ctx.currentUserId,n)];case 1:return(i=a.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(s=o.latestMessage)&&(0===t||s.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,Tn()]):[2,Tn()]:[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,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=Ol.encode(ka,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query(jr.cleanMsgBatch,this._ctx.currentUserId,t)];case 1:return(n=i.sent()).isOk?(e.forEach((function(e){var t=r.storage.getModel(e);if(t){var n=t.latestMessage;n&&(!e.timestamp||n.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),[2,Tn()]):[2,n.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 n,r;return a(this,(function(i){switch(i.label){case 0:return n=Ol.encode(Es,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),r=t[0],[4,this._ctx.query(jr.readReceipt,r,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,l;return a(this,(function(a){switch(a.label){case 0:return t=new Map,e.forEach((function(e){var n=Wd(e.identifier),r=t.get(n)||new Set;r.add(e.messageUId),t.set(n,r)})),n=Array.from(t.entries()).map((function(e){var t=u(e,2),n=t[0],r=t[1],i=Kd(n);return{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgIds:Array.from(r)}})),r=function(e){return Ol.encode(Ts,{items:e,compress:Od.enable()})}(n),[4,this._ctx.query(jr.qryReceiptBatch,e[0].messageUId,r)];case 1:return(i=a.sent()).isOk?(o=i.data,s=Cg(o.pbData).item,l=[],s.forEach((function(e){var t,n={conversationType:e.type,targetId:e.targetId,channelId:e.busChannel};null===(t=e.msg)||void 0===t||t.forEach((function(e){var t=e.msgId,r=e.unreadCnt,i=e.readCnt,o=e.totalCnt;l.push({identifier:n,messageUId:t,unreadCount:r,readCount:i,totalCount:o})}))})),[2,Tn(l)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return r=0===n.readStatus?1:2,i=Og({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:1,pageType:1,pageToken:n.pageToken,pageSize:n.pageCount,readType:r,order:n.order?0:1}),[4,this._ctx.query(jr.qryReceipt,t,i)];case 1:return(o=a.sent()).isOk?(s=o.data,u=Ng(s.pbData),l=u.resp,c=u.pageToken,d=l[0],[2,Tn({pageToken:c||"",totalCount:1===r?d.readCnt:d.unreadCnt,users:(1===r?d.readUser:d.unreadUser).map((function(e){var t=e.userId,n=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!n}}))})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:return r=Og({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:n}),[4,this._ctx.query(jr.qryReceipt,t,r)];case 1:return(i=a.sent()).isOk?(o=i.data,s=Ng(o.pbData).resp,c=s[0],[2,Tn({pageToken:"",totalCount:0,users:l(l([],u(c.readUser),!1),u(c.unreadUser),!1).map((function(e){var t=e.userId,n=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!n}}))})]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=Rn.create("requestSpeechToTextForMessage").isObject("option",t,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==t?void 0:t.messageType,(function(e){return e===me.HQ_VOICE||e===me.VOICE}),!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){if(t.messageType===me.HQ_VOICE)e.validate("numberOfChannels",t.numberOfChannels,(function(e){return 1===e}),!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",t.sampleRate,(function(e){return 16e3===e||8e3===e}),!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",t.format).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").isHttpUrl("remoteUrl",t.remoteUrl,!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid");else{var n=t.content;e.isNotEmptyString("content",n,!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid")}})).isLimitedInteger("duration",t.duration,1,60,!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid").result()).isOk?c(this,Pp,"f").has(e)?[2,vn(x.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process")]:(c(this,ap,"m",Lp).call(this,e,t),[2,Tn()]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=e.messageUId,n=e.messageContent,r=e.conversation,i=Ol.encode(Cs,{targetId:r.targetId,type:r.conversationType,busChannel:r.channelId,msgUID:t,msgTime:0,content:JSON.stringify(n),fromUserId:""}),[4,this._ctx.query(jr.modifyMsg,this._ctx.currentUserId,i,Ps)];case 1:return(o=a.sent()).isOk?((s=this.storage.getModel(r))&&(u=s.latestMessage,l=s.conversationType,u&&u.messageUId===t&&(u.content=n,u.isModifyMessage=!0,u.modifyInfo=l===F.ULTRA_GROUP?void 0:{timestamp:o.data.modifyTime,status:Hn,content:{}},s.updateAttrs({latestMessage:u}))),[2,Tn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s=this;return a(this,(function(a){return(o=Rn.create("refreshReferenceMessageWithParams").validate("messageInfoMap",i,(function(t){return t&&e.every((function(e){return t[e]&&mt(t[e])}))}),!0).fail(x.INVALID_PARAMETER_MESSAGE_INFO_MAP).result()).isOk?(setTimeout((function(){r([]),c(s,ap,"m",Mp).call(s,e,t,n,i)}),0),[2,Tn()]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,l,c,d,_,f,h,g,p=this;return a(this,(function(a){switch(a.label){case 0:return this._userSettins.hasTag(e)?(n=this.storage.get("conversationStatusVersion"),r=Date.now(),i=this._ctx.currentUserId,o=t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:r,stateItem:[{sessionStateType:ga.Tags,value:"",tags:[{tagId:e}]}]}})),s=Mg(n,o),[4,this._ctx.query(jr.addTag,i,s,fs)]):[2,vn(x.TAG_NOT_EXIST)];case 1:return(l=a.sent()).isOk?(c=l.data,d=c.version,_=c.updateVersion,f=new Map,t.forEach((function(t){var n=p.storage.getOrCreateModel(t,!0),r={},i=n.tags;i.some((function(t){return t.tagId===e}))||(r.tags=i.concat({tagId:e}),f.set(n,r))})),h=[],g=[],Array.from(f.entries()).forEach((function(e){var t=u(e,2),n=t[0],r=t[1];g.push(n);var i=n.updateAttrs(r,d);i&&h.push({conversation:n.toIReceivedConversation(),updatedItems:i})})),this.storage.updateConversationStorage(g),_&&this.storage.set("conversationStatusVersion",d),h.length>0&&this._ctx.emit("conversationStatusChanged",h),[2,Tn()]):[2,l.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){return t=this.storage.getOrCreateModel(e,!1),n=this._userSettins.getTags(),r=t.tags.map((function(e){var t;return{tagId:e.tagId,tagName:null===(t=n[e.tagId])||void 0===t?void 0:t.tagName}})),[2,Tn(r)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,_,f,h;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),i=n.isTop,o=this.storage.getOrCreateModel(t,!1),s=o.tags,(u=s.find((function(t){return t.tagId===e})))?(l=Mg(r,[{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:ga.Tags,value:"",tags:[{tagId:e,isTop:i}]}]}]),c=this._ctx.currentUserId,[4,this._ctx.query(jr.addTag,c,l,fs)]):[2,vn(x.NO_TAG_IN_CONVER)];case 1:return(d=a.sent()).isOk?(_=d.data,f=_.version,h=_.updateVersion,u.isTop=i,o.updateAttrs({tags:s},f),this.storage.updateConversationStorage([o]),h&&this.storage.set("conversationStatusVersion",f),[2,Tn()]):[2,d.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),r=Mg(n,t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:ga.Tags,value:"",tags:[{tagId:e}]}]}}))),i=this._ctx.currentUserId,[4,this._ctx.query(jr.delTag,i,r,fs)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=t.map((function(t){var n=d.storage.getOrCreateModel(t,!0),r={tags:n.tags.filter((function(t){return t.tagId!==e}))};return n.updateAttrs(r,u),n})),this.storage.updateConversationStorage(c),l&&this.storage.set("conversationStatusVersion",u),[2,Tn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,_;return a(this,(function(a){switch(a.label){case 0:return n=this._ctx.currentUserId,r=this.storage.get("conversationStatusVersion"),i=Mg(r,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:ga.Tags,value:"",tags:t.map((function(e){return{tagId:e}}))}]}]),[4,this._ctx.query(jr.delTag,n,i,fs)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.getOrCreateModel(e,!0),d=c.tags,_={tags:d.filter((function(e){return!t.includes(e.tagId)}))},c.updateAttrs(_,u),this.storage.updateConversationStorage([c]),l&&this.storage.set("conversationStatusVersion",u),[2,Tn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){return this._userSettins.hasTag(e)?(i=t||Number.MAX_SAFE_INTEGER,0===(o=this.storage.getAllSGModels().filter((function(t){return t.operationTime<i&&t.tags.some((function(t){return t.tagId===e}))})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,n)).length?[2,Tn([])]:(s=o.map((function(t){return r(r({},t.toIReceivedConversation()),{isTopInTag:t.tags.some((function(t){return t.tagId===e&&t.isTop}))})})),[2,c(this,ap,"m",Np).call(this,s)])):[2,Tn([])]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return n=0,this.storage.getAllSGModels().forEach((function(r){var i;if(r.tags.some((function(t){return t.tagId===e}))){if(r.notificationLevel>Re.NOT_SET&&!t)return;n+=null!==(i=r.unreadCount)&&void 0!==i?i:0}})),[2,Tn(n)]}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.identifiers,n=e.deleteMessages,r=Ol.encode(Xa,{relation:t.map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),cleanMsg:n}),[4,this._ctx.query(jr.delRelationBatch,this._ctx.currentUserId,r,void 0)];case 1:return(i=a.sent()).isOk&&t.forEach((function(e){var t=o.storage.getModel(e);t&&o.storage.removeConversation(t)})),[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Ol.encode(ps,{msgId:t,channelId:n}),[4,this._ctx.query(jr.rrMsg,e,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationType,n=e.channelId,r=e.targetId,i=Ol.encode(Gs,{targetId:r,type:t,busChannel:n||"",opType:0}),(o=new fo(jr.operate,i,r)).setHeaderQos(Hr),[4,this._ctx.send(o)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){return t=e.targetId,n=e.channelType,r=this.storage.getAllUGModels().filter((function(e){return!(void 0!==t&&t!==e.targetId||void 0!==n&&n!==e.channelType)})).sort((function(e,t){var n,r,i=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-i})).map((function(e){var t=e.toIReceivedConversation();return t.unreadMentionedCount=Uc(t.unreadMentionedCount||0),t.unreadMessageCount=Uc(t.unreadMessageCount||0),t.unreadMentionedMeCount=Uc(t.unreadMentionedMeCount||0),t})),[2,Tn(r)]}))}))}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=this._ctx.currentUserId,[4,c(this,ap,"m",wp).call(this,e,t)];case 1:return(r=a.sent()).isOk?(i=r.data,o=i.list,i.notExistMsgId,s=o.map((function(t){return Nc(t,n,!1,e.targetId)})),[2,Tn(s)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.targetId,n=e.channelId,r=e.sentTime,i=e.count,o=Ol.encode(Ga,{groupId:t,busChannel:n,msgTime:r,size:i}),[4,this._ctx.query(jr.qryUgUal,this._ctx.currentUserId,o,Va)];case 1:return(s=a.sent()).isOk?(u=s.data.msgInfo,[2,Tn(u.map((function(e){return{messageUId:e.msgId,sentTime:e.msgTime,messageType:e.className,mentionedType:e.remindType}})))]):[2,s.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var i;return o(this,void 0,void 0,(function(){var o,s,u,l,c,d,_,f;return a(this,(function(a){switch(a.label){case 0:return o=this._ctx.currentUserId,s=t.mid,u=t.put,l=t.del,c=t.clear,d=Ol.encode(Cs,{fromUserId:o,targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgUID:s,msgTime:n,content:JSON.stringify(t)}),[4,this._ctx.query(jr.upMsgEx,e.targetId,d)];case 1:return(_=a.sent()).isOk&&(null==(f=null===(i=this.storage.getModel(e))||void 0===i?void 0:i.latestMessage)?void 0:f.messageUId)===s&&(c?f.expansion={}:u?f.expansion=r(r({},f.expansion),u):l&&f.expansion&&l.forEach((function(e){delete f.expansion[e]}))),[2,_.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Ol.encode(ds,{unpushLevel:t,busChannel:n}),[4,this._ctx.query(jr.ugUnpushSet,e,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){switch(o.label){case 0:return n=Ol.encode(cs,{busChannel:t}),[4,this._ctx.query(jr.ugUnpushQuery,e,n,_s)];case 1:return(r=o.sent()).isOk?(i=r.data.unpushLevel,[2,Tn(i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return n=this.storage.getModel(e),[2,Tn(null!==(t=null==n?void 0:n.unreadMentionedCount)&&void 0!==t?t:0)]}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return e=this.storage.getAllSGModels().reduce((function(e,t){return e+t.unreadMentionedCount}),0),[2,Tn(e)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=0,this.storage.getAllModels().forEach((function(i){if(e.includes(i.conversationType)){var o=i.notificationLevel,a=i.unreadCount,s=i.unreadMentionedCount;(0===t.length||t.includes(o))&&(r+=n?s:a)}})),[2,Tn(r)]}))}))}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return t=this.storage.getModel(e),[2,Tn(t?t.unreadCount:0)]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return(t=this.storage.getModel(e))?(n=t.firstUnreadMessage,[2,Tn(n?{messageUId:n.messageUId||"",sentTime:n.sentTime}:null)]):[2,Tn(null)]}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){return r=this.storage.getAllUGModels(),i=r.reduce((function(r,i){var o=n?i.unreadMentionedCount:i.unreadCount;if(!o||i.targetId!==e)return r;var a=i.notificationLevel||Re.NOT_SET;return!t.length||t.includes(a)?r+o:r}),0),[2,Tn(Uc(i))]}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return t=this.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:Uc(e.unreadCount||0),mentionedCount:Uc(e.unreadMentionedCount||0),mentionedMeCount:Uc(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||Re.NOT_SET}})),[2,Tn(t)]}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return t=this.storage.getModel(e),(n=null==t?void 0:t.firstUnreadMessage)?[2,Tn(n)]:[2,vn(x.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return e=this.storage.getAllUGModels().filter((function(e){return e.notificationLevel>Re.NOT_SET})).map((function(e){return e.toIReceivedConversation()})),[2,Tn(e)]}))}))}}),Object.defineProperty(e.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return t=this._ctx.serverTime,e.conversationType!==F.ULTRA_GROUP?[3,2]:(n=mg(e,t),(r=new fo(jr.updUgRTime,n,this._ctx.currentUserId)).setHeaderQos(Hr),[4,this._ctx.send(r)]);case 1:if(!(i=o.sent()).isOk)return[2,i.wipe()];o.label=2;case 2:return this.storage.clearConversationUnreadCount(e,t),[2,Tn()]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,ap,"m",Dp).call(this,t,n,e,[],Ve.ALL,jr.qrySessions)];case 1:return(i=a.sent()).isOk?(o=this._ctx.currentUserId,s=i.data.info.map((function(e){var t=e.unreadCount,n=e.busChannel,i=e.type,a=e.userId,s=e.versionTime,l=e.msg,c=u.storage.getOrCreateModel({conversationType:i,targetId:a,channelId:n||""},!1);return r(r({},c.toIReceivedConversation()),{unreadMessageCount:t,operationTime:s,latestMessage:l?Nc(l,o,!1,a):null})})).sort((function(e,t){var r,i,o=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0,a=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===n?a-o:o-a})),[2,Tn(s)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Ol.encode(qa,{nothing:1}),[4,this._ctx.query(jr.qrySessionsAtt,this._ctx.currentUserId,e,Ya)];case 1:return[2,t.sent().trans((function(e){return e.totalUnreadCount}))]}}))}))}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return t=this._ctx.serverTime,this.storage.clearConversationUnreadCount(e,this._ctx.serverTime),n=mg(e,t),r=new fo(jr.updRRTime,n,this._ctx.currentUserId),[4,this._ctx.send(r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Ol.encode(Ka,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(jr.delSessions,this._ctx.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Ol.encode(Ja,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(jr.qrySessionsUnread,this._ctx.currentUserId,t,Qa)];case 1:return[2,n.sent().trans((function(e){return e.sessions.map((function(e){return{conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:e.unreadCount||0}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){return n=e.count,r=e.conversationTypes,i=e.timestamp||Number.MAX_SAFE_INTEGER,t?(o=this.storage.getAllModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&r.includes(e.conversationType)&&(e.conversationType!==F.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,n),[2,Tn(o.map((function(e){return e.toIReceivedConversation()})))]):(s=this.storage.getAllSGModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&r.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,n),u=s.map((function(e){return e.toIReceivedConversation()})),[2,c(this,ap,"m",Np).call(this,u)])}))}))}}),Object.defineProperty(e.prototype,"loadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,_=this;return a(this,(function(a){switch(a.label){case 0:return i=function(e,t,n){var r=n.conversationTypes,i=n.tagFilter,o=void 0===i?{}:i,a=n.order;n.channelId;var s=o.tagIds,u=o.topPriority;return Ol.encode(Ua,{type:r,count:t,order:a,tags:s,isTagTop:!!u,pageToken:e,compress:Od.enable()})}(e,t,n),[4,this._ctx.query(jr.qryRelationFilter,this._ctx.currentUserId,i,void 0)];case 1:return(o=a.sent()).isOk?(s=yg(o.data.pbData),u=s.pageToken,l=s.isFinished,c=s.info,d=c.map((function(e){var t=e.busChannel,n=e.type,i=e.userId,o={conversationType:n,targetId:i,channelId:t||""},a=_.storage.getOrCreateModel(o,!1);return r(r({},a.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Nc(e.msg,_._ctx.currentUserId,!1,i):null})})),[2,Tn({pageToken:u||"",finished:!!l,list:d})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=mg(e,t),r=new fo(jr.updRTime,n,this._ctx.currentUserId),[4,this._ctx.send(r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Ol.encode(ps,{msgId:[t],channelId:n}),[4,this._ctx.query(jr.rrList,e,r,Is)];case 1:return[2,i.sent().trans((function(e){return{totalMemberCount:e.totalMemberNum,list:e.list}}))]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=e.conversationType,i=e.targetId,o=e.channelId,s=Ol.encode(qs,{targetId:i,type:r,busChannel:o,startMsgId:t,endMsgId:n}),u=new fo(jr.sendMsgRead,s,i),[4,this._ctx.send(u)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return n=e.targetId,r=e.channelId,i=void 0===r?"":r,o=Ol.encode(Ys,{targetId:n,busChannel:i,msgId:t}),[4,this._ctx.query(jr.qryMsgRead,n,o,Ws)];case 1:return[2,a.sent().trans((function(e){var t=e.list,n=e.num,r=e.readCnt;return{list:t.map((function(e){return{userId:e.userId,readTime:e.receiptTime}})),totalCount:n,readCount:r}}))]}}))}))}}),Object.defineProperty(e.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=e.targetId,i=e.conversationType,o=e.channelId,s=Ol.encode(Ks,{type:i,busChannel:o,msgId:t}),[4,this._ctx.query(jr.qryMsgReadCntBatch,n,s,Js)];case 1:return[2,a.sent().trans((function(t){return t.result.map((function(t){return r({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){return t=e.count,n=e.conversationTypes,this._ctx.includeUg?(r=e.timestamp||Number.MAX_SAFE_INTEGER,i=this.storage.getAllSGModels().filter((function(e){return e.includeRobot&&e.operationTime<r&&n.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,t),[2,Tn(i.map((function(e){return e.toIReceivedConversation()})))]):[2,c(this,ap,"m",Op).call(this,e.timestamp,t,0,n,Ve.ROBOT_ONLY)]}))}))}}),e}();sp=new WeakMap,up=new WeakMap,lp=new WeakMap,cp=new WeakMap,pp=new WeakMap,Pp=new WeakMap,ap=new WeakSet,dp=function(e,t,n){if(t===x.SUCCESS&&this._ctx.includeUg&&0!==n.length){var r=[F.PRIVATE,F.SYSTEM];this.storage.getAllSGModels().filter((function(e){return r.includes(e.conversationType)&&n.some((function(t){return t.robotId===e.targetId}))})).forEach((function(e){return e.updateAttrs({includeRobot:!0})}))}},_p=function(e,t,n){if(t===Qg){e.stopPropagation();var r=[];n.forEach((function(e){if(0===e.subChangeType){var t=Ol.decode(Vu,new Uint8Array(e.eventData)),n=t.msgId,i=t.unreadCnt,o=t.readCnt,a=t.readList,s=t.totalCnt;r.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:n,users:a.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}})),readCount:o,unreadCount:i,totalCount:s})}})),this._ctx.emit("readReceiptResponseV5",r)}},fp=function(e){e||(c(this,up,"f").setInitVersion(0),this._ctx.includeUg&&c(this,ap,"m",Ep).call(this)),c(this,up,"f").startInterval(kp,!0)},hp=function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return e?[3,2]:(this.settings.reset(),[4,this.settings.syncDataFromServer()]);case 1:t=n.sent(),this.settings.setInitVersion(t),n.label=2;case 2:return this._ctx.isConnected&&this.settings.startInterval(kp,!0),[2]}}))}))},gp=function(e,t){t||this.storage.syncDataFromLocalStorage(this._ctx),c(this,ap,"m",hp).call(this,t),c(this,ap,"m",fp).call(this,t),this._ctx.ugEnabel&&c(this,ap,"m",mp).call(this,t)},Ep=function e(){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,_=this;return a(this,(function(a){switch(a.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,n=t.createTraceId(),r=c(this,pp,"f"),t.info(B.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:r}),n),[4,c(this,ap,"m",Dp).call(this,r,1,1e3)]):[2];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.info,u=o.isFinished,l=o.pullTime,d(this,pp,l,"f"),t.info(B.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:r,isFinished:u,pullTime:l}),n),this.storage.addRelations(s,this._ctx.currentUserId),u?(this._ctx.emit("sgRelationsSynced",x.SUCCESS),[2]):[2,c(this,ap,"m",e).call(this)]):(t.warn(B.L_PULL_SG_RELATIONS_R,i.errmsg(),n),setTimeout((function(){return c(_,ap,"m",e).call(_)}),1e3),[2])}}))}))},bp=function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,ap,"m",wp).call(this,e,t)];case 1:return(r=a.sent()).isOk?(i=r.data.list.map((function(t){return Nc(t,u._ctx.currentUserId,!1,e.targetId)})),(o=this.storage.getModel(e))&&o.latestMessage&&(s=i.find((function(e){return e.messageUId===o.latestMessage.messageUId})))&&o.updateAttrs({latestMessage:s}),2===n?this._ctx.emit("messageModified",i):1===n&&this._ctx.emit("ugMsgExpansionUpdated",i),[2]):[2]}}))}))},Tp=function(e,t,n){c(this,ap,"m",bp).call(this,t,n,2)},vp=function(e,t,n){c(this,ap,"m",bp).call(this,t,n,1)},Rp=function(e,t){var n=this,i=t.map((function(e){var t=e.targetId,i=e.busChannel,o=e.msgUID,a=e.msgTime,s=e.operatorId,u=e.remindType,l={conversationType:F.ULTRA_GROUP,targetId:t,channelId:i||""},d=r(r({},l),{messageUId:o,sentTime:a}),_=r(r({},l),{sentTime:a,messageUId:o,senderUserId:s,content:d,messageDirection:1,messageType:me.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:ye.UNREAD,receivedStatusInfo:jt(ye.UNREAD)}),f=n.storage.getModel(l);return f&&c(n,ap,"m",Ip).call(n,f,_,u),_}));this._ctx.emit("ugMsgRecalled",i)},Ip=function(e,t,n){var r={},i=t.content,o=i.messageUId,a=i.sentTime,s=e.latestMessage;s&&s.messageUId===o&&(r.latestMessage=wc(t,!0)),a&&e.lastReadTime<a&&e.unreadCount&&(r.unreadCount=e.unreadCount-1,n!==Y.ALL&&n!==Y.SINGAL||!e.unreadMentionedCount||(r.unreadMentionedCount=e.unreadMentionedCount-1),n===Y.SINGAL&&e.unreadMentionedCount&&(r.unreadMentionedMeCount=e.unreadMentionedMeCount-1));var u=e.updateAttrs(r,a);this.storage.updateConversationStorage([e]),u&&this._ctx.emit("conversation",[{conversation:e.toIReceivedConversation(),updatedItems:u}])},mp=function(e){return o(this,void 0,void 0,(function(){var e,t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,c(this,sp,"f").markOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,n=t.relations,r=t.msgVersion,this.storage.addRelations(n,this._ctx.currentUserId),this._ctx.emit("ultraGroupEnable"),c(this,sp,"f").setInitVersion(r),c(this,sp,"f").startInterval(kp,!0),c(this,lp,"f").setInitVersion(r),c(this,lp,"f").startInterval(kp,!0),[2]):[2]}}))}))},yp=function(){this.settings.stopInterval(),c(this,sp,"f").reset(),c(this,up,"f").reset(),c(this,lp,"f").reset()},Ap=function(e,t){return 3===t.type?(e.stopPropagation(),void this.settings.push(t.time)):7===t.type?(e.stopPropagation(),void c(this,lp,"f").push(t.time)):void(12===t.type&&(e.stopPropagation(),c(this,cp,"f").push(t.time)))},Sp=function(e,t,n){var r=t.syncMsg,i=xr(t.topic);if(r&&i===jr.updUgRTime){e.stopPropagation();var o=Ol.decode(Wa,t.pbData),a=o.channelId,s=o.busChannel,u=o.msgTime,l=this.storage.clearConversationUnreadCount({conversationType:F.ULTRA_GROUP,targetId:a,channelId:s||""},u);l&&this._ctx.emit("conversationStatusChanged",[l])}},Op=function(e,t,n,i,s){return o(this,void 0,void 0,(function(){var o,u,l,d,_,f=this;return a(this,(function(a){switch(a.label){case 0:return o=this._ctx.currentUserId,[4,c(this,ap,"m",Dp).call(this,e,n||0,t,i,s)];case 1:return(u=a.sent()).isOk?(l=u.data,d=l.info,l.isFinished,l.pullTime,_=d.map((function(e){var t=e.userId,n=e.type,i=e.busChannel,a=f.storage.getOrCreateModel({conversationType:n,targetId:t,channelId:i},!1);return r(r({},a.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Nc(e.msg,o,!1,t):null})})),[2,Tn(_)]):[2,u.wipe()]}}))}))},Np=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return this._ctx.includeUg?[2,Tn(e)]:(t=this._ctx.currentUserId,n=e.filter((function(e){return e.conversationType!==F.ULTRA_GROUP})).map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),0===n.length?[2,Tn(e)]:(r=Ol.encode(Xa,{relation:n}),[4,this._ctx.query(jr.qryRLBatch,this._ctx.currentUserId,r,void 0)]));case 1:return(i=o.sent()).isOk?(c(this,ap,"m",Up).call(this,i.data.pbData).info.forEach((function(n){if(n.msg){var r=e.find((function(e){return(e.channelId||"")===(n.busChannel||"")&&e.targetId===n.userId&&e.conversationType===n.type}));r.latestMessage=Nc(n.msg,t,!1,n.userId),r.includeRobot=!!n.isBot}})),[2,Tn(e)]):[2,i.wipe()]}}))}))},Cp=function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){return o=[],void 0!==n&&o.push({sessionStateType:ga.IsTop,value:n?"1":"0"}),void 0!==r&&o.push({sessionStateType:ga.IsSilent,value:r.toString()}),void 0!==i&&o.push({sessionStateType:ga.AutoTrans,value:i.toString()}),s=Mg(t,e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:o}}))),[2,this._ctx.query(jr.setSeAtt,this._ctx.currentUserId,s,fs)]}))}))},Lp=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return c(this,Pp,"f").add(e),n=t.messageType===me.HQ_VOICE?{msgId:e,objectName:t.messageType,content:t.remoteUrl,sampleRate:t.sampleRate,channelNumber:t.numberOfChannels,format:t.format}:{msgId:e,objectName:t.messageType,content:t.content},r=Ol.encode(ju,{businessType:1,businessInfo:Ol.encode(ku,n)}),[4,this._ctx.query(jr.upConvertMsg,e,r,xu)];case 1:return i=a.sent(),c(this,Pp,"f").delete(e),o=i.code,i.isOk?(u=Ol.decode(Fu,new Uint8Array(i.data.businessResult)),s={status:ke.SUCCESS,text:u.result}):s={status:ke.FAILED,text:""},this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:s}),[2]}}))}))},wp=function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,o=Ol.encode(Us,{targetId:n,type:r,query:t.map((function(e){return{msgTime:0,msgUID:e,busChannel:i}}))});return this._ctx.query(jr.qryMsg,this._ctx.currentUserId,o,Ds)},Mp=function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,d,_,f,h,g,p,E,b,T=this;return a(this,(function(a){switch(a.label){case 0:return i=Object.values(r),o=l([],u(new Set(l(l([],u(e),!1),u(i),!1))),!1),[4,c(this,ap,"m",wp).call(this,t,o)];case 1:return s=a.sent(),d=s.isOk,_=s.code,f=s.data,d?(g=(h=f).list,p=h.notExistMsgId,E=new Map(g.map((function(e){var n=Nc(e,T._ctx.currentUserId,!1,t.targetId);return[n.messageUId,n]}))),b=e.map((function(e){var t=E.get(e);if(!t)return p.includes(e)?{messageUId:e,code:x.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:x.SERVER_DATA_ERROR};if(t.messageType!==me.REFERENCE)return{messageUId:e,code:x.INVALID_PARAMETER_MESSAGE_TYPE};var n=r[e],i=E.get(n),o=t.content;return i?(o.referMsg=i.content,o.referMsgStatus=i.isModifyMessage?qn.MODIFIED:qn.DEFAULT,{messageUId:e,message:t,code:x.SUCCESS}):p.includes(n)?(o.referMsgStatus=qn.DELETE,{messageUId:e,code:x.RC_DB_DATA_NOT_FOUND,message:t}):(o.referMsgStatus=qn.DEFAULT,{messageUId:e,code:x.SERVER_DATA_ERROR,message:t})})),n(b),[2]):(n(e.map((function(e){return{messageUId:e,code:_}}))),[2])}}))}))},Up=function(e){var t=yg(e);return this._ctx.getNaviInfoFromCache().supportRecallRefactor&&t.info.forEach((function(e){var t=e.msg;if(t&&t.classname===me.RECALL){var n=JSON.parse(t.content),r=n.messageUId,i=n.sentTime,o=n.extra,a={recallTime:i,recallActionTime:t.dataTime,admin:!!n.isAdmin,delete:!!n.isDelete,isDelete:!!n.isDelete,operatorId:t.fromUserId,extra:o};t.classname=me.RECALL_NOTIFICATION_MESSAGE,t.content=JSON.stringify(a),t.msgId=r,t.dataTime=i||t.dataTime}})),t},Dp=function(e,t,n,r,i,s){return void 0===s&&(s=jr.qryRelationR),o(this,void 0,void 0,(function(){var o,u,l=this;return a(this,(function(a){switch(a.label){case 0:return o=this._ctx.currentUserId,u=function(e,t,n,r,i){return Ol.encode(Ma,{startTime:e,order:t,count:n,compressioEnabled:Od.enable(),channelType:r,botType:i})}(e,t,n,r,i),[4,this._ctx.query(s,o,u)];case 1:return[2,a.sent().trans((function(e){return c(l,ap,"m",Up).call(l,e.pbData)}))]}}))}))};var Fp,Bp,Hp,qp,Yp,Wp,Kp=((op={})[F.PRIVATE]=jr.cleanPMsg,op[F.GROUP]=jr.cleanGMsg,op[F.CUSTOMER_SERVICE]=jr.cleanCMsg,op[F.SYSTEM]=jr.cleanSMsg,op[F.APP_PUBLIC_SERVICE]=jr.cleanMCMsg,op[F.PUBLIC_SERVICE]=jr.cleanMPMsg,op[F.ULTRA_GROUP]=jr.cleanGMsg,op),Jp=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function Qp(e){var t=!(1&~(e.ugMsg||0)),n=!(1&~(e.sessionCfg||0));return t&&n}var Xp,Zp,zp,$p=[jr.chatMsg,jr.ugMsg,jr.recallMsg,jr.ppMsgS,jr.pgMsgS,jr.ppMsgP,jr.pgMsgP,jr.pcMsgP,jr.prMsgS,jr.pbMsgP,jr.chatMsgS],eE=function(e){function n(t,n,r,i){var o=e.call(this)||this;return Fp.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:n}),Object.defineProperty(o,"_navi",{enumerable:!0,configurable:!0,writable:!0,value:r}),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}),Bp.set(o,void 0),Object.defineProperty(o,"_robots",{enumerable:!0,configurable:!0,writable:!0,value:{robots:[],isSynced:!1}}),o.userStorage=new Jp,d(o,Bp,new Zg(n,i),"f"),c(o,Bp,"f").pipe(o),o.on("onConnected",c(o,Fp,"m",Hp),o,100),o.on("onDisconnected",c(o,Fp,"m",Yp),o,100),o.on("onSuspend",c(o,Fp,"m",qp),o,100),o.send=o._connMgr.send.bind(o._connMgr),o.query=o._connMgr.query.bind(o._connMgr),o.on("signal",c(o,Fp,"m",Wp),o),o}return t(n,e),Object.defineProperty(n.prototype,"isConnected",{get:function(){return this._connMgr.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentToken",{get:function(){return this._connMgr.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ugEnabel",{get:function(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDisableEmptyUGChannelId",{get:function(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"includeUg",{get:function(){return Qp(this.getNaviInfoFromCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._navi.getNaviInfoFromCache(this.currentToken)}}),Object.defineProperty(n.prototype,"robots",{get:function(){return this._robots.robots.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:return t=this._robots.robots.slice(),!e&&this._robots.isSynced?[2,Tn(t)]:(n=Ol.encode(gl,{ids:[]}),[4,this._connMgr.query(jr.qAppBot,this.currentUserId,n,pl)]);case 1:return(r=a.sent()).isOk?(i=Math.max.apply(Math,l([],u(t.map((function(e){return e.updateTime}))),!1)),o=[],s=r.data.bots.map((function(e){var t={robotId:e.id,name:e.name,portraitUri:e.portraitUrl,robotType:e.type||"",metadata:Object.fromEntries(e.metadata.map((function(e){return[e.key,e.value]}))),createTime:e.createTime,updateTime:e.updateTime};return t.updateTime>i&&o.push(t),t})),c=t.filter((function(e){return!s.some((function(t){return t.robotId===e.robotId}))})),this._robots.isSynced=!0,this._robots.robots=s,e&&this.emit("robotsSynced",r.code,s.slice(),o,c),[2,Tn(s.slice())]):(e&&this.emit("robotsSynced",r.code,[],[],[]),[2,vn(r.code,r.msg,t)])}}))}))}}),n}(gn);Bp=new WeakMap,Fp=new WeakSet,Hp=function(e,t){return o(this,void 0,void 0,(function(){var e,n,r,i;return a(this,(function(o){switch(o.label){case 0:return t||this.getAllRobots(!0),[4,c(this,Bp,"f").noticeOnline()];case 1:return(e=o.sent()).isOk?(t?c(this,Bp,"f").startInterval(18e4,!0):(n=e.data,r=n.syncTime,i=n.hasNext,c(this,Bp,"f").setInitVersion(r),c(this,Bp,"f").startInterval(18e4,!!i)),[2]):[2]}}))}))},qp=function(e,t){c(this,Bp,"f").stopInterval()},Yp=function(e){this._robots.isSynced=!1,this._robots.robots=[],c(this,Bp,"f").reset()},Wp=function(e,t,n){var r=t.topic,i=t.syncMsg,o=xr(r);if(o||(this.logger.warn(B.L_RECV_RMTP_E,"unknown topic: ".concat(r)),e.stopPropagation()),this.logger.debug(B.L_RECV_RMTP_O,r),i&&$p.includes(o)){e.stopPropagation();var a=n||{},s=a.timestamp,u=void 0===s?this.serverTime:s,l=a.messageUId,d=void 0===l?"":l,_=Oc(t,this.currentUserId,u,d),f=Nc(_,this.currentUserId,!1,t.targetId);this.emit("syncMsg",f,o)}else{if(o===jr.s_ntf){e.stopPropagation();var h=(E=Ol.decode(Ta,t.pbData)).type,g=E.chrmId,p=E.time;return this.logger.info(B.L_RECV_S_NTF_O,"type: ".concat(h,", chrmId: ").concat(g,", time: ").concat(p)),void this.emit("sNtf",E)}if(o===jr.s_cmd){e.stopPropagation();var E;h=(E=Ol.decode(Ta,t.pbData)).type,g=E.chrmId,p=E.time;if(this.logger.info(B.L_RECV_S_CMD_O,"type: ".concat(h,", chrmId: ").concat(g,", time: ").concat(p)),11===h)return void c(this,Bp,"f").push(p);this.emit("sCmd",E)}if(o===jr.s_msg){e.stopPropagation();_=Ol.decode(ya,t.pbData),f=Nc(_,this.currentUserId,!1);this.emit("sMsg",f)}}};var tE,nE=function(e,t,n){var r=0;return e&&(r|=1),t&&(r|=2),n&&(r|=4),r},rE=function(e,t,n){return{chatroomId:e,key:t.key,value:t.value,timestamp:t.version,type:n?U.DELETE:U.UPDATE}},iE=function(e){function n(t,n){var r=e.call(this,"WebChatroomKVStore")||this;return Xp.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Zp.set(r,new Map),Object.defineProperty(r,"_emittedEntriesSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l,d,_,f,h=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,n=t.createTraceId(),i=this._chatroomId,o={chatroomId:i,timestamp:e},t.info(B.L_PULL_CHATROOM_KV_T,JSON.stringify(o),n),[4,this._ctx.query(jr.pullKV,i,Dg(e),void 0)];case 1:return(s=a.sent()).isOk?(u=Gg(s.data.pbData),l=u.bFullUpdate,d=u.entries,_=u.syncTime,t.info(B.L_PULL_CHATROOM_KV_R,JSON.stringify(r(r({},o),{newVersion:_})),n),f=new Map,l&&(Array.from(c(this,Zp,"f").values()).forEach((function(e){f.set(e.key,rE(i,e,!0))})),c(this,Zp,"f").clear()),Array.from(d.values()).forEach((function(e){var t,n=(t=e.status,{isAutoDelete:!!(1&t),isOverwrite:!!(2&t),isDelete:!!(4&t)}).isDelete,r=function(e){var t=e.key,n=e.value;return e.timestamp,{key:t,value:n,userId:e.uid,version:e.version}}(e);n?c(h,Zp,"f").delete(r.key):c(h,Zp,"f").set(r.key,r),f.set(r.key,rE(i,r,n))})),this._emittedEntriesSynced||(this._emittedEntriesSynced=!0,this._ctx.emit("chatroom",{entriesSynced:i})),f.size>0&&this._ctx.emit("chatroom",{updatedEntries:Array.from(f.values())}),[2,Tn({version:_})]):(t.warn(B.L_PULL_CHATROOM_KV_R,JSON.stringify(r(r({},o),{code:s.code})),n),[2,s.wipe()])}}))}))}}),Object.defineProperty(n.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return[4,c(this,Xp,"m",zp).call(this,e,t,!1)];case 1:return(n=r.sent()).isOk&&c(this,Zp,"f").set(e.key,{key:e.key,value:e.value,userId:this._ctx.currentUserId,version:this._ctx.serverTime}),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return[4,c(this,Xp,"m",zp).call(this,{key:e.key,value:"",isAutoDelete:!1,isSendNotification:e.isSendNotification,notificationExtra:e.notificationExtra},t,!0)];case 1:return(n=r.sent()).isOk&&c(this,Zp,"f").delete(e.key),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.serverTime,n=e.entries.map((function(n){var r,i=c(l,Zp,"f").get(n.key);return{key:n.key,value:n.value,uid:l._ctx.currentUserId,version:null!==(r=null==i?void 0:i.version)&&void 0!==r?r:t,status:nE(!!e.isAutoDelete,e.isForce||!1,!1)}})),r=Ol.encode($a,{entry:n}),[4,this._ctx.query(jr.setKVS,this._chatroomId,r,ts)];case 1:return(i=a.sent()).isOk||i.code===x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?((o=i.data).errorKeys,s=o.keysVersion,u=new Map,null==s||s.forEach((function(e){u.set(e.key,e.version)})),e.entries.forEach((function(e){var t=e.key,n=u.get(t);n&&c(l,Zp,"f").set(t,{key:t,value:e.value,userId:l._ctx.currentUserId,version:n})})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return t=nE(!1,!1,!0),n=this._ctx.serverTime,r=Ol.encode($a,{entry:e.keys.map((function(e){var r,i=c(u,Zp,"f").get(e);return{key:e,status:t,value:"",uid:u._ctx.currentUserId,version:null!==(r=null==i?void 0:i.version)&&void 0!==r?r:n}}))}),[4,this._ctx.query(jr.delKVS,this._chatroomId,r,ts)];case 1:return(i=a.sent()).isOk||i.code===x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?(o=i.data.errorKeys,s=new Set,null==o||o.forEach((function(e){return s.add(e.key)})),e.keys.forEach((function(e){s.has(e)||c(u,Zp,"f").delete(e)})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,Zp,"f").has(e)?c(this,Zp,"f").get(e).value:null}}),Object.defineProperty(n.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Array.from(c(this,Zp,"f").entries()).map((function(e){var t=u(e,2);return[t[0],t[1].value]}));return Object.fromEntries(e)}}),n}(pn);Zp=new WeakMap,Xp=new WeakSet,zp=function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx.serverTime,o=c(this,Zp,"f").get(e.key),s=nE(!!e.isAutoDelete,t,n),u={entry:{key:e.key,value:e.value,uid:this._ctx.currentUserId,version:null!==(r=null==o?void 0:o.version)&&void 0!==r?r:i,status:s}},e.isSendNotification&&(u.type=F.CHATROOM,u.bNotify=!0,u.notification={sessionId:Cc(me.CHRM_KV_NOTIFY,!1,!1,!1),classname:me.CHRM_KV_NOTIFY,content:JSON.stringify({key:e.key,value:e.value,extra:e.notificationExtra,type:n?U.DELETE:U.UPDATE})}),l=Ol.encode(za,u),[4,this._ctx.query(n?jr.delKV:jr.setKV,this._chatroomId,l)];case 1:return[2,a.sent().wipe()]}}))}))};var oE,aE,sE,uE,lE=function(e){function n(t,n,r,i){var o=e.call(this,"WebChatroomMessageReceiver")||this;return Object.defineProperty(o,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_handler",{enumerable:!0,configurable:!0,writable:!0,value:i}),tE.set(o,0),d(o,tE,r,"f"),o}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,d,_,f=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,n=t.createTraceId(),r={chatroomId:this._chatroomId,version:e},t.info(B.L_PULL_CHATROOM_MSG_T,JSON.stringify(r),n),i=function(e,t){return Ol.encode(wa,{syncTime:e,count:t,compressioEnabled:Od.enable()})}(e,c(this,tE,"f")),[4,this._ctx.query(jr.chrmPull,this._chatroomId,i,void 0)];case 1:return o=a.sent(),t.summary(B.L_PULL_CHATROOM_MSG_R,o,n,r),o.isOk?(s=this._ctx.currentUserId,u=Sg(o.data.pbData),l=u.list,d=u.syncTime,l.length>0&&(_=l.map((function(e){return Nc(e,s,!1,f._chatroomId)})),this._handler(_,this._chatroomId)),[2,Tn({version:d})]):[2,o.wipe()]}}))}))}}),n}(pn);tE=new WeakMap;var cE,dE,_E,fE,hE,gE,pE,EE,bE,TE,vE,RE,IE,mE,yE,AE=function(e){function n(t,n,r,i,o){var a=e.call(this)||this;return oE.add(a),Object.defineProperty(a,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(a,"roomId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"initCount",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"extra",{enumerable:!0,configurable:!0,writable:!0,value:o}),aE.set(a,void 0),sE.set(a,void 0),d(a,aE,new lE(a._ctx,a.roomId,r,i),"f"),d(a,sE,new iE(a._ctx,a.roomId),"f"),a}return t(n,e),Object.defineProperty(n.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;c(this,aE,"f").setInitVersion(0),c(this,aE,"f").startInterval(e,!0),c(this,oE,"a",uE)&&(c(this,sE,"f").setInitVersion(0),c(this,sE,"f").startInterval(e,!0))}}),Object.defineProperty(n.prototype,"restartInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;this.stopInterval(),c(this,sE,"f").startInterval(e,!0),c(this,aE,"f").startInterval(e,!0)}}),Object.defineProperty(n.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,aE,"f").stopInterval(),c(this,sE,"f").stopInterval()}}),Object.defineProperty(n.prototype,"handleMessageNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,aE,"f").push(e)}}),Object.defineProperty(n.prototype,"handleKVNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,sE,"f").push(e)}}),Object.defineProperty(n.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,c(this,sE,"f").setEntry(e,t)]}))}))}}),Object.defineProperty(n.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,sE,"f").setEntries(e)]}))}))}}),Object.defineProperty(n.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,c(this,sE,"f").removeEntry(e,t)]}))}))}}),Object.defineProperty(n.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,sE,"f").removeEntries(e)]}))}))}}),Object.defineProperty(n.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,sE,"f").getEntry(e)}}),Object.defineProperty(n.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,sE,"f").getAllEntries()}}),n}(gn);aE=new WeakMap,sE=new WeakMap,oE=new WeakSet,uE=function(){var e;return!!(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.kvStorage)};var SE,OE,NE,CE,PE=function(e){var t=e.joinTime,n=e.createTime,r=e.memberCount,i=e.chatroomBanState;return{createTime:n,joinTime:t,memberCount:r,isAllChatroomBanned:!(1&~(i||0)),isCurrentUserBanned:!(2&~(i||0)),isCurrentChatroomBanned:!(4&~(i||0)),isCurrentChatroomInWhitelist:!(1&~(e.whiteListState||0))}},LE=function(e){function n(t){var n=e.call(this)||this;return cE.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),dE.set(n,new Map),Object.defineProperty(n,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),n.logger=t.logger,n._ctx.on("onConnected",c(n,cE,"m",hE),n),n._ctx.on("onDisconnected",c(n,cE,"m",_E),n),n._ctx.on("onSuspend",c(n,cE,"m",fE),n),n._ctx.on("sNtf",c(n,cE,"m",EE),n),n._ctx.on("sCmd",c(n,cE,"m",bE),n),n._ctx.on("syncMsg",c(n,cE,"m",pE),n),n._ctx.on("sMsg",c(n,cE,"m",gE),n),n}return t(n,e),Object.defineProperty(n.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,cE,"m",RE).call(this,e,n,r)];case 1:return(i=a.sent()).isOk?((o=c(this,dE,"f").get(e))||(o=new AE(this._ctx,e,t,c(this,cE,"m",TE).bind(this),r),c(this,dE,"f").set(e,o),o.startInterval()),[2,i.trans(PE)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return c(this,dE,"f").get(e)?(c(this,cE,"m",IE).call(this,e),n=Ol.encode(Pa,{nothing:1,extra:t}),[4,this._ctx.query(jr.exitChrm,e,n)]):[2,Tn()];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(n.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Ol.encode(xa,{count:t,order:n}),[4,this._ctx.query(jr.queryChrmI,e,r,Fa)];case 1:return[2,i.sent().trans((function(e){return{userCount:e.userTotalNums,userInfos:e.userInfos.map((function(e){return{id:e.id,time:e.time}}))}}))]}}))}))}}),Object.defineProperty(n.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,c(this,cE,"m",mE).call(this,e).next((function(e){return e.setEntry(t,n)}))]}))}))}}),Object.defineProperty(n.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,c(this,cE,"m",mE).call(this,e).next((function(e){return e.setEntries(t)}))]}))}))}}),Object.defineProperty(n.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,c(this,cE,"m",mE).call(this,e).next((function(e){return e.removeEntry(t,n)}))]}))}))}}),Object.defineProperty(n.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,c(this,cE,"m",mE).call(this,e).next((function(e){return e.removeEntries(t)}))]}))}))}}),Object.defineProperty(n.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return(n=c(this,dE,"f").get(e))?null===(r=n.getEntry(t))?[2,vn(x.CHATROOM_KEY_NOT_EXIST)]:[2,Tn(r)]:[4,c(this,cE,"m",yE).call(this,e)];case 1:return[2,i.sent().tryTrans((function(e){var n=e[t];return void 0===n?vn(x.CHATROOM_KEY_NOT_EXIST):Tn(n)}))]}}))}))}}),Object.defineProperty(n.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return(t=c(this,dE,"f").get(e))?[2,Tn(t.getAllEntries())]:[2,c(this,cE,"m",yE).call(this,e)]}))}))}}),Object.defineProperty(n.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return i=Lg({targetId:e,time:t,count:n,order:r}),o=this._ctx.currentUserId,[4,this._ctx.query(jr.qryCHMsg,e,i)];case 1:return(s=a.sent()).isOk?(u=wg(s.data.pbData),[2,Tn({hasMore:!!u.hasMsg,list:u.list.map((function(t){return Nc(t,o,!1,e)}))})]):[2,s.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Ol.encode(js,{rtcRoomId:e.rtcRoomId}),[4,this._ctx.query(jr.setRtcRoomId,e.chatRoomId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),n}(gn);dE=new WeakMap,cE=new WeakSet,_E=function(){var e,t;try{for(var n=s(c(this,dE,"f").values()),r=n.next();!r.done;r=n.next()){r.value.stopInterval()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}c(this,dE,"f").clear()},fE=function(){var e,t;try{for(var n=s(c(this,dE,"f").values()),r=n.next();!r.done;r=n.next()){r.value.stopInterval()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},hE=function(e,t){var n,r;if(t)try{for(var i=s(c(this,dE,"f").values()),o=i.next();!o.done;o=i.next()){var a=o.value;c(this,cE,"m",vE).call(this,a)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},gE=function(e,t){var n=t.conversationType,r=t.targetId;(t.messageType,n===F.CHATROOM)&&(e.stopPropagation(),c(this,dE,"f").get(r)&&c(this,cE,"m",TE).call(this,[t],r))},pE=function(e,t){t.conversationType===F.CHATROOM&&(e.stopPropagation(),this.emit("message",[t],t.targetId))},EE=function(e,t){var n=t.type,r=t.chrmId,i=t.time;if(2===n){e.stopPropagation();var o=c(this,dE,"f").get(r);o&&o.handleMessageNotify(i)}},bE=function(e,t){var n=t.type,r=t.chrmId,i=t.time;if(2===n||4===n){e.stopPropagation();var o=c(this,dE,"f").get(r);if(o)return 4===n?(c(this,dE,"f").delete(r),void this._ctx.emit("chatroom",{chatroomDestroyed:r})):void o.handleKVNotify(i)}},TE=function(e,t){var n=this,r=e.filter((function(e){var r,i=e.messageType;if(i===me.CHATROOM_MERGE_CHANGE){var o=function(e){var t={},n=[],r=e.content.memberCount||0;return Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,n.push({userId:e.userId,action:e.status,extra:e.extra})})),{users:t,chatroomId:e.targetId,memberCount:r,userList:n}}(e);return n._ctx.emit("chatroom",{userChange:o}),!1}if(i===me.CHATROOM_MERGE_BAN){var a=function(e){var t=e.content;return{chatroomId:t.chatroomId,banType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return n._ctx.emit("chatroom",{chatroomNotifyBan:a}),!1}if(i===me.CHATROOM_SYNC_MSG){var s=function(e){var t=e.content;return{chatroomId:t.chatroomId,status:t.status,reason:t.reason,time:t.time,extra:t.extra||""}}(e);return n._ctx.emit("chatroom",{chatroomNotifyMultiLoginSync:s}),!1}if(i===me.CHATROOM_MERGE_BLOCK){var u=function(e){var t=e.content;return{chatroomId:t.chatroomId,operateType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return u.operateType===k.Blocked&&(null===(r=null==u?void 0:u.userIdList)||void 0===r?void 0:r.includes(n._ctx.currentUserId))&&c(n,cE,"m",IE).call(n,t),n._ctx.emit("chatroom",{chatroomNotifyBlock:u}),!1}return!0}));this.emit("message",r,t)},vE=function(e){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l,d;return a(this,(function(a){switch(a.label){case 0:return t=e.roomId,n=e.extra,i=this.logger.createTraceId(),this.logger.info(B.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:t}),i),[4,c(this,cE,"m",RE).call(this,t,!1,n)];case 1:return o=a.sent(),this.logger.summary(B.L_REJOIN_CHATROOM_R,o,i,{chatroomId:t}),s=o.code,u=o.isOk,l=o.data,u?(e.restartInterval(),d=PE(l),this._ctx.emit("chatroom",{rejoinedRoom:r(r({chatroomId:t},d),{count:e.initCount})}),[2]):(s!==x.RC_CHATROOM_USER_KICKED&&s!==x.RC_CHATROOM_NOT_EXIST||c(this,dE,"f").delete(t),this._ctx.emit("chatroom",{rejoinedRoom:{chatroomId:t,errorCode:s}}),[2])}}))}))},RE=function(e,t,n){var r=Ol.encode(Pa,{extra:n,nothing:1}),i=t?jr.joinChrm:jr.joinChrmR;return this._ctx.query(i,e,r,La)},IE=function(e){var t=c(this,dE,"f").get(e);t&&(t.stopInterval(),c(this,dE,"f").delete(e))},mE=function(e){var t=c(this,dE,"f").get(e);return t?Tn(t):vn(x.NOT_IN_CHATROOM)},yE=function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return[4,this._ctx.query(jr.pullKV,e,Dg(0),void 0)];case 1:return(t=r.sent()).isOk?(n=Gg(t.data.pbData).entries,[2,Tn(n.reduce((function(e,t){return e[t.key]=t.value,e}),{}))]):[2,t.wipe()]}}))}))};var wE=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ua.localStorage,n=e.appkey,r=e.currentUserId,i=at(n,r),o=t.getItem(i)||"{}",a=JSON.parse(o);return{value:{value:{version:a.version||0,tags:a.tags||{},transLan:a.transLan||"zh",autoTrans:a.autoTrans||!1},key:i,stringify:!0}}}}),Object.defineProperty(n.prototype,"version",{get:function(){return this.get("value").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tags",{get:function(){return this.get("value").tags||{}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"forceUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.set("value",e)}}),Object.defineProperty(n.prototype,"addTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("value"),r=n.tags,i=n.autoTrans,o=n.transLan;r[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:r,autoTrans:i,transLan:o})}}),Object.defineProperty(n.prototype,"deleteTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("value"),r=n.tags,i=n.autoTrans,o=n.transLan;delete r[e],this.set("value",{version:t,tags:r,autoTrans:i,transLan:o})}}),n}(Yd),ME=function(e){function n(t){var n=e.call(this,"UserSettings")||this;return SE.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:void 0}),OE.set(n,!1),n.storage=new wE,n._ctx.on("onConnected",n._handleConnected,n),n._ctx.on("onDisconnected",n._handleDisconnected,n),n._ctx.on("onSuspend",n._handleDisconnected,n),n._ctx.on("signal",n._handleSignal,n),n}return t(n,e),Object.defineProperty(n.prototype,"_handleConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.storage.syncDataFromLocalStorage(this._ctx),d(this,OE,!0,"f");var e=this.storage.version;this.setInitVersion(e),this.push(e)}}),Object.defineProperty(n.prototype,"_handleDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reset()}}),Object.defineProperty(n.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(xr(t.topic)===jr.s_us){var n=Ol.decode(As,t.pbData).version;this.push(n),e.stopPropagation()}}}),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,d,_,f,h,g,p,E,b,T,v,R;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,n=t.currentUserId,r=t.logger,i=this._ctx.getNaviInfoFromCache(),o=r.createTraceId(),r.info(B.L_SYNC_USER_SETTINGS_T,"version: ".concat(e),o),s=Ol.encode(os,{version:e,ipType:i.ipType||0}),[4,this._ctx.query(jr.pullUS,n,s,as)];case 1:return u=a.sent(),r.summary(B.L_SYNC_USER_SETTINGS_R,u,o),u.isOk?(l=u.data,d=l.version,_=l.items,f=!1,h=!1,g=!1,p="",E=this.storage.get("value"),b=E.transLan,T=E.autoTrans,v=E.tags,R={version:d,transLan:b,autoTrans:T,tags:v},null==_||_.forEach((function(e){var t=e.key,n=e.value;switch(t){case"Tag":R.tags={},e.tags.forEach((function(e){R.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),f=!0;break;case"transLan":g=!0,R.transLan=Xi.readUTF(new Uint8Array(n));break;case"autoTrans":h=!0,R.autoTrans="1"===Xi.readUTF(new Uint8Array(n));break;case"VoipInfo":p=Xi.readUTF(new Uint8Array(n))}})),this.storage.set("value",R),f&&this.emit("tagsChanged"),g&&this.emit("userSettingsChanged",{key:Yn.TranslationLanguage,value:R.transLan}),h&&this.emit("userSettingsChanged",{key:Yn.AutoTranslateEnable,value:R.autoTrans}),p&&this.emit("voipInfoChanged",p),c(this,SE,"m",NE).call(this,u.code),[2,Tn({version:d})]):(c(this,SE,"m",NE).call(this,u.code),[2,u.wipe()])}}))}))}}),Object.defineProperty(n.prototype,"hasTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.storage.tags[e]}}),Object.defineProperty(n.prototype,"getTags",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.storage.tags}}),Object.defineProperty(n.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,n=this._ctx.currentUserId,r=Ol.encode(ms,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),[4,this._ctx.query(jr.addSeTag,n,r,is)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.addTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,n=this._ctx.currentUserId,r=Ol.encode(ys,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),[4,this._ctx.query(jr.delSeTag,n,r,is)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.deleteTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,SE,"m",CE).call(this,jr.transLan,e)]}))}))}}),Object.defineProperty(n.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,Tn(this.storage.get("value").transLan||"zh")]}))}))}}),Object.defineProperty(n.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,SE,"m",CE).call(this,jr.autoTrans,e?"1":"0")]}))}))}}),Object.defineProperty(n.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,Tn(this.storage.get("value").autoTrans)]}))}))}}),n}(pn);OE=new WeakMap,SE=new WeakSet,NE=function(e){c(this,OE,"f")&&(d(this,OE,!1,"f"),this.emit("userSettingsSynced",e))},CE=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,_,f,h,g;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.version,r=this._ctx.currentUserId,i=Ol.encode(rs,{version:n,value:t,ignoreVersion:!0}),[4,this._ctx.query(e,r,i,is)];case 1:if((o=a.sent()).isOk){switch(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.get("value"),d=c.transLan,_=c.autoTrans,f=c.tags,h=c.version,g={version:l?u:h,transLan:d,autoTrans:_,tags:f},e){case jr.transLan:g.transLan=t;break;case jr.autoTrans:g.autoTrans="1"===t}this.storage.set("value",g)}return[2,o.wipe()]}}))}))};var UE,DE=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:Object.fromEntries(e.extProfile.map((function(e){return[e.key,e.value]}))),addTime:e.relationTime,inBlackList:!!e.flag}},GE=function(e){var t,n,r=e.targetId,i=e.settingProfile,o=e.extProfile,a=e.baseInfo,s=e.userInfo,u=Zt(i||[]),l=Zt(o||[]);return{groupId:r,groupName:u.name||"",portraitUri:u.portraitUrl||"",introduction:u.introduction||"",notice:u.announcement||"",extProfile:l,joinPermission:~~u.joinPerm,removeMemberPermission:~~u.removePerm,invitePermission:~~u.memInvitePerm,inviteHandlePermission:~~u.invitePerm,groupInfoEditPermission:~~u.profilePerm,memberInfoEditPermission:~~u.memProfilePerm,creatorId:(null==a?void 0:a.creatorId)||"",ownerId:(null==a?void 0:a.ownerId)||"",createTime:(null==a?void 0:a.createTime)||0,membersCount:(null==a?void 0:a.memberCount)||0,remark:null!==(t=null==s?void 0:s.remarkName)&&void 0!==t?t:"",joinedTime:(null==s?void 0:s.joinTime)||0,role:null!==(n=null==s?void 0:s.role)&&void 0!==n?n:y.UNDEF}},VE=function(){function e(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"searchFriendsInfo",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"searchGroupMembers",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(this,"searchJoinedGroups",{enumerable:!0,configurable:!0,writable:!0,value:Vp})}return Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Ol.encode(uu,{permission:e}),[4,this.ctx.query(jr.updProfilePermiss,this.ctx.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Ol.encode(su,{nothing:1}),[4,this.ctx.query(jr.qProfilePermiss,this.ctx.currentUserId,e,uu)];case 1:return[2,t.sent().trans((function(e){return e.permission}))]}}))}))}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=Ol.encode(lu,{uniqueId:e}),[4,this.ctx.query(jr.searchUserProfile,this.ctx.currentUserId,t,ru)];case 1:return(n=a.sent()).isOk?(r=n.data,i=r.userId,o=r.userProfile,s=r.userExtProfile,u=Ft(i,o,s),[2,Tn(u)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return i=fg(e,t,n,r),[4,this.ctx.query(jr.channelCreate,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,o.wipe()]:(s=Ol.decode(du,o.data.pbData),u={errorKeys:s.censorFailedFields,processCode:s.processCode||0},[2,vn(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=fg(e,t,n),[4,this.ctx.query(jr.upChannelInfo,e,r,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=Ol.decode(du,i.data.pbData),[2,vn(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return t=Ol.encode(_u,{type:F.GROUP,list:e.map((function(e){return{targetId:e}}))}),[4,this.ctx.query(jr.qChannelInfo,e[0],t,gu)];case 1:return(n=i.sent()).isOk?(r=Pg(n.data).list,[2,Tn(r.map(GE))]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=xg({targetId:e,users:t,settingInfo:{isQuit:!0,isDelBan:n.removeMuteStatus,isDelAttention:n.removeFollow,isDelWhite:n.removeWhiteList}}),[4,this.ctx.query(jr.channelMemKick,e,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=xg({targetId:e,settingInfo:{isQuit:!0,isDelBan:t.removeMuteStatus,isDelAttention:t.removeFollow,isDelWhite:t.removeWhiteList}}),[4,this.ctx.query(jr.channelMemQuit,e,n)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=xg({targetId:e}),[4,this.ctx.query(jr.channelDismiss,e,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return i=xg({targetId:e,settingInfo:{isQuit:n,isDelBan:r.removeMuteStatus,isDelAttention:r.removeFollow,isDelWhite:r.removeWhiteList},users:[t]}),[4,this.ctx.query(jr.channelTransfer,e,i)];case 1:return[2,o.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Ol.encode(fu,{targetId:t,type:F.GROUP,users:n,operateType:e}),[4,this.ctx.query(jr.upChannelManager,t,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Ol.encode(fu,{targetId:t,type:F.GROUP,users:n,operateType:e}),[4,this.ctx.query(jr.upChannelFollow,t,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return t=jg({targetId:e}),[4,this.ctx.query(jr.qChannelFollow,e,t,gu)];case 1:return(n=o.sent()).isOk?(r=Pg(n.data).list,i=r.map((function(e){return{userId:e.userId,time:e.opTime}})),[2,Tn(i)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=kg({targetId:e,operateType:t?O.ADD:O.REMOVE,channelNickName:t}),[4,this.ctx.query(jr.upChannelRemark,e,n)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Ol.encode(Iu,{targetId:e,type:t,info:n}),[4,this.ctx.query(jr.friendAdd,this.ctx.currentUserId,r,du)];case 1:return[2,i.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Ol.encode(mu,{targetId:e,type:t}),[4,this.ctx.query(jr.friendDel,this.ctx.currentUserId,n)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Ol.encode(Iu,{targetId:e,type:1}),[4,this.ctx.query(jr.friendHandle,this.ctx.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Ol.encode(Iu,{targetId:e,type:2,info:t}),[4,this.ctx.query(jr.friendHandle,this.ctx.currentUserId,n)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=Ol.encode(Au,{targetId:e,remarkName:t,extProfile:Object.entries(n).map((function(e){var t=u(e,2);return{key:t[0],value:t[1]}}))}),[4,this.ctx.query(jr.friendSetPf,this.ctx.currentUserId,r,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=Ol.decode(Su,i.data.pbData),[2,vn(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Ol.encode(mu,{targetId:e,type:t}),[4,this.ctx.query(jr.friendCheck,this.ctx.currentUserId,n,yu)];case 1:return[2,r.sent().trans((function(e){return e.list.map((function(e){return{userId:e.targetId,relationType:e.status}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=Ol.encode(Ou,{queryType:11,friendType:e,page:{size:t.count,order:t.order?0:1,pageToken:t.pageToken}}),[4,this.ctx.query(jr.friendsQuery,this.ctx.currentUserId,n,gu)];case 1:return(r=a.sent()).isOk?(i=r.data.page,o=i.pageToken,s=i.hasNext,u=Pg(r.data).list,l={pageToken:s&&o?o:"",data:u.map(DE)},[2,Tn(l)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=Ol.encode(Ou,{queryType:12,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(jr.friendsQuery,this.ctx.currentUserId,t,gu)];case 1:return(n=a.sent()).isOk?(r=n.data.page,i=r.pageToken,o=r.hasNext,s=Pg(n.data).list,u={pageToken:o&&i?i:"",data:s.map((function(e){return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,applicationType:e.type,applicationStatus:e.status,operationTime:e.operateTime,extra:e.info||""}}))},[2,Tn(u)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Ol.encode(Nu,{targetId:e}),[4,this.ctx.query(jr.friendsInfoQry,this.ctx.currentUserId,t,Pu)];case 1:return[2,n.sent().trans((function(e){return e.list.map(DE)}))]}}))}))}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Ol.encode(Cu,{level:e}),[4,this.ctx.query(jr.friendAuthSet,this.ctx.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return e=this.ctx.currentUserId,t=Ol.encode(Iu,{targetId:e}),[4,this.ctx.query(jr.friendAuthGet,e,t,Cu)];case 1:return[2,n.sent().trans((function(e){return e.level}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return n=jg({targetId:e,ids:t}),[4,this.ctx.query(jr.qChannelSpeMem,e,n,gu)];case 1:return(r=a.sent()).isOk?(i=Pg(r.data).list,o=i.map(Qt),[2,Tn(o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return i=kg({targetId:e,userId:t,channelNickName:n,additional:r}),[4,this.ctx.query(jr.upChannelMem,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,o.wipe()]:(s=Ol.decode(du,o.data.pbData),[2,vn(o.code,o.msg,{errorKeys:s.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return r=jg({targetId:e,roleType:t,botType:n.filterRobotType,page:{size:n.count,order:n.order?0:1,pageToken:n.pageToken}}),[4,this.ctx.query(jr.qChannelMem,e,r,gu)];case 1:return(i=a.sent()).isOk?(o=i.data.page,s=o.pageToken,u=o.hasNext,l=Pg(i.data).list,c={pageToken:u&&s?s:"",data:l.map(Qt)},[2,Tn(c)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Ol.encode(Ru,{targetId:e,type:F.GROUP}),[4,this.ctx.query(jr.channelMemJoin,e,t,du)];case 1:return[2,n.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Ol.encode(Ru,{targetId:e,type:F.GROUP,userIds:t}),[4,this.ctx.query(jr.channelMemInvite,e,n,du)];case 1:return[2,r.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.groupId,n=e.inviterId,r=e.optType,i=e.optResult,o=e.joinUserId,s=e.reason,u=Ol.encode(vu,{targetId:t,type:F.GROUP,optType:r,optResult:i,inviterId:n,joinUserId:o,detail:s}),[4,this.ctx.query(jr.channelApplyResp,t,u,du)];case 1:return[2,a.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=jg({page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(jr.qChannelApplyList,this.ctx.currentUserId,t,gu)];case 1:return(n=a.sent()).isOk?(r=Pg(n.data),i=r.pageToken,o=r.hasNext,s=r.list,u=s.map(Xt),[2,Tn({data:u,pageToken:o&&i?i:""})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=jg({roleType:e,page:{size:t.count,pageToken:t.pageToken,order:t.order?1:0}}),[4,this.ctx.query(jr.qChannelMemJoin,this.ctx.currentUserId,n,gu)];case 1:return(r=a.sent()).isOk?(i=r.data.page,o=i.pageToken,s=i.hasNext,u=Pg(r.data).list,l=u.map(GE),[2,Tn({data:l,pageToken:s&&o?o:""})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return t=Ol.encode(hu,{type:F.GROUP,ids:e}),[4,this.ctx.query(jr.qChannelMemSpeJoin,this.ctx.currentUserId,t,gu)];case 1:return(n=o.sent()).isOk?(r=Pg(n.data).list,i=r.map(GE),[2,Tn(i)]):[2,n.wipe()]}}))}))}}),e}(),jE=((UE={})[F.PRIVATE]=jr.qryPMsg,UE[F.GROUP]=jr.qryGMsg,UE[F.CHATROOM]=jr.qryCHMsg,UE[F.CUSTOMER_SERVICE]=jr.qryCMsg,UE[F.SYSTEM]=jr.qrySMsg,UE[F.APP_PUBLIC_SERVICE]=jr.qryMCMsg,UE[F.PUBLIC_SERVICE]=jr.qryMPMsg,UE[F.ULTRA_GROUP]=jr.qryUgMsg,UE),kE=function(e,t,n,r,i,o){var a=Rr(t.messageType),s=a.isCounted,u=a.isPersited,l=a.isStatusMessage;return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:i,messageDirection:be.SEND,isCounted:s,isMentioned:!!t.isMentioned,content:t.content,messageType:t.messageType,isOffLineMessage:!1,isPersited:u,messageUId:n,sentTime:r,receivedTime:0,disableNotification:!!t.disableNotification,isStatusMessage:!!l,canIncludeExpansion:!!t.canIncludeExpansion,expansion:t.canIncludeExpansion?t.expansion:null,receivedStatus:ye.UNREAD,receivedStatusInfo:jt(ye.UNREAD),pushConfig:t.pushConfig,isInterrupt:t.isInterrupt,messageId:o||0,sentStatus:ue.SENT,directedUserIds:t.directionalUserIdList,disableUpdateLastMessage:t.disableUpdateLastMessage,needReceipt:t.needReceipt}},xE=[L.GROUP_OPERATION,L.GROUP_PROFILE_CHANGE,L.GROUP_APPLICATION_INVITATION,L.GROUP_FOLLOW_USER_CHANGE],FE=[b.FRIEND_APPLICATION];function BE(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve(vn(x.RC_NET_UNAVAILABLE))]}))}))},n}}var HE,qE=function(e){function d(t,n){var r=this,i=n.loggerProxy?n.loggerProxy:Ed();r=e.call(this,t,n,new rd(n.appkey,"IMLib","IM",i))||this,_.add(r),Object.defineProperty(r,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_sendMessageStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_readReceiptManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_pullOfflineFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(r,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"reporterStatistic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(r,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_dataHosting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_loggerProxy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(r,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t){var n,i=t.messageType,o=e.conversationType;if(i===me.SYNC_READ_STATUS&&function(e){return[F.GROUP,F.DISCUSSION,F.ULTRA_GROUP,F.PUBLIC_SERVICE,F.APP_PUBLIC_SERVICE].includes(e)}(o)&&(t.directionalUserIdList=[r.currentUserId]),i===me.READ_RECEIPT_RESPONSE){if(!t.content.receiptMessageDic||0===Object.keys(t.content.receiptMessageDic).length){var a=null===(n=r._readReceiptManager)||void 0===n?void 0:n.getReceiptMessageDic(e);t.content.receiptMessageDic=a||{}}for(var s in t.directionalUserIdList=[],t.content.receiptMessageDic)t.directionalUserIdList.push(s)}return t}}),Object.defineProperty(r,"_ultraMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(r,"setProxy",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"getProxy",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"testProxy",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"setUserStatusListener",{enumerable:!0,configurable:!0,writable:!0,value:Gp}),Object.defineProperty(r,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Gp}),Object.defineProperty(r,"subscribeUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Gp}),Object.defineProperty(r,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"getLocalMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"deleteLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"deleteLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"batchClearLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"clearLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:Gp}),Object.defineProperty(r,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),r._loggerProxy=i;var o=n.appkey,a=n.logOutputLevel,s=n.logExpireTime,u=n.navigators,l=n.areaCode,d=n.logServerUrl,E=n.miniCMPProxy,b=n.environment,T=n.useNaviV2,y=void 0!==T&&T,A=n.enableReadReceiptStorage;r._environment=b||"default",r._enableReadReceiptStorage=A,r.logger.setOutputLevel(a),Xn.init({areaCode:l,navigators:u,logServerUrl:d,miniCMPProxy:E}),n.loggerProxy||dd(o,r.logger,s),r.reporter=new Vd(o,r.logger,r._loggerProxy),r.navi=new Hc(o,r.logger,new Qc(o,r.logger),r._environment,y),r.reporterStatistic=new kd(o,r.logger,r._loggerProxy),r._sendMessageStore=new qc(o);var S=r._connMgr=new td(o,r.navi,r.logger),O=r._ctx=new eE(r._appkey,S,r.navi,r.logger);return r._connMgr.pipe(O),"browser"===ua.tag&&r._initCloudController(),r._userSettings=new ME(O),r._chat=new xp(O,r._userSettings),r._chatroom=new LE(O),r._dataHosting=new VE(O),r._chatroom.on("message",r._handleChatroomMessages,r),O.on("conversationStatusChanged",r._conversationStatusChanged,r),O.on("sCmd",r._handleSCmdNotify,r),O.on("signal",r._handleSignal,r),O.on("onConnected",r.onConnected,r),O.on("onDisconnected",r.onDisconnected,r),O.on("onConnecting",r.onConnecting,r),O.on("onSuspend",r.onSuspend,r),O.on("ultraGroupEnable",r._handleUltraGroupEnable,r),O.on("messagesFromUG",r._handleMessagesFromUltraGroup,r),O.on("messagesFromSG",r._handleMessagesFromSignalGroup,r),O.on("smsgFromSignalGroup",r._handleSmsgFromSignalGroup,r),O.on("syncMsg",r._handleSyncMsg,r),O.on("sgRelationsSynced",r._handleSGRelationsSynced,r),O.on("serverEvent",c(r,_,"m",N),r),O.on("readReceiptResponseV5",c(r,_,"m",h),r),O.on("speechToTextResponse",c(r,_,"m",g),r),O.on("ugUserGroupChanged",r._handleUserGroupStatus,r),O.on("ugChannelChanged",r._handleUltraChannelChange,r),O.on("conversationStatusSynced",(function(e,t){return r._watcher.conversationStatusSynced(t)}),r),O.on("messageModified",c(r,_,"m",p),r),O.on("messageModifiedSyncCompleted",c(r,_,"m",v),r),O.on("ugMsgExpansionUpdated",c(r,_,"m",R),r),O.on("ugMsgRecalled",c(r,_,"m",I),r),O.on("conversation",c(r,_,"m",m),r),O.on("chatroom",r._handlerChatroomEvent,r),O.on("robotsSynced",c(r,_,"m",f),r),r._userSettings.on("voipInfoChanged",r._naviChangeHandler,r),r._userSettings.on("tagsChanged",(function(){return r._watcher.tag()}),r),r._userSettings.on("userSettingsSynced",(function(e,t){return r._watcher.userSettingsSynced(t)}),r),r._userSettings.on("userSettingsChanged",(function(e,t){return r._watcher.userSettingsChanged(t)}),r),r}var _,f,h,g,p,v,R,I,m,N,C,P;return t(d,e),Object.defineProperty(d.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"userSettings",{get:function(){return this._userSettings},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"dataHosting",{get:function(){return this._dataHosting},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"usingCppEngine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;e=u(Xn.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new nd(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,ur.init)}}),Object.defineProperty(d.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.navi.getNaviInfoFromCache(this._connMgr.getToken());this._pullOfflineFinished=!1,this._readReceiptManager||(this._readReceiptManager=new Jc(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(n),this._sendMessageStore.init(this.currentUserId),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(),this.reporter.checkStart(n),this.reporterStatistic.checkStart(n)}}),Object.defineProperty(d.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}}),Object.defineProperty(d.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.onSuspend(t)}}),Object.defineProperty(d.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(d.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.conversation(t);var n=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));n&&this._watcher.conversationTag()}}),Object.defineProperty(d.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new Kc(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var n,r;null===(r=(n=t._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(n,e)},subscribeUserStatusChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedUserStatusChange)||void 0===r||r.call(n,e)},subscribeRelationChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedRelationChange)||void 0===r||r.call(n,e)},ownUserProfileChanged:function(e){var n,r;null===(r=(n=t._watcher).ownUserProfileChanged)||void 0===r||r.call(n,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(d.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new rd(this._appkey,e,t,this._loggerProxy)}}),Object.defineProperty(d.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(d.prototype,"naviInfo",{get:function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"connectionStatus",{get:function(){return this._connMgr.getConnectionStatus()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return this._openCallPlus=n,[2,this._connMgr.connect(e,t,n,r)]}))}))}}),Object.defineProperty(d.prototype,"_handleUltraGroupEnable",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.ultraGroupEnable()}}),Object.defineProperty(d.prototype,"_handleSGRelationsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.sgRelationsSynced(t)}}),Object.defineProperty(d.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=new Map,o=[];t.forEach((function(e){var t,n,a,s=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,d=e.isMentioned,_=e.isCounted,f=e.senderUserId,h=e.messageType,g=e.sentTime,p=e.channelType,E=e.isPersited;if(r._ultraMsgMap[l])delete r._ultraMsgMap[l];else{var b={conversationType:F.ULTRA_GROUP,targetId:s,channelId:c||""},T=r._chat.storage.getOrCreateModel(b,!0),v=i.get(T)||{params:{channelType:p},time:g};i.set(T,v),v.time=g;var R=v.params;if(E&&(R.hidden=!1,R.latestMessage=e,R.operationTime=g),_&&f!==r.currentUserId&&h!==me.RECALL_NOTIFICATION_MESSAGE){R.unreadCount=(R.unreadCount||T.unreadCount)+1;var I=(null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===Y.ALL;d&&(I||(null===(a=null===(n=null==u?void 0:u.mentionedInfo)||void 0===n?void 0:n.userIdList)||void 0===a?void 0:a.includes(r.currentUserId)))&&(R.unreadMentionedCount=(R.unreadMentionedCount||T.unreadMentionedCount)+1,I||(R.unreadMentionedMeCount=(R.unreadMentionedMeCount||T.unreadMentionedMeCount)+1),R.hasMentioned=!0,R.mentionedInfo=null==u?void 0:u.mentionedInfo),T.firstUnreadMessage||R.firstUnreadMessageUId||(R.firstUnreadMessageType=h,R.firstUnreadMessageUId=l,R.firstUnreadTime=g)}o.push(e)}}));var a=[],s=[];Array.from(i.entries()).forEach((function(e){var t=u(e,2),n=t[0],r=t[1],i=r.params,o=r.time;a.push(n);var l=n.updateAttrs(i,o);l&&s.push({conversation:n.toIReceivedConversation(),updatedItems:l})})),this._chat.storage.updateConversationStorage(a),s.length>0&&this._watcher.conversation(s),this._batchMessage(o)}}),Object.defineProperty(d.prototype,"_handleChatroomMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=this._connMgr.getConnectedTime(),o=[];if(t.forEach((function(e){e.sentTime>=i&&r._writeMessagesLog(F.CHATROOM,e.messageUId)&&o.push(e.messageUId)})),o.length>0){var a=Date.now();this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:a,server_deltatime:a-this._connMgr.getCrtServerTime(),msg_ids:o.join(",")}))}this._watcher.batchMessage(t)}}),Object.defineProperty(d.prototype,"_handlerChatroomEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.chatroom(t)}}),Object.defineProperty(d.prototype,"_handleMessagesFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=this._messageProcessor(t),o=i.newOutboxTime;i.messageUIds;var a=i.messages,s=i.messageExpansionList,u=i.RSMsgList,l=i.msgUIds2Statistic;l.length>0&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:l.join(",")})),this._batchMessage(a),s.forEach((function(e){r._receiveMessageExpansion(e)})),u.forEach((function(e){r._processRSMsg(e)})),this._sendMessageStore.removeByTimestamp(o),n&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this.logger.info(B.L_PULL_OFFLINE_MESSAGE_FINISHED_S),this._watcher.pullFinished(),this._chat.startPullModifyMsg())}}),Object.defineProperty(d.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i=t.syncMsg,o=t.topic;if(i)this._receiveSyncMsg(t,n);else switch(xr(o)){case jr.rtc_ntf:this._receiveRtcKv(t.pbData);break;case jr.s_opNtf:this._pullOperateStatusNotify(t);break;case jr.s_pubCall:this._pubCallInfo(t);break;case jr.s_stat:null===(r=this._subscribeManager)||void 0===r||r.updateUserStatus(t)}}}),Object.defineProperty(d.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r,i,o=t.time;switch(t.type){case 8:null===(n=this._subscribeManager)||void 0===n||n.startsyncSubscribeUserStatus(o);break;case 9:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(o);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(d.prototype,"_receiveMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,n=e.channelId,r=void 0===n?"":n,i=e.conversationType,o=e.targetId,a=t.put,s=t.del,u=t.mid;a&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:a,channelId:r,conversationType:i,targetId:o}}),s&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:s,channelId:r,conversationType:i,targetId:o}})}}),Object.defineProperty(d.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){var o=this._chat.storage.clearConversationUnreadCount({conversationType:e,targetId:t,channelId:n},i);r&&o&&this._watcher.conversation([o])}}),Object.defineProperty(d.prototype,"_setConversationCacheByMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.isPersited,i=e.targetId,o=e.channelId,a=e.sentTime,s=e.disableUpdateLastMessage,u=e.senderUserId,l=e.messageType,c=e.isCounted,d=e.messageUId,_=e.content,f=e.isMentioned;if(te(t,W)){var h=this.naviInfo,g=this._chat.storage.getOrCreateModel({conversationType:t,targetId:i,channelId:o},!0),p={},E=u===this.currentUserId,b=l===me.RECALL,T=g.lastReadTime>a;if(c&&!Mc(h).isOk&&!b&&!E&&!T&&(0===g.unreadCount&&(p.firstUnreadMessageUId=d,p.firstUnreadTime=a,p.firstUnreadMessageType=l),p.unreadCount=g.unreadCount+1,f&&At(_)&&_.mentionedInfo)){p.hasMentioned=!0,p.mentionedInfo=_.mentionedInfo;var v=_.mentionedInfo,R=v.type,I=v.userIdList;(R===Y.ALL||(I||[]).includes(this.currentUserId))&&(p.unreadMentionedCount=g.unreadMentionedCount+1)}if(b&&At(_)&&!E){var m=_,y=m.sentTime,A=m.messageUId;!this._ctx.userStorage.recallMsgMap.has(A)&&g.unreadCount>0&&y>g.lastReadTime&&(this._ctx.userStorage.recallMsgMap.add(A),p.unreadCount=g.unreadCount-1,0===g.unreadCount&&(p.firstUnreadMessageUId="",p.firstUnreadTime=0,p.firstUnreadMessageType=""))}if(n){b&&!g.hidden||(p.operationTime=a),p.hidden=!1;var S=b?_.sentTime:a;s||g.latestMessage&&!(g.latestMessage.sentTime<=S)||(p.latestMessage=h.supportRecallRefactor&&b?wc(e,!0):e)}if(this._ctx.includeUg&&l===me.EXPANSION_NOTIFY&&g.latestMessage&&g.latestMessage.messageUId===d){var O=_,N=O.put,C=O.del;O.clear?g.latestMessage.expansion={}:N?g.latestMessage.expansion=r(r({},g.latestMessage.expansion),N):C&&g.latestMessage.expansion&&C.forEach((function(e){delete g.latestMessage.expansion[e]}))}var P=g.updateAttrs(p,e.sentTime);this._chat.storage.updateConversationStorage([g]),P&&n&&!s&&this._watcher.conversation([{conversation:g.toIReceivedConversation(),updatedItems:P}])}}}),Object.defineProperty(d.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;switch(xr(e.topic)){case jr.updRTime:this._receivesyncReadStatus(e);break;case jr.updUserSub:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(d.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,n=[],r=[],i=[],o=e.length-1;o>=0;o-=1){var a=e[o];a.messageType===me.LOG_COMMAND&&a.senderUserId===Je?r.unshift(a):a.messageType===me.CLOUD_CONTROL&&a.senderUserId===Je?i.push(a):n.unshift(a)}this._watcher.batchMessage(n),r.forEach((function(e){var n=e.content,r=n.startTime,i=n.endTime,o=n.platform,a=n.logId,s=n.uri;t.reporter.report(parseInt(r,10),parseInt(i,10),o,s,a,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)}}),Object.defineProperty(d.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){switch(o.label){case 0:return e.shift()?(n=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,ur.other,n)]):[3,2];case 1:r=o.sent()||0,(i=e.filter((function(e){return e.sentTime>r}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(d.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ol.decode(Fs,e.pbData),n=t.key,r=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:n,value:r}]}))}}),Object.defineProperty(d.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ol.decode(Wa,e.pbData),n=t.type,r=t.channelId,i=t.msgTime,o=t.busChannel;this._clearConversationUnreadCount(n,r,o||"",!0,i),this._watcher.syncReadStatus({conversationType:n,targetId:r,channelId:o,timestamp:i})}}),Object.defineProperty(d.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r;return a(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=Ol.encode(Bs,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._connMgr.query(jr.pullKvMsg,this.currentUserId,e,Hs)]):[2];case 1:return t=i.sent(),n=t.isOk,r=t.data,n&&r?(this._latestPullKVMsgTimestamp=r.maxTime,this._watcher.callInfo(JSON.stringify({list:r.info})),[2]):[2]}}))}))}}),Object.defineProperty(d.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===ge.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"_filterMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType;return t===me.DELIVERED||t===me.DELIVERED_MSG||t===me.SYNC_READ_STATUS&&!this._processSRSMsg(e)}}),Object.defineProperty(d.prototype,"_messageProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=0,r=[],i=[],o=[],a=[],s=[];return e.forEach((function(e){var u=e.conversationType,l=e.targetId,c=e.channelId,d=e.messageDirection,_=e.messageUId,f=e.messageType,h=e.sentTime,g=e.senderUserId,p=e.content;if(r.push(_),d===be.SEND){n=Math.max(h,n);var E=t._sendMessageStore.getSendMessageMap(),b=f===me.RECALL?"Cmd:".concat(p.messageUId):_;if(E[b])return void t._sendMessageStore.removeByUID(b)}if(!t._filterMessage(e)){switch(h>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,_)&&s.push(_),f){case me.EXPANSION_NOTIFY:return void o.push(e);case me.READ_RECEIPT:g===t.currentUserId&&t._clearConversationUnreadCount(u,l,c,!0,h);break;case me.READ_STATE:return void a.push(e);case me.READ_RECEIPT_REQUEST:t._enableReadReceiptStorage&&t._processRRReqMsg(e);break;case me.READ_RECEIPT_RESPONSE:t._enableReadReceiptStorage&&t._processRRRspMsg(e)}t._setConversationCacheByMessage(e),i.push(e)}})),{newOutboxTime:n,messageUIds:r,messages:i,messageExpansionList:o,RSMsgList:a,msgUIds2Statistic:s}}}),Object.defineProperty(d.prototype,"_processSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=e.content,o=e.senderUserId,a=e.sentTime;if(o!==this.currentUserId)return!1;var s=this.naviInfo;return this._clearConversationUnreadCount(t,n,r,!0,a),1!==s.sesDriven||(a>this.connectedTime||this._watcher.syncReadStatus({conversationType:t,targetId:n,channelId:r,timestamp:i.lastMessageSendTime}),!1)}}),Object.defineProperty(d.prototype,"_processRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,i=e.channelId,o=e.content,a={conversationType:t,targetId:n,channelId:i};this._watcher.messageReadReceipt(t===F.PRIVATE?{privateReadReceipt:r(r({},a),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:r(r({},a),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})}}),Object.defineProperty(d.prototype,"_processRRReqMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=e.conversationType,r=e.channelId,i=e.targetId,o=e.content,a=e.sentTime,s=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:n,channelId:r,targetId:i},o.messageUId,s,a,u)}}),Object.defineProperty(d.prototype,"_processRRRspMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r,i=this,o=e.conversationType,a=e.channelId,u=e.targetId,l=e.content,c=e.senderUserId,d=l.receiptMessageDic,_=void 0===d?{}:d;if(c===this.currentUserId)for(var f in _){var h=_[f];try{for(var g=(t=void 0,s(h)),p=g.next();!p.done;p=g.next()){var E=p.value;null===(r=this._readReceiptManager)||void 0===r||r.remove({conversationType:o,channelId:a,targetId:u},E)}}catch(e){t={error:e}}finally{try{p&&!p.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}}else(_[this.currentUserId]||[]).forEach((function(e){var t;null===(t=i._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:o,channelId:a,targetId:u},e,c)}))}}),Object.defineProperty(d.prototype,"_handleSmsgFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.conversationType,r=t.senderUserId,i=t.messageUId,o=t.sentTime;this._writeMessagesLog(n,i)&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),r!==this.currentUserId||t.isStatusMessage||this._sendMessageStore.setMessage(i,o),this._handleNotNotifyMsg(t)||(this._handleReadReceiptStorage(t),this._setConversationCacheByMessage(t),this._batchMessage([t]))}}),Object.defineProperty(d.prototype,"_handleReadReceiptStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._enableReadReceiptStorage){var t=e.messageType;t===me.READ_RECEIPT_REQUEST&&this._processRRReqMsg(e),t===me.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(e)}}}),Object.defineProperty(d.prototype,"_handleSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageStore.setMessage(t.messageUId,t.sentTime),this.logger.info(B.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),t.messageType!==me.EXPANSION_NOTIFY?((t.messageType===me.SYNC_READ_STATUS||t.messageType===me.READ_RECEIPT&&t.senderUserId===this.currentUserId)&&this._clearConversationUnreadCount(t.conversationType,t.targetId,t.channelId,!0,t.sentTime),t.messageType===me.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),t.messageType===me.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._setConversationCacheByMessage(t),this._batchMessage([t])):this._receiveMessageExpansion(t)}}),Object.defineProperty(d.prototype,"_handleNotNotifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType,n=e.senderUserId;return t===me.DELIVERED||(t===me.DELIVERED_MSG||(t===me.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===me.SYNC_READ_STATUS&&n!==this.currentUserId||t===me.READ_STATE&&(this._processRSMsg(e),!0)))}}),Object.defineProperty(d.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,_,f,h,g,p=this;return a(this,(function(a){switch(a.label){case 0:return n=e.conversationType,r=e.targetId,i=e.channelId,o=t.timestamp,s=t.count,u=t.order,l=jE[n],c=this.currentUserId,d=Lg({targetId:r,busChannel:i,time:o||(1===u?1:this._connMgr.getCrtServerTime()+6e4),count:s,order:u}),_=n===F.CHATROOM?r:c,[4,this._connMgr.query(l,_,d,void 0)];case 1:return(f=a.sent()).isOk?(h=wg(f.data.pbData),g=h.list.map((function(e){var t,n=Nc(e,c,!1,r),i=null===(t=p._readReceiptManager)||void 0===t?void 0:t.getReadReceiptInfo(n,n.messageUId);if(i){var o=i.users;n.readReceiptInfo={isReceiptRequestMessage:!0,readerList:o}}return n})),[2,Tn({hasMore:!!h.hasMsg,list:0===u?g.reverse():g})]):[2,f.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(B.L_VER_REPORT_T,o,i),s=Ol.encode(Ss,{sdkInfo:o}),u=new _o(jr.reportsdk,s,n),[4,r.send(u)]):[2];case 1:return(l=a.sent().code)!==x.SUCCESS&&this.logger.warn(B.L_VER_REPORT_R,l,i),[2]}}))}))}}),Object.defineProperty(d.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return this._chat.storage.setDrafts(e,t),[2,Tn()]}))}))}}),Object.defineProperty(d.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return t=this._chat.storage.getDrafts(e),[2,Tn(t)]}))}))}}),Object.defineProperty(d.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._chat.storage.deleteDrafts(e),[2,Tn()]}))}))}}),Object.defineProperty(d.prototype,"_writeMessagesLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=null===(n=this.cloudController)||void 0===n?void 0:n.getMRTRConfig();if(!r)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 n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(t),o=0;switch(e){case F.PRIVATE:o=r.private;break;case F.GROUP:o=r.group;break;case F.CHATROOM:o=r.chatroom;break;case F.ULTRA_GROUP:o=r.ultraGroup}return!!o&&i%(1/o)==0}}),Object.defineProperty(d.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i){return o(this,void 0,void 0,(function(){var n,o,s,u,l,c,d,_,f,h,g,p,E,b,T,v;return a(this,(function(a){switch(a.label){case 0:return n=e.conversationType,o=e.targetId,t=this._handleInnerMsgOptions(e,t),s=!1,[F.PRIVATE,F.GROUP].includes(n)&&(t.isStatusMessage||Rr(t.messageType).isStatusMessage)&&(s=!0),u=s?function(e){var t;return(t={},t[F.PRIVATE]=jr.ppMsgS,t[F.GROUP]=jr.pgMsgS,t)[e]}(n):function(e){var t;return(t={},t[F.PRIVATE]=jr.ppMsgP,t[F.GROUP]=jr.pgMsgP,t[F.CHATROOM]=jr.chatMsg,t[F.CUSTOMER_SERVICE]=jr.pcMsgP,t[F.RTC_ROOM]=jr.prMsgS,t[F.SYSTEM]=jr.pbMsgP,t)[e]}(n)||jr.ppMsgP,t.messageId||(t.messageId=sn()),l=t.messageId,c=Vg(e,t),(d=new fo(jr[u],c,n===F.SYSTEM?this.currentUserId:o)).setHeaderQos(Hr),s?(this._connMgr.sendOnly(d),[2,Tn(kE(e,r(r({},t),{isStatusMessage:s}),"",0,this.currentUserId,l))]):(_=this._connMgr.getCrtServerTime(),f=kE(e,r(r({},t),{isStatusMessage:s}),"",_,this.currentUserId,l),null==i||i(l),h=Date.now(),[4,this._connMgr.send(d)]);case 1:return g=a.sent(),p=g.code,E=g.isOk,b=g.msg,T=g.data,E?(v=T,this._sendMessageSuccessHandle(f,v),this._writeMessagesLog(n,v.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:v.messageUId,channel:n,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),[2,Tn(f)]):(this._writeMessagesLog(n)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:n,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),f.sentStatus=ue.FAILED,[2,vn(p,b,f)])}}))}))}}),Object.defineProperty(d.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=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,a=e.targetId,s=e.channelId,u=e.sentTime,l=e.content,c=e.messageDirection;if(this._enableReadReceiptStorage){if(i===me.READ_RECEIPT_REQUEST){var d=l.messageUId;null===(n=this._readReceiptManager)||void 0===n||n.insert({conversationType:o,targetId:a,channelId:s},d,c,u)}if(i===me.READ_RECEIPT_RESPONSE){var _=l.receiptMessageDic;if(!_)return;for(var f in _)_[f].forEach((function(e){var t;null===(t=r._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:a,channelId:s},e)}))}}}}),Object.defineProperty(d.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,_,f,h,g,p,E,b,T,v,R,I,m;return a(this,(function(a){switch(a.label){case 0:return n=e.targetId,r=e.conversationType,i=e.channelId||"",o=t.user,s=t.extra,u=t.isDelete,l=t.directionalUserIdList,c=t.disableUpdateLastMessage,d=t.messageUId,_=t.sentTime,f=t.disableNotification,h=t.pushConfig,g=t.pushContent,p=t.isAdmin,E={conversationType:r,targetId:n,messageUId:d,sentTime:_,channelId:i,isDelete:!!u,isAdmin:!!p},o&&(E.user=o),s&&(E.extra=s),b={content:E,messageType:me.RECALL,disableNotification:f,pushConfig:h,pushContent:(null==h?void 0:h.pushContent)||g,disableUpdateLastMessage:c,directionalUserIdList:[F.GROUP,F.ULTRA_GROUP].includes(r)?l:void 0},T=Vg(e,b),(v=new fo(jr.recallMsg,T,this.currentUserId)).setHeaderQos(Hr),[4,this._connMgr.send(v)];case 1:return(R=a.sent()).isOk?(I=R.data,r!==F.ULTRA_GROUP&&(I.messageUId="Cmd:".concat(d)),m=kE(e,b,I.messageUId,I.timestamp,this.currentUserId),r===F.ULTRA_GROUP?(this._ultraMsgMap[I.messageUId]=I.timestamp,this._updateUltraGroupWhenRecallMsg(m)):(this._sendMessageStore.setMessage(I.messageUId,I.timestamp),this._setConversationCacheByMessage(m)),[2,Tn(m)]):[2,R.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._connMgr.getToken();this.navi.updateVoipCallInfo(n,t);var i=this.navi.getNaviInfoFromCache(n);this._watcher.onNaviDataChange(r({},i))}}),Object.defineProperty(d.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,s,u){return o(this,void 0,void 0,(function(){var o,l,c,d,_;return a(this,(function(a){switch(a.label){case 0:return o=i&&"uploads"!==i?t||"":tn(e,t),l=this.naviInfo,c=dn(l,this.logger),d="",c||(d=JSON.stringify({uploadDomain:c})),_=Ol.encode(Sa,{type:e,key:o,httpMethod:n||"",queryString:i||"",url:s||"",ext:d,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._connMgr.query(jr.qnTkn,this.currentUserId,_,Na)];case 1:return[2,a.sent().trans((function(e){return r(r({},e),{fileName:o,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(d.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return o=this.naviInfo,u="",l="",t===n.QINIU?s=jr.qnUrl:t===n.AWS?s=jr.s3Url:t===n.STC?s=jr.stcUrl:t===n.MINIO?(s=jr.minioUrl,u=dn(o,this.logger),l=JSON.stringify({url:u})):s=jr.aliUrl,c=Ol.encode(Oa,{type:e,key:r,fileName:i,ext:l,size:-1,ipType:o.ipType||0}),[4,this._connMgr.query(s,this.currentUserId,c,Ca)];case 1:return[2,a.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(d.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect(e,t)];case 1:return n.sent(),this._resetMemoryState(),[2,Tn()]}}))}))}}),Object.defineProperty(d.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager}}),Object.defineProperty(d.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(d.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"userId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,vn(x.TAG_EXISTS)]:[2,this._userSettings.createTag(e)]}))}))}}),Object.defineProperty(d.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e)?[2,this._userSettings.removeTag(e)]:[2,vn(x.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(d.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,this._userSettings.createTag(e)]:[2,vn(x.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(d.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){for(i in t=this._userSettings.getTags(),n=this._chat.storage.getTagConversationCountMap(),r=[],t)r.push({tagId:i,tagName:t[i].tagName,createdTime:t[i].createdTime,conversationCount:(null===(e=n.get(i))||void 0===e?void 0:e.length)||0});return[2,Tn(r)]}))}))}}),Object.defineProperty(d.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i){return o(this,void 0,void 0,(function(){var n,o,s,u,l,c,d,_,f,h,g,p,E;return a(this,(function(a){switch(a.label){case 0:return n=e.targetId,t.messageId||(t.messageId=sn()),o=t.messageId,s=Vg(e,t),(u=new fo(jr.ugMsg,s,n)).setHeaderQos(Hr),l=this._connMgr.getCrtServerTime(),c=kE(e,r({},t),"",l,this.currentUserId,o),i&&i(o),d=Date.now(),[4,this._connMgr.send(u)];case 1:return _=a.sent(),f=_.code,h=_.data,f!==x.SUCCESS?(this._writeMessagesLog(F.ULTRA_GROUP)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:F.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentStatus=ue.FAILED,[2,vn(f,void 0,c)]):(g=h,this._writeMessagesLog(F.ULTRA_GROUP,g.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:g.messageUId,channel:F.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,p=this._chat.storage.getOrCreateModel(e,!0),(E=p.updateAttrs({operationTime:g.timestamp,latestMessage:r({},c)},g.timestamp))&&this._watcher.conversation([{conversation:p.toIReceivedConversation(),updatedItems:E}]),[2,Tn(c)])}}))}))}}),Object.defineProperty(d.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._isConnected){var t=function(e){var t=e,n=t.type,r=t.notifyType,i=t.info,o=t.summary,a=[],s=[],u=!(2&~r),l=!(1&~r);return l&&Array.isArray(i)&&i.forEach((function(e){var t=e,n=t.targetId,r=t.busChannel,i=t.userId,o=t.opType,s=t.optime;a.push({targetId:n,channelId:r,userId:i,operationType:o,operationTime:s})})),u&&Array.isArray(o)&&o.forEach((function(e){var t=e,n=t.targetId,r=t.busChannel,i=t.count,o=t.opType;s.push({targetId:n,channelId:r,count:i,operationType:o})})),{conversationType:n,info:a,summary:s,hasInfo:l,hasSummary:u}}(Ol.decode(Vs,e.pbData));this._watcher.operateStatus(t)}}}),Object.defineProperty(d.prototype,"_handleConvertEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r=[];e.filter((function(e){return 0===e.subChangeType})).forEach((function(e){var t=Ol.decode(Hu,new Uint8Array(e.eventData)).results;r.push.apply(r,l([],u(t.map((function(e){return{identifier:e.messageUID,from:e.inputSource,code:e.code,translateInfo:{targetLanguage:e.targetLan,translatedText:e.transResult||"",status:e.code===x.SUCCESS?Pr.SUCCESS:Pr.FAILED}}}))),!1))})),r.length&&(null===(n=(t=this._watcher).translateResponse)||void 0===n||n.call(t,r))}}),Object.defineProperty(d.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:xE},Friend:{map:{},types:FE}},n=function(e,t,n){e[t]||(e[t]=[]),e[t].push(n)};e.forEach((function(e){var r=e.changeType;for(var i in t)if(t[i].types.includes(r)){n(t[i].map,r,e);break}}));var r={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&r[i](t[i].map)}}),Object.defineProperty(d.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=L.GROUP_OPERATION,n=L.GROUP_PROFILE_CHANGE,r=L.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[n]&&this._handleGroupProfileChange(e[n]),e[r]&&this._handleFollowUserChange(e[r])}}),Object.defineProperty(d.prototype,"_processChangeMapFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e[b.FRIEND_APPLICATION]||[]).forEach((function(e){var n,r,i,o,a,s,u,l,c,d,_=e.subChangeType,f=e.businessId,h=e.time,g=e.eventData,p=T.FRIEND_APPLY,b=T.FRIEND_REFUSE,v=T.FRIEND_USER_INFO,R=T.FRIENDS_INPUT,I=T.FRIEND_CLEAR,m=T.FRIEND_INFO_CHANGE,y=T.FRIEND_INFO_CHANGE_SYNC;switch(_){case p:case b:var A=_===p?E.UNHANDLED:E.REFUSED;null===(r=(n=t._watcher).friendApplicationStatusChanged)||void 0===r||r.call(n,{userId:f,applicationType:g.applyType,applicationStatus:A,directionType:g.friendType,operationTime:h,extra:g.info||""});break;case v: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 R:null===(s=(a=t._watcher).friendDelete)||void 0===s||s.call(a,{userIds:g.targetId,directionType:g.type,operationTime:h});break;case I:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,h);break;case m:break;case y:null===(d=(c=t._watcher).friendInfoChangedSync)||void 0===d||d.call(c,{userId:f,remark:g.remarkname,extProfile:g.extProfile,operationTime:h})}}))}}),Object.defineProperty(d.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i,o,a=e.subChangeType,s=e.businessId,l=e.time,c=e.eventData,d=c.optUserInfo,_=c.channelInfo,f=c.userInfos,h={groupId:s,operation:a,operationTime:l};d&&(n=u(Kt([d]),1),h.operatorInfo=n[0]),a===A.CREATE&&(r=u(function(e){return void 0===e&&(e=[]),e.map((function(e){var t,n,r,i,o,a,s,u,l,c=Jt(e.settingProfile)||{},d=e.extProfile||[],_=e.targetId,f=e.baseInfo,h=e.userInfo;return{groupId:_,groupName:null!==(t=c.name)&&void 0!==t?t:"",portraitUri:null!==(n=c.portraitUrl)&&void 0!==n?n:"",introduction:null!==(r=c.introduction)&&void 0!==r?r:"",notice:null!==(i=c.announcement)&&void 0!==i?i:"",extProfile:Jt(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!==(a=null==f?void 0:f.ownerId)&&void 0!==a?a:"",createTime:(null==f?void 0:f.createTime)||0,membersCount:null!==(s=null==f?void 0:f.memberCount)&&void 0!==s?s:0,remark:null!==(u=null==h?void 0:h.remarkName)&&void 0!==u?u:"",joinedTime:(null==h?void 0:h.joinTime)||0,role:null!==(l=null==h?void 0:h.role)&&void 0!==l?l:y.UNDEF}}))}([_]),1),h.groupInfo=r[0]),[A.CREATE,A.DISMISS].includes(a)||(h.memberInfos=Kt(f)),null===(o=(i=t._watcher).groupOperation)||void 0===o||o.call(i,h)}))}}),Object.defineProperty(d.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i,o,a,s,l=e.businessId,c=e.time,d=e.eventData,_=e.subChangeType,f=e.secondaryId;switch(_){case S.GROUP_INFO_CHANGE:var h=u(Kt([d.optUserInfo]),1)[0],g=u(qt([d.channelInfo]),1)[0],p=u(d.channelFullInfo?qt([d.channelFullInfo]):[void 0],1)[0];null===(r=(n=t._watcher).groupInfoChanged)||void 0===r||r.call(n,{operatorInfo:h,groupInfo:g,changedGroupInfo:g,operationTime:c,fullGroupInfo:p});break;case S.MEMBER_PROFILE_CHANGE:h=u(Kt([d.optUserInfo]),1)[0];var E=Kt(d.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:l,operatorInfo:h,memberInfo:E,operationTime:c});break;case S.GROUP_REMARK_DELETE:case S.GROUP_REMARK_SET:var b=_===S.GROUP_REMARK_SET?O.ADD:O.REMOVE;null===(s=(a=t._watcher).groupRemarkChangedSync)||void 0===s||s.call(a,{groupId:l,operationType:b,operationTime:c,groupRemark:f})}}))}}),Object.defineProperty(d.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i=e.subChangeType,o=e.businessId,a=e.time,s=e.userGroupIds,u=1===i?O.ADD:O.REMOVE;null===(r=(n=t._watcher).groupFollowsChangedSync)||void 0===r||r.call(n,{groupId:o,operationType:u,operationTime:a,userIds:s})}))}}),Object.defineProperty(d.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,r=[],i=[],o=[];t.forEach((function(e){var t=e.subChangeType,a=e.targetId;e.msgTime;var s=e.operatorId,u=e.busChannelType,l=e.time,c=e.busChannel||"",d={conversationType:F.ULTRA_GROUP,targetId:a,channelId:c},_=n._chat.storage.getModel(d);switch(t){case oe.PRIVATE_TO_PUBLIC:null==_||_.updateAttrs({channelType:ne.PUBLIC}),r.push({targetId:a,channelId:c,changeType:re.PRIVATE_TO_PUBLIC,channelType:ne.PUBLIC});break;case oe.PUBLIC_TO_PRIVATE:null==_||_.updateAttrs({channelType:ne.PRIVATE}),r.push({targetId:a,channelId:c,changeType:re.PUBLIC_TO_PRIVATE,channelType:ne.PRIVATE});break;case oe.PUBLIC_TO_PRIVATE_USER_NOT_IN:_&&n._chat.storage.removeConversation(_),r.push({targetId:a,channelId:c,changeType:re.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:u});break;case oe.CHANNEL_DELETE:_&&n._chat.storage.removeConversation(_),i.push({targetId:a,channelId:c,channelType:u,deleteTime:l});break;case oe.CHANNEL_USER_KICKED:o.push({targetId:a,channelId:c,userId:s,channelType:ne.PRIVATE}),s===n.currentUserId&&_&&n._chat.storage.removeConversation(_);case oe.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:}})),r.length>0&&this._watcher.ultraGroupChannelChangeType(r),i.length>0&&this._watcher.ultraGroupChannelDelete(i),o.length>0&&this._watcher.ultraGroupChannelUserKicked(o)}}),Object.defineProperty(d.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var e,n,r,i,o,s;return a(this,(function(a){return e=[],n=[],r=[],i=[],o=[],t.forEach((function(t){var a=t.type,s=t.targetId,u=t.busChannelType,l=t.busChannel,c=t.userGroupIds;switch(t.subChangeType){case ae.REMOVE_USER_GROUP:e.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.JOIN_USER_GROUP:n.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.EXIT_USER_GROUP:r.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.CHANNEL_BIND_USER_GROUP:i.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c});break;case ae.CHANNEL_UNBIND_USER_GROUP:o.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c})}})),s={},e.length>0&&(s.userGroupDisband=e),n.length>0&&(s.userAdded=n),r.length>0&&(s.userRemoved=r),i.length>0&&(s.userGroupBindChannel=i),o.length>0&&(s.userGroupUnBindChannel=o),this._watcher.userGroupStatus(s),[2]}))}))}}),Object.defineProperty(d.prototype,"_updateUltraGroupWhenRecallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._chat.storage.getModel(e);if(n){var r={},i=e.content,o=i.messageUId,a=i.sentTime,s=n.latestMessage;s&&s.messageUId===o&&(r.latestMessage=wc(e,!0)),a&&n.lastReadTime<a&&n.unreadCount&&(r.unreadCount=n.unreadCount-1,t!==se.ALL&&t!==se.ME||!n.unreadMentionedCount||(r.unreadMentionedCount=n.unreadMentionedCount-1),t===se.ME&&n.unreadMentionedCount&&(r.unreadMentionedMeCount=n.unreadMentionedMeCount-1));var u=n.updateAttrs(r,e.sentTime);this._chat.storage.updateConversationStorage([n]),u&&this._watcher.conversation([{conversation:n.toIReceivedConversation(),updatedItems:u}])}}}),Object.defineProperty(d.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._subscribeManager.updateSubscribeRelation(e,t,fe.SUBSCRIBE,n)]}))}))}}),Object.defineProperty(d.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,this._subscribeManager.updateSubscribeRelation(e,t,fe.UNSUBSCRIBE)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){return i=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserList(e,t,n),[2,Tn(i)]}))}))}}),Object.defineProperty(d.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserStatus(e,t),[2,Tn(r||[])]}))}))}}),Object.defineProperty(d.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=Ol.encode(ru,c(this,_,"m",C).call(this,e)),[4,this._connMgr.query(jr.updUserProfile,this.currentUserId,n,void 0)];case 1:return(r=a.sent()).data?(i=Ol.decode(iu,r.data.pbData),r.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,r.wipe()]):(s=i.censorFailedFields,[2,vn(r.code,"",s&&0!==s.length?{errorKeys:s,errorKey:s[0]}:void 0)])):[2,r.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subscribeManager.getOwnProfile()}}),Object.defineProperty(d.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._subscribeManager.getUserProfiles(e)]}))}))}}),Object.defineProperty(d.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){switch(i.label){case 0:return n?[3,2]:[4,this._connMgr.send(new fo(t,r,e))];case 1:return[2,i.sent().wipe()];case 2:return[4,this._connMgr.query(t,e,r,void 0)];case 3:return[2,i.sent().trans((function(e){return e.pbData}))]}}))}))}}),Object.defineProperty(d.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=Jl(t,n),[4,this.rtcSignaling(e,jr[jr.rtcPing],!0,r)];case 1:return(i=a.sent()).isOk?(o=Ol.decode(rl,i.data),[2,Tn(o)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"deviceId",{get:function(){return Tc()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;(t=e.deviceId)&&(bc=t),n=e.packageName,Ic=n}}),Object.defineProperty(d.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){o(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return id?(ld&&(clearTimeout(ld),ld=null),[4,id]):[2];case 1:return(e=n.sent())&&(t=e.db,_d.push(t)),id=null,[2]}}))}))}}),Object.defineProperty(d.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;if(this._connMgr.setNetwork(e,t),e.status&&this.cloudControllerUri){var r=this._connMgr.getToken();null===(n=this.cloudController)||void 0===n||n.request(this.cloudControllerUri,ur.newWorkChange,r)}}}),Object.defineProperty(d.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return r=Ol.encode(xs,{key:t,dataContent:n}),[4,this._connMgr.query(jr.reqCall,e,r,xs)];case 1:return(i=o.sent()).isOk?[2,i.trans((function(e){return{key:e.key,value:e.dataContent}}))]:[2,i.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Ol.encode(Mu,e),[4,this._connMgr.query(jr.addUnpush,this.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Ol.encode(Uu,{nothing:0}),[4,this._connMgr.query(jr.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Ol.encode(Du,{nothing:0}),[4,this._connMgr.query(jr.qryUnpush,this.currentUserId,e,Gu)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,n=e.spanMinutes,r=e.startTime,i=e.level,o=e.timezone;return t?{spanMinutes:n,startTime:r,level:i,timezone:o}:{spanMinutes:0,startTime:"",level:we.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(d.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,Tn(Xn.getStatsUrlList(this.naviInfo))]}))}))}}),Object.defineProperty(d.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,_=this;return a(this,(function(a){switch(a.label){case 0:return i=0===r?e[0].identifier:this.currentUserId,o=this.userSettings.storage.get("value").transLan,s=[],u=[],e.forEach((function(e){var t=e.sourceLanguage,n=e.content,i=e.targetLanguage||o;t!==i?n?s.push({messageUID:e.identifier,sourceLan:e.sourceLanguage,targetLan:e.targetLanguage||o,text:e.content,inputSource:r,transType:1}):u.push({identifier:e.identifier,from:r,code:x.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:Pr.NONE}}):u.push({identifier:e.identifier,from:r,code:x.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:Pr.NONE}})})),0!==s.length?[3,1]:(l=Tn(),[3,3]);case 1:return c=Ol.encode(ju,{businessType:3,businessInfo:Ol.encode(Bu,{forceTrans:n,transInfos:s,model:t})}),[4,this._connMgr.query(jr.upConvertMsg,i,c,xu)];case 2:d=a.sent(),l=d.wipe(),a.label=3;case 3:return u.length>0&&setTimeout((function(){return _._watcher.translateResponse(u)}),0),[2,l]}}))}))}}),Object.defineProperty(d.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return this._subscribeManager?(t=[],n=new Set,this._subscribeManager.getSubscribeUserStatus(_e.ONLINE_STATUS,e).forEach((function(e){var r=e.userId,i=e.details,o=(void 0===i?[]:i).map((function(e){return{platform:e.platform,isOnline:!!e.eventValue,updateTime:e.changeTime}})),a=o.some((function(e){return e.isOnline})),s={userId:r,isOnline:a,details:o};t.push(s),n.add(r)})),0===(r=e.filter((function(e){return!n.has(e)}))).length?[2,Tn(t)]:[4,c(this,_,"m",P).call(this,_e.FRIEND_ONLINE_STATUS,r)]):[2,Tn([])];case 1:return(i=o.sent()).isOk?(i.data.list.forEach((function(e){var n,r=e.subUserId,i=e.data.map((function(e){return{platform:e.platformInfo,isOnline:!!e.value,updateTime:e.versionTime}})),o=i.some((function(e){return e.isOnline}));t.push((n={userId:r,isOnline:o,details:i},[de.iOS,de.Android,de.Web,de.PC,de.Mini,de.HarmonyOS].forEach((function(e){n.details.some((function(t){return t.platform===e}))||n.details.push({platform:e,isOnline:!1,updateTime:0})})),n))})),[2,Tn(t)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._ctx.getAllRobots(!1)]}))}))}}),_=new WeakSet,f=function(e,t,n,r,i){this._watcher.robotsSynced(t,r)},h=function(e,t){this._watcher.readReceiptResponseV5(t)},g=function(e,t){this._watcher.speechToTextResponse(t)},p=function(e,t){this._watcher.messagesModified(t)},v=function(e){this._watcher.messageModifiedSyncCompleted()},R=function(e,t){this._watcher.ultraGroupMessageExpansionUpdated(t)},I=function(e,t){this._watcher.ultraGroupMessageRecalled(t)},m=function(e,t){this._watcher.conversation(t)},N=function(e,t,n){var r=this;t!==Jg?t!==Xg?this._handleEventChangeList(this._connMgr.codec.formatEventChangeList(n)):this._handleConvertEvent(n):n.forEach((function(e){Ol.decode(wu,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,n,i=Xt(e);null===(n=(t=r._watcher).groupApplicationEvent)||void 0===n||n.call(t,i)}))}))},C=function(e){var t={},n=e.extraProfile;return n&&(delete e.extraProfile,t.userExtProfile=_g(n)),t.userProfile=_g(e),t},P=function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Ol.encode(nu,{subType:e,subUsers:t.map((function(e){return{subUserId:e}}))}),[4,this._connMgr.query(jr.qrySubData,this.currentUserId,n,eu)];case 1:return[2,r.sent()]}}))}))},i([BE()],d.prototype,"setNotificationQuietHoursWithSetting",null),i([BE()],d.prototype,"removeNotificationQuietHoursSetting",null),i([BE()],d.prototype,"getNotificationQuietHoursSetting",null),d}(Zl),YE=function(){function e(e){HE.set(this,void 0),d(this,HE,e,"f")}return Object.defineProperty(e.prototype,"isSpeechToTextEnabled",{get:function(){return!!(1&(c(this,HE,"f").AIBusinessSub||0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConversationListIncludeUltraGroup",{get:function(){return Qp(c(this,HE,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageModifiableMinutes",{get:function(){return c(this,HE,"f").msgModifyMinute||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readReceiptVersion",{get:function(){return e=(e=c(this,HE,"f").grpRRVer)||0,Object.values(Fe).includes(e)?e:Fe.UNKNOWN;var e},enumerable:!1,configurable:!0}),e}();HE=new WeakMap;var WE,KE,JE,QE,XE,ZE,zE,$E=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ctx=e,this.logger=e.logger}return Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e.checkAuthed(!1)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e.checkAuthed(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkAuthed",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.ctx.connectionStatus===ge.CONNECTED||this.ctx.userId&&e?Tn(this.ctx.naviInfo):vn(x.RC_NET_UNAVAILABLE)}}),e}(),eb=function(e){function n(t,n){var r=e.call(this,t)||this;return Object.defineProperty(r,"svr",{enumerable:!0,configurable:!0,writable:!0,value:n}),r}return t(n,e),Object.defineProperty(n.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,extra:r,createIfNotExist:n}),i),[4,Rn.create("joinChatroom").validate("chatroomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isNumber("count",t,!0).fail(x.INVALID_PARAMETER_COUNT).isString("extra",r).fail(x.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){var i=Math.max(Math.min(t,50),-1)||10;return s.svr.joinChatroom(e,i,n,r)}))];case 1:return o=a.sent(),this.logger.summary(B.A_JOIN_CHATROOM_R,o,i),[2,o]}}))}))}}),Object.defineProperty(n.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_QUIT_CHATROOM_T,JSON.stringify({roomId:e}),n),[4,Rn.create("quitChatroom").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isString("extra",t).fail(x.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.quitChatroom(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_QUIT_CHATROOM_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_INFO_T,JSON.stringify({roomId:e,count:t,order:n}),r),[4,Rn.create("getChatroomInfo").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,0,20).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",n,0,2).fail(x.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).next((function(){return o.svr.getChatroomInfo(e,t||0,n||1)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_CHATROOM_INFO_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:n}),r),[4,Rn.create("setChatroomEntry").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("key",null==t?void 0:t.key,on,!0).fail(x.INVALID_PARAMETER_KEY).validate("value",null==t?void 0:t.value,an,!0).fail(x.INVALID_PARAMETER_VALUE).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(x.INVALID_PARAMETER_NOTIFICATION_EXTRA).isBoolean("isAutoDelete",null==t?void 0:t.isAutoDelete).fail(x.INVALID_PARAMETER_IS_AUTO_DELETE).isBoolean("isSendNotification",null==t?void 0:t.isSendNotification).fail(x.INVALID_PARAMETER_IS_SEND_NOTIFICATION).result().tryTrans(this.validateConnected).next((function(){return o.svr.setChatroomEntry(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_CHATROOM_ENTRY_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),n),[4,Rn.create("setChatroomEntries").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isTypedArray("entries",null==t?void 0:t.entries,(function(e){return on(null==e?void 0:e.key)&&an(null==e?void 0:e.value)}),!0).fail(x.INVALID_PARAMETER_ENTRIES).isLimitedArray("entryOptions.entries",null==t?void 0:t.entries,10,!0).fail(x.CHATROOM_KV_STORE_OUT_LIMIT).isBoolean("entryOptions.isForce",null==t?void 0:t.isForce).fail(x.INVALID_PARAMETER_IS_FORCE).isBoolean("entryOptions.isAutoDelete",null==t?void 0:t.isAutoDelete).fail(x.INVALID_PARAMETER_IS_AUTO_DELETE).result().tryTrans(this.validateConnected).next((function(){return i.svr.setChatroomEntries(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SET_CHATROOM_ENTRIES_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:n}),r),[4,Rn.create("removeChatroomEntry").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("entry.key",null==t?void 0:t.key,on,!0).fail(x.INVALID_PARAMETER_KEY).isBoolean("entry.isSendNotification",null==t?void 0:t.isSendNotification).fail(x.INVALID_PARAMETER_IS_SEND_NOTIFICATION).isLimitedString("entry.notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(x.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return o.svr.removeChatroomEntry(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_REMOVE_CHATROOM_ENTRY_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),n),[4,Rn.create("removeChatroomEntries").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("keys",null==t?void 0:t.keys,10,on,!0).fail(x.INVALID_PARAMETER_KEYS).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(x.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.removeChatroomEntries(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REMOVE_CHATROOM_ENTRIES_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,key:t}),n),[4,Rn.create("getChatroomEntry").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("key",t,on,!0).fail(x.INVALID_PARAMETER_KEY).result().tryTrans(this.validateConnected).next((function(){return i.svr.getChatroomEntry(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_CHATROOM_ENTRY_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e}),t),[4,Rn.create("getAllChatroomEntries").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return r.svr.getAllChatroomEntries(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_CHATROOM_ENTRIES_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:t,order:n,timestamp:r}),i),[4,Rn.create("getChatroomHistoryMessages").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,1,100).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",n,0,1).fail(x.INVALID_PARAMETER_ORDER).isTimestamp("timestamp",r).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return s.svr.getChatroomHistoryMessages(e,r||0,t||20,n||0)}))];case 1:return o=a.sent(),this.logger.summary(B.A_GET_CHATROOM_HISTORY_MESSAGES_R,o,i),[2,o]}}))}))}}),Object.defineProperty(n.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.svr.setCheckChatRoomDuplicateMessage(e)}}),Object.defineProperty(n.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BIND_RTC_FOR_CHATROOM_T,JSON.stringify({option:e}),t),[4,Rn.create("bindRTCRoomForChatroom").validate("chatRoomId",null==e?void 0:e.chatRoomId,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return r.svr.bindRTCRoomForChatroom(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_BIND_RTC_FOR_CHATROOM_R,n,t),[2,n]}}))}))}}),n}($E),tb=function(e){e.groupId;var t=e.groupName,n=e.portraitUri,r=e.introduction,i=e.notice;e.extProfile;var o=e.joinPermission,a=e.removeMemberPermission,s=e.invitePermission,u=e.inviteHandlePermission,l=e.groupInfoEditPermission,c=e.memberInfoEditPermission;return JSON.parse(JSON.stringify({name:t,portraitUrl:n,introduction:r,announcement:i,joinPerm:o,removePerm:a,memInvitePerm:s,invitePerm:u,profilePerm:l,memProfilePerm:c}))},nb=function(e){var t,n,r;return{removeMuteStatus:!(null!==(t=null==e?void 0:e.removeMuteStatus)&&void 0!==t&&!t),removeWhiteList:!(null!==(n=null==e?void 0:e.removeWhiteList)&&void 0!==n&&!n),removeFollow:!(null!==(r=null==e?void 0:e.removeFollow)&&void 0!==r&&!r)}},rb=function(e,t,n){return e.validate("groupId",null==t?void 0:t.groupId,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedString("groupName",null==t?void 0:t.groupName,1,64,n).fail(x.INVALID_PARAMETER_GROUP_NAME).isString("portraitUri",null==t?void 0:t.portraitUri).isString("introduction",null==t?void 0:t.introduction).isString("notice",null==t?void 0:t.notice).validate("extProfile",null==t?void 0:t.extProfile,(function(e){if(!At(e))return!1;var t=Object.entries(e);return t.length<=10&&t.every((function(e){var t=u(e,2);t[0];var n=t[1];return Et(n)}))})).isNumberEnum("joinPermission",null==t?void 0:t.joinPermission,v).isNumberEnum("removeMemberPermission",null==t?void 0:t.removeMemberPermission,R).isNumberEnum("invitePermission",null==t?void 0:t.invitePermission,R).isNumberEnum("inviteHandlePermission",null==t?void 0:t.inviteHandlePermission,m).isNumberEnum("groupInfoEditPermission",null==t?void 0:t.groupInfoEditPermission,R).isNumberEnum("memberInfoEditPermission",null==t?void 0:t.memberInfoEditPermission,I).fail(x.INVALID_PARAMETER_GROUP_INFO)},ib=function(e,t,n,r,i){return e.isObject("option",r,i).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("count",null==r?void 0:r.count,1,t,n).fail(x.INVALID_PARAMETER_COUNT).isString("pageToken",null==r?void 0:r.pageToken).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).isBoolean("order",null==r?void 0:r.order).fail(x.INVALID_PARAMETER_ORDER)},ob=function(e){function n(t,n){var r=e.call(this,t)||this;return Object.defineProperty(r,"svr",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"_userProfileEnabled",{enumerable:!0,configurable:!0,writable:!0,value:function(){var e;return 1===(null===(e=r.ctx.naviInfo)||void 0===e?void 0:e.userProfile)?Tn():vn(x.RC_USER_PROFILE_SERVICE_UNAVAILABLE)}}),r}return t(n,e),Object.defineProperty(n.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MY_USER_PROFILE_VISIBILITY_T,e,t),[4,Rn.create("updateMyUserProfileVisibility").isNumberEnum("visibility",e,he,!0).fail(x.INVALID_PARAMETER_USER_PROFILE_VISIBILITY).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.updateMyUserProfileVisibility(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_UPDATE_MY_USER_PROFILE_VISIBILITY_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_MY_USER_PROFILE_VISIBILITY_T,"",e),[4,this.validateConnected().tryTrans(this._userProfileEnabled).next((function(){return n.svr.getMyUserProfileVisibility()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_MY_USER_PROFILE_VISIBILITY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(n.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T,e,t),[4,Rn.create("searchUserProfileByUniqueId").isNotEmptyString("uniqueId",e,!0).fail(x.INVALID_PARAMETER_UNIQUE_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.searchUserProfileByUniqueId(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ADD_FRIEND_T,JSON.stringify({userId:e,directionType:t,extra:n}),r),[4,Rn.create("addFriend").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isNumberEnum("directionType",t,_,!0).fail(x.INVALID_PARAMETER_DIRECTION_TYPE).isLimitedString("extra",n,0,128).fail(x.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.addFriend(e,t,n||"")}))];case 1:return i=a.sent(),this.svr.addFriend(e,t,n||""),this.logger.summary(B.A_ADD_FRIEND_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_DELETE_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),n),[4,Rn.create("deleteFriends").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,_,!0).fail(x.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.deleteFriends(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_DELETE_FRIENDS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_FRIEND_REQUEST_T,e,t),[4,Rn.create("acceptFriendRequest").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.acceptFriendRequest(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_ACCEPT_FRIEND_REQUEST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_FRIEND_REQUEST_T,JSON.stringify({userId:e,reason:t}),n),[4,Rn.create("refuseFriendApplication").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isString("reason",t).fail(x.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.refuseFriendRequest(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REFUSE_FRIEND_REQUEST_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_FRIEND_INFO_T,JSON.stringify({userId:e,remark:t,extProfile:n}),r),[4,Rn.create("setFriendInfo").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isLimitedString("remark",t,0,64,!0).fail(x.INVALID_PARAMETER_REMARK).validate("extProfile",n,(function(e){if("object"!=typeof n)return!1;var t=Object.entries(n);return!(t.length>10||t.some((function(e){var t=u(e,2);t[0];var n=t[1];return!Et(n)})))})).fail(x.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.setFriendInfo(e,t,n||{})}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_FRIEND_INFO_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_CHECK_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),n),[4,Rn.create("checkFriends").isLimitedTypedArray("userIds",e,20,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,_,!0).fail(x.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.checkFriends(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_CHECK_FRIENDS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIENDS_T,JSON.stringify({directionType:e,option:t}),n),[4,Rn.create("getFriends").isNumberEnum("directionType",e,f,!0).fail(x.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE).check((function(e){return ib(e,100,!1,t)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:(null==t?void 0:t.count)||50,pageToken:(null==t?void 0:t.pageToken)||"",order:!!(null==t?void 0:t.order)};return i.svr.getFriends(e,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_FRIENDS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIEND_APPLICATIONS_T,JSON.stringify({option:e,types:t,status:n}),r),[4,Rn.create("getFriendApplications").check((function(t){return ib(t,100,!1,e)})).check((function(e){e.isTypedArray("types",t,(function(t){return!e.isNumberEnum("type",t,p,!0).isFailed})).fail(x.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE).isTypedArray("status",n,(function(t){return!e.isNumberEnum("status",t,E,!0).isFailed})).fail(x.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:(null==e?void 0:e.count)||50,pageToken:(null==e?void 0:e.pageToken)||"",order:!!(null==e?void 0:e.order)},i=t&&0!==t.length?t:[1,2],a=n&&0!==n.length?n:[0,1,2,3];return o.svr.getFriendApplications(r,i,a)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_FRIEND_APPLICATIONS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIENDS_INFO_T,JSON.stringify({userIds:e}),t),[4,Rn.create("getFriendsInfo").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getFriendsInfo(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_FRIENDS_INFO_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_FRIENDS_INFO_T,JSON.stringify({nickname:e}),t),[4,Rn.create("searchFriendsInfo").isLimitedString("nickname",e,1,64,!0).fail(x.INVALID_PARAMETER_NICK_NAME).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.searchFriendsInfo(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SEARCH_FRIENDS_INFO_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_FRIEND_ADD_PERMISSION_T,JSON.stringify({permission:e}),t),[4,Rn.create("setFriendAddPermission").isNumberEnum("permission",e,h,!0).fail(x.INVALID_PARAMETER_FRIEND_ADD_PERMISSION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.setFriendAddPermission(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SET_FRIEND_ADD_PERMISSION_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIEND_ADD_PERMISSION_T,JSON.stringify({}),e),[4,Rn.create("getFriendAddPermission").result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getFriendAddPermission()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_FRIEND_ADD_PERMISSION_R,t,e),[2,t]}}))}))}}),Object.defineProperty(n.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_CREATE_GROUP_T,JSON.stringify({groupInfo:e,inviteeUserIds:t}),n),[4,Rn.create("createGroup").check((function(t){return rb(t,e,!0)})).isLimitedTypedArray("inviteeUserIds",t,30,Ut,!1,0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n=tb(e);return i.svr.createGroup(e.groupId,n,e.extProfile||{},t||[])}))];case 1:return r=o.sent(),this.logger.summary(B.A_CREATE_GROUP_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_GROUP_INFO_T,JSON.stringify({groupInfo:e}),t),[4,Rn.create("updateGroupInfo").check((function(t){return rb(t,e,!1)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var t=tb(e);return r.svr.updateGroupInfo(e.groupId,t,e.extProfile)}))];case 1:return n=i.sent(),this.logger.summary(B.A_UPDATE_GROUP_INFO_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUPS_INFO_T,JSON.stringify({groupIds:e}),t),[4,Rn.create("getGroupsInfo").isLimitedTypedArray("groupIds",e,20,Dt,!0,1).fail(x.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getGroupsInfo(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_GROUPS_INFO_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_KICK_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t,config:n}),r),[4,Rn.create("kickGroupMembers").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.kickGroupMembers(e,t,nb(n))}))];case 1:return i=a.sent(),this.logger.summary(B.A_KICK_GROUP_MEMBERS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_QUIT_GROUP_T,JSON.stringify({groupId:e,config:t}),n),[4,Rn.create("quitGroup").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.quitGroup(e,nb(t))}))];case 1:return r=o.sent(),this.logger.summary(B.A_QUIT_GROUP_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_DISMISS_GROUP_T,JSON.stringify({groupId:e}),t),[4,Rn.create("dismissGroup").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.dismissGroup(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_DISMISS_GROUP_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_TRANSFER_GROUP_OWNER_T,JSON.stringify({groupId:e,newOwnerId:t,quit:n,config:r}),i),[4,Rn.create("transferGroupOwner").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("newOwnerId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.transferGroupOwner(e,t,!!n,nb(r))}))];case 1:return o=a.sent(),this.logger.summary(B.A_TRANSFER_GROUP_OWNER_R,o,i),[2,o]}}))}))}}),Object.defineProperty(n.prototype,"addGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ADD_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),n),[4,Rn.create("addGroupManagers").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,Ut,!0,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(O.ADD,e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_ADD_GROUP_MANAGERS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"removeGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),n),[4,Rn.create("removeGroupManagers").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,Ut,!0,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(O.REMOVE,e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REMOVE_GROUP_MANAGERS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t}),n),[4,Rn.create("getGroupMembers").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.getGroupMembers(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_GROUP_MEMBERS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_SET_GROUP_MEMBER_INFO_T,JSON.stringify({groupId:e,userId:t,nickname:n,extra:r}),i),[4,Rn.create("setGroupMemberInfo").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("userId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isLimitedString("nickname",n,0,64,!0).fail(x.INVALID_PARAMETER_NICK_NAME).isLimitedString("extra",r,0,128).fail(x.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.setGroupMemberInfo(e,t,n,r)}))];case 1:return o=a.sent(),this.logger.summary(B.A_SET_GROUP_MEMBER_INFO_R,o,i),[2,o]}}))}))}}),Object.defineProperty(n.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_GROUP_MEMBERS_T,JSON.stringify({groupId:e,nickName:t,option:n}),r),[4,Rn.create("searchGroupMembers").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedString("nickName",t,1,64,!0).fail(x.INVALID_PARAMETER_NICK_NAME).check((function(e){return ib(e,200,!0,n,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var r={count:n.count,pageToken:n.pageToken||"",order:!!n.order};return o.svr.searchGroupMembers(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SEARCH_GROUP_MEMBERS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_MEMBERS_BY_ROLE_T,JSON.stringify({groupId:e,role:t,option:n}),r),[4,Rn.create("getGroupMembersByRole").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isNumberEnum("role",t,y,!0).fail(x.INVALID_PARAMETER_GROUP_MEMBER_ROLE).isLimitedInteger("count",n.count,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).isString("pageToken",n.pageToken).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).isNumberEnum("filterRobotType",n.filterRobotType,Ve).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:n.count,pageToken:n.pageToken||"",order:!!n.order,filterRobotType:n.filterRobotType||Ve.ALL};return o.svr.getGroupMembersByRole(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_GROUP_MEMBERS_BY_ROLE_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"addGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ADD_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),n),[4,Rn.create("addGroupFollows").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(O.ADD,e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_ADD_GROUP_FOLLOWS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"removeGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),n),[4,Rn.create("removeGroupFollows").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(O.REMOVE,e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REMOVE_GROUP_FOLLOWS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_FOLLOWS_T,JSON.stringify({groupId:e}),t),[4,Rn.create("getGroupFollows").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getGroupFollows(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_GROUP_FOLLOWS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_GROUP_REMARK_T,JSON.stringify({groupId:e,remark:t}),n),[4,Rn.create("setGroupRemark").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedString("remark",t,0,64,!0).fail(x.INVALID_PARAMETER_REMARK).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupRemark(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SET_GROUP_REMARK_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_JOIN_GROUP_T,JSON.stringify({groupId:e}),t),[4,Rn.create("joinGroup").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.joinGroup(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_JOIN_GROUP_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_INVITE_USERS_TO_GROUP_T,JSON.stringify({groupId:e,userIds:t}),n),[4,Rn.create("inviteUsersToGroup").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,30,Ut,!0,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.inviteUsersToGroup(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_INVITE_USERS_TO_GROUP_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"acceptGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t}),n),[4,Rn.create("acceptGroupInvite").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.memberInviteResponse({groupId:e,inviterId:t,optType:P.APPLICANT,optResult:C.ACCEPT})}))];case 1:return r=o.sent(),this.logger.summary(B.A_ACCEPT_GROUP_INVITE_R,r,n),[2,r.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"refuseGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t,reason:n}),r),[4,Rn.create("refuseGroupInvite").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isLimitedString("reason",n,0,128).fail(x.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,inviterId:t,optType:P.APPLICANT,optResult:C.REFUSE,reason:n})}))];case 1:return i=a.sent(),this.logger.summary(B.A_REFUSE_GROUP_INVITE_R,i,r),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"acceptGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:n}),r),[4,Rn.create("acceptGroupApplication").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).validate("inviterId",n,Ut).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n||"",optType:P.MANAGER,optResult:C.ACCEPT})}))];case 1:return i=a.sent(),this.logger.summary(B.A_ACCEPT_GROUP_APPLICATION_R,i,r),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"refuseGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:n,reason:r}),i),[4,Rn.create("refuseGroupApplication").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).validate("inviterId",n,Ut).fail(x.INVALID_PARAMETER_USER_ID).isLimitedString("reason",r,0,128).fail(x.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n||"",optType:P.MANAGER,optResult:C.REFUSE,reason:r})}))];case 1:return o=a.sent(),this.logger.summary(B.A_REFUSE_GROUP_APPLICATION_R,o,i),[2,o.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_APPLICATIONS_T,JSON.stringify({option:e,directions:t,status:n}),r),i=this.ctx.usingCppEngine,[4,Rn.create("getGroupApplications").check((function(t){return ib(t,200,!0,e,!0)})).check((function(e){i&&e.isLimitedTypedArray("directions",t,Object.keys(M).length,(function(t){return!e.isNumberEnum("directions",t,M,!0).isFailed}),!0,1).fail(x.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION).isLimitedTypedArray("status",n,Object.keys(N).length,(function(t){return!e.isNumberEnum("status",t,N,!0).isFailed}),!0,1).fail(x.INVALID_PARAMETER_GROUP_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:e.count,pageToken:e.pageToken||"",order:!!e.order};return s.svr.getGroupApplications(r,t||[],n||[])}))];case 1:return o=a.sent(),this.logger.summary(B.A_GET_GROUP_APPLICATIONS_R,o,r),[2,o]}}))}))}}),Object.defineProperty(n.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_JOINED_GROUPS_BY_ROLES_T,JSON.stringify({role:e,option:t}),n),[4,Rn.create("getJoinedGroupsByRole").isNumberEnum("role",e,y,!0).fail(x.INVALID_PARAMETER_GROUP_MEMBER_ROLE).check((function(e){return ib(e,100,!0,t,!0)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.getJoinedGroupsByRole(e,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_JOINED_GROUPS_BY_ROLES_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_JOINED_GROUPS_T,JSON.stringify({groupName:e,option:t}),n),[4,Rn.create("searchJoinedGroups").isLimitedString("groupName",e,1,64,!0).fail(x.INVALID_PARAMETER_GROUP_NAME).check((function(e){return ib(e,200,!0,t,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var n={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.searchJoinedGroups(e,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SEARCH_JOINED_GROUPS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_JOINED_GROUPS_T,JSON.stringify({groupIds:e}),t),[4,Rn.create("getJoinedGroups").isLimitedTypedArray("groupIds",e,20,Dt,!0,1).fail(x.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getJoinedGroups(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_JOINED_GROUPS_R,n,t),[2,n]}}))}))}}),n}($E),ab=0,sb=function(e){function n(t,n,i){var o=e.call(this,i)||this;return Object.defineProperty(o,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:n}),WE.set(o,void 0),KE.set(o,!1),JE.set(o,!0),QE.set(o,""),Object.defineProperty(o,"_id",{enumerable:!0,configurable:!0,writable:!0,value:++ab}),d(o,WE,r(r({},t),{tagFilter:r({},t.tagFilter)}),"f"),o}return t(n,e),Object.defineProperty(n.prototype,"hasMore",{get:function(){return c(this,JE,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isLoading",{get:function(){return c(this,KE,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"load",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return c(this,KE,"f")?[2,vn(x.METHOD_BUSY)]:(d(this,KE,!0,"f"),t=this.logger.createTraceId(),this.logger.info(B.A_LOAD_CONVERSATION_LIST_T,JSON.stringify({count:e,loaderId:this._id,pageToken:c(this,QE,"f")}),t),[4,Rn.create("ConversationListLoader.load").isLimitedInteger("count",e,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){return u._svr.loadConversationList(c(u,QE,"f"),e,c(u,WE,"f"))}))]);case 1:return n=a.sent(),this.logger.summary(B.A_LOAD_CONVERSATION_LIST_R,n,t,{loaderId:this._id},(function(e){return{pageToken:e.pageToken,finished:e.finished}})),d(this,KE,!1,"f"),n.isOk?(r=n.data,i=r.pageToken,o=r.finished,s=r.list,d(this,QE,i,"f"),d(this,JE,!o,"f"),[2,Tn(s)]):[2,n.wipe()]}}))}))}}),n}($E);WE=new WeakMap,KE=new WeakMap,JE=new WeakMap,QE=new WeakMap;var ub,lb,cb,db,_b,fb,hb,gb,pb,Eb=function(e){function n(t,n){var r=e.call(this,t)||this;return XE.add(r),Object.defineProperty(r,"svr",{enumerable:!0,configurable:!0,writable:!0,value:n}),r}return t(n,e),Object.defineProperty(n.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SAVE_EDITED_MSG_DRAFT_T,JSON.stringify({draft:e,identifier:t}),n),[4,Rn.create("saveEditedMessageDraft").check((function(e){return lc(e,t,Z)})).isString("draft",null==e?void 0:e.content,!0).fail(x.INVALID_PARAMETER_DRAFT).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateLogin).next((function(){return i.svr.saveEditedMessageDraft(e,c(i,XE,"m",zE).call(i,t))}))];case 1:return r=o.sent(),this.logger.summary(B.A_SAVE_EDITED_MSG_DRAFT_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,Rn.create("getEditedMessageDraft").check((function(t){return lc(t,e,Z)})).result().next((function(){return r.svr.getEditedMessageDraft(c(r,XE,"m",zE).call(r,e))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_EDITED_MSG_DRAFT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,Rn.create("clearEditedMessageDraft").check((function(t){return lc(t,e,Z)})).result().next((function(){return r.svr.clearEditedMessageDraft(c(r,XE,"m",zE).call(r,e))}))];case 1:return n=i.sent(),this.logger.summary(B.A_CLEAR_EDITED_MSG_DRAFT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"createConversationListLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return n=(t=e||{}).conversationTypes,i=t.order,o=t.channelId,s=t.tagFilter,[4,Rn.create("createConversationListLoader").isTypedArray("conversationTypes",n,(function(e){return te(e,W)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("order",i,0,1).fail(x.INVALID_PARAMETER_ORDER).validate("channelId",o,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).check((function(e){if(s){var t=s.tagIds;e.isLimitedTypedArray("tagIds",t,20,mt,!1,0).fail(x.INVALID_PARAMETER_TAG_ID)}})).result().tryTrans(this.validateConnected).trans((function(){return new sb(r(r({},e),{tagFilter:r({},s)}),u.svr,u.ctx)}))];case 1:return[2,a.sent()]}}))}))}}),Object.defineProperty(n.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),n=null==e?void 0:e.conversationType,this.logger.info(B.A_SEND_UG_TYPING_T,JSON.stringify(e),t),[4,Rn.create("sendUltraGroupTypingStatus").check((function(t){return lc(t,e,X)})).validate("conversationType",n,(function(){return n===F.ULTRA_GROUP}),!0).fail(x.CONVERSATION_TYPE_NOT_SUPPORT).result().tryTrans(this.validateConnected).next((function(){var t=c(i,XE,"m",zE).call(i,e);return i.svr.sendUltraGroupTypingStatus(t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SEND_UG_TYPING_R,r,t),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"sendTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_TYPING_STATUS_T,JSON.stringify({identifier:e,typingContentType:t}),n),[4,Rn.create("sendTypingStatus").check((function(t){return lc(t,e,W)})).isString("typingContentType",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var r={messageType:"RC:TypSts",content:{typingContentType:t}};return i.ctx.sendMessage(e,r,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SEND_TYPING_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"sendSyncReadStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SYNC_READ_STATUS_T,JSON.stringify({identifier:e,timestamp:t}),n),[4,Rn.create("sendSyncReadStatusMessage").check((function(t){return lc(t,e,W)})).isNumber("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return 1===r.sesDriven?[2,this.svr.updateConversationReadTime(e,t)]:(i={messageType:me.SYNC_READ_STATUS,content:{lastMessageSendTime:t},directionalUserIdList:[this.ctx.userId]},[4,this.ctx.sendMessage(e,i,n)]);case 1:return[2,o.sent().wipe()]}}))}))}))];case 1:return r=s.sent(),this.logger.summary(B.A_SYNC_READ_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_UNREAD_COUNT_BY_TIME_T,JSON.stringify({identifier:e,timestamp:t}),n),[4,Rn.create("clearUnreadCountByTimestamp").check((function(t){return lc(t,e,W)})).isTimestamp("timestamp",t).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i.svr.clearUnreadCountByTimestamp(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_CLEAR_UNREAD_COUNT_BY_TIME_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"sendReadReceiptRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_REQ_T,JSON.stringify({identifier:e,messageUId:t}),n),[4,Rn.create("sendReadReceiptRequest").check((function(t){return lc(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(){var r={messageType:me.READ_RECEIPT_REQUEST,content:{messageUId:t}};return i.ctx.sendMessage(e,r,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_REQ_R,r,n),[2,r.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageUId:t,timestamp:n}),r),[4,Rn.create("sendReadReceiptMessage").check((function(t){return lc(t,e,$)})).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("timestamp",n,1,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var i={messageType:me.READ_RECEIPT,content:{messageUId:t,lastMessageSendTime:n,type:1}};return o.ctx.sendMessage(e,i,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_R,i,r),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"sendReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageList:t}),n),[4,Rn.create("sendReadReceipt").check((function(t){return lc(t,e,z)})).fail(x.INVALID_PARAMETER_TARGET_ID).check((function(e){At(t)&&!Object.keys(t).some((function(n){var r=t[n];return e.isLimitedTypedArray("messageList",r,Number.MAX_SAFE_INTEGER,mt,!0).isFailed}))||e.setFailed(x.MSG_LIMIT_ERROR)})).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:return 0!==(i=r.grpRRVer||0)&&1!==i?[2,vn(x.READ_RECEIPT_ERROR)]:1===i?(o=[],Object.keys(t).forEach((function(e){o.push.apply(o,l([],u(t[e]),!1))})),[2,this.svr.sendReadReceiptV2(e.targetId,o,e.channelId)]):[4,this.ctx.sendMessage(e,{messageType:me.READ_RECEIPT_RESPONSE,content:{receiptMessageDic:t}},n)];case 1:return[2,a.sent().wipe()]}}))}))}))];case 1:return r=s.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_MSG_READER_T,JSON.stringify({targetId:e,messageUId:t,channelId:n}),r),[4,Rn.create("getMessageReader").validate("targetId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(r){return o(s,void 0,void 0,(function(){return a(this,(function(i){return 1!==r.grpRRVer?[2,vn(x.READ_RECEIPT_ERROR)]:[2,this.svr.getMessageReader(e,t,n||"")]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_MSG_READER_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,endMsgUid:t,startMsgUid:n}),r),[4,Rn.create("sendReadReceiptMessageV4").check((function(t){return lc(t,e,W)})).isNotEmptyString("endMsgUid",t,!0).fail(x.INVALID_PARAMETER_END_MESSAGE_UID).isNotEmptyString("startMsgUid",n).fail(x.INVALID_PARAMETER_START_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return o(s,void 0,void 0,(function(){return a(this,(function(i){return 3!==r.grpRRVer?[2,vn(x.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.sendReadReceiptMessageV4(e,n||"",t)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_V4_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,messageUId:t}),n),[4,Rn.create("getMessageReadReceiptV4").check((function(t){return lc(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){return a(this,(function(r){return 3!==n.grpRRVer?[2,vn(x.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.getMessageReadReceiptV4(e,t)]}))}))}))];case 1:return r=s.sent(),this.logger.summary(B.A_GET_READ_RECEIPT_V4_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_BATCH_GET_READ_RECEIPT_INFO_V4_T,JSON.stringify({conversation:e,messageUIds:t}),n),[4,Rn.create("batchGetMessageReadReceiptInfoV4").check((function(t){return lc(t,e,z)})).isTypedArray("messageUIds",t,mt,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){return a(this,(function(r){return 3!==n.grpRRVer?[2,vn(x.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}))];case 1:return r=s.sent(),this.logger.summary(B.A_BATCH_GET_READ_RECEIPT_INFO_V4_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T,JSON.stringify({options:e}),t),[4,Rn.create("getConversationsIncludingRobots").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,2,(function(e){return[F.PRIVATE,F.SYSTEM].includes(e)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var t=r(r({},e),{topPriority:!!e.topPriority});return i.svr.getConversationsIncludingRobots(t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R,n,t),[2,n]}}))}))}}),n}($E);function bb(e){return r({},e)}XE=new WeakSet,ZE=function(e){var t;return!!(2&((null===(t=this.ctx.naviInfo)||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e},zE=function(e){return e.conversationType!==F.ULTRA_GROUP?e:r(r({},e),{channelId:c(this,XE,"m",ZE).call(this,e.channelId)})};var Tb=function(){function e(e){var t,n,i=this;ub.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,"chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataHosting",{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,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_ugSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[me.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),t[me.INTERCEPT]=this._processInterceptMessage.bind(this),t)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(n={},n[me.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),n[me.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),n[me.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),n)}),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,userSettingsSynced:void 0,userSettingsChanged:void 0,conversationStatusSynced:void 0,robotsSynced: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,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,databaseOpened:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0,readReceiptResponseV5:void 0,speechToTextResponse:void 0,translateResponse:void 0,messagesModified:void 0,messageModifiedSyncCompleted: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:[]}),this._options=r({},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 o={onConnected:function(){return i._onConnectionStatusChange(ge.CONNECTED)},onConnecting:this._onConnectionStatusChange.bind(this,ge.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,ge.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,ge.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),userSettingsSynced:this._onUserSettingsSynced.bind(this),userSettingsChanged:this._onUserSettingsChanged.bind(this),conversationStatusSynced:this._onConversationStatusSynced.bind(this),robotsSynced:this._onRobotsSynced.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),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),databaseOpened:this._databaseOpened.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this),readReceiptResponseV5:this._readReceiptResponseV5.bind(this),speechToTextResponse:this._speechToTextResponse.bind(this),translateResponse:this._translateResponse.bind(this),messagesModified:this._messagesModified.bind(this),messageModifiedSyncCompleted:this._messageModifiedSyncCompleted.bind(this)},a=Vt();this._engine=a?new RCCppEngine(o,this._options):new qE(o,this._options),this.logger=this._engine.logger,this._options.eventLoopBlockingCheck&&lr.start(this.logger),this.sse=new zl(this,a),this.chatroom=new eb(this._engine,this._engine.chatroom),this.dataHosting=new ob(this._engine,this._engine.dataHosting),this.chat=new Eb(this._engine,this._engine.chat)}return Object.defineProperty(e,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this._context)return this._context.logger.warn(B.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(B.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(B.L_IMSDK_VER_O,JSON.stringify({commitId:"3a2c6fc3b07dfb5651302458dffca3edfc17abc8",version:"5.32.0"}));var n=this._context._engine;return ua.setNetworkStatusListener(n.setNetwork.bind(n)),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 a(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(B.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 n=this.logger.createTraceId();if(this.logger.info(B.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),n),this._pluginInstanseMap[e.tag])return this.logger.warn(B.L_INSTALL_PLUGIN_R,"repeat install",n),this._pluginInstanseMap[e.tag];var r="RCRTC"===e.tag?new nc(this):new tc(this),i=null;try{if(!e.verify(ua))return null;i=e.setup(r,ua,t)}catch(e){this.logger.error(B.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,n)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(r),this._pluginInstanseMap[e.tag]=i),i}}),Object.defineProperty(e.prototype,"getAppSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.validateLogin().trans((function(e){return new YE(e)}))}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r;this._ugSynced=!1,this.logger.warn(B.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(r=(n=this._watcher).connection)||void 0===r||r.call(n,e,t),this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onconnectionstatechange)||void 0===r||r.call(n,e,t)}))}}),Object.defineProperty(e.prototype,"_processTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._addTypingInfo(bb(e)),!!this._watcher.typingState}}),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===F.ULTRA_GROUP){var n=e.content.sourceType;if(t.sourceType=n,(n===Ee.MSG_EXPANSION||n===Ee.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(B.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!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,n=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,r=this._engine.userId;n&&Array.isArray(n[r])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,n[r])}}),Object.defineProperty(e.prototype,"_messageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i,o,a,s=this;if(!(null===(i=(r=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(r,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(bb(e))}catch(e){return s.logger.error(B.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(a=(o=this._watcher).message)||void 0===a||a.call(o,bb(e),t,n),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=[],o=[],a=[me.READ_RECEIPT,me.READ_RECEIPT_REQUEST,me.READ_RECEIPT_RESPONSE];e.forEach((function(e){var s=r._messageReceiver(e,t,n);s&&a.includes(s.messageType)?o.push(s):s&&i.push(s)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(B.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.forEach((function(e){r._messageProccessor[e.messageType]&&r._messageProccessor[e.messageType](e)}))}}),Object.defineProperty(e.prototype,"_chatroomInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).chatroomState)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).conversationState)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_expansionInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).expansion)||void 0===n||n.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,"_onUserSettingsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userSettingsSynced)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_onUserSettingsChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userSettingsChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_onConversationStatusSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).conversationStatusSynced)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_onRobotsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r;null===(r=(n=this._watcher).robotsSynced)||void 0===r||r.call(n,e,t)}}),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,n;null===(n=(t=this._watcher).typingState)||void 0===n||n.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,n;null===(n=(t=this._watcher).messageBlocked)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_callInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._pluginContextQueue.forEach((function(n){try{n.onCallInfo&&n.onCallInfo(e)}catch(e){t.logger.warn(B.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;this._ugSynced=!0,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(e){var t,n;null===(n=(t=this._watcher).sgRelationsSynced)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_operateStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).operateStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageExpansionUpdatedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageRecalledListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageRecalled)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelChangeTypeListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelChangeType)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelUserKickedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelDeleteListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelDelete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_userGroupStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userGroupStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).messageReadReceipt)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_syncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).syncReadStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedUserStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).subscribedUserStatusChange)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedRelationChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).subscribedRelationChange)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_syncSubscribedUserStatusFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(B.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(n=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ownUserProfileChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(B.L_OWN_USER_PROFILE_CHANGED_S),null===(n=(t=this._watcher).ownUserProfileChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupOperation)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupInfoChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupMemberInfoChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupApplicationEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupApplicationEvent)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupRemarkChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupRemarkChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupFollowsChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupFollowsChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendAdd)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendDelete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendApplicationStatusChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendCleared",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendCleared)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendInfoChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_rtcDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onrtcdatachange)||void 0===r||r.call(n,e,t)}))}}),Object.defineProperty(e.prototype,"_naviDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pluginContextQueue.forEach((function(t){var n;null===(n=t.onnavidatachange)||void 0===n||n.call(t,e)}))}}),Object.defineProperty(e.prototype,"_databaseOpened",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r;null===(r=(n=this._watcher).databaseOpened)||void 0===r||r.call(n,e,t)}}),Object.defineProperty(e.prototype,"_databaseUpgradeWillStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.logger.info(B.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,n;this.logger.info(B.L_DB_UPGRATING_S,e),null===(n=(t=this._watcher).databaseUpgrading)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_databaseUpgradeDidComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(B.L_DB_UPGRATE_COMPLETE_S),null===(n=(t=this._watcher).databaseUpgradeDidComplete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_readReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).readReceiptResponseV5)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_speechToTextResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).speechToTextResponse)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_translateResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).translateResponse)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messagesModified",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).messagesModified)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messageModifiedSyncCompleted",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).messageModifiedSyncCompleted)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"assignWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;Object.keys(this._watcher).forEach((function(n){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];t._watcher[n]=St(r)||At(r)?r: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,n=e.conversationType,r=e.targetId,i=e.content,o=e.channelId,a=i.typingContentType,s=o||"",u="".concat(n,"#").concat(r,"#").concat(s);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===a?this._typingInfo[u][l].timestamp=Date.now():(l>=0&&this._typingInfo[u].splice(l,1),this._typingInfo[u].push({userId:t,messageType:a,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 n=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===n||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.connectedTime}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.serverTime}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.deviceId}}),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.userId}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.connectionStatus}}),Object.defineProperty(e.prototype,"_validateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return 1!==e.userProfile?vn(x.RC_USER_PROFILE_SERVICE_UNAVAILABLE):Tn(e)}}),Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e.checkAuthed(!1)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e.checkAuthed(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkAuthed",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.connectionStatus===ge.CONNECTED||this._engine.userId&&e?Tn(this._engine.naviInfo):vn(x.RC_NET_UNAVAILABLE)}}),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 a(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,c(this,ub,"m",lb).call(this,e,t,n)];case 1:return r=i.sent(),this.logger.summary(B.A_CONNECT_R,r,n,void 0,(function(e){return{userId:e}})),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return this.logger.info(B.A_DISCONNECT_O,JSON.stringify({closeDB:e,disablePush:t})),[2,c(this,ub,"m",cb).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_RECONNECT_T,JSON.stringify({reconnectKickEnable:e}),t),[4,c(this,ub,"m",lb).call(this,this.token,!!e,t)];case 1:return n=r.sent(),this.logger.summary(B.A_RECONNECT_R,n,t,void 0,(function(e){return{userId:e}})),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"_channelIdConvert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e!==F.ULTRA_GROUP)return t;var n=this.getNaviInfoFromCache();return!!(2&((null==n?void 0:n.ugDriven)||0))&&!t?"RCDefault":t}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.naviInfo}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,o){void 0===i&&(i=[]),void 0===o&&(o=!1);var a,s,u,l={isPersited:t,isCounted:n,searchProps:i,isStatusMessage:o};a=e,s=l,(u=vr.get(a))&&!u.isCustom&&console.warn("Builtin message type '".concat(a,"' cannot be registered")),s.isStatusMessage&&(s.isCounted=s.isPersited=!1),vr.set(a,r(r({},s),{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,"innerSendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.L_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),r),[4,c(this,ub,"m",_b).call(this,e,t,r,n)];case 1:return i=o.sent(),this.logger.summary(B.L_SEND_MSG_R,i,r,void 0,(function(t){return{messageId:t.messageId,messageUId:t.messageUId,messageType:t.messageType,identifier:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),r),[4,c(this,ub,"m",_b).call(this,e,t,r,n)];case 1:return i=o.sent(),this.logger.summary(B.A_SEND_MSG_R,i,r,void 0,(function(t){return{messageId:t.messageId,messageUId:t.messageUId,messageType:t.messageType,identifier:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"updateMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MSG_EXPANSION_T,JSON.stringify({expansion:e,attrs:t}),n),[4,Rn.create("updateMessageExpansion").check((function(n){return cc(n,t,Object.keys(e||{}))})).check((function(n){return dc(n,e,t.canIncludeExpansion)})).result().tryTrans(this.validateConnected).next((function(){var i={put:e,mid:t.messageUId},a=r(r({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===F.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(a,i,t.sentTime):c(o,ub,"m",hb).call(o,a,i,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_UPDATE_MSG_EXPANSION_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_MSG_EXPANSION_T,JSON.stringify({keys:e,attrs:t}),n),[4,Rn.create("removeMessageExpansion").isLimitedTypedArray("keys",e,20,(function(e){return"string"==typeof e&&/^[A-Za-z0-9_=+-]+$/.test(e)}),!0).fail(x.INVALID_PARAMETER_KEYS).check((function(n){return cc(n,t,e)})).result().tryTrans(this.validateConnected).next((function(){var i={del:e,mid:t.messageUId},a=r(r({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===F.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(a,i,t.sentTime):c(o,ub,"m",hb).call(o,a,i,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_REMOVE_MSG_EXPANSION_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeAllMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_ALL_MSG_EXPANSION_T,JSON.stringify({attrs:e}),t),[4,Rn.create("removeAllMessageExpansion").check((function(t){return cc(t,e,[])})).check((function(t){e.conversationType!==F.ULTRA_GROUP&&t.setFailed(x.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){var n={clear:1,mid:e.messageUId},o=r(r({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)});return e.conversationType===F.ULTRA_GROUP?i._engine.chat.updateUGMessageExpansion(o,n,e.sentTime):c(i,ub,"m",hb).call(i,o,n,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_REMOVE_ALL_MSG_EXPANSION_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=r||this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_V2_T,JSON.stringify({targetId:e,messageUIds:t,channelId:n}),r),[4,Rn.create("sendReadReceiptV2").validate("targetId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("messageUIds",t,Number.MAX_SAFE_INTEGER,mt,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(r){return o(s,void 0,void 0,(function(){return a(this,(function(i){return 1!==r.grpRRVer?[2,vn(x.READ_RECEIPT_ERROR,"The read receipt switch is not on, please call the sendMessage method.")]:[2,this._engine.chat.sendReadReceiptV2(e,t,n)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_V2_R,i,r),[2,i]}}))}))}}),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 a(this,(function(t){switch(t.label){case 0:return lr.stop(),this._resetWatcher(),this._engine.destroy(),ua.removeNetworkStatusListener(),[4,c(this,ub,"m",cb).call(this)];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(B.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){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=null==t?void 0:t.timestamp,r=null==t?void 0:t.count,i=null==t?void 0:t.order,o=null==t?void 0:t.messageType,s=this.logger.createTraceId(),this.logger.info(B.A_GET_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),s),[4,Rn.create("getHistoryMessage").check((function(t){return lc(t,e,Q)})).isLimitedInteger("timestamp",n,0,Number.MAX_SAFE_INTEGER).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(x.INVALID_PARAMETER_ORDER).isLimitedInteger("count",r,1,100).fail(x.INVALID_PARAMETER_COUNT).isNotEmptyString("messageType",o).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:n||0,count:r||20,order:i||0,messageType:o||""},a=c(l,ub,"m",db).call(l,e);return l._engine.getHistoryMessage(a,t,!0)}))];case 1:return u=a.sent(),this.logger.summary(B.A_GET_HISTORY_MSG_R,u,s),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_CONTINUOUS_MSGS_T,JSON.stringify({conversation:e,options:t}),n),[4,Rn.create("getContinuousMessages").check((function(t){return lc(t,e,K)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(x.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateLogin).next((function(){var n=c(i,ub,"m",db).call(i,e),r={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageType:""};return i._engine.chat.getContinuousMessages(n,r)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_CONTINUOUS_MSGS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_HIS_MSGS_BY_OBJ_NAMES_T,JSON.stringify({conversation:e,option:t}),n),[4,Rn.create("getHistoryMessagesByObjectNames").check((function(t){return lc(t,e,X)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(x.INVALID_PARAMETER_ORDER).isTypedArray("messageTypes",null==t?void 0:t.messageTypes,mt).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateLogin).next((function(){var n=c(i,ub,"m",db).call(i,e),r={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageTypes:t.messageTypes||[]};return i._engine.chat.getHistoryMessagesByObjectNames(n,r)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_HIS_MSGS_BY_OBJ_NAMES_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_TOP_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e,channelId:t}),n),[4,Rn.create("getTopConversationList").isTypedArray("conversationTypes",e,(function(e){return te(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",t,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=Qp(n))&&!this._ugSynced?[2,vn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTopConversationList(r,e,t)]}))}))}))];case 1:return r=s.sent(),this.logger.summary(B.A_GET_TOP_CONVERSATION_LIST_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e}),t),[4,Rn.create("getUnreadConversationList").isTypedArray("conversationTypes",e,(function(e){return te(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).next((function(t){return o(r,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=Qp(t))&&!this._ugSynced?[2,vn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getUnreadConversationList(n,e)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UNREAD_CONVERSATION_LIST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLOCKED_CONVERSATION_LIST_T,"",e),[4,Rn.create("getBlockedConversationList").result().tryTrans(this.validateConnected).next((function(e){return o(n,void 0,void 0,(function(){var t;return a(this,(function(n){return(t=Qp(e))&&!this._ugSynced?[2,vn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getBlockedConversationList(t)]}))}))}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_BLOCKED_CONVERSATION_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByPageIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return[4,Rn.create("getConversationListByPageIndex").isInteger("index",e,!0).fail(x.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",t,!0).fail(x.INVALID_PARAMETER_LIMIT).result().tryTrans(this.validateLogin).next((function(){return n._engine.chat.getConversationListByPageIndex(e,t)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_ALL_CONVERSATION_LIST_T,JSON.stringify({channelId:e}),t),[4,Rn.create("getAllConversationList").validate("channelId",e,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateLogin).next((function(t){return o(r,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=Qp(t))&&!this._ugSynced?[2,vn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getAllConversationList(n,e)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_ALL_CONVERSATION_LIST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_LIST_OLD_T,JSON.stringify(e),t),[4,Vt()&&"string"!=typeof(null==e?void 0:e.channelId)?this.getAllConversationList(null==e?void 0:e.channelId):this.getConversationListByTimestamp(e)];case 1:return n=r.sent(),this.logger.summary(B.A_GET_CONVERSATION_LIST_OLD_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_LIST_BY_TIME_T,JSON.stringify(e),t),[4,Rn.create("getConversationListByTimestamp").isObject("params",e,!0).fail(x.CONVER_GET_ERROR,"params must be an object").isInteger("startTime",null==e?void 0:e.startTime,!0).fail(x.INVALID_PARAMETER_START_TIME).isInteger("count",null==e?void 0:e.count,!0).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==e?void 0:e.order,0,1).fail(x.INVALID_PARAMETER_ORDER).validate("channelId",null==e?void 0:e.channelId,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,(function(e){return te(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans((function(){return r.checkAuthed(Vt())})).next((function(t){return o(r,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=Qp(t))&&!this._ugSynced?[2,vn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getConversationListByTimestamp(e,n)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_CONVERSATION_LIST_BY_TIME_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_T,JSON.stringify(e),t),[4,Rn.create("getConversation").check((function(t){return lc(t,e,Q)})).result().tryTrans(this.validateConnected).next((function(){var t=c(r,ub,"m",db).call(r,e);return r._engine.chat.getConversation(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_CONVERSATION_R,n,t,e),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CONVERSATION_T,JSON.stringify(e),n),[4,Rn.create("removeConversation").check((function(t){return lc(t,e,J)})).result().tryTrans(this.validateConnected).next((function(){var n=c(i,ub,"m",db).call(i,e);return i._engine.chat.batchDeleteConversations({identifiers:[n],deleteRemotely:!!t,deleteMessages:!1})}))];case 1:return r=o.sent(),this.logger.summary(B.A_REMOVE_CONVERSATION_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,s,u=this;return a(this,(function(l){switch(l.label){case 0:return t=null==e?void 0:e.identifiers,n=!!(null==e?void 0:e.deleteRemotely),r=!!(null==e?void 0:e.deleteMessages),i=this.logger.createTraceId(),this.logger.info(B.A_BATCH_DEL_CONVERS_T,JSON.stringify({identifiers:t,deleteRemotely:n,deleteMessages:r}),i),[4,Rn.create("batchDeleteConversations").isLimitedArray("identifiers",t,100,!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected).next((function(){return o(u,void 0,void 0,(function(){var e,i=this;return a(this,(function(o){return 0===(e=t.filter((function(e){return uc("",e,J).result().isOk})).map((function(e){return c(i,ub,"m",db).call(i,e)}))).length?[2,Tn()]:[2,this._engine.chat.batchDeleteConversations({identifiers:e,deleteRemotely:n,deleteMessages:r})]}))}))}))];case 1:return s=l.sent(),this.logger.summary(B.A_BATCH_DEL_CONVERS_R,s,i),[2,s.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return t=null==e?void 0:e.targetId,n=null==e?void 0:e.channelType,r=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_LIST_T,JSON.stringify({targetId:t,channelType:n}),r),[4,Rn.create("getUltraGroupList").validate("targetId",t,Ut).fail(x.INVALID_PARAMETER_TARGET_ID).isNumberEnum("channelType",n,ne).fail(x.INVALID_PARAMETER_CHANNEL_TYPE).result().tryTrans(this.validateLogin).next((function(){return o(s,void 0,void 0,(function(){return a(this,(function(t){return this._ugSynced?[2,this._engine.chat.getUltraGroupList(e)]:[2,vn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_UG_LIST_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLOCKED_UG_LIST_T,"",e),[4,Rn.create("getBlockedUGList").result().tryTrans(this.validateConnected).next((function(){return o(n,void 0,void 0,(function(){return a(this,(function(e){return this._ugSynced?[2,this._engine.chat.getBlockedUGList()]:[2,vn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_BLOCKED_UG_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_UNREAD_COUNT_T,JSON.stringify(e),t),[4,Rn.create("clearUnreadCount").check((function(t){return lc(t,e,X)})).result().tryTrans((function(){return r.checkAuthed(e.conversationType!==F.ULTRA_GROUP)})).next((function(){return o(r,void 0,void 0,(function(){var t;return a(this,(function(n){return e.conversationType!==F.ULTRA_GROUP||this._ugSynced?(t=c(this,ub,"m",db).call(this,e),[2,this._engine.chat.clearConversationUnreadCount(t)]):[2,vn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_CLEAR_UNREAD_COUNT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_ALL_UNREAD_COUNT_T,null,e),[4,Rn.create("clearAllUnreadCount").result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.chat.clearAllSGUnreadCount()]}))}))}))];case 1:return t=r.sent(),this.logger.summary(B.A_CLEAR_ALL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_COUNT_T,JSON.stringify(e),t),[4,Rn.create("getUnreadCount").check((function(t){return lc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return o(r,void 0,void 0,(function(){var t;return a(this,(function(n){return e.conversationType!==F.ULTRA_GROUP||this._ugSynced?(t=c(this,ub,"m",db).call(this,e),[2,this._engine.chat.getConversationUnreadCount(t)]):[2,vn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UNREAD_COUNT_R,n,t,void 0,(function(e){return{unreadCount:e}})),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_TOTAL_UNREAD_COUNT_T,JSON.stringify({conversationTypes:e,includeMuted:t,channelId:n}),r),[4,Rn.create("getTotalUnreadCount").validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",e,(function(e){return te(e,X)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin).next((function(r){return o(s,void 0,void 0,(function(){var i,o;return a(this,(function(a){return!(i=Qp(r))&&e&&e.includes(F.ULTRA_GROUP)?[2,vn(x.METHOD_NOT_SUPPORT)]:(o=e&&e.length>0?e:ee(i?J:W)).includes(F.ULTRA_GROUP)&&!this._ugSynced?[2,vn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCount(o,!!t,n)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_TOTAL_UNREAD_COUNT_R,i,r,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T,JSON.stringify({conversationTypes:e,levels:t,isMentioned:n}),r),[4,Rn.create("getTotalUnreadCountByLevels").isLimitedTypedArray("conversationTypes",e,20,(function(e){return te(e,J)}),!0).fail(x.CONVERSATION_TYPE_NOT_SUPPORT).isTypedArray("levels",t,Lt,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(s,void 0,void 0,(function(){return a(this,(function(r){return e.includes(F.ULTRA_GROUP)&&!this._ugSynced?[2,vn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCountByLevels(e,t,n)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R,i,r,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FIRST_UNREAD_MEG_T,JSON.stringify(e),t),[4,Rn.create("getFirstUnreadMessage").check((function(t){return lc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(r,ub,"m",db).call(r,e);return r._engine.chat.getFirstUnreadMessage(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_FIRST_UNREAD_MSG_R,n,t,e),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,Rn.create("getFirstUnreadMessageDigest").check((function(t){return lc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(r,ub,"m",db).call(r,e);return r._engine.chat.getFirstUnreadMessageDigest(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_FIRST_UNREAD_MSG_DIGEST_R,n,t,e),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:t}),n),[4,Rn.create("batchSetConversationNotificationLevel").isLimitedTypedArray("conversations",e,20,(function(e){return!uc("batchSetConversationNotificationLevel",e,J).isFailed}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("notificationLevel",t,Re,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var n=e.map((function(e){return c(i,ub,"m",db).call(i,e)}));return i._engine.chat.batchSetConversationNotificationLevel(n,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return i=Rn.create("batchSetConversationToTop"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return uc("batchSetConversationToTop",e,J).result().isOk}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==F.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?Tn():vn(x.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(s=this.logger.createTraceId(),u=e.map((function(e){return c(d,ub,"m",db).call(d,e)})),this.logger.info(B.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:u,isTop:t,isUpdateTime:n,isCreateConversation:r}),s),[4,this._engine.chat.batchSetConversationToTop(u,t,n,r)]):[2,o.wipe()];case 1:return l=a.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_TO_TOP_R,l,s),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return n=Rn.create("batchSetConversationTranslateStrategy"),(r=n.isLimitedTypedArray("conversations",e,20,(function(e){return uc("",e,J).result().isOk}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("strategy",t,Lr,!0).fail(x.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),this.logger.info(B.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:t}),i),o=e.map((function(e){return c(u,ub,"m",db).call(u,e)})),[4,this._engine.chat.batchSetConversationTranslateStrategy(o,t)]):[2,r.wipe()];case 1:return s=a.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return[4,uc("saveTextMessageDraft",e,X).isString("draft",t,!0).fail(x.INVALID_PARAMETER_DRAFT).result().tryTrans(this.validateLogin).next((function(){var r=c(n,ub,"m",db).call(n,e);return n._engine.saveTextMessageDraft(r,t)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return a(this,(function(n){switch(n.label){case 0:return[4,uc("getTextMessageDraft",e,X).result().tryTrans(this.validateLogin).next((function(){var n=c(t,ub,"m",db).call(t,e);return t._engine.getTextMessageDraft(n)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return a(this,(function(n){switch(n.label){case 0:return[4,uc("clearTextMessageDraft",e,X).result().tryTrans(this.validateLogin).next((function(){var n=c(t,ub,"m",db).call(t,e);return t._engine.clearTextMessageDraft(n)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"recallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),r={conversation:e,messageUId:null==t?void 0:t.messageUId},this.logger.info(B.A_RECALL_MESSAGE_T,JSON.stringify(r),n),[4,Rn.create("recallMessage").check((function(t){return lc(t,e,Q)})).isNotEmptyString("messageUId",t.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(x.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(x.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(x.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,Ut,!1,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){var n=c(o,ub,"m",db).call(o,e);return o._engine.recallMsg(n,t)}))];case 1:return i=a.sent(),this.logger.summary(B.A_RECALL_MESSAGE_R,i,n,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_DEL_REMOTE_MSGS_T,JSON.stringify({conversation:e,messages:t}),n),[4,Rn.create("deleteRemoteMessage").check((function(t){return lc(t,e,J)})).isLimitedTypedArray("messages",t,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,n=e.sentTime,r=e.messageDirection;return mt(t)&&(r===be.SEND||r===be.RECEIVE)&&vt({min:0})(n)}),!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var n=c(i,ub,"m",db).call(i,e);return i._engine.chat.deleteRemoteMessage(n,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_DEL_REMOTE_MSGS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_DEL_REMOTE_MSGS_T,JSON.stringify({identifier:e,timestamp:t}),n),[4,Rn.create("deleteRemoteMessageByTimestamp").check((function(t){return lc(t,e,Q)})).isInteger("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var n=c(i,ub,"m",db).call(i,e);return i._engine.chat.deleteRemoteMessageByTimestamp(n,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_DEL_REMOTE_MSGS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var u=this;return a(this,(function(l){return[2,Rn.create("getFileToken").isNumberEnum("fileType",e,q,!0).fail(x.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(x.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).validate("httpMethod",n,(function(e){return"POST"===e||"PUT"===e})).fail(x.BIZ_ERROR_INVALID_PARAMETER,"`httpMethod` is invalid").isString("queryString",r).fail(x.BIZ_ERROR_INVALID_PARAMETER,"`queryString` is invalid").isString("url",i).fail(x.BIZ_ERROR_INVALID_PARAMETER,"`url` is invalid").isInteger("size",s).fail(x.BIZ_ERROR_INVALID_PARAMETER,"`size` is invalid").result().tryTrans(this.validateConnected).next((function(l){return o(u,void 0,void 0,(function(){var o,u;return a(this,(function(a){switch(a.label){case 0:return o=l.uploadServer||"",u=l.ossConfig||"",[4,this._engine.getFileToken(e,t,n,r,i,s)];case 1:return[2,a.sent().trans((function(e){return Object.assign(e,{qiniu:o,ossConfig:e.ossConfig||u})}))]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var o=this;return a(this,(function(a){switch(a.label){case 0:return[4,Rn.create("getFileUrl").isNumberEnum("fileType",e,q,!0).fail(x.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(x.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).isString("saveName",i).fail(x.INVALID_PARAMETER_SAVE_NAME).isNumberEnum("serverType",r,n,!0).fail(x.INVALID_PARAMETER_SERVER_TYPE).result().tryTrans(this.validateConnected).next((function(){return o._engine.getFileUrl(e,r,t,i||"")}))];case 1:return[2,a.sent()]}}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,Rn.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(x.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return r._engine.createTag(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_ADD_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t),[4,Rn.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((function(){return r._engine.removeTag(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_REMOVE_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,Rn.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(x.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return r._engine.updateTag(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_UPDATE_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_TAGS_T,"",e),[4,this.validateLogin().next((function(){return n._engine.getTagList()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_TAGS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return(n=Rn.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",t,(function(e){return uc("",e,W).result().isOk}),!0).fail(x.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==t?void 0:t.length,1,1e3,!0).fail(x.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(r=t.map((function(e){return c(s,ub,"m",db).call(s,e)})),i=this.logger.createTraceId(),this.logger.info(B.A_ADD_TAG_FOR_CONVERSATIONS_T,JSON.stringify({tagId:e,conversations:r}),i),[4,this._engine.chat.addTagForConversations(e,r)]):[2,n.wipe()];case 1:return o=a.sent(),this.logger.summary(B.A_ADD_TAG_FOR_CONVERSATIONS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return(n=Rn.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",t,1e3,(function(e){return uc("",e,W).result().isOk}),!0).fail(x.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected)).isOk?(r=t.map((function(e){return c(s,ub,"m",db).call(s,e)})),i=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_TAG_FOR_CONVERS_T,JSON.stringify({tagId:e,conversations:r}),i),[4,this._engine.chat.removeTagForConversations(e,r)]):[2,n.wipe()];case 1:return o=a.sent(),this.logger.summary(B.A_REMOVE_TAG_FOR_CONVERS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return(n=uc("removeTagsForConversation",e,W).isTypedArray("tagIds",t,(function(e){return Et(e)}),!0).fail(x.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected)).isOk?(r=this.logger.createTraceId(),i=c(this,ub,"m",db).call(this,e),this.logger.info(B.A_REMOVE_TAGS_FOR_CONVER_T,JSON.stringify({tagIds:t,conversation:i}),r),[4,this._engine.chat.removeTagsForConversation(i,t)]):[2,n.wipe()];case 1:return o=a.sent(),this.logger.summary(B.A_REMOVE_TAGS_FOR_CONVER_R,o,r),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){return(r=Rn.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isInteger("count",n,!0).fail(x.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",t,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_START_TIME).result().tryTrans((function(){return o.checkAuthed(Vt())}))).isOk?(i=n<=0?20:Math.min(n,1e3),[2,this._engine.chat.getConversationListByTag(e,t,i)]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:t}),n),[4,Rn.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",t,!0).fail(x.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.getUnreadCountByTag(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_UNREAD_COUNT_BY_TAG_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return(r=uc("setConversationStatusInTag",t,W).isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==n?void 0:n.isTop,!0).fail(x.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),o=c(this,ub,"m",db).call(this,t),this.logger.info(B.A_SET_CONVER_TO_TOP_IN_TAG_T,JSON.stringify({tagId:e,conversation:o,isTop:n.isTop}),i),[4,this._engine.chat.setConversationStatusInTag(e,o,n)]):[2,r.wipe()];case 1:return s=a.sent(),this.logger.summary(B.A_SET_CONVER_TO_TOP_IN_TAG_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return(t=uc("getTagsForConversation",e,W).result().tryTrans(this.validateLogin)).isOk?(n=this.logger.createTraceId(),r=c(this,ub,"m",db).call(this,e),this.logger.info(B.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(r),n),[4,this._engine.chat.getTagsForConversation(r)]):[2,t.wipe()];case 1:return i=o.sent(),this.logger.summary(B.A_GET_TAGS_OF_CONVERSATION_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTIONED_COUNT_T,JSON.stringify(e),t),[4,Rn.create("getUnreadMentionedCount").check((function(t){return lc(t,e,Z)})).result().tryTrans(this.validateLogin).next((function(){return o(r,void 0,void 0,(function(){var t;return a(this,(function(n){return e.conversationType!==F.ULTRA_GROUP||this._ugSynced?(t=c(this,ub,"m",db).call(this,e),[2,this._engine.chat.getUnreadMentionedCount(t)]):[2,vn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UNREAD_MENTIONED_COUNT_R,n,t),[2,n.trans(Uc)]}}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_ALL_UNREAD_MENTIONED_COUNT_T,"",e),[4,this.validateLogin().next((function(){return n._engine.chat.getAllUnreadMentionedCount()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_ALL_UNREAD_MENTIONED_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),r=t instanceof Array?t.map((function(e){return null==e?void 0:e.messageUId})):[],i=null==e?void 0:e.conversationType,o=null==e?void 0:e.targetId,s=null==e?void 0:e.channelId,this.logger.info(B.A_GET_UG_MSGS_BY_UID_T,JSON.stringify({conversationType:i,targetId:o,channelId:s,messageUIds:r}),n),[4,Rn.create("getUltraGroupMessageListByMessageUId").check((function(t){return lc(t,e,J)})).isTypedArray("messages",t,(function(e){return mt(null==e?void 0:e.messageUId)}),!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messages",null==t?void 0:t.length,1,20,!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var n=c(l,ub,"m",db).call(l,e);return l._engine.chat.getRemoteMessagesByUIds(n,t.map((function(e){return e.messageUId})))}))];case 1:return u=a.sent(),this.logger.summary(B.A_GET_UG_MSGS_BY_UID_R,u,n,u.isOk?{list:u.data.map((function(e){return e.messageUId}))}:void 0),[2,u.trans((function(e){var t={};return e.forEach((function(e){t[e.messageUId]=e})),t}))]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T,JSON.stringify({targetId:e,levels:n,isGetMentioned:t}),r),[4,Rn.create("getUGUnreadCountForAllChannels").validate("targetId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).check((function(e){e.isTypedArray("levels",n,(function(t){return!e.isNumberEnum("",t,Re,!0).isFailed}))})).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(s,void 0,void 0,(function(){return a(this,(function(r){return this._ugSynced?[2,this._engine.chat.getUGUnreadCountForAllChannels(e,n||[],t)]:[2,vn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return t=null==e?void 0:e.targetId,n=null==e?void 0:e.channelId,r=null==e?void 0:e.sentTime,i=null==e?void 0:e.count,o=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_MENTIONED_DIGEST_T,JSON.stringify({targetId:t,channelId:n,sentTime:r,count:i}),o),[4,Rn.create("getUGUnreadMentionedDigest").validate("targetId",t,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isLimitedInteger("count",i,1,50,!0).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("sentTime",r,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return e.channelId=u._channelIdConvert(F.ULTRA_GROUP,n),u._engine.chat.getUGUnreadMentionedDigest(e)}))];case 1:return s=a.sent(),this.logger.summary(B.A_GET_UG_UNREAD_MENTIONED_DIGEST_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i=this;return a(this,(function(s){switch(s.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,Rn.create("getUGFirstUnreadMessageDigest").validate("targetId",null==e?void 0:e.targetId,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==e?void 0:e.channelId,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){return o(i,void 0,void 0,(function(){var t;return a(this,(function(n){return this._ugSynced?(t=c(this,ub,"m",db).call(this,r(r({},e),{conversationType:F.ULTRA_GROUP})),[2,this._engine.chat.getUGFirstUnreadMessageDigest(t)]):[2,vn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return n=s.sent(),this.logger.summary(B.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_INFO_LIST_T,JSON.stringify({targetIds:e}),t),[4,Rn.create("getUGUnreadInfoList").isLimitedTypedArray("targetIds",e,20,(function(e){return Ut(e)}),!0,1).fail(x.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateLogin).next((function(){return o(r,void 0,void 0,(function(){var t;return a(this,(function(n){return this._ugSynced?(t=new Set(e),[2,this._engine.chat.getUGUnreadInfoList(Array.from(t))]):[2,vn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UG_UNREAD_INFO_LIST_R,n,t),[2,n]}}))}))}}),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,n){var r=this;return this.validateConnected().next((function(){return r._engine.setCallInfo(e,t,n)}))}}),Object.defineProperty(e.prototype,"_validateSubDriven",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=e.subDriven,r=void 0===n?0:n;switch(t){case _e.ONLINE_STATUS:return 1&r?Tn(e):vn(x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);case _e.USER_PROFILE:return 2&r?Tn(e):vn(x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);default:return vn(x.INVALID_PARAMETER_SUBSCRIBE_TYPE)}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t,expiry:n}),r),[4,Rn.create("subscribeUser").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,_e,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("expiry",n,60,2592e3,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_EXPIRY).result().tryTrans(this.validateConnected).tryTrans((function(e){return o._validateSubDriven(e,t)})).next((function(){return o._engine.subscribeUser(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SUBSCRIBE_USER_STATUS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_UNSUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t}),n),[4,Rn.create("unSubscribeUser").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,_e,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_TYPE).result().tryTrans(this.validateConnected).tryTrans((function(e){return i._validateSubDriven(e,t)})).next((function(){return i._engine.unSubscribeUser(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_UNSUBSCRIBE_USER_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_SUBSCRIBE_USER_STATUS_LIST_T,JSON.stringify({subscribeType:e,count:t,offset:n}),r),[4,Rn.create("getSubscribeUserList").isNumberEnum("subscribeType",e,_e,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("count",t,1,200,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE).isLimitedInteger("offset",n,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_OFFSET).result().tryTrans(this.validateConnected).tryTrans((function(t){return o._validateSubDriven(t,e)})).next((function(){return o._engine.getSubscribeUserList(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_SUBSCRIBE_USER_STATUS_LIST_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_SUB_USERS_STATUS_T,JSON.stringify({subscribeType:e,userIds:t}),n),[4,Rn.create("getSubscribeUserStatus").isNumberEnum("subscribeType",e,_e,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedTypedArray("userIds",t,200,Ut,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).result().tryTrans(this.validateConnected).tryTrans((function(t){return i._validateSubDriven(t,e)})).next((function(){return i._engine.getSubscribeUserStatus(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_SUB_USERS_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_SUB_USERS_ONLINE_STATUS_T,JSON.stringify({userIds:e}),t),[4,Rn.create("getSubscribeUsersOnlineStatus").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){return r._engine.getSubscribeUsersOnlineStatus(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_SUB_USERS_ONLINE_STATUS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MY_USER_PROFILE_T,JSON.stringify({profile:e}),t),[4,Rn.create("updateMyUserProfile").isObject("profile",e,!0).check((function(t){var n=e.name,r=e.portraitUri,i=e.email,o=e.birthday,a=e.gender,s=e.location,l=e.role,c=e.level,d=e.extraProfile;t.isString("name",n).isString("portraitUri",r).isString("email",i).isString("birthday",o).isNumber("gender",a).isString("location",s).isNumber("role",l).isNumber("level",c).isObject("extraProfile",d),!t.isFailed&&d&&Object.entries(d).forEach((function(e){var n=u(e,2);n[0];var r=n[1];t.isString("extraProfile",r,!0)}))})).fail(x.INVALID_PARAMETER_USER_PROFILE).result().tryTrans(this.validateConnected).tryTrans((function(e){return i._validateUserProfile(e)})).next((function(){var t={};return["name","portraitUri","email","birthday","gender","location","role","level"].forEach((function(n){var r=e[n];void 0!==r&&(t[n]=r)})),e.extraProfile&&(t.extraProfile=r({},e.extraProfile)),i._engine.updateMyUserProfile(t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_UPDATE_MY_USER_PROFILE_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_USER_PROFILES_T,JSON.stringify({userIds:e}),t),[4,Rn.create("getUserProfiles").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateLogin).tryTrans((function(e){return r._validateUserProfile(e)})).next((function(){return r._engine.getUserProfiles(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_USER_PROFILES_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_MY_USER_PROFILE_T,void 0,e),[4,Rn.create("getMyUserProfile").result().tryTrans(this.validateConnected).tryTrans((function(e){return n._validateUserProfile(e)})).next((function(){return n._engine.getMyUserProfile()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_MY_USER_PROFILE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.chat.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){n.logger.error(B.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(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ADD_TO_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,Rn.create("addToBlacklist").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return r._engine.addToBlacklist(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_ADD_TO_BLACKLIST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_FROM_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,Rn.create("removeFromBlacklist").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return r._engine.removeFromBlacklist(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_REMOVE_FROM_BLACKLIST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLACKLIST_T,void 0,e),[4,Rn.create("getBlacklist").result().tryTrans(this.validateConnected).next((function(){return n._engine.getBlacklist()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_BLACKLIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_BLACKLIST_STATUS_T,JSON.stringify({userId:e}),t),[4,Rn.create("getBlacklistStatus").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return r._engine.getBlacklistStatus(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_BLACKLIST_STATUS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_INSERT_MSG_T,JSON.stringify({conversation:e,params:t}),n),[4,Rn.create("insertMessage").check((function(t){return lc(t,e,X)})).validate("senderUserId",t.senderUserId,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isNotEmptyString("messageType",t.messageType,!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t.content,!0).fail(x.INVALID_PARAMETER_MESSAGE_CONTENT).isNumberEnum("messageDirection",t.messageDirection,be,!0).fail(x.INVALID_MESSAGE_DIRECTION).check((function(e){t.canIncludeExpansion&&t.expansion&&dc(e,t.expansion,!0)})).isTimestamp("sentTime",t.sentTime).fail(x.INVALID_PARAMETER_TIMESTAMP).isNumberEnum("sentStatus",t.sentStatus,ue).fail(x.INVALID_PARAMETER_SENT_STATUS).isTypedArray("directedUserIds",t.directedUserIds,Ut).fail(x.INVALID_PARAMETER_USERIDLIST).isString("searchContent",t.searchContent).fail(x.SEARCH_PROPS_LIMIT_ERROR).result().tryTrans((function(){return sc(t.messageType,t.content)})).tryTrans(this.validateLogin).next((function(){var n=c(i,ub,"m",db).call(i,e);return i._engine.insertMessage(n,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_INSERT_MSG_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_BATCH_INSERT_MSGS_T,JSON.stringify({count:null==e?void 0:e.length,checkDuplicate:t}),n),i=Rn.create(""),[4,Rn.create("batchInsertMessage").isLimitedTypedArray("messages",e,500,(function(e){return"object"==typeof e&&(lc(i,e,X),i.validate("senderUserId",e.senderUserId,Ut,!0).isNotEmptyString("messageType",e.messageType,!0).isObject("content",e.content,!0).isNumberEnum("messageDirection",e.messageDirection,be,!0).check((function(t){e.canIncludeExpansion&&e.expansion&&dc(t,e.expansion,!0)})).isTimestamp("sentTime",e.sentTime).isNumberEnum("sentStatus",e.sentStatus,ue).isString("searchContent",e.searchContent).isNumber("receivedStatus",e.receivedStatus).isObject("receivedStatusInfo",e.receivedStatusInfo).isTypedArray("directedUserIds",e.directedUserIds,Ut),!i.isFailed)}),!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateLogin).next((function(){var n=e.map((function(e){return r(r({},e),{channelId:s._channelIdConvert(e.conversationType,e.channelId)})}));return s._engine.batchInsertMessage(n,t)}))];case 1:return o=a.sent(),this.logger.summary(B.A_BATCH_INSERT_MSGS_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_LOCAL_MSG_COUNT_T,JSON.stringify({conversation:e}),t),[4,Rn.create("getMessageCount").check((function(t){return lc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(r,ub,"m",db).call(r,e);return r._engine.getLocalMessageCount(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_LOCAL_MSG_COUNT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_DELETE_LOCAL_MSGS_T,JSON.stringify({messageIds:e}),t),[4,Rn.create("deleteLocalMessages").isTypedArray("messageIds",e,(function(e){return Number.isInteger(e)}),!0).fail(x.INVALID_PARAMETER_MESSAGE_ARRAY).result().tryTrans(this.validateLogin).next((function(){return r._engine.deleteLocalMessages(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_DELETE_LOCAL_MSGS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DEL_LOCAL_MSGS_BY_TIME_T,JSON.stringify({conversation:e,timestamp:t,cleanSpace:n}),r),[4,Rn.create("deleteLocalMessagesByTimestamp").check((function(t){return lc(t,e,X)})).isTimestamp("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){var r=c(o,ub,"m",db).call(o,e);return o._engine.deleteLocalMessagesByTimestamp(r,t,!!n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_DEL_LOCAL_MSGS_BY_TIME_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T,JSON.stringify({options:e}),t),[4,Rn.create("batchClearLocalMessagesByTimestamp").check((function(t){t.isLimitedTypedArray("options",e,20,(function(e){return lc(t,e,J),!t.isFailed&&vt({min:0})(e.timestamp)})).fail(x.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return r(r({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)})}));return i._engine.batchClearLocalMessagesByTimestamp(t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),n),[4,Rn.create("batchClearRemoteHistoryMessages").isLimitedArray("options",e,20,!0,1).check((function(t){e.forEach((function(e){lc(t,e,J).isTimestamp("timestamp",null==e?void 0:e.timestamp)}))})).fail(x.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,void 0,!0).check((function(t){e.some((function(e){return e.conversationType===F.ULTRA_GROUP}))&&t.setFailed(x.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.batchClearRemoteHistoryMessages(e,!!t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_BATCH_CLEAR_REMOTE_MSG_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_LOCAL_MSG_T,JSON.stringify({conversation:e}),t),[4,Rn.create("clearLocalMessages").check((function(t){return lc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return r._engine.clearLocalMessages(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_CLEAR_LOCAL_MSG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),t),[4,Rn.create("getLocalMessage").validate("messageId",e,(function(){return mt(e)||Tt(e)}),!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).result().next((function(){return r._engine.getMessage(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_LOCAL_MESSAGE_R,n,t,{messageId:e}),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"_innerSetMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.setMessageContent(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_MSG_CONTENT_T,JSON.stringify({messageId:e,messageType:n}),r),[4,Rn.create("setMessageContent").isInteger("messageId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).isNotEmptyString("messageType",n,!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_CONTENT).result().tryTrans(this.validateLogin).next((function(){var r=JSON.stringify(t);return o._innerSetMessageContent(e,r,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_MSG_CONTENT_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.setMessageSearchField(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_E_SET_MSG_SENT_STATUS_T,JSON.stringify({messageId:e,sentStatus:t}),n),[4,Rn.create("setMessageSentStatus").isInteger("messageId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).isNumberEnum("sentStatus",t,ue,!0).fail(x.INVALID_PARAMETER_SENT_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageSentStatus(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_E_SET_MSG_SENT_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_E_SET_MSG_RECEIVED_STATUS_T,JSON.stringify({messageId:e,receivedStatus:t}),n),[4,Rn.create("setMessageReceivedStatus").isInteger("messageId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).isInteger("receivedStatus",t,!0).fail(x.INVALID_PARAMETER_RECEIVED_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageReceivedStatus(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_E_SET_MSG_RECEIVED_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setMessageStatusToRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(n=uc("setMessageStatusToRead",e,W).isNumber("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(r=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,s=e.channelId,this.logger.info(B.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),r),[4,this._engine.updateMessageReceiptStatus(i,o,t,s)]):[2,n.wipe()];case 1:return u=a.sent(),this.logger.summary(B.A_E_SET_MESSAGE_STATUS_TO_READ_R,u,r),[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 a(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 a(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 a(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return(i=Rn.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(x.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return mt(e)})).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",r,(function(e){return te(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(B.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:t,channelId:n,conversationTypes:r}),o),[4,this._engine.chat.searchConversationByContent(e,t&&0!==t.length?t:[me.TEXT,me.FILE],n||"",r&&0!==r.length?r:ee(J))]):[2,i.wipe()];case 1:return s=a.sent(),this.logger.summary(B.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[me.TEXT,me.FILE],n&&0!==n.length?n:ee(J))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,i;return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return(o=uc("searchMessages",e,X).isLimitedString("keyword",null==t?void 0:t.keyword,0,1e3,!0).fail(x.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==t?void 0:t.limit,1,dt,!0).fail(x.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==t?void 0:t.offset,0,dt).fail(x.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==t?void 0:t.order,0,1,!0).fail(x.INVALID_PARAMETER_ORDER).isObject("timeRange",t.timeRange).validate("timeRange",t.timeRange,(function(e){var t=e.startTime,n=e.endTime;return!t&&!n||!(t&&!Tt(t)||n&&!Tt(n))&&(t=null!=t?t:0,n=null!=n?n:Date.now(),t>=0&&t<=n)})).fail(x.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(n=null==t?void 0:t.messageFilter)||void 0===n?void 0:n.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(x.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(i=null==t?void 0:t.messageFilter)||void 0===i?void 0:i.senderIds,Ut).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans((function(){return Vt()?Tn():vn(x.NOT_SUPPORT,"Only support electron platform.")})).tryTrans(this.validateLogin)).isOk?(s=c(this,ub,"m",db).call(this,e),[4,c(this,ub,"m",gb).call(this,r(r({},t),{conversationFilter:{conversationTypes:[s.conversationType],targetIds:[s.targetId],channelIds:"string"==typeof s.channelId?[s.channelId]:[]}}))]):[2,o.wipe()];case 1:return[2,a.sent().orSync((function(){return Tn({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r,i,s,u;return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){return(o=Rn.create("searchMessagesWithParams").isObject("params",e,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(x.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,dt,!0).fail(x.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,dt).fail(x.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(x.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,n=e.endTime;return!t&&!n||!(t&&!Tt(t)||n&&!Tt(n))&&(t=null!=t?t:0,n=null!=n?n:Date.now(),t>=0&&t<=n)})).fail(x.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(t=null==e?void 0:e.conversationFilter)||void 0===t?void 0:t.conversationTypes,(function(e){return te(e,X)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.targetIds,20,Ut,!1,0).fail(x.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.channelIds,10,wt,!1,0).fail(x.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(i=null==e?void 0:e.messageFilter)||void 0===i?void 0:i.senderIds,20,Ut,!1,0).fail(x.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(s=null==e?void 0:e.messageFilter)||void 0===s?void 0:s.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(x.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin)).isOk?(e.limit=Math.min(e.limit,100),(null===(u=e.messageFilter)||void 0===u?void 0:u.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),[2,c(this,ub,"m",gb).call(this,e)]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_GET_MSGS_AROUND_TIMESTAMP_T,JSON.stringify({conversation:e,timestamp:t,beforeCount:n,afterCount:r}),i),[4,Rn.create("getMessagesAroundTimestamp").check((function(t){return lc(t,e,X)})).isLimitedInteger("timestamp",t,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("beforeCount",n,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_BEFORE).isLimitedInteger("afterCount",r,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_AFTER).result().tryTrans(this.validateLogin).next((function(){var i=c(s,ub,"m",db).call(s,e);return s._engine.chat.getMessagesAroundTimestamp(i,t,n,r)}))];case 1:return o=a.sent(),this.logger.summary(B.A_GET_MSGS_AROUND_TIMESTAMP_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTIONED_MSGS_T,JSON.stringify(e),t),[4,Rn.create("getUnreadMentionedMessages").check((function(t){return lc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(r,ub,"m",db).call(r,e);return r._engine.chat.getUnreadMentionedMessages(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UNREAD_MENTIONED_MSGS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,channelId:t}),n),[4,Rn.create("getUltraGroupDefaultNotificationLevel").validate("targetId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",t,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){var n="string"==typeof t?i._channelIdConvert(F.ULTRA_GROUP,t):t;return i._engine.chat.getUGDefaultNotificationLevel(e,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_UG_DEFAULT_NTF_LEVEL_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,notificationLevel:t,channelId:n}),r),[4,Rn.create("setUltraGroupDefaultNotificationLevel").validate("targetId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isNumberEnum("notificationLevel",t,Re,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var r="string"==typeof n?o._channelIdConvert(F.ULTRA_GROUP,n):n;return o._engine.chat.setUGDefaultNotificationLevel(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_UG_DEFAULT_NTF_LEVEL_R,i,r),[2,i]}}))}))}}),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 a(this,(function(n){return(t=uc("getConversationNotificationLevel",e,J).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(c(this,ub,"m",db).call(this,e))]:[2,t.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 n;return a(this,(function(r){return(n=Rn.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return te(e,J)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE).isNumberEnum("level",t,Re,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.setConversationTypeNotificationLevel(e,t)]:[2,n.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 a(this,(function(n){return(t=Rn.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return te(e,J)}),!0).fail(x.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){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return n=null==t?void 0:t.timestamp,r=null==t?void 0:t.count,i=null==t?void 0:t.order,o=this.logger.createTraceId(),this.logger.info(B.A_GET_REMOTE_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),o),[4,Rn.create("getRemoteHistoryMessages").check((function(t){return lc(t,e,Q)})).isLimitedInteger("timestamp",n,0,Number.MAX_SAFE_INTEGER).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(x.INVALID_PARAMETER_ORDER).isLimitedInteger("count",r,1,100).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:n||0,count:r||20,order:i||0,messageType:""},o=c(u,ub,"m",db).call(u,e);return u._engine.getHistoryMessage(o,t,!1)}))];case 1:return s=a.sent(),this.logger.summary(B.A_GET_REMOTE_HISTORY_MSG_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(B.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 o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATIONS_T,JSON.stringify({identifiers:e}),t),[4,Rn.create("getConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,100,(function(e){return!lc(t,e,X).isFailed}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return c(r,ub,"m",db).call(r,e)}));return r._engine.chat.getConversations(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_CONVERSATIONS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckDuplicateMessage(!!e)}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i=this;return a(this,(function(o){switch(o.label){case 0:return[4,this.validateConnected().next((function(){return i._engine.rtcSignaling(e,t,n,r)}))];case 1:return[2,o.sent()]}}))}))}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.rtcPing(e,t,n)}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_PROXY_T,JSON.stringify({proxy:e}),t),[4,Rn.create("setProxy").check((function(t){return _c(t,e)})).result().next((function(){return r._engine.setProxy(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SET_PROXY_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_PROXY_T,JSON.stringify({}),e),[4,this._engine.getProxy()];case 1:return t=n.sent(),this.logger.summary(B.A_GET_PROXY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_TEST_PROXY_T,JSON.stringify({proxy:e,testHost:t}),n),[4,Rn.create("testProxy").check((function(t){return _c(t,e)})).isString("testHost",t,!0).fail(x.INVALID_PARAMETER_TESTHOST).result().next((function(){return i._engine.testProxy(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_TEST_PROXY_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_REALTIME_CONVERSATIONS_T,JSON.stringify({count:e,startTime:t,order:n}),r),[4,Rn.create("getRealtimeConversations").isLimitedInteger("count",e,1,50,!0).fail(x.INVALID_PARAMETER_COUNT).isTimestamp("startTime",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",n,0,1,!0).fail(x.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).tryTrans(Mc).next((function(){return o._engine.chat.getRealtimeConversations(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_REALTIME_CONVERSATIONS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T,"",e),[4,this.validateConnected().tryTrans(Mc).next((function(){return n._engine.chat.getRealtimeConTotalUnreadCount()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,this.validateConnected().tryTrans(Mc).next((function(){return r._engine.chat.clearRealtimeConUnreadCount(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_CLEAR_REALTIME_CON_UNREAD_COUNT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_REALTIME_CONVERSATIONS_T,JSON.stringify(e),t),[4,Rn.create("removeRealtimeConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,20,(function(e){return!lc(t,e,X).isFailed}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Mc).next((function(){return r._engine.chat.removeRealtimeConversations(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_REMOVE_REALTIME_CONVERSATIONS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,Rn.create("batchGetRealtimeConUnreadCount").check((function(t){t.isLimitedTypedArray("identifiers",e,10,(function(e){return!lc(t,e,X).isFailed}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Mc).next((function(){return r._engine.chat.batchGetRealtimeConUnreadCount(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return Rn.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(x.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(x.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(x.INVALID_PARAMETER_SPAN_MINUTES).isNumberEnum("level",e.level,we,!0).fail(x.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 n;return a(this,(function(r){return(n=uc("sendReadReceiptResponseV5",e,K).isTypedArray("messageUIdArray",t,(function(e){return Ut(e)}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?Tn():vn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.sendReadReceiptResponseV5(e,t)]:[2,n.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 n,r;return a(this,(function(i){return(n=uc("getMessageReadReceiptInfoV5",e,K).isTypedArray("messageUIdArray",t,(function(e){return Ut(e)}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?Tn():vn(x.READ_RECEIPT_ERROR)}))).isOk?(r=t.map((function(t){return{identifier:e,messageUId:t}})),[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(r)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return t=Rn.create(""),(n=Rn.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(function(e){return lc(t,e.identifier,K).isNotEmptyString("messageUId",e.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().isOk}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?Tn():vn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(e)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=uc("getMessageReadReceiptInfoV5",e,K).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isObject("option",n,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",n.pageToken).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",n.pageCount,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?Tn():vn(x.READ_RECEIPT_ERROR)}))).isOk?(n.order=1!==n.order?0:1,n.readStatus=1!==n.readStatus?0:1,[2,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,t,n)]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=uc("getMessagesReadReceiptByUsersV5",e,K).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",n,(function(e){return Ut(e)}),!0).fail(x.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",n.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?Tn():vn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessagesReadReceiptByUsersV5(e,t,n)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:t}),n),[4,Rn.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((function(e){return!!(1&(e.AIBusinessSub||0))?Tn():vn(x.SPEECH_TO_TEXT_DISABLE)})).next((function(){return i._engine.chat.requestSpeechToTextForMessage(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return[4,Rn.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).result().tryTrans(this.validateLogin).next((function(){return n._engine.chat.setMessageSpeechToTextVisible(e,!!t)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:t,topPriority:n}),r),[4,Rn.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isInteger("count",t,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateLogin).next((function(){var r=t<=0?20:Math.min(t,100);return o._engine.chat.getUntaggedConversationListByPage(e,r,!!n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"translateMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=Vt(),[4,Rn.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof Nr&&e.isValid(!n)}),!0).fail(x.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(t=null==e?void 0:e.list)||void 0===t?void 0:t.length,1,10,!0).fail(x.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,Sr).fail(x.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(r=a.sent()).isOk?(i=e.list,o=e.force,s=e.mode,[2,c(this,ub,"m",pb).call(this,i,0,s,o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"translateTextsWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){switch(o.label){case 0:return[4,Rn.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof Cr&&e.isValid(!0)}),!0).fail(x.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(t=null==e?void 0:e.list)||void 0===t?void 0:t.length,1,10,!0).fail(x.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,Sr).fail(x.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(n=o.sent()).isOk?(r=e.list,i=e.mode,[2,c(this,ub,"m",pb).call(this,r,1,i)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t),[4,Rn.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((function(){return r._engine.userSettings.setTranslationLanguage(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SET_TRANSLATION_LANGUAGE_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_TRANSLATION_LANGUAGE_T,void 0,e),[4,this.validateLogin().next((function(){return n._engine.userSettings.getTranslationLanguage()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_TRANSLATION_LANGUAGE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_AUTO_TRANSLATE_ENABLED_T,JSON.stringify({enabled:!!e}),t),[4,this.validateConnected().next((function(){return r._engine.userSettings.setAutoTranslateEnabled(!!e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SET_AUTO_TRANSLATE_ENABLED_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_AUTO_TRANSLATE_ENABLED_T,void 0,e),[4,this.validateLogin().next((function(){return n._engine.userSettings.getAutoTranslateEnabled()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_AUTO_TRANSLATE_ENABLED_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),n=null==e?void 0:e.messageUId,r=null==e?void 0:e.messageContent,this.logger.info(B.A_MODIFY_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUId:n,conversation:null==e?void 0:e.conversation}),t),[4,Rn.create("modifyMessageWithParams").check((function(t){return lc(t,null==e?void 0:e.conversation,Z)})).isNotEmptyString("messageUId",n,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isObject("messageContent",r,!0).fail(x.INVALID_PARAMETER_MESSAGE_CONTENT).isLimitedInteger("messageContent",hc(JSON.stringify(r)),1,qe,!0).fail(x.RC_MSG_CONTENT_EXCEED_LIMIT).result().tryTrans(this.validateConnected).next((function(){return o._engine.chat.modifyMessageWithParams(e)}))];case 1:return i=a.sent(),this.logger.summary(B.A_MODIFY_MESSAGE_WITH_PARAMS_R,i,t),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),n=null==e?void 0:e.messageUIds,this.logger.info(B.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUIds:n}),t),[4,uc("refreshReferenceMessageWithParams",null==e?void 0:e.conversationIdentifier,Z).isObject("params",e,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER).isTypedArray("messageUIds",n,(function(e){return mt(e)}),!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==n?void 0:n.length,1,20,!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.refreshReferenceMessageWithParams(n,e.conversationIdentifier,e.remoteMessageBlock,e.localMessageBlock,e.messageInfoMap)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_SYNC_REMOTE_CONVERSATIONS_T,void 0,e),[4,this.validateConnected().next((function(){return n._engine.chat.syncRemoteConversations()}))];case 1:return t=r.sent(),this.logger.summary(B.A_SYNC_REMOTE_CONVERSATIONS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalUGMessagesForAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T,JSON.stringify({targetId:e,timestamp:t}),n),[4,Rn.create("deleteLocalUGMessagesForAllChannel").isNotEmptyString("targetId",e,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isTimestamp("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.deleteLocalUGMessagesForAllChannel(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T,JSON.stringify({params:e}),t),[4,Rn.create("getUnreadMentionMeConversationList").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,Number.MAX_SAFE_INTEGER,(function(e){return te(e,J)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(t){return o(r,void 0,void 0,(function(){var n;return a(this,(function(r){if(n=Qp(t)){if(!this._ugSynced)return[2,vn(x.METHOD_NOT_AVAILABLE)]}else if(e.conversationTypes=e.conversationTypes.filter((function(e){return e!==F.ULTRA_GROUP})),0===e.conversationTypes.length)return[2,Tn([])];return[2,this._engine.chat.getUnreadMentionMeConversationList(e,n)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_ALL_ROBOTS_T,void 0,e),[4,this.validateConnected().next((function(){return n._engine.getAllRobots()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_ALL_ROBOTS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getRobotById",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_ROBOT_BY_ID_T,JSON.stringify({id:e}),t),[4,Rn.create("getRobotById").validate("id",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return o(i,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.getAllRobots()]}))}))}))];case 1:return n=s.sent(),r=n.trans((function(t){return t.find((function(t){return t.robotId===e}))||null})),this.logger.summary(B.A_GET_ROBOT_BY_ID_R,n,t,{id:e,robot:r.data}),[2,r]}}))}))}}),e}();ub=new WeakSet,lb=function(e,t,n){var r,i;return o(this,void 0,void 0,(function(){var s,u,l=this;return a(this,(function(c){switch(c.label){case 0:return[4,Rn.create("connect").isNotEmptyString("token",e).fail(x.RC_CONN_TOKEN_INCORRECT).result().next((function(){return o(l,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return this._token=e,[4,ua.getNetworkType()];case 1:return r=o.sent(),this._engine.setNetwork({status:!0,type:r},!0),i=!!this._pluginInstanseMap.RCCallPlus,[2,this._engine.connect(e,t,i,n)]}}))}))}))];case 1:return(s=c.sent()).isOk&&1!==this._engine.naviInfo.type&&(u=ft.getInfo(),null===(i=(r=this._engine).reportSDKInfo)||void 0===i||i.call(r,u)),[2,s]}}))}))},cb=function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return r.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){n.logger.error(B.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},db=function(e){return r(r({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})},_b=function(e,t,n,r){return o(this,void 0,void 0,(function(){var i=this;return a(this,(function(o){switch(o.label){case 0:return[4,Rn.create("sendMessage").check((function(t){return lc(t,e,X)})).isObject("content",t.content,!0).fail(x.INVALID_PARAMETER_MESSAGE_CONTENT).isString("messageType",t.messageType,!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){var n=sc(t.messageType,t.content);n.isOk||e.setFailed(n.code)})).isNumber("messageId",t.messageId).fail(x.INVALID_PARAMETER_MESSAGE_ID).isBoolean("isStatusMessage",t.isStatusMessage).fail(x.INVALID_PARAMETER_IS_STATUS_MESSAGE).isBoolean("disableNotification",t.disableNotification).fail(x.INVALID_PARAMETER_DISABLE_NOTIFICATION).isString("pushContent",t.pushContent).fail(x.INVALID_PARAMETER_PUSH_CONTENT).isString("pushData",t.pushData).fail(x.INVALID_PARAMETER_PUSH_DATA).isObject("pushConfig",t.pushConfig).fail(x.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("isVoipPush",t.isVoipPush).fail(x.INVALID_PARAMETER_IS_VOIP_PUSH).isBoolean("canIncludeExpansion",t.canIncludeExpansion).fail(x.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION).check((function(e){t.canIncludeExpansion&&t.expansion&&dc(e,t.expansion,!0)})).check((function(n){n.isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(x.INVALID_DISABLE_UPDATE_LAST_MESSAGE),n.isFailed||e.conversationType===F.ULTRA_GROUP&&t.disableUpdateLastMessage&&n.setFailed(x.INVALID_DISABLE_UPDATE_LAST_MESSAGE)})).check((function(n){if(!n.isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,Ut,!1,0).fail(x.INVALID_PARAMETER_USERIDLIST).isFailed&&t.directionalUserIdList&&0!==t.directionalUserIdList.length){var r=e.conversationType;[F.GROUP,F.ULTRA_GROUP,F.APP_PUBLIC_SERVICE,F.PUBLIC_SERVICE].includes(r)||n.setFailed(x.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE)}})).isBoolean("isMentioned",t.isMentioned).fail(x.INVALID_PARAMETER_IS_MENTIONED).check((function(n){var r=e.conversationType;if(!t.isMentioned||r!==F.GROUP&&r!==F.ULTRA_GROUP)delete t.content.mentionedInfo;else{var i=t.content.mentionedInfo||{type:t.mentionedType,userIdList:t.mentionedUserIdList};!n.isNumberEnum("mentionedType",null==i?void 0:i.type,Y,!0).fail(x.INVALID_PARAMETER_MENTIONED_TYPE).isTypedArray("mentionedUserIdList",null==i?void 0:i.userIdList,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).isString("mentionedContent",null==i?void 0:i.mentionedContent).fail(x.INVALID_PARAMETER_MESSAGE_CONTENT).isFailed&&(t.content.mentionedInfo=i)}})).result().tryTrans(this.validateConnected).tryTrans((function(n){if(!t.needReceipt)return Tn(n);if(n.grpRRVer!==Fe.V5)return vn(x.READ_RECEIPT_ERROR);var r=e.conversationType,i=Rr(t.messageType),o=i.isPersited,a=i.isStatusMessage;return(r!==F.GROUP&&r!==F.PRIVATE||t.isStatusMessage||a||!o||r===F.GROUP&&t.directionalUserIdList&&t.directionalUserIdList.length>0)&&(t.needReceipt=!1),Tn(n)})).tryTrans((function(n){var r=e.conversationType,i=t.messageType;if(r===F.SYSTEM&&i!==me.SYNC_READ_STATUS)return vn(x.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE);if(i===me.STREAM_MESSAGE)return vn(x.MESSAGE_NOT_SUPPORT_SENDING);if(i===me.READ_RECEIPT_RESPONSE&&n.grpRRVer)return vn(x.READ_RECEIPT_ERROR);var o=JSON.stringify(t.content);return hc(o)>qe?vn(x.RC_MSG_CONTENT_EXCEED_LIMIT):Tn()})).next((function(){return c(i,ub,"m",fb).call(i,e,t,n,r)}))];case 1:return[2,o.sent()]}}))}))},fb=function(e,t,n,r){var i=c(this,ub,"m",db).call(this,e);return i.conversationType===F.ULTRA_GROUP?this._engine.sendUltraMessage(i,t,n,r):this._engine.sendMessage(i,t,n,r)},hb=function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._engine.sendMessage(e,{content:t,messageType:me.EXPANSION_NOTIFY},n)];case 1:return[2,r.sent().wipe()]}}))}))},gb=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.timeRange||{},n=t.startTime,r=t.endTime,i={startTime:null!=n?n:0,endTime:null!=r?r:Number.MAX_SAFE_INTEGER},e.timeRange=i,o=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return s=a.sent(),this.logger.summary(B.A_SEARCH_MSGS_BY_PARAMS_R,s,o),[2,s]}}))}))},pb=function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,this._engine.translateWithParams(e.map((function(e){return e.toInnerParam()})),n||Sr.MECHANICAL,!!r,t)]}))}))};export{Tb as APIContext,Ec as AppStorage,Bn as AreaCode,ec as AssertRules,Zl as BasicEngine,er as BasicLogger,U as ChatroomEntryType,G as ChatroomSyncStatusReason,V as ChatroomUserChangeType,j as ChrmMemBanType,k as ChrmMemOperateType,D as ChrmSyncStatus,Kl as Codec,vl as ConnectionStatus,F as ConversationType,_ as DirectionType,x as ErrorCode,Hl as EventEmitter,q as FileType,Ve as FilterRobotType,h as FriendAddPermission,E as FriendApplicationStatus,p as FriendApplicationType,g as FriendRelationType,M as GroupApplicationDirection,N as GroupApplicationStatus,w as GroupApplicationType,m as GroupInviteHandlePermission,v as GroupJoinPermission,I as GroupMemberInfoEditPermission,y as GroupMemberRole,A as GroupOperation,R as GroupOperationPermission,P as GroupOperationRole,C as GroupOperationStatus,O as GroupOperationType,Fe as GroupReadReceiptVersion,Ge as HttpMethod,Le as InterruptionLevel,ar as LogDBProxy,Jn as LogL,bl as LogLevel,Tl as LogSource,B as LogTagId,qe as MAX_MESSAGE_CONTENT_BYTES,dt as MAX_U32_INTEGER,We as MAX_UPLOAD_FILE_SIZE,Y as MentionedType,je as MessageAuditType,Ee as MessageBlockSourceType,pe as MessageBlockType,be as MessageDirection,me as MessageType,Re as NotificationLevel,Ie as NotificationStatus,ce as OnlineStatus,le as OperateStatus,El as PBCodec,de as Platform,tc as PluginContext,Te as PushImportanceHonor,we as PushNotificationQuietHoursLevel,f as QueryFriendsDirectionType,ge as RCConnectionStatus,bn as RCResult,yl as RTCApiType,Sl as RTCJoinType,Rl as RTCMode,nc as RTCPluginContext,ye as ReceivedStatus,qn as ReferenceMessageStatus,ue as SentStatus,ke as SpeechToTextStatus,Pl as StreamMessageResponseEventType,fe as SubscribeOperationType,_e as SubscribeType,En as SuspendablePromise,Nr as TranslateMessageParam,Sr as TranslateMode,Pr as TranslateStatus,Lr as TranslateStrategy,Cr as TranslateTextParam,Ke as UPLOAD_FILE_CHUNK_SIZE,ht as UUId,re as UltraGroupChannelChangeType,ne as UltraGroupChannelType,n as UploadMethod,he as UserProfileVisibility,Yn as UserSettingsChangedKey,xe as UserType,Rn as Validator,ft as VersionManage,oc as assert,sr as createLogDBProxy,vn as fail,cn as fixUrlProtocol,ql as forEach,Rr as getMessageTypeDescription,vc as getUUID,Rc as getUUID22,Ir as hasMessageTypeDescription,xn as httpRequest,Rt as isArray,bt as isBoolean,St as isFunction,Nt as isHttpUrl,vt as isInteger,It as isLimitedString,Wl as isNull,Tt as isNumber,At as isObject,Et as isString,Ot as isUndefined,Pt as isValidConversationType,Mt as isValidEnum,Gt as isValidFileType,Dt as isValidGroupId,Ut as isValidTargetId,Bl as logger,Yl as map,yt as notEmptyArray,Ct as notEmptyObject,mt as notEmptyString,Tn as ok,An as promiseWithResolvers,ua as runtime,jt as trans2IReceivedStatusInfo,Me as trans2NotificationLevel,Ue as trans2NotificationStatus,kt as transformReceivedStatusFlag,Vt as usingCppEngine,ac as validate};
|
|
15
|
+
var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n,r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function o(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function a(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function c(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function d(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!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"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}!function(e){e[e.QINIU=1]="QINIU",e[e.ALI=2]="ALI",e[e.AWS=3]="AWS",e[e.STC=4]="STC",e[e.MINIO=5]="MINIO"}(n||(n={}));var _,f,h,g,p,E,b,T,v,R,I,m,y,A,S,O,N,C,P,L,w,M,U,D,G,V,j,k,x,F,B={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",A_SEND_TYPING_STATUS_T:"A-send_typing_status-T",A_SEND_TYPING_STATUS_R:"A-send_typing_status-R",A_SEND_READ_RECEIPT_REQ_T:"A-send_read_receipt_req-T",A_SEND_READ_RECEIPT_REQ_R:"A-send_read_receipt_req-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_LOCAL_MSGS_T:"A-delete_local_msgs-T",A_DELETE_LOCAL_MSGS_R:"A-delete_local_msgs-R",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_REJOIN_CHATROOM_T:"L-rejoin_chatroom-T",L_REJOIN_CHATROOM_R:"L-rejoin_chatroom-R",A_QUIT_CHATROOM_T:"A-quit_chatroom-T",A_QUIT_CHATROOM_R:"A-quit_chatroom-R",A_GET_CHATROOM_INFO_T:"A-get_chatroom_info-T",A_GET_CHATROOM_INFO_R:"A-get_chatroom_info-R",A_SET_CHATROOM_ENTRY_T:"A-set_chatroom_entry-T",A_SET_CHATROOM_ENTRY_R:"A-set_chatroom_entry-R",A_SET_CHATROOM_ENTRIES_T:"A-set_chatroom_entries-T",A_SET_CHATROOM_ENTRIES_R:"A-set_chatroom_entries-R",A_REMOVE_CHATROOM_ENTRY_T:"A-remove_chatroom_entry-T",A_REMOVE_CHATROOM_ENTRY_R:"A-remove_chatroom_entry-R",A_REMOVE_CHATROOM_ENTRIES_T:"A-remove_chatroom_entries-T",A_REMOVE_CHATROOM_ENTRIES_R:"A-remove_chatroom_entries-R",A_GET_CHATROOM_ENTRY_T:"A-get_chatroom_entry-T",A_GET_CHATROOM_ENTRY_R:"A-get_chatroom_entry-R",A_GET_CHATROOM_ENTRIES_T:"A-get_chatroom_entries-T",A_GET_CHATROOM_ENTRIES_R:"A-get_chatroom_entries-R",A_BIND_RTC_FOR_CHATROOM_T:"A-bind_rtc_for_chatroom-T",A_BIND_RTC_FOR_CHATROOM_R:"A-bind_rtc_for_chatroom-R",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",A_GET_REMOTE_HISTORY_MSG_T:"A-get_remote_history_msg-T",A_GET_REMOTE_HISTORY_MSG_R:"A-get_remote_history_msg-R",L_CALLBACK_E:"L-callback-E",A_SEND_READ_RECEIPT_T:"A-send_read_receipt-T",A_SEND_READ_RECEIPT_R:"A-send_read_receipt-R",A_SEND_READ_RECEIPT_V2_T:"A-send_read_receipt_v2-T",A_SEND_READ_RECEIPT_V2_R:"A-send_read_receipt_v2-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_SEND_RMTP_E:"L-send-rmtp-E",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_REMOVE_PROXY_O:"A-remove_proxy-O",L_SET_PROXY_O:"L-set_proxy-O",L_TEST_PROXY_T:"L-test_proxy-T",L_TEST_PROXY_R:"L-test_proxy-R",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_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_convers_notification_level-T",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R:"A-batch_set_convers_notification_level-R",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T:"A-batch_set_convers_translate_strategy-T",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R:"A-batch_set_convers_translate_strategy-R",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_DEL_REMOTE_MSGS_T:"A-del_remote_msgs-T",A_DEL_REMOTE_MSGS_R:"A-del_remote_msgs-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",A_LOAD_CONVERSATION_LIST_T:"A-load_conversation_list-T",A_LOAD_CONVERSATION_LIST_R:"A-load_conversation_list-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",A_GET_CHATROOM_HISTORY_MESSAGES_T:"A-get_chatroom_history_messages-T",A_GET_CHATROOM_HISTORY_MESSAGES_R:"A-get_chatroom_history_messages-R",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T:"A-request_speech_to_text_for_message-T",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R:"A-request_speech_to_text_for_message-R",L_SYNC_USER_SETTINGS_T:"L-sync_user_settings-T",L_SYNC_USER_SETTINGS_R:"L-sync_user_settings-R",A_ADD_TAG_T:"A-add_tag-T",A_ADD_TAG_R:"A-add_tag-R",A_REMOVE_TAG_T:"A-remove_tag-T",A_REMOVE_TAG_R:"A-remove_tag-R",A_UPDATE_TAG_T:"A-update_tag-T",A_UPDATE_TAG_R:"A-update_tag-R",A_GET_TAGS_T:"A-get_tags-T",A_GET_TAGS_R:"A-get_tags-R",A_ADD_TAG_FOR_CONVERSATIONS_T:"A-add_tag_for_conversations-T",A_ADD_TAG_FOR_CONVERSATIONS_R:"A-add_tag_for_conversations-R",A_GET_TAGS_OF_CONVERSATION_T:"A-get_tags_of_conversation-T",A_GET_TAGS_OF_CONVERSATION_R:"A-get_tags_of_conversation-R",A_SET_CONVER_TO_TOP_IN_TAG_T:"A-set_conver_to_top_in_tag-T",A_SET_CONVER_TO_TOP_IN_TAG_R:"A-set_conver_to_top_in_tag-R",A_REMOVE_TAG_FOR_CONVERS_T:"A-remove_tag_for_conversations-T",A_REMOVE_TAG_FOR_CONVERS_R:"A-remove_tag_for_conversations-R",A_REMOVE_TAGS_FOR_CONVER_T:"A-remove_tags_for_conversation-T",A_REMOVE_TAGS_FOR_CONVER_R:"A-remove_tags_for_conversation-R",A_GET_UNREAD_COUNT_BY_TAG_T:"A-get_unread_count_by_tag-T",A_GET_UNREAD_COUNT_BY_TAG_R:"A-get_unread_count_by_tag-R",A_GET_UNREAD_COUNT_T:"A-get_unread_count-T",A_GET_UNREAD_COUNT_R:"A-get_unread_count-R",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T:"A-get_untagged_conversation_list_by_page-T",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R:"A-get_untagged_conversation_list_by_page-R",A_SET_TRANSLATION_LANGUAGE_T:"A-set_translation_language-T",A_SET_TRANSLATION_LANGUAGE_R:"A-set_translation_language-R",A_GET_TRANSLATION_LANGUAGE_T:"A-get_translation_language-T",A_GET_TRANSLATION_LANGUAGE_R:"A-get_translation_language-R",A_SET_AUTO_TRANSLATE_ENABLED_T:"A-set_auto_translate_enabled-T",A_SET_AUTO_TRANSLATE_ENABLED_R:"A-set_auto_translate_enabled-R",A_GET_AUTO_TRANSLATE_ENABLED_T:"A-get_auto_translate_enabled-T",A_GET_AUTO_TRANSLATE_ENABLED_R:"A-get_auto_translate_enabled-R",L_PULL_OFFLINE_MESSAGE_FINISHED_S:"L-pull_offline_message_finished-S",A_MODIFY_MESSAGE_WITH_PARAMS_T:"A-modify_msg_with_params-T",A_MODIFY_MESSAGE_WITH_PARAMS_R:"A-modify_msg_with_params-R",A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T:"A-refresh_refer_msg_with_params-T",A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R:"A-refresh_refer_msg_with_params-R",L_PULL_MODIFY_MSG_T:"L-pull_modify_msg-T",L_PULL_MODIFY_MSG_R:"L-pull_modify_msg-R",A_BATCH_DEL_CONVERS_T:"A-batch_del_conversation-T",A_BATCH_DEL_CONVERS_R:"A-batch_del_conversation-R",A_SYNC_REMOTE_CONVERSATIONS_T:"A-e_sync_remote_conversations-T",A_SYNC_REMOTE_CONVERSATIONS_R:"A-e_sync_remote_conversations-R",L_UPDATE_MSG_BOX_TIME_O:"L-update_msg_box_time-O",A_SEND_UG_TYPING_T:"A-send_ug_typing-T",A_SEND_UG_TYPING_R:"A-send_ug_typing-R",A_GET_UG_LIST_T:"A-get_ug_list-T",A_GET_UG_LIST_R:"A-get_ug_list-R",A_GET_UG_MSGS_BY_UID_T:"A-get_ug_msgs_by_uid-T",A_GET_UG_MSGS_BY_UID_R:"A-get_ug_msgs_by_uid-R",A_GET_UG_UNREAD_MENTIONED_DIGEST_T:"A-get_ug_unread_mentioned_digest-T",A_GET_UG_UNREAD_MENTIONED_DIGEST_R:"A-get_ug_unread_mentioned_digest-R",A_GET_HIS_MSGS_BY_OBJ_NAMES_T:"A-get_his_msgs_by_obj_names-T",A_GET_HIS_MSGS_BY_OBJ_NAMES_R:"A-get_his_msgs_by_obj_names-R",A_GET_CONTINUOUS_MSGS_T:"A-get_continuous_msgs-T",A_GET_CONTINUOUS_MSGS_R:"A-get_continuous_msgs-R",A_GET_MSGS_AROUND_TIMESTAMP_T:"A-get_msgs_around_timestamp-T",A_GET_MSGS_AROUND_TIMESTAMP_R:"A-get_msgs_around_timestamp-R",A_CLEAR_LOCAL_MSG_T:"A-clear_local_msg-T",A_CLEAR_LOCAL_MSG_R:"A-clear_local_msg-R",A_DEL_LOCAL_MSGS_BY_TIME_T:"A-del_local_msgs_by_time-T",A_DEL_LOCAL_MSGS_BY_TIME_R:"A-del_local_msgs_by_time-R",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T:"A-batch_clear_local_msgs_by_time-T",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R:"A-batch_clear_local_msgs_by_time-R",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T:"A-del_local_ug_msgs_for_all_channel-T",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R:"A-del_local_ug_msgs_for_all_channel-R",A_UPDATE_MSG_EXPANSION_T:"A-update_msg_expansion-T",A_UPDATE_MSG_EXPANSION_R:"A-update_msg_expansion-R",A_REMOVE_MSG_EXPANSION_T:"A-remove_msg_expansion-T",A_REMOVE_MSG_EXPANSION_R:"A-remove_msg_expansion-R",A_REMOVE_ALL_MSG_EXPANSION_T:"A-remove_all_msg_expansion-T",A_REMOVE_ALL_MSG_EXPANSION_R:"A-remove_all_msg_expansion-R",A_INSERT_MSG_T:"A-insert_msg-T",A_INSERT_MSG_R:"A-insert_msg-R",A_BATCH_INSERT_MSGS_T:"A-batch_insert_msgs-T",A_BATCH_INSERT_MSGS_R:"A-batch_insert_msgs-R",A_SET_MSG_CONTENT_T:"A-set_msg_content-T",A_SET_MSG_CONTENT_R:"A-set_msg_content-R",A_SET_UG_DEFAULT_NTF_LEVEL_T:"A-set_ug_default_ntf_level-T",A_SET_UG_DEFAULT_NTF_LEVEL_R:"A-set_ug_default_ntf_level-R",A_GET_UG_DEFAULT_NTF_LEVEL_T:"A-get_ug_default_ntf_level-T",A_GET_UG_DEFAULT_NTF_LEVEL_R:"A-get_ug_default_ntf_level-R",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T:"A-get_ug_unread_count_for_all_channels-T",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R:"A-get_ug_unread_count_for_all_channels-R",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T:"A-get_total_unread_count_by_levels-T",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R:"A-get_total_unread_count_by_levels-R",A_GET_TOTAL_UNREAD_COUNT_T:"A-get_total_unread_count-T",A_GET_TOTAL_UNREAD_COUNT_R:"A-get_total_unread_count-R",A_GET_FIRST_UNREAD_MEG_T:"A-get_first_unread_msg-T",A_GET_FIRST_UNREAD_MSG_R:"A-get_first_unread_msg-R",A_GET_FIRST_UNREAD_MSG_DIGEST_T:"A-get_first_unread_msg_digest-T",A_GET_FIRST_UNREAD_MSG_DIGEST_R:"A-get_first_unread_msg_digest-R",A_GET_UNREAD_MENTIONED_MSGS_T:"A-get_unread_mentioned_msgs-T",A_GET_UNREAD_MENTIONED_MSGS_R:"A-get_unread_mentioned_msgs-R",A_GET_UG_UNREAD_INFO_LIST_T:"A-get_ug_unread_info_list-T",A_GET_UG_UNREAD_INFO_LIST_R:"A-get_ug_unread_info_list-R",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T:"A-get_ug_first_unread_msg_digest-T",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R:"A-get_ug_first_unread_msg_digest-R",A_GET_LOCAL_MSG_COUNT_T:"A-get_local_msg_count-T",A_GET_LOCAL_MSG_COUNT_R:"A-get_local_msg_count-R",A_GET_CONVERSATIONS_T:"A-get_conversations-T",A_GET_CONVERSATIONS_R:"A-get_conversations-R",A_GET_BLOCKED_UG_LIST_T:"A-get_blocked_ug_list-T",A_GET_BLOCKED_UG_LIST_R:"A-get_blocked_ug_list-R",A_CLEAR_UNREAD_COUNT_T:"A-clear_unread_count-T",A_CLEAR_UNREAD_COUNT_R:"A-clear_unread_count-R",A_CLEAR_ALL_UNREAD_COUNT_T:"A-clear_all_unread_count-T",A_CLEAR_ALL_UNREAD_COUNT_R:"A-clear_all_unread_count-R",A_GET_TOP_CONVERSATION_LIST_T:"A-get_top_conversation_list-T",A_GET_TOP_CONVERSATION_LIST_R:"A-get_top_conversation_list-R",A_GET_UNREAD_CONVERSATION_LIST_T:"A-get_unread_conversation_list-T",A_GET_UNREAD_CONVERSATION_LIST_R:"A-get_unread_conversation_list-R",A_GET_BLOCKED_CONVERSATION_LIST_T:"A-get_blocked_conversation_list-T",A_GET_BLOCKED_CONVERSATION_LIST_R:"A-get_blocked_conversation_list-R",A_GET_ALL_CONVERSATION_LIST_T:"A-get_all_conversation_list-T",A_GET_ALL_CONVERSATION_LIST_R:"A-get_all_conversation_list-R",A_GET_CONVERSATION_LIST_BY_TIME_T:"A-get_conversation_list_by_time-T",A_GET_CONVERSATION_LIST_BY_TIME_R:"A-get_conversation_list_by_time-R",A_GET_CONVERSATION_LIST_OLD_T:"A-get_conversation_list_old-T",A_GET_CONVERSATION_LIST_OLD_R:"A-get_conversation_list_old-R",A_GET_UNREAD_MENTIONED_COUNT_T:"A-get_unread_mentioned_count-T",A_GET_UNREAD_MENTIONED_COUNT_R:"A-get_unread_mentioned_count-R",A_GET_ALL_UNREAD_MENTIONED_COUNT_T:"A-get_all_unread_mentioned_count-T",A_GET_ALL_UNREAD_MENTIONED_COUNT_R:"A-get_all_unread_mentioned_count-R",A_GET_REALTIME_CONVERSATIONS_T:"A-get_realtime_conversations-T",A_GET_REALTIME_CONVERSATIONS_R:"A-get_realtime_conversations-R",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T:"A-get_realtime_con_total_unread_count-T",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R:"A-get_realtime_con_total_unread_count-R",A_CLEAR_REALTIME_CON_UNREAD_COUNT_T:"A-clear_realtime_con_unread_count-T",A_CLEAR_REALTIME_CON_UNREAD_COUNT_R:"A-clear_realtime_con_unread_count-R",A_REMOVE_REALTIME_CONVERSATIONS_T:"A-remove_realtime_conversations-T",A_REMOVE_REALTIME_CONVERSATIONS_R:"A-remove_realtime_conversations-R",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T:"A-batch_get_realtime_con_unread_count-T",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R:"A-batch_get_realtime_con_unread_count-R",A_GET_SUB_USERS_STATUS_T:"A-get_sub_users_status-T",A_GET_SUB_USERS_STATUS_R:"A-get_sub_users_status-R",A_GET_SUB_USERS_ONLINE_STATUS_T:"A-get_sub_users_online_status-T",A_GET_SUB_USERS_ONLINE_STATUS_R:"A-get_sub_users_online_status-R",A_SAVE_EDITED_MSG_DRAFT_T:"A-save_edited_msg_draft-T",A_SAVE_EDITED_MSG_DRAFT_R:"A-save_edited_msg_draft-R",A_GET_EDITED_MSG_DRAFT_T:"A-get_edited_msg_draft-T",A_GET_EDITED_MSG_DRAFT_R:"A-get_edited_msg_draft-R",A_CLEAR_EDITED_MSG_DRAFT_T:"A-clear_edited_msg_draft-T",A_CLEAR_EDITED_MSG_DRAFT_R:"A-clear_edited_msg_draft-R",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T:"A-get_unread_mention_me_conversation_list-T",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R:"A-get_unread_mention_me_conversation_list-R",A_GET_USER_PROFILES_T:"A-get_user_profiles-T",A_GET_USER_PROFILES_R:"A-get_user_profiles-R",A_ADD_TO_BLACKLIST_T:"A-add_to_blacklist-T",A_ADD_TO_BLACKLIST_R:"A-add_to_blacklist-R",A_REMOVE_FROM_BLACKLIST_T:"A-remove_from_blacklist-T",A_REMOVE_FROM_BLACKLIST_R:"A-remove_from_blacklist-R",A_GET_BLACKLIST_T:"A-get_blacklist-T",A_GET_BLACKLIST_R:"A-get_blacklist-R",A_GET_BLACKLIST_STATUS_T:"A-get_blacklist_status-T",A_GET_BLACKLIST_STATUS_R:"A-get_blacklist_status-R",A_E_SET_MSG_RECEIVED_STATUS_T:"A-e_set_msg_received_status-T",A_E_SET_MSG_RECEIVED_STATUS_R:"A-e_set_msg_received_status-R",A_E_SET_MSG_SENT_STATUS_T:"A-e_set_msg_sent_status-T",A_E_SET_MSG_SENT_STATUS_R:"A-e_set_msg_sent_status-R",A_E_SET_CHECK_DUPLICATE_MSG_T:"A-e_set_check_duplicate_msg-T",A_E_SET_CHECK_DUPLICATE_MSG_R:"A-e_set_check_duplicate_msg-R",A_SET_PROXY_T:"A-set_proxy-T",A_SET_PROXY_R:"A-set_proxy-R",A_GET_PROXY_T:"A-get_proxy-T",A_GET_PROXY_R:"A-get_proxy-R",A_TEST_PROXY_T:"A-test_proxy-T",A_TEST_PROXY_R:"A-test_proxy-R",A_CLEAR_UNREAD_COUNT_BY_TIME_T:"A-clear_unread_count_by_time-T",A_CLEAR_UNREAD_COUNT_BY_TIME_R:"A-clear_unread_count_by_time-R",A_GET_MSG_READER_T:"A-get_msg_reader-T",A_GET_MSG_READER_R:"A-get_msg_reader-R",A_SEND_READ_RECEIPT_V4_T:"A-send_read_receipt_v4-T",A_SEND_READ_RECEIPT_V4_R:"A-send_read_receipt_v4-R",A_GET_READ_RECEIPT_V4_T:"A-get_read_receipt_V4-T",A_GET_READ_RECEIPT_V4_R:"A-get_read_receipt_V4-R",A_BATCH_GET_READ_RECEIPT_INFO_V4_T:"A-batch_get_read_receipt_info_V4-T",A_BATCH_GET_READ_RECEIPT_INFO_V4_R:"A-batch_get_read_receipt_info_V4-R",A_GET_ALL_ROBOTS_T:"A-get_all_robots-T",A_GET_ALL_ROBOTS_R:"A-get_all_robots-R",A_GET_ROBOT_BY_ID_T:"A-get_robot_by_id-T",A_GET_ROBOT_BY_ID_R:"A-get_robot_by_id-R",A_ADD_FRIEND_T:"A-add_friend-T",A_ADD_FRIEND_R:"A-add_friend-R",A_DELETE_FRIENDS_T:"A-delete_friends-T",A_DELETE_FRIENDS_R:"A-delete_friends-R",A_ACCEPT_FRIEND_REQUEST_T:"A-accept_friend_request-T",A_ACCEPT_FRIEND_REQUEST_R:"A-accept_friend_request-R",A_REFUSE_FRIEND_REQUEST_T:"A-refuse_friend_request-T",A_REFUSE_FRIEND_REQUEST_R:"A-refuse_friend_request-R",A_SET_FRIEND_INFO_T:"A-set_friend_info-T",A_SET_FRIEND_INFO_R:"A-set_friend_info-R",A_CHECK_FRIENDS_T:"A-check_friends-T",A_CHECK_FRIENDS_R:"A-check_friends-R",A_GET_FRIENDS_T:"A-get_friends-T",A_GET_FRIENDS_R:"A-get_friends-R",A_GET_FRIEND_APPLICATIONS_T:"A-get_friend_applications-T",A_GET_FRIEND_APPLICATIONS_R:"A-get_friend_applications-R",A_GET_FRIENDS_INFO_T:"A-get_friends_info-T",A_GET_FRIENDS_INFO_R:"A-get_friends_info-R",A_SEARCH_FRIENDS_INFO_T:"A-search_friends_info-T",A_SEARCH_FRIENDS_INFO_R:"A-search_friends_info-R",A_SET_FRIEND_ADD_PERMISSION_T:"A-set_friend_add_permission-T",A_SET_FRIEND_ADD_PERMISSION_R:"A-set_friend_add_permission-R",A_GET_FRIEND_ADD_PERMISSION_T:"A-get_friend_add_permission-T",A_GET_FRIEND_ADD_PERMISSION_R:"A-get_friend_add_permission-R",A_CREATE_GROUP_T:"A-create_group-T",A_CREATE_GROUP_R:"A-create_group-R",A_UPDATE_GROUP_INFO_T:"A-update_group_info-T",A_UPDATE_GROUP_INFO_R:"A-update_group_info-R",A_GET_GROUPS_INFO_T:"A-get_groups_info-T",A_GET_GROUPS_INFO_R:"A-get_groups_info-R",A_KICK_GROUP_MEMBERS_T:"A-kick_group_members-T",A_KICK_GROUP_MEMBERS_R:"A-kick_group_members-R",A_QUIT_GROUP_T:"A-quit_group-T",A_QUIT_GROUP_R:"A-quit_group-R",A_DISMISS_GROUP_T:"A-dismiss_group-T",A_DISMISS_GROUP_R:"A-dismiss_group-R",A_TRANSFER_GROUP_OWNER_T:"A-transfer_group_owner-T",A_TRANSFER_GROUP_OWNER_R:"A-transfer_group_owner-R",A_ADD_GROUP_MANAGERS_T:"A-add_group_managers-T",A_ADD_GROUP_MANAGERS_R:"A-add_group_managers-R",A_REMOVE_GROUP_MANAGERS_T:"A-remove_group_managers-T",A_REMOVE_GROUP_MANAGERS_R:"A-remove_group_managers-R",A_GET_GROUP_MEMBERS_T:"A-get_group_members-T",A_GET_GROUP_MEMBERS_R:"A-get_group_members-R",A_SET_GROUP_MEMBER_INFO_T:"A-set_group_member_info-T",A_SET_GROUP_MEMBER_INFO_R:"A-set_group_member_info-R",A_SEARCH_GROUP_MEMBERS_T:"A-search_group_members-T",A_SEARCH_GROUP_MEMBERS_R:"A-search_group_members-R",A_JOIN_GROUP_T:"A-join_group-T",A_JOIN_GROUP_R:"A-join_group-R",A_INVITE_USERS_TO_GROUP_T:"A-invite_users_to_group-T",A_INVITE_USERS_TO_GROUP_R:"A-invite_users_to_group-R",A_ADD_GROUP_FOLLOWS_T:"A-add_group_follows-T",A_ADD_GROUP_FOLLOWS_R:"A-add_group_follows-R",A_REMOVE_GROUP_FOLLOWS_T:"A-remove_group_follows-T",A_REMOVE_GROUP_FOLLOWS_R:"A-remove_group_follows-R",A_GET_GROUP_FOLLOWS_T:"A-get_group_follows-T",A_GET_GROUP_FOLLOWS_R:"A-get_group_follows-R",A_SET_GROUP_REMARK_T:"A-set_group_remark-T",A_SET_GROUP_REMARK_R:"A-set_group_remark-R",A_GET_GROUP_MEMBERS_BY_ROLE_T:"A-get_group_members_by_role-T",A_GET_GROUP_MEMBERS_BY_ROLE_R:"A-get_group_members_by_role-R",A_ACCEPT_GROUP_INVITE_T:"A-accept_group_invite-T",A_ACCEPT_GROUP_INVITE_R:"A-accept_group_invite-R",A_REFUSE_GROUP_INVITE_T:"A-refuse_group_invite-T",A_REFUSE_GROUP_INVITE_R:"A-refuse_group_invite-R",A_ACCEPT_GROUP_APPLICATION_T:"A-accept_group_application-T",A_ACCEPT_GROUP_APPLICATION_R:"A-accept_group_application-R",A_REFUSE_GROUP_APPLICATION_T:"A-refuse_group_application-T",A_REFUSE_GROUP_APPLICATION_R:"A-refuse_group_application-R",A_GET_GROUP_APPLICATIONS_T:"A-get_group_applications-T",A_GET_GROUP_APPLICATIONS_R:"A-get_group_applications-R",A_GET_JOINED_GROUPS_BY_ROLES_T:"A-get_joined_groups_by_roles-T",A_GET_JOINED_GROUPS_BY_ROLES_R:"A-get_joined_groups_by_roles-R",A_SEARCH_JOINED_GROUPS_T:"A-search_joined_groups-T",A_SEARCH_JOINED_GROUPS_R:"A-search_joined_groups-R",A_GET_JOINED_GROUPS_T:"A-get_joined_groups-T",A_GET_JOINED_GROUPS_R:"A-get_joined_groups-R",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T:"A-search_user_profile_by_unique_id-T",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R:"A-search_user_profile_by_unique_id-R",A_UPDATE_MY_USER_PROFILE_VISIBILITY_T:"A-update_my_user_profile_visibility-T",A_UPDATE_MY_USER_PROFILE_VISIBILITY_R:"A-update_my_user_profile_visibility-R",A_GET_MY_USER_PROFILE_VISIBILITY_T:"A-get_my_user_profile_visibility-T",A_GET_MY_USER_PROFILE_VISIBILITY_R:"A-get_my_user_profile_visibility-R",A_SUBSCRIBE_USER_STATUS_T:"A-subscribe_user_status-T",A_SUBSCRIBE_USER_STATUS_R:"A-subscribe_user_status-R",A_UNSUBSCRIBE_USER_STATUS_T:"A-unsubscribe_user_status-T",A_UNSUBSCRIBE_USER_STATUS_R:"A-unsubscribe_user_status-R",A_GET_SUBSCRIBE_USER_STATUS_LIST_T:"A-get_subscribe_user_status_list-T",A_GET_SUBSCRIBE_USER_STATUS_LIST_R:"A-get_subscribe_user_status_list-R",A_GET_MY_USER_PROFILE_T:"A-get_my_user_profile-T",A_GET_MY_USER_PROFILE_R:"A-get_my_user_profile-R",A_UPDATE_MY_USER_PROFILE_T:"A-update_my_user_profile-T",A_UPDATE_MY_USER_PROFILE_R:"A-update_my_user_profile-R",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T:"A-get_conversations_including_robots-T",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R:"A-get_conversations_including_robots-R"};!function(e){e[e.BOTH=2]="BOTH"}(_||(_={})),function(e){e[e.BOTH=2]="BOTH"}(f||(f={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(h||(h={})),function(e){e[e.NONE=0]="NONE",e[e.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",e[e.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",e[e.BOTH_WAY=3]="BOTH_WAY"}(g||(g={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(p||(p={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(E||(E={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(b||(b={})),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"}(T||(T={})),function(e){e[e.OWNER_VERIFY=0]="OWNER_VERIFY",e[e.FREE=1]="FREE",e[e.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(v||(v={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(R||(R={})),function(e){e[e.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",e[e.OWNER_OR_SELF=1]="OWNER_OR_SELF",e[e.SELF=2]="SELF"}(I||(I={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(m||(m={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(y||(y={})),function(e){e[e.CREATE=0]="CREATE",e[e.JOIN=1]="JOIN",e[e.KICK=2]="KICK",e[e.QUIT=3]="QUIT",e[e.DISMISS=4]="DISMISS",e[e.ADD_MANAGER=5]="ADD_MANAGER",e[e.REMOVE_MANAGER=6]="REMOVE_MANAGER",e[e.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER"}(A||(A={})),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={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(O||(O={})),function(e){e[e.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",e[e.MANAGER_REFUSED=1]="MANAGER_REFUSED",e[e.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",e[e.INVITEE_REFUSED=3]="INVITEE_REFUSED",e[e.JOINED=4]="JOINED",e[e.EXPIRED=5]="EXPIRED"}(N||(N={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(C||(C={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(P||(P={})),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"}(L||(L={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(w||(w={})),function(e){e[e.APPLICATION_SENT=0]="APPLICATION_SENT",e[e.INVITATION_SENT=1]="INVITATION_SENT",e[e.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",e[e.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED"}(M||(M={})),function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(U||(U={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(D||(D={})),function(e){e[e.LeaveOnMyOwn=0]="LeaveOnMyOwn",e[e.OtherDeviceLogin=1]="OtherDeviceLogin"}(G||(G={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(V||(V={})),function(e){e[e.UnmuteUsers=0]="UnmuteUsers",e[e.MuteUsers=1]="MuteUsers",e[e.UnmuteAll=2]="UnmuteAll",e[e.MuteAll=3]="MuteAll",e[e.RemoveWhitelist=4]="RemoveWhitelist",e[e.AddWhitelist=5]="AddWhitelist",e[e.UnmuteGloble=6]="UnmuteGloble",e[e.MuteGloble=7]="MuteGloble"}(j||(j={})),function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(k||(k={})),function(e){e[e.SUCCESS=0]="SUCCESS",e[e.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.NOT_IN_WHITELIST=407]="NOT_IN_WHITELIST",e[e.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",e[e.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",e[e.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",e[e.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",e[e.MESSAGE_OVER_MODIFY_TIME_FAIL=20114]="MESSAGE_OVER_MODIFY_TIME_FAIL",e[e.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",e[e.MESSAGE_UNSUPPORTED_MODIFY=20116]="MESSAGE_UNSUPPORTED_MODIFY",e[e.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",e[e.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",e[e.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",e[e.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",e[e.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",e[e.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",e[e.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",e[e.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",e[e.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",e[e.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",e[e.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",e[e.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",e[e.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",e[e.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",e[e.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",e[e.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",e[e.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",e[e.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",e[e.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",e[e.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",e[e.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",e[e.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",e[e.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",e[e.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",e[e.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",e[e.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",e[e.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",e[e.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",e[e.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",e[e.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",e[e.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",e[e.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",e[e.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",e[e.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",e[e.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",e[e.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",e[e.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",e[e.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",e[e.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",e[e.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",e[e.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",e[e.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",e[e.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",e[e.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",e[e.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",e[e.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",e[e.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",e[e.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",e[e.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",e[e.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",e[e.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",e[e.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",e[e.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",e[e.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",e[e.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",e[e.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",e[e.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",e[e.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",e[e.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",e[e.RC_FRIEND_NOT_SUPPORT_ROBOT=25474]="RC_FRIEND_NOT_SUPPORT_ROBOT",e[e.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",e[e.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",e[e.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",e[e.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",e[e.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",e[e.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",e[e.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",e[e.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",e[e.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",e[e.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",e[e.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",e[e.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",e[e.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",e[e.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",e[e.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",e[e.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",e[e.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",e[e.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",e[e.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",e[e.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",e[e.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",e[e.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",e[e.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",e[e.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",e[e.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",e[e.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",e[e.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",e[e.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",e[e.TRANS_FAILED=28401]="TRANS_FAILED",e[e.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",e[e.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",e[e.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",e[e.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",e[e.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",e[e.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",e[e.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",e[e.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",e[e.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",e[e.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",e[e.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",e[e.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",e[e.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",e[e.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",e[e.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",e[e.RC_TCP_RESET=32054]="RC_TCP_RESET",e[e.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",e[e.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.METHOD_BUSY=33103]="METHOD_BUSY",e[e.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",e[e.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",e[e.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",e[e.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",e[e.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.UPLOAD_FAIL=34011]="UPLOAD_FAIL",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",e[e.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",e[e.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",e[e.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",e[e.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",e[e.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",e[e.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",e[e.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",e[e.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",e[e.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",e[e.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",e[e.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",e[e.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",e[e.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",e[e.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",e[e.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",e[e.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",e[e.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",e[e.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",e[e.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",e[e.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",e[e.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",e[e.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",e[e.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",e[e.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",e[e.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",e[e.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",e[e.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",e[e.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",e[e.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",e[e.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",e[e.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",e[e.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",e[e.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",e[e.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",e[e.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",e[e.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",e[e.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",e[e.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",e[e.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",e[e.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",e[e.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",e[e.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",e[e.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",e[e.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",e[e.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",e[e.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",e[e.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",e[e.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",e[e.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",e[e.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",e[e.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",e[e.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",e[e.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",e[e.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",e[e.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",e[e.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",e[e.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",e[e.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",e[e.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",e[e.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",e[e.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",e[e.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",e[e.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",e[e.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",e[e.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",e[e.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",e[e.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",e[e.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",e[e.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",e[e.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",e[e.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",e[e.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",e[e.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",e[e.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",e[e.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",e[e.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",e[e.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",e[e.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",e[e.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",e[e.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",e[e.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",e[e.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",e[e.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",e[e.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",e[e.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",e[e.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",e[e.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",e[e.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",e[e.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",e[e.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",e[e.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",e[e.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",e[e.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",e[e.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",e[e.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",e[e.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.NOT_SUPPORT=35004]="NOT_SUPPORT",e[e.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",e[e.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",e[e.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",e[e.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",e[e.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",e[e.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",e[e.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",e[e.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",e[e.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",e[e.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",e[e.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",e[e.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",e[e.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",e[e.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",e[e.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",e[e.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",e[e.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",e[e.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",e[e.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",e[e.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",e[e.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",e[e.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",e[e.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",e[e.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",e[e.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",e[e.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",e[e.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",e[e.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",e[e.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",e[e.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",e[e.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",e[e.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",e[e.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",e[e.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",e[e.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",e[e.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",e[e.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",e[e.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",e[e.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",e[e.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",e[e.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",e[e.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",e[e.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",e[e.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",e[e.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",e[e.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",e[e.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.TIMEOUT=-1]="TIMEOUT"}(x||(x={})),function(e){e[e.NONE=0]="NONE",e[e.PRIVATE=1]="PRIVATE",e[e.DISCUSSION=2]="DISCUSSION",e[e.GROUP=3]="GROUP",e[e.CHATROOM=4]="CHATROOM",e[e.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",e[e.SYSTEM=6]="SYSTEM",e[e.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",e[e.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",e[e.ULTRA_GROUP=10]="ULTRA_GROUP",e[e.RTC_ROOM=12]="RTC_ROOM"}(F||(F={}));var H,q,Y,W=0,K=1,J=2,Q=3,X=4,Z=5,z=6,$=7,ee=function(e){var t=[F.PRIVATE,F.GROUP,F.SYSTEM,F.PUBLIC_SERVICE,F.APP_PUBLIC_SERVICE];switch(e){case W:return t;case K:return[F.PRIVATE,F.GROUP];case J:return l(l([],u(t),!1),[F.ULTRA_GROUP],!1);case Q:return l(l([],u(t),!1),[F.ULTRA_GROUP,F.CHATROOM],!1);case X:return l(l([],u(t),!1),[F.ULTRA_GROUP,F.CHATROOM,F.RTC_ROOM,F.CUSTOMER_SERVICE,F.DISCUSSION],!1);case Z:return[F.PRIVATE,F.GROUP,F.ULTRA_GROUP];case z:return[F.GROUP];case $:return[F.PRIVATE]}},te=function(e,t){return ee(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"}(H||(H={})),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"}(q||(q={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(Y||(Y={}));var ne,re,ie,oe,ae,se,ue,le,ce,de,_e,fe,he,ge,pe,Ee,be,Te,ve,Re,Ie,me={TextMessage:"RC:TxtMsg",TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL:"RC:RcCmd",RECALL_MESSAGE_TYPE:"RC:RcCmd",RECALL_NOTIFICATION_MESSAGE:"RC:RcNtf",READ_RECEIPT:"RC:ReadNtf",READ_RECEIPT_REQUEST:"RC:RRReqMsg",READ_RECEIPT_RESPONSE:"RC:RRRspMsg",SYNC_READ_STATUS:"RC:SRSMsg",GROUP_READ_RECEIPT_REQUEST:"RC:RRMsg",READ_STATE:"RC:RSMsg",DELIVERED:"RC:Delivered",DELIVERED_MSG:"RC:DRMsg",CHATROOM_MERGE_CHANGE:"RC:ChrmMemChange",CHATROOM_SYNC_MSG:"RC:ChrmSyncMsg",CHATROOM_MERGE_BLOCK:"RC:ChrmBlockMsg",CHATROOM_MERGE_BAN:"RC:ChrmBanMsg",TYPING_STATUS:"RC:TypSts",INTERCEPT:"RC:InterceptMsg",CLOUD_CONTROL:"RC:CCConfigChangeRequestMsg",STREAM_MESSAGE:"RC:StreamMsg"};!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(ne||(ne={})),function(e){e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(re||(re={})),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"}(ie||(ie={})),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"}(oe||(oe={})),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"}(ae||(ae={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(se||(se={})),function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(ue||(ue={})),function(e){e[e.typing=0]="typing"}(le||(le={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(ce||(ce={})),function(e){e[e.Other=0]="Other",e[e.iOS=1]="iOS",e[e.Android=2]="Android",e[e.Web=3]="Web",e[e.PC=4]="PC",e[e.Mini=5]="Mini",e[e.HarmonyOS=6]="HarmonyOS"}(de||(de={})),function(e){e[e.ONLINE_STATUS=1]="ONLINE_STATUS",e[e.USER_PROFILE=2]="USER_PROFILE",e[e.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",e[e.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE"}(_e||(_e={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(fe||(fe={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(he||(he={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(ge||(ge={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(pe||(pe={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(Ee||(Ee={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(be||(be={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(Te||(Te={})),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"}(ve||(ve={})),function(e){e[e.ALL_MESSAGE=-1]="ALL_MESSAGE",e[e.NOT_SET=0]="NOT_SET",e[e.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",e[e.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",e[e.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",e[e.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION"}(Re||(Re={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(Ie||(Ie={}));var ye,Ae,Se,Oe,Ne,Ce,Pe,Le,we,Me=function(e){return e===Ie.OPEN?Re.AT_MESSAGE_NOTIFICATION:Re.NOT_SET},Ue=function(e){return e<=Re.NOT_SET?Ie.CLOSE:Ie.OPEN};!function(e){e[e.READ=1]="READ",e[e.LISTENED=2]="LISTENED",e[e.DOWNLOADED=4]="DOWNLOADED",e[e.RETRIEVED=8]="RETRIEVED",e[e.UNREAD=0]="UNREAD"}(ye||(ye={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(Ae||(Ae={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(Se||(Se={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Oe||(Oe={})),function(e){e[e.CURRENT=2]="CURRENT"}(Ne||(Ne={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Ce||(Ce={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Pe||(Pe={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(Le||(Le={})),function(e){e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED"}(we||(we={}));var De,Ge,Ve={ALL:0,EXCLUDE_ROBOT:1,ROBOT_ONLY:2},je={DISALLOW:0,ALLOW:1},ke={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},xe={NORMAL:0,ROBOT:1},Fe={UNKNOWN:-1,V1:0,V2:1,V4:3,V5:4};!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"}(De||(De={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(Ge||(Ge={}));var Be=72e5,He=6e4,qe=131072,Ye="5.32.1-c-test-alpha.1".replace(/-.+$/,""),We=5368709120,Ke=10485760,Je="rongcloudsystem",Qe=864e5,Xe=function(e){return"navi_".concat(e)},Ze=function(e,t){return"RC-con-stat-ver-".concat(e,"-").concat(t)},ze=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},$e=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},et=function(e,t){return"RC-con-type-settings-".concat(e,"-").concat(t)},nt=function(e,t){return"outbox_".concat(e,"_").concat(t)},rt=function(e,t){return"inbox_".concat(e,"_").concat(t)},it=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},ot=function(e,t){return"send_msg_".concat(e,"_").concat(t)},at=function(e,t){return"RC-us-".concat(e,"-").concat(t)},st=function(e){return"rc-static-config-".concat(e)},ut=function(e){return"RC-cc-".concat(e)},lt=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},ct=function(e){return"RC-LI-".concat(e)},dt=Math.pow(2,31)-1,_t="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};_t.engine="5.32.1-c-test-alpha.1";var ft=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)&&(_t[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 n=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return _t.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=n}}),Object.defineProperty(e,"getInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _t}}),e}();var ht={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,n=Date.now(),r=n.toString(36),i=Math.floor(Math.random()*n).toString(36),o=e-r.length-i.length;return[i,r,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},gt=ht.genWithLen(22),pt=Date.now(),Et=function(e){return"string"==typeof e},bt=function(e){return"boolean"==typeof e},Tt=function(e){return"number"==typeof e&&!Number.isNaN(e)},vt=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},Rt=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},It=function(e){return function(t){return Et(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))}},mt=function(e){return Et(e)&&e.length>0},yt=function(e){return Rt(e)&&e.length>0},At=function(e){return"[object Object]"===Object.prototype.toString.call(e)},St=function(e){return"function"==typeof e},Ot=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Nt=function(e){return Et(e)&&/https?:\/\//.test(e)},Ct=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},Pt=function(e){return Tt(e)&&Object.prototype.hasOwnProperty.call(F,e)},Lt=function(e){return Tt(e)&&Object.prototype.hasOwnProperty.call(Re,e)},wt=function(e){var t=!1;return Et(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},Mt=function(e){return Object.values(e.type).includes(e.value)},Ut=function(e){return It({minLength:1,maxLength:64})(e)},Dt=function(e){return It({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},Gt=function(e){return Tt(e)&&Object.prototype.hasOwnProperty.call(q,e)},Vt=function(){return"undefined"!=typeof RCCppEngine},jt=function(e){return{isRead:(e&ye.READ)===ye.READ,isListened:(e&ye.LISTENED)===ye.LISTENED,isDownload:(e&ye.DOWNLOADED)===ye.DOWNLOADED,isRetrieved:(e&ye.RETRIEVED)===ye.RETRIEVED}},kt=function(e){var t=ye.UNREAD;return(null==e?void 0:e.isRead)&&(t|=ye.READ),(null==e?void 0:e.isListened)&&(t|=ye.LISTENED),(null==e?void 0:e.isDownload)&&(t|=ye.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=ye.RETRIEVED),t},xt=function(e){return[de.iOS,de.Android,de.Web,de.PC,de.Mini,de.HarmonyOS].map((function(t){var n=e.findIndex((function(e){return e.platform===t}));return-1===n?{platform:t,changeTime:0,eventValue:0}:e[n]}))},Ft=function(e,t,n){var r=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 r.userId=e,n.forEach((function(e){r.extraProfile=r.extraProfile||{},r.extraProfile[e.key]=e.value})),r},Bt=function(e,t,n){return t?1===n?H.TLS:H.RMTP:"http"===e?H.WS:H.WSS},Ht=function(e,t){var n=e.server,r=e.backupServer,i=e.bs,o=e.serverAddr,a=e.protocol,s=e.openTLS;if(o)return l([],u(o.filter((function(e){return e.addr}))),!1);var c=[],d=[];return n&&d.push(n),(r||i||"").split(",").forEach((function(e){d.indexOf(e)<0&&d.push(e)})),d.forEach((function(e,r){e&&c.push({addr:e,protocol:Bt(a,t,s),weight:n.length-r,race:!1})})),l([],u(c),!1)},qt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Jt(e.settingProfile),n=e.extProfile||[],i=e.targetId,o=e.baseInfo,a=e.userInfo;return JSON.parse(JSON.stringify(r(r({groupId:i},Wt(t)),{extProfile:n.length>0?Jt(n):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:null==o?void 0:o.createTime,membersCount:null==o?void 0:o.memberCount,remark:null==a?void 0:a.remarkName})))}))},Yt=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},Wt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Yt(e.joinPerm),removeMemberPermission:Yt(e.removePerm),invitePermission:Yt(e.memInvitePerm),inviteHandlePermission:Yt(e.invitePerm),groupInfoEditPermission:Yt(e.profilePerm),memberInfoEditPermission:Yt(e.memProfilePerm)}))},Kt=function(e){return void 0===e&&(e=[]),e.map(Qt)},Jt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Qt=function(e){var t=e.userId,n=e.name,r=e.portraitUrl,i=e.ext||{},o=i.role,a=i.joinTime,s=i.channelNickName,u=i.additional,l=i.isBot;return{userId:t,name:n||"",portraitUri:r||"",nickname:s||"",extra:u||"",role:o||y.UNDEF,joinedTime:a||0,isRobot:!!l}},Xt=function(e){var t=e.joinUserInfo,n=e.inviterInfo,r=e.processInfo;return{groupId:e.targetId,joinMemberInfo:Qt(t),inviterInfo:n&&n.userId?Qt(n):void 0,operatorInfo:r&&r.userId?Qt(r):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},Zt=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},zt=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var n=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return n.length?[e,n.join("&")].join("?"):e};function $t(e){for(var t=null===window||void 0===window?void 0:window.atob(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n.buffer}var en,tn=function(e,t){var n=Math.floor(1e3*Math.random()%1e4),r=ht.gen(),i=function(e){e=e||"-";var t=new Date,n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate();return"".concat(n).concat(e).concat(r).concat(e).concat(i)}(),o=(new Date).getTime(),a="";if(t){var s=t.split(".");a=".".concat(s[s.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(n,"_").concat(o).concat(r).concat(a)},nn=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t={}),void 0===n&&(n={});var r=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,a=t.typeVivo,s=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,d=t.importanceHonor,_=t.imageUrlHonor,f=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.threadId,r=e.apnsCollapseId,i=e.category,o=e.richMediaUri,a=e.interruptionLevel,s=t.googleConfig,u={};u["thread-id"]=n||"",u["apns-collapse-id"]=r||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=a||"active";var l={};l.collapse_key=null==s?void 0:s.collapseKey,l.imageUrl=null==s?void 0:s.imageUrl;var c=null==s?void 0:s.priority;return c&&!["high","normal"].includes(c)&&(c="normal"),l.priority=c,{APNS:u,FCM:l}}(e,t),h=[{HW:{channelId:i||"",importance:s||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:r||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:a||"",category:c||""}},{APNS:f.APNS},{FCM:f.FCM},{HONOR:{importance:d||Te.NORMAL,image:_||""}},{OHOS:{category:n.category||null,image:n.image||""}}];return JSON.stringify(h)},rn=function(e,t){var n={},r={notificationId:t||""},i={};if(!e)return{iOSConfig:n,androidConfig:r,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,a,s,u,l,c,d,_,f,h,g,p=Object.keys(e);if(0!==p.length){var E=p[0];switch(E){case"HW":return r.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,r.importanceHW=null===(o=e[E])||void 0===o?void 0:o.importance,r.imageUrlHW=null===(a=e[E])||void 0===a?void 0:a.image,void(r.categoryHW=null===(s=e[E])||void 0===s?void 0:s.category);case"MI":return void(r.channelIdMi=null===(u=e[E])||void 0===u?void 0:u.channelId);case"OPPO":return void(r.channelIdOPPO=null===(l=e[E])||void 0===l?void 0:l.channelId);case"VIVO":return r.typeVivo=null===(c=e[E])||void 0===c?void 0:c.classification,void(r.categoryVivo=null===(d=e[E])||void 0===d?void 0:d.category);case"APNS":return n.threadId=e[E]["thread-id"],n.apnsCollapseId=e[E]["apns-collapse-id"],n.category=e[E].category,n.richMediaUri=e[E].richMediaUri,void(n.interruptionLevel=e[E]["interruption-level"]);case"FCM":return void(r.googleConfig={collapseKey:e[E].collapse_key||"",imageUrl:e[E].imageUrl||"",priority:e[E].priority||""});case"HONOR":return r.importanceHonor=null===(_=e[E])||void 0===_?void 0:_.importance,void(r.imageUrlHonor=null===(f=e[E])||void 0===f?void 0:f.image);case"OHOS":i.category=null===(h=e[E])||void 0===h?void 0:h.category,i.image=null===(g=e[E])||void 0===g?void 0:g.image}}}))}catch(e){}return{iOSConfig:n,androidConfig:r,harmonyOSConfig:i}},on=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),n=e.length;return t&&(n<=128&&n>=1)},an=function(e){var t=e.length;return t<=4096&&t>=1},sn=(en=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),n=e+en.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return en=2047&++en,parseInt(n,2)}),un=function(){var e=ft.getInfo(),t="electron";for(var n in e)"engine"!==n&&(t=["imlib-v2-adapter","imlib-next"].includes(n)?n:"electron");return t},ln=function(e,t,n){return o(void 0,void 0,void 0,(function(){var r,i;return a(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 r=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(n)},r,$t(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function cn(e,t){var n;if(!e)return"";var r="undefined"!=typeof window&&"https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol);return/^https?:\/\//.test(e)?r?e.replace(/^https?:\/\//i,"https://"):e:t!==H.HTTP||r?"https://".concat(e):"http://".concat(e)}var dn=function(e,t){if(!e)return"";var n=e.ossConfig,r=void 0===n?"":n,i="";try{var o=JSON.parse(r);if(o.length>0){var a=o.find((function(e){return e.minio}));a&&(i=a.minio)}}catch(e){t.warn(B.L_PARSE_JSON_E,JSON.stringify({ossConfig:r,error:e}))}return i};var _n,fn=function(e,t){return t&&0!==t.length?[F.GROUP,F.ULTRA_GROUP,F.APP_PUBLIC_SERVICE,F.PUBLIC_SERVICE].includes(e)?t:[]:t||[]},hn=function(e){function n(t){var n=e.call(this,t)||this;return n.name="RCError",n}return t(n,e),Object.defineProperty(n,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new n("Invalid parameter -> ".concat(e)):new n("Invalid parameters.")}}),Object.defineProperty(n,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new n("Wrong parameter type")}}),n}(Error),gn=function(){function e(){_n.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){d(this,_n,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return c(this,_n,"f")},enumerable:!1,configurable:!0}),e}();_n=new WeakMap;var pn=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,n,r,i){void 0===i&&(i=0);var o=Symbol(),a=this._map.get(e)||this._map.set(e,[]).get(e),s={symbol:o,priority:Math.min(i,100),listener:t.bind(r),once:n},u=a.findIndex((function(e){return e.priority>i}));return-1===u?a.push(s):a.splice(u,0,s),o}}),Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=0),this._addItem(e,t,!1,n,r)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=0),this._addItem(e,t,!0,n,r)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;try{for(var r=s(this._map),i=r.next();!i.done;i=r.next()){var o=u(i.value,2),a=(o[0],o[1]),l=a.findIndex((function(t){return t.symbol===e}));if(-1!==l)return void a.splice(l,1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map.get(e);if(r&&r.length>0)for(var i=new gn,o=0;o<r.length;o+=1){var a=r[o],s=a.once,c=a.listener;s&&r.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(n){return n.emit.apply(n,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}(),En=function(e){function n(t){var n=e.call(this)||this;return Object.defineProperty(n,"_name",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(n,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(n,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(n,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(n,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),n}return t(n,e),Object.defineProperty(n.prototype,"length",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"setInitVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,(function(){return a(this,(function(n){return-1!==this._dataVersion||(this._dataVersion=e,t&&this._execPulling()),[2]}))}))}}),Object.defineProperty(n.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(n.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return this._pullingPromise?[2]:(this._pullingPromise=this._handleSyncData(this._dataVersion),[4,this._pullingPromise]);case 1:if(e=a.sent(),t=e.isOk,n=e.data,this._pullingPromise=null,!t)return[2];if(void 0===(null==n?void 0:n.version)||n.version<this._dataVersion)throw new Error("".concat(this._name,": version error, please check: lastVersion: ").concat(this._dataVersion,", newVersion: ").concat(null==n?void 0:n.version));return r=n.version,i=n.hasNext,o=this._versionQueue.filter((function(e){return e>r})),this._versionQueue=l([],u(o),!1),this._dataVersion=r,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[2,this._execPulling()]):[2]}}))}))}}),Object.defineProperty(n.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((function(){return n._execPulling()}),e))}}),Object.defineProperty(n.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(n.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}),n}(pn),bn=function(){function e(e,t){var n=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){n._resolve=t,e(n._onResolve.bind(n))})),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}(),Tn=function(){function e(e,t,n){Object.defineProperty(this,"isOk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"msg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isOk=0===e,this.code=e,this.msg=t,this.data=n}return Object.defineProperty(e,"from",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r){return new e(t,n||"fail: ".concat(t),r)}}),Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(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 a(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?vn(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?vn(void 0,this.msg):Rn(this.code,this.msg)}}),e}(),vn=function(e,t){return new Tn(0,t||"success",e)},Rn=function(e,t,n){return new Tn(e,t||"fail: ".concat(e),n)},In=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,"isFailed",{get:function(){return!this._isValid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.isFailed&&(0===this._code||n)&&(this._code=e,this._errmsg=t||this._errmsg),this}}),Object.defineProperty(e.prototype,"setFailed",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isValid=!1,this.fail(e,t)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.isFailed&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this.isFailed?Rn(this._code,this._errmsg):vn()}}),Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isFailed||e(this),this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(void 0===r&&(r=!1),this.isFailed)return this;var i=r?n(t):null==t||n(t);return this._isValid=i,this.isFailed&&(this._errmsg="param '".concat(e,"' is invalid")),this}}),Object.defineProperty(e.prototype,"assert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(void 0===r&&(r=!1),this.isFailed)return this;if(this.validate(e,t,n,r),this.isFailed)throw hn.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(){return"string"==typeof t}),n)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return"string"==typeof t}),n)}}),Object.defineProperty(e.prototype,"isHttpUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.isNotEmptyString(e,t,n).validate(e,t,(function(e){return/^https?:\/\//.test(e)}))}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.isString(e,t,n).validate(e,t,(function(e){return e.trim().length>0}),n)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assertString(e,t,n),this.assert(e,t,(function(e){return e.trim().length>0}),n)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=n&&e.length<=r}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=n&&e.length<=r}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),n)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),n)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),n)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),n)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"isTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.isLimitedInteger(e,t,0,Number.MAX_SAFE_INTEGER,n)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===r&&(r=!1),void 0===i&&(i=1),this.isArray(e,t,r).validate(e,t,(function(e){return e.length>=i&&e.length<=n}),r)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===r&&(r=!1),void 0===i&&(i=1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.length>=i&&e.length<=n}),r)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.isArray(e,t,r).validate(e,t,(function(e){return e.every(n)}),r)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.every(n)}),r)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,n,i,o).validate(e,t,(function(e){return e.every(r)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,n,i,o),this.assert(e,t,(function(e){return e.every(r)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)}}),Object.defineProperty(e.prototype,"isStringEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.isString(e,t,r).validate(e,t,(function(e){return Object.values(n).includes(e)}),r)}}),Object.defineProperty(e.prototype,"isNumberEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.isNumber(e,t,r).validate(e,t,(function(e){return Object.values(n).includes(e)}),r)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return Object.values(n).includes(t)}),r)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"function"==typeof e}),n)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"function"==typeof e}),n)}}),e}(),mn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function yn(e){var t,n,r,i,o,a,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=mn.indexOf(e.charAt(u++))<<2|(i=mn.indexOf(e.charAt(u++)))>>4,n=(15&i)<<4|(o=mn.indexOf(e.charAt(u++)))>>2,r=(3&o)<<6|(a=mn.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==o&&(s+=String.fromCharCode(n)),64!==a&&(s+=String.fromCharCode(r));return s}var An,Sn=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},On=1732584193,Nn=4023233417,Cn=2562383102,Pn=271733878,Ln=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],wn=[3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745];function Mn(e,t){return e<<t|e>>>32-t}function Un(e,t,n){return e&n|t&~n}function Dn(e,t,n){return e^t^n}function Gn(e,t,n){return t^(e|~n)}function Vn(e){for(var t=[],n=0;n<e.length;n+=4)t.push((e[n]||0)|(e[n+1]||0)<<8|(e[n+2]||0)<<16|(e[n+3]||0)<<24);return t}function jn(e){var t=new Uint8Array(4);return t[0]=255&e,t[1]=e>>8&255,t[2]=e>>16&255,t[3]=e>>24&255,t}function kn(e){var t=8*e.length,n=e.length%64<56?56-e.length%64:120-e.length%64,r=new Uint8Array(e.length+n+8);r.set(e),r[e.length]=128;for(var i=1;i<n;i++)r[e.length+i]=0;var o=new Uint8Array(8),a=4294967295&t,s=4294967295&Math.floor(t/4294967296);o.set(jn(a),0),o.set(jn(s),4),r.set(o,e.length+n);var u,l=On,c=Nn,d=Cn,_=Pn;for(i=0;i<r.length;i+=64){for(var f=Vn(r.slice(i,i+64)),h=l,g=c,p=d,E=_,b=0;b<64;b++){var T=void 0,v=void 0;b<16?(T=(u=c)&d|~u&_,v=b):b<32?(T=Un(c,d,_),v=(5*b+1)%16):b<48?(T=Dn(c,d,_),v=(3*b+5)%16):(T=Gn(c,d,_),v=7*b%16);var R=_;_=d,d=c,c+=Mn(l+T+wn[b]+f[v]&4294967295,Ln[b]),l=R}l=l+h&4294967295,c=c+g&4294967295,d=d+p&4294967295,_=_+E&4294967295}var I=new Uint8Array(16);return I.set(jn(l),0),I.set(jn(c),4),I.set(jn(d),8),I.set(jn(_),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(I)}function xn(e){var t=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);var t=unescape(encodeURIComponent(e)).split("").map((function(e){return e.charCodeAt(0)}));return new Uint8Array(t)}(e);return kn(t)}function Fn(e){var t=e.method||Ge.GET,n=e.timeout||He,r=e.headers,i=e.query,o=e.body,a=e.onProgress,s=zt(e.url,i),u=new XMLHttpRequest;if(u.open(t,s),r&&u.setRequestHeader)for(var l in r)u.setRequestHeader(l,r[l]);return function(e,t,n,r){return new bn((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},r&&(e.upload.onprogress=function(e){return r(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(n)}),(function(t){e.abort(),t({status:-1})}))}(u,n,o,a)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(An||(An={}));var Bn,Hn,qn=0,Yn={DEFAULT:0,MODIFIED:1,RECALLED:2,DELETE:3},Wn={TranslationLanguage:0,AutoTranslateEnable:1};!function(e){e[e.BJ=1]="BJ",e[e.SG=2]="SG",e[e.NA=3]="NA",e[e.SG_A=4]="SG_A",e[e.SG_B=4]="SG_B",e[e.SA=5]="SA",e[e.OM=6]="OM"}(Hn||(Hn={}));var Kn=((Bn={})[Hn.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Bn[Hn.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Bn[Hn.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Bn[Hn.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Bn[Hn.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Bn[Hn.OM]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]},Bn);function Jn(e){return Hn[e]?e:Hn.BJ}var Qn,Xn=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 n,r=this.initOption||{},i=r.areaCode,o=r.navigators,a=(n=i,void 0===n&&(n=Hn.BJ),Kn[Jn(n)].naviUrlBase64).map((function(e){return yn(e)})),s=[],c=u(e.split("@"),2)[1];t&&(s=c?c.split(";"):[]);var d=o&&o.length>0?l(l([],u(s),!1),u(o),!1):l(l([],u(s),!1),u(a),!1);return d.filter((function(e,t){return d.indexOf(e)===t})).map((function(e){return cn(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,i=e||{},o=i.log,a=i.logPolicy,s=this.initOption||{},c=s.areaCode,d=s.logServerUrl,_=(n=c,void 0===n&&(n=Hn.BJ),Kn[Jn(n)].logUrlBase64).map((function(e){return r(r({},e),{addr:yn(e.addr)})})),f=[],h={level:1,itv:6,times:5};if(o)f.push.apply(f,l([],u(o.addrs),!1)),Object.assign(h,o.policy);else if(a)try{var g=JSON.parse(a);f.push({addr:g.url,protocol:H.HTTPS,weight:1}),h.level=g.level,h.itv=g.itv,h.times=g.times}catch(n){t.warn(B.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var p=d?l([{addr:d,protocol:H.HTTPS,weight:101}],u(f),!1):l(l([],u(f),!1),u(_),!1);return{policy:h,addrs:p.filter((function(e,t){return p.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return r(r({},e),{addr:cn(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,n=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=Hn.BJ),Kn[Jn(t)].miniCmpBase64).map((function(e){return yn(e)})),r=(this.initOption||{}).miniCMPProxy;return r&&r.length>0?r:n}}),Object.defineProperty(e.prototype,"getStaticConfigUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=Hn.BJ),Kn[Jn(t)].staticConfigUrlBase64).map((function(e){return yn(e)}))}}),Object.defineProperty(e.prototype,"getCloudControllerUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(n=r,void 0===n&&(n=Hn.BJ),Kn[Jn(n)].cloudControllerUrlBase64).map((function(e){return yn(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:Hn.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!Hn[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,n,r=e||{},i=r.active,o=r.activeServer,a=(null==i?void 0:i.addrs)||[],s=(n=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===n&&(n=Hn.BJ),Kn[Jn(n)].statsUrlBase64).map((function(e){return yn(e)})),c=[];return 0!==a.length?c.push.apply(c,l([],u(a.sort((function(e,t){return t.weight-e.weight})).map((function(e){return cn(e.addr,e.protocol)}))),!1)):o&&c.push(cn(o,H.HTTPS)),s.forEach((function(e){c.includes(e)||c.push(e)})),c}}),e}(),Zn=new Xn,zn=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,n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:if(!(t=this.getCache()))return[3,6];a.label=1;case 1:return a.trys.push([1,4,,5]),n=JSON.parse(t),Date.now()-(null==n?void 0:n.time)<18e5?[4,this.decryptData(n.val)]:[3,3];case 2:return r=a.sent(),(i=r.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return cn(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=a.sent(),this.logger.error(B.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),a.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=a.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(u=a.sent())?void 0:u.areaCode)!==Zn.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),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 cn(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,n,r,i,o,c,d,_,f,h;return a(this,(function(a){switch(a.label){case 0:e=(e=l(l([],u(this.staticUrls),!1),u(Zn.getStaticConfigUrl()),!1).map((function(e){return cn(e)}))).filter((function(t,n){return e.indexOf(t)===n})),a.label=1;case 1:a.trys.push([1,6,7,8]),t=s(e),n=t.next(),a.label=2;case 2:return n.done?[3,5]:(r=n.value,this.logger.info(B.L_GET_STATIC_CONF_T,JSON.stringify({url:r})),i=Date.now(),[4,this.sendRequest("".concat(r,"/").concat(this.appkey))]);case 3:if(o=a.sent(),c=o.code,d=o.data,200===c)return this.logger.info(B.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:c,duration:Date.now()-i})),[2,d];this.logger.warn(B.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:c,duration:Date.now()-i})),a.label=4;case 4:return n=t.next(),[3,2];case 5:return[3,8];case 6:return _=a.sent(),f={error:_},[3,8];case 7:try{n&&!n.done&&(h=t.return)&&h.call(t)}finally{if(f)throw f.error}return[7];case 8:return[2]}}))}))}}),e}();!function(e){e[e.STATISTICS=-2]="STATISTICS",e[e.RECORD=-1]="RECORD",e[e.FATAL=0]="FATAL",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG"}(Qn||(Qn={}));var $n,er,tr=function(){function e(e,t,n,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:n}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:Qn.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Qn.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Qn.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Qn.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Qn.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Qn.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,n=e.level,r=e.content,i=e.traceId;/^[\w-]+$/.test(t)?n!==Qn.DEBUG&&this.logDB.write(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(r," | ").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 gt}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,n=e.tag,r=e.content,i=e.traceId,o=e.level,a=e.loggerId;if(console&&!(o<=Qn.FATAL||o>this.outputLevel)){var s=["error","warn","info","debug"][o-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=a?a:this._id,"][").concat((s||"stat").toUpperCase(),"]: ").concat(n," | ").concat(r," | ").concat(i);console[s||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[Qn.DEBUG,Qn.INFO,Qn.WARN,Qn.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,n,r){var i={time:Date.now(),level:e,tag:t,content:n,traceId:r,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,n,i,o,a){if(void 0===i&&(i={}),t.isOk){var s=null==o?void 0:o(t.data);this.info(e,JSON.stringify(r(r({isOk:!0},i),s)),n)}else{s=null==a?void 0:a(t.data);this.warn(e,JSON.stringify(r(r({code:t.code,msg:t.msg},i),s)),n)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),nr=function(){function e(e,t,n,r,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:n}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),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,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:i=[],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.logDB.read(e,t,n,r,s)];case 2:return o=a.sent(),Rt(o.logs)&&(i=o.logs.filter((function(e){return!(!e||"object"!=typeof e)}))),[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{logs:i}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(n=Zn.getLogUrlPolicyList(e,this.logger),r=n.policy,i=n.addrs,this.started=!0,this.itvByNavi=r.itv,this.timesByNavi=r.times,i.length>0&&this.realtimeReport(i[0].addr,r.level,r.itv,t)),[2])}))}))}}),Object.defineProperty(e.prototype,"_sendLogs2Realtime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,_,f,h;return a(this,(function(a){switch(a.label){case 0:return[4,this.compressLogs(e)];case 1:return i=a.sent(),o=i.success,s=i.data,o?(u=Nt(n)?n:"https://".concat(n),u+="?version=".concat("5.32.1-c-test-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:u,body:s,method:"POST"})]):[2,{isOk:!1,itv:r}];case 2:if(l=a.sent(),c=l.status,d=l.data,200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(r+=r),this.reportFailedNumber++,[2,{isOk:!1,itv:r}];if(this.reportFailedNumber=0,d)try{(h=JSON.parse(d)).nextTime&&(r=h.nextTime),_=h.level,f=h.logSwitch}catch(e){this.logger.warn(B.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:r,level:_,logSwitch:f}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,c,d,_,f,h,g,p,E=this;return a(this,(function(a){switch(a.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||pt,s=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),[4,this._getLogs(o,s,t,!0,c,r)];case 1:return 0!==(d=a.sent().logs).length?[3,2]:[3,4];case 2:return d.length>0?[4,this._sendLogs2Realtime(d,c,e,n)]:[3,4];case 3:_=a.sent(),f=_.itv,h=_.level,g=_.logSwitch,_.isOk&&(p=Math.max.apply(Math,l([],u(d.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(p+1),0===g&&(this.started=!1),void 0!==h&&(t=h)),n=f,a.label=4;case 4:return this.started&&(n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return E.realtimeReport(e,t,n,r)}),1e3*n)),[2]}}))}))}}),Object.defineProperty(e.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s,u){return void 0===u&&(u=!1),o(this,void 0,void 0,(function(){var o,l,c,d,_,f,h,g;return a(this,(function(a){switch(a.label){case 0:return"web"!==n.toLowerCase()||this.disableLogReport?[2]:(o=this.logger.createTraceId(),this.logger.info(B.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:s,isCloudControl:u}),o),[4,this._getLogs(e,t,Qn.DEBUG,!1,o)]);case 1:return l=a.sent().logs,this.logger.info(B.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),o),c=Nt(r)?r:"https://".concat(r),c+="?version=".concat("5.32.1-c-test-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),l.length>0?[4,this.compressLogs(l)]:[3,3];case 2:return _=a.sent(),f=_.success,h=_.data,d=f?h:"compress failed",[3,4];case 3:d="no data or no database",a.label=4;case 4:return this.logger.debug(B.L_REPORT_FULL_LOG_O,"compress done",o),u&&(c+="&source=cloud"),[4,this.send({url:c,body:d,method:"POST"})];case 5:return g=a.sent().status,this.logger.info(B.L_REPORT_FULL_LOG_R,JSON.stringify({status:g}),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}(),rr=function(e){var t=e.sessionId,n=e.level,r=e.loggerId,i=e.traceId,o=e.time,a=e.tag,s=e.type,u=e.content;Et(u)||(u=JSON.stringify(u));var l=n<0?u||"":JSON.stringify({content:u,traceId:i,from:r});return l='"'.concat(l.replace(/"/g,'""'),'"'),"".concat(t,",").concat(o,",").concat(s,",").concat(n,",").concat(a,",").concat(l,"\n")};function ir(e){try{return!(!e||"object"!=typeof e)&&("number"==typeof e.time&&("string"==typeof e.tag&&("string"==typeof e.sessionId&&("string"==typeof e.type&&"number"==typeof e.level))))}catch(e){return!1}}function or(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{logs:[]}]}))}))}function ar(){}var sr=function(){function e(e,t){$n.set(this,void 0),er.set(this,void 0),d(this,$n,e,"f"),d(this,er,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,c(this,$n,"f").call(this,e,t,n,r,i)];case 1:return(o=a.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(ir)}]:[2,{logs:[]}];case 2:return s=a.sent(),console.error("[LogDBProxy] read error",s),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{c(this,er,"f").call(this,e)}catch(e){console.error("[LogDBProxy] write error",e)}}}),Object.defineProperty(e.prototype,"setLogReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&d(this,$n,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&d(this,er,e,"f"),this}}),e}();function ur(){return new sr(or,ar)}$n=new WeakMap,er=new WeakMap;var lr,cr=function(){function e(){}var t,n,r,i,o,a;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,t,"f",n)||(d(this,t,e,"f",n),e.info(B.L_EVENT_LOOP_BLOCKING_S,"start"),c(this,t,"m",a).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,t,"f",n)&&(c(this,t,"f",n).info(B.L_EVENT_LOOP_BLOCKING_S,"stop"),d(this,t,null,"f",n),c(this,t,"f",r)&&(clearTimeout(c(this,t,"f",r)),d(this,t,null,"f",r)))}}),t=e,a=function e(){var a=this,s=Date.now();d(this,t,setTimeout((function(){var r=Date.now()-s;r>=c(a,t,"f",o)&&c(a,t,"f",n).warn(B.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(r,"ms")),c(a,t,"m",e).call(a)}),c(this,t,"f",i)),"f",r)},n={value:null},r={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"}(lr||(lr={}));var dr=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,n,r,i,o=this;this.taskLock=!1;var a=null!==(t=e.startTime)&&void 0!==t?t:0,s=null!==(n=e.endTime)&&void 0!==n?n:0,u=null!==(r=e.platform)&&void 0!==r?r:"",l=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==l&&(this.logId=e.logId,this.reporter.report(a,s,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 _r,fr,hr,gr,pr=function(){function e(e,t,n){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:n}),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 dr(n)}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===me.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,Ct(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,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,_,f;return a(this,(function(a){switch(a.label){case 0:return!this.isEable&&t===lr.init&&this.isExire()?(this.logger.info(B.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===lr.newWorkChange&&this.isOverclock()?(this.logger.info(B.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(r=cn(e),this.lastRequestTime=(new Date).getTime(),i="".concat(r,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},n&&(o["RC-Token"]=n),s={platform:"web",version:"5.32.1-c-test-alpha.1",timestamp:this.timestamp},this.logger.record(ve.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!n,uri:i})),[4,this.httpRequest(i,Ge.POST,o,s)]);case 1:return u=a.sent(),l=u.code,c=u.data,this.logger.record(ve.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===x.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(d=c.targetRegion,this.changeAreaCode===d?[2,this.timestamp]:(_=Zn.setAreaCode(d),this.logger.info(B.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:_,originAreaCode:Zn.getAreaCode(),newAreaCode:d})),this.changeAreaCode=d,(f=Zn.getCloudControllerUrl(d))[0]?[2,this.request(f[0],lr.other)]:(this.logger.info(B.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}(),Er=function(e){return e===x.RC_CONN_REDIRECTED},br=function(e){function n(t,n,r){var i=e.call(this)||this;return _r.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:n}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),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:""}),gr.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:De.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:ge.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(n,e),Object.defineProperty(n.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(n.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(n.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===ge.DISCONNECTED&&e===ge.CONNECTING&&(this._doConnectReason=Pe.CONNECT,c(this,_r,"m",hr).call(this)),this._crtConnectionStatus===ge.CONNECTED&&e===ge.SUSPENDED&&(t===x.RC_PING_EXCEED_LIMIT?this._doConnectReason=Pe.TIMEOUT:t===x.RC_CONN_REDIRECTED?this._doConnectReason=Pe.REDIRECTED:this._doConnectReason=Pe.RECONNECT),this._crtConnectionStatus===ge.CONNECTED){var n={bid:un(),cod:t,net:this.getNetwork().type,dur:Date.now()-c(this,gr,"f"),cid:this.cid};this.logger.record(ve.IM_CONNECTION_DURATION,JSON.stringify(n)),e===ge.SUSPENDED&&c(this,_r,"m",hr).call(this)}switch(this._crtConnectionStatus=e,e){case ge.CONNECTED:this.logger.info(B.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),c(this,_r,"m",fr).call(this).emit("onConnected",this._fromSuspend);break;case ge.CONNECTING:this.logger.warn(B.L_CONNECT_S,"status: ".concat(e)),c(this,_r,"m",fr).call(this).emit("onConnecting");break;case ge.SUSPENDED:this._fromSuspend=!0,this.logger.warn(B.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),Er(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,_r,"m",fr).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(B.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,_r,"m",fr).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(n.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(n.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===ge.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t){var n={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(ve.IM_NETWORK_CHANGE,JSON.stringify(n))}this._network=e}}),Object.defineProperty(n.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(n.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus===ge.CONNECTED?[2,vn(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=n,this.token=e,this.setConnectionStatus(ge.CONNECTING),[4,this.try2Connect(e,t,!1,r,!0)]);case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?(this.setConnectionStatus(ge.DISCONNECTED,o),[2,Rn(o)]):(this.setConnectionStatus(ge.CONNECTED),[2,vn(s)])}}))}))}}),Object.defineProperty(n.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,n,r,i),[4,this._crtConnectionTask]);case 1:return o=a.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(n.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c,_,f,h,g,p;return a(this,(function(a){switch(a.label){case 0:return o={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(ve.IM_STATS_CS,JSON.stringify(o)),s={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,n,!1,r,s)];case 1:return u=a.sent(),l=u.code,c=u.data,l!==x.SUCCESS?[2,Rn(l)]:1===(_=c).type?[2,Rn(x.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(B.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,this._connectWithToken(e.replace(/@.+$/,"@"),_,t,r)]);case 2:return f=a.sent(),h=f.code,g=f.data,i||h===x.SUCCESS||(this.retryCount+=1),Er(h)?(this.logger.warn(B.L_CONNECT_R,"redirect code: ".concat(h),r),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,r,i)]):[x.RC_TCP_RESET,x.RC_CONN_ACK_TIMEOUT,x.RC_TCP_DISCONNECTED_NO_RMTP,x.CONNECTION_REFUSED].includes(h)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),p=this.cmpWeightCache.every((function(e){return e.failed})),i&&p?(this.logger.warn(B.L_CONNECT_R,"cpp code:".concat(h,",reture code:").concat(x.SERVER_UNAVAILABLE),r),[2,Rn(x.SERVER_UNAVAILABLE)]):(this.logger.warn(B.L_CONNECT_R,"cmp ack timeout, code: ".concat(h),r),this.setConnectionStatus(ge.SUSPENDED,h),this.setConnectionStatus(ge.CONNECTING),[2,this.createConnectionTask(e,t,!1,r,i)])):h!==x.SUCCESS?(this.logger.warn(B.L_CONNECT_R,"code: ".concat(h),r),[2,Rn(h)]):(this.logger.info(B.L_CONNECT_R,"userId: ".concat(g),r),d(this,gr,Date.now(),"f"),this._crtUserId=g,[2,vn(g)])}}))}))}}),Object.defineProperty(n.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){return n=this.logger.createTraceId(),this.logger.debug(B.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),n),this.stopReconnectTimer(),r=function(){return o(i,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus!==ge.SUSPENDED?[2]:(this.setConnectionStatus(ge.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,n,!1)]);case 1:return i=a.sent(),o=i.code,s=i.isOk,this.reconnectTimer=null,s?(this.setConnectionStatus(ge.CONNECTED),[2]):[x.SERVER_UNAVAILABLE,x.TIMEOUT,x.RC_SOCKET_DISCONNECTED,x.RC_SOCKET_NOT_CREATED,x.RC_CONN_ACK_TIMEOUT,x.RC_TCP_RESET,x.RC_NAVI_REQ_FAILED,x.RC_NETWORK_DOWN,x.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==ge.CONNECTING||(this.setConnectionStatus(ge.SUSPENDED,o),this.reconnectTimer=setTimeout(r,5e3)),[2]):(this.setConnectionStatus(ge.DISCONNECTED,o),[2])}}))}))},r(),[2]}))}))}}),Object.defineProperty(n.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;return Er(e)?(this.setConnectionStatus(ge.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===x.RC_UDP_DISCONNECTED?(this.setConnectionStatus(ge.SUSPENDED,e),void setTimeout((function(){n.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(ge.DISCONNECTED,e)}}),Object.defineProperty(n.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(ge.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(n.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return this._crtConnectionStatus!==ge.CONNECTED?(this._failedCount=0,this.logger.debug(B.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(B.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=r.sent())===x.SUCCESS?(this.logger.debug(B.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return n.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==ge.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(B.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(B.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return r.sent(),this.setConnectionStatus(ge.SUSPENDED,x.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,x.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(n.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:n.sent(),n.label=2;case 2:return this.setConnectionStatus(ge.DISCONNECTED,x.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(n.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(n.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 n=Ht(e,t);return this.cmpWeightCache=l([],u(n),!1),l([],u(n),!1)}}),Object.defineProperty(n.prototype,"updateCmpWeight",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(this.cmpWeightCache){var r=this.cmpWeightCache.find((function(t){return n?t.addr===e&&t.protocol===H.QUIC:t.addr===e}));if(r)if(t){var i=Math.max.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==i&&(r.weight=i+1)}else{var o=Math.min.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==o&&(r.weight=o-1),r.failed=!0}}}}),Object.defineProperty(n.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(n.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){this.token=e,this._openCallPlus=n,this.onDisconenctUnusual(r)}}),n}(pn);gr=new WeakMap,_r=new WeakSet,fr=function(){return this},hr=function(){this.uuid=ht.gen(),this.retryCount=0};var Tr=function(e){return e.replace(/@.+$/,"@")},vr=function(){function e(e,t,n,r,i,o){void 0===r&&(r=!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:n}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:r}),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,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,n,r,i),[4,this.crtRequest]);case 1:return o=a.sent(),this.crtRequest=null,[2,o]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){var s;return o(this,void 0,void 0,(function(){var o,u,l,c,d,_,f,h,g,p,E,b,T,v,R,I,m;return a(this,(function(a){switch(a.label){case 0:return o=Tr(e),u=this.getNaviCache(o),!t&&u&&(l=u.timestamp,c=u.naviInfo,n||Date.now()-l<Be)?(this.logger.info(B.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),r),i&&(d=i.uuid,_=i.retryCount,f=i.reason,h={bid:un(),ptc:Se.NAVI,cod:x.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(s=c.type)&&void 0!==s?s:0,hos:"",cache:Oe.LOCAL,v:Ne.CURRENT,rsn:f,cid:"".concat(d,"_").concat(_),count:_},this.logger.record(ve.IM_NAVI,JSON.stringify(h),r)),[2,vn(c)]):(g=Zn.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(B.L_GET_NAVI_T,JSON.stringify({token:e,uris:g}),r),[4,this.requestHandler(g,e,r,i)]);case 1:return p=a.sent(),E=p.code,b=p.data,E===x.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(T=a.sent())?void 0:T.navi)&&(null==T?void 0:T.navi.length)>0?(v=T.navi,[4,this.requestHandler(v,e,r,i)]):[3,4];case 3:R=a.sent(),E=R.code,b=R.data,a.label=4;case 4:return E!==x.SUCCESS?(this.logger.warn(B.L_GET_NAVI_R,E,r),[2,Rn(E)]):(I=b).code&&200!==I.code?(this.logger.warn(B.L_GET_NAVI_R,I.code,r),[2,Rn(this.transHttpCode(I.code))]):Ht(I).length>0?(this.logger.info(B.L_GET_NAVI_R,JSON.stringify({naviInfo:I}),r),this.setNaviCache(o,I),[2,vn(I)]):(m={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(B.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(m)),r),[2,Rn(x.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,_,f;return a(this,(function(a){switch(a.label){case 0:i=0,o=e.length,a.label=1;case 1:return i<o?(s=i===e.length-1,u=this.useV2Navi()?this.httpRequestV2:this.httpRequest,l=Date.now(),[4,u.call(this,e[i],this.appkey,t,n,s)]):[3,4];case 2:if(c=a.sent(),d=c.code,_=c.data,f={bid:un(),ptc:Se.NAVI,cod:d,net:null==r?void 0:r.type,dur:Date.now()-l,spr:0,pr:(null==_?void 0:_.type)||0,hos:e[i],cache:Oe.REQUEST,v:Ne.CURRENT,rsn:null==r?void 0:r.reason,cid:"".concat(null==r?void 0:r.uuid,"_").concat(null==r?void 0:r.retryCount),count:null==r?void 0:r.retryCount},this.logger.record(ve.IM_NAVI,JSON.stringify(f),n),[x.SUCCESS,x.RC_CONN_TOKEN_INCORRECT,x.RC_LICENSE_EXPIRED].includes(d))return[2,d===x.SUCCESS?vn(_):Rn(d)];a.label=3;case 3:return i+=1,[3,1];case 4:return[2,Rn(x.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 x.RC_CONN_TOKEN_INCORRECT;case 416:return x.RC_LICENSE_EXPIRED;default:return x.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(Tr(e));return t?t.naviInfo:null}}),Object.defineProperty(e.prototype,"updateVoipCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.getNaviInfoFromCache(e);n&&this.setNaviCache(Tr(e),r(r({},n),{voipCallInfo:t}))}}),Object.defineProperty(e.prototype,"getNaviV2RequestOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=e.uri,r=e.token,i=e.platform,o=e.protocol,a=e.mac;t="".concat(n,"/v2/navi.json?cloud=").concat(0);var s="token=".concat(encodeURIComponent(r),"&v=").concat(Ye,"&platfrom=").concat(i);return a&&(s+="&m=".concat(a)),{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:s,url:t,timeout:1e4}}}),Object.defineProperty(e.prototype,"useV2Navi",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),Rr=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 Ir(e){return Rr.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function mr(e){return Rr.has(e)}var yr,Ar,Sr,Or={MECHANICAL:0,INTELLIGENT:1},Nr=function(){function e(e,t,n,r){Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sourceLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"targetLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.identifier=e,this.sourceLanguage=t||"auto",this.targetLanguage=n,this.text=r}return Object.defineProperty(e.prototype,"isValid",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"string"==typeof this.identifier&&this.identifier.length>0&&"string"==typeof this.sourceLanguage&&(void 0===this.targetLanguage||"string"==typeof this.targetLanguage)&&(e?"string"==typeof this.text:void 0===this.text||"string"==typeof this.text)}}),Object.defineProperty(e.prototype,"toInnerParam",{enumerable:!1,configurable:!0,writable:!0,value:function(){return{identifier:this.identifier,sourceLanguage:this.sourceLanguage,targetLanguage:this.targetLanguage,content:this.text}}}),e}(),Cr=function(e){function n(t,n,r,i){return e.call(this,t,n,r,i)||this}return t(n,e),n}(Nr),Pr=function(e){function n(t,n,r){return e.call(this,xn(t),n,r,t)||this}return t(n,e),n}(Nr),Lr={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},wr={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2},Mr=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,r=t.length;n<r;n++)if(!e[t[n]])return!1;return!0}(uni))},Ur=function(){function e(e){yr.add(this),Ar.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(this,Ar,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 a(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,c(this,yr,"m",Sr).call(this,e,c(this,Ar,"f"))]}))}))}}),e}();Ar=new WeakMap,yr=new WeakSet,Sr=function e(t,n){return o(this,void 0,void 0,(function(){var r,i,s,u=this;return a(this,(function(l){switch(l.label){case 0:return 0===t.length?[2,Rn(x.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(r=t.shift(),i=cn(r.addr,r.protocol),i="".concat(i,"/v3/message/get_stream.json?sdkVersion=").concat("5.32.1-c-test-alpha.1","&platform=Websocket&messageUID=").concat(n.msgUId),this._logger.info(B.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(i)),[4,this._openHandler(i,n)]);case 1:return[2,(s=l.sent()).or((function(r){return o(u,void 0,void 0,(function(){return a(this,(function(i){return-1===r?[2,c(this,yr,"m",e).call(this,t,n)]:[2,s]}))}))}))]}}))}))};var Dr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s=this;return a(this,(function(a){return n=Sn(),r=n.resolve,i=n.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){s._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),r(Rn(-1,"timeout"))},o.onreadystatechange=function(n){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),a=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&a){r(vn());var u=0;o.onprogress=function(e){var n=o.response.slice(u);u=o.response.length,t.onRawContent(n)},o.onerror=function(n){s._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(x.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);r(Rn(e.code,e.message))}}},o.onerror=function(t){s._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),r(Rn(-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]}))}))}}),n}(Ur),Gr=Mr();var Vr=null,jr=function(e){return o(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return[4,xr.getNetworkType()];case 1:return t=n.sent(),Vr({status:"online"===e.type,type:t}),[2]}}))}))};var kr,xr={tag:"browser",httpReq:function(e){return Fn(e).result()},get localStorage(){return localStorage},get sessionStorage(){return sessionStorage},useNavi:!0,connectPlatform:"",isFromUniapp:Gr,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",Promise.resolve(vn({id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,r=t.reason;e(n,r)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}))},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:De.UNKONWN},t=e.type,n=e.effectiveType,r=t||n||De.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){Vr=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",jr),window.addEventListener("online",jr))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",jr),window.removeEventListener("online",jr)),Vr=null},createSSEClient:function(e){return vn(new Dr(e))},getApiVer:function(){var e=xr.runtimeInfo,t=e.type,n=e.version;return"|".concat(t,"|").concat(n)},get runtimeInfo(){var e,t,n=navigator.userAgent,r={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 r)if(r.hasOwnProperty(i)){var o=n.match(r[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.transLan=24]="transLan",e[e.autoTrans=25]="autoTrans",e[e.pullUS=26]="pullUS",e[e.sendMsgRead=27]="sendMsgRead",e[e.qryMsgRead=28]="qryMsgRead",e[e.qryMsgReadCntBatch=29]="qryMsgReadCntBatch",e[e.updRTime=30]="updRTime",e[e.qryRLBatch=31]="qryRLBatch",e[e.chatMsgS=32]="chatMsgS",e[e.qrySessionsAtt=33]="qrySessionsAtt",e[e.pullMsg=34]="pullMsg",e[e.qrySessions=35]="qrySessions",e[e.delSessions=36]="delSessions",e[e.delMsg=37]="delMsg",e[e.delUgMsg=38]="delUgMsg",e[e.delUgSe=39]="delUgSe",e[e.updRRTime=40]="updRRTime",e[e.qrySessionsUnread=41]="qrySessionsUnread",e[e.setTypeUnpush=42]="setTypeUnpush",e[e.chrmPull=43]="chrmPull",e[e.joinChrm=44]="joinChrm",e[e.joinChrmR=45]="joinChrmR",e[e.exitChrm=46]="exitChrm",e[e.queryChrmI=47]="queryChrmI",e[e.setKV=48]="setKV",e[e.delKV=49]="delKV",e[e.setKVS=50]="setKVS",e[e.delKVS=51]="delKVS",e[e.pullKV=52]="pullKV",e[e.qryRelation=53]="qryRelation",e[e.qryRelationR=54]="qryRelationR",e[e.qryRelationFilter=55]="qryRelationFilter",e[e.delRelation=56]="delRelation",e[e.delRelationBatch=57]="delRelationBatch",e[e.pullSeAtts=58]="pullSeAtts",e[e.setSeAtt=59]="setSeAtt",e[e.qnTkn=60]="qnTkn",e[e.qnUrl=61]="qnUrl",e[e.aliUrl=62]="aliUrl",e[e.s3Url=63]="s3Url",e[e.stcUrl=64]="stcUrl",e[e.minioUrl=65]="minioUrl",e[e.cleanPMsg=66]="cleanPMsg",e[e.cleanGMsg=67]="cleanGMsg",e[e.cleanCMsg=68]="cleanCMsg",e[e.cleanSMsg=69]="cleanSMsg",e[e.cleanMCMsg=70]="cleanMCMsg",e[e.cleanMPMsg=71]="cleanMPMsg",e[e.cleanMsgBatch=72]="cleanMsgBatch",e[e.rtcPing=73]="rtcPing",e[e.rtc_ntf=74]="rtc_ntf",e[e.rtcSetOutData=75]="rtcSetOutData",e[e.rtcQryUserOutData=76]="rtcQryUserOutData",e[e.addSeTag=77]="addSeTag",e[e.delSeTag=78]="delSeTag",e[e.addTag=79]="addTag",e[e.delTag=80]="delTag",e[e.reportsdk=81]="reportsdk",e[e.pullUgSes=82]="pullUgSes",e[e.pullUgMsg=83]="pullUgMsg",e[e.ugMsg=84]="ugMsg",e[e.qryUgMsg=85]="qryUgMsg",e[e.updUgRTime=86]="updUgRTime",e[e.upMsgEx=87]="upMsgEx",e[e.modifyMsg=88]="modifyMsg",e[e.qryMsgChange=89]="qryMsgChange",e[e.qryMsg=90]="qryMsg",e[e.operate=91]="operate",e[e.s_opNtf=92]="s_opNtf",e[e.ugUnpushQuery=93]="ugUnpushQuery",e[e.ugUnpushSet=94]="ugUnpushSet",e[e.setRtcRoomId=95]="setRtcRoomId",e[e.qryUgUal=96]="qryUgUal",e[e.updUserSub=97]="updUserSub",e[e.pullUserSub=98]="pullUserSub",e[e.pullSubData=99]="pullSubData",e[e.qrySubData=100]="qrySubData",e[e.pullUserProfile=101]="pullUserProfile",e[e.pullOwnProfile=102]="pullOwnProfile",e[e.updProfilePermiss=103]="updProfilePermiss",e[e.qProfilePermiss=104]="qProfilePermiss",e[e.searchUserProfile=105]="searchUserProfile",e[e.updUserProfile=106]="updUserProfile",e[e.pullEventChange=107]="pullEventChange",e[e.channelCreate=108]="channelCreate",e[e.upChannelInfo=109]="upChannelInfo",e[e.qChannelInfo=110]="qChannelInfo",e[e.channelMemKick=111]="channelMemKick",e[e.channelMemQuit=112]="channelMemQuit",e[e.channelDismiss=113]="channelDismiss",e[e.channelTransfer=114]="channelTransfer",e[e.upChannelManager=115]="upChannelManager",e[e.qChannelMem=116]="qChannelMem",e[e.qChannelSpeMem=117]="qChannelSpeMem",e[e.upChannelMem=118]="upChannelMem",e[e.channelMemJoin=119]="channelMemJoin",e[e.channelMemInvite=120]="channelMemInvite",e[e.channelApplyResp=121]="channelApplyResp",e[e.qChannelApplyList=122]="qChannelApplyList",e[e.qChannelMemJoin=123]="qChannelMemJoin",e[e.qChannelMemSpeJoin=124]="qChannelMemSpeJoin",e[e.upChannelRemark=125]="upChannelRemark",e[e.qChannelRemark=126]="qChannelRemark",e[e.upChannelFollow=127]="upChannelFollow",e[e.qChannelFollow=128]="qChannelFollow",e[e.qSimpleUserProfile=129]="qSimpleUserProfile",e[e.friendAdd=130]="friendAdd",e[e.friendDel=131]="friendDel",e[e.friendHandle=132]="friendHandle",e[e.friendSetPf=133]="friendSetPf",e[e.friendCheck=134]="friendCheck",e[e.friendsQuery=135]="friendsQuery",e[e.friendApplyDel=136]="friendApplyDel",e[e.friendsInfoQry=137]="friendsInfoQry",e[e.friendAuthSet=138]="friendAuthSet",e[e.friendAuthGet=139]="friendAuthGet",e[e.addUnpush=140]="addUnpush",e[e.qryUnpush=141]="qryUnpush",e[e.delUnpush=142]="delUnpush",e[e.s_pubCall=143]="s_pubCall",e[e.reqCall=144]="reqCall",e[e.pullKvMsg=145]="pullKvMsg",e[e.readReceipt=146]="readReceipt",e[e.qryReceipt=147]="qryReceipt",e[e.qryReceiptBatch=148]="qryReceiptBatch",e[e.upConvertMsg=149]="upConvertMsg",e[e.pullModifyMsg=150]="pullModifyMsg",e[e.qAppBot=151]="qAppBot",e[e.qBot=152]="qBot"}(kr||(kr={}));var Fr=function(e){var t=kr[e];return t},Br=function(e){return kr[e]},Hr=0,qr=1,Yr=2,Wr=3,Kr=4,Jr=5,Qr=6,Xr=7,Zr=12,zr=13,$r=14,ei=4,ti=3,ni="rtcRJoin_data",ri="rtcRExit",ii="rtcUPut",oi="rtcUDel",ai="rtcSetData",si="userSetData",ui="rtcQryData",li="rtcDelData",ci="rtcToken",di="rtcUserState",_i="rtcUList",fi="viewerJoinR",hi="viewerExitR",gi="rtcPullKv",pi="rtcIdentityChange",Ei="rtcInvite",bi="rtcCancelInvite",Ti="rtcInviteAnswer",vi="rtcEndInvite",Ri="rtcQueryJoined",Ii=0,mi=1,yi=2,Ai=3,Si=4,Oi=5,Ni=6,Ci=7,Pi=8,Li=9,wi=10,Mi=11,Ui=12,Di=13,Gi=14,Vi=15,ji=16,ki=17,xi=18,Fi=19,Bi=20,Hi=1,qi=2,Yi=4,Wi=5,Ki=6,Ji=7,Qi=8,Xi=9,Zi=function(){function e(){}return Object.defineProperty(e,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this._getBackAndByteSize(e),n=t.back,r=t.byteSize,i=0,o=n.length;i<o;i++)n[i]>255&&(n[i]&=255);return r<=255?[0,r].concat(n):[r>>8,255&r].concat(n)}}),Object.defineProperty(e,"_getBackAndByteSize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],n=0;if("string"==typeof e)for(var r=0,i=e.length;r<i;r++){var o=e.charCodeAt(r);o>=0&&o<=127?(n+=1,t.push(o)):o>=128&&o<=2047?(n+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(n+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:n,back:t}}}),Object.defineProperty(e,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,n,r=[],i=-1,o=e,a="";++i<o.length;){var s=Number(o[i]);if(s===(127&s)||(240&~s?224&~s?192&~s||(s=(s^=192)<<6|128^o[++i]):s=(s=(s^=224)<<6|128^o[++i])<<6|128^o[++i]:s=(s=(s=(s^=240)<<6|128^o[++i])<<6|128^o[++i])<<6|128^o[++i]),!Number.isFinite(s)||s<0||s>1114111||Math.floor(s)!==s)throw RangeError("Invalid code point: ".concat(s));s<=65535?r.push(s):(t=(s-=65536)>>10|55296,n=s%1024|56320,r.push(t,n)),(i+1===o.length||r.length>16384)&&(a+=String.fromCharCode.apply(null,r),r.length=0)}return a}}),e}(),zi=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="",n=0;n<2;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r.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="",n=0;n<8;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r}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 n=this._pool.subarray(t,this._position);return Zi.readUTF(n)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),$i=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=Zi.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}(),eo=function(){function e(e,t,n,r){void 0===t&&(t=qr),void 0===n&&(n=!1),void 0===r&&(r=!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:n}),Object.defineProperty(this,"dup",{enumerable:!0,configurable:!0,writable:!0,value:r})}return Object.defineProperty(e,"parse",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t>>4,(6&t)>>1,!(1&~t),(8&t)>0)}}),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}(),to=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,n){this.readMessage(e,t,n)}}),Object.defineProperty(e.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return{stream:e,length:t}}}),e}(),no=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 eo(e,Hr)}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 $i;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),ro=function(e){function n(){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(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(e.readByte(),this.status=e.readByte(),t<=n.MESSAGE_LENGTH)return{stream:e,length:t};if(r===ei){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(n,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),n}(to),io=function(e){function n(t){var n=e.call(this,$r)||this;return Object.defineProperty(n,"status",{enumerable:!0,configurable:!0,writable:!0,value:t}),n}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.writeArr([0,this.status])}}),n}(no),oo=function(e){function n(){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(n,e),Object.defineProperty(n.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(n,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),n}(to),ao=function(e){function n(){return e.call(this,Zr)||this}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),n}(no),so=function(e){function n(t){return e.call(this,t)||this}return t(n,e),n}(to),uo=function(e){function n(){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(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=256*e.readByte()+e.readByte();return this.messageId=parseInt(n.toString(),10),{stream:e,length:t}}}),n}(to),lo=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.messageId,n=255&t,r=(65280&t)>>8;e.writeByte(r),e.writeByte(n)}}),n}(no),co=function(e){function n(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(n,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(n,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(n,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),n.syncMsg=t.dup,n}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,n),this.pbData=t.readAll(),{stream:t,length:n}}}),n}(uo),_o=function(e){function n(t,n,r,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:r}),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 n?n:Br(n),o}return t(n,e),Object.defineProperty(n.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)}}),n}(lo),fo=function(e){function n(t,n,r){return e.call(this,Jr,t,r,n)||this}return t(n,e),n}(_o),ho=function(e){function n(t,n,r){return e.call(this,Wr,t,r,n)||this}return t(n,e),n}(_o),go=function(e){function n(){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(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.readMessage.call(this,t,n),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:n}}}),n}(uo),po=function(e){function n(t){var n=e.call(this,Kr)||this;return n.messageId=t,n}return t(n,e),n}(lo),Eo=function(e){function n(t){var n=e.call(this,Xr)||this;return n.messageId=t,n}return t(n,e),n}(lo),bo=function(e){function n(){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(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.readMessage.call(this,t,n),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:n}}}),n}(uo),To=function(e,t){var n=new Uint8Array(e),r=new zi(n),i=r.readByte(),o=function(e){var t,n=e.command;switch(n){case Yr:t=new ro(e);break;case Wr:t=new co(e);break;case Kr:t=new go(e);break;case Qr:t=new bo(e);break;case zr:t=new so(e);break;case $r:t=new oo(e);break;default:console.error("No support for deserializing ".concat(n," messages"))}return t}(eo.parse(i));return o&&o.read(r,n.length-1,t),o},vo=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=Sn(),r=n.resolve,i=n.promise,o=this._logger,a=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")))r(vn());else{var n=JSON.parse(e.data),i=n.code,o=n.message;r(Rn(i,o))}},fail:function(t){var n=t.errMsg,i=t.errno;o.warn(B.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:n,errno:i})),r(Rn(-1,t.errMsg))},complete:function(){o.debug(B.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return a.onChunkReceived((function(e){var n=Zi.readUTF(new Uint8Array(e.data));o.debug(B.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(n)),t.onRawContent(n)})),i}}),n}(Ur),Ro=Mr(),Io=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},mo={setItem:Io("setStorageSync"),getItem:Io("getStorageSync"),removeItem:Io("removeStorageSync"),clear:Io("clearStorageSync")},yo=null,Ao=function(e){var t=e.isConnected,n=e.networkType;yo({status:t,type:n})};var So={tag:"wechat",httpReq:function(e){var t=e.method||Ge.GET,n=e.timeout||He,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i);return new Promise((function(e){wx.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:mo,sessionStorage:mo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ro,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return Promise.resolve(vn({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),n.close()}))},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){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){yo=e,wx.onNetworkStatusChange(Ao)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(Ao),yo=null},createSSEClient:function(e){return vn(new vo(e))},get runtimeInfo(){return{type:So.tag,version:"Unknown"}}},Oo=Mr(),No=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var r=my[e]({key:t[0]}).data;return r?JSON.stringify(r):r}catch(e){}}},Co={setItem:No("setStorageSync"),getItem:No("getStorageSync"),removeItem:No("removeStorageSync"),clear:No("clearStorageSync")},Po=null,Lo=function(e){var t=e.isConnected,n=e.networkType;Po({status:t,type:n})};var wo={tag:"alipay",httpReq:function(e){var t=e.method||Ge.GET,n=e.timeout||He,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i),s=e.dataType||"json";return new Promise((function(e){my.request({url:a,method:t,headers:r,timeout:n,data:o,dataType:s,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:Co,sessionStorage:Co,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Oo,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return Promise.resolve(vn({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 n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){Po=e,my.onNetworkStatusChange(Lo)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Lo),Po=null},createSSEClient:function(e){return Rn(x.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:wo.tag,version:"Unknown"}}},Mo=Mr(),Uo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,l([],u(t),!1))}catch(e){}}},Do={setItem:Uo("setStorageSync"),getItem:Uo("getStorageSync"),removeItem:Uo("removeStorageSync"),clear:Uo("clearStorageSync")},Go=null,Vo=function(e){var t=e.isConnected,n=e.networkType;Go({status:t,type:n})};var jo={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Mo,localStorage:Do,sessionStorage:Do,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:x.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){return new Promise((function(n){var r=tt.connectSocket({url:e,protocols:t,fail:function(e){return n(Rn(x.RC_SOCKET_DISCONNECTED,e.errMsg))}});n(vn({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){r.close(),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 n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){Go=e,tt.onNetworkStatusChange(Vo)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Vo),Go=null},createSSEClient:function(e){return Rn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:jo.tag,version:"Unknown"}}},ko=Mr(),xo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,l([],u(t),!1))}catch(e){}}},Fo={setItem:xo("setStorageSync"),getItem:xo("getStorageSync"),removeItem:xo("removeStorageSync"),clear:xo("clearStorageSync")},Bo=null,Ho=function(e){var t=e.isConnected,n=e.networkType;Bo({status:t,type:n})};var qo={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ko,localStorage:Fo,sessionStorage:Fo,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 n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:x.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return Promise.resolve(vn({id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}))},getNetworkType:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Bo=e,swan.onNetworkStatusChange(Ho)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Ho),Bo=null},createSSEClient:function(e){return Rn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:qo.tag,version:"Unknown"}}},Yo=Mr(),Wo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Ko={setItem:Wo("setStorageSync"),getItem:Wo("getStorageSync"),removeItem:Wo("removeStorageSync"),clear:Wo("clearStorageSync")},Jo=null,Qo=function(e){var t=e.isConnected,n=e.networkType;Jo({status:t,type:n})};var Xo={tag:"jingdong",httpReq:function(e){var t=e.method||Ge.GET,n=e.timeout||He,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i);return new Promise((function(e){jd.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:Ko,sessionStorage:Ko,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Yo,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),Promise.resolve(vn({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 n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){Jo=e,jd.onNetworkStatusChange(Qo)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Qo),Jo=null},createSSEClient:function(e){return Rn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:Xo.tag,version:"Unknown"}}},Zo=Mr(),zo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return ks[e].apply(ks,l([],u(t),!1))}catch(e){}}},$o={setItem:zo("setStorageSync"),getItem:zo("getStorageSync"),removeItem:zo("removeStorageSync"),clear:zo("clearStorageSync")},ea=null,ta=function(e){var t=e.isConnected,n=e.networkType;ea({status:t,type:n})};var na={tag:"kuaishou",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Zo,localStorage:$o,sessionStorage:$o,httpReq:function(e){return new Promise((function(t){ks.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:x.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=ks.connectSocket({url:e,protocols:t});return Promise.resolve(vn({id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){ks.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){ea=e,ks.onNetworkStatusChange(ta)},removeNetworkStatusListener:function(){ks.offNetworkStatusChange(ta),ea=null},createSSEClient:function(e){return Rn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:na.tag,version:"Unknown"}}},ra=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},ia={setItem:ra("setStorageSync"),getItem:ra("getStorageSync"),removeItem:ra("removeStorageSync"),clear:ra("clearStorageSync")},oa=null,aa=function(e){var t=e.isConnected,n=e.networkType;oa({status:t,type:n})};var sa={tag:"uniapp",httpReq:function(e){var t=e.method||Ge.GET,n=e.timeout||He,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i);return new Promise((function(e){uni.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:ia,sessionStorage:ia,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,n=e.osName;return["app","app-plus"].includes(t)&&n||""},isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},r=uni.connectSocket(n);return Promise.resolve(vn({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){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(De.UNKONWN)}})}))},setNetworkStatusListener:function(e){oa=e,uni.onNetworkStatusChange(aa)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(aa),oa=null},createSSEClient:function(e){return Rn(x.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,n=e.deviceModel,r=e.deviceBrand,i=e.osVersion,o="android"===e.osName?t:i;return"".concat(r||"","|").concat(n||"","|").concat(o||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:sa.tag,version:"Unknown"}}},ua=function(e){return e&&e.request&&e.getSystemInfo},la="undefined"!=typeof uni&&ua(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return sa;case"mp-jd":return Xo;case"mp-baidu":return qo;case"mp-toutiao":return jo;case"mp-alipay":return wo;case"mp-weixin":return So;case"mp-kuaishou":return na;default:return xr}}():"undefined"!=typeof jd&&ua(jd)?Xo:"undefined"!=typeof my&&ua(my)?wo:"undefined"!=typeof tt&&ua(tt)?jo:"undefined"!=typeof ks&&ua(ks)?na:"undefined"!=typeof swan&&ua(swan)?qo:"undefined"!=typeof wx&&ua(wx)?So:xr;const ca=function(){var e,t={},n=function(e){var t=function(e,n,i){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===n&&(n=t.DEFAULT_ENDIAN),void 0===i&&(i=t.DEFAULT_NOASSERT),!i){if((e|=0)<0)throw RangeError("Illegal capacity");n=!!n,i=!!i}this.buffer=0===e?r:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=n,this.noAssert=i};t.VERSION="5.0.1",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var n=t.prototype;n.__isByteBuffer__,Object.defineProperty(n,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var r=new ArrayBuffer(0),i=String.fromCharCode;function o(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function a(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+i.apply(String,e);e.length+arguments.length>1024&&(t.push(i.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function s(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,d=n?i-1:0,_=n?-1:1,f=e[t+d];for(d+=_,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+d],d+=_,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+d],d+=_,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=l}return(f?-1:1)*a*Math.pow(2,o-r)}function u(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,d=c>>1,_=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,h=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?_/u:_*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=h,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[n+f]=255&a,f+=h,a/=256,l-=8);e[n+f-h]|=128*g}t.accessor=function(){return Uint8Array},t.allocate=function(e,n,r){return new t(e,n,r)},t.concat=function(e,n,r,i){"boolean"!=typeof n&&"string"==typeof n||(i=r,r=n,n=void 0);for(var o,a=0,s=0,u=e.length;s<u;++s)t.isByteBuffer(e[s])||(e[s]=t.wrap(e[s],n)),(o=e[s].limit-e[s].offset)>0&&(a+=o);if(0===a)return new t(0,r,i);var l,c=new t(a,r,i);for(s=0;s<u;)(o=(l=e[s++]).limit-l.offset)<=0||(c.view.set(l.view.subarray(l.offset,l.limit),c.offset),c.offset+=o);return c.limit=c.offset,c.offset=0,c},t.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},t.type=function(){return ArrayBuffer},t.wrap=function(e,r,i,o){if("string"!=typeof r&&(o=i,i=r,r=void 0),"string"==typeof e)switch(void 0===r&&(r="utf8"),r){case"base64":return t.fromBase64(e,i);case"hex":return t.fromHex(e,i);case"binary":return t.fromBinary(e,i);case"utf8":return t.fromUTF8(e,i);case"debug":return t.fromDebug(e,i);default:throw Error("Unsupported encoding: "+r)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var a;if(t.isByteBuffer(e))return(a=n.clone.call(e)).markedOffset=-1,a;if(e instanceof Uint8Array)a=new t(0,i,o),e.length>0&&(a.buffer=e.buffer,a.offset=e.byteOffset,a.limit=e.byteOffset+e.byteLength,a.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)a=new t(0,i,o),e.byteLength>0&&(a.buffer=e,a.offset=0,a.limit=e.byteLength,a.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(a=new t(e.length,i,o)).limit=e.length;for(var s=0;s<e.length;++s)a.view[s]=e[s]}return a},n.writeBitSet=function(e,t){var n=void 0===t;if(n&&(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)}var r,i=t,o=e.length,a=o>>3,s=0;for(t+=this.writeVarint32(o,t);a--;)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(s<o){var u=0;for(r=0;s<o;)r|=(1&!!e[s++])<<u++;this.writeByte(r,t++)}return n?(this.offset=t,this):t-i},n.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var n,r=this.readVarint32(e),i=r.value,o=i>>3,a=0,s=[];for(e+=r.length;o--;)n=this.readByte(e++),s[a++]=!!(1&n),s[a++]=!!(2&n),s[a++]=!!(4&n),s[a++]=!!(8&n),s[a++]=!!(16&n),s[a++]=!!(32&n),s[a++]=!!(64&n),s[a++]=!!(128&n);if(a<i){var u=0;for(n=this.readByte(e++);a<i;)s[a++]=!!(n>>u++&1)}return t&&(this.offset=e),s},n.readBytes=function(e,t){var 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)}var r=this.slice(t,t+e);return n&&(this.offset+=e),r},n.writeBytes=n.append,n.writeInt8=function(e,t){var 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)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},n.writeByte=n.writeInt8,n.readInt8=function(e){var t=void 0===e;if(t&&(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)}var n=this.view[e];return 128&~n||(n=-(255-n+1)),t&&(this.offset+=1),n},n.readByte=n.readInt8,n.writeUint8=function(e,t){var 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)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},n.writeUInt8=n.writeUint8,n.readUint8=function(e){var t=void 0===e;if(t&&(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)}var n=this.view[e];return t&&(this.offset+=1),n},n.readUInt8=n.readUint8,n.writeInt16=function(e,t){var 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)}t+=2;var r=this.buffer.byteLength;return t>r&&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},n.writeShort=n.writeInt16,n.readInt16=function(e){var t=void 0===e;if(t&&(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)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),32768&~n||(n=-(65535-n+1)),t&&(this.offset+=2),n},n.readShort=n.readInt16,n.writeUint16=function(e,t){var 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)}t+=2;var r=this.buffer.byteLength;return t>r&&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},n.writeUInt16=n.writeUint16,n.readUint16=function(e){var t=void 0===e;if(t&&(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)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),t&&(this.offset+=2),n},n.readUInt16=n.readUint16,n.writeInt32=function(e,t){var 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)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},n.writeInt=n.writeInt32,n.readInt32=function(e){var t=void 0===e;if(t&&(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)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),n|=0,t&&(this.offset+=4),n},n.readInt=n.readInt32,n.writeUint32=function(e,t){var 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)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},n.writeUInt32=n.writeUint32,n.readUint32=function(e){var t=void 0===e;if(t&&(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)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),t&&(this.offset+=4),n},n.readUInt32=n.readUint32,e&&(n.writeInt64=function(t,n){var r=void 0===n;if(r&&(n=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 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)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=t.low,a=t.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},n.writeLong=n.writeInt64,n.readInt64=function(t){var 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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=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,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=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);var o=new e(r,i,!1);return n&&(this.offset+=8),o},n.readLong=n.readInt64,n.writeUint64=function(t,n){var r=void 0===n;if(r&&(n=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 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)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=t.low,a=t.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},n.writeUInt64=n.writeUint64,n.readUint64=function(t){var 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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=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,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=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);var o=new e(r,i,!0);return n&&(this.offset+=8),o},n.readUInt64=n.readUint64),n.writeFloat32=function(e,t){var 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)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,u(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},n.writeFloat=n.writeFloat32,n.readFloat32=function(e){var t=void 0===e;if(t&&(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)}var n=s(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),n},n.readFloat=n.readFloat32,n.writeFloat64=function(e,t){var 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)}t+=8;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=8,u(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},n.writeDouble=n.writeFloat64,n.readFloat64=function(e){var t=void 0===e;if(t&&(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)}var n=s(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),n},n.readDouble=n.readFloat64,t.MAX_VARINT32_BYTES=5,t.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},t.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},t.zigZagDecode32=function(e){return e>>>1^-(1&e)},n.writeVarint32=function(e,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+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)}var i,o=t.calculateVarint32(e);n+=o;var a=this.buffer.byteLength;for(n>a&&this.resize((a*=2)>n?a:n),n-=o,e>>>=0;e>=128;)i=127&e|128,this.view[n++]=i,e>>>=7;return this.view[n++]=e,r?(this.offset=n,this):o},n.writeVarint32ZigZag=function(e,n){return this.writeVarint32(t.zigZagEncode32(e),n)},n.readVarint32=function(e){var t=void 0===e;if(t&&(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)}var n,r=0,i=0;do{if(!this.noAssert&&e>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}n=this.view[e++],r<5&&(i|=(127&n)<<7*r),++r}while(128&n);return i|=0,t?(this.offset=e,i):{value:i,length:r}},n.readVarint32ZigZag=function(e){var n=this.readVarint32(e);return"object"==typeof n?n.value=t.zigZagDecode32(n.value):n=t.zigZagDecode32(n),n},e&&(t.MAX_VARINT64_BYTES=10,t.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:n<1<<21?3:4:r<16384?r<128?5:6:r<1<<21?7:8:i<128?9:10},t.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()},t.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()},n.writeVarint64=function(n,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof n)n=e.fromNumber(n);else if("string"==typeof n)n=e.fromString(n);else if(!(n&&n instanceof e))throw TypeError("Illegal value: "+n+" (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)}"number"==typeof n?n=e.fromNumber(n,!1):"string"==typeof n?n=e.fromString(n,!1):!1!==n.unsigned&&(n=n.toSigned());var o=t.calculateVarint64(n),a=n.toInt()>>>0,s=n.shiftRightUnsigned(28).toInt()>>>0,u=n.shiftRightUnsigned(56).toInt()>>>0;r+=o;var l=this.buffer.byteLength;switch(r>l&&this.resize((l*=2)>r?l:r),r-=o,o){case 10:this.view[r+9]=u>>>7&1;case 9:this.view[r+8]=9!==o?128|u:127&u;case 8:this.view[r+7]=8!==o?s>>>21|128:s>>>21&127;case 7:this.view[r+6]=7!==o?s>>>14|128:s>>>14&127;case 6:this.view[r+5]=6!==o?s>>>7|128:s>>>7&127;case 5:this.view[r+4]=5!==o?128|s:127&s;case 4:this.view[r+3]=4!==o?a>>>21|128:a>>>21&127;case 3:this.view[r+2]=3!==o?a>>>14|128:a>>>14&127;case 2:this.view[r+1]=2!==o?a>>>7|128:a>>>7&127;case 1:this.view[r]=1!==o?128|a:127&a}return i?(this.offset+=o,this):o},n.writeVarint64ZigZag=function(e,n){return this.writeVarint64(t.zigZagEncode64(e),n)},n.readVarint64=function(t){var 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+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=t,i=0,o=0,a=0,s=0;if(i=127&(s=this.view[t++]),128&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)&&(o|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(a=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(a|=(127&(s=this.view[t++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|o<<28,o>>>4|a<<24,!1);return n?(this.offset=t,u):{value:u,length:t-r}},n.readVarint64ZigZag=function(n){var r=this.readVarint64(n);return r&&r.value instanceof e?r.value=t.zigZagDecode64(r.value):r=t.zigZagDecode64(r),r}),n.writeCString=function(e,t){var n=void 0===t;n&&(t=this.offset);var r,i=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;r<i;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");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)}i=c.calculateUTF16asUTF8(o(e))[1],t+=i+1;var a=this.buffer.byteLength;return t>a&&this.resize((a*=2)>t?a:t),t-=i+1,c.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,n?(this.offset=t,this):i},n.readCString=function(e){var t=void 0===e;if(t&&(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)}var n,r=e,i=-1;return c.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=a(),!0),t?(this.offset=e,n()):{string:n(),length:e-r}},n.writeIString=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");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)}var r,i=t;r=c.calculateUTF16asUTF8(o(e),this.noAssert)[1],t+=4+r;var a=this.buffer.byteLength;if(t>a&&this.resize((a*=2)>t?a:t),t-=4+r,this.littleEndian?(this.view[t+3]=r>>>24&255,this.view[t+2]=r>>>16&255,this.view[t+1]=r>>>8&255,this.view[t]=255&r):(this.view[t]=r>>>24&255,this.view[t+1]=r>>>16&255,this.view[t+2]=r>>>8&255,this.view[t+3]=255&r),t+=4,c.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),t!==i+4+r)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+r));return n?(this.offset=t,this):t-i},n.readIString=function(e){var n=void 0===e;if(n&&(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)}var r=e,i=this.readUint32(e),o=this.readUTF8String(i,t.METRICS_BYTES,e+=4);return e+=o.length,n?(this.offset=e,o.string):{string:o.string,length:e-r}},t.METRICS_CHARS="c",t.METRICS_BYTES="b",n.writeUTF8String=function(e,t){var n,r=void 0===t;if(r&&(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+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i=t;n=c.calculateUTF16asUTF8(o(e))[1],t+=n;var a=this.buffer.byteLength;return t>a&&this.resize((a*=2)>t?a:t),t-=n,c.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),r?(this.offset=t,this):t-i},n.writeString=n.writeUTF8String,t.calculateUTF8Chars=function(e){return c.calculateUTF16asUTF8(o(e))[0]},t.calculateUTF8Bytes=function(e){return c.calculateUTF16asUTF8(o(e))[1]},t.calculateString=t.calculateUTF8Bytes,n.readUTF8String=function(e,n,r){"number"==typeof n&&(r=n,n=void 0);var i=void 0===r;if(i&&(r=this.offset),void 0===n&&(n=t.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"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)}var o,s=0,u=r;if(n===t.METRICS_CHARS){if(o=a(),c.decodeUTF8(function(){return s<e&&r<this.limit?this.view[r++]:null}.bind(this),(function(e){++s,c.UTF8toUTF16(e,o)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=r,o()):{string:o(),length:r-u}}if(n===t.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}var l=r+e;if(c.decodeUTF8toUTF16(function(){return r<l?this.view[r++]:null}.bind(this),o=a(),this.noAssert),r!==l)throw RangeError("Illegal range: Truncated data, "+r+" == "+l);return i?(this.offset=r,o()):{string:o(),length:r-u}}throw TypeError("Unsupported metrics: "+n)},n.readString=n.readUTF8String,n.writeVString=function(e,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("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)}var i,a,s=n;i=c.calculateUTF16asUTF8(o(e),this.noAssert)[1],a=t.calculateVarint32(i),n+=a+i;var u=this.buffer.byteLength;if(n>u&&this.resize((u*=2)>n?u:n),n-=a+i,n+=this.writeVarint32(i,n),c.encodeUTF16toUTF8(o(e),function(e){this.view[n++]=e}.bind(this)),n!==s+i+a)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+i+a));return r?(this.offset=n,this):n-s},n.readVString=function(e){var n=void 0===e;if(n&&(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)}var r=e,i=this.readVarint32(e),o=this.readUTF8String(i.value,t.METRICS_BYTES,e+=i.length);return e+=o.length,n?(this.offset=e,o.string):{string:o.string,length:e-r}},n.append=function(e,n,r){"number"!=typeof n&&"string"==typeof n||(r=n,n=void 0);var i=void 0===r;if(i&&(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)}e instanceof t||(e=t.wrap(e,n));var o=e.limit-e.offset;if(o<=0)return this;r+=o;var a=this.buffer.byteLength;return r>a&&this.resize((a*=2)>r?a:r),r-=o,this.view.set(e.view.subarray(e.offset,e.limit),r),e.offset+=o,i&&(this.offset+=o),this},n.appendTo=function(e,t){return e.append(this,t),this},n.assert=function(e){return this.noAssert=!e,this},n.capacity=function(){return this.buffer.byteLength},n.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},n.clone=function(e){var n=new t(0,this.littleEndian,this.noAssert);return e?(n.buffer=new ArrayBuffer(this.buffer.byteLength),n.view=new Uint8Array(n.buffer)):(n.buffer=this.buffer,n.view=this.view),n.offset=this.offset,n.markedOffset=this.markedOffset,n.limit=this.limit,n},n.compact=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(0===e&&t===this.buffer.byteLength)return this;var n=t-e;if(0===n)return this.buffer=r,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var i=new ArrayBuffer(n),o=new Uint8Array(i);return o.set(this.view.subarray(e,t)),this.buffer=i,this.view=o,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this},n.copy=function(e,n){if(void 0===e&&(e=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,e<0||e>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+n+" <= "+this.buffer.byteLength)}if(e===n)return new t(0,this.littleEndian,this.noAssert);var r=n-e,i=new t(r,this.littleEndian,this.noAssert);return i.offset=0,i.limit=r,i.markedOffset>=0&&(i.markedOffset-=e),this.copyTo(i,0,e,n),i},n.copyTo=function(e,n,r,i){var o,a;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(n=(a=void 0===n)?e.offset:0|n,r=(o=void 0===r)?this.offset:0|r,i=void 0===i?this.limit:0|i,n<0||n>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+n+" <= "+e.buffer.byteLength);if(r<0||i>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+r+" <= "+this.buffer.byteLength);var s=i-r;return 0===s?e:(e.ensureCapacity(n+s),e.view.set(this.view.subarray(r,i),n),o&&(this.offset+=s),a&&(e.offset+=s),this)},n.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},n.fill=function(e,t,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=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 n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;t<n;)this.view[t++]=e;return r&&(this.offset=t),this},n.flip=function(){return this.limit=this.offset,this.offset=0,this},n.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},n.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},n.LE=function(e){return this.littleEndian=void 0===e||!!e,this},n.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},n.prepend=function(e,n,r){"number"!=typeof n&&"string"==typeof n||(r=n,n=void 0);var i=void 0===r;if(i&&(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)}e instanceof t||(e=t.wrap(e,n));var o=e.limit-e.offset;if(o<=0)return this;var a=o-r;if(a>0){var s=new ArrayBuffer(this.buffer.byteLength+a),u=new Uint8Array(s);u.set(this.view.subarray(r,this.buffer.byteLength),o),this.buffer=s,this.view=u,this.offset+=a,this.markedOffset>=0&&(this.markedOffset+=a),this.limit+=a,r+=a}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),r-o),e.offset=e.limit,i&&(this.offset-=o),this},n.prependTo=function(e,t){return e.prepend(this,t),this},n.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},n.remaining=function(){return this.limit-this.offset},n.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},n.resize=function(e){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)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),n=new Uint8Array(t);n.set(this.view),this.buffer=t,this.view=n}return this},n.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},n.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},n.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 n=this.clone();return n.offset=e,n.limit=t,n},n.toBuffer=function(e){var t=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(!e&&0===t&&n===this.buffer.byteLength)return this.buffer;if(t===n)return r;var i=new ArrayBuffer(n-t);return new Uint8Array(i).set(new Uint8Array(this.buffer).subarray(t,n),0),i},n.toArrayBuffer=n.toBuffer,n.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(n=t=e="utf8"),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var l=function(){for(var e={},t=[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],n=[],r=0,i=t.length;r<i;++r)n[t[r]]=r;return e.encode=function(e,n){for(var r,i;null!==(r=e());)n(t[r>>2&63]),i=(3&r)<<4,null!==(r=e())?(n(t[63&((i|=r>>4&15)|r>>4&15)]),i=(15&r)<<2,null!==(r=e())?(n(t[63&(i|r>>6&3)]),n(t[63&r])):(n(t[63&i]),n(61))):(n(t[63&i]),n(61),n(61))},e.decode=function(e,t){var r,i,o;function a(e){throw Error("Illegal character code: "+e)}for(;null!==(r=e());)if(void 0===(i=n[r])&&a(r),null!==(r=e())&&(void 0===(o=n[r])&&a(r),t(i<<2>>>0|(48&o)>>4),null!==(r=e()))){if(void 0===(i=n[r])){if(61===r)break;a(r)}if(t((15&o)<<4>>>0|(60&i)>>2),null!==(r=e())){if(void 0===(o=n[r])){if(61===r)break;a(r)}t((3&i)<<6>>>0|o)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();n.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 l.encode(function(){return e<t?this.view[e++]:null}.bind(this),n=a()),n()},t.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new t(e.length/4*3,n),i=0;return l.decode(o(e),(function(e){r.view[i++]=e})),r.limit=i,r},t.btoa=function(e){return t.fromBinary(e).toBase64()},t.atob=function(e){return t.fromBase64(e).toBinary()},n.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 n=[],r=[];e<t;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},t.fromBinary=function(e,n){if("string"!=typeof e)throw TypeError("str");for(var r,i=0,o=e.length,a=new t(o,n);i<o;){if((r=e.charCodeAt(i))>255)throw RangeError("illegal char code: "+r);a.view[i++]=r}return a.limit=o,a},n.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",a="";n<r;){if(-1!==n&&(i+=(t=this.view[n])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";a+=i+o+"\n",i=o=""}n===this.offset&&n===this.limit?i+=n===this.markedOffset?"!":"|":n===this.offset?i+=n===this.markedOffset?"[":"<":n===this.limit?i+=n===this.markedOffset?"]":">":i+=n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";a+=i+o+"\n"}return e?a:i},t.fromDebug=function(e,n,r){for(var i,o,a=e.length,s=new t((a+1)/3|0,n,r),u=0,l=0,c=!1,d=!1,_=!1,f=!1,h=!1;u<a;){switch(i=e.charAt(u++)){case"!":if(!r){if(d||_||f){h=!0;break}d=_=f=!0}s.offset=s.markedOffset=s.limit=l,c=!1;break;case"|":if(!r){if(d||f){h=!0;break}d=f=!0}s.offset=s.limit=l,c=!1;break;case"[":if(!r){if(d||_){h=!0;break}d=_=!0}s.offset=s.markedOffset=l,c=!1;break;case"<":if(!r){if(d){h=!0;break}d=!0}s.offset=l,c=!1;break;case"]":if(!r){if(f||_){h=!0;break}f=_=!0}s.limit=s.markedOffset=l,c=!1;break;case">":if(!r){if(f){h=!0;break}f=!0}s.limit=l,c=!1;break;case"'":if(!r){if(_){h=!0;break}_=!0}s.markedOffset=l,c=!1;break;case" ":c=!1;break;default:if(!r&&c){h=!0;break}if(o=parseInt(i+e.charAt(u++),16),!r&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[l++]=o,c=!0}if(h)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!r){if(!d||!f)throw TypeError("Illegal str: Missing offset or limit");if(l<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+a)}return s},n.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 n,r=new Array(t-e);e<t;)(n=this.view[e++])<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},t.fromHex=function(e,n,r){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(var i,o=e.length,a=new t(o/2|0,n),s=0,u=0;s<o;s+=2){if(i=parseInt(e.substring(s,s+2),16),!r&&(!isFinite(i)||i<0||i>255))throw TypeError("Illegal str: Contains non-hex characters");a.view[u++]=i}return a.limit=u,a};var c=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(n>>6&31|192),t(63&n|128)):n<65536?(t(n>>12&15|224),t(n>>6&63|128),t(63&n|128)):(t(n>>18&7|240),t(n>>12&63|128),t(n>>6&63|128),t(63&n|128)),n=null},decodeUTF8:function(e,t){for(var n,r,i,o,a=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(128&n)if(192==(224&n))null===(r=e())&&a([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))(null===(r=e())||null===(i=e()))&&a([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(o=e()))&&a([n,r,i,o]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}else t(n)},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(t(55296+((n-=65536)>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,n)}))},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,n)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,(function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4})),[n,r]}};return e}();return n.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{c.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),n=a())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return n()},t.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new t(c.calculateUTF16asUTF8(o(e),!0)[1],n,r),a=0;return c.encodeUTF16toUTF8(o(e),(function(e){i.view[a++]=e})),i.limit=a,i},t}(function(){function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var n={},r={};function i(e,t){var i,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=r[e])?o:(i=a(e,(0|e)<0?-1:0,!0),s&&(r[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(o=n[e])?o:(i=a(e,e<0?-1:0,!1),s&&(n[e]=i),i)}function o(e,t){if(isNaN(e)||!isFinite(e))return t?g:h;if(t){if(e<0)return g;if(e>=d)return v}else{if(e<=-_)return R;if(e+1>=_)return T}return e<0?o(-e,t).neg():a(e%c|0,e/c|0,t)}function a(t,n,r){return new e(t,n,r)}e.fromInt=i,e.fromNumber=o,e.fromBits=a;var s=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return h;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return u(e.substring(1),t,n).neg();for(var i=o(s(n,8)),a=h,l=0;l<e.length;l+=8){var c=Math.min(8,e.length-l),d=parseInt(e.substring(l,l+c),n);if(c<8){var _=o(s(n,c));a=a.mul(_).add(o(d))}else a=(a=a.mul(i)).add(o(d))}return a.unsigned=t,a}function l(t){return t instanceof e?t:"number"==typeof t?o(t):"string"==typeof t?u(t):a(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=l;var c=4294967296,d=c*c,_=d/2,f=i(1<<24),h=i(0);e.ZERO=h;var g=i(0,!0);e.UZERO=g;var p=i(1);e.ONE=p;var E=i(1,!0);e.UONE=E;var b=i(-1);e.NEG_ONE=b;var T=a(-1,2147483647,!1);e.MAX_VALUE=T;var v=a(-1,-1,!0);e.MAX_UNSIGNED_VALUE=v;var R=a(0,-2147483648,!1);e.MIN_VALUE=R;var I=e.prototype;return I.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){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(R)){var t=o(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=o(s(e,6),this.unsigned),a=this,u="";;){var l=a.div(i),c=(a.sub(l.mul(i)).toInt()>>>0).toString(e);if((a=l).isZero())return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}},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(){if(this.isNegative())return this.eq(R)?64:this.neg().getNumBitsAbs();for(var 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=l(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=l(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?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(R)?R:this.not().add(p)},I.neg=I.negate,I.add=function(e){t(e)||(e=l(e));var n=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,u=65535&e.high,c=e.low>>>16,d=0,_=0,f=0,h=0;return f+=(h+=o+(65535&e.low))>>>16,_+=(f+=i+c)>>>16,d+=(_+=r+u)>>>16,d+=n+s,a((f&=65535)<<16|(h&=65535),(d&=65535)<<16|(_&=65535),this.unsigned)},I.subtract=function(e){return t(e)||(e=l(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){if(this.isZero())return h;if(t(e)||(e=l(e)),e.isZero())return h;if(this.eq(R))return e.isOdd()?R:h;if(e.eq(R))return this.isOdd()?R:h;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(f)&&e.lt(f))return o(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,c=65535&e.high,d=e.low>>>16,_=65535&e.low,g=0,p=0,E=0,b=0;return E+=(b+=s*_)>>>16,p+=(E+=i*_)>>>16,E&=65535,p+=(E+=s*d)>>>16,g+=(p+=r*_)>>>16,p&=65535,g+=(p+=i*d)>>>16,p&=65535,g+=(p+=s*c)>>>16,g+=n*_+r*d+i*c+s*u,a((E&=65535)<<16|(b&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(e){if(t(e)||(e=l(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:h;var n,r,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return E;i=g}else{if(this.eq(R))return e.eq(p)||e.eq(b)?R:e.eq(R)?p:(n=this.shr(1).div(e).shl(1)).eq(h)?e.isNegative()?p:b:(r=this.sub(e.mul(n)),i=n.add(r.div(e)));if(e.eq(R))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();i=h}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),u=a<=48?1:s(2,a-48),c=o(n),d=c.mul(e);d.isNegative()||d.gt(r);)d=(c=o(n-=u,this.unsigned)).mul(e);c.isZero()&&(c=p),i=i.add(c),r=r.sub(d)}return i},I.div=I.divide,I.modulo=function(e){return t(e)||(e=l(e)),this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.not=function(){return a(~this.low,~this.high,this.unsigned)},I.and=function(e){return t(e)||(e=l(e)),a(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return t(e)||(e=l(e)),a(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return t(e)||(e=l(e)),a(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?a(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):a(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?a(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):a(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var n=this.high;return e<32?a(this.low>>>e|n<<32-e,n>>>e,this.unsigned):a(32===e?n:n>>>e-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:a(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,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},I.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e}());return t.ByteBuffer=n,t.Long=n.Long||null,t.VERSION="5.0.3",t.WIRE_TYPES={},t.WIRE_TYPES.VARINT=0,t.WIRE_TYPES.BITS64=1,t.WIRE_TYPES.LDELIM=2,t.WIRE_TYPES.STARTGROUP=3,t.WIRE_TYPES.ENDGROUP=4,t.WIRE_TYPES.BITS32=5,t.PACKABLE_WIRE_TYPES=[t.WIRE_TYPES.VARINT,t.WIRE_TYPES.BITS64,t.WIRE_TYPES.BITS32],t.TYPES={int32:{name:"int32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},uint64:{name:"uint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.UZERO:void 0},sint64:{name:"sint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},bool:{name:"bool",wireType:t.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:t.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:t.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.ZERO:void 0},float:{name:"float",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:t.WIRE_TYPES.STARTGROUP,defaultValue:null}},t.MAP_KEY_TYPES=[t.TYPES.int32,t.TYPES.sint32,t.TYPES.sfixed32,t.TYPES.uint32,t.TYPES.fixed32,t.TYPES.int64,t.TYPES.sint64,t.TYPES.sfixed64,t.TYPES.uint64,t.TYPES.fixed64,t.TYPES.bool,t.TYPES.string,t.TYPES.bytes],t.ID_MIN=1,t.ID_MAX=536870911,t.convertFieldsToCamelCase=!1,t.populateAccessors=!0,t.populateDefaults=!0,t.Util=((e={}).IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e),t.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]*)(?:\.[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},t.DotProto=function(e,t){var n={},r=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},i=r.prototype;i._readString=function(){var e='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;e.lastIndex=this.index-1;var n=e.exec(this.source);if(!n)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,n[1]},i.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,n,r;do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++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("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var i=this.index;if(t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;var o=this.source.substring(this.index,this.index=i);return'"'!==o&&"'"!==o||(this._stringOpen=o),o},i.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},i.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},i.omit=function(e){return this.peek()===e&&(this.next(),!0)},i.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},n.Tokenizer=r;var o=function(e){this.tn=new r(e),this.proto3=!1},a=o.prototype;function s(e,n){var r=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=i*r|0,!n&&r<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return r}function u(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return n*(1/0);if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function l(e,t,n){void 0===e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}return a.parse=function(){var e,n,r={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},i=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!i||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(!i)throw Error("unexpected 'import'");("public"===(e=this.tn.peek())||(n="weak"===e))&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n||r.imports.push(e);break;case"syntax":if(!i)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),i=!1;break;case"enum":this._parseEnum(r),i=!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()},a._readString=function(){var e,t,n="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},a._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return u(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},a._parseOption=function(e,n){var r=this.tn.next(),i=!1;if("("===r&&(i=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal option name: "+r);var o=r;i&&(this.tn.skip(")"),o="("+o+")",r=this.tn.peek(),t.FQTYPEREF.test(r)&&(o+=r,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,o),n||this.tn.skip(";")},a._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)l(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?l(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},a._parseService=function(e){var n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal service name at line "+this.tn.line+": "+n);var r={name:n,rpc:{},options:{}};for(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)},a._parseServiceRPC=function(e){var n="rpc",r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal rpc service method name: "+r);var i=r,o={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),"stream"===(r=this.tn.next()).toLowerCase()&&(o.request_stream=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal rpc service request type: "+r);if(o.request=r,this.tn.skip(")"),"returns"!==(r=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+r);if(this.tn.skip("("),"stream"===(r=this.tn.next()).toLowerCase()&&(o.response_stream=!0,r=this.tn.next()),o.response=r,this.tn.skip(")"),"{"===(r=this.tn.peek())){for(this.tn.next();"}"!==(r=this.tn.next());){if("option"!==r)throw Error("illegal rpc service token: "+r);this._parseOption(o)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[n]&&(e[n]={}),e[n][i]=o},a._parseMessage=function(e,n){var r=!!n,i=this.tn.next(),o={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(i))throw Error("illegal "+(r?"group":"message")+" name: "+i);for(o.name=i,r&&(this.tn.skip("="),n.id=s(this.tn.next()),o.isGroup=!0),"["===(i=this.tn.peek())&&n&&this._parseFieldOptions(n),this.tn.skip("{");"}"!==(i=this.tn.next());)if(t.RULE.test(i))this._parseMessageField(o,i);else if("oneof"===i)this._parseMessageOneOf(o);else if("enum"===i)this._parseEnum(o);else if("message"===i)this._parseMessage(o);else if("option"===i)this._parseOption(o);else if("service"===i)this._parseService(o);else if("extensions"===i)o.hasOwnProperty("extensions")?o.extensions=o.extensions.concat(this._parseExtensionRanges()):o.extensions=this._parseExtensionRanges();else if("reserved"===i)this._parseIgnored();else if("extend"===i)this._parseExtend(o);else{if(!t.TYPEREF.test(i))throw Error("illegal message token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(o,"optional",i)}return this.tn.omit(";"),e.messages.push(o),o},a._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},a._parseMessageField=function(e,n,r){if(!t.RULE.test(n))throw Error("illegal message field rule: "+n);var i,o={rule:n,type:"",name:"",options:{},id:0};if("map"===n){if(r)throw Error("illegal type: "+r);if(this.tn.skip("<"),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(o.keytype=i,this.tn.skip(","),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field: "+i);if(o.type=i,this.tn.skip(">"),i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);o.name=i,this.tn.skip("="),o.id=s(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(r=void 0!==r?r:this.tn.next())){var a=this._parseMessage(e,o);if(!/^[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(r)&&!t.TYPEREF.test(r))throw Error("illegal message field type: "+r);if(o.type=r,i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);o.name=i,this.tn.skip("="),o.id=s(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},a._parseMessageOneOf=function(e){var n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal oneof name: "+n);var r,i=n,o=[];for(this.tn.skip("{");"}"!==(n=this.tn.next());)(r=this._parseMessageField(e,"optional",n)).oneof=i,o.push(r.id);this.tn.omit(";"),e.oneofs[i]=o},a._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()},a._parseEnum=function(e){var n={name:"",values:[],options:{}},r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal name: "+r);for(n.name=r,this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if(!t.NAME.test(r))throw Error("illegal name: "+r);this.tn.skip("=");var i={name:r,id:s(this.tn.next(),!0)};"["===(r=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),n.values.push(i)}this.tn.omit(";"),e.enums.push(n)},a._parseExtensionRanges=function(){var t,n,r,i=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":r=e.ID_MIN;break;case"max":r=e.ID_MAX;break;default:r=u(t)}if(n.push(r),2===n.length)break;if("to"!==this.tn.peek()){n.push(r);break}this.tn.next()}i.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),i},a._parseExtend=function(e){var n=this.tn.next();if(!t.TYPEREF.test(n))throw Error("illegal extend reference: "+n);var r={ref:n,fields:[]};for(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},a.toString=function(){return"Parser at line "+this.tn.line},n.Parser=o,n}(t,t.Lang),t.Reflect=function(e){var t={},r=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},i=r.prototype;i.fqn=function(){for(var e=this.name,t=this;;){if(null==(t=t.parent))break;e=t.name+"."+e}return e},i.toString=function(e){return(e?this.className+" ":"")+this.fqn()},i.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},t.T=r;var o=function(e,t,n,i,o){r.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=i||{},this.syntax=o||"proto2"},a=o.prototype=Object.create(r.prototype);a.getChildren=function(e){if(null==(e=e||null))return this.children.slice();for(var t=[],n=0,r=this.children.length;n<r;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},a.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof c.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof c.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)},a.getChild=function(e){for(var t="number"==typeof e?"id":"name",n=0,r=this.children.length;n<r;++n)if(this.children[n][t]===e)return this.children[n];return null},a.resolve=function(e,n){var r,i="string"==typeof e?e.split("."):e,o=this,a=0;if(""===i[a]){for(;null!==o.parent;)o=o.parent;a++}do{do{if(!(o instanceof t.Namespace)){o=null;break}if(!(r=o.getChild(i[a]))||!(r instanceof t.T)||n&&!(r instanceof t.Namespace)){o=null;break}o=r,a++}while(a<i.length);if(null!=o)break;if(null!==this.parent)return this.parent.resolve(e,n)}while(null!=o);return o},a.qn=function(e){var n=[],r=e;do{n.unshift(r.name),r=r.parent}while(null!==r);for(var i=1;i<=n.length;i++){var o=n.slice(n.length-i);if(e===this.resolve(o,e instanceof t.Namespace))return o.join(".")}return e.fqn()},a.build=function(){for(var e,t={},n=this.children,r=0,i=n.length;r<i;++r)(e=n[r])instanceof o&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},a.buildOpt=function(){for(var e={},t=Object.keys(this.options),n=0,r=t.length;n<r;++n){var i=t[n],o=this.options[t[n]];e[i]=o}return e},a.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},t.Namespace=o;var s=function(t,n,r,i,o){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=i,this.name=o,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=s.prototype;function l(t,n){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===n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}s.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.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"},u.verifyValue=function(t){var r=this;function i(e,t){throw Error("Illegal value for "+r.toString(!0)+" of type "+r.type.name+": "+e+" ("+t+")")}switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),t>4294967295?0|t:t;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),t<0?t>>>0:t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return l(t,!1)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return l(t,!0)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof t&&i(typeof t,"not a boolean"),t;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof t&&i(typeof t,"not a number"),t;case e.TYPES.string:return"string"==typeof t||t&&t instanceof String||i(typeof t,"not a string"),""+t;case e.TYPES.bytes:return n.isByteBuffer(t)?t:n.wrap(t,"base64");case e.TYPES.enum:var o=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(s=0;s<o.length;s++){if(o[s].name==t)return o[s].id;if(o[s].id==t)return o[s].id}if("proto3"===this.syntax)return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),(t>4294967295||t<0)&&i(typeof t,"not in range for uint32"),t;i(t,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(t&&"object"==typeof t||i(typeof t,"object expected"),t instanceof this.resolvedType.clazz)return t;if(t instanceof e.Builder.Message){var a={};for(var s in t)t.hasOwnProperty(s)&&(a[s]=t[s]);t=a}return new this.resolvedType.clazz(t)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+t+" (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){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");var o=r.offset;i.writeVarint32(r.remaining()),i.append(r),r.offset=o;break;case e.TYPES.message:var a=(new n).LE();this.resolvedType.encode(r,a),i.writeVarint32(a.offset),i.append(a.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,n,r){if(n!=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,r)}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()},t.Element=s;var c=function(e,t,n,r,i,a){o.call(this,e,t,n,r,a),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},d=c.prototype=Object.create(o.prototype);function _(t,n){var r=n.readVarint32(),i=7&r,o=r>>>3;switch(i){case e.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(!(128&~r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:_(o,n);break;case e.WIRE_TYPES.ENDGROUP:if(o===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+o+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+i)}return!0}d.build=function(t){if(this.clazz&&!t)return this.clazz;var r=function(e,t){var r=t.getChildren(e.Reflect.Message.Field),i=t.getChildren(e.Reflect.Message.OneOf),o=function(a,s){e.Builder.Message.call(this);for(var u=0,l=i.length;u<l;++u)this[i[u].name]=null;for(u=0,l=r.length;u<l;++u){var c=r[u];this[c.name]=c.repeated?[]:c.map?new e.Map(c):null,!c.required&&"proto3"!==t.syntax||null===c.defaultValue||(this[c.name]=c.defaultValue)}var d;if(arguments.length>0)if(1!==arguments.length||null===a||"object"!=typeof a||!("function"!=typeof a.encode||a instanceof o)||Array.isArray(a)||a instanceof e.Map||n.isByteBuffer(a)||a instanceof ArrayBuffer||e.Long&&a instanceof e.Long)for(u=0,l=arguments.length;u<l;++u)void 0!==(d=arguments[u])&&this.$set(r[u].name,d);else this.$set(a)},a=o.prototype=Object.create(e.Builder.Message.prototype);a.add=function(n,r,i){var o=t._fieldsByName[n];if(!i){if(!o)throw Error(this+"#"+n+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+n+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+n+" is not a repeated field");r=o.verifyValue(r,!0)}return null===this[n]&&(this[n]=[]),this[n].push(r),this},a.$add=a.add,a.set=function(n,r,i){if(n&&"object"==typeof n){for(var o in i=r,n)n.hasOwnProperty(o)&&void 0!==(r=n[o])&&void 0===t._oneofsByName[o]&&this.$set(o,r,i);return this}var a=t._fieldsByName[n];if(i)this[n]=r;else{if(!a)throw Error(this+"#"+n+" is not a field: undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+n+" is not a field: "+a.toString(!0));this[a.name]=r=a.verifyValue(r)}if(a&&a.oneof){var s=this[a.oneof.name];null!==r?(null!==s&&s!==a.name&&(this[s]=null),this[a.oneof.name]=a.name):s===n&&(this[a.oneof.name]=null)}return this},a.$set=a.set,a.get=function(n,r){if(r)return this[n];var i=t._fieldsByName[n];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+n+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+n+" is not a field: "+i.toString(!0));return this[i.name]},a.$get=a.get;for(var s=0;s<r.length;s++){var u=r[s];u instanceof e.Reflect.Message.ExtensionField||t.builder.options.populateAccessors&&function(e){var n=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));n=n.substring(0,1).toUpperCase()+n.substring(1);var r=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),i=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},o=function(){return this[e.name]};null===t.getChild("set"+n)&&(a["set"+n]=i),null===t.getChild("set_"+r)&&(a["set_"+r]=i),null===t.getChild("get"+n)&&(a["get"+n]=o),null===t.getChild("get_"+r)&&(a["get_"+r]=o)}(u)}function l(t,r,i,o){if(null===t||"object"!=typeof t){if(o&&o instanceof e.Reflect.Enum){var a=e.Reflect.Enum.getName(o.object,t);if(null!==a)return a}return t}if(n.isByteBuffer(t))return r?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return i?t.toString():e.Long.fromValue(t);var s;if(Array.isArray(t))return s=[],t.forEach((function(e,t){s[t]=l(e,r,i,o)})),s;if(s={},t instanceof e.Map){for(var u=t.entries(),c=u.next();!c.done;c=u.next())s[t.keyElem.valueToString(c.value[0])]=l(c.value[1],r,i,t.valueElem.resolvedType);return s}var d=t.$type,_=void 0;for(var f in t)t.hasOwnProperty(f)&&(d&&(_=d.getChild(f))?s[f]=l(t[f],r,i,_.resolvedType):s[f]=l(t[f],r,i));return s}return a.encode=function(e,r){"boolean"==typeof e&&(r=e,e=void 0);var i=!1;e||(e=new n,i=!0);var o=e.littleEndian;try{return t.encode(this,e.LE(),r),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},o.encode=function(e,t,n){return new o(e).encode(t,n)},a.calculate=function(){return t.calculate(this)},a.encodeDelimited=function(e,r){var i=!1;e||(e=new n,i=!0);var o=(new n).LE();return t.encode(this,o,r).flip(),e.writeVarint32(o.remaining()),e.append(o),i?e.flip():e},a.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},a.toArrayBuffer=a.encodeAB,a.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},a.toBuffer=a.encodeNB,a.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},a.toBase64=a.encode64,a.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},a.toHex=a.encodeHex,a.toRaw=function(e,t){return l(this,!!e,!!t,this.$type)},a.encodeJSON=function(){return JSON.stringify(l(this,!0,!0,this.$type))},o.decode=function(e,r,i){"string"==typeof r&&(i=r,r=-1),"string"==typeof e?e=n.wrap(e,i||"base64"):n.isByteBuffer(e)||(e=n.wrap(e));var o=e.littleEndian;try{var a=t.decode(e.LE(),r);return e.LE(o),a}catch(t){throw e.LE(o),t}},o.decodeDelimited=function(e,r){if("string"==typeof e?e=n.wrap(e,r||"base64"):n.isByteBuffer(e)||(e=n.wrap(e)),e.remaining()<1)return null;var i=e.offset,o=e.readVarint32();if(e.remaining()<o)return e.offset=i,null;try{var a=t.decode(e.slice(e.offset,e.offset+o).LE());return e.offset+=o,a}catch(t){throw e.offset+=o,t}},o.decode64=function(e){return o.decode(e,"base64")},o.decodeHex=function(e){return o.decode(e,"hex")},o.decodeJSON=function(e){return new o(JSON.parse(e))},a.toString=function(){return t.toString()},Object.defineProperty&&(Object.defineProperty(o,"$options",{value:t.buildOpt()}),Object.defineProperty(a,"$options",{value:o.$options}),Object.defineProperty(o,"$type",{value:t}),Object.defineProperty(a,"$type",{value:t})),o}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var i,o=0,a=this.children.length;o<a;o++)if((i=this.children[o])instanceof p||i instanceof c||i instanceof T){if(r.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");r[i.name]=i.build()}else if(i instanceof c.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(i instanceof c.OneOf)this._oneofsByName[i.name]=i;else if(!(i instanceof c.OneOf||i instanceof b))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=r},d.encode=function(e,t,n){for(var r,i,o=null,a=0,s=this._fields.length;a<s;++a)i=e[(r=this._fields[a]).name],r.required&&null===i?null===o&&(o=r):r.encode(n?i:r.verifyValue(i),t,e);if(null!==o){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+o);throw u.encoded=t,u}return t},d.calculate=function(e){for(var t,n,r=0,i=0,o=this._fields.length;i<o;++i){if(n=e[(t=this._fields[i]).name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},d.decode=function(t,n,r){"number"!=typeof n&&(n=-1);for(var i,o,a,s,u=t.offset,l=new this.clazz;t.offset<u+n||-1===n&&t.remaining()>0;){if(a=(i=t.readVarint32())>>>3,(o=7&i)===e.WIRE_TYPES.ENDGROUP){if(a!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(r?r+" expected":"not a group")+")");break}if(s=this._fieldsById[a]){if(s.repeated&&!s.options.packed)l[s.name].push(s.decode(o,t));else if(s.map){var c=s.decode(o,t);l[s.name].set(c[0],c[1])}else if(l[s.name]=s.decode(o,t),s.oneof){var d=l[s.oneof.name];null!==d&&d!==s.name&&(l[d]=null),l[s.oneof.name]=s.name}}else switch(o){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:var f=t.readVarint32();t.offset+=f;break;case e.WIRE_TYPES.STARTGROUP:for(;_(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+o)}}for(var h=0,g=this._fields.length;h<g;++h)if(null===l[(s=this._fields[h]).name])if("proto3"===this.syntax)l[s.name]=s.defaultValue;else{if(s.required){var p=Error("Missing at least one required field for "+this.toString(!0)+": "+s.name);throw p.decoded=l,p}e.populateDefaults&&null!==s.defaultValue&&(l[s.name]=s.defaultValue)}return l},t.Message=c;var f=function(t,n,i,o,a,s,u,l,d,_){r.call(this,t,n,s),this.className="Message.Field",this.required="required"===i,this.repeated="repeated"===i,this.map="map"===i,this.keyType=o||null,this.type=a,this.resolvedType=null,this.id=u,this.options=l||{},this.defaultValue=null,this.oneof=d||null,this.syntax=_||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof c.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},h=f.prototype=Object.create(r.prototype);h.build=function(){this.element=new s(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new s(this.keyType,void 0,!0,this.syntax,this.name)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=s.defaultFieldValue(this.type)},h.verifyValue=function(t,n){n=n||!1;var r,i=this;function o(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}if(null===t)return this.required&&o(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&o(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!n){Array.isArray(t)||(t=[t]);var a=[];for(r=0;r<t.length;r++)a.push(this.element.verifyValue(t[r]));return a}return this.map&&!n?t instanceof e.Map?t:(t instanceof Object||o(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&o(typeof t,"no array expected"),this.element.verifyValue(t))},h.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[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}},h.encode=function(t,r,i){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{var o;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1);var a=r.offset;for(o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],r);var s=r.offset-a,u=n.calculateVarint32(s);if(u>1){var l=r.slice(a,r.offset);a+=u-1,r.offset=a,r.append(l)}r.writeVarint32(s,a-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,o){var a=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(a),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},h.calculate=function(t,r){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;var i=0;try{var o,a;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),a=0,o=0;o<t.length;o++)a+=this.element.calculateLength(this.id,t[o]);i+=n.calculateVarint32(a),i+=a}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,o){var a=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(a),i+=a}),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},h.decode=function(t,n,r){var i,o;if(!(!this.map&&t==this.type.wireType||!r&&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&&!r){o=n.readVarint32(),o=n.offset+o;for(var a=[];n.offset<o;)a.push(this.decode(this.type.wireType,n,!0));return a}if(this.map){var u=s.defaultFieldValue(this.keyType);if(i=s.defaultFieldValue(this.type),o=n.readVarint32(),n.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+n.remaining());var l=n.clone();for(l.limit=l.offset+o,n.offset+=o;l.remaining()>0;){var c=l.readVarint32();t=7&c;var d=c>>>3;if(1===d)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(n,t,this.id)},t.Message.Field=f;var g=function(e,t,n,r,i,o,a){f.call(this,e,t,n,null,r,i,o,a),this.extension};g.prototype=Object.create(f.prototype),t.Message.ExtensionField=g;t.Message.OneOf=function(e,t,n){r.call(this,e,t,n),this.fields=[]};var p=function(e,t,n,r,i){o.call(this,e,t,n,r,i),this.className="Enum",this.object=null};p.getName=function(e,t){for(var n,r=Object.keys(e),i=0;i<r.length;++i)if(e[n=r[i]]===t)return n;return null},(p.prototype=Object.create(o.prototype)).build=function(t){if(this.object&&!t)return this.object;for(var n=new e.Builder.Enum,r=this.getChildren(p.Value),i=0,o=r.length;i<o;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},t.Enum=p;var E=function(e,t,n,i){r.call(this,e,t,n),this.className="Enum.Value",this.id=i};E.prototype=Object.create(r.prototype),t.Enum.Value=E;var b=function(e,t,n,i){r.call(this,e,t,n),this.field=i};b.prototype=Object.create(r.prototype),t.Extension=b;var T=function(e,t,n,r){o.call(this,e,t,n,r),this.className="Service",this.clazz=null};(T.prototype=Object.create(o.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){for(var r=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=r.prototype=Object.create(e.Builder.Service.prototype),o=t.getChildren(e.Reflect.Service.RPCMethod),a=0;a<o.length;a++)!function(e){i[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(n,r){if(n)i(n);else{null===r&&(r="");try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}r&&r instanceof e.resolvedResponseType.clazz?i(null,r):i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}}))}catch(e){setTimeout(i.bind(this,e),0)}},r[e.name]=function(t,n,i){new r(t)[e.name](n,i)},Object.defineProperty&&(Object.defineProperty(r[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(i[e.name],"$options",{value:r[e.name].$options}))}(o[a]);return Object.defineProperty&&(Object.defineProperty(r,"$options",{value:t.buildOpt()}),Object.defineProperty(i,"$options",{value:r.$options}),Object.defineProperty(r,"$type",{value:t}),Object.defineProperty(i,"$type",{value:t})),r}(e,this)},t.Service=T;var v=function(e,t,n,i){r.call(this,e,t,n),this.className="Service.Method",this.options=i||{}};(v.prototype=Object.create(r.prototype)).buildOpt=a.buildOpt,t.Service.Method=v;var R=function(e,t,n,r,i,o,a,s){v.call(this,e,t,n,s),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=a,this.resolvedRequestType=null,this.resolvedResponseType=null};return R.prototype=Object.create(v.prototype),t.Service.RPCMethod=R,t}(t),t.Builder=function(e,t,n){var r=function(e){this.ns=new n.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},i=r.prototype;function o(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,o(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}return r.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},r.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},r.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},r.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},r.isExtend=function(e){return"string"==typeof e.ref},i.reset=function(){return this.ptr=this.ns,this},i.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 n.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},i.create=function(t){if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(var i=[t];i.length>0;){if(t=i.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var o=t.shift();if(r.isMessage(o)){var a=new n.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),s={};o.oneofs&&Object.keys(o.oneofs).forEach((function(e){a.addChild(s[e]=new n.Message.OneOf(this,a,e))}),this),o.fields&&o.fields.forEach((function(e){if(null!==a.getChild(0|e.id))throw Error("duplicate or invalid field id in "+a.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+a.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=s[e.oneof]))throw Error("illegal oneof in "+a.name+"#"+e.name+": "+e.oneof);e=new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,o.syntax),t&&t.fields.push(e),a.addChild(e)}),this);var u=[];if(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&&("number"==typeof o.extensions[0]?a.extensions=[o.extensions]:a.extensions=o.extensions),this.ptr.addChild(a),u.length>0){i.push(t),t=u,u=null,this.ptr=a,a=null;continue}u=null}else if(r.isEnum(o))a=new n.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){a.addChild(new n.Enum.Value(this,a,e.name,e.id))}),this),this.ptr.addChild(a);else if(r.isService(o))a=new n.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(a);else{if(!r.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(a=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){if(null!==a.getChild(0|t.id))throw Error("duplicate extended field id in "+a.name+": "+t.id);if(a.extensions){var r=!1;if(a.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(r=!0)})),!r)throw Error("illegal extended field id in "+a.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var o=new n.Message.ExtensionField(this,a,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),s=new n.Extension(this,this.ptr,t.name,o);o.extension=s,this.ptr.addChild(s),a.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,a=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},i.import=function(t,n){var r="/";if("string"==typeof n){if(e.Util.IS_NODE&&(n=require("path").resolve(n)),!0===this.files[n])return this.reset();this.files[n]=!0}else if("object"==typeof n){var i,a=n.root;if(e.Util.IS_NODE&&(a=require("path").resolve(a)),(a.indexOf("\\")>=0||n.file.indexOf("\\")>=0)&&(r="\\"),i=e.Util.IS_NODE?require("path").join(a,n.file):a+r+n.file,!0===this.files[i])return this.reset();this.files[i]=!0}if(t.imports&&t.imports.length>0){var s,u=!1;"object"==typeof n?(this.importRoot=n.root,u=!0,s=this.importRoot,n=n.file,(s.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(r="\\")):"string"==typeof n?this.importRoot?s=this.importRoot:n.indexOf("/")>=0?""===(s=n.replace(/\/[^\/]*$/,""))&&(s="/"):n.indexOf("\\")>=0?(s=n.replace(/\\[^\\]*$/,""),r="\\"):s=".":s=null;for(var l=0;l<t.imports.length;l++)if("string"==typeof t.imports[l]){if(!s)throw Error("cannot determine import root");var c=t.imports[l];if("google/protobuf/descriptor.proto"===c)continue;if(c=e.Util.IS_NODE?require("path").join(s,c):s+r+c,!0===this.files[c])continue;/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json"));var d=e.Util.fetch(c);if(null===d)throw Error("failed to import '"+c+"' in '"+n+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(d+""),c):this.import(e.DotProto.Parser.parse(d),c)}else n?/\.(\w+)$/.test(n)?this.import(t.imports[l],n.replace(/^(.+)\.(\w+)$/,(function(e,t,n){return t+"_import"+l+"."+n}))):this.import(t.imports[l],n+"_import"+l):this.import(t.imports[l]);u&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&o(t);var _=this.ptr;return t.options&&Object.keys(t.options).forEach((function(e){_.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=_),t.enums&&(this.create(t.enums),this.ptr=_),t.services&&(this.create(t.services),this.ptr=_),t.extends&&this.create(t.extends),this.reset()},i.resolveAll=function(){var r;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof n.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof n.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(!(r=(this.ptr instanceof n.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=r,r instanceof n.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==r.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(r instanceof n.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=r.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]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==e.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&(this.ptr.options.packed=!0)}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(!((r=this.ptr.parent.resolve(this.ptr.requestName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=r,!((r=this.ptr.parent.resolve(this.ptr.responseName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=r}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()},i.build=function(e){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(var t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},i.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},i.toString=function(){return"Builder"},r.Message=function(){},r.Enum=function(){},r.Service=function(){},r}(t,t.Lang,t.Reflect),t.Map=function(e,t){var n=function(e,n){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}}),n)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=this.keyElem.valueFromString(r[i]),a=this.valueElem.verifyValue(n[r[i]]);this.map[this.keyElem.valueToString(o)]={key:o,value:a}}},r=n.prototype;function i(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}return r.clear=function(){this.map={}},r.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},r.entries=function(){for(var e,t=[],n=Object.keys(this.map),r=0;r<n.length;r++)t.push([(e=this.map[n[r]]).key,e.value]);return i(t)},r.keys=function(){for(var e=[],t=Object.keys(this.map),n=0;n<t.length;n++)e.push(this.map[t[n]].key);return i(e)},r.values=function(){for(var e=[],t=Object.keys(this.map),n=0;n<t.length;n++)e.push(this.map[t[n]].value);return i(e)},r.forEach=function(e,t){for(var n,r=Object.keys(this.map),i=0;i<r.length;i++)e.call(t,(n=this.map[r[i]]).value,n.key,this)},r.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},r.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},r.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},n}(0,t.Reflect),t.loadProto=function(e,n,r){return("string"==typeof n||n&&"string"==typeof n.file&&"string"==typeof n.root)&&(r=n,n=void 0),t.loadJson(t.DotProto.Parser.parse(e),n,r)},t.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=t.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=t.populateAccessors),new t.Builder(e)},t.loadJson=function(e,n,r){return("string"==typeof n||n&&"string"==typeof n.file&&"string"==typeof n.root)&&(r=n,n=null),n&&"object"==typeof n||(n=t.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),n.import(e,r),n.resolveAll(),n},t}();var da,_a,fa,ha,ga,pa,Ea,ba,Ta,va="NotifyMsg",Ra="SyncRequestMsg",Ia="UpStreamMessage",ma="DownStreamMessages",ya="ChrmDownStreamMessages",Aa="DownStreamMessage",Sa="ExtMsgData",Oa="GetQNupTokenInput",Na="GetDownloadUrlInput",Ca="GetQNupTokenOutput",Pa="GetDownloadUrlOutput",La="ChrmInput",wa="ChrmOutput",Ma="ChrmPullMsg",Ua="RelationQryInput",Da="RelationQryFilter",Ga="RelationsOutput",Va="QryRemindListReq",ja="QryRemindListResp",ka="CleanHisMsgInput",xa="CleanMsgBatchReq",Fa="QueryChatRoomInfoInput",Ba="QueryChatRoomInfoOutput",Ha="HistoryMsgInput",qa="HistoryMsgOuput",Ya="SessionsAttQryInput",Wa="SessionsAttOutput",Ka="SessionMsgReadInput",Ja="DeleteSessionsInput",Qa="QuerySessionsInput",Xa="QuerySessionsOutPut",Za="RelationDelBatchReq",za="DeleteMsgInput",$a="SetChrmKV",es="SetChrmKVS",ts="ChrmKVOutput",ns="ChrmKVSOutput",rs="QueryChrmKV",is="SetUserSettingInput",os="SetUserSettingOutput",as="PullUserSettingInput",ss="PullUserSettingOutput",us="SessionReq",ls="SessionStates",cs="SessionStateModifyReq",ds="GroupUnpushQuery",_s="GroupUnpushSet",fs="GroupUnpushResult",hs="SessionStateModifyResp",gs="TypeUnpushInput",ps="TypeUnpushOutput",Es="GrpReadReceiptMsg",bs="ReadReceipt",Ts="QueryReceiptReq",vs="QueryReceiptBatchReq",Rs="ReceiptResp",Is="QueryReceiptBatchResp",ms="GrpReadReceiptQryResp",ys="SessionTagAddInput",As="SessionTagDelInput",Ss="UserSettingNotification",Os="ReportSDKInput",Ns="UltraGrpPullSes",Cs="UltraGrpPullMsg",Ps="MsgChangeReq",Ls="ModifyMsgResp",ws="QueryMsgChange",Ms="EventChangeList",Us="MsgChangeList",Ds="MsgQuery",Gs="MsgQueryAck",Vs="OperateStatus",js="OperateStatusNotify",xs="SetRtcRoomIdInput",Fs="CallInfoUpStream",Bs="CallInfoDownStream",Hs="KvInput",qs="KvOutput",Ys="ReadReceiptMsg",Ws="ReceiptQryReq",Ks="QueryReceiptResp",Js="ReceiptCntQryReq",Qs="ReceiptCntQryResp",Xs="UpdateUserSubReq",Zs="UpdateUserSubResp",zs="PullUserSubReq",$s="PUllUserSubResp",eu="PullSubDataReq",tu="PullSubDataResp",nu="SubDataDetail",ru="QrySubDataReq",iu="UserProfile",ou="SetUserProfileResp",au="PullUserProfileReq",su="UserProfiles",uu="UserProfileInput",lu="UserProfilePermission",cu="SearchUserProfile",du="ChannelsInput",_u="ChannelsOutput",fu="MultiChannels",hu="ModifyChannelsInput",gu="ChannelsQueryInput",pu="ChannelsListResult",Eu="ChannelsInviteStatusInfos",bu="ChannelsUserInfos",Tu="ChannelsJoinedInfos",vu="ChannelsMemberUpdateInput",Ru="ChannelsMemberResponseInput",Iu="ChannelsMembersInput",mu="FriendInput",yu="FriendsInput",Au="FriendsCheckOutput",Su="FriendProfileInput",Ou="FriendProfileOutput",Nu="FriendQueryInput",Cu="FriendsListInput",Pu="FriendLevelSet",Lu="FriendUserInfos",wu="FriendInviteInfos",Mu="ChannelApplyInfo",Uu="AddUnpushPeriodInput",Du="DeleteUnpushPeriodInput",Gu="QueryUnpushPeriodInput",Vu="QueryUnpushPeriodOutput",ju="MsgReadEvent",ku="ConvertMsgInput",xu="SpeechToTextInfo",Fu="ConvertMsgOutput",Bu="SpeechToTextResult",Hu="TransReq",qu="TransResp",Yu="PullModifyMsgReq",Wu="PullModifyMsgResp",Ku="SetUserStatusInput",Ju="MCFollowInput",Qu="RtcQueryListInput",Xu="RtcKeyDeleteInput",Zu="RtcValueInfo",zu="RtcUserListOutput",$u="RtcInput",el="RtcQryOutput",tl="RtcDataInput",nl="RtcSetDataInput",rl="RtcUserSetDataInput",il="RtcOutput",ol="RtcTokenOutput",al="RtcNotifyMsg",sl="RtcPullKV",ul="RtcKVOutput",ll="RtcQueryUserJoinedInput",cl="RtcQueryUserJoinedOutput",dl="RtcViewerJoinedOutput",_l="RtcInviteInput",fl="RtcCancelInviteInput",hl="RtcInviteAnswerInput",gl="RtcEndInviteInput",pl="BotInput",El="BotOutput",bl=function(){function e(e){da.add(this),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0});var t=ca.loadProto(e);this.pbModules=t.build("Modules").probuf}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.pbModules[e].encode(t).toArrayBuffer()}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{var n=this.pbModules[e].decode(t);return c(this,da,"m",_a).call(this,n)}catch(t){var r="name: ".concat(e,", stack: ").concat(t.stack);throw null===console||void 0===console||console.error("pb decode error!",r),t}}}),e}();da=new WeakSet,_a=function e(t,n){var r,i=this;if(t instanceof Array)return t.map((function(t){return c(i,da,"m",e).call(i,t)}));if(r=t,"[object Object]"!==Object.prototype.toString.call(r))return t;if(t instanceof ca.ByteBuffer)return t.toArrayBuffer();if(t instanceof ca.Long)return n?t.toString():t.toNumber();var o={};return Object.keys(t).forEach((function(n){var r=t[n],a=t.$type.name===Sa&&"seqId"===n;o[n]=c(i,da,"m",e).call(i,r,a)})),o},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"}(fa||(fa={})),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"}(ha||(ha={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(ga||(ga={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(pa||(pa={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(Ea||(Ea={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(ba||(ba={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Ta||(Ta={}));var Tl,vl,Rl,Il,ml,yl,Al,Sl,Ol,Nl=new bl("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 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 optional string convertExt = 24;\n optional ExtMsgData extMsgData = 25;\n }\n message ExtMsgData {\n optional int64 seqId = 1;\n optional int64 sendTime = 2;\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 repeated ChannelType channelType = 9;\n optional int32 botType = 10;\n }\n message RelationQryFilter {\n repeated ChannelType type = 1;\n optional int32 count = 2;\n optional int32 order = 3;\n repeated string tags = 4;\n optional bool isTagTop = 5;\n optional string pageToken = 6;\n optional bool compress = 7;\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 optional string pageToken = 6;\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 optional bool isBot = 12;\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 optional bool ignoreCmd = 10;\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 optional bool cleanMsg = 2;\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 optional bool ignoreVersion = 3;\n }\n message SetUserSettingOutput {\n required int64 version=1;\n required bool reserve=2;\n optional bool updateVersion = 3;\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 required 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 optional int64 time = 4;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n AutoTrans = 4;\n }\n message SessionStateModifyReq {\n required int64 version=1;\n repeated SessionState state= 2;\n optional bool ignoreVersion = 3;\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 optional bool updateVersion = 2;\n }\n message TypeUnpushInput {\n required ChannelType type = 1;\n required int64 version = 2;\n required int32 unpushLevel = 3;\n optional bool ignoreVersion = 4;\n }\n message TypeUnpushOutput {\n required int64 version = 1;\n optional bool updateVersion = 2;\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 QueryReceiptBatchReq {\n repeated QueryReceipt items = 1;\n optional bool compress = 2;\n }\n message QueryReceipt {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated string msgIds = 4;\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 QueryReceiptBatchResp {\n repeated QueryReceiptBatchRespItem item = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n }\n\n message QueryReceiptBatchRespItem {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated QueryReceiptRespItem msg = 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 optional bool ignoreVersion = 3;\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 optional bool ignoreVersion = 3;\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 ModifyMsgResp {\n optional int64 modifyTime = 1;\n optional DownStreamMessage msg = 2;\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 repeated string notExistMsgId = 2;\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 optional int32 botType = 6;\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 optional bool isBan = 6;\n optional int64 banEndTime = 7;\n optional bool isBot = 8;\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 message ConvertMsgInput {\n optional int32 businessType = 1;\n optional bytes businessInfo = 2;\n }\n message SpeechToTextInfo {\n optional string msgId = 1;\n optional string objectName = 2;\n optional string content = 3;\n optional int32 sampleRate = 4;\n optional int32 channelNumber = 5;\n optional string format = 6;\n optional string extra = 7;\n }\n message ConvertMsgOutput {\n optional int32 businessType = 1;\n optional bytes businessResult = 2;\n }\n message SpeechToTextResult {\n optional string result = 1;\n optional string message = 2;\n }\n message TransReq {\n repeated TransInfo transInfos = 1;\n optional int32 model = 2;\n optional bool forceTrans = 3;\n }\n message TransResp {\n repeated TransResult results = 1;\n optional int32 model = 2;\n }\n message TransInfo {\n optional string messageUID = 1;\n optional int32 transType = 2;\n optional string text = 3;\n optional string transFileUrl = 4;\n optional string sourceLan = 5;\n optional string targetLan = 6;\n optional int32 inputSource = 7;\n }\n message TransResult {\n optional string messageUID = 1;\n optional string transResult = 2;\n optional string sourceLan = 3;\n optional string targetLan = 4;\n optional int32 code = 5;\n optional int32 inputSource = 6;\n }\n message PullModifyMsgReq { \n optional int64 pullVersion = 1;\n optional bool compress = 2;\n repeated int32 modifyType = 3;\n }\n message PullModifyMsgResp {\n repeated ModifyMsg msg = 1;\n optional int64 nextVersion = 2;\n optional bool finished = 3;\n optional bool compress = 4;\n optional bytes compressedData = 5;\n }\n message ModifyMsg {\n optional int32 modifyType = 1;\n optional DownStreamMessage msg = 2;\n }\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 SetUserStatusInput {\n optional int32 status=1;\n }\n message MCFollowInput {\n required string state = 1;\n }\n message RtcQueryListInput {\n optional int32 order=1;\n }\n message RtcKeyDeleteInput {\n repeated string key=1;\n }\n message RtcValueInfo {\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo {\n required string userId=1;\n repeated RtcValueInfo userData=2;\n }\n message RtcUserListOutput {\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4;\n repeated RtcKVEntity entries = 5;\n optional int64 syncTime = 6;\n optional int32 offlineKickTime = 7;\n }\n message RtcRoomInfoOutput {\n optional string roomId = 1;\n repeated RtcValueInfo roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message 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 RtcValueInfo innerDatas = 7;\n repeated RtcValueInfo outerDatas = 8;\n }\n message RtcQryOutput {\n repeated RtcValueInfo outInfo=1;\n }\n message 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 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 RtcUserSetDataInput {\n repeated RtcValueInfo valueInfo = 1;\n required string objectName = 2;\n repeated 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 optional int32 nothing=1;\n optional int64 version=2;\n }\n message RtcTokenOutput {\n required string rtcToken=1;\n }\n message RtcSetOutDataInput {\n required TargetType target=1;\n repeated RtcValueInfo valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message RtcQryUserOutDataInput {\n repeated string userId = 1;\n }\n message RtcUserOutDataOutput {\n repeated RtcUserInfo user = 1;\n }\n message RtcNotifyMsg {\n required int32 type= 1;\n optional int64 time= 2;\n optional string roomId=3;\n }\n message RtcPullKV {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity {\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 RtcKVOutput {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType {\n AnchorToViewer = 1;\n ViewerToAnchor = 2;\n }\n message RtcQueryUserJoinedInput {\n required string userId = 1;\n }\n message RtcJoinedInfo {\n required string deviceId = 1;\n required string roomId = 2;\n optional int64 joinTime = 3;\n }\n message RtcQueryUserJoinedOutput {\n repeated RtcJoinedInfo info = 1;\n }\n message RtcViewerJoinedOutput {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;\n optional int64 syncTime = 3;\n }\n message RtcInviteInput {\n required string invitedUserId=1;\n optional int32 timeoutTime=2;\n required string invitedRoomId=3;\n required string inviteInfo=4;\n required string inviteSessionId= 5;\n }\n message RtcCancelInviteInput {\n required string invitedUserId=1;\n required string invitedRoomId=2;\n required string inviteInfo=3;\n required string inviteSessionId=4;\n }\n message RtcInviteAnswerInput {\n required string inviteUserId=1;\n required int32 answerCode=2;\n required string inviteRoomId=3;\n required string inviteSessionId=4;\n required string content=5;\n optional string key=6;\n optional string value=7;\n }\n message RtcEndInviteInput {\n required string inviteRoomId=1;\n required string inviteSessionId=2;\n required string inviteContent=3;\n repeated string inviteRoomKeys=4;\n }\n message BotInput {\n repeated string ids = 1;\n }\n message BotOutput{\n repeated BotInfo bots = 1;\n }\n message BotInfo{\n optional string id = 1; \n optional string name = 2;\n optional string portraitUrl = 3;\n optional string type = 4;\n repeated MetadataInfo metadata = 5;\n optional int64 createTime = 6;\n optional int64 updateTime = 7;\n }\n message MetadataInfo{\n optional string key = 1; \n optional string value = 2;\n }\n}\n");!function(e){e[e.LOG=0]="LOG",e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL",e[e.STATISTICS=6]="STATISTICS",e[e.NONE=1e3]="NONE"}(Tl||(Tl={})),function(e){e.IM="IM",e.RTC="RTC"}(vl||(vl={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",e[e.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",e[e.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",e[e.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",e[e.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",e[e.BLOCKED=9]="BLOCKED",e[e.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",e[e.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",e[e.REDIRECT=14]="REDIRECT",e[e.USER_LOGOUT=19]="USER_LOGOUT",e[e.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",e[e.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",e[e.ULTRALIMIT=1101]="ULTRALIMIT",e[e.REQUEST_NAVI=201]="REQUEST_NAVI",e[e.RESPONSE_NAVI=202]="RESPONSE_NAVI",e[e.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",e[e.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR"}(Rl||(Rl={})),function(e){e[e.RTC=0]="RTC",e[e.LIVE=2]="LIVE",e[e.SIP=4]="SIP",e[e.CALL=5]="CALL",e[e.MEETING=6]="MEETING",e[e.CROSS_MUTI=7]="CROSS_MUTI",e[e.CROSS_LIVE=8]="CROSS_LIVE"}(Il||(Il={})),function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(ml||(ml={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(yl||(yl={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(Al||(Al={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Sl||(Sl={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(Ol||(Ol={}));var Cl=null;function Pl(e,t,n,r){void 0===n&&(n={});var i=["error","warn","info","debug"][3-e];if(Cl&&e<Tl.FATAL)try{var o=JSON.stringify(n);Cl[i](t,o)}catch(e){console.error(e)}}var Ll,wl,Ml,Ul,Dl,Gl,Vl,jl,kl,xl,Fl,Bl=Pl.bind(null,Tl.DEBUG),Hl={init:function(e){Cl=e},info:Pl.bind(null,Tl.INFO),debug:Bl,warn:Pl.bind(null,Tl.WARN),error:Pl.bind(null,Tl.ERROR),fatal:Pl.bind(null,Tl.FATAL)},ql=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,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n})}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n,once:!0})}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._map[e];r&&((r=r.filter((function(e){return e.listener!==t||e.target!==n}))).length?this._map[e]=r:delete this._map[e])}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map[e];if(r)for(var i=0;i<r.length;i+=1){var o=r[i],a=o.target,s=o.once,c=o.listener;s&&(r.splice(i,1),i-=1);try{c.call.apply(c,l([a],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}(),Yl=function(e,t,n){var r=null==n?void 0:n.isReverse;At(e)&&function(){for(var n in e)t(e[n],n,e)}(),(Rt(e)||Et(e))&&function(){if(r)for(var n=e.length-1;n>=0;n--)t(e[n],n);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},Wl=function(e,t){return Yl(e,(function(n,r){e[r]=t(n,r)})),e},Kl=function(e){return"[object Null]"===Object.prototype.toString.call(e)},Jl=function(){function e(e){Object.defineProperty(this,"pbCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbCodec=new bl(e)}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return n?t:this.pbCodec.encode(e,t)}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.pbCodec.decode(e,t)}}),e}(),Ql=function(e,t,n,r,i){var o=r?Object.keys(r).map((function(e){return{key:e,value:r[e]}})):void 0,a=i?Object.keys(i).map((function(e){return{key:e,value:i[e]}})):void 0;return Nl.encode($u,{roomType:e,broadcastType:t,joinType:n,innerDatas:o,outerDatas:a})},Xl=function(e){var t=Nl.decode(zu,e),n=t.users,r=t.token,i=t.sessionId,o=t.roomInfo,a=t.entries,s=t.offlineKickTime,u={};return Yl(n,(function(e){var t=e.userId,n=e.userData,r={};Yl(n,(function(e){var t=e.key,n=e.value;r[t]=n})),u[t]=r})),{users:u,token:r,sessionId:i,roomInfo:o,kvEntries:a,offlineKickTime:s}},Zl=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,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,n=e.timestamp,(r=this._pullTime)>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS?(this._isPulling=!1,this._pullTime=s||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}(),zl=function(){function e(e,t,n){Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:t}),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 Zl(this)}return Object.defineProperty(e.prototype,"appkey",{get:function(){return this._appkey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"initOption",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"logger",{get:function(){return this._logger},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._rtcSignalingListener=e}}),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,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=Nl.encode(sl,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,gi,!0,t)];case 1:return(n=a.sent()).isOk?(i=Nl.decode(ul,n.data),o=i.entries,s=i.syncTime,o=(o||[]).map((function(e){return r(r({},e),{timestamp:e.timestamp})})),this._watcher.onRTCDataChange(o,e),[2,vn(s)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"_receiveRtcKv",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=Nl.decode(al,e),n=t.time,r=t.type,i=t.roomId;1===r&&this._rtcKVManager.pullEntry(i,n)}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),e}();!function(e){e.INIT="INIT",e.DATA="DATA",e.END="END"}(Ll||(Ll={}));var $l=function(e){function n(t,n){var r=e.call(this)||this;return wl.add(r),Ml.set(r,void 0),Ul.set(r,new Map),Dl.set(r,void 0),d(r,Ml,t,"f"),d(r,Dl,n,"f"),r}return t(n,e),Object.defineProperty(n.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=c(this,wl,"a",Gl).createTraceId(),c(this,wl,"a",Gl).info(B.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,In.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(c(this,Ml,"f").validateConnected).tryTrans((function(e){var t,n;return(null===(n=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===n?void 0:n.length)?vn(e.streamServer.addrs):Rn(x.STREAM_MESSAGE_DISABLE)})).next((function(t){return c(r,wl,"m",Fl).call(r,e,t)}))];case 1:return n=i.sent(),c(this,wl,"a",Gl).summary(B.L_REQ_STREAM_MSG_CONTENT_R,n,t,{messageUId:e}),[2,n.wipe()]}}))}))}}),n}(pn);Ml=new WeakMap,Ul=new WeakMap,Dl=new WeakMap,wl=new WeakSet,Gl=function(){return c(this,Ml,"f").logger},Vl=function(e,t,n){var r=c(this,Ul,"f").get(e);r&&(c(this,Ul,"f").delete(e),c(this,wl,"m",jl).call(this,e,Ll.END,t,r.msg))},jl=function(e,t,n,r,i){this.emit("message",{code:n,messageUId:e,type:t,chunk:i,message:r})},kl=function(e,t){e.content=r(r({},e.content),t),c(this,Ml,"f")._innerSetMessageContent(e.messageId,JSON.stringify(e.content),e.messageType)},xl=function(e,t,n){var r,i,o=c(this,Ul,"f").get(t);switch(e){case"init":o.msg&&c(this,wl,"m",kl).call(this,o.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),c(this,wl,"m",jl).call(this,t,Ll.INIT,x.SUCCESS,o.msg);break;case"complete":i=(r=n.length?JSON.parse(n):{}).complete||!1,o.msg&&c(this,wl,"m",kl).call(this,o.msg,{stopReason:r.stopReason||0,completeReason:r.completeReason||0,complete:i,isSynced:i}),c(this,wl,"m",Vl).call(this,t,r.stopReason||0,i);break;default:r=JSON.parse(n),o.cached+=r.content,o.msg&&c(this,wl,"m",kl).call(this,o.msg,{content:o.cached}),c(this,wl,"m",jl).call(this,t,Ll.DATA,x.SUCCESS,o.msg,{content:r.content,fullContent:o.cached})}},Fl=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return c(this,Ul,"f").has(e)?[2,Rn(x.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:c(this,Ul,"f").size>=3?[2,Rn(x.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(n=la.createSSEClient({logger:c(this,wl,"a",Gl),msgUId:e,appkey:c(this,Ml,"f").appkey,token:c(this,Ml,"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 n=t.indexOf("\n"),r=t.slice(0,n).replace("event:",""),i=t.slice(n+1+5);c(d,wl,"m",xl).call(d,r,e,i.trim())}}))},onNetworkError:function(t){c(d,wl,"m",Vl).call(d,e,t,!1)}}),n.isOk?(r=n.data,i={client:r,cached:"",msg:void 0},c(this,Ul,"f").set(e,i),c(this,Dl,"f")?[4,c(this,Ml,"f").getLocalMessage(e)]:[3,2]):[2,n.wipe()]);case 1:if(o=a.sent(),s=o.code,!(u=o.data))return c(this,Ul,"f").delete(e),[2,Rn(s,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return c(this,Ul,"f").delete(e),[2,Rn(x.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,a.label=2;case 2:return[4,r.open(t.slice())];case 3:return(l=a.sent()).isOk||c(this,Ul,"f").delete(e),[2,l.wipe()]}}))}))};var ec,tc,nc=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 Jl(t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new bl(e)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(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.32.1-c-test-alpha.1"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.32.1-c-test-alpha.1"}}),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,n){return console.warn('[PluginContext] sendMessage is deprecated, please use "sendMessageTo" instead'),this.sendMessageTo({conversationType:e,targetId:t,channelId:n.channelId},n)}}),Object.defineProperty(e.prototype,"sendMessageTo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.sendMessageByPlugin(e,t)}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){void 0===r&&(r=[]),this._context.registerMessageType(e,t,n,r)}}),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,n){return this._context.setCallInfo(e,t,n)}}),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}(),rc=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"joinRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return o=Ql(t,n,r,i,s),[4,this.rtcSignaling(e,ni,!0,o)];case 1:return u=a.sent(),l=u.code,c=u.buffer,l===x.SUCCESS&&c&&(d=Xl(c)),[2,{code:l,data:d}]}}))}))}}),Object.defineProperty(n.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Nl.encode(Ku,{status:0}),[4,this.rtcSignaling(e,ri,!0,t)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._context.rtcPing(e,t,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcPingResVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._context.rtcPing(e,t,n)}}),Object.defineProperty(n.prototype,"getRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("Method not implemented.")}}),Object.defineProperty(n.prototype,"setRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Nl.encode(Zu,{key:t,value:n}),[4,this.rtcSignaling(e,ii,!0,r)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"removeRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Nl.encode(Xu,{key:t}),[4,this.rtcSignaling(e,oi,!1,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return o=Nl.encode(nl,{interior:r,target:i,key:t,value:n,objectName:null==s?void 0:s.name,content:null==s?void 0:s.content}),[4,this.rtcSignaling(e,ai,!1,o)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return o={objectName:r,content:[{key:t.name,value:t.content}],valueInfo:[{key:"uris",value:n},{key:"mcu_uris",value:i}]},s=Nl.encode(rl,o),[4,this.rtcSignaling(e,si,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Nl.encode(rl,{objectName:t,valueInfo:[{key:"cdn_uris",value:n}]}),[4,this.rtcSignaling(e,si,!0,r)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"getRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=Nl.encode(tl,{interior:n,target:r,key:t}),[4,this.rtcSignaling(e,ui,!0,i)];case 1:return o=a.sent(),s=o.code,u=o.buffer,s===x.SUCCESS&&u?(l=Nl.decode(el,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:s,data:c}]):[2,{code:s}]}}))}))}}),Object.defineProperty(n.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return o=Nl.encode(tl,{interior:n,target:r,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,li,!1,o)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(n.prototype,"getRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(n.prototype,"getRTCToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=Ql(t,n),[4,this.rtcSignaling(e,ci,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=Nl.decode(ol,s).rtcToken,[2,{code:o,data:{rtcToken:u}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"setRTCState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Nl.encode(Ju,{state:t}),[4,this.rtcSignaling(e,di,!0,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=Nl.encode(Qu,{order:2}),[4,this.rtcSignaling(e,_i,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i?(o=Xl(i),[2,{code:r,data:o}]):[2,{code:r}]}}))}))}}),Object.defineProperty(n.prototype,"joinLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return r=Ql(t,n),[4,this.rtcSignaling(e,fi,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=Nl.decode(dl,s),l=u.rtcToken,c=u.entries,[2,{code:o,data:{token:l,kvEntries:c}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"quitLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Nl.encode(Ku,{status:0}),[4,this.rtcSignaling(e,hi,!0,t)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcIdentityChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=Nl.encode($u,{roomType:Il.LIVE,broadcastType:n,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,pi,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=Xl(s),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,s=e.roomId,u=Nl.encode(_l,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(s,Ei,!0,u)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,s=Nl.encode(fl,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,inviteInfo:i}),[4,this.rtcSignaling(o,bi,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return t=e.inviteUserId,n=e.inviteRoomId,r=e.inviteSessionId,i=e.content,o=e.key,s=e.value,u=e.agree,l=e.roomId,c=Nl.encode(hl,{inviteUserId:t,inviteRoomId:n,inviteSessionId:r,content:i,key:o,value:s,answerCode:u?1:0}),[4,this.rtcSignaling(l,Ti,!0,c)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.endRoomId,n=e.sessionId,r=e.content,i=e.keys,o=e.roomId,s=Nl.encode(gl,{inviteRoomId:t,inviteSessionId:n,inviteContent:r,inviteRoomKeys:i}),[4,this.rtcSignaling(o,vi,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"registerRTCSignalListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.registerRTCSignalingListener(e)}}),Object.defineProperty(n.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return[4,this._context.rtcSignaling(e,t,n,r)];case 1:return[2,{code:(i=o.sent()).code,buffer:i.data}]}}))}))}}),Object.defineProperty(n.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=Nl.encode(ll,{userId:e}),[4,this.rtcSignaling("",Ri,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i?(o=Nl.decode(cl,i).info,[2,{code:r,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:r}]}}))}))}}),n}(nc);!function(e){e[e.STRING=0]="STRING",e[e.ONLY_STRING=1]="ONLY_STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.OBJECT=4]="OBJECT",e[e.ARRAY=5]="ARRAY",e[e.CALLBACK=6]="CALLBACK",e[e.CHANNEL_ID=7]="CHANNEL_ID"}(tc||(tc={}));var ic=((ec={})[tc.STRING]=mt,ec[tc.ONLY_STRING]=Et,ec[tc.NUMBER]=Tt,ec[tc.BOOLEAN]=function(e){return"boolean"==typeof e},ec[tc.OBJECT]=At,ec[tc.ARRAY]=Rt,ec[tc.CALLBACK]=function(e){var t=!0;return At(e)||(t=!1),(e=e||{}).onSuccess&&!St(e.onSuccess)&&(t=!1),e.onError&&!St(e.onError)&&(t=!1),t},ec[tc.CHANNEL_ID]=wt,ec),oc=function(e){function n(t){var n=e.call(this,t)||this;return n.name="RCAssertError",n}return t(n,e),n}(Error),ac=function(e,t,n,r){if(void 0===r&&(r=!1),!sc(e,t,n,r))throw new oc("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},sc=function(e,t,n,r){void 0===r&&(r=!1),n=ic[n]||n;var i=r?n(t):Ot(t)||null==t||n(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},uc=function(e,t){var n=Ir(e).searchProps;return n&&0!==n.length?n.every((function(e){return void 0!==t[e]}))?vn():Rn(x.SEARCH_PROPS_LIMIT_ERROR):vn()},lc=function(e,t,n){return cc(In.create(e),t,n)},cc=function(e,t,n){return e.isFailed||e.isObject("conversation",t,!0).fail(x.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return te(null==t?void 0:t.conversationType,n)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID),e},dc=function(e,t,n){return e.check((function(e){return cc(e,t,Z)})).check((function(e){var r=null==t?void 0:t.messageType;mt(r)?r===me.STREAM_MESSAGE&&n.includes("RC_Ext_StreamMsgSummary")&&e.setFailed(x.STREAM_MESSAGE_EXPANSION_KEY_ERROR):e.setFailed(x.INVALID_PARAMETER_MESSAGE_TYPE)})).check((function(e){(null==t?void 0:t.canIncludeExpansion)||e.setFailed(x.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isNotEmptyString("messageUId",null==t?void 0:t.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isTimestamp("sentTime",null==t?void 0:t.sentTime,!0).fail(x.INVALID_PARAMETER_TIMESTAMP),e},_c=function(e,t,n){return e.check((function(e){n||e.setFailed(x.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isObject("expansion",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_EXPANSION).check((function(e){var n=Object.keys(t);if(n.length>20||0===n.length)e.setFailed(x.EXPANSION_LIMIT_EXCEET);else if(n.some((function(e){return!/^[A-Za-z0-9_=+-]+$/.test(e)||"string"!=typeof t[e]})))e.setFailed(x.INVALID_PARAMETER_MESSAGE_EXPANSION);else{n.some((function(e){return e.length>32||t[e].length>4096}))&&e.setFailed(x.EXPANSION_LIMIT_EXCEET)}})),e},fc=function(e,t){return t?(e.isObject("proxy",t,!0).isString("socketHost",t.socksHost,!0).isNumber("socketPort",t.socksPort,!0).isString("socketUsername",t.socksUsername).isString("socketPassword",t.socksPassword).fail(x.INVALID_PARAMETER_PROXY),e):e};var hc,gc=function(e){return function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);var t=unescape(encodeURIComponent(e)).split("").map((function(e){return e.charCodeAt(0)}));return new Uint8Array(t)}(e).byteLength},pc=function(){return hc||(hc={set:function(e,t){la.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(la.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return la.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in la.localStorage)e.push(t);return e}}),hc},Ec=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}(),bc=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=pc();var n=this._rootStorage.get(e)||{};this._cache=new Ec(((t={})[e]=n,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 n=this._get();n[e]=t,this._set(n)}}),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 n in e)t.push(n);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}(),Tc="",vc=function(){var e="";if(Tc)return Tc;if("browser"===la.tag)return gt;var t="RCDeviceId",n=pc(),r=n.get(t);return r?e=r:(e=ht.genWithLen(22),n.set(t,e)),e},Rc=function(){return ht.gen()},Ic=function(){return ht.genWithLen(22)},mc="",yc=function(){return mc},Ac=function(e,t,n,r,i){var o=0;return e&&(o|=16),t&&(o|=32),n&&(o|=64),r&&(o|=512),i&&(o|=1024),o},Sc=function(e){var t;try{t=JSON.parse(e)}catch(n){t=e}if(null==t?void 0:t.user){var n=t.user,r=n.portrait,i=n.portraitUri,o=r||i;o&&(t.user.portrait=t.user.portraitUri=o)}return t},Oc=function(e){var t={};try{var n=JSON.parse(e);Object.entries(n).forEach((function(e){var n=u(e,2),r=n[0],i=n[1];t[r]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},Nc=function(e,t,n,r){var i,o,a=Nl.decode(Ia,e.pbData),s=Fr(e.topic);if(s===kr.recallMsg){var u=JSON.parse(a.content);i=u.conversationType,o=u.targetId}else i=function(e){var t;return((t={})[kr.ppMsgP]=F.PRIVATE,t[kr.pgMsgP]=F.GROUP,t[kr.chatMsg]=F.CHATROOM,t[kr.ugMsg]=F.ULTRA_GROUP,t[kr.pcMsgP]=F.CUSTOMER_SERVICE,t[kr.pbMsgP]=F.SYSTEM,t)[e]||F.PRIVATE}(s),o=e.targetId;var l=![F.GROUP,F.CHATROOM,F.RTC_ROOM,F.ULTRA_GROUP].includes(i),c=l?o:t,d=l?"":o,_=Lc(a.sessionId),f=_.isPersited,h=_.isCounted,g=_.isMentioned,p=_.disableNotification,E=_.canIncludeExpansion;return{fromUserId:c,type:i,groupId:d,classname:a.classname,content:a.content,dataTime:n,status:Ac(f,h,g,p,E),msgId:r,direction:be.SEND,clientUniqueId:a.clientUniqueId,extraContent:a.extraContent,pushContent:a.pushText,configFlag:a.configFlag,pushExt:a.pushExt,busChannel:a.busChannel,toUserIds:a.toUserIds,optionBits:a.optionBits}},Cc=function(e,t,n,i){void 0===n&&(n=!1);var o,a,s,u=e.type,l=![F.GROUP,F.CHATROOM,F.RTC_ROOM,F.ULTRA_GROUP].includes(u)?i||e.fromUserId:e.groupId||i,c={isPersited:!!(16&(o=e.status)),isCounted:!!(32&o),isMentioned:!!(64&o),disableNotification:!!(512&o),receivedStatus:2&o?ye.RETRIEVED:ye.UNREAD,canIncludeExpansion:!!(1024&o)},d=c.isMentioned,_=c.disableNotification,f=c.receivedStatus,h=c.canIncludeExpansion,g=e.direction===be.SEND?be.SEND:be.RECEIVE,p=function(e,t,n){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,a=i.forceShowDetailContent,s=rn(null==n?void 0:n.pushConfigs,null==n?void 0:n.pushId);return r({pushTitle:(null==n?void 0:n.title)||"",pushContent:t||"",pushData:"",disablePushTitle:o,forceShowDetailContent:a,templateId:null==n?void 0:n.templateId},s)}(e.configFlag||0,e.pushContent,e.pushExt),E=(a=e.extStatus,{isInterrupt:!!(2&(s=a||0)),isModifyMessage:!!(4&s),isPrivateChannel:!!(8&s),isStatusMessage:!!(64&s)}),b=E.isInterrupt,T=E.isModifyMessage,v=E.isPrivateChannel,R=E.isStatusMessage,I=Ir(e.classname),m=I.isCounted,y=I.isPersited,A=I.isStatusMessage;return{conversationType:u,targetId:l,senderUserId:g===be.SEND?t:e.fromUserId,messageType:e.classname,messageUId:e.msgId,isPersited:y,isCounted:m,isMentioned:d,sentTime:e.dataTime,messageDirection:g,receivedTime:Date.now(),disableNotification:_,receivedStatus:f,receivedStatusInfo:jt(f),canIncludeExpansion:h,content:Sc(e.content),expansion:e.extraContent?Oc(e.extraContent):null,pushConfig:p,channelId:e.busChannel||"",isInterrupt:b,isModifyMessage:T,messageId:e.clientUniqueId||0,sentStatus:ue.SENT,isOffLineMessage:n,channelType:v?ne.PRIVATE:ne.PUBLIC,isStatusMessage:R||!!A,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0,modifyInfo:wc(e.convertExt),extraData:e.extMsgData?{seqId:e.extMsgData.seqId,sentTime:e.extMsgData.sendTime}:void 0}},Pc=function(e,t,n,r,i){var o=0,a=Ir(e),s=a.isPersited,u=a.isCounted,l=a.isStatusMessage,c=i||l;return s&&!c&&(o|=1),u&&!c&&(o|=2),t&&(o|=4),n&&(o|=32),r&&(o|=64),o},Lc=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}},wc=function(e){if(e)try{var t=JSON.parse(e).modify;if(t.time)return{timestamp:t.time,content:{},status:qn}}catch(t){console.error("parse message modify info error: ".concat(e),t)}},Mc=function(e,t){var n=e.content,i=n.sentTime,o=n.messageUId,a=n.isDelete,s=n.isAdmin,u=n.directionalUserIdList,l=n.extra,c={recallTime:i,recallActionTime:e.sentTime,admin:!!s,delete:!!a,isDelete:!!a,operatorId:e.senderUserId,extra:l},d=r(r({},e),{content:c,messageType:me.RECALL_NOTIFICATION_MESSAGE});return t&&(d.messageUId=o,d.sentTime=i,d.directedUserIds=u),d};function Uc(e){return 1&~((null==e?void 0:e.sessionMode)||0)?Rn(x.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):vn()}function Dc(e){return Math.min(e,999)}var Gc={};function Vc(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:1,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:Zn.getMiniCmpUrlList().join(",")}}var jc,kc,xc,Fc,Bc,Hc,qc=function(e){function n(t,n,r,i,o){void 0===i&&(i="default");var a=e.call(this,t,n,r,la.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),la.useNavi,o)||this;return a._environment=i,a}return t(n,e),Object.defineProperty(n.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return o="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(n),"&callBack=x&v=").concat(Ye,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(la.tag),this.logger.debug(B.L_REQUEST_T,"req navi => ".concat(o),r),[4,la.httpReq({url:o,timeout:1e4,dataType:"text"})];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(B.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!la.useNavi&&i?[2,vn(Vc())]:[2,Rn(this.transHttpCode(s.status))];try{return 0===(u=s.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,Rn(this.transHttpCode(l.code))]:(la.useNavi||(l.server="",l.backupServer=Zn.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,vn(l)])}catch(e){this.logger.error(B.L_PARSE_NAVI_E,s.data,r)}return[2,Rn(x.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(n.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:n,uri:e,platform:la.tag,protocol:(/^https/.test(e)?H.WSS:H.WS).toString()}),this.logger.debug(B.L_REQUEST_T,"req navi => ".concat(o.url),r),[4,la.httpReq(o)];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(B.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!la.useNavi&&i?[2,vn(Vc())]:[2,Rn(this.transHttpCode(s.status))];try{return u=s.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(o.url)?"https":"http",la.useNavi||(l.logSwitch=0,c=Zn.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?H.WSS:H.WS,weight:c.length-t}}))),[2,vn(l)]}catch(e){this.logger.error(B.L_PARSE_NAVI_E,s.data,r)}return[2,Rn(x.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(n.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=this.getCatchKey(e);if(Gc[n])return Gc[n];var r,i=Xe(this.appkey),o=la.localStorage;try{var a=o.getItem(i);r=a?JSON.parse(a):[]}catch(e){r=[]}if(0===r.length)return null;var s=r.find((function(n){return n.token===e&&n.environment===t._environment}))||null;return Gc[n]=s,s}}),Object.defineProperty(n.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=this,i=Xe(this.appkey),o=la.localStorage;try{var a=o.getItem(i);n=a?JSON.parse(a):[]}catch(e){n=[]}var s=Date.now();n.length>0&&(n=n.filter((function(t){return s-t.timestamp<Be&&(e!==t.token||r._environment!==t.environment)})));var u={timestamp:s,naviInfo:t,token:e,environment:this._environment};n.push(u),o.setItem(i,JSON.stringify(n)),Gc[this.getCatchKey(e)]=u}}),n}(vr),Yc=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=ot(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)}}),Object.defineProperty(e.prototype,"_getLocalInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=la.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 n=ot(this._appkey,this._userId),r=this._getLocalInfo(n);r[e]=t,la.localStorage.setItem(n,JSON.stringify(r))}}),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=ot(this._appkey,this._userId),n=this._getLocalInfo(t);Object.keys(n).forEach((function(t){n[t]<e&&delete n[t]})),la.localStorage.setItem(t,JSON.stringify(n))}}),e}(),Wc=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[_e.ONLINE_STATUS]={},t[_e.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={})[_e.ONLINE_STATUS]={},e[_e.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===_e.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].statusMap={}})):e===_e.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].profile=void 0}))}}),Object.defineProperty(e.prototype,"getSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.subscribeData[e][t];return n?r({},n):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,n){this.subscribeData[e][t]=n}}),Object.defineProperty(e.prototype,"clearExpiredData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t in this.subscribeData[e]){var n=this.subscribeData[e][t];n.expiry<(Date.now()+this._delayTime-n.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return l([],u(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(n,n+t)}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=r(r({},null===(t=this._ownProfile)||void 0===t?void 0:t.extraProfile),e.extraProfile);this._ownProfile=r(r(r({},this._ownProfile),e),{extraProfile:n})}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ownProfile?r(r({},this._ownProfile),{extraProfile:r({},this._ownProfile.extraProfile)}):null}}),e}(),Kc=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 Wc(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(n){var r=e.find((function(e){return e.subscribeType===t.subType&&e.userId===n.subUserId}));r?r.subscribeTime<t.subTime&&(r.expiry=t.expiry,r.operationType=t.opType,r.subscribeTime=t.subTime):e.push({userId:n.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 n=this;void 0===t&&(t=!1);var r=[],i=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,a,s=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===fe.UNSUBSCRIBE)return n._subStore.removeSubscribeUserData(l,s),void o.push(e);var d=n._subStore.getSubscribeUserData(l,s);if(!(d&&d.subscribeTime>=u)){if(l===_e.ONLINE_STATUS){r.push(s);var _=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};n._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,statusMap:_})}else{i.push(s);var f=null===(a=d)||void 0===a?void 0:a.profile;n._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,profile:f,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:r,newSubscribeUserProfileList:i,subscribeUserChangeList:o}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(_e.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(_e.USER_PROFILE)}}),Object.defineProperty(e.prototype,"updateSubscribeUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[];return e.forEach((function(e){var i=e.subUserId,o=e.data,a=t._subStore.getSubscribeUserData(_e.ONLINE_STATUS,i);if(a){var s=[],u=r({},a.statusMap);o.forEach((function(e){var t=e.platformInfo,n=e.versionTime,i=u[t];if(!(i&&i.changeTime>n)){var o={eventValue:e.value,changeTime:n};u[t]=o,s.push(r(r({},o),{platform:t}))}})),t._subStore.updateSubscribeUserData(_e.ONLINE_STATUS,i,{subscribeTime:a.subscribeTime,expiry:a.expiry,userId:i,subscribeType:_e.ONLINE_STATUS,statusMap:u}),n.push({userId:i,subscribeType:_e.ONLINE_STATUS,subscribeTime:a.subscribeTime,expiry:a.expiry,details:s})}})),n}}),Object.defineProperty(e.prototype,"updateSubscribeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[];return e.forEach((function(e){var i=e.userId,o=e.version,a=e.userProfile,s=e.userExtProfile,u=t._subStore.getSubscribeUserData(_e.USER_PROFILE,i),l=Ft(i,a,s);u?u.profile&&u.profile.version>=o||(t._subStore.updateSubscribeUserData(_e.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:_e.USER_PROFILE,profile:{info:l,version:o},isSubscribed:u.isSubscribed}),u.isSubscribed&&n.push({userId:i,subscribeType:_e.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:r({},l)})):t._subStore.updateSubscribeUserData(_e.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:_e.USER_PROFILE,profile:{info:l,version:o},isSubscribed:!1})})),n}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,i=[];return t.forEach((function(t){var o=n._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+n._delayTime-o.subscribeTime)/1e3)n._subStore.removeSubscribeUserData(e,t);else{var a={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===_e.ONLINE_STATUS){var s=o.statusMap,u=Object.keys(s).map((function(e){return r({platform:~~e},s[~~e])}));a.details=xt(u)}else if(e===_e.USER_PROFILE&&!o.isSubscribed)return;i.push(a)}})),i}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[],i=[];return e.forEach((function(e){var o=t._subStore.getSubscribeUserData(_e.USER_PROFILE,e);if(o&&o.profile){var a=o.profile,s=a.version,u=a.info;if(o.isSubscribed)return t._delayTime+Date.now()-s>6048e5?void i.push(e):void n.push(r(r({},u),{extraProfile:r({},u.extraProfile)}));t._delayTime+Date.now()-s>6e5?i.push(e):n.push(r(r({},u),{extraProfile:r({},u.extraProfile)}))}else i.push(e)})),{list:n,needQueryUserIds:i}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,n).map((function(t){var n={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===_e.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return r({platform:~~e},t.statusMap[~~e])}));n.details=xt(i)}return n}))}}),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}(),Jc=function(){function e(e,t,n,r,i,o,a){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:n}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:r}),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:a}),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 Kc(r)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(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(_e.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(_e.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(_e.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(_e.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 a(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 a(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 n,r,i,o,s,u,l,c,d,_,f,h,g;return a(this,(function(a){switch(a.label){case 0:return n=this._subscribeService.getRelationshipStatusVersion(),r=this._logger.createTraceId(),this._logger.info(B.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:n,_pageToken:t}),r),i=Nl.encode(zs,{version:n,pageToken:t}),[4,this._connectManager.query(kr.pullUserSub,this._currentUserId,i,$s)];case 1:return o=a.sent(),this._logger.summary(B.L_PULL_SUBSCRIBED_USER_RELATION_R,o,r),o.isOk?(this._pullRelationshipFailTime=0,s=o.data,u=s.list,l=s.version,c=s.hasNext,d=s.pageToken,e?(_=this._subscribeService.updateSubscribeRelation(u),f=_.newSubscribeOnlineStatusList,h=_.newSubscribeUserProfileList,(g=_.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(g),f.length>0&&this._queryAndUpdateUserOnlineStatus(f),h.length>0&&this._queryAndUpdateUserProfile(h)):this._subscribeService.updateSubscribeRelation(u,!t),this._subscribeService.updateRelationshipStatusVersion(l),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>l})),c?[4,this._pullSubscribeRelationship(e,d)]:[3,3]):(this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:a.sent(),a.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 a(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 a(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 n,r,i,o,s,u,l,c,d,_,f,h;return a(this,(function(a){switch(a.label){case 0:return n=this._subscribeService.getSubscribeUserStatusVersion(),r=this._logger.createTraceId(),this._logger.info(B.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:n,_pageToken:t,needAllData:e}),r),i=Nl.encode(eu,{versionTime:n,needAllData:e,pageToken:t}),[4,this._connectManager.query(kr.pullSubData,this._currentUserId,i,tu)];case 1:return(o=a.sent()).isOk?(this._pullSubUserStatusFailTime=0,s=o.data,u=s.list,l=s.versionTime,c=s.hasNext,d=s.pageToken,_=s.isFull,this._logger.info(B.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code}),r),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>l})),this._subscribeService.updateSubscribeUserStatusVersion(l),f=[],h=[],u.forEach((function(e){switch(e.subType){case _e.ONLINE_STATUS:f.push(e);break;case _e.USER_PROFILE:h.push(e.subUserId);case _e.FRIEND_ONLINE_STATUS:case _e.FRIEND_USER_PROFILE:}})),_&&""===t&&this._subscribeService.clearSubscribeStatus(),f.length>0&&this._updateUserOnlineStatus(f,!_),h.length>0?[4,this._queryAndUpdateUserProfile(h,!_)]:[3,3]):(this._logger.warn(B.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code,failTime:this._pullSubUserStatusFailTime}),r),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:a.sent(),a.label=3;case 3:return c?[4,this._pullSubscribeUserStatus(e,d)]:[3,5];case 4:a.sent(),a.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,n,r;return a(this,(function(i){switch(i.label){case 0:return t=this._logger.createTraceId(),this._logger.info(B.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),n=Nl.encode(ru,{subType:_e.ONLINE_STATUS,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._connectManager.query(kr.qrySubData,this._currentUserId,n,tu)];case 1:return r=i.sent(),this._logger.summary(B.L_QUERY_SUBSCRIBE_DATA_R,r,t),r.isOk?(this._updateUserOnlineStatus(r.data.list),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"_updateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!0);var n=this._subscribeService.updateSubscribeUserOnlineStatus(e);n=n.filter((function(e){return e.details&&e.details.length>0})),t&&n.length>0&&this._event.subscribeUserStatusChanged(n)}}),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 n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this._logger.createTraceId(),this._logger.info(B.L_PULL_USER_PROFILE_T,JSON.stringify(e),n),r=Nl.encode(au,{userId:e}),i=new fo(kr.pullUserProfile,r,this._currentUserId),[4,this._connectManager.send(i,su)];case 1:return o=a.sent(),s=o.code,u=o.data,this._logger.info(B.L_PULL_USER_PROFILE_R,JSON.stringify({code:s,data:u}),n),s!==x.SUCCESS?[2,Rn(s)]:(l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,vn(u.UserProfile)])}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return(t=Nl.decode(nu,e.pbData)).subType!==_e.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==_e.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==_e.FRIEND_ONLINE_STATUS?[3,3]:(n=t.data.map((function(e){return{changeTime:e.versionTime,eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:n}]),[3,5]);case 3:return t.subType!==_e.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:r=o.sent(),(i=r.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Ft(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,n){return this._subscribeService.getSubscribeUserList(e,t,n)}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=0),o(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=Nl.encode(Xs,{subType:t,opType:n,expiry:r,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._connectManager.query(kr.updUserSub,this._currentUserId,i,Zs)];case 1:return o=a.sent(),s=o.code,u=o.data,l=o.isOk,s===x.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT?[2,Rn(s,"",u.subUsers.map((function(e){return e.subUserId})))]:l?(c=u.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:r,opType:n,subUsers:e.map((function(e){return{subUserId:e}}))}]),n===fe.SUBSCRIBE&&(t===_e.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===_e.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,o.wipe()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._subscribeService.getUserProfiles(e),n=t.needQueryUserIds,r=t.list,0===n.length?[2,vn(r)]:[4,this._queryAndUpdateUserProfile(n,!1)];case 1:return(i=a.sent()).isOk?(o=i.data.map((function(e){return Ft(e.userId,e.userProfile,e.userExtProfile)})),[2,vn(l(l([],u(r),!1),u(o),!1))]):[2,i.wipe()]}}))}))}}),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,n,r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(B.L_PULL_OWN_PROFILE_T,"",t),n=Nl.encode(uu,{nothing:1}),[4,this._connectManager.query(kr.pullOwnProfile,this._currentUserId,n,iu)]):[2,Rn(x.RC_USER_PROFILE_SERVICE_UNAVAILABLE)];case 1:return r=a.sent(),this._logger.summary(B.L_PULL_OWN_PROFILE_R,r,t),r.isOk?(i=r.data,o=i.userExtProfile,s=i.userProfile,u=i.version,l=i.userId,c=Ft(l,s,o),this._subscribeService.updateOwnProfile(c,u),e&&this._event.ownUserProfileChanged(c),[2,vn(c)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,vn(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 a(this,(function(n){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),Qc=function(){function e(e,t,n){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 bc(lt(e,t)),this._delayTime=n,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,n,r=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=s(r),a=o.next();!a.done;a=o.next()){var u=a.value;i[u.key]=u.value}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.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,n,i,o){var a;if(!(i<Date.now()-this._delayTime-Qe)){var s=this._getConversationKey(e),u=this._storage.get(s)||{};if(!u[t]){var l={t:i,d:n};o&&(l.sId=o);var c=r(r({},u),((a={})[t]=l,a));Object.keys(c).length>30&&(c=this._removeExcessData(c)),this._storage.set(s,c)}}}}),Object.defineProperty(e.prototype,"addReadedUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var i,o=this._getConversationKey(e),a=this._storage.get(o)||{},s=a[t];if(s){if(s.us){if(s.us.includes(n))return}else s.us=[];s.us.push(n),this._storage.set(o,r(r({},a),((i={})[t]=s,i)))}}}),Object.defineProperty(e.prototype,"getReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._getConversationKey(e),r=(this._storage.get(n)||{})[t];return r?{time:r.t,direction:r.d,users:r.us||[],senderId:r.sId}:null}}),Object.defineProperty(e.prototype,"getReceiptMessageDic",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._getConversationKey(e),n=this._storage.get(t)||{},r={};for(var i in n){var o=n[i];o.d===be.RECEIVE&&(r[o.sId]||(r[o.sId]=[]),r[o.sId].push(i))}return r}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._getConversationKey(e),r=this._storage.get(n)||{};r[t]&&(delete r[t],0===Object.keys(r).length?this._storage.remove(n):this._storage.set(n,r))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.getValues(),t={};for(var n in e){var r=e[n],i={};for(var o in r){var a=r[o];Date.now()-this._delayTime-a.t<Qe&&(i[o]=a)}Object.keys(i).length&&(t[n]=i)}this._storage.update(t)}}),e}(),Xc=function(e){function n(t,n){var r=e.call(this,t,n)||this;return Object.defineProperty(r,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:""}),r._storageKey=st(t),r}return t(n,e),Object.defineProperty(n.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return la.localStorage.getItem(this._storageKey)}}),Object.defineProperty(n.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){la.localStorage.setItem(this._storageKey,e)}}),Object.defineProperty(n.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){la.localStorage.removeItem(this._storageKey)}}),Object.defineProperty(n.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,la.httpReq({url:e})];case 1:return t=i.sent(),n=t.status,r=t.data,[2,{code:n,data:r}]}}))}))}}),Object.defineProperty(n.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,ln(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=r.sent(),[2,JSON.parse(t)];case 2:return n=r.sent(),this.logger.error(B.L_GET_STATIC_CONF_E,JSON.stringify({error:null==n?void 0:n.stack})),[3,3];case 3:return[2]}}))}))}}),n}(zn),Zc=((jc={})[L.GROUP_OPERATION]=function(e){return"ChannelEventData"},jc[L.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},jc[b.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},jc),zc=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,n){var r=e,i={}[t];try{r=e.length>0&&Nl.decode(t,e),St(i)&&(r=i.call(this,r,n))}catch(e){this.logger.error(B.L_PB_DECODE_E,t)}return r}}),Object.defineProperty(e.prototype,"formatEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.map((function(e){var n,r=e.businessId,i=e.time,o=e.changeType,a=e.originalId,s=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,d=e.operatorId,_=e.subChangeType,f=e.secondaryType,h=e.remindType,g=e.isRemindMe,p=e.extIds,E=e.eventData;return E&&(n=t._formatEventData(E,o,_)),{businessId:r,changeType:o,originalId:a,time:i,originalTime:s,secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:d,subChangeType:_,userGroupIds:p,secondaryType:f,remindType:h,isRemindMe:g,eventData:n}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r={};return e&&Zc[t]&&Zc[t](n)&&(r=Nl.decode(Zc[t](n),e)||{}),r}}),e}(),$c=((kc={})[Hi]=x.RC_DISCONN_KICK,kc[qi]=x.RC_DISCONN_EXCEPTION,kc[Wi]=x.RC_DISCONN_EXCEPTION,kc[Ki]=x.RC_CONN_REDIRECTED,kc[Ji]=x.RC_CONN_TOKEN_EXPIRED,kc[Qi]=x.RC_CONN_PROTO_VERSION_ERROR,kc[Xi]=x.RC_ACCOUNT_CANCELLATION,kc),ed=((xc={})[Ii]=x.SUCCESS,xc[mi]=x.RC_CONN_PROTO_VERSION_ERROR,xc[yi]=x.RC_CONN_IDENTIFIER_REJECTED,xc[Ai]=x.RC_CONN_SERVER_UNAVAILABLE,xc[Si]=x.RC_CONN_TOKEN_INCORRECT,xc[Oi]=x.RC_CONN_NOT_AUTHRORIZED,xc[Ni]=x.RC_CONN_REDIRECTED,xc[Ci]=x.RC_CONN_PACKAGE_NAME_INVALID,xc[Pi]=x.RC_CONN_APP_BLOCKED_OR_DELETED,xc[Li]=x.RC_CONN_USER_BLOCKED,xc[wi]=x.RC_CONN_TOKEN_EXPIRED,xc[Mi]=x.RC_CONN_DEVICE_ERROR,xc[Ui]=x.RC_CONN_HOSTNAME_ERROR,xc[Di]=x.RC_DISCONN_SAME_CLIENT_ON_LINE,xc[Gi]=x.RC_LISCENSE_COUNT_OUT_OF_LIMIT,xc[Vi]=x.RC_CONN_WRONG_CLUSTER,xc[ji]=x.RC_APP_AUTH_NOT_PASS,xc[ki]=x.RC_OTP_USED,xc[xi]=x.RC_PLATFORM_ERROR,xc[Fi]=x.RC_ACCOUNT_CANCELLATION,xc[Bi]=x.RC_LICENSE_EXPIRED,xc),td=function(e){return[kr.ppMsgS,kr.pgMsgS,kr.chatMsgS,kr.prMsgS].includes(e)},nd=function(e){function n(t,n,r){var i=e.call(this,t,n,r)||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 zc(i.logger),i}return t(n,e),Object.defineProperty(n.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(n.prototype,"getLocalConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime}}),Object.defineProperty(n.prototype,"getCrtServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}}),Object.defineProperty(n.prototype,"getDelayTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime-this._connectedTime}}),Object.defineProperty(n.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,d,_,f;return a(this,(function(h){switch(h.label){case 0:if(n=t.openAnti,i=t.type,o=t.baggageEnabled,s=this.getCmpList(t),this.logger.debug(B.L_NAVI_CMP_R,JSON.stringify(s),r),0===(u=s.filter((function(e,t){return s.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(B.L_NAVI_CONF_E,"no service available",r),[2,Rn(x.SERVER_UNAVAILABLE)];l=1===n?ei:ti,c=function(t){var n,s,c,_,f,h,g,p,E,b,T;return a(this,(function(a){switch(a.label){case 0:return n=u[t],s=n.protocol,c=n.addr,_=n.weight,f=function(e,t,n,r,i,o,a,s){var u,l=a?"&protocolVer=".concat(a):"",c=vc(),d=yc();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(n,"&token=").concat(encodeURIComponent(r),"&sdkVer=").concat(Ye,"&pid=").concat(o,"&deviceId=").concat(encodeURIComponent(c)).concat(1===s?"&baggage=".concat(encodeURIComponent("cid=".concat(i))):"","&apiVer=").concat(encodeURIComponent((null===(u=la.getApiVer)||void 0===u?void 0:u.call(la))||"||")).concat(la.connectPlatform?"&platform=".concat(la.connectPlatform):"").concat(l).concat(la.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(d)):"")}(s===H.WS?"ws":"wss",c,d.appkey,e,d.cid,"",l,o),h=Date.now(),[4,d.connectWebSocket(f,l,r)];case 1:return g=a.sent(),p=g.code,E=g.data,b=d.cmpWeightCache.findIndex((function(e){return e.addr===c})),T={bid:un(),ptc:Se.WS,cod:p,net:d.getNetwork().type,dur:Date.now()-h,spr:0,pr:i||0,hos:c,idx:b,rct:d.retryCount?Ce.RECONNECT:Ce.CONNECT,cid:d.cid,v:Ne.CURRENT,rsn:d._doConnectReason,count:d.retryCount,weight:_,ssid:d._serverSessionId},d.logger.record(ve.IM_WEBSOCKET,JSON.stringify(T),r),p===x.RC_SOCKET_DISCONNECTED||p===x.TIMEOUT?[2,"continue"]:p!==x.SUCCESS?[2,{value:Rn(p)}]:(d._localConnectedTime=Math.floor((Date.now()+h)/2),d._socket=E.socket,d.updateCmpWeight(u[t].addr,!0),d.curCmpUrl=u[t].addr,[2,{value:vn(E.userId)}])}}))},d=this,_=0,h.label=1;case 1:return _<u.length?[5,c(_)]:[3,4];case 2:if("object"==typeof(f=h.sent()))return[2,f.value];h.label=3;case 3:return _+=1,[3,1];case 4:return[2,Rn(x.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(n.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,_,f=this;return a(this,(function(a){switch(a.label){case 0:return this.logger.info(B.L_CONNECT_O,"connect start: ".concat(e),n),r=Sn(),i=r.resolve,o=r.promise,[4,la.createWebSocket(e)];case 1:return s=a.sent(),u=s.data,l=s.code,c=s.msg,l===x.SUCCESS&&u?(this._socketIndex=u.id,d=x.SUCCESS,_=setTimeout((function(){f.logger.warn(B.L_CONNECT_S,"timeout",n),d=x.TIMEOUT,u.close()}),5e3),u.onOpen((function(){f.logger.info(B.L_CONNECT_S,"socket opened",n),clearTimeout(_)})),u.onError((function(e){f.logger.info(B.L_CONNECT_S,"socket error",n),clearTimeout(_);var t=x.RC_SOCKET_DISCONNECTED;i(Rn(t)),f.onSocketEnd(u,t)})),u.onClose((function(){f.logger.info(B.L_CONNECT_S,"socket close",n);var e=d===x.SUCCESS?x.RC_SOCKET_DISCONNECTED:d;i(Rn(e)),f.onSocketEnd(u,e)})),u.onMessage((function(e){if(f._socketIndex===u.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var r=To(e,t);if(r){if(r instanceof ro){var o=r.status;if(o!==Ii)return f.logger.warn(B.L_CONNECT_O,"connect failed: ".concat(o),n),d=ed[o],u.close(),void i(Rn(d));f.logger.info(B.L_CONNECT_O,"connect success",n);var a=r.timestamp,s=r.userId,l=r.messageId,c=r.sessionId;return f._serverSessionId=c,f._connectedTime=a,f._idCount=l,void i(vn({userId:s,socket:u}))}if(r instanceof oo){var _=r.status;return f.logger.info(B.T,"recv disconnect signal -> status: ".concat(_)),void f.onRecvDisconnect(_,u)}f._onReceiveSignal(r)}}}else f.logger.warn(B.L_WS_DISACCORD_E,JSON.stringify({socketIndex:f._socketIndex,curSocketId:u.id}))})),[2,o]):[2,Rn(l,c)]}}))}))}}),Object.defineProperty(n.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==Hr)return e instanceof co&&!e.syncMsg?(this.logger.debug(B.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new po(e.messageId))):void(e instanceof bo&&this._messageIds[e.messageId]&&(this.logger.debug(B.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new Eo(e.messageId))))}}),Object.defineProperty(n.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.syncMsg,n=e.topic,r=e.messageId,this.logger.debug(B.O,"recv PublishReader -> messageId: ".concat(r," ").concat(n)),n===si?[2]:!t||td(Fr(n))?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[r]=e}))];case 1:return i=a.sent(),delete this._syncMessageIds[r],this.emit("signal",e,i),[2]}}))}))}}),Object.defineProperty(n.prototype,"_onReceiveSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return e instanceof so&&this._pingResolve?(this._pingResolve(x.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof go||e instanceof bo)&&(t=e.messageId,this.logger.debug(B.O,"recv ack -> messageId: ".concat(t)),(n=this._messageIds[t])&&(n(e),delete this._messageIds[t]),(r=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],r(e))),e instanceof co?[4,this._publishReader(e)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(n.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 $c[e]}(e)))}}),Object.defineProperty(n.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(n.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(x.RC_SOCKET_DISCONNECTED)}}}),Object.defineProperty(n.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(n){t._pingResolve=n,setTimeout((function(){return n(x.TIMEOUT)}),e),t.sendOnly(new ao)}))}}),Object.defineProperty(n.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof ho||e instanceof fo)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(n.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(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(x.TIMEOUT)}),3e4)}))]):[2,Rn(x.RC_NET_CHANNEL_INVALID)];case 1:return n=o.sent(),r="number"==typeof n?n:n.status,x.SUCCESS,"number"==typeof n?[2,Rn(n)]:[2,r===x.SUCCESS?vn(n):Rn(r,"",n)]}}))}))}}),Object.defineProperty(n.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u;return a(this,(function(a){switch(a.label){case 0:return this.logger.createTraceId(),Br(e),o=new fo(e,n,t),i&&o.setHeaderQos(i),[4,this._sendHandler(o)];case 1:return s=a.sent(),u=s.data,s.isOk&&void 0!==r?[2,vn(Nl.decode(r,u.pbData))]:[2,s]}}))}))}}),Object.defineProperty(n.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,this._sendHandler(e)];case 1:return(n=a.sent()).data?n.data instanceof go?[2,n]:(r=n.data,i=t&&r.pbData&&[x.SUCCESS,x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,x.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,x.RC_USER_PROFILE_KEY_NOT_EXIST,x.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,x.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,x.RC_USER_PROFILE_VALUE_EXCEED_RANGE,x.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(r.status)>=0,o=i?Nl.decode(t,r.pbData):r,0!==r.status?[2,Rn(r.status,void 0,t&&r.pbData?o:null)]:[2,vn(o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return n?[4,this.sendOnly(new io(Yi))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),n}(br),rd=function(e){function n(t,n,r){var i=e.call(this,n,t,r)||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=la.runtimeInfo,a=o.type,s=o.version;return i.deviceId=vc(),i.model="Web|".concat(a,"|").concat(s),i.init(),i}return t(n,e),Object.defineProperty(n.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,_,f;return a(this,(function(a){switch(a.label){case 0:return(i=r).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:n,body:JSON.stringify(i)},s=this.logger.createTraceId(),this.logger.info(B.L_REQUEST_T,JSON.stringify(o),s),[4,la.httpReq(o)];case 1:u=a.sent(),l=u.status,c=u.data,d=void 0===c?"":c,this.logger.info(B.L_REQUEST_R,JSON.stringify({status:l,data:d}),s);try{return _=JSON.parse(d),f=_.data,[2,{code:parseInt(_.code,10),data:f}]}catch(e){return this.logger.warn(B.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:l,data:d,error:e})),[2,{code:l,msg:e}]}return[2]}}))}))}}),Object.defineProperty(n.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ut(this.appkey);la.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(B.L_CLOUD_SET_CACHE_O,JSON.stringify(e))}}),Object.defineProperty(n.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=ut(this.appkey),t=la.localStorage.getItem(e);return this.logger.info(B.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t}}),Object.defineProperty(n.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(B.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}}),Object.defineProperty(n.prototype,"getMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mrtr}}),n}(pr),id=function(e){function n(t,n,r,i){var o=e.call(this,t,n,r,i)||this;return Object.defineProperty(o,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_id",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:i}),Fc.set(o,void 0),Bc.set(o,pt),d(o,Fc,new bc(ct(t)),"f"),o}return t(n,e),Object.defineProperty(n.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){d(this,Bc,e,"f")}}),Object.defineProperty(n.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,Bc,"f")}}),Object.defineProperty(n.prototype,"setConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{return c(this,Fc,"f").set(e,t),!0}catch(e){return!1}}}),Object.defineProperty(n.prototype,"getConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return{success:!0,value:c(this,Fc,"f").get(e)}}catch(e){return{success:!1}}}}),n}(tr);Fc=new WeakMap,Bc=new WeakMap;var od=null,ad="RC_LOGS",sd="RC_STATISTICS",ud=((Hc={})[ad]=["level","time"],Hc[sd]=["level","time"],Hc),ld=function(e,t,n){return new Promise((function(r){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),o=IDBKeyRange.upperBound(Date.now()-n),a=i.openCursor(o);a.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):r()},a.onerror=function(){r()}}))},cd=null,dd=function(e){return o(void 0,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return[4,od];case 1:return(t=r.sent())?(n=t.db,[4,ld(n,ad,e)]):[2];case 2:return r.sent(),[4,ld(n,sd,e)];case 3:return r.sent(),cd=setTimeout((function(){return dd(e)}),6e5),[2]}}))}))},_d=function(e,t,n){void 0===n&&(n=168),od||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==la.runtimeInfo.type?od=new Promise((function(r){var i=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(n){n.forEach((function(n){n.name&&e.includes(n.name)&&t.deleteDatabase(n.name)}))}))}(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var o="RC_LOGS_".concat(e),a=i.open(o,2);a.onerror=function(e){t.error(B.L_LOGDB_OPEN_FAILED_E,e.target.error),r(null)},a.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){od=null,t.warn(B.L_LOGDB_CLOSED_S)},o.onerror=function(e){od=null,t.error(B.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(B.L_LOGDB_ABORT_S,e.target.error)},dd(3600*Math.max(24,Math.min(168,n))*1e3),r({appkey:e,db:o})):r(null)},a.onupgradeneeded=function(e){var t=e.target.result;Object.keys(ud).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var n=t.createObjectStore(e,{autoIncrement:!0});ud[e].forEach((function(e){return n.createIndex(e,e,{unique:!1})}))}))}})):t.warn(B.L_UNSUPPORT_INDEXDB_O))},fd=[],hd=function(e,t,n){return new Promise((function(r){var i=e.transaction(t,"readwrite");i.oncomplete=r,i.onabort=r;var o=i.objectStore(t);n.forEach((function(e){try{o.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},gd=[],pd=!1,Ed=function(e){return o(void 0,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return pd||0===gd.length?[2]:(pd=!0,t=gd.filter((function(e){return e.level<Qn.FATAL})),n=gd.filter((function(e){return e.level>=Qn.FATAL})),gd.length=0,[4,hd(e,ad,n)]);case 1:return r.sent(),[4,hd(e,sd,t)];case 2:return r.sent(),pd=!1,0===gd.length&&fd.length>0&&(fd.forEach((function(e){return e.close()})),fd.length=0),setTimeout((function(){return Ed(e)})),[2]}}))}))},bd=function(){var e=ur();return e.setLogReader((function(e,t,n,r,i){return void 0===i&&(i=ad),o(void 0,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return[4,od];case 1:return(o=a.sent())?[2,new Promise((function(a){var s=o.db.transaction(i,"readonly").objectStore(i),u=[],l=IDBKeyRange.bound(e,t),c=s.index("time").openCursor(l);c.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=n&&(r?i.sessionId===gt:i.level>=0)&&u.push(i),t.continue()}else a({logs:u})},c.onerror=function(){a({logs:[]})}}))]:[2,{logs:[]}]}}))}))})),e.setLogWriter((function(e){!function(e){o(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return[4,od];case 1:if(!(t=n.sent()))return[2];if(e.content&&Et(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return gd.push(e),Ed(t.db),[2]}}))}))}(e)})),e},Td="REPORT_SESSION",vd=function(e,t){return o(void 0,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){return n="".concat(Td,"_").concat(e),r=t.getSessionId(),i=t.getConf(n),o=i.success,s=i.value,o?(r===(null==s?void 0:s.sessionId)||t.setConf(n,{sessionId:r}),[2]):[2]}))}))},Rd=function(e,t){return o(void 0,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){return n=t.getSessionId(),r=t.getConf("".concat(Td,"_").concat(e)),i=r.success,o=r.value,[2,i&&(null==o?void 0:o.sessionId)===n]}))}))},Id=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,n){return void 0===t&&(t=Date.now()-Id),void 0===n&&(n=Date.now()),o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=t<0?Date.now()+t:t,(n=n<=0?Date.now():n)-t>Id&&(t=n-Id),r=ur(),(i=new id(e,"RC-IM","IM",r)).debug(B.T,"get logs: startTime ".concat(t," endTime ").concat(n)),_d(e,i),[4,r.read(t,n,Qn.DEBUG,!1)];case 1:return o=a.sent().logs,i.debug(B.T,"get logs ".concat(o.length)),function(e,t){var n=t.map((function(e){var t=e.sessionId,n=e.time,r=e.type,i=e.level,o=e.tag,a=e.traceId,s=e.loggerId,u=e.content;return"".concat(t,",").concat(n,",").concat(r,",").concat(i,",").concat(o,",").concat(a,",").concat(s,',"').concat(u,'"\n')})),r=new Blob(n,{type:"text/csv"}),i=URL.createObjectURL(r),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(n),o),[2]}}))}))}}}}var md,yd,Ad,Sd,Od,Nd=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),Cd=48,Pd=64,Ld=80,wd=96,Md="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ud=function(e){for(var t={},n=0;n<e.length-1;n++){var r=e.charAt(n)+e.charAt(n+1);t.hasOwnProperty(r)?t[r].push(n):t[r]=[n]}for(var i=[],o=[],a=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=Gd(e.length),n=String.fromCharCode(Ld|t.length);i.push(n+t)}else{var r=String.fromCharCode(wd|e.length);i.push(r)}i.push(e)}},s=0;s<e.length;){var u=Dd(t,e,s);if(u.length<2)o.push(e.charAt(s++));else if(u.length<4)o.push(e.substr(s,u.length)),s+=u.length;else{var l=Gd(s-u.offset),c=Gd(u.length);if(l.length+c.length>=u.length)o.push(e.substr(s,u.length)),s+=u.length;else{a();var d=String.fromCharCode(Pd|l.length<<2|c.length);i.push(d+l+c),s+=u.length}}}a();var _=Gd(e.length),f=String.fromCharCode(Cd|_.length);return i.push(f+_),i.join("")},Dd=function(e,t,n){var r={length:0,offset:-1};if(t.length,n>=t.length-1)return r;var i=e[t.charAt(n)+t.charAt(n+1)];if(i[0]===n)return r;for(var o=t.length-n,a=0,s=i.length;a<s;a++){var u=i[a],l=n-u;if(!(l>238327)){var c=Math.min(o,l);if(c<=r.length)break;if(!(r.length>2&&t.charAt(u+r.length-1)!==t.charAt(n+r.length-1))){for(var d=2,_=d;_<c&&t.charAt(u+_)===t.charAt(n+_);_++)d++;d>=r.length&&(r.length=d,r.offset=u)}}}return r},Gd=function(e){var t=[],n=0;do{n=e%62,t.push(Md.charAt(n)),e=(e-n)/62}while(e>0);return t.join("")},Vd=function(e){function n(t,n,r,i){var o,a=vc(),s=la.runtimeInfo,u=s.type,l=s.version,c="".concat(u,"|").concat(l,"|").concat(n.getSessionId(),"|").concat(la.connectPlatform);return o=e.call(this,t,a,c,i,n)||this,Object.defineProperty(o,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return t(n,e),Object.defineProperty(n.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return la.httpReq(e)}}),Object.defineProperty(n.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,vd(t.userId,this.logger)];case 1:return n.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))}}),Object.defineProperty(n.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,{success:!0,data:Ud(e.map(rr).join(""))}]}))}))}}),Object.defineProperty(n.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,n,r,this.tableName)]}))}))}}),n}(nr),kd=function(e){function n(t,n,r){return e.call(this,t,n,ad,r)||this}return t(n,e),Object.defineProperty(n.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,Rd(this.userId,this.logger)];case 1:return[2,e.sent()]}}))}))}}),Object.defineProperty(n.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r,i,s,u,l){return void 0===l&&(l=!1),o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return[4,this.isReporter()];case 1:return o=a.sent(),this.userId&&!o?[2]:[2,e.prototype.report.call(this,t,n,r,i,s,u,l)]}}))}))}}),n}(Vd),xd=function(e){function n(t,n,r){return e.call(this,t,n,sd,r)||this}return t(n,e),n}(Vd),Fd=function(e){function n(t,n){var r=e.call(this,"WebConversationSettings")||this;return md.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:n}),yd.set(r,!1),r._ctx.on("sCmd",c(r,md,"m",Sd),r),r._ctx.on("onConnected",c(r,md,"m",Ad),r),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return a(this,(function(n){switch(n.label){case 0:return[4,c(this,md,"m",Od).call(this,e)];case 1:return[2,n.sent().trans((function(e){return{version:t._storage.get("conversationStatusVersion")}}))]}}))}))}}),Object.defineProperty(n.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,c(this,md,"m",Od).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),n}(En);yd=new WeakMap,md=new WeakSet,Ad=function(){d(this,yd,!0,"f")},Sd=function(e,t){var n=t.type,r=t.time;if(3===n)this.push(r),e.stopPropagation()},Od=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,n=t.createTraceId(),t.info(B.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),n),r=Nl.encode(us,{time:e}),[4,this._ctx.query(kr.pullSeAtts,this._ctx.currentUserId,r,ls)];case 1:return i=a.sent(),t.summary(B.L_PULL_CONVERSATION_SETTINGS_R,i,n,{version:e},(function(t){return{syncTime:t.version,version:e}})),i.isOk&&(o=this._storage.updateBySessionStates(i.data)).length&&this._ctx.emit("conversationStatusChanged",o),c(this,yd,"f")&&(d(this,yd,!1,"f"),this._ctx.emit("conversationStatusSynced",i.code)),[2,i]}}))}))};var Bd,Hd,qd,Yd,Wd=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 n=this._memData[e],r=n.key,i=n.stringify;n.value=t;var o=i?JSON.stringify(t):t;la.localStorage.setItem(r,o)}}),e}(),Kd=function(e){var t;return"".concat(null!==(t=e.channelId)&&void 0!==t?t:"","_").concat(e.conversationType,"_").concat(e.targetId)},Jd=function(e){var t=u(e.split("_")),n=t[0],r=t[1],i=t.slice(2);return{channelId:n,conversationType:parseInt(r,10),targetId:i.join("_")}};function Qd(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 Xd=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:Re.NOT_SET,translateStrategy:wr.DEFAULT,tags:[],channelType:ne.PUBLIC,operationTime:0,draft:"",hidden:!1,includeRobot:!1}},Zd=function(){function e(e){Bd.set(this,void 0),Hd.set(this,void 0),qd.set(this,void 0),Yd.set(this,Xd()),d(this,Bd,e.conversationType,"f"),d(this,Hd,e.targetId,"f"),d(this,qd,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return c(this,Bd,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return c(this,Hd,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return c(this,qd,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return c(this,Yd,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!c(this,Yd,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!c(this,Yd,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return c(this,Yd,"f").notificationLevel||Re.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateStrategy",{get:function(){return c(this,Yd,"f").translateStrategy||wr.DEFAULT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(c(this,Yd,"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,Yd,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return c(this,Yd,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return c(this,Yd,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!c(this,Yd,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return c(this,Yd,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return c(this,Yd,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return c(this,Yd,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return c(this,Yd,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return c(this,Yd,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return c(this,Yd,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return c(this,Yd,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return c(this,Yd,"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,"identifier",{get:function(){return{conversationType:c(this,Bd,"f"),targetId:c(this,Hd,"f"),channelId:c(this,qd,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return Kd(this.identifier)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"includeRobot",{get:function(){return!!c(this,Yd,"f").includeRobot},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){return r(r({},this.identifier),{latestMessage:this.latestMessage,unreadMessageCount:this.unreadCount,unreadMentionedCount:this.unreadMentionedCount,unreadMentionedMeCount:this.unreadMentionedMeCount,hasMentioned:this.hasMentioned,mentionedInfo:this.mentionedInfo,lastUnreadTime:0,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,notificationStatus:Ue(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft,includeRobot:this.includeRobot})}}),Object.defineProperty(e.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};return this.isTop&&(e.to=!0),this.notificationLevel!==Re.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.translateStrategy!==wr.DEFAULT&&(e.ts=this.translateStrategy),this.hidden&&(e.h=!0),e}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.updateAttrs(r(r({},Xd()),{tags:this.tags,isTop:this.isTop,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,hidden:!0}))}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:e,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0},e)}}),Object.defineProperty(e.prototype,"updateAttrs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;void 0===t&&(t=0);var r={},i={latestMessage:"latestMessage",unreadCount:"unreadMessageCount",hasMentioned:"hasMentioned",mentionedInfo:"mentionedInfo",notificationLevel:"notificationLevel",tags:"tags",isTop:"isTop",translateStrategy:"translateStrategy",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,includeRobot:void 0,hidden:void 0};return Object.entries(i).forEach((function(i){var o=u(i,2),a=o[0],s=o[1],l=a;if(Object.prototype.hasOwnProperty.call(e,l)){var d=e[l];c(n,Yd,"f")[l]!==d&&(c(n,Yd,"f")[l]=d,s&&(r[s]={time:t,val:d}))}})),Object.keys(r).length>0?r:null}}),e}();Bd=new WeakMap,Hd=new WeakMap,qd=new WeakMap,Yd=new WeakMap;var zd,$d,e_,t_=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.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}}),n}(Zd),n_=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.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(n.prototype,"isDefaultChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!this.channelId||"RCDefault"===this.channelId}}),n}(Zd),r_=function(e){function n(t){var n=e.call(this)||this;return zd.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"models",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),n}return t(n,e),Object.defineProperty(n.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=la.localStorage,n=e.appkey,r=e.currentUserId,i=e.isDisableEmptyUGChannelId;t.removeItem("RC-con-s-ver-".concat(n,"-").concat(r));var o=rt(n,r),a=nt(n,r),s=it(n,r),u=ze(n,r),l=Ze(n,r),d=$e(n,r),_=et(n,r),f=t.getItem(o)||"0",h=t.getItem(a)||"0",g=t.getItem(s)||"1",p=t.getItem(l)||"0",E=JSON.parse(t.getItem(_)||"{}"),b=JSON.parse(t.getItem(u)||"{}"),T=JSON.parse(t.getItem(d)||"{}");return c(this,zd,"m",$d).call(this,b,T,E,i),{inboxTime:{value:parseInt(f,10)||0,key:o},outboxTime:{value:parseInt(h,10)||0,key:a},broadcastTime:{value:parseInt(g,10)||0,key:s},conversationStatus:{value:b,key:u,stringify:!0},ultraGroupStatus:{value:T,key:d,stringify:!0},conversationStatusVersion:{value:parseInt(p,10)||0,key:l},conversationTypeGlobalSettings:{value:E,key:_,stringify:!0}}}}),Object.defineProperty(n.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),this.models.clear(),c(this,zd,"m",e_).call(this)}}),Object.defineProperty(n.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("conversationTypeGlobalSettings");t===Re.NOT_SET?delete n[e]:n[e]={nl:t},this.set("conversationTypeGlobalSettings",n)}}),Object.defineProperty(n.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return(null===(t=this.get("conversationTypeGlobalSettings")[e])||void 0===t?void 0:t.nl)||Re.NOT_SET}}),Object.defineProperty(n.prototype,"getOrCreateModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=e.conversationType,r=e.targetId;e.channelId;var i=this.getModel(e);if(!i){i=e.conversationType===F.ULTRA_GROUP?new n_(e):new t_(e);var o=(n===F.PRIVATE||n===F.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===r}));i.updateAttrs({includeRobot:o}),t&&this.models.set(Kd(e),i)}return i}}),Object.defineProperty(n.prototype,"updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("ultraGroupStatus"),n=this.get("conversationStatus");e.forEach((function(e){var r=e.conversationType,i=e.key,o=e.toStoragItem(),a=Object.keys(o),s=0===a.length||1===a.length&&"h"===a[0],u=r===F.ULTRA_GROUP?t:n;s?delete u[i]:u[i]=o})),this.set("conversationStatus",n),this.set("ultraGroupStatus",t)}}),Object.defineProperty(n.prototype,"updateBySessionStates",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=e.version,r=e.state;if(!(null==r?void 0:r.length))return[];var i=this.get("conversationStatusVersion"),o=new Map,a=new Set;r.forEach((function(e){var r=e.channelId,s=e.busChannel,u=e.type,l=e.stateItem,c=e.time;i=Math.max(i,c);var d={};if(null==l||l.forEach((function(e){var t=e.tags,n=e.sessionStateType,r=e.value;switch(n){case pa.IsSilent:d.notificationLevel=parseInt(r,10);break;case pa.IsTop:d.isTop="1"===r;break;case pa.Tags:d.tags=t;break;case pa.AutoTrans:d.translateStrategy=parseInt(r,10)}})),r){var _={conversationType:u,targetId:r,channelId:s},f=t.getOrCreateModel(_,!0);a.add(f);var h=f.updateAttrs(d,n);if(h)if(o.has(f)){var g=o.get(f);Object.assign(g,h)}else o.set(f,h)}else void 0!==d.notificationLevel&&t.setConversationTypeNotificationLevel(u,d.notificationLevel)})),this.set("conversationStatusVersion",i),this.updateConversationStorage(Array.from(a));var s=Array.from(o.entries()).map((function(e){var t=u(e,2),n=t[0],r=t[1];return{conversation:n.toIReceivedConversation(),updatedItems:r}}));return s}}),Object.defineProperty(n.prototype,"addRelations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;e.forEach((function(e){var r=e.userId,i=e.type,o={conversationType:i,targetId:r,channelId:e.busChannel},a=n.getOrCreateModel(o,!0),s=function(e,t){var n,r,i,o=e.msg,a=e.isBot;return{latestMessage:o?Cc(o,t,!1,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===(r=e.msgInfo)||void 0===r?void 0:r.msgId,firstUnreadTime:null===(i=e.msgInfo)||void 0===i?void 0:i.msgTime,includeRobot:!!a}}(e,t);i===F.ULTRA_GROUP?a.updateAttrs(s):a.updateAttrs({latestMessage:s.latestMessage,operationTime:s.operationTime,includeRobot:s.includeRobot,hidden:!1})}))}}),Object.defineProperty(n.prototype,"getDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);return(null==t?void 0:t.draft)||""}}),Object.defineProperty(n.prototype,"setDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}}),Object.defineProperty(n.prototype,"deleteDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);t&&t.updateAttrs({draft:""})}}),Object.defineProperty(n.prototype,"getCachedUGConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n={conversationType:F.ULTRA_GROUP,targetId:e,channelId:t},r=this.getModel(n);return(null==r?void 0:r.toIReceivedConversation())||null}}),Object.defineProperty(n.prototype,"getAllUGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.models.values();return Array.from(e).filter((function(e){return e.conversationType===F.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(n.prototype,"getAllSGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.models.values();return Array.from(e).filter((function(e){return e.conversationType!==F.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(n.prototype,"getAllModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(this.models.values())}}),Object.defineProperty(n.prototype,"getModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,r=Kd(e),i=this.models.get(r);if(!i)return null;var o=(t===F.PRIVATE||t===F.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===n}));return i.updateAttrs({includeRobot:o}),i}}),Object.defineProperty(n.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);t&&(t.remove(),this.updateConversationStorage([t]))}}),Object.defineProperty(n.prototype,"getAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=0;return this.getAllSGModels().forEach((function(r){var i,o=r.conversationType;e.includes(o)&&(r.notificationLevel>Re.NOT_SET&&!t||(n+=null!==(i=r.unreadCount)&&void 0!==i?i:0))})),n}}),Object.defineProperty(n.prototype,"getTagConversationCountMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Map;return this.getAllModels().forEach((function(t){var n=t.tags;n.length>0&&n.forEach((function(n){e.set(n.tagId,(e.get(n.tagId)||[]).concat(t.identifier))}))})),e}}),Object.defineProperty(n.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.getModel(e);if(!n)return null;var r=n.clearUnreadCount(t);return this.updateConversationStorage([n]),r?{conversation:n.toIReceivedConversation(),updatedItems:r}:null}}),n}(Wd);zd=new WeakSet,$d=function(e,t,n,r){Object.keys(e).forEach((function(t){var r=Jd(t);te(r.conversationType,W)?r.targetId||(n[r.conversationType]={nl:e[t].nl||Re.NOT_SET},delete e[t]):delete e[t]})),Object.keys(t).forEach((function(e){var i=Jd(e);if(i.conversationType===F.ULTRA_GROUP)return i.targetId?void(r&&!i.channelId&&delete t[e]):(n[i.conversationType]={nl:t[e].nl||Re.NOT_SET},void delete t[e]);delete t[e]}))},e_=function(){var e=this,t=Object.entries(this.get("conversationStatus")),n=Object.entries(this.get("ultraGroupStatus"));l(l([],u(t),!1),u(n),!1).forEach((function(t){var n,r,i,o,a,s,l,c,d,_,f,h,g,p,E,b=u(t,2),T=b[0],v=b[1],R=Jd(T);te(R.conversationType,J)&&e.getOrCreateModel(R,!0).updateAttrs((r=(n=v).c,i=n.mc,o=n.mmc,a=n.hm,s=n.m,l=n.fut,c=n.fuid,d=n.fumt,_=n.nl,f=n.to,h=n.tg,g=n.rt,p=n.h,E=n.ts,{isTop:f,notificationLevel:_,tags:Qd(h),unreadCount:r,unreadMentionedCount:i,unreadMentionedMeCount:o,hasMentioned:a,mentionedInfo:s,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:d,lastReadTime:g,hidden:p,translateStrategy:E}),0)}))};function i_(e){let t=e.length;for(;--t>=0;)e[t]=0}const o_=256,a_=286,s_=30,u_=15,l_=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]),c_=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]),d_=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),__=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f_=new Array(576);i_(f_);const h_=new Array(60);i_(h_);const g_=new Array(512);i_(g_);const p_=new Array(256);i_(p_);const E_=new Array(29);i_(E_);const b_=new Array(s_);function T_(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let v_,R_,I_;function m_(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}i_(b_);const y_=e=>e<256?g_[e]:g_[256+(e>>>7)],A_=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},S_=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,A_(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},O_=(e,t,n)=>{S_(e,n[2*t],n[2*t+1])},N_=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},C_=(e,t,n)=>{const r=new Array(16);let i,o,a=0;for(i=1;i<=u_;i++)a=a+n[i-1]<<1,r[i]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=N_(r[t]++,t))}},P_=e=>{let t;for(t=0;t<a_;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s_;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},L_=e=>{e.bi_valid>8?A_(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},w_=(e,t,n,r)=>{const i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},M_=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&w_(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!w_(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},U_=(e,t,n)=>{let r,i,o,a,s=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+s++],r+=(255&e.pending_buf[e.sym_buf+s++])<<8,i=e.pending_buf[e.sym_buf+s++],0===r?O_(e,i,t):(o=p_[i],O_(e,o+o_+1,t),a=l_[o],0!==a&&(i-=E_[o],S_(e,i,a)),r--,o=y_(r),O_(e,o,n),a=c_[o],0!==a&&(r-=b_[o],S_(e,r,a)))}while(s<e.sym_next);O_(e,256,t)},D_=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<o;a++)0!==n[2*a]?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[2*a+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,n[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[2*u+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)M_(e,n,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],M_(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[2*u]=n[2*a]+n[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[2*a+1]=n[2*s+1]=u,e.heap[1]=u++,M_(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,d,_,f,h,g=0;for(_=0;_<=u_;_++)e.bl_count[_]=0;for(n[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],_=n[2*n[2*c+1]+1]+1,_>u&&(_=u,g++),n[2*c+1]=_,c>r||(e.bl_count[_]++,f=0,c>=s&&(f=a[c-s]),h=n[2*c],e.opt_len+=h*(_+f),o&&(e.static_len+=h*(i[2*c+1]+f)));if(0!==g){do{for(_=u-1;0===e.bl_count[_];)_--;e.bl_count[_]--,e.bl_count[_+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(_=u;0!==_;_--)for(c=e.bl_count[_];0!==c;)d=e.heap[--l],d>r||(n[2*d+1]!==_&&(e.opt_len+=(_-n[2*d+1])*n[2*d],n[2*d+1]=_),c--)}})(e,t),C_(n,l,e.bl_count)},G_=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<u&&i===a||(s<l?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4))},V_=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<u&&i===a)){if(s<l)do{O_(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(O_(e,i,e.bl_tree),s--),O_(e,16,e.bl_tree),S_(e,s-3,2)):s<=10?(O_(e,17,e.bl_tree),S_(e,s-3,3)):(O_(e,18,e.bl_tree),S_(e,s-11,7));s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4)}};let j_=!1;const k_=(e,t,n,r)=>{S_(e,0+(r?1:0),3),L_(e),A_(e,n),A_(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var x_=(e,t,n,r)=>{let i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&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<o_;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),D_(e,e.l_desc),D_(e,e.d_desc),a=(e=>{let t;for(G_(e,e.dyn_ltree,e.l_desc.max_code),G_(e,e.dyn_dtree,e.d_desc.max_code),D_(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*__[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=n+5,n+4<=i&&-1!==t?k_(e,t,n,r):4===e.strategy||o===i?(S_(e,2+(r?1:0),3),U_(e,f_,h_)):(S_(e,4+(r?1:0),3),((e,t,n,r)=>{let i;for(S_(e,t-257,5),S_(e,n-1,5),S_(e,r-4,4),i=0;i<r;i++)S_(e,e.bl_tree[2*__[i]+1],3);V_(e,e.dyn_ltree,t-1),V_(e,e.dyn_dtree,n-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),U_(e,e.dyn_ltree,e.dyn_dtree)),P_(e),r&&L_(e)},F_={_tr_init:e=>{j_||((()=>{let e,t,n,r,i;const o=new Array(16);for(n=0,r=0;r<28;r++)for(E_[r]=n,e=0;e<1<<l_[r];e++)p_[n++]=r;for(p_[n-1]=r,i=0,r=0;r<16;r++)for(b_[r]=i,e=0;e<1<<c_[r];e++)g_[i++]=r;for(i>>=7;r<s_;r++)for(b_[r]=i<<7,e=0;e<1<<c_[r]-7;e++)g_[256+i++]=r;for(t=0;t<=u_;t++)o[t]=0;for(e=0;e<=143;)f_[2*e+1]=8,e++,o[8]++;for(;e<=255;)f_[2*e+1]=9,e++,o[9]++;for(;e<=279;)f_[2*e+1]=7,e++,o[7]++;for(;e<=287;)f_[2*e+1]=8,e++,o[8]++;for(C_(f_,287,o),e=0;e<s_;e++)h_[2*e+1]=5,h_[2*e]=N_(e,5);v_=new T_(f_,l_,257,a_,u_),R_=new T_(h_,c_,0,s_,u_),I_=new T_(new Array(0),d_,0,19,7)})(),j_=!0),e.l_desc=new m_(e.dyn_ltree,v_),e.d_desc=new m_(e.dyn_dtree,R_),e.bl_desc=new m_(e.bl_tree,I_),e.bi_buf=0,e.bi_valid=0,P_(e)},_tr_stored_block:k_,_tr_flush_block:x_,_tr_tally:(e,t,n)=>(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++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(p_[n]+o_+1)]++,e.dyn_dtree[2*y_(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{S_(e,2,3),O_(e,256,f_),(e=>{16===e.bi_valid?(A_(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 B_=(e,t,n,r)=>{let i=65535&e,o=e>>>16&65535,a=0;for(;0!==n;){a=n>2e3?2e3:n,n-=a;do{i=i+t[r++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16};const H_=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var q_=(e,t,n,r)=>{const i=H_,o=r+n;e^=-1;for(let n=r;n<o;n++)e=e>>>8^i[255&(e^t[n])];return~e},Y_={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"},W_={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:K_,_tr_stored_block:J_,_tr_flush_block:Q_,_tr_tally:X_,_tr_align:Z_}=F_,{Z_NO_FLUSH:z_,Z_PARTIAL_FLUSH:$_,Z_FULL_FLUSH:ef,Z_FINISH:tf,Z_BLOCK:nf,Z_OK:rf,Z_STREAM_END:of,Z_STREAM_ERROR:af,Z_DATA_ERROR:sf,Z_BUF_ERROR:uf,Z_DEFAULT_COMPRESSION:lf,Z_FILTERED:cf,Z_HUFFMAN_ONLY:df,Z_RLE:_f,Z_FIXED:ff,Z_DEFAULT_STRATEGY:hf,Z_UNKNOWN:gf,Z_DEFLATED:pf}=W_,Ef=258,bf=262,Tf=42,vf=113,Rf=666,If=(e,t)=>(e.msg=Y_[t],t),mf=e=>2*e-(e>4?9:0),yf=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Af=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do{n=e.head[--r],e.head[r]=n>=i?n-i:0}while(--t);t=i,r=t;do{n=e.prev[--r],e.prev[r]=n>=i?n-i:0}while(--t)};let Sf=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const Of=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},Nf=(e,t)=>{Q_(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Of(e.strm)},Cf=(e,t)=>{e.pending_buf[e.pending++]=t},Pf=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Lf=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=B_(e.adler,t,i,n):2===e.state.wrap&&(e.adler=q_(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},wf=(e,t)=>{let n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-bf?e.strstart-(e.w_size-bf):0,l=e.window,c=e.w_mask,d=e.prev,_=e.strstart+Ef;let f=l[o+a-1],h=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(n=t,l[n+a]===h&&l[n+a-1]===f&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&o<_);if(r=Ef-(_-o),o=_-Ef,r>a){if(e.match_start=t,a=r,r>=s)break;f=l[o+a-1],h=l[o+a]}}}while((t=d[t&c])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead},Mf=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-bf)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Af(e),r+=t),0===e.strm.avail_in)break;if(n=Lf(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Sf(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Sf(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<bf&&0!==e.strm.avail_in)},Uf=(e,t)=>{let n,r,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,s=e.strm.avail_in;do{if(n=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,r=e.strstart-e.block_start,n>r+e.strm.avail_in&&(n=r+e.strm.avail_in),n>i&&(n=i),n<o&&(0===n&&t!==tf||t===z_||n!==r+e.strm.avail_in))break;a=t===tf&&n===r+e.strm.avail_in?1:0,J_(e,0,0,a),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Of(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(Lf(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===a);return s-=e.strm.avail_in,s&&(s>=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<=s&&(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-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==z_&&t!==tf&&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&&(Lf(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,r=e.strstart-e.block_start,(r>=o||(r||t===tf)&&t!==z_&&0===e.strm.avail_in&&r<=i)&&(n=r>i?i:r,a=t===tf&&0===e.strm.avail_in&&n===r?1:0,J_(e,e.block_start,n,a),e.block_start+=n,Of(e.strm)),a?3:1)},Df=(e,t)=>{let n,r;for(;;){if(e.lookahead<bf){if(Mf(e),e.lookahead<bf&&t===z_)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Sf(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-bf&&(e.match_length=wf(e,n)),e.match_length>=3)if(r=X_(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=Sf(e,e.ins_h,e.window[e.strstart+3-1]),n=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=Sf(e,e.ins_h,e.window[e.strstart+1]);else r=X_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Nf(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===tf?(Nf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Nf(e,!1),0===e.strm.avail_out)?1:2},Gf=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<bf){if(Mf(e),e.lookahead<bf&&t===z_)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Sf(e,e.ins_h,e.window[e.strstart+3-1]),n=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!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-bf&&(e.match_length=wf(e,n),e.match_length<=5&&(e.strategy===cf||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,r=X_(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=Sf(e,e.ins_h,e.window[e.strstart+3-1]),n=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++,r&&(Nf(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=X_(e,0,e.window[e.strstart-1]),r&&Nf(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&&(r=X_(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===tf?(Nf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Nf(e,!1),0===e.strm.avail_out)?1:2};function Vf(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const jf=[new Vf(0,0,0,0,Uf),new Vf(4,4,8,4,Df),new Vf(4,5,16,8,Df),new Vf(4,6,32,32,Df),new Vf(4,4,16,16,Gf),new Vf(8,16,32,32,Gf),new Vf(8,16,128,128,Gf),new Vf(8,32,128,256,Gf),new Vf(32,128,258,1024,Gf),new Vf(32,258,258,4096,Gf)];function kf(){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=pf,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),yf(this.dyn_ltree),yf(this.dyn_dtree),yf(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),yf(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),yf(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 xf=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Tf&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==vf&&t.status!==Rf?1:0},Ff=e=>{if(xf(e))return If(e,af);e.total_in=e.total_out=0,e.data_type=gf;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?Tf:vf,e.adler=2===t.wrap?0:1,t.last_flush=-2,K_(t),rf},Bf=e=>{const t=Ff(e);var n;return t===rf&&((n=e.state).window_size=2*n.w_size,yf(n.head),n.max_lazy_match=jf[n.level].max_lazy,n.good_match=jf[n.level].good_length,n.nice_match=jf[n.level].nice_length,n.max_chain_length=jf[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},Hf=(e,t,n,r,i,o)=>{if(!e)return af;let a=1;if(t===lf&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||n!==pf||r<8||r>15||t<0||t>9||o<0||o>ff||8===r&&1!==a)return If(e,af);8===r&&(r=9);const s=new kf;return e.state=s,s.strm=e,s.status=Tf,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=o,s.method=n,Bf(e)};var qf={deflateInit:(e,t)=>Hf(e,t,pf,15,8,hf),deflateInit2:Hf,deflateReset:Bf,deflateResetKeep:Ff,deflateSetHeader:(e,t)=>xf(e)||2!==e.state.wrap?af:(e.state.gzhead=t,rf),deflate:(e,t)=>{if(xf(e)||t>nf||t<0)return e?If(e,af):af;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===Rf&&t!==tf)return If(e,0===e.avail_out?uf:af);const r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(Of(e),0===e.avail_out)return n.last_flush=-1,rf}else if(0===e.avail_in&&mf(t)<=mf(r)&&t!==tf)return If(e,uf);if(n.status===Rf&&0!==e.avail_in)return If(e,uf);if(n.status===Tf&&0===n.wrap&&(n.status=vf),n.status===Tf){let t=pf+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=df||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=r<<6,0!==n.strstart&&(t|=32),t+=31-t%31,Pf(n,t),0!==n.strstart&&(Pf(n,e.adler>>>16),Pf(n,65535&e.adler)),e.adler=1,n.status=vf,Of(e),0!==n.pending)return n.last_flush=-1,rf}if(57===n.status)if(e.adler=0,Cf(n,31),Cf(n,139),Cf(n,8),n.gzhead)Cf(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Cf(n,255&n.gzhead.time),Cf(n,n.gzhead.time>>8&255),Cf(n,n.gzhead.time>>16&255),Cf(n,n.gzhead.time>>24&255),Cf(n,9===n.level?2:n.strategy>=df||n.level<2?4:0),Cf(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Cf(n,255&n.gzhead.extra.length),Cf(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=q_(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(Cf(n,0),Cf(n,0),Cf(n,0),Cf(n,0),Cf(n,0),Cf(n,9===n.level?2:n.strategy>=df||n.level<2?4:0),Cf(n,3),n.status=vf,Of(e),0!==n.pending)return n.last_flush=-1,rf;if(69===n.status){if(n.gzhead.extra){let t=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=q_(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,Of(e),0!==n.pending)return n.last_flush=-1,rf;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=q_(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=q_(e.adler,n.pending_buf,n.pending-r,r)),Of(e),0!==n.pending)return n.last_flush=-1,rf;r=0}t=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,Cf(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=q_(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=q_(e.adler,n.pending_buf,n.pending-r,r)),Of(e),0!==n.pending)return n.last_flush=-1,rf;r=0}t=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,Cf(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=q_(e.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Of(e),0!==n.pending))return n.last_flush=-1,rf;Cf(n,255&e.adler),Cf(n,e.adler>>8&255),e.adler=0}if(n.status=vf,Of(e),0!==n.pending)return n.last_flush=-1,rf}if(0!==e.avail_in||0!==n.lookahead||t!==z_&&n.status!==Rf){let r=0===n.level?Uf(n,t):n.strategy===df?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(Mf(e),0===e.lookahead)){if(t===z_)return 1;break}if(e.match_length=0,n=X_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Nf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===tf?(Nf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Nf(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===_f?((e,t)=>{let n,r,i,o;const a=e.window;for(;;){if(e.lookahead<=Ef){if(Mf(e),e.lookahead<=Ef&&t===z_)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=e.strstart+Ef;do{}while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);e.match_length=Ef-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=X_(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=X_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Nf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===tf?(Nf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Nf(e,!1),0===e.strm.avail_out)?1:2})(n,t):jf[n.level].func(n,t);if(3!==r&&4!==r||(n.status=Rf),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),rf;if(2===r&&(t===$_?Z_(n):t!==nf&&(J_(n,0,0,!1),t===ef&&(yf(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Of(e),0===e.avail_out))return n.last_flush=-1,rf}return t!==tf?rf:n.wrap<=0?of:(2===n.wrap?(Cf(n,255&e.adler),Cf(n,e.adler>>8&255),Cf(n,e.adler>>16&255),Cf(n,e.adler>>24&255),Cf(n,255&e.total_in),Cf(n,e.total_in>>8&255),Cf(n,e.total_in>>16&255),Cf(n,e.total_in>>24&255)):(Pf(n,e.adler>>>16),Pf(n,65535&e.adler)),Of(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?rf:of)},deflateEnd:e=>{if(xf(e))return af;const t=e.state.status;return e.state=null,t===vf?If(e,sf):rf},deflateSetDictionary:(e,t)=>{let n=t.length;if(xf(e))return af;const r=e.state,i=r.wrap;if(2===i||1===i&&r.status!==Tf||r.lookahead)return af;if(1===i&&(e.adler=B_(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===i&&(yf(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Mf(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=Sf(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,Mf(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,rf},deflateInfo:"pako deflate (from Nodeca project)"};const Yf=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Wf={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)Yf(n,t)&&(e[t]=n[t])}}return e},flattenChunks:e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;const n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n}};let Kf=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Kf=!1}const Jf=new Uint8Array(256);for(let e=0;e<256;e++)Jf[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Jf[254]=Jf[254]=1;var Qf={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i<a;i++)n=e.charCodeAt(i),55296==(64512&n)&&i+1<a&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)n=e.charCodeAt(i),55296==(64512&n)&&i+1<a&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},buf2string:(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,i;const o=new Array(2*n);for(i=0,r=0;r<n;){let t=e[r++];if(t<128){o[i++]=t;continue}let a=Jf[t];if(a>4)o[i++]=65533,r+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&r<n;)t=t<<6|63&e[r++],a--;a>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&&Kf)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n})(o,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+Jf[e[n]]>t?n:t}};var Xf=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 Zf=Object.prototype.toString,{Z_NO_FLUSH:zf,Z_SYNC_FLUSH:$f,Z_FULL_FLUSH:eh,Z_FINISH:th,Z_OK:nh,Z_STREAM_END:rh,Z_DEFAULT_COMPRESSION:ih,Z_DEFAULT_STRATEGY:oh,Z_DEFLATED:ah}=W_;function sh(e){this.options=Wf.assign({level:ih,method:ah,chunkSize:16384,windowBits:15,memLevel:8,strategy:oh},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 Xf,this.strm.avail_out=0;let n=qf.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==nh)throw new Error(Y_[n]);if(t.header&&qf.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Qf.string2buf(t.dictionary):"[object ArrayBuffer]"===Zf.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=qf.deflateSetDictionary(this.strm,e),n!==nh)throw new Error(Y_[n]);this._dict_set=!0}}sh.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?th:zf,"string"==typeof e?n.input=Qf.string2buf(e):"[object ArrayBuffer]"===Zf.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===$f||o===eh)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(i=qf.deflate(n,o),i===rh)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=qf.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===nh;if(0!==n.avail_out){if(o>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},sh.prototype.onData=function(e){this.chunks.push(e)},sh.prototype.onEnd=function(e){e===nh&&(this.result=Wf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const uh=16209;var lh=function(e,t){let n,r,i,o,a,s,u,l,c,d,_,f,h,g,p,E,b,T,v,R,I,m,y,A;const S=e.state;n=e.next_in,y=e.input,r=n+(e.avail_in-5),i=e.next_out,A=e.output,o=i-(t-e.avail_out),a=i+(e.avail_out-257),s=S.dmax,u=S.wsize,l=S.whave,c=S.wnext,d=S.window,_=S.hold,f=S.bits,h=S.lencode,g=S.distcode,p=(1<<S.lenbits)-1,E=(1<<S.distbits)-1;e:do{f<15&&(_+=y[n++]<<f,f+=8,_+=y[n++]<<f,f+=8),b=h[_&p];t:for(;;){if(T=b>>>24,_>>>=T,f-=T,T=b>>>16&255,0===T)A[i++]=65535&b;else{if(!(16&T)){if(64&T){if(32&T){S.mode=16191;break e}e.msg="invalid literal/length code",S.mode=uh;break e}b=h[(65535&b)+(_&(1<<T)-1)];continue t}for(v=65535&b,T&=15,T&&(f<T&&(_+=y[n++]<<f,f+=8),v+=_&(1<<T)-1,_>>>=T,f-=T),f<15&&(_+=y[n++]<<f,f+=8,_+=y[n++]<<f,f+=8),b=g[_&E];;){if(T=b>>>24,_>>>=T,f-=T,T=b>>>16&255,16&T){if(R=65535&b,T&=15,f<T&&(_+=y[n++]<<f,f+=8,f<T&&(_+=y[n++]<<f,f+=8)),R+=_&(1<<T)-1,R>s){e.msg="invalid distance too far back",S.mode=uh;break e}if(_>>>=T,f-=T,T=i-o,R>T){if(T=R-T,T>l&&S.sane){e.msg="invalid distance too far back",S.mode=uh;break e}if(I=0,m=d,0===c){if(I+=u-T,T<v){v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}}else if(c<T){if(I+=u+c-T,T-=c,T<v){v-=T;do{A[i++]=d[I++]}while(--T);if(I=0,c<v){T=c,v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}}}else if(I+=c-T,T<v){v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}for(;v>2;)A[i++]=m[I++],A[i++]=m[I++],A[i++]=m[I++],v-=3;v&&(A[i++]=m[I++],v>1&&(A[i++]=m[I++]))}else{I=i-R;do{A[i++]=A[I++],A[i++]=A[I++],A[i++]=A[I++],v-=3}while(v>2);v&&(A[i++]=A[I++],v>1&&(A[i++]=A[I++]))}break}if(64&T){e.msg="invalid distance code",S.mode=uh;break e}b=g[(65535&b)+(_&(1<<T)-1)]}}break}}while(n<r&&i<a);v=f>>3,n-=v,f-=v<<3,_&=(1<<f)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=i<a?a-i+257:257-(i-a),S.hold=_,S.bits=f};const ch=15,dh=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]),_h=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]),fh=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]),hh=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 gh=(e,t,n,r,i,o,a,s)=>{const u=s.bits;let l,c,d,_,f,h,g=0,p=0,E=0,b=0,T=0,v=0,R=0,I=0,m=0,y=0,A=null;const S=new Uint16Array(16),O=new Uint16Array(16);let N,C,P,L=null;for(g=0;g<=ch;g++)S[g]=0;for(p=0;p<r;p++)S[t[n+p]]++;for(T=u,b=ch;b>=1&&0===S[b];b--);if(T>b&&(T=b),0===b)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(E=1;E<b&&0===S[E];E++);for(T<E&&(T=E),I=1,g=1;g<=ch;g++)if(I<<=1,I-=S[g],I<0)return-1;if(I>0&&(0===e||1!==b))return-1;for(O[1]=0,g=1;g<ch;g++)O[g+1]=O[g]+S[g];for(p=0;p<r;p++)0!==t[n+p]&&(a[O[t[n+p]]++]=p);if(0===e?(A=L=a,h=20):1===e?(A=dh,L=_h,h=257):(A=fh,L=hh,h=0),y=0,p=0,g=E,f=o,v=T,R=0,d=-1,m=1<<T,_=m-1,1===e&&m>852||2===e&&m>592)return 1;for(;;){N=g-R,a[p]+1<h?(C=0,P=a[p]):a[p]>=h?(C=L[a[p]-h],P=A[a[p]-h]):(C=96,P=0),l=1<<g-R,c=1<<v,E=c;do{c-=l,i[f+(y>>R)+c]=N<<24|C<<16|P}while(0!==c);for(l=1<<g-1;y&l;)l>>=1;if(0!==l?(y&=l-1,y+=l):y=0,p++,0==--S[g]){if(g===b)break;g=t[n+a[p]]}if(g>T&&(y&_)!==d){for(0===R&&(R=T),f+=E,v=g-R,I=1<<v;v+R<b&&(I-=S[v+R],!(I<=0));)v++,I<<=1;if(m+=1<<v,1===e&&m>852||2===e&&m>592)return 1;d=y&_,i[d]=T<<24|v<<16|f-o}}return 0!==y&&(i[f+y]=g-R<<24|64<<16),s.bits=T,0};const{Z_FINISH:ph,Z_BLOCK:Eh,Z_TREES:bh,Z_OK:Th,Z_STREAM_END:vh,Z_NEED_DICT:Rh,Z_STREAM_ERROR:Ih,Z_DATA_ERROR:mh,Z_MEM_ERROR:yh,Z_BUF_ERROR:Ah,Z_DEFLATED:Sh}=W_,Oh=16180,Nh=16190,Ch=16191,Ph=16192,Lh=16194,wh=16199,Mh=16200,Uh=16206,Dh=16209,Gh=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Vh(){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 jh=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Oh||t.mode>16211?1:0},kh=e=>{if(jh(e))return Ih;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=Oh,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,Th},xh=e=>{if(jh(e))return Ih;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,kh(e)},Fh=(e,t)=>{let n;if(jh(e))return Ih;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Ih:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,xh(e))},Bh=(e,t)=>{if(!e)return Ih;const n=new Vh;e.state=n,n.strm=e,n.window=null,n.mode=Oh;const r=Fh(e,t);return r!==Th&&(e.state=null),r};let Hh,qh,Yh=!0;const Wh=e=>{if(Yh){Hh=new Int32Array(512),qh=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(gh(1,e.lens,0,288,Hh,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;gh(2,e.lens,0,32,qh,0,e.work,{bits:5}),Yh=!1}e.lencode=Hh,e.lenbits=9,e.distcode=qh,e.distbits=5},Kh=(e,t,n,r)=>{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)),r>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),(r-=i)?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var Jh={inflateReset:xh,inflateReset2:Fh,inflateResetKeep:kh,inflateInit:e=>Bh(e,15),inflateInit2:Bh,inflate:(e,t)=>{let n,r,i,o,a,s,u,l,c,d,_,f,h,g,p,E,b,T,v,R,I,m,y=0;const A=new Uint8Array(4);let S,O;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(jh(e)||!e.output||!e.input&&0!==e.avail_in)return Ih;n=e.state,n.mode===Ch&&(n.mode=Ph),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,l=n.hold,c=n.bits,d=s,_=u,m=Th;e:for(;;)switch(n.mode){case Oh:if(0===n.wrap){n.mode=Ph;break}for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,A[0]=255&l,A[1]=l>>>8&255,n.check=q_(n.check,A,2,0),l=0,c=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Dh;break}if((15&l)!==Sh){e.msg="unknown compression method",n.mode=Dh;break}if(l>>>=4,c-=4,I=8+(15&l),0===n.wbits&&(n.wbits=I),I>15||I>n.wbits){e.msg="invalid window size",n.mode=Dh;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:Ch,l=0,c=0;break;case 16181:for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(n.flags=l,(255&n.flags)!==Sh){e.msg="unknown compression method",n.mode=Dh;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Dh;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=q_(n.check,A,2,0)),l=0,c=0,n.mode=16182;case 16182:for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,n.check=q_(n.check,A,4,0)),l=0,c=0,n.mode=16183;case 16183:for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=q_(n.check,A,2,0)),l=0,c=0,n.mode=16184;case 16184:if(1024&n.flags){for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=q_(n.check,A,2,0)),l=0,c=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(f=n.length,f>s&&(f=s),f&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+f),I)),512&n.flags&&4&n.wrap&&(n.check=q_(n.check,r,f,o)),s-=f,o+=f,n.length-=f),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;f=0;do{I=r[o+f++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I))}while(I&&f<s);if(512&n.flags&&4&n.wrap&&(n.check=q_(n.check,r,f,o)),s-=f,o+=f,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;f=0;do{I=r[o+f++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I))}while(I&&f<s);if(512&n.flags&&4&n.wrap&&(n.check=q_(n.check,r,f,o)),s-=f,o+=f,I)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(4&n.wrap&&l!==(65535&n.check)){e.msg="header crc mismatch",n.mode=Dh;break}l=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Ch;break;case 16189:for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}e.adler=n.check=Gh(l),l=0,c=0,n.mode=Nh;case Nh:if(0===n.havedict)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,Rh;e.adler=n.check=1,n.mode=Ch;case Ch:if(t===Eh||t===bh)break e;case Ph:if(n.last){l>>>=7&c,c-=7&c,n.mode=Uh;break}for(;c<3;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}switch(n.last=1&l,l>>>=1,c-=1,3&l){case 0:n.mode=16193;break;case 1:if(Wh(n),n.mode=wh,t===bh){l>>>=2,c-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=Dh}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Dh;break}if(n.length=65535&l,l=0,c=0,n.mode=Lh,t===bh)break e;case Lh:n.mode=16195;case 16195:if(f=n.length,f){if(f>s&&(f=s),f>u&&(f=u),0===f)break e;i.set(r.subarray(o,o+f),a),s-=f,o+=f,u-=f,a+=f,n.length-=f;break}n.mode=Ch;break;case 16196:for(;c<14;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(n.nlen=257+(31&l),l>>>=5,c-=5,n.ndist=1+(31&l),l>>>=5,c-=5,n.ncode=4+(15&l),l>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Dh;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;c<3;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.lens[N[n.have++]]=7&l,l>>>=3,c-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},m=gh(0,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,m){e.msg="invalid code lengths set",n.mode=Dh;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;y=n.lencode[l&(1<<n.lenbits)-1],p=y>>>24,E=y>>>16&255,b=65535&y,!(p<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(b<16)l>>>=p,c-=p,n.lens[n.have++]=b;else{if(16===b){for(O=p+2;c<O;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(l>>>=p,c-=p,0===n.have){e.msg="invalid bit length repeat",n.mode=Dh;break}I=n.lens[n.have-1],f=3+(3&l),l>>>=2,c-=2}else if(17===b){for(O=p+3;c<O;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=p,c-=p,I=0,f=3+(7&l),l>>>=3,c-=3}else{for(O=p+7;c<O;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=p,c-=p,I=0,f=11+(127&l),l>>>=7,c-=7}if(n.have+f>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Dh;break}for(;f--;)n.lens[n.have++]=I}}if(n.mode===Dh)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=Dh;break}if(n.lenbits=9,S={bits:n.lenbits},m=gh(1,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,m){e.msg="invalid literal/lengths set",n.mode=Dh;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},m=gh(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,m){e.msg="invalid distances set",n.mode=Dh;break}if(n.mode=wh,t===bh)break e;case wh:n.mode=Mh;case Mh:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,lh(e,_),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,l=n.hold,c=n.bits,n.mode===Ch&&(n.back=-1);break}for(n.back=0;y=n.lencode[l&(1<<n.lenbits)-1],p=y>>>24,E=y>>>16&255,b=65535&y,!(p<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(E&&!(240&E)){for(T=p,v=E,R=b;y=n.lencode[R+((l&(1<<T+v)-1)>>T)],p=y>>>24,E=y>>>16&255,b=65535&y,!(T+p<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=T,c-=T,n.back+=T}if(l>>>=p,c-=p,n.back+=p,n.length=b,0===E){n.mode=16205;break}if(32&E){n.back=-1,n.mode=Ch;break}if(64&E){e.msg="invalid literal/length code",n.mode=Dh;break}n.extra=15&E,n.mode=16201;case 16201:if(n.extra){for(O=n.extra;c<O;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;y=n.distcode[l&(1<<n.distbits)-1],p=y>>>24,E=y>>>16&255,b=65535&y,!(p<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(!(240&E)){for(T=p,v=E,R=b;y=n.distcode[R+((l&(1<<T+v)-1)>>T)],p=y>>>24,E=y>>>16&255,b=65535&y,!(T+p<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=T,c-=T,n.back+=T}if(l>>>=p,c-=p,n.back+=p,64&E){e.msg="invalid distance code",n.mode=Dh;break}n.offset=b,n.extra=15&E,n.mode=16203;case 16203:if(n.extra){for(O=n.extra;c<O;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Dh;break}n.mode=16204;case 16204:if(0===u)break e;if(f=_-u,n.offset>f){if(f=n.offset-f,f>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Dh;break}f>n.wnext?(f-=n.wnext,h=n.wsize-f):h=n.wnext-f,f>n.length&&(f=n.length),g=n.window}else g=i,h=a-n.offset,f=n.length;f>u&&(f=u),u-=f,n.length-=f;do{i[a++]=g[h++]}while(--f);0===n.length&&(n.mode=Mh);break;case 16205:if(0===u)break e;i[a++]=n.length,u--,n.mode=Mh;break;case Uh:if(n.wrap){for(;c<32;){if(0===s)break e;s--,l|=r[o++]<<c,c+=8}if(_-=u,e.total_out+=_,n.total+=_,4&n.wrap&&_&&(e.adler=n.check=n.flags?q_(n.check,i,_,a-_):B_(n.check,i,_,a-_)),_=u,4&n.wrap&&(n.flags?l:Gh(l))!==n.check){e.msg="incorrect data check",n.mode=Dh;break}l=0,c=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(4&n.wrap&&l!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=Dh;break}l=0,c=0}n.mode=16208;case 16208:m=vh;break e;case Dh:m=mh;break e;case 16210:return yh;default:return Ih}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,(n.wsize||_!==e.avail_out&&n.mode<Dh&&(n.mode<Uh||t!==ph))&&Kh(e,e.output,e.next_out,_-e.avail_out),d-=e.avail_in,_-=e.avail_out,e.total_in+=d,e.total_out+=_,n.total+=_,4&n.wrap&&_&&(e.adler=n.check=n.flags?q_(n.check,i,_,e.next_out-_):B_(n.check,i,_,e.next_out-_)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Ch?128:0)+(n.mode===wh||n.mode===Lh?256:0),(0===d&&0===_||t===ph)&&m===Th&&(m=Ah),m},inflateEnd:e=>{if(jh(e))return Ih;let t=e.state;return t.window&&(t.window=null),e.state=null,Th},inflateGetHeader:(e,t)=>{if(jh(e))return Ih;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Th):Ih},inflateSetDictionary:(e,t)=>{const n=t.length;let r,i,o;return jh(e)?Ih:(r=e.state,0!==r.wrap&&r.mode!==Nh?Ih:r.mode===Nh&&(i=1,i=B_(i,t,n,0),i!==r.check)?mh:(o=Kh(e,t,n,n),o?(r.mode=16210,yh):(r.havedict=1,Th)))},inflateInfo:"pako inflate (from Nodeca project)"};var Qh=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 Xh=Object.prototype.toString,{Z_NO_FLUSH:Zh,Z_FINISH:zh,Z_OK:$h,Z_STREAM_END:eg,Z_NEED_DICT:tg,Z_STREAM_ERROR:ng,Z_DATA_ERROR:rg,Z_MEM_ERROR:ig}=W_;function og(e){this.options=Wf.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 Xf,this.strm.avail_out=0;let n=Jh.inflateInit2(this.strm,t.windowBits);if(n!==$h)throw new Error(Y_[n]);if(this.header=new Qh,Jh.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Qf.string2buf(t.dictionary):"[object ArrayBuffer]"===Xh.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Jh.inflateSetDictionary(this.strm,t.dictionary),n!==$h)))throw new Error(Y_[n])}function ag(e,t){const n=new og(t);if(n.push(e),n.err)throw n.msg||Y_[n.err];return n.result}og.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=t===~~t?t:!0===t?zh:Zh,"[object ArrayBuffer]"===Xh.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=Jh.inflate(n,a),o===tg&&i&&(o=Jh.inflateSetDictionary(n,i),o===$h?o=Jh.inflate(n,a):o===rg&&(o=tg));n.avail_in>0&&o===eg&&n.state.wrap>0&&0!==e[n.next_in];)Jh.inflateReset(n),o=Jh.inflate(n,a);switch(o){case ng:case rg:case tg:case ig:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||o===eg))if("string"===this.options.to){let e=Qf.utf8border(n.output,n.next_out),t=n.next_out-e,i=Qf.buf2string(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(o!==$h||0!==s){if(o===eg)return o=Jh.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},og.prototype.onData=function(e){this.chunks.push(e)},og.prototype.onEnd=function(e){e===$h&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Wf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var sg={Inflate:og,inflate:ag,inflateRaw:function(e,t){return(t=t||{}).raw=!0,ag(e,t)},ungzip:ag,constants:W_};const{Inflate:ug,inflate:lg,inflateRaw:cg,ungzip:dg}=sg;var _g=dg;function fg(e){return Object.keys(e).map((function(t){var n=e[t];return"string"!=typeof n&&(n="".concat(n)),{key:t,value:n}}))}function hg(e,t,n,r){return Nl.encode(du,{targetId:e,type:F.GROUP,users:r,extProfile:n?fg(n):void 0,settingProfile:fg(t)})}var gg,pg,Eg,bg,Tg,vg,Rg,Ig,mg,yg=function(e,t){return Nl.encode(Ka,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},Ag=function(e){var t=Nl.decode(Ga,e),n=t.compressioEnabled,r=t.compressedData,i=t.info,o=t.pullTime,a=t.isFinished,s=t.pageToken;if(n){var u=_g(r);return Ag(u)}return{info:i,pullTime:o,isFinished:a,pageToken:s}},Sg=function(e){var t=Nl.decode(ma,e);if(t.compressioEnabled){var n=_g(t.compressedData);return Sg(n)}return t},Og=function(e){var t=Nl.decode(ya,e);if(t.compressioEnabled){var n=_g(t.compressedData);return Og(n)}return{syncTime:t.syncTime,list:t.list.map((function(e){return Nl.decode(Aa,new Uint8Array(e))}))}},Ng=function(e){return Nl.encode(Ts,r(r({},e),{compress:Nd.enable()}))},Cg=function(e){var t=Nl.decode(Rs,e);if(t.compress){var n=_g(t.compressData);return Cg(n)}return t},Pg=function(e){var t=Nl.decode(Is,e);if(t.compress){var n=_g(t.compressData);return Pg(n)}return t},Lg=function(e){var t=e.listType,n=e.result,i=e.page,o=new Uint8Array(n),a=[];switch(t){case 1:a=Nl.decode(bu,o).list;break;case 2:a=Nl.decode(Eu,o).list;break;case 3:a=Nl.decode(Tu,o).list;break;case 11:a=Nl.decode(Lu,o).list;break;case 12:a=Nl.decode(wu,o).list}return r(r({},i),{list:a})},wg=function(e){return Nl.encode(Ha,r(r({},e),{compressioEnabled:Nd.enable(),ignoreCmd:!0}))},Mg=function(e){var t=Nl.decode(qa,e);if(t.compressioEnabled){var n=_g(t.compressedData);return Mg(n)}return t},Ug=function(e,t){return Nl.encode(cs,{ignoreVersion:!0,version:e,state:t})},Dg=function(e){var t=Nl.decode(Wu,e);if(t.compress){var n=_g(t.compressedData);return Dg(n)}return t},Gg=function(e){return Nl.encode(rs,{timestamp:e,compressioEnabled:Nd.enable()})},Vg=function(e){var t=Nl.decode(ts,e);if(t.compressioEnabled){var n=_g(t.compressedData);return Vg(n)}return t},jg=function(e,t){var n,r,i,o,a=e.targetId,l=e.conversationType,c=e.channelId,d=t.messageType,_=t.isMentioned,f=t.disableNotification,h=t.canIncludeExpansion,g=t.pushConfig,p=t.directionalUserIdList,E=t.isVoipPush,b=t.isFilerWhiteBlacklist,T=t.content,v=t.pushContent,R=t.pushData,I=t.expansion,m=t.messageId,y=t.needReceipt,A=t.disableUpdateLastMessage,S=t.isStatusMessage,O=Ir(d).isPersited,N=Pc(d,_,f,h,S),C=function(e,t,n,r){var i=0;return e&&(i|=1),t&&(i|=2),n&&(i|=4),r&&(i|=8),i}(!!E,!b,!!(null==g?void 0:g.disablePushTitle),!!(null==g?void 0:g.forceShowDetailContent));if(T.user&&T.user.portraitUri&&(T.user.portrait=T.user.portraitUri),h&&I){i={};try{for(var P=s(Object.entries(I)),L=P.next();!L.done;L=P.next()){var w=u(L.value,2),M=w[0],U=w[1];i[M]={v:U}}}catch(e){n={error:e}}finally{try{L&&!L.done&&(r=P.return)&&r.call(P)}finally{if(n)throw n.error}}}if(g){var D=g.pushTitle,G=g.iOSConfig,V=g.androidConfig,j=g.templateId,k=g.harmonyOSConfig;o={title:D,pushConfigs:nn(G,V,k),pushId:null==V?void 0:V.notificationId,templateId:j}}var x=l===F.SYSTEM?a:void 0,B=0;return O&&A&&(B|=1),y&&(B|=2),Nl.encode(Ia,{sessionId:N,pushText:(null==g?void 0:g.pushContent)||v,appData:(null==g?void 0:g.pushData)||R,toUserIds:p,configFlag:C,classname:d,content:JSON.stringify(T),extraContent:i?JSON.stringify(i):void 0,pushExt:o,clientUniqueId:m,busChannel:c,systemId:x,optionBits:B})},kg=function(e){return Nl.encode(gu,r(r({},e),{type:F.GROUP}))},xg=function(e){return Nl.encode(vu,r(r({},e),{type:F.GROUP}))},Fg=function(e){return Nl.encode(hu,r(r({},e),{type:F.GROUP}))},Bg=function(e){function n(t,n){var r=e.call(this,"WebSGModule")||this;return gg.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:n}),r._ctx.on("sNtf",c(r,gg,"m",bg),r),r._ctx.on("sMsg",c(r,gg,"m",Eg),r),r._ctx.on("syncMsg",c(r,gg,"m",pg),r),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c,d,_,f,h,g,p,E,b,T,v;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,n=t.logger,r=t.currentUserId,i=t.connectedTime,o=this._storage.get("inboxTime"),s=this._storage.get("outboxTime"),u=this._storage.get("broadcastTime"),l=n.createTraceId(),n.info(B.L_PULL_MSG_T,JSON.stringify({inboxTime:o,outboxTime:s,broadcastTime:u}),l),c=Nl.encode(Ra,{ispolling:!1,isPullSend:!0,syncTime:o,sendBoxSyncTime:s,broadcastSyncTime:u,compressioEnabled:Nd.enable()}),[4,this._ctx.query(kr.pullMsg,this._ctx.currentUserId,c)];case 1:return(d=a.sent()).isOk?(_=Sg(d.data.pbData),h=(f=_).list,g=f.finished,p=f.syncTime,E=f.broadcastSyncTime,b=s,T=h.map((function(e){var t=Cc(e,r,e.dataTime<i);return t.messageDirection===be.SEND&&(b=Math.max(b,t.sentTime)),t})),this._storage.set("inboxTime",p),this._storage.set("broadcastTime",E||1),this._storage.set("outboxTime",b),n.info(B.L_PULL_MSG_R,JSON.stringify({code:0,inboxTime:p,broadcastTime:E,outboxTime:b,msgCount:T.length,hasNext:!!g}),l),v=Math.max(p,E||1,b),this._ctx.emit("messagesFromSG",T,!!g,e),[2,vn({version:v,hasNext:!g})]):(n.warn(B.L_PULL_MSG_R,JSON.stringify({code:d.code}),l),[2,d.wipe()])}}))}))}}),n}(En);gg=new WeakSet,pg=function(e,t,n){var r=t.conversationType,i=t.sentTime;r!==F.ULTRA_GROUP&&r!==F.CHATROOM&&(r===F.RTC_ROOM||td(n)||(e.stopPropagation(),this.push(i)))},Eg=function(e,t){var n=t.conversationType,r=t.sentTime,i=t.isStatusMessage;n!==F.CHATROOM&&(e.stopPropagation(),i||n===F.RTC_ROOM?this._ctx.emit("smsgFromSignalGroup",t):this.push(r))},bg=function(e,t){1===t.type&&(e.stopPropagation(),this.push(t.time))};var Hg,qg,Yg=function(e){function n(t){var n=e.call(this,"WebUGModule")||this;return Tg.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),n._ctx.on("syncMsg",c(n,Tg,"m",Rg),n),n._ctx.on("sCmd",c(n,Tg,"m",vg),n),n}return t(n,e),Object.defineProperty(n.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,Tg,"m",mg).call(this,0)];case 1:return(e=a.sent()).isOk?(this._ctx.logger.info(B.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,c(this,Tg,"m",Ig).call(this,0,[])]):(this._ctx.logger.warn(B.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(n=a.sent()).isOk?(r=n.data,i=r.length>0?r[r.length-1].versionTime:0,o=Math.max(t,i),[2,vn({relations:r,msgVersion:o})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return a(this,(function(n){switch(n.label){case 0:return[4,c(this,Tg,"m",mg).call(this,e)];case 1:return[2,n.sent().trans((function(e){var n=e,r=n.syncTime,i=n.finished,o=n.list;if(null==o?void 0:o.length){var a=t._ctx.currentUserId,s=o.map((function(e){return Cc(e,a,!1)}));t._ctx.emit("messagesFromUG",s,r)}return{version:r,hasNext:!i}}))]}}))}))}}),n}(En);Tg=new WeakSet,vg=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},Rg=function(e,t){t.conversationType===F.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},Ig=function e(t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,d,_,f,h,g;return a(this,(function(a){switch(a.label){case 0:return(r=this._ctx).currentUserId,i=r.logger,o=i.createTraceId(),i.info(B.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),o),s=Nl.encode(Ns,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query(kr.pullUgSes,this._ctx.currentUserId,s,void 0)];case 1:return d=a.sent(),i.summary(B.L_PULL_UG_RELATIONS_R,d,o,{ver:t}),d.isOk?(_=Ag(d.data.pbData),f=_.info,h=_.isFinished,n.push.apply(n,l([],u(f),!1)),h?[2,vn(n)]:(g=f[f.length-1].versionTime,[2,c(this,Tg,"m",e).call(this,g,n)])):[2,d.wipe()]}}))}))},mg=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,n=t.currentUserId,r=t.logger,i=r.createTraceId(),r.info(B.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=Nl.encode(Cs,{syncTime:l,compressioEnabled:Nd.enable()}),[4,this._ctx.query(kr.pullUgMsg,n,o)];case 1:return s=a.sent(),r.summary(B.L_PULL_ULTRA_MSG_R,s,i,{version:e}),s.isOk?(u=s.data,[2,vn(Sg(u.pbData))]):[2,s.wipe()]}var l}))}))};var Wg,Kg,Jg,Qg=13,Xg=36,Zg=41,zg=function(e){function n(t,n){var r=e.call(this,"WebServerEventHandler")||this;return Hg.add(r),Object.defineProperty(r,"_con",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,l,d=this;return a(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(B.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,c(this,Hg,"m",qg).call(this,e)];case 1:return n=a.sent(),this._logger.summary(B.L_PULL_EVENT_CHANGE_R,n,t,{version:e}),n.isOk?(r=n.data,i=r.list,o=r.syncTime,s=r.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),n=t[0],r=t[1];d.emit("serverEvent",n,r)}))),[2,vn({version:o,hasNext:s})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(B.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,c(this,Hg,"m",qg).call(this,0)];case 1:return t=n.sent(),this._logger.summary(B.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),n}(En);Hg=new WeakSet,qg=function(e){var t=Nl.encode(ws,{syncTime:e});return this._con.query(kr.pullEventChange,this._con.getCurrentUserId(),t,Ms)};var $g=function(e){function n(t){var n=e.call(this,"WebUGServerEventHandler")||this;return Wg.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),n}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=Nl.encode(ws,{syncTime:e}),[4,this._ctx.query(kr.qryMsgChange,this._ctx.currentUserId,t,Us)];case 1:return(n=a.sent()).isOk?(r=n.data,i=r.list,o=r.syncTime,s=r.hasNext,i&&i.length&&c(this,Wg,"m",Kg).call(this,i),[2,vn({version:o,hasNext:s})]):[2,n.wipe()]}}))}))}}),n}(En);Wg=new WeakSet,Kg=function(e){var t=[],n=[],r=[],i=[],o=[];e.forEach((function(e){switch(e.changeType){case 1:n.push(e);break;case 2:t.push(e);break;case 3:r.push(e);break;case 4:i.push(e);break;case 5:o.push(e)}})),n.length&&c(this,Wg,"m",Jg).call(this,n,1),t.length&&c(this,Wg,"m",Jg).call(this,t,2),r.length&&this.emit("ugMsgRecalled",e),i.length&&this._ctx.emit("ugChannelChanged",i),o.length&&this._ctx.emit("ugUserGroupChanged",o)},Jg=function(e,t){var n=this,r=new Map;e.forEach((function(e){var t=e.targetId,n=e.busChannel,i=e.msgUID,o="".concat(t,"-").concat(n),a=r.get(o);a?a.messageUIds.push(i):r.set(o,{conversationIdentifier:{conversationType:F.ULTRA_GROUP,targetId:t,channelId:n},messageUIds:[i]})})),Array.from(r.entries()).forEach((function(e){var r=u(e,2);r[0];var i=r[1];1===t?n.emit("ugMsgExpansion",i.conversationIdentifier,i.messageUIds):n.emit("ugMsgModify",i.conversationIdentifier,i.messageUIds)}))};var ep,tp,np,rp,ip,op,ap,sp,up,lp,cp,dp,_p,fp,hp,gp,pp,Ep,bp,Tp,vp,Rp,Ip,mp,yp,Ap,Sp,Op,Np,Cp,Pp,Lp,wp,Mp,Up,Dp,Gp,Vp=function(){return o(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,x.NOT_SUPPORT]}))}))},jp=function(){return o(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,Rn(x.NOT_SUPPORT,"Not support")]}))}))},kp=function(e){function n(t,n){var r=e.call(this,"WebSGMsgModifyReceiver")||this;return ep.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"storage",{enumerable:!0,configurable:!0,writable:!0,value:n}),tp.set(r,0),np.set(r,!0),r._ctx.on("onConnected",c(r,ep,"m",rp),r),r._ctx.on("messagesFromSG",c(r,ep,"m",ip),r),r}return t(n,e),Object.defineProperty(n.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.setInitVersion(c(this,tp,"f"),!0)}}),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger.createTraceId(),this._ctx.logger.info(B.L_PULL_MODIFY_MSG_T,JSON.stringify({time:e}),t),_={pullVersion:e},n=Nl.encode(Yu,r(r({},_),{modifyType:[1],compress:Nd.enable()})),[4,this._ctx.query(kr.pullModifyMsg,this._ctx.currentUserId,n,void 0)];case 1:return i=a.sent(),this._ctx.logger.summary(B.L_PULL_MODIFY_MSG_R,i,t),i.isOk?(o=Dg(i.data.pbData),s=o.msg,u=o.nextVersion,l=o.finished,s&&s.length&&c(this,ep,"m",op).call(this,s),c(this,np,"f")&&(this._ctx.emit("messageModifiedSyncCompleted",!l),d(this,np,!1,"f")),[2,vn({version:u,hasNext:!l})]):[2,i.wipe()]}var _}))}))}}),n}(En);tp=new WeakMap,np=new WeakMap,ep=new WeakSet,rp=function(e,t){d(this,np,!0,"f"),t||(this.reset(),d(this,tp,this._ctx.connectedTime,"f"))},ip=function(e,t,n,r){0===r&&t.length>0&&d(this,tp,t[0].sentTime,"f")},op=function(e){var t=this,n=[],r=this._ctx.currentUserId;e.forEach((function(e){var i=e.msg;if(1===e.modifyType){var o=Cc(i,r,!1);n.push(o);var a=o.conversationType,s=o.targetId,u=o.channelId,l=t.storage.getModel({conversationType:a,targetId:s,channelId:u});if(l&&l.latestMessage){var c=l.latestMessage,d=c.messageUId,_=c.messageType,f=c.content;if(d!==o.messageUId){if(_===me.REFERENCE){if(f.referMsgUid!==o.messageUId)return;f.referMsg=o.content}}else l.updateAttrs({latestMessage:o})}}})),n.length&&this._ctx.emit("messageModified",n)};var xp=18e4,Fp=function(){function e(e,t){sp.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_userSettins",{enumerable:!0,configurable:!0,writable:!0,value:t}),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}),up.set(this,void 0),lp.set(this,void 0),cp.set(this,void 0),dp.set(this,void 0),Ep.set(this,1),Object.defineProperty(this,"getConversationListByPageIndex",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Lp.set(this,new Set),Object.defineProperty(this,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"syncRemoteConversations",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"getMessagesAroundTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"deleteLocalUGMessagesForAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"getUnreadMentionedMessages",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"saveEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"getEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"clearEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:jp}),this.storage=new r_(e),this.settings=new Fd(this._ctx,this.storage),d(this,up,new Yg(this._ctx),"f"),d(this,lp,new Bg(this._ctx,this.storage),"f"),d(this,cp,new $g(this._ctx),"f"),d(this,dp,new kp(this._ctx,this.storage),"f"),c(this,cp,"f").on("ugMsgModify",c(this,sp,"m",vp),this),c(this,cp,"f").on("ugMsgExpansion",c(this,sp,"m",Rp),this),c(this,cp,"f").on("ugMsgRecalled",c(this,sp,"m",Ip),this),this._ctx.on("onConnected",c(this,sp,"m",pp),this),this._ctx.on("onDisconnected",c(this,sp,"m",Ap),this),this._ctx.on("onSuspend",c(this,sp,"m",Ap),this),this._ctx.on("sCmd",c(this,sp,"m",Sp),this),this._ctx.on("signal",c(this,sp,"m",Op),this),this._ctx.on("serverEvent",c(this,sp,"m",fp),this),this._ctx.on("robotsSynced",c(this,sp,"m",_p),this)}return Object.defineProperty(e.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,dp,"f").startPullModifyMsg()}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,d;return a(this,(function(a){return n=e.count,r=e.startTime,i=e.order,o=e.conversationTypes,t?(s=0!==r||i?r:Number.MAX_SAFE_INTEGER,u=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==F.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>s:e.operationTime<s)})).sort((function(e,t){return e.operationTime-t.operationTime})),l=Math.min(u.length,n),d=i?u.slice(0,l):u.slice(u.length-l),i||d.reverse(),[2,vn(d.map((function(e){return e.toIReceivedConversation()})))]):[2,c(this,sp,"m",Np).call(this,r,n,i||0,o)]}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){return r=((null==t?void 0:t.length)||0)>0?t:ee(e?J:W),i="string"==typeof n&&""!==n,o=this.storage.getAllModels().filter((function(t){return t.isTop&&!t.hidden&&r.includes(t.conversationType)&&(t.conversationType!==F.ULTRA_GROUP&&(!i||t.channelId===n)||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,sp,"m",Cp).call(this,o)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>Re.NOT_SET&&(t.conversationType!==F.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,sp,"m",Cp).call(this,t)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){return n=((null==t?void 0:t.length)||0)>0?t:ee(e?J:W),r=this.storage.getAllModels().filter((function(t){return t.unreadCount>0&&n.includes(t.conversationType)&&(t.conversationType!==F.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,sp,"m",Cp).call(this,r)]}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n="string"==typeof t,e?(r=this.storage.getAllModels().filter((function(e){return!(e.hidden||(e.conversationType===F.ULTRA_GROUP||n&&e.channelId!==t)&&e.channelId&&"RCDefault"!==e.channelId)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,vn(r)]):[4,c(this,sp,"m",Np).call(this,0,1e3,0)];case 1:return[2,i.sent().trans((function(e){return e.filter((function(e){return!n||e.channelId===t}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=0,this.storage.getAllModels().forEach((function(i){i.unreadCount>0&&e.includes(i.conversationType)&&(i.conversationType!==F.ULTRA_GROUP&&(!n&&!i.channelId||i.channelId===n)||i.conversationType===F.ULTRA_GROUP&&(""===i.channelId||"RCDefault"===i.channelId))&&(t||i.notificationLevel<=Re.NOT_SET)&&(r+=i.unreadCount)})),[2,vn(r)]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return t=this.storage.getOrCreateModel(e,!1),n=t.toIReceivedConversation(),[4,c(this,sp,"m",Cp).call(this,[n])];case 1:return(r=i.sent()).isOk?[2,r.trans((function(e){return e[0]}))]:[2,vn(n)]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,sp,"m",Pp).call(this,e,n,t)];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.version,u=o.updateVersion,l=e.map((function(e){var n=d.storage.getOrCreateModel(e,!0);return n.updateAttrs({isTop:t,hidden:!r&&n.hidden,operationTime:n.hidden&&r?Date.now():n.operationTime}),n})),this.storage.updateConversationStorage(l),u&&this.storage.set("conversationStatusVersion",s),[2,vn()]):[2,i.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 n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,sp,"m",Pp).call(this,e,n,void 0,t)];case 1:return(r=a.sent()).isOk?(i=r.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var n=l.storage.getOrCreateModel(e,!0);return n.updateAttrs({notificationLevel:t}),n})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,vn()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,sp,"m",Pp).call(this,e,n,void 0,void 0,t)];case 1:return(r=a.sent()).isOk?(i=r.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var n=l.storage.getOrCreateModel(e,!0);return n.updateAttrs({translateStrategy:t}),n})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,vn()]):[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 a(this,(function(n){return t=this.storage.getOrCreateModel(e,!1),[2,vn(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 a(this,(function(n){return t=this.storage.getConversationTypeNotificationLevel(e),[2,vn(t)]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),r=this._ctx.currentUserId,i=Nl.encode(gs,{type:e,unpushLevel:t,version:n,ignoreVersion:!0}),[4,this._ctx.query(kr.setTypeUnpush,r,i,ps)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,this.storage.setConversationTypeNotificationLevel(e,t),l&&this.storage.set("conversationStatusVersion",u),[2,vn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){return e=this.storage.getAllSGModels(),t=this._ctx.serverTime,e.forEach((function(e){return e.clearUnreadCount(t)})),this.storage.updateConversationStorage(e),[2,vn()]}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),r=Nl.encode(za,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:n}),i=e.conversationType===F.ULTRA_GROUP?kr.delUgMsg:kr.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,r)];case 1:return(o=a.sent()).isOk?this._ctx.includeUg?((s=this.storage.getModel(e))&&(u=s.latestMessage)&&t.some((function(e){return e.messageUId===u.messageUId}))&&s.updateAttrs({latestMessage:null}),[2,vn()]):[2,vn()]:[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 n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=Nl.encode(ka,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),r=Jp[e.conversationType],[4,this._ctx.query(r,this._ctx.currentUserId,n)];case 1:return(i=a.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(s=o.latestMessage)&&(0===t||s.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,vn()]):[2,vn()]:[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,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=Nl.encode(xa,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query(kr.cleanMsgBatch,this._ctx.currentUserId,t)];case 1:return(n=i.sent()).isOk?(e.forEach((function(e){var t=r.storage.getModel(e);if(t){var n=t.latestMessage;n&&(!e.timestamp||n.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),[2,vn()]):[2,n.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 n,r;return a(this,(function(i){switch(i.label){case 0:return n=Nl.encode(bs,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),r=t[0],[4,this._ctx.query(kr.readReceipt,r,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,l;return a(this,(function(a){switch(a.label){case 0:return t=new Map,e.forEach((function(e){var n=Kd(e.identifier),r=t.get(n)||new Set;r.add(e.messageUId),t.set(n,r)})),n=Array.from(t.entries()).map((function(e){var t=u(e,2),n=t[0],r=t[1],i=Jd(n);return{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgIds:Array.from(r)}})),r=function(e){return Nl.encode(vs,{items:e,compress:Nd.enable()})}(n),[4,this._ctx.query(kr.qryReceiptBatch,e[0].messageUId,r)];case 1:return(i=a.sent()).isOk?(o=i.data,s=Pg(o.pbData).item,l=[],s.forEach((function(e){var t,n={conversationType:e.type,targetId:e.targetId,channelId:e.busChannel};null===(t=e.msg)||void 0===t||t.forEach((function(e){var t=e.msgId,r=e.unreadCnt,i=e.readCnt,o=e.totalCnt;l.push({identifier:n,messageUId:t,unreadCount:r,readCount:i,totalCount:o})}))})),[2,vn(l)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return r=0===n.readStatus?1:2,i=Ng({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:1,pageType:1,pageToken:n.pageToken,pageSize:n.pageCount,readType:r,order:n.order?0:1}),[4,this._ctx.query(kr.qryReceipt,t,i)];case 1:return(o=a.sent()).isOk?(s=o.data,u=Cg(s.pbData),l=u.resp,c=u.pageToken,d=l[0],[2,vn({pageToken:c||"",totalCount:1===r?d.readCnt:d.unreadCnt,users:(1===r?d.readUser:d.unreadUser).map((function(e){var t=e.userId,n=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!n}}))})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:return r=Ng({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:n}),[4,this._ctx.query(kr.qryReceipt,t,r)];case 1:return(i=a.sent()).isOk?(o=i.data,s=Cg(o.pbData).resp,c=s[0],[2,vn({pageToken:"",totalCount:0,users:l(l([],u(c.readUser),!1),u(c.unreadUser),!1).map((function(e){var t=e.userId,n=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!n}}))})]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=In.create("requestSpeechToTextForMessage").isObject("option",t,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==t?void 0:t.messageType,(function(e){return e===me.HQ_VOICE||e===me.VOICE}),!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){if(t.messageType===me.HQ_VOICE)e.validate("numberOfChannels",t.numberOfChannels,(function(e){return 1===e}),!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",t.sampleRate,(function(e){return 16e3===e||8e3===e}),!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",t.format).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").isHttpUrl("remoteUrl",t.remoteUrl,!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid");else{var n=t.content;e.isNotEmptyString("content",n,!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid")}})).isLimitedInteger("duration",t.duration,1,60,!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid").result()).isOk?c(this,Lp,"f").has(e)?[2,Rn(x.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process")]:(c(this,sp,"m",wp).call(this,e,t),[2,vn()]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=e.messageUId,n=e.messageContent,r=e.conversation,i=Nl.encode(Ps,{targetId:r.targetId,type:r.conversationType,busChannel:r.channelId,msgUID:t,msgTime:0,content:JSON.stringify(n),fromUserId:""}),[4,this._ctx.query(kr.modifyMsg,this._ctx.currentUserId,i,Ls)];case 1:return(o=a.sent()).isOk?((s=this.storage.getModel(r))&&(u=s.latestMessage,l=s.conversationType,u&&u.messageUId===t&&(u.content=n,u.isModifyMessage=!0,u.modifyInfo=l===F.ULTRA_GROUP?void 0:{timestamp:o.data.modifyTime,status:qn,content:{}},s.updateAttrs({latestMessage:u}))),[2,vn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s=this;return a(this,(function(a){return(o=In.create("refreshReferenceMessageWithParams").validate("messageInfoMap",i,(function(t){return t&&e.every((function(e){return t[e]&&mt(t[e])}))}),!0).fail(x.INVALID_PARAMETER_MESSAGE_INFO_MAP).result()).isOk?(setTimeout((function(){r([]),c(s,sp,"m",Up).call(s,e,t,n,i)}),0),[2,vn()]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,l,c,d,_,f,h,g,p=this;return a(this,(function(a){switch(a.label){case 0:return this._userSettins.hasTag(e)?(n=this.storage.get("conversationStatusVersion"),r=Date.now(),i=this._ctx.currentUserId,o=t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:r,stateItem:[{sessionStateType:pa.Tags,value:"",tags:[{tagId:e}]}]}})),s=Ug(n,o),[4,this._ctx.query(kr.addTag,i,s,hs)]):[2,Rn(x.TAG_NOT_EXIST)];case 1:return(l=a.sent()).isOk?(c=l.data,d=c.version,_=c.updateVersion,f=new Map,t.forEach((function(t){var n=p.storage.getOrCreateModel(t,!0),r={},i=n.tags;i.some((function(t){return t.tagId===e}))||(r.tags=i.concat({tagId:e}),f.set(n,r))})),h=[],g=[],Array.from(f.entries()).forEach((function(e){var t=u(e,2),n=t[0],r=t[1];g.push(n);var i=n.updateAttrs(r,d);i&&h.push({conversation:n.toIReceivedConversation(),updatedItems:i})})),this.storage.updateConversationStorage(g),_&&this.storage.set("conversationStatusVersion",d),h.length>0&&this._ctx.emit("conversationStatusChanged",h),[2,vn()]):[2,l.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){return t=this.storage.getOrCreateModel(e,!1),n=this._userSettins.getTags(),r=t.tags.map((function(e){var t;return{tagId:e.tagId,tagName:null===(t=n[e.tagId])||void 0===t?void 0:t.tagName}})),[2,vn(r)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,_,f,h;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),i=n.isTop,o=this.storage.getOrCreateModel(t,!1),s=o.tags,(u=s.find((function(t){return t.tagId===e})))?(l=Ug(r,[{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:pa.Tags,value:"",tags:[{tagId:e,isTop:i}]}]}]),c=this._ctx.currentUserId,[4,this._ctx.query(kr.addTag,c,l,hs)]):[2,Rn(x.NO_TAG_IN_CONVER)];case 1:return(d=a.sent()).isOk?(_=d.data,f=_.version,h=_.updateVersion,u.isTop=i,o.updateAttrs({tags:s},f),this.storage.updateConversationStorage([o]),h&&this.storage.set("conversationStatusVersion",f),[2,vn()]):[2,d.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),r=Ug(n,t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:pa.Tags,value:"",tags:[{tagId:e}]}]}}))),i=this._ctx.currentUserId,[4,this._ctx.query(kr.delTag,i,r,hs)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=t.map((function(t){var n=d.storage.getOrCreateModel(t,!0),r={tags:n.tags.filter((function(t){return t.tagId!==e}))};return n.updateAttrs(r,u),n})),this.storage.updateConversationStorage(c),l&&this.storage.set("conversationStatusVersion",u),[2,vn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,_;return a(this,(function(a){switch(a.label){case 0:return n=this._ctx.currentUserId,r=this.storage.get("conversationStatusVersion"),i=Ug(r,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:pa.Tags,value:"",tags:t.map((function(e){return{tagId:e}}))}]}]),[4,this._ctx.query(kr.delTag,n,i,hs)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.getOrCreateModel(e,!0),d=c.tags,_={tags:d.filter((function(e){return!t.includes(e.tagId)}))},c.updateAttrs(_,u),this.storage.updateConversationStorage([c]),l&&this.storage.set("conversationStatusVersion",u),[2,vn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){return this._userSettins.hasTag(e)?(i=t||Number.MAX_SAFE_INTEGER,0===(o=this.storage.getAllSGModels().filter((function(t){return t.operationTime<i&&t.tags.some((function(t){return t.tagId===e}))})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,n)).length?[2,vn([])]:(s=o.map((function(t){return r(r({},t.toIReceivedConversation()),{isTopInTag:t.tags.some((function(t){return t.tagId===e&&t.isTop}))})})),[2,c(this,sp,"m",Cp).call(this,s)])):[2,vn([])]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return n=0,this.storage.getAllSGModels().forEach((function(r){var i;if(r.tags.some((function(t){return t.tagId===e}))){if(r.notificationLevel>Re.NOT_SET&&!t)return;n+=null!==(i=r.unreadCount)&&void 0!==i?i:0}})),[2,vn(n)]}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.identifiers,n=e.deleteMessages,r=Nl.encode(Za,{relation:t.map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),cleanMsg:n}),[4,this._ctx.query(kr.delRelationBatch,this._ctx.currentUserId,r,void 0)];case 1:return(i=a.sent()).isOk&&t.forEach((function(e){var t=o.storage.getModel(e);t&&o.storage.removeConversation(t)})),[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Nl.encode(Es,{msgId:t,channelId:n}),[4,this._ctx.query(kr.rrMsg,e,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationType,n=e.channelId,r=e.targetId,i=Nl.encode(Vs,{targetId:r,type:t,busChannel:n||"",opType:0}),(o=new ho(kr.operate,i,r)).setHeaderQos(qr),[4,this._ctx.send(o)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){return t=e.targetId,n=e.channelType,r=this.storage.getAllUGModels().filter((function(e){return!(void 0!==t&&t!==e.targetId||void 0!==n&&n!==e.channelType)})).sort((function(e,t){var n,r,i=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-i})).map((function(e){var t=e.toIReceivedConversation();return t.unreadMentionedCount=Dc(t.unreadMentionedCount||0),t.unreadMessageCount=Dc(t.unreadMessageCount||0),t.unreadMentionedMeCount=Dc(t.unreadMentionedMeCount||0),t})),[2,vn(r)]}))}))}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=this._ctx.currentUserId,[4,c(this,sp,"m",Mp).call(this,e,t)];case 1:return(r=a.sent()).isOk?(i=r.data,o=i.list,i.notExistMsgId,s=o.map((function(t){return Cc(t,n,!1,e.targetId)})),[2,vn(s)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.targetId,n=e.channelId,r=e.sentTime,i=e.count,o=Nl.encode(Va,{groupId:t,busChannel:n,msgTime:r,size:i}),[4,this._ctx.query(kr.qryUgUal,this._ctx.currentUserId,o,ja)];case 1:return(s=a.sent()).isOk?(u=s.data.msgInfo,[2,vn(u.map((function(e){return{messageUId:e.msgId,sentTime:e.msgTime,messageType:e.className,mentionedType:e.remindType}})))]):[2,s.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var i;return o(this,void 0,void 0,(function(){var o,s,u,l,c,d,_,f;return a(this,(function(a){switch(a.label){case 0:return o=this._ctx.currentUserId,s=t.mid,u=t.put,l=t.del,c=t.clear,d=Nl.encode(Ps,{fromUserId:o,targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgUID:s,msgTime:n,content:JSON.stringify(t)}),[4,this._ctx.query(kr.upMsgEx,e.targetId,d)];case 1:return(_=a.sent()).isOk&&(null==(f=null===(i=this.storage.getModel(e))||void 0===i?void 0:i.latestMessage)?void 0:f.messageUId)===s&&(c?f.expansion={}:u?f.expansion=r(r({},f.expansion),u):l&&f.expansion&&l.forEach((function(e){delete f.expansion[e]}))),[2,_.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Nl.encode(_s,{unpushLevel:t,busChannel:n}),[4,this._ctx.query(kr.ugUnpushSet,e,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){switch(o.label){case 0:return n=Nl.encode(ds,{busChannel:t}),[4,this._ctx.query(kr.ugUnpushQuery,e,n,fs)];case 1:return(r=o.sent()).isOk?(i=r.data.unpushLevel,[2,vn(i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return n=this.storage.getModel(e),[2,vn(null!==(t=null==n?void 0:n.unreadMentionedCount)&&void 0!==t?t:0)]}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return e=this.storage.getAllSGModels().reduce((function(e,t){return e+t.unreadMentionedCount}),0),[2,vn(e)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=0,this.storage.getAllModels().forEach((function(i){if(e.includes(i.conversationType)){var o=i.notificationLevel,a=i.unreadCount,s=i.unreadMentionedCount;(0===t.length||t.includes(o))&&(r+=n?s:a)}})),[2,vn(r)]}))}))}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return t=this.storage.getModel(e),[2,vn(t?t.unreadCount:0)]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return(t=this.storage.getModel(e))?(n=t.firstUnreadMessage,[2,vn(n?{messageUId:n.messageUId||"",sentTime:n.sentTime}:null)]):[2,vn(null)]}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){return r=this.storage.getAllUGModels(),i=r.reduce((function(r,i){var o=n?i.unreadMentionedCount:i.unreadCount;if(!o||i.targetId!==e)return r;var a=i.notificationLevel||Re.NOT_SET;return!t.length||t.includes(a)?r+o:r}),0),[2,vn(Dc(i))]}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return t=this.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:Dc(e.unreadCount||0),mentionedCount:Dc(e.unreadMentionedCount||0),mentionedMeCount:Dc(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||Re.NOT_SET}})),[2,vn(t)]}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return t=this.storage.getModel(e),(n=null==t?void 0:t.firstUnreadMessage)?[2,vn(n)]:[2,Rn(x.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return e=this.storage.getAllUGModels().filter((function(e){return e.notificationLevel>Re.NOT_SET})).map((function(e){return e.toIReceivedConversation()})),[2,vn(e)]}))}))}}),Object.defineProperty(e.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return t=this._ctx.serverTime,e.conversationType!==F.ULTRA_GROUP?[3,2]:(n=yg(e,t),(r=new ho(kr.updUgRTime,n,this._ctx.currentUserId)).setHeaderQos(qr),[4,this._ctx.send(r)]);case 1:if(!(i=o.sent()).isOk)return[2,i.wipe()];o.label=2;case 2:return this.storage.clearConversationUnreadCount(e,t),[2,vn()]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,sp,"m",Gp).call(this,t,n,e,[],Ve.ALL,kr.qrySessions)];case 1:return(i=a.sent()).isOk?(o=this._ctx.currentUserId,s=i.data.info.map((function(e){var t=e.unreadCount,n=e.busChannel,i=e.type,a=e.userId,s=e.versionTime,l=e.msg,c=u.storage.getOrCreateModel({conversationType:i,targetId:a,channelId:n||""},!1);return r(r({},c.toIReceivedConversation()),{unreadMessageCount:t,operationTime:s,latestMessage:l?Cc(l,o,!1,a):null})})).sort((function(e,t){var r,i,o=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0,a=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===n?a-o:o-a})),[2,vn(s)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Nl.encode(Ya,{nothing:1}),[4,this._ctx.query(kr.qrySessionsAtt,this._ctx.currentUserId,e,Wa)];case 1:return[2,t.sent().trans((function(e){return e.totalUnreadCount}))]}}))}))}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return t=this._ctx.serverTime,this.storage.clearConversationUnreadCount(e,this._ctx.serverTime),n=yg(e,t),r=new ho(kr.updRRTime,n,this._ctx.currentUserId),[4,this._ctx.send(r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Nl.encode(Ja,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(kr.delSessions,this._ctx.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Nl.encode(Qa,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(kr.qrySessionsUnread,this._ctx.currentUserId,t,Xa)];case 1:return[2,n.sent().trans((function(e){return e.sessions.map((function(e){return{conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:e.unreadCount||0}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){return n=e.count,r=e.conversationTypes,i=e.timestamp||Number.MAX_SAFE_INTEGER,t?(o=this.storage.getAllModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&r.includes(e.conversationType)&&(e.conversationType!==F.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,n),[2,vn(o.map((function(e){return e.toIReceivedConversation()})))]):(s=this.storage.getAllSGModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&r.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,n),u=s.map((function(e){return e.toIReceivedConversation()})),[2,c(this,sp,"m",Cp).call(this,u)])}))}))}}),Object.defineProperty(e.prototype,"loadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,_=this;return a(this,(function(a){switch(a.label){case 0:return i=function(e,t,n){var r=n.conversationTypes,i=n.tagFilter,o=void 0===i?{}:i,a=n.order;n.channelId;var s=o.tagIds,u=o.topPriority;return Nl.encode(Da,{type:r,count:t,order:a,tags:s,isTagTop:!!u,pageToken:e,compress:Nd.enable()})}(e,t,n),[4,this._ctx.query(kr.qryRelationFilter,this._ctx.currentUserId,i,void 0)];case 1:return(o=a.sent()).isOk?(s=Ag(o.data.pbData),u=s.pageToken,l=s.isFinished,c=s.info,d=c.map((function(e){var t=e.busChannel,n=e.type,i=e.userId,o={conversationType:n,targetId:i,channelId:t||""},a=_.storage.getOrCreateModel(o,!1);return r(r({},a.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Cc(e.msg,_._ctx.currentUserId,!1,i):null})})),[2,vn({pageToken:u||"",finished:!!l,list:d})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=yg(e,t),r=new ho(kr.updRTime,n,this._ctx.currentUserId),[4,this._ctx.send(r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Nl.encode(Es,{msgId:[t],channelId:n}),[4,this._ctx.query(kr.rrList,e,r,ms)];case 1:return[2,i.sent().trans((function(e){return{totalMemberCount:e.totalMemberNum,list:e.list}}))]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=e.conversationType,i=e.targetId,o=e.channelId,s=Nl.encode(Ys,{targetId:i,type:r,busChannel:o,startMsgId:t,endMsgId:n}),u=new ho(kr.sendMsgRead,s,i),[4,this._ctx.send(u)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return n=e.targetId,r=e.channelId,i=void 0===r?"":r,o=Nl.encode(Ws,{targetId:n,busChannel:i,msgId:t}),[4,this._ctx.query(kr.qryMsgRead,n,o,Ks)];case 1:return[2,a.sent().trans((function(e){var t=e.list,n=e.num,r=e.readCnt;return{list:t.map((function(e){return{userId:e.userId,readTime:e.receiptTime}})),totalCount:n,readCount:r}}))]}}))}))}}),Object.defineProperty(e.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=e.targetId,i=e.conversationType,o=e.channelId,s=Nl.encode(Js,{type:i,busChannel:o,msgId:t}),[4,this._ctx.query(kr.qryMsgReadCntBatch,n,s,Qs)];case 1:return[2,a.sent().trans((function(t){return t.result.map((function(t){return r({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){return t=e.count,n=e.conversationTypes,this._ctx.includeUg?(r=e.timestamp||Number.MAX_SAFE_INTEGER,i=this.storage.getAllSGModels().filter((function(e){return e.includeRobot&&e.operationTime<r&&n.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,t),[2,vn(i.map((function(e){return e.toIReceivedConversation()})))]):[2,c(this,sp,"m",Np).call(this,e.timestamp,t,0,n,Ve.ROBOT_ONLY)]}))}))}}),e}();up=new WeakMap,lp=new WeakMap,cp=new WeakMap,dp=new WeakMap,Ep=new WeakMap,Lp=new WeakMap,sp=new WeakSet,_p=function(e,t,n){if(t===x.SUCCESS&&this._ctx.includeUg&&0!==n.length){var r=[F.PRIVATE,F.SYSTEM];this.storage.getAllSGModels().filter((function(e){return r.includes(e.conversationType)&&n.some((function(t){return t.robotId===e.targetId}))})).forEach((function(e){return e.updateAttrs({includeRobot:!0})}))}},fp=function(e,t,n){if(t===Xg){e.stopPropagation();var r=[];n.forEach((function(e){if(0===e.subChangeType){var t=Nl.decode(ju,new Uint8Array(e.eventData)),n=t.msgId,i=t.unreadCnt,o=t.readCnt,a=t.readList,s=t.totalCnt;r.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:n,users:a.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}})),readCount:o,unreadCount:i,totalCount:s})}})),this._ctx.emit("readReceiptResponseV5",r)}},hp=function(e){e||(c(this,lp,"f").setInitVersion(0),this._ctx.includeUg&&c(this,sp,"m",bp).call(this)),c(this,lp,"f").startInterval(xp,!0)},gp=function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return e?[3,2]:(this.settings.reset(),[4,this.settings.syncDataFromServer()]);case 1:t=n.sent(),this.settings.setInitVersion(t),n.label=2;case 2:return this._ctx.isConnected&&this.settings.startInterval(xp,!0),[2]}}))}))},pp=function(e,t){t||this.storage.syncDataFromLocalStorage(this._ctx),c(this,sp,"m",gp).call(this,t),c(this,sp,"m",hp).call(this,t),this._ctx.ugEnabel&&c(this,sp,"m",yp).call(this,t)},bp=function e(){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,_=this;return a(this,(function(a){switch(a.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,n=t.createTraceId(),r=c(this,Ep,"f"),t.info(B.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:r}),n),[4,c(this,sp,"m",Gp).call(this,r,1,1e3)]):[2];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.info,u=o.isFinished,l=o.pullTime,d(this,Ep,l,"f"),t.info(B.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:r,isFinished:u,pullTime:l}),n),this.storage.addRelations(s,this._ctx.currentUserId),u?(this._ctx.emit("sgRelationsSynced",x.SUCCESS),[2]):[2,c(this,sp,"m",e).call(this)]):(t.warn(B.L_PULL_SG_RELATIONS_R,i.errmsg(),n),setTimeout((function(){return c(_,sp,"m",e).call(_)}),1e3),[2])}}))}))},Tp=function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,sp,"m",Mp).call(this,e,t)];case 1:return(r=a.sent()).isOk?(i=r.data.list.map((function(t){return Cc(t,u._ctx.currentUserId,!1,e.targetId)})),(o=this.storage.getModel(e))&&o.latestMessage&&(s=i.find((function(e){return e.messageUId===o.latestMessage.messageUId})))&&o.updateAttrs({latestMessage:s}),2===n?this._ctx.emit("messageModified",i):1===n&&this._ctx.emit("ugMsgExpansionUpdated",i),[2]):[2]}}))}))},vp=function(e,t,n){c(this,sp,"m",Tp).call(this,t,n,2)},Rp=function(e,t,n){c(this,sp,"m",Tp).call(this,t,n,1)},Ip=function(e,t){var n=this,i=t.map((function(e){var t=e.targetId,i=e.busChannel,o=e.msgUID,a=e.msgTime,s=e.operatorId,u=e.remindType,l={conversationType:F.ULTRA_GROUP,targetId:t,channelId:i||""},d=r(r({},l),{messageUId:o,sentTime:a}),_=r(r({},l),{sentTime:a,messageUId:o,senderUserId:s,content:d,messageDirection:1,messageType:me.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:ye.UNREAD,receivedStatusInfo:jt(ye.UNREAD)}),f=n.storage.getModel(l);return f&&c(n,sp,"m",mp).call(n,f,_,u),_}));this._ctx.emit("ugMsgRecalled",i)},mp=function(e,t,n){var r={},i=t.content,o=i.messageUId,a=i.sentTime,s=e.latestMessage;s&&s.messageUId===o&&(r.latestMessage=Mc(t,!0)),a&&e.lastReadTime<a&&e.unreadCount&&(r.unreadCount=e.unreadCount-1,n!==Y.ALL&&n!==Y.SINGAL||!e.unreadMentionedCount||(r.unreadMentionedCount=e.unreadMentionedCount-1),n===Y.SINGAL&&e.unreadMentionedCount&&(r.unreadMentionedMeCount=e.unreadMentionedMeCount-1));var u=e.updateAttrs(r,a);this.storage.updateConversationStorage([e]),u&&this._ctx.emit("conversation",[{conversation:e.toIReceivedConversation(),updatedItems:u}])},yp=function(e){return o(this,void 0,void 0,(function(){var e,t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,c(this,up,"f").markOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,n=t.relations,r=t.msgVersion,this.storage.addRelations(n,this._ctx.currentUserId),this._ctx.emit("ultraGroupEnable"),c(this,up,"f").setInitVersion(r),c(this,up,"f").startInterval(xp,!0),c(this,cp,"f").setInitVersion(r),c(this,cp,"f").startInterval(xp,!0),[2]):[2]}}))}))},Ap=function(){this.settings.stopInterval(),c(this,up,"f").reset(),c(this,lp,"f").reset(),c(this,cp,"f").reset()},Sp=function(e,t){return 3===t.type?(e.stopPropagation(),void this.settings.push(t.time)):7===t.type?(e.stopPropagation(),void c(this,cp,"f").push(t.time)):void(12===t.type&&(e.stopPropagation(),c(this,dp,"f").push(t.time)))},Op=function(e,t,n){var r=t.syncMsg,i=Fr(t.topic);if(r&&i===kr.updUgRTime){e.stopPropagation();var o=Nl.decode(Ka,t.pbData),a=o.channelId,s=o.busChannel,u=o.msgTime,l=this.storage.clearConversationUnreadCount({conversationType:F.ULTRA_GROUP,targetId:a,channelId:s||""},u);l&&this._ctx.emit("conversationStatusChanged",[l])}},Np=function(e,t,n,i,s){return o(this,void 0,void 0,(function(){var o,u,l,d,_,f=this;return a(this,(function(a){switch(a.label){case 0:return o=this._ctx.currentUserId,[4,c(this,sp,"m",Gp).call(this,e,n||0,t,i,s)];case 1:return(u=a.sent()).isOk?(l=u.data,d=l.info,l.isFinished,l.pullTime,_=d.map((function(e){var t=e.userId,n=e.type,i=e.busChannel,a=f.storage.getOrCreateModel({conversationType:n,targetId:t,channelId:i},!1);return r(r({},a.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Cc(e.msg,o,!1,t):null})})),[2,vn(_)]):[2,u.wipe()]}}))}))},Cp=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return this._ctx.includeUg?[2,vn(e)]:(t=this._ctx.currentUserId,n=e.filter((function(e){return e.conversationType!==F.ULTRA_GROUP})).map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),0===n.length?[2,vn(e)]:(r=Nl.encode(Za,{relation:n}),[4,this._ctx.query(kr.qryRLBatch,this._ctx.currentUserId,r,void 0)]));case 1:return(i=o.sent()).isOk?(c(this,sp,"m",Dp).call(this,i.data.pbData).info.forEach((function(n){if(n.msg){var r=e.find((function(e){return(e.channelId||"")===(n.busChannel||"")&&e.targetId===n.userId&&e.conversationType===n.type}));r.latestMessage=Cc(n.msg,t,!1,n.userId),r.includeRobot=!!n.isBot}})),[2,vn(e)]):[2,i.wipe()]}}))}))},Pp=function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){return o=[],void 0!==n&&o.push({sessionStateType:pa.IsTop,value:n?"1":"0"}),void 0!==r&&o.push({sessionStateType:pa.IsSilent,value:r.toString()}),void 0!==i&&o.push({sessionStateType:pa.AutoTrans,value:i.toString()}),s=Ug(t,e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:o}}))),[2,this._ctx.query(kr.setSeAtt,this._ctx.currentUserId,s,hs)]}))}))},wp=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return c(this,Lp,"f").add(e),n=t.messageType===me.HQ_VOICE?{msgId:e,objectName:t.messageType,content:t.remoteUrl,sampleRate:t.sampleRate,channelNumber:t.numberOfChannels,format:t.format}:{msgId:e,objectName:t.messageType,content:t.content},r=Nl.encode(ku,{businessType:1,businessInfo:Nl.encode(xu,n)}),[4,this._ctx.query(kr.upConvertMsg,e,r,Fu)];case 1:return i=a.sent(),c(this,Lp,"f").delete(e),o=i.code,i.isOk?(u=Nl.decode(Bu,new Uint8Array(i.data.businessResult)),s={status:ke.SUCCESS,text:u.result}):s={status:ke.FAILED,text:""},this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:s}),[2]}}))}))},Mp=function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,o=Nl.encode(Ds,{targetId:n,type:r,query:t.map((function(e){return{msgTime:0,msgUID:e,busChannel:i}}))});return this._ctx.query(kr.qryMsg,this._ctx.currentUserId,o,Gs)},Up=function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,d,_,f,h,g,p,E,b,T=this;return a(this,(function(a){switch(a.label){case 0:return i=Object.values(r),o=l([],u(new Set(l(l([],u(e),!1),u(i),!1))),!1),[4,c(this,sp,"m",Mp).call(this,t,o)];case 1:return s=a.sent(),d=s.isOk,_=s.code,f=s.data,d?(g=(h=f).list,p=h.notExistMsgId,E=new Map(g.map((function(e){var n=Cc(e,T._ctx.currentUserId,!1,t.targetId);return[n.messageUId,n]}))),b=e.map((function(e){var t=E.get(e);if(!t)return p.includes(e)?{messageUId:e,code:x.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:x.SERVER_DATA_ERROR};if(t.messageType!==me.REFERENCE)return{messageUId:e,code:x.INVALID_PARAMETER_MESSAGE_TYPE};var n=r[e],i=E.get(n),o=t.content;return i?(o.referMsg=i.content,o.referMsgStatus=i.isModifyMessage?Yn.MODIFIED:Yn.DEFAULT,{messageUId:e,message:t,code:x.SUCCESS}):p.includes(n)?(o.referMsgStatus=Yn.DELETE,{messageUId:e,code:x.RC_DB_DATA_NOT_FOUND,message:t}):(o.referMsgStatus=Yn.DEFAULT,{messageUId:e,code:x.SERVER_DATA_ERROR,message:t})})),n(b),[2]):(n(e.map((function(e){return{messageUId:e,code:_}}))),[2])}}))}))},Dp=function(e){var t=Ag(e);return this._ctx.getNaviInfoFromCache().supportRecallRefactor&&t.info.forEach((function(e){var t=e.msg;if(t&&t.classname===me.RECALL){var n=JSON.parse(t.content),r=n.messageUId,i=n.sentTime,o=n.extra,a={recallTime:i,recallActionTime:t.dataTime,admin:!!n.isAdmin,delete:!!n.isDelete,isDelete:!!n.isDelete,operatorId:t.fromUserId,extra:o};t.classname=me.RECALL_NOTIFICATION_MESSAGE,t.content=JSON.stringify(a),t.msgId=r,t.dataTime=i||t.dataTime}})),t},Gp=function(e,t,n,r,i,s){return void 0===s&&(s=kr.qryRelationR),o(this,void 0,void 0,(function(){var o,u,l=this;return a(this,(function(a){switch(a.label){case 0:return o=this._ctx.currentUserId,u=function(e,t,n,r,i){return Nl.encode(Ua,{startTime:e,order:t,count:n,compressioEnabled:Nd.enable(),channelType:r,botType:i})}(e,t,n,r,i),[4,this._ctx.query(s,o,u)];case 1:return[2,a.sent().trans((function(e){return c(l,sp,"m",Dp).call(l,e.pbData)}))]}}))}))};var Bp,Hp,qp,Yp,Wp,Kp,Jp=((ap={})[F.PRIVATE]=kr.cleanPMsg,ap[F.GROUP]=kr.cleanGMsg,ap[F.CUSTOMER_SERVICE]=kr.cleanCMsg,ap[F.SYSTEM]=kr.cleanSMsg,ap[F.APP_PUBLIC_SERVICE]=kr.cleanMCMsg,ap[F.PUBLIC_SERVICE]=kr.cleanMPMsg,ap[F.ULTRA_GROUP]=kr.cleanGMsg,ap),Qp=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function Xp(e){var t=!(1&~(e.ugMsg||0)),n=!(1&~(e.sessionCfg||0));return t&&n}var Zp,zp,$p,eE=[kr.chatMsg,kr.ugMsg,kr.recallMsg,kr.ppMsgS,kr.pgMsgS,kr.ppMsgP,kr.pgMsgP,kr.pcMsgP,kr.prMsgS,kr.pbMsgP,kr.chatMsgS],tE=function(e){function n(t,n,r,i){var o=e.call(this)||this;return Bp.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:n}),Object.defineProperty(o,"_navi",{enumerable:!0,configurable:!0,writable:!0,value:r}),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}),Hp.set(o,void 0),Object.defineProperty(o,"_robots",{enumerable:!0,configurable:!0,writable:!0,value:{robots:[],isSynced:!1}}),o.userStorage=new Qp,d(o,Hp,new zg(n,i),"f"),c(o,Hp,"f").pipe(o),o.on("onConnected",c(o,Bp,"m",qp),o,100),o.on("onDisconnected",c(o,Bp,"m",Wp),o,100),o.on("onSuspend",c(o,Bp,"m",Yp),o,100),o.send=o._connMgr.send.bind(o._connMgr),o.query=o._connMgr.query.bind(o._connMgr),o.on("signal",c(o,Bp,"m",Kp),o),o}return t(n,e),Object.defineProperty(n.prototype,"isConnected",{get:function(){return this._connMgr.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentToken",{get:function(){return this._connMgr.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ugEnabel",{get:function(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDisableEmptyUGChannelId",{get:function(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"includeUg",{get:function(){return Xp(this.getNaviInfoFromCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._navi.getNaviInfoFromCache(this.currentToken)}}),Object.defineProperty(n.prototype,"robots",{get:function(){return this._robots.robots.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:return t=this._robots.robots.slice(),!e&&this._robots.isSynced?[2,vn(t)]:(n=Nl.encode(pl,{ids:[]}),[4,this._connMgr.query(kr.qAppBot,this.currentUserId,n,El)]);case 1:return(r=a.sent()).isOk?(i=Math.max.apply(Math,l([],u(t.map((function(e){return e.updateTime}))),!1)),o=[],s=r.data.bots.map((function(e){var t={robotId:e.id,name:e.name,portraitUri:e.portraitUrl,robotType:e.type||"",metadata:Object.fromEntries(e.metadata.map((function(e){return[e.key,e.value]}))),createTime:e.createTime,updateTime:e.updateTime};return t.updateTime>i&&o.push(t),t})),c=t.filter((function(e){return!s.some((function(t){return t.robotId===e.robotId}))})),this._robots.isSynced=!0,this._robots.robots=s,e&&this.emit("robotsSynced",r.code,s.slice(),o,c),[2,vn(s.slice())]):(e&&this.emit("robotsSynced",r.code,[],[],[]),[2,Rn(r.code,r.msg,t)])}}))}))}}),n}(pn);Hp=new WeakMap,Bp=new WeakSet,qp=function(e,t){return o(this,void 0,void 0,(function(){var e,n,r,i;return a(this,(function(o){switch(o.label){case 0:return t||this.getAllRobots(!0),[4,c(this,Hp,"f").noticeOnline()];case 1:return(e=o.sent()).isOk?(t?c(this,Hp,"f").startInterval(18e4,!0):(n=e.data,r=n.syncTime,i=n.hasNext,c(this,Hp,"f").setInitVersion(r),c(this,Hp,"f").startInterval(18e4,!!i)),[2]):[2]}}))}))},Yp=function(e,t){c(this,Hp,"f").stopInterval()},Wp=function(e){this._robots.isSynced=!1,this._robots.robots=[],c(this,Hp,"f").reset()},Kp=function(e,t,n){var r=t.topic,i=t.syncMsg,o=Fr(r);if(o||(this.logger.warn(B.L_RECV_RMTP_E,"unknown topic: ".concat(r)),e.stopPropagation()),this.logger.debug(B.L_RECV_RMTP_O,r),i&&eE.includes(o)){e.stopPropagation();var a=n||{},s=a.timestamp,u=void 0===s?this.serverTime:s,l=a.messageUId,d=void 0===l?"":l,_=Nc(t,this.currentUserId,u,d),f=Cc(_,this.currentUserId,!1,t.targetId);this.emit("syncMsg",f,o)}else{if(o===kr.s_ntf){e.stopPropagation();var h=(E=Nl.decode(va,t.pbData)).type,g=E.chrmId,p=E.time;return this.logger.info(B.L_RECV_S_NTF_O,"type: ".concat(h,", chrmId: ").concat(g,", time: ").concat(p)),void this.emit("sNtf",E)}if(o===kr.s_cmd){e.stopPropagation();var E;h=(E=Nl.decode(va,t.pbData)).type,g=E.chrmId,p=E.time;if(this.logger.info(B.L_RECV_S_CMD_O,"type: ".concat(h,", chrmId: ").concat(g,", time: ").concat(p)),11===h)return void c(this,Hp,"f").push(p);this.emit("sCmd",E)}if(o===kr.s_msg){e.stopPropagation();_=Nl.decode(Aa,t.pbData),f=Cc(_,this.currentUserId,!1);this.emit("sMsg",f)}}};var nE,rE=function(e,t,n){var r=0;return e&&(r|=1),t&&(r|=2),n&&(r|=4),r},iE=function(e,t,n){return{chatroomId:e,key:t.key,value:t.value,timestamp:t.version,type:n?U.DELETE:U.UPDATE}},oE=function(e){function n(t,n){var r=e.call(this,"WebChatroomKVStore")||this;return Zp.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:n}),zp.set(r,new Map),Object.defineProperty(r,"_emittedEntriesSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l,d,_,f,h=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,n=t.createTraceId(),i=this._chatroomId,o={chatroomId:i,timestamp:e},t.info(B.L_PULL_CHATROOM_KV_T,JSON.stringify(o),n),[4,this._ctx.query(kr.pullKV,i,Gg(e),void 0)];case 1:return(s=a.sent()).isOk?(u=Vg(s.data.pbData),l=u.bFullUpdate,d=u.entries,_=u.syncTime,t.info(B.L_PULL_CHATROOM_KV_R,JSON.stringify(r(r({},o),{newVersion:_})),n),f=new Map,l&&(Array.from(c(this,zp,"f").values()).forEach((function(e){f.set(e.key,iE(i,e,!0))})),c(this,zp,"f").clear()),Array.from(d.values()).forEach((function(e){var t,n=(t=e.status,{isAutoDelete:!!(1&t),isOverwrite:!!(2&t),isDelete:!!(4&t)}).isDelete,r=function(e){var t=e.key,n=e.value;return e.timestamp,{key:t,value:n,userId:e.uid,version:e.version}}(e);n?c(h,zp,"f").delete(r.key):c(h,zp,"f").set(r.key,r),f.set(r.key,iE(i,r,n))})),this._emittedEntriesSynced||(this._emittedEntriesSynced=!0,this._ctx.emit("chatroom",{entriesSynced:i})),f.size>0&&this._ctx.emit("chatroom",{updatedEntries:Array.from(f.values())}),[2,vn({version:_})]):(t.warn(B.L_PULL_CHATROOM_KV_R,JSON.stringify(r(r({},o),{code:s.code})),n),[2,s.wipe()])}}))}))}}),Object.defineProperty(n.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return[4,c(this,Zp,"m",$p).call(this,e,t,!1)];case 1:return(n=r.sent()).isOk&&c(this,zp,"f").set(e.key,{key:e.key,value:e.value,userId:this._ctx.currentUserId,version:this._ctx.serverTime}),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return[4,c(this,Zp,"m",$p).call(this,{key:e.key,value:"",isAutoDelete:!1,isSendNotification:e.isSendNotification,notificationExtra:e.notificationExtra},t,!0)];case 1:return(n=r.sent()).isOk&&c(this,zp,"f").delete(e.key),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.serverTime,n=e.entries.map((function(n){var r,i=c(l,zp,"f").get(n.key);return{key:n.key,value:n.value,uid:l._ctx.currentUserId,version:null!==(r=null==i?void 0:i.version)&&void 0!==r?r:t,status:rE(!!e.isAutoDelete,e.isForce||!1,!1)}})),r=Nl.encode(es,{entry:n}),[4,this._ctx.query(kr.setKVS,this._chatroomId,r,ns)];case 1:return(i=a.sent()).isOk||i.code===x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?((o=i.data).errorKeys,s=o.keysVersion,u=new Map,null==s||s.forEach((function(e){u.set(e.key,e.version)})),e.entries.forEach((function(e){var t=e.key,n=u.get(t);n&&c(l,zp,"f").set(t,{key:t,value:e.value,userId:l._ctx.currentUserId,version:n})})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return t=rE(!1,!1,!0),n=this._ctx.serverTime,r=Nl.encode(es,{entry:e.keys.map((function(e){var r,i=c(u,zp,"f").get(e);return{key:e,status:t,value:"",uid:u._ctx.currentUserId,version:null!==(r=null==i?void 0:i.version)&&void 0!==r?r:n}}))}),[4,this._ctx.query(kr.delKVS,this._chatroomId,r,ns)];case 1:return(i=a.sent()).isOk||i.code===x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?(o=i.data.errorKeys,s=new Set,null==o||o.forEach((function(e){return s.add(e.key)})),e.keys.forEach((function(e){s.has(e)||c(u,zp,"f").delete(e)})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,zp,"f").has(e)?c(this,zp,"f").get(e).value:null}}),Object.defineProperty(n.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Array.from(c(this,zp,"f").entries()).map((function(e){var t=u(e,2);return[t[0],t[1].value]}));return Object.fromEntries(e)}}),n}(En);zp=new WeakMap,Zp=new WeakSet,$p=function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx.serverTime,o=c(this,zp,"f").get(e.key),s=rE(!!e.isAutoDelete,t,n),u={entry:{key:e.key,value:e.value,uid:this._ctx.currentUserId,version:null!==(r=null==o?void 0:o.version)&&void 0!==r?r:i,status:s}},e.isSendNotification&&(u.type=F.CHATROOM,u.bNotify=!0,u.notification={sessionId:Pc(me.CHRM_KV_NOTIFY,!1,!1,!1),classname:me.CHRM_KV_NOTIFY,content:JSON.stringify({key:e.key,value:e.value,extra:e.notificationExtra,type:n?U.DELETE:U.UPDATE})}),l=Nl.encode($a,u),[4,this._ctx.query(n?kr.delKV:kr.setKV,this._chatroomId,l)];case 1:return[2,a.sent().wipe()]}}))}))};var aE,sE,uE,lE,cE=function(e){function n(t,n,r,i){var o=e.call(this,"WebChatroomMessageReceiver")||this;return Object.defineProperty(o,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_handler",{enumerable:!0,configurable:!0,writable:!0,value:i}),nE.set(o,0),d(o,nE,r,"f"),o}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,d,_,f=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,n=t.createTraceId(),r={chatroomId:this._chatroomId,version:e},t.info(B.L_PULL_CHATROOM_MSG_T,JSON.stringify(r),n),i=function(e,t){return Nl.encode(Ma,{syncTime:e,count:t,compressioEnabled:Nd.enable()})}(e,c(this,nE,"f")),[4,this._ctx.query(kr.chrmPull,this._chatroomId,i,void 0)];case 1:return o=a.sent(),t.summary(B.L_PULL_CHATROOM_MSG_R,o,n,r),o.isOk?(s=this._ctx.currentUserId,u=Og(o.data.pbData),l=u.list,d=u.syncTime,l.length>0&&(_=l.map((function(e){return Cc(e,s,!1,f._chatroomId)})),this._handler(_,this._chatroomId)),[2,vn({version:d})]):[2,o.wipe()]}}))}))}}),n}(En);nE=new WeakMap;var dE,_E,fE,hE,gE,pE,EE,bE,TE,vE,RE,IE,mE,yE,AE,SE=function(e){function n(t,n,r,i,o){var a=e.call(this)||this;return aE.add(a),Object.defineProperty(a,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(a,"roomId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"initCount",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"extra",{enumerable:!0,configurable:!0,writable:!0,value:o}),sE.set(a,void 0),uE.set(a,void 0),d(a,sE,new cE(a._ctx,a.roomId,r,i),"f"),d(a,uE,new oE(a._ctx,a.roomId),"f"),a}return t(n,e),Object.defineProperty(n.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;c(this,sE,"f").setInitVersion(0),c(this,sE,"f").startInterval(e,!0),c(this,aE,"a",lE)&&(c(this,uE,"f").setInitVersion(0),c(this,uE,"f").startInterval(e,!0))}}),Object.defineProperty(n.prototype,"restartInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;this.stopInterval(),c(this,uE,"f").startInterval(e,!0),c(this,sE,"f").startInterval(e,!0)}}),Object.defineProperty(n.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,sE,"f").stopInterval(),c(this,uE,"f").stopInterval()}}),Object.defineProperty(n.prototype,"handleMessageNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,sE,"f").push(e)}}),Object.defineProperty(n.prototype,"handleKVNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,uE,"f").push(e)}}),Object.defineProperty(n.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,c(this,uE,"f").setEntry(e,t)]}))}))}}),Object.defineProperty(n.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,uE,"f").setEntries(e)]}))}))}}),Object.defineProperty(n.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,c(this,uE,"f").removeEntry(e,t)]}))}))}}),Object.defineProperty(n.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,uE,"f").removeEntries(e)]}))}))}}),Object.defineProperty(n.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,uE,"f").getEntry(e)}}),Object.defineProperty(n.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,uE,"f").getAllEntries()}}),n}(pn);sE=new WeakMap,uE=new WeakMap,aE=new WeakSet,lE=function(){var e;return!!(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.kvStorage)};var OE,NE,CE,PE,LE=function(e){var t=e.joinTime,n=e.createTime,r=e.memberCount,i=e.chatroomBanState;return{createTime:n,joinTime:t,memberCount:r,isAllChatroomBanned:!(1&~(i||0)),isCurrentUserBanned:!(2&~(i||0)),isCurrentChatroomBanned:!(4&~(i||0)),isCurrentChatroomInWhitelist:!(1&~(e.whiteListState||0))}},wE=function(e){function n(t){var n=e.call(this)||this;return dE.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),_E.set(n,new Map),Object.defineProperty(n,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:jp}),n.logger=t.logger,n._ctx.on("onConnected",c(n,dE,"m",gE),n),n._ctx.on("onDisconnected",c(n,dE,"m",fE),n),n._ctx.on("onSuspend",c(n,dE,"m",hE),n),n._ctx.on("sNtf",c(n,dE,"m",bE),n),n._ctx.on("sCmd",c(n,dE,"m",TE),n),n._ctx.on("syncMsg",c(n,dE,"m",EE),n),n._ctx.on("sMsg",c(n,dE,"m",pE),n),n}return t(n,e),Object.defineProperty(n.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,dE,"m",IE).call(this,e,n,r)];case 1:return(i=a.sent()).isOk?((o=c(this,_E,"f").get(e))||(o=new SE(this._ctx,e,t,c(this,dE,"m",vE).bind(this),r),c(this,_E,"f").set(e,o),o.startInterval()),[2,i.trans(LE)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return c(this,_E,"f").get(e)?(c(this,dE,"m",mE).call(this,e),n=Nl.encode(La,{nothing:1,extra:t}),[4,this._ctx.query(kr.exitChrm,e,n)]):[2,vn()];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(n.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Nl.encode(Fa,{count:t,order:n}),[4,this._ctx.query(kr.queryChrmI,e,r,Ba)];case 1:return[2,i.sent().trans((function(e){return{userCount:e.userTotalNums,userInfos:e.userInfos.map((function(e){return{id:e.id,time:e.time}}))}}))]}}))}))}}),Object.defineProperty(n.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,c(this,dE,"m",yE).call(this,e).next((function(e){return e.setEntry(t,n)}))]}))}))}}),Object.defineProperty(n.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,c(this,dE,"m",yE).call(this,e).next((function(e){return e.setEntries(t)}))]}))}))}}),Object.defineProperty(n.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,c(this,dE,"m",yE).call(this,e).next((function(e){return e.removeEntry(t,n)}))]}))}))}}),Object.defineProperty(n.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,c(this,dE,"m",yE).call(this,e).next((function(e){return e.removeEntries(t)}))]}))}))}}),Object.defineProperty(n.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return(n=c(this,_E,"f").get(e))?null===(r=n.getEntry(t))?[2,Rn(x.CHATROOM_KEY_NOT_EXIST)]:[2,vn(r)]:[4,c(this,dE,"m",AE).call(this,e)];case 1:return[2,i.sent().tryTrans((function(e){var n=e[t];return void 0===n?Rn(x.CHATROOM_KEY_NOT_EXIST):vn(n)}))]}}))}))}}),Object.defineProperty(n.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return(t=c(this,_E,"f").get(e))?[2,vn(t.getAllEntries())]:[2,c(this,dE,"m",AE).call(this,e)]}))}))}}),Object.defineProperty(n.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return i=wg({targetId:e,time:t,count:n,order:r}),o=this._ctx.currentUserId,[4,this._ctx.query(kr.qryCHMsg,e,i)];case 1:return(s=a.sent()).isOk?(u=Mg(s.data.pbData),[2,vn({hasMore:!!u.hasMsg,list:u.list.map((function(t){return Cc(t,o,!1,e)}))})]):[2,s.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Nl.encode(xs,{rtcRoomId:e.rtcRoomId}),[4,this._ctx.query(kr.setRtcRoomId,e.chatRoomId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),n}(pn);_E=new WeakMap,dE=new WeakSet,fE=function(){var e,t;try{for(var n=s(c(this,_E,"f").values()),r=n.next();!r.done;r=n.next()){r.value.stopInterval()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}c(this,_E,"f").clear()},hE=function(){var e,t;try{for(var n=s(c(this,_E,"f").values()),r=n.next();!r.done;r=n.next()){r.value.stopInterval()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},gE=function(e,t){var n,r;if(t)try{for(var i=s(c(this,_E,"f").values()),o=i.next();!o.done;o=i.next()){var a=o.value;c(this,dE,"m",RE).call(this,a)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},pE=function(e,t){var n=t.conversationType,r=t.targetId;(t.messageType,n===F.CHATROOM)&&(e.stopPropagation(),c(this,_E,"f").get(r)&&c(this,dE,"m",vE).call(this,[t],r))},EE=function(e,t){t.conversationType===F.CHATROOM&&(e.stopPropagation(),this.emit("message",[t],t.targetId))},bE=function(e,t){var n=t.type,r=t.chrmId,i=t.time;if(2===n){e.stopPropagation();var o=c(this,_E,"f").get(r);o&&o.handleMessageNotify(i)}},TE=function(e,t){var n=t.type,r=t.chrmId,i=t.time;if(2===n||4===n){e.stopPropagation();var o=c(this,_E,"f").get(r);if(o)return 4===n?(c(this,_E,"f").delete(r),void this._ctx.emit("chatroom",{chatroomDestroyed:r})):void o.handleKVNotify(i)}},vE=function(e,t){var n=this,r=e.filter((function(e){var r,i=e.messageType;if(i===me.CHATROOM_MERGE_CHANGE){var o=function(e){var t={},n=[],r=e.content.memberCount||0;return Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,n.push({userId:e.userId,action:e.status,extra:e.extra})})),{users:t,chatroomId:e.targetId,memberCount:r,userList:n}}(e);return n._ctx.emit("chatroom",{userChange:o}),!1}if(i===me.CHATROOM_MERGE_BAN){var a=function(e){var t=e.content;return{chatroomId:t.chatroomId,banType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return n._ctx.emit("chatroom",{chatroomNotifyBan:a}),!1}if(i===me.CHATROOM_SYNC_MSG){var s=function(e){var t=e.content;return{chatroomId:t.chatroomId,status:t.status,reason:t.reason,time:t.time,extra:t.extra||""}}(e);return n._ctx.emit("chatroom",{chatroomNotifyMultiLoginSync:s}),!1}if(i===me.CHATROOM_MERGE_BLOCK){var u=function(e){var t=e.content;return{chatroomId:t.chatroomId,operateType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return u.operateType===k.Blocked&&(null===(r=null==u?void 0:u.userIdList)||void 0===r?void 0:r.includes(n._ctx.currentUserId))&&c(n,dE,"m",mE).call(n,t),n._ctx.emit("chatroom",{chatroomNotifyBlock:u}),!1}return!0}));this.emit("message",r,t)},RE=function(e){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l,d;return a(this,(function(a){switch(a.label){case 0:return t=e.roomId,n=e.extra,i=this.logger.createTraceId(),this.logger.info(B.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:t}),i),[4,c(this,dE,"m",IE).call(this,t,!1,n)];case 1:return o=a.sent(),this.logger.summary(B.L_REJOIN_CHATROOM_R,o,i,{chatroomId:t}),s=o.code,u=o.isOk,l=o.data,u?(e.restartInterval(),d=LE(l),this._ctx.emit("chatroom",{rejoinedRoom:r(r({chatroomId:t},d),{count:e.initCount})}),[2]):(s!==x.RC_CHATROOM_USER_KICKED&&s!==x.RC_CHATROOM_NOT_EXIST||c(this,_E,"f").delete(t),this._ctx.emit("chatroom",{rejoinedRoom:{chatroomId:t,errorCode:s}}),[2])}}))}))},IE=function(e,t,n){var r=Nl.encode(La,{extra:n,nothing:1}),i=t?kr.joinChrm:kr.joinChrmR;return this._ctx.query(i,e,r,wa)},mE=function(e){var t=c(this,_E,"f").get(e);t&&(t.stopInterval(),c(this,_E,"f").delete(e))},yE=function(e){var t=c(this,_E,"f").get(e);return t?vn(t):Rn(x.NOT_IN_CHATROOM)},AE=function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return[4,this._ctx.query(kr.pullKV,e,Gg(0),void 0)];case 1:return(t=r.sent()).isOk?(n=Vg(t.data.pbData).entries,[2,vn(n.reduce((function(e,t){return e[t.key]=t.value,e}),{}))]):[2,t.wipe()]}}))}))};var ME=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=la.localStorage,n=e.appkey,r=e.currentUserId,i=at(n,r),o=t.getItem(i)||"{}",a=JSON.parse(o);return{value:{value:{version:a.version||0,tags:a.tags||{},transLan:a.transLan||"zh",autoTrans:a.autoTrans||!1},key:i,stringify:!0}}}}),Object.defineProperty(n.prototype,"version",{get:function(){return this.get("value").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tags",{get:function(){return this.get("value").tags||{}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"forceUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.set("value",e)}}),Object.defineProperty(n.prototype,"addTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("value"),r=n.tags,i=n.autoTrans,o=n.transLan;r[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:r,autoTrans:i,transLan:o})}}),Object.defineProperty(n.prototype,"deleteTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("value"),r=n.tags,i=n.autoTrans,o=n.transLan;delete r[e],this.set("value",{version:t,tags:r,autoTrans:i,transLan:o})}}),n}(Wd),UE=function(e){function n(t){var n=e.call(this,"UserSettings")||this;return OE.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:void 0}),NE.set(n,!1),n.storage=new ME,n._ctx.on("onConnected",n._handleConnected,n),n._ctx.on("onDisconnected",n._handleDisconnected,n),n._ctx.on("onSuspend",n._handleDisconnected,n),n._ctx.on("signal",n._handleSignal,n),n}return t(n,e),Object.defineProperty(n.prototype,"_handleConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.storage.syncDataFromLocalStorage(this._ctx),d(this,NE,!0,"f");var e=this.storage.version;this.setInitVersion(e),this.push(e)}}),Object.defineProperty(n.prototype,"_handleDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reset()}}),Object.defineProperty(n.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(Fr(t.topic)===kr.s_us){var n=Nl.decode(Ss,t.pbData).version;this.push(n),e.stopPropagation()}}}),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,d,_,f,h,g,p,E,b,T,v,R;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,n=t.currentUserId,r=t.logger,i=this._ctx.getNaviInfoFromCache(),o=r.createTraceId(),r.info(B.L_SYNC_USER_SETTINGS_T,"version: ".concat(e),o),s=Nl.encode(as,{version:e,ipType:i.ipType||0}),[4,this._ctx.query(kr.pullUS,n,s,ss)];case 1:return u=a.sent(),r.summary(B.L_SYNC_USER_SETTINGS_R,u,o),u.isOk?(l=u.data,d=l.version,_=l.items,f=!1,h=!1,g=!1,p="",E=this.storage.get("value"),b=E.transLan,T=E.autoTrans,v=E.tags,R={version:d,transLan:b,autoTrans:T,tags:v},null==_||_.forEach((function(e){var t=e.key,n=e.value;switch(t){case"Tag":R.tags={},e.tags.forEach((function(e){R.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),f=!0;break;case"transLan":g=!0,R.transLan=Zi.readUTF(new Uint8Array(n));break;case"autoTrans":h=!0,R.autoTrans="1"===Zi.readUTF(new Uint8Array(n));break;case"VoipInfo":p=Zi.readUTF(new Uint8Array(n))}})),this.storage.set("value",R),f&&this.emit("tagsChanged"),g&&this.emit("userSettingsChanged",{key:Wn.TranslationLanguage,value:R.transLan}),h&&this.emit("userSettingsChanged",{key:Wn.AutoTranslateEnable,value:R.autoTrans}),p&&this.emit("voipInfoChanged",p),c(this,OE,"m",CE).call(this,u.code),[2,vn({version:d})]):(c(this,OE,"m",CE).call(this,u.code),[2,u.wipe()])}}))}))}}),Object.defineProperty(n.prototype,"hasTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.storage.tags[e]}}),Object.defineProperty(n.prototype,"getTags",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.storage.tags}}),Object.defineProperty(n.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,n=this._ctx.currentUserId,r=Nl.encode(ys,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),[4,this._ctx.query(kr.addSeTag,n,r,os)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.addTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,n=this._ctx.currentUserId,r=Nl.encode(As,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),[4,this._ctx.query(kr.delSeTag,n,r,os)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.deleteTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,OE,"m",PE).call(this,kr.transLan,e)]}))}))}}),Object.defineProperty(n.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,vn(this.storage.get("value").transLan||"zh")]}))}))}}),Object.defineProperty(n.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,OE,"m",PE).call(this,kr.autoTrans,e?"1":"0")]}))}))}}),Object.defineProperty(n.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,vn(this.storage.get("value").autoTrans)]}))}))}}),n}(En);NE=new WeakMap,OE=new WeakSet,CE=function(e){c(this,NE,"f")&&(d(this,NE,!1,"f"),this.emit("userSettingsSynced",e))},PE=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,_,f,h,g;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.version,r=this._ctx.currentUserId,i=Nl.encode(is,{version:n,value:t,ignoreVersion:!0}),[4,this._ctx.query(e,r,i,os)];case 1:if((o=a.sent()).isOk){switch(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.get("value"),d=c.transLan,_=c.autoTrans,f=c.tags,h=c.version,g={version:l?u:h,transLan:d,autoTrans:_,tags:f},e){case kr.transLan:g.transLan=t;break;case kr.autoTrans:g.autoTrans="1"===t}this.storage.set("value",g)}return[2,o.wipe()]}}))}))};var DE,GE=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:Object.fromEntries(e.extProfile.map((function(e){return[e.key,e.value]}))),addTime:e.relationTime,inBlackList:!!e.flag}},VE=function(e){var t,n,r=e.targetId,i=e.settingProfile,o=e.extProfile,a=e.baseInfo,s=e.userInfo,u=Zt(i||[]),l=Zt(o||[]);return{groupId:r,groupName:u.name||"",portraitUri:u.portraitUrl||"",introduction:u.introduction||"",notice:u.announcement||"",extProfile:l,joinPermission:~~u.joinPerm,removeMemberPermission:~~u.removePerm,invitePermission:~~u.memInvitePerm,inviteHandlePermission:~~u.invitePerm,groupInfoEditPermission:~~u.profilePerm,memberInfoEditPermission:~~u.memProfilePerm,creatorId:(null==a?void 0:a.creatorId)||"",ownerId:(null==a?void 0:a.ownerId)||"",createTime:(null==a?void 0:a.createTime)||0,membersCount:(null==a?void 0:a.memberCount)||0,remark:null!==(t=null==s?void 0:s.remarkName)&&void 0!==t?t:"",joinedTime:(null==s?void 0:s.joinTime)||0,role:null!==(n=null==s?void 0:s.role)&&void 0!==n?n:y.UNDEF}},jE=function(){function e(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"searchFriendsInfo",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"searchGroupMembers",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(this,"searchJoinedGroups",{enumerable:!0,configurable:!0,writable:!0,value:jp})}return Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Nl.encode(lu,{permission:e}),[4,this.ctx.query(kr.updProfilePermiss,this.ctx.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Nl.encode(uu,{nothing:1}),[4,this.ctx.query(kr.qProfilePermiss,this.ctx.currentUserId,e,lu)];case 1:return[2,t.sent().trans((function(e){return e.permission}))]}}))}))}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=Nl.encode(cu,{uniqueId:e}),[4,this.ctx.query(kr.searchUserProfile,this.ctx.currentUserId,t,iu)];case 1:return(n=a.sent()).isOk?(r=n.data,i=r.userId,o=r.userProfile,s=r.userExtProfile,u=Ft(i,o,s),[2,vn(u)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return i=hg(e,t,n,r),[4,this.ctx.query(kr.channelCreate,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,o.wipe()]:(s=Nl.decode(_u,o.data.pbData),u={errorKeys:s.censorFailedFields,processCode:s.processCode||0},[2,Rn(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=hg(e,t,n),[4,this.ctx.query(kr.upChannelInfo,e,r,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=Nl.decode(_u,i.data.pbData),[2,Rn(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return t=Nl.encode(fu,{type:F.GROUP,list:e.map((function(e){return{targetId:e}}))}),[4,this.ctx.query(kr.qChannelInfo,e[0],t,pu)];case 1:return(n=i.sent()).isOk?(r=Lg(n.data).list,[2,vn(r.map(VE))]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Fg({targetId:e,users:t,settingInfo:{isQuit:!0,isDelBan:n.removeMuteStatus,isDelAttention:n.removeFollow,isDelWhite:n.removeWhiteList}}),[4,this.ctx.query(kr.channelMemKick,e,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Fg({targetId:e,settingInfo:{isQuit:!0,isDelBan:t.removeMuteStatus,isDelAttention:t.removeFollow,isDelWhite:t.removeWhiteList}}),[4,this.ctx.query(kr.channelMemQuit,e,n)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Fg({targetId:e}),[4,this.ctx.query(kr.channelDismiss,e,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return i=Fg({targetId:e,settingInfo:{isQuit:n,isDelBan:r.removeMuteStatus,isDelAttention:r.removeFollow,isDelWhite:r.removeWhiteList},users:[t]}),[4,this.ctx.query(kr.channelTransfer,e,i)];case 1:return[2,o.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Nl.encode(hu,{targetId:t,type:F.GROUP,users:n,operateType:e}),[4,this.ctx.query(kr.upChannelManager,t,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Nl.encode(hu,{targetId:t,type:F.GROUP,users:n,operateType:e}),[4,this.ctx.query(kr.upChannelFollow,t,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return t=kg({targetId:e}),[4,this.ctx.query(kr.qChannelFollow,e,t,pu)];case 1:return(n=o.sent()).isOk?(r=Lg(n.data).list,i=r.map((function(e){return{userId:e.userId,time:e.opTime}})),[2,vn(i)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=xg({targetId:e,operateType:t?O.ADD:O.REMOVE,channelNickName:t}),[4,this.ctx.query(kr.upChannelRemark,e,n)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=Nl.encode(mu,{targetId:e,type:t,info:n}),[4,this.ctx.query(kr.friendAdd,this.ctx.currentUserId,r,_u)];case 1:return[2,i.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Nl.encode(yu,{targetId:e,type:t}),[4,this.ctx.query(kr.friendDel,this.ctx.currentUserId,n)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Nl.encode(mu,{targetId:e,type:1}),[4,this.ctx.query(kr.friendHandle,this.ctx.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Nl.encode(mu,{targetId:e,type:2,info:t}),[4,this.ctx.query(kr.friendHandle,this.ctx.currentUserId,n)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=Nl.encode(Su,{targetId:e,remarkName:t,extProfile:Object.entries(n).map((function(e){var t=u(e,2);return{key:t[0],value:t[1]}}))}),[4,this.ctx.query(kr.friendSetPf,this.ctx.currentUserId,r,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=Nl.decode(Ou,i.data.pbData),[2,Rn(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Nl.encode(yu,{targetId:e,type:t}),[4,this.ctx.query(kr.friendCheck,this.ctx.currentUserId,n,Au)];case 1:return[2,r.sent().trans((function(e){return e.list.map((function(e){return{userId:e.targetId,relationType:e.status}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=Nl.encode(Nu,{queryType:11,friendType:e,page:{size:t.count,order:t.order?0:1,pageToken:t.pageToken}}),[4,this.ctx.query(kr.friendsQuery,this.ctx.currentUserId,n,pu)];case 1:return(r=a.sent()).isOk?(i=r.data.page,o=i.pageToken,s=i.hasNext,u=Lg(r.data).list,l={pageToken:s&&o?o:"",data:u.map(GE)},[2,vn(l)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=Nl.encode(Nu,{queryType:12,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(kr.friendsQuery,this.ctx.currentUserId,t,pu)];case 1:return(n=a.sent()).isOk?(r=n.data.page,i=r.pageToken,o=r.hasNext,s=Lg(n.data).list,u={pageToken:o&&i?i:"",data:s.map((function(e){return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,applicationType:e.type,applicationStatus:e.status,operationTime:e.operateTime,extra:e.info||""}}))},[2,vn(u)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Nl.encode(Cu,{targetId:e}),[4,this.ctx.query(kr.friendsInfoQry,this.ctx.currentUserId,t,Lu)];case 1:return[2,n.sent().trans((function(e){return e.list.map(GE)}))]}}))}))}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Nl.encode(Pu,{level:e}),[4,this.ctx.query(kr.friendAuthSet,this.ctx.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return e=this.ctx.currentUserId,t=Nl.encode(mu,{targetId:e}),[4,this.ctx.query(kr.friendAuthGet,e,t,Pu)];case 1:return[2,n.sent().trans((function(e){return e.level}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return n=kg({targetId:e,ids:t}),[4,this.ctx.query(kr.qChannelSpeMem,e,n,pu)];case 1:return(r=a.sent()).isOk?(i=Lg(r.data).list,o=i.map(Qt),[2,vn(o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return i=xg({targetId:e,userId:t,channelNickName:n,additional:r}),[4,this.ctx.query(kr.upChannelMem,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,o.wipe()]:(s=Nl.decode(_u,o.data.pbData),[2,Rn(o.code,o.msg,{errorKeys:s.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return r=kg({targetId:e,roleType:t,botType:n.filterRobotType,page:{size:n.count,order:n.order?0:1,pageToken:n.pageToken}}),[4,this.ctx.query(kr.qChannelMem,e,r,pu)];case 1:return(i=a.sent()).isOk?(o=i.data.page,s=o.pageToken,u=o.hasNext,l=Lg(i.data).list,c={pageToken:u&&s?s:"",data:l.map(Qt)},[2,vn(c)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Nl.encode(Iu,{targetId:e,type:F.GROUP}),[4,this.ctx.query(kr.channelMemJoin,e,t,_u)];case 1:return[2,n.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Nl.encode(Iu,{targetId:e,type:F.GROUP,userIds:t}),[4,this.ctx.query(kr.channelMemInvite,e,n,_u)];case 1:return[2,r.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.groupId,n=e.inviterId,r=e.optType,i=e.optResult,o=e.joinUserId,s=e.reason,u=Nl.encode(Ru,{targetId:t,type:F.GROUP,optType:r,optResult:i,inviterId:n,joinUserId:o,detail:s}),[4,this.ctx.query(kr.channelApplyResp,t,u,_u)];case 1:return[2,a.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=kg({page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(kr.qChannelApplyList,this.ctx.currentUserId,t,pu)];case 1:return(n=a.sent()).isOk?(r=Lg(n.data),i=r.pageToken,o=r.hasNext,s=r.list,u=s.map(Xt),[2,vn({data:u,pageToken:o&&i?i:""})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=kg({roleType:e,page:{size:t.count,pageToken:t.pageToken,order:t.order?1:0}}),[4,this.ctx.query(kr.qChannelMemJoin,this.ctx.currentUserId,n,pu)];case 1:return(r=a.sent()).isOk?(i=r.data.page,o=i.pageToken,s=i.hasNext,u=Lg(r.data).list,l=u.map(VE),[2,vn({data:l,pageToken:s&&o?o:""})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return t=Nl.encode(gu,{type:F.GROUP,ids:e}),[4,this.ctx.query(kr.qChannelMemSpeJoin,this.ctx.currentUserId,t,pu)];case 1:return(n=o.sent()).isOk?(r=Lg(n.data).list,i=r.map(VE),[2,vn(i)]):[2,n.wipe()]}}))}))}}),e}(),kE=((DE={})[F.PRIVATE]=kr.qryPMsg,DE[F.GROUP]=kr.qryGMsg,DE[F.CHATROOM]=kr.qryCHMsg,DE[F.CUSTOMER_SERVICE]=kr.qryCMsg,DE[F.SYSTEM]=kr.qrySMsg,DE[F.APP_PUBLIC_SERVICE]=kr.qryMCMsg,DE[F.PUBLIC_SERVICE]=kr.qryMPMsg,DE[F.ULTRA_GROUP]=kr.qryUgMsg,DE),xE=function(e,t,n,r,i,o){var a=Ir(t.messageType),s=a.isCounted,u=a.isPersited,l=a.isStatusMessage;return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:i,messageDirection:be.SEND,isCounted:s,isMentioned:!!t.isMentioned,content:t.content,messageType:t.messageType,isOffLineMessage:!1,isPersited:u,messageUId:n,sentTime:r,receivedTime:0,disableNotification:!!t.disableNotification,isStatusMessage:!!l,canIncludeExpansion:!!t.canIncludeExpansion,expansion:t.canIncludeExpansion?t.expansion:null,receivedStatus:ye.UNREAD,receivedStatusInfo:jt(ye.UNREAD),pushConfig:t.pushConfig,isInterrupt:t.isInterrupt,messageId:o||0,sentStatus:ue.SENT,directedUserIds:t.directionalUserIdList,disableUpdateLastMessage:t.disableUpdateLastMessage,needReceipt:t.needReceipt}},FE=[L.GROUP_OPERATION,L.GROUP_PROFILE_CHANGE,L.GROUP_APPLICATION_INVITATION,L.GROUP_FOLLOW_USER_CHANGE],BE=[b.FRIEND_APPLICATION];function HE(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve(Rn(x.RC_NET_UNAVAILABLE))]}))}))},n}}var qE,YE=function(e){function d(t,n){var r=this,i=n.loggerProxy?n.loggerProxy:bd();r=e.call(this,t,n,new id(n.appkey,"IMLib","IM",i))||this,_.add(r),Object.defineProperty(r,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_sendMessageStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_readReceiptManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_pullOfflineFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(r,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"reporterStatistic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(r,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_dataHosting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_loggerProxy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(r,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t){var n,i=t.messageType;if(e.conversationType,i===me.SYNC_READ_STATUS&&(t.directionalUserIdList=fn(e.conversationType,[r.currentUserId])),i===me.READ_RECEIPT_RESPONSE){if(!t.content.receiptMessageDic||0===Object.keys(t.content.receiptMessageDic).length){var o=null===(n=r._readReceiptManager)||void 0===n?void 0:n.getReceiptMessageDic(e);t.content.receiptMessageDic=o||{}}for(var a in t.directionalUserIdList=[],t.content.receiptMessageDic)t.directionalUserIdList.push(a)}return t}}),Object.defineProperty(r,"_ultraMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(r,"setProxy",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"getProxy",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"testProxy",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"setUserStatusListener",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"subscribeUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"getLocalMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"deleteLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"deleteLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"batchClearLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"clearLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:Vp}),Object.defineProperty(r,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:jp}),Object.defineProperty(r,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:jp}),r._loggerProxy=i;var o=n.appkey,a=n.logOutputLevel,s=n.logExpireTime,u=n.navigators,l=n.areaCode,d=n.logServerUrl,E=n.miniCMPProxy,b=n.environment,T=n.useNaviV2,y=void 0!==T&&T,A=n.enableReadReceiptStorage;r._environment=b||"default",r._enableReadReceiptStorage=A,r.logger.setOutputLevel(a),Zn.init({areaCode:l,navigators:u,logServerUrl:d,miniCMPProxy:E}),n.loggerProxy||_d(o,r.logger,s),r.reporter=new kd(o,r.logger,r._loggerProxy),r.navi=new qc(o,r.logger,new Xc(o,r.logger),r._environment,y),r.reporterStatistic=new xd(o,r.logger,r._loggerProxy),r._sendMessageStore=new Yc(o);var S=r._connMgr=new nd(o,r.navi,r.logger),O=r._ctx=new tE(r._appkey,S,r.navi,r.logger);return r._connMgr.pipe(O),"browser"===la.tag&&r._initCloudController(),r._userSettings=new UE(O),r._chat=new Fp(O,r._userSettings),r._chatroom=new wE(O),r._dataHosting=new jE(O),r._chatroom.on("message",r._handleChatroomMessages,r),O.on("conversationStatusChanged",r._conversationStatusChanged,r),O.on("sCmd",r._handleSCmdNotify,r),O.on("signal",r._handleSignal,r),O.on("onConnected",r.onConnected,r),O.on("onDisconnected",r.onDisconnected,r),O.on("onConnecting",r.onConnecting,r),O.on("onSuspend",r.onSuspend,r),O.on("ultraGroupEnable",r._handleUltraGroupEnable,r),O.on("messagesFromUG",r._handleMessagesFromUltraGroup,r),O.on("messagesFromSG",r._handleMessagesFromSignalGroup,r),O.on("smsgFromSignalGroup",r._handleSmsgFromSignalGroup,r),O.on("syncMsg",r._handleSyncMsg,r),O.on("sgRelationsSynced",r._handleSGRelationsSynced,r),O.on("serverEvent",c(r,_,"m",N),r),O.on("readReceiptResponseV5",c(r,_,"m",h),r),O.on("speechToTextResponse",c(r,_,"m",g),r),O.on("ugUserGroupChanged",r._handleUserGroupStatus,r),O.on("ugChannelChanged",r._handleUltraChannelChange,r),O.on("conversationStatusSynced",(function(e,t){return r._watcher.conversationStatusSynced(t)}),r),O.on("messageModified",c(r,_,"m",p),r),O.on("messageModifiedSyncCompleted",c(r,_,"m",v),r),O.on("ugMsgExpansionUpdated",c(r,_,"m",R),r),O.on("ugMsgRecalled",c(r,_,"m",I),r),O.on("conversation",c(r,_,"m",m),r),O.on("chatroom",r._handlerChatroomEvent,r),O.on("robotsSynced",c(r,_,"m",f),r),r._userSettings.on("voipInfoChanged",r._naviChangeHandler,r),r._userSettings.on("tagsChanged",(function(){return r._watcher.tag()}),r),r._userSettings.on("userSettingsSynced",(function(e,t){return r._watcher.userSettingsSynced(t)}),r),r._userSettings.on("userSettingsChanged",(function(e,t){return r._watcher.userSettingsChanged(t)}),r),r}var _,f,h,g,p,v,R,I,m,N,C,P;return t(d,e),Object.defineProperty(d.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"userSettings",{get:function(){return this._userSettings},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"dataHosting",{get:function(){return this._dataHosting},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"usingCppEngine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;e=u(Zn.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new rd(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,lr.init)}}),Object.defineProperty(d.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.navi.getNaviInfoFromCache(this._connMgr.getToken());this._pullOfflineFinished=!1,this._readReceiptManager||(this._readReceiptManager=new Qc(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(n),this._sendMessageStore.init(this.currentUserId),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(),this.reporter.checkStart(n),this.reporterStatistic.checkStart(n)}}),Object.defineProperty(d.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}}),Object.defineProperty(d.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.onSuspend(t)}}),Object.defineProperty(d.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(d.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.conversation(t);var n=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));n&&this._watcher.conversationTag()}}),Object.defineProperty(d.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new Jc(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var n,r;null===(r=(n=t._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(n,e)},subscribeUserStatusChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedUserStatusChange)||void 0===r||r.call(n,e)},subscribeRelationChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedRelationChange)||void 0===r||r.call(n,e)},ownUserProfileChanged:function(e){var n,r;null===(r=(n=t._watcher).ownUserProfileChanged)||void 0===r||r.call(n,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(d.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new id(this._appkey,e,t,this._loggerProxy)}}),Object.defineProperty(d.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(d.prototype,"naviInfo",{get:function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"connectionStatus",{get:function(){return this._connMgr.getConnectionStatus()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return this._openCallPlus=n,[2,this._connMgr.connect(e,t,n,r)]}))}))}}),Object.defineProperty(d.prototype,"_handleUltraGroupEnable",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.ultraGroupEnable()}}),Object.defineProperty(d.prototype,"_handleSGRelationsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.sgRelationsSynced(t)}}),Object.defineProperty(d.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=new Map,o=[];t.forEach((function(e){var t,n,a,s=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,d=e.isMentioned,_=e.isCounted,f=e.senderUserId,h=e.messageType,g=e.sentTime,p=e.channelType,E=e.isPersited;if(r._ultraMsgMap[l])delete r._ultraMsgMap[l];else{var b={conversationType:F.ULTRA_GROUP,targetId:s,channelId:c||""},T=r._chat.storage.getOrCreateModel(b,!0),v=i.get(T)||{params:{channelType:p},time:g};i.set(T,v),v.time=g;var R=v.params;if(E&&(R.hidden=!1,R.latestMessage=e,R.operationTime=g),_&&f!==r.currentUserId&&h!==me.RECALL_NOTIFICATION_MESSAGE){R.unreadCount=(R.unreadCount||T.unreadCount)+1;var I=(null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===Y.ALL;d&&(I||(null===(a=null===(n=null==u?void 0:u.mentionedInfo)||void 0===n?void 0:n.userIdList)||void 0===a?void 0:a.includes(r.currentUserId)))&&(R.unreadMentionedCount=(R.unreadMentionedCount||T.unreadMentionedCount)+1,I||(R.unreadMentionedMeCount=(R.unreadMentionedMeCount||T.unreadMentionedMeCount)+1),R.hasMentioned=!0,R.mentionedInfo=null==u?void 0:u.mentionedInfo),T.firstUnreadMessage||R.firstUnreadMessageUId||(R.firstUnreadMessageType=h,R.firstUnreadMessageUId=l,R.firstUnreadTime=g)}o.push(e)}}));var a=[],s=[];Array.from(i.entries()).forEach((function(e){var t=u(e,2),n=t[0],r=t[1],i=r.params,o=r.time;a.push(n);var l=n.updateAttrs(i,o);l&&s.push({conversation:n.toIReceivedConversation(),updatedItems:l})})),this._chat.storage.updateConversationStorage(a),s.length>0&&this._watcher.conversation(s),this._batchMessage(o)}}),Object.defineProperty(d.prototype,"_handleChatroomMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=this._connMgr.getConnectedTime(),o=[];if(t.forEach((function(e){e.sentTime>=i&&r._writeMessagesLog(F.CHATROOM,e.messageUId)&&o.push(e.messageUId)})),o.length>0){var a=Date.now();this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:a,server_deltatime:a-this._connMgr.getCrtServerTime(),msg_ids:o.join(",")}))}this._watcher.batchMessage(t)}}),Object.defineProperty(d.prototype,"_handlerChatroomEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.chatroom(t)}}),Object.defineProperty(d.prototype,"_handleMessagesFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=this._messageProcessor(t),o=i.newOutboxTime;i.messageUIds;var a=i.messages,s=i.messageExpansionList,u=i.RSMsgList,l=i.msgUIds2Statistic;l.length>0&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:l.join(",")})),this._batchMessage(a),s.forEach((function(e){r._receiveMessageExpansion(e)})),u.forEach((function(e){r._processRSMsg(e)})),this._sendMessageStore.removeByTimestamp(o),n&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this.logger.info(B.L_PULL_OFFLINE_MESSAGE_FINISHED_S),this._watcher.pullFinished(),this._chat.startPullModifyMsg())}}),Object.defineProperty(d.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i=t.syncMsg,o=t.topic;if(i)this._receiveSyncMsg(t,n);else switch(Fr(o)){case kr.rtc_ntf:this._receiveRtcKv(t.pbData);break;case kr.s_opNtf:this._pullOperateStatusNotify(t);break;case kr.s_pubCall:this._pubCallInfo(t);break;case kr.s_stat:null===(r=this._subscribeManager)||void 0===r||r.updateUserStatus(t)}}}),Object.defineProperty(d.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r,i,o=t.time;switch(t.type){case 8:null===(n=this._subscribeManager)||void 0===n||n.startsyncSubscribeUserStatus(o);break;case 9:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(o);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(d.prototype,"_receiveMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,n=e.channelId,r=void 0===n?"":n,i=e.conversationType,o=e.targetId,a=t.put,s=t.del,u=t.mid;a&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:a,channelId:r,conversationType:i,targetId:o}}),s&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:s,channelId:r,conversationType:i,targetId:o}})}}),Object.defineProperty(d.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){var o=this._chat.storage.clearConversationUnreadCount({conversationType:e,targetId:t,channelId:n},i);r&&o&&this._watcher.conversation([o])}}),Object.defineProperty(d.prototype,"_setConversationCacheByMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.isPersited,i=e.targetId,o=e.channelId,a=e.sentTime,s=e.disableUpdateLastMessage,u=e.senderUserId,l=e.messageType,c=e.isCounted,d=e.messageUId,_=e.content,f=e.isMentioned;if(te(t,W)){var h=this.naviInfo,g=this._chat.storage.getOrCreateModel({conversationType:t,targetId:i,channelId:o},!0),p={},E=u===this.currentUserId,b=l===me.RECALL,T=g.lastReadTime>a;if(c&&!Uc(h).isOk&&!b&&!E&&!T&&(0===g.unreadCount&&(p.firstUnreadMessageUId=d,p.firstUnreadTime=a,p.firstUnreadMessageType=l),p.unreadCount=g.unreadCount+1,f&&At(_)&&_.mentionedInfo)){p.hasMentioned=!0,p.mentionedInfo=_.mentionedInfo;var v=_.mentionedInfo,R=v.type,I=v.userIdList;(R===Y.ALL||(I||[]).includes(this.currentUserId))&&(p.unreadMentionedCount=g.unreadMentionedCount+1)}if(b&&At(_)&&!E){var m=_,y=m.sentTime,A=m.messageUId;!this._ctx.userStorage.recallMsgMap.has(A)&&g.unreadCount>0&&y>g.lastReadTime&&(this._ctx.userStorage.recallMsgMap.add(A),p.unreadCount=g.unreadCount-1,0===g.unreadCount&&(p.firstUnreadMessageUId="",p.firstUnreadTime=0,p.firstUnreadMessageType=""))}if(n){b&&!g.hidden||(p.operationTime=a),p.hidden=!1;var S=b?_.sentTime:a;s||g.latestMessage&&!(g.latestMessage.sentTime<=S)||(p.latestMessage=h.supportRecallRefactor&&b?Mc(e,!0):e)}if(this._ctx.includeUg&&l===me.EXPANSION_NOTIFY&&g.latestMessage&&g.latestMessage.messageUId===d){var O=_,N=O.put,C=O.del;O.clear?g.latestMessage.expansion={}:N?g.latestMessage.expansion=r(r({},g.latestMessage.expansion),N):C&&g.latestMessage.expansion&&C.forEach((function(e){delete g.latestMessage.expansion[e]}))}var P=g.updateAttrs(p,e.sentTime);this._chat.storage.updateConversationStorage([g]),P&&n&&!s&&this._watcher.conversation([{conversation:g.toIReceivedConversation(),updatedItems:P}])}}}),Object.defineProperty(d.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;switch(Fr(e.topic)){case kr.updRTime:this._receivesyncReadStatus(e);break;case kr.updUserSub:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(d.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,n=[],r=[],i=[],o=e.length-1;o>=0;o-=1){var a=e[o];a.messageType===me.LOG_COMMAND&&a.senderUserId===Je?r.unshift(a):a.messageType===me.CLOUD_CONTROL&&a.senderUserId===Je?i.push(a):n.unshift(a)}this._watcher.batchMessage(n),r.forEach((function(e){var n=e.content,r=n.startTime,i=n.endTime,o=n.platform,a=n.logId,s=n.uri;t.reporter.report(parseInt(r,10),parseInt(i,10),o,s,a,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)}}),Object.defineProperty(d.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){switch(o.label){case 0:return e.shift()?(n=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,lr.other,n)]):[3,2];case 1:r=o.sent()||0,(i=e.filter((function(e){return e.sentTime>r}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(d.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Nl.decode(Bs,e.pbData),n=t.key,r=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:n,value:r}]}))}}),Object.defineProperty(d.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Nl.decode(Ka,e.pbData),n=t.type,r=t.channelId,i=t.msgTime,o=t.busChannel;this._clearConversationUnreadCount(n,r,o||"",!0,i),this._watcher.syncReadStatus({conversationType:n,targetId:r,channelId:o,timestamp:i})}}),Object.defineProperty(d.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r;return a(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=Nl.encode(Hs,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._connMgr.query(kr.pullKvMsg,this.currentUserId,e,qs)]):[2];case 1:return t=i.sent(),n=t.isOk,r=t.data,n&&r?(this._latestPullKVMsgTimestamp=r.maxTime,this._watcher.callInfo(JSON.stringify({list:r.info})),[2]):[2]}}))}))}}),Object.defineProperty(d.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===ge.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"_filterMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType;return t===me.DELIVERED||t===me.DELIVERED_MSG||t===me.SYNC_READ_STATUS&&!this._processSRSMsg(e)}}),Object.defineProperty(d.prototype,"_messageProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=0,r=[],i=[],o=[],a=[],s=[];return e.forEach((function(e){var u=e.conversationType,l=e.targetId,c=e.channelId,d=e.messageDirection,_=e.messageUId,f=e.messageType,h=e.sentTime,g=e.senderUserId,p=e.content;if(r.push(_),d===be.SEND){n=Math.max(h,n);var E=t._sendMessageStore.getSendMessageMap(),b=f===me.RECALL?"Cmd:".concat(p.messageUId):_;if(E[b])return void t._sendMessageStore.removeByUID(b)}if(!t._filterMessage(e)){switch(h>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,_)&&s.push(_),f){case me.EXPANSION_NOTIFY:return void o.push(e);case me.READ_RECEIPT:g===t.currentUserId&&t._clearConversationUnreadCount(u,l,c,!0,h);break;case me.READ_STATE:return void a.push(e);case me.READ_RECEIPT_REQUEST:t._enableReadReceiptStorage&&t._processRRReqMsg(e);break;case me.READ_RECEIPT_RESPONSE:t._enableReadReceiptStorage&&t._processRRRspMsg(e)}t._setConversationCacheByMessage(e),i.push(e)}})),{newOutboxTime:n,messageUIds:r,messages:i,messageExpansionList:o,RSMsgList:a,msgUIds2Statistic:s}}}),Object.defineProperty(d.prototype,"_processSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=e.content,o=e.senderUserId,a=e.sentTime;if(o!==this.currentUserId)return!1;var s=this.naviInfo;return this._clearConversationUnreadCount(t,n,r,!0,a),1!==s.sesDriven||(a>this.connectedTime||this._watcher.syncReadStatus({conversationType:t,targetId:n,channelId:r,timestamp:i.lastMessageSendTime}),!1)}}),Object.defineProperty(d.prototype,"_processRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,i=e.channelId,o=e.content,a={conversationType:t,targetId:n,channelId:i};this._watcher.messageReadReceipt(t===F.PRIVATE?{privateReadReceipt:r(r({},a),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:r(r({},a),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})}}),Object.defineProperty(d.prototype,"_processRRReqMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=e.conversationType,r=e.channelId,i=e.targetId,o=e.content,a=e.sentTime,s=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:n,channelId:r,targetId:i},o.messageUId,s,a,u)}}),Object.defineProperty(d.prototype,"_processRRRspMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r,i=this,o=e.conversationType,a=e.channelId,u=e.targetId,l=e.content,c=e.senderUserId,d=l.receiptMessageDic,_=void 0===d?{}:d;if(c===this.currentUserId)for(var f in _){var h=_[f];try{for(var g=(t=void 0,s(h)),p=g.next();!p.done;p=g.next()){var E=p.value;null===(r=this._readReceiptManager)||void 0===r||r.remove({conversationType:o,channelId:a,targetId:u},E)}}catch(e){t={error:e}}finally{try{p&&!p.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}}else(_[this.currentUserId]||[]).forEach((function(e){var t;null===(t=i._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:o,channelId:a,targetId:u},e,c)}))}}),Object.defineProperty(d.prototype,"_handleSmsgFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.conversationType,r=t.senderUserId,i=t.messageUId,o=t.sentTime;this._writeMessagesLog(n,i)&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),r!==this.currentUserId||t.isStatusMessage||this._sendMessageStore.setMessage(i,o),this._handleNotNotifyMsg(t)||(this._handleReadReceiptStorage(t),this._setConversationCacheByMessage(t),this._batchMessage([t]))}}),Object.defineProperty(d.prototype,"_handleReadReceiptStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._enableReadReceiptStorage){var t=e.messageType;t===me.READ_RECEIPT_REQUEST&&this._processRRReqMsg(e),t===me.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(e)}}}),Object.defineProperty(d.prototype,"_handleSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageStore.setMessage(t.messageUId,t.sentTime),this.logger.info(B.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),t.messageType!==me.EXPANSION_NOTIFY?((t.messageType===me.SYNC_READ_STATUS||t.messageType===me.READ_RECEIPT&&t.senderUserId===this.currentUserId)&&this._clearConversationUnreadCount(t.conversationType,t.targetId,t.channelId,!0,t.sentTime),t.messageType===me.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),t.messageType===me.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._setConversationCacheByMessage(t),this._batchMessage([t])):this._receiveMessageExpansion(t)}}),Object.defineProperty(d.prototype,"_handleNotNotifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType,n=e.senderUserId;return t===me.DELIVERED||(t===me.DELIVERED_MSG||(t===me.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===me.SYNC_READ_STATUS&&n!==this.currentUserId||t===me.READ_STATE&&(this._processRSMsg(e),!0)))}}),Object.defineProperty(d.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,_,f,h,g,p=this;return a(this,(function(a){switch(a.label){case 0:return n=e.conversationType,r=e.targetId,i=e.channelId,o=t.timestamp,s=t.count,u=t.order,l=kE[n],c=this.currentUserId,d=wg({targetId:r,busChannel:i,time:o||(1===u?1:this._connMgr.getCrtServerTime()+6e4),count:s,order:u}),_=n===F.CHATROOM?r:c,[4,this._connMgr.query(l,_,d,void 0)];case 1:return(f=a.sent()).isOk?(h=Mg(f.data.pbData),g=h.list.map((function(e){var t,n=Cc(e,c,!1,r),i=null===(t=p._readReceiptManager)||void 0===t?void 0:t.getReadReceiptInfo(n,n.messageUId);if(i){var o=i.users;n.readReceiptInfo={isReceiptRequestMessage:!0,readerList:o}}return n})),[2,vn({hasMore:!!h.hasMsg,list:0===u?g.reverse():g})]):[2,f.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(B.L_VER_REPORT_T,o,i),s=Nl.encode(Os,{sdkInfo:o}),u=new fo(kr.reportsdk,s,n),[4,r.send(u)]):[2];case 1:return(l=a.sent().code)!==x.SUCCESS&&this.logger.warn(B.L_VER_REPORT_R,l,i),[2]}}))}))}}),Object.defineProperty(d.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return this._chat.storage.setDrafts(e,t),[2,vn()]}))}))}}),Object.defineProperty(d.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return t=this._chat.storage.getDrafts(e),[2,vn(t)]}))}))}}),Object.defineProperty(d.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._chat.storage.deleteDrafts(e),[2,vn()]}))}))}}),Object.defineProperty(d.prototype,"_writeMessagesLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=null===(n=this.cloudController)||void 0===n?void 0:n.getMRTRConfig();if(!r)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 n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(t),o=0;switch(e){case F.PRIVATE:o=r.private;break;case F.GROUP:o=r.group;break;case F.CHATROOM:o=r.chatroom;break;case F.ULTRA_GROUP:o=r.ultraGroup}return!!o&&i%(1/o)==0}}),Object.defineProperty(d.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i){return o(this,void 0,void 0,(function(){var n,o,s,u,l,c,d,_,f,h,g,p,E,b,T,v;return a(this,(function(a){switch(a.label){case 0:return n=e.conversationType,o=e.targetId,t=this._handleInnerMsgOptions(e,t),s=!1,[F.PRIVATE,F.GROUP].includes(n)&&(t.isStatusMessage||Ir(t.messageType).isStatusMessage)&&(s=!0),u=s?function(e){var t;return(t={},t[F.PRIVATE]=kr.ppMsgS,t[F.GROUP]=kr.pgMsgS,t)[e]}(n):function(e){var t;return(t={},t[F.PRIVATE]=kr.ppMsgP,t[F.GROUP]=kr.pgMsgP,t[F.CHATROOM]=kr.chatMsg,t[F.CUSTOMER_SERVICE]=kr.pcMsgP,t[F.RTC_ROOM]=kr.prMsgS,t[F.SYSTEM]=kr.pbMsgP,t)[e]}(n)||kr.ppMsgP,t.messageId||(t.messageId=sn()),l=t.messageId,c=jg(e,t),(d=new ho(kr[u],c,n===F.SYSTEM?this.currentUserId:o)).setHeaderQos(qr),s?(this._connMgr.sendOnly(d),[2,vn(xE(e,r(r({},t),{isStatusMessage:s}),"",0,this.currentUserId,l))]):(_=this._connMgr.getCrtServerTime(),f=xE(e,r(r({},t),{isStatusMessage:s}),"",_,this.currentUserId,l),null==i||i(l),h=Date.now(),[4,this._connMgr.send(d)]);case 1:return g=a.sent(),p=g.code,E=g.isOk,b=g.msg,T=g.data,E?(v=T,this._sendMessageSuccessHandle(f,v),this._writeMessagesLog(n,v.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:v.messageUId,channel:n,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),[2,vn(f)]):(this._writeMessagesLog(n)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:n,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),f.sentStatus=ue.FAILED,[2,Rn(p,b,f)])}}))}))}}),Object.defineProperty(d.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=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,a=e.targetId,s=e.channelId,u=e.sentTime,l=e.content,c=e.messageDirection;if(this._enableReadReceiptStorage){if(i===me.READ_RECEIPT_REQUEST){var d=l.messageUId;null===(n=this._readReceiptManager)||void 0===n||n.insert({conversationType:o,targetId:a,channelId:s},d,c,u)}if(i===me.READ_RECEIPT_RESPONSE){var _=l.receiptMessageDic;if(!_)return;for(var f in _)_[f].forEach((function(e){var t;null===(t=r._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:a,channelId:s},e)}))}}}}),Object.defineProperty(d.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,_,f,h,g,p,E,b,T,v,R,I,m;return a(this,(function(a){switch(a.label){case 0:return n=e.targetId,r=e.conversationType,i=e.channelId||"",o=t.user,s=t.extra,u=t.isDelete,l=t.directionalUserIdList,c=t.disableUpdateLastMessage,d=t.messageUId,_=t.sentTime,f=t.disableNotification,h=t.pushConfig,g=t.pushContent,p=t.isAdmin,E={conversationType:r,targetId:n,messageUId:d,sentTime:_,channelId:i,isDelete:!!u,isAdmin:!!p},o&&(E.user=o),s&&(E.extra=s),b={content:E,messageType:me.RECALL,disableNotification:f,pushConfig:h,pushContent:(null==h?void 0:h.pushContent)||g,disableUpdateLastMessage:c,directionalUserIdList:fn(r,l)},T=jg(e,b),(v=new ho(kr.recallMsg,T,this.currentUserId)).setHeaderQos(qr),[4,this._connMgr.send(v)];case 1:return(R=a.sent()).isOk?(I=R.data,r!==F.ULTRA_GROUP&&(I.messageUId="Cmd:".concat(d)),m=xE(e,b,I.messageUId,I.timestamp,this.currentUserId),r===F.ULTRA_GROUP?(this._ultraMsgMap[I.messageUId]=I.timestamp,this._updateUltraGroupWhenRecallMsg(m)):(this._sendMessageStore.setMessage(I.messageUId,I.timestamp),this._setConversationCacheByMessage(m)),[2,vn(m)]):[2,R.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._connMgr.getToken();this.navi.updateVoipCallInfo(n,t);var i=this.navi.getNaviInfoFromCache(n);this._watcher.onNaviDataChange(r({},i))}}),Object.defineProperty(d.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,s,u){return o(this,void 0,void 0,(function(){var o,l,c,d,_;return a(this,(function(a){switch(a.label){case 0:return o=i&&"uploads"!==i?t||"":tn(e,t),l=this.naviInfo,c=dn(l,this.logger),d="",c||(d=JSON.stringify({uploadDomain:c})),_=Nl.encode(Oa,{type:e,key:o,httpMethod:n||"",queryString:i||"",url:s||"",ext:d,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._connMgr.query(kr.qnTkn,this.currentUserId,_,Ca)];case 1:return[2,a.sent().trans((function(e){return r(r({},e),{fileName:o,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(d.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return o=this.naviInfo,u="",l="",t===n.QINIU?s=kr.qnUrl:t===n.AWS?s=kr.s3Url:t===n.STC?s=kr.stcUrl:t===n.MINIO?(s=kr.minioUrl,u=dn(o,this.logger),l=JSON.stringify({url:u})):s=kr.aliUrl,c=Nl.encode(Na,{type:e,key:r,fileName:i,ext:l,size:-1,ipType:o.ipType||0}),[4,this._connMgr.query(s,this.currentUserId,c,Pa)];case 1:return[2,a.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(d.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect(e,t)];case 1:return n.sent(),this._resetMemoryState(),[2,vn()]}}))}))}}),Object.defineProperty(d.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager}}),Object.defineProperty(d.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(d.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"userId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,Rn(x.TAG_EXISTS)]:[2,this._userSettings.createTag(e)]}))}))}}),Object.defineProperty(d.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e)?[2,this._userSettings.removeTag(e)]:[2,Rn(x.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(d.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,this._userSettings.createTag(e)]:[2,Rn(x.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(d.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){for(i in t=this._userSettings.getTags(),n=this._chat.storage.getTagConversationCountMap(),r=[],t)r.push({tagId:i,tagName:t[i].tagName,createdTime:t[i].createdTime,conversationCount:(null===(e=n.get(i))||void 0===e?void 0:e.length)||0});return[2,vn(r)]}))}))}}),Object.defineProperty(d.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i){return o(this,void 0,void 0,(function(){var n,o,s,u,l,c,d,_,f,h,g,p,E;return a(this,(function(a){switch(a.label){case 0:return n=e.targetId,t.messageId||(t.messageId=sn()),o=t.messageId,s=jg(e,t),(u=new ho(kr.ugMsg,s,n)).setHeaderQos(qr),l=this._connMgr.getCrtServerTime(),c=xE(e,r({},t),"",l,this.currentUserId,o),i&&i(o),d=Date.now(),[4,this._connMgr.send(u)];case 1:return _=a.sent(),f=_.code,h=_.data,f!==x.SUCCESS?(this._writeMessagesLog(F.ULTRA_GROUP)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:F.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentStatus=ue.FAILED,[2,Rn(f,void 0,c)]):(g=h,this._writeMessagesLog(F.ULTRA_GROUP,g.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:g.messageUId,channel:F.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,p=this._chat.storage.getOrCreateModel(e,!0),(E=p.updateAttrs({operationTime:g.timestamp,latestMessage:r({},c)},g.timestamp))&&this._watcher.conversation([{conversation:p.toIReceivedConversation(),updatedItems:E}]),[2,vn(c)])}}))}))}}),Object.defineProperty(d.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._isConnected){var t=function(e){var t=e,n=t.type,r=t.notifyType,i=t.info,o=t.summary,a=[],s=[],u=!(2&~r),l=!(1&~r);return l&&Array.isArray(i)&&i.forEach((function(e){var t=e,n=t.targetId,r=t.busChannel,i=t.userId,o=t.opType,s=t.optime;a.push({targetId:n,channelId:r,userId:i,operationType:o,operationTime:s})})),u&&Array.isArray(o)&&o.forEach((function(e){var t=e,n=t.targetId,r=t.busChannel,i=t.count,o=t.opType;s.push({targetId:n,channelId:r,count:i,operationType:o})})),{conversationType:n,info:a,summary:s,hasInfo:l,hasSummary:u}}(Nl.decode(js,e.pbData));this._watcher.operateStatus(t)}}}),Object.defineProperty(d.prototype,"_handleConvertEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r=[];e.filter((function(e){return 0===e.subChangeType})).forEach((function(e){var t=Nl.decode(qu,new Uint8Array(e.eventData)).results;r.push.apply(r,l([],u(t.map((function(e){return{identifier:e.messageUID,from:e.inputSource,code:e.code,translateInfo:{targetLanguage:e.targetLan,translatedText:e.transResult||"",status:e.code===x.SUCCESS?Lr.SUCCESS:Lr.FAILED}}}))),!1))})),r.length&&(null===(n=(t=this._watcher).translateResponse)||void 0===n||n.call(t,r))}}),Object.defineProperty(d.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:FE},Friend:{map:{},types:BE}},n=function(e,t,n){e[t]||(e[t]=[]),e[t].push(n)};e.forEach((function(e){var r=e.changeType;for(var i in t)if(t[i].types.includes(r)){n(t[i].map,r,e);break}}));var r={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&r[i](t[i].map)}}),Object.defineProperty(d.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=L.GROUP_OPERATION,n=L.GROUP_PROFILE_CHANGE,r=L.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[n]&&this._handleGroupProfileChange(e[n]),e[r]&&this._handleFollowUserChange(e[r])}}),Object.defineProperty(d.prototype,"_processChangeMapFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e[b.FRIEND_APPLICATION]||[]).forEach((function(e){var n,r,i,o,a,s,u,l,c,d,_=e.subChangeType,f=e.businessId,h=e.time,g=e.eventData,p=T.FRIEND_APPLY,b=T.FRIEND_REFUSE,v=T.FRIEND_USER_INFO,R=T.FRIENDS_INPUT,I=T.FRIEND_CLEAR,m=T.FRIEND_INFO_CHANGE,y=T.FRIEND_INFO_CHANGE_SYNC;switch(_){case p:case b:var A=_===p?E.UNHANDLED:E.REFUSED;null===(r=(n=t._watcher).friendApplicationStatusChanged)||void 0===r||r.call(n,{userId:f,applicationType:g.applyType,applicationStatus:A,directionType:g.friendType,operationTime:h,extra:g.info||""});break;case v: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 R:null===(s=(a=t._watcher).friendDelete)||void 0===s||s.call(a,{userIds:g.targetId,directionType:g.type,operationTime:h});break;case I:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,h);break;case m:break;case y:null===(d=(c=t._watcher).friendInfoChangedSync)||void 0===d||d.call(c,{userId:f,remark:g.remarkname,extProfile:g.extProfile,operationTime:h})}}))}}),Object.defineProperty(d.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i,o,a=e.subChangeType,s=e.businessId,l=e.time,c=e.eventData,d=c.optUserInfo,_=c.channelInfo,f=c.userInfos,h={groupId:s,operation:a,operationTime:l};d&&(n=u(Kt([d]),1),h.operatorInfo=n[0]),a===A.CREATE&&(r=u(function(e){return void 0===e&&(e=[]),e.map((function(e){var t,n,r,i,o,a,s,u,l,c=Jt(e.settingProfile)||{},d=e.extProfile||[],_=e.targetId,f=e.baseInfo,h=e.userInfo;return{groupId:_,groupName:null!==(t=c.name)&&void 0!==t?t:"",portraitUri:null!==(n=c.portraitUrl)&&void 0!==n?n:"",introduction:null!==(r=c.introduction)&&void 0!==r?r:"",notice:null!==(i=c.announcement)&&void 0!==i?i:"",extProfile:Jt(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!==(a=null==f?void 0:f.ownerId)&&void 0!==a?a:"",createTime:(null==f?void 0:f.createTime)||0,membersCount:null!==(s=null==f?void 0:f.memberCount)&&void 0!==s?s:0,remark:null!==(u=null==h?void 0:h.remarkName)&&void 0!==u?u:"",joinedTime:(null==h?void 0:h.joinTime)||0,role:null!==(l=null==h?void 0:h.role)&&void 0!==l?l:y.UNDEF}}))}([_]),1),h.groupInfo=r[0]),[A.CREATE,A.DISMISS].includes(a)||(h.memberInfos=Kt(f)),null===(o=(i=t._watcher).groupOperation)||void 0===o||o.call(i,h)}))}}),Object.defineProperty(d.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i,o,a,s,l=e.businessId,c=e.time,d=e.eventData,_=e.subChangeType,f=e.secondaryId;switch(_){case S.GROUP_INFO_CHANGE:var h=u(Kt([d.optUserInfo]),1)[0],g=u(qt([d.channelInfo]),1)[0],p=u(d.channelFullInfo?qt([d.channelFullInfo]):[void 0],1)[0];null===(r=(n=t._watcher).groupInfoChanged)||void 0===r||r.call(n,{operatorInfo:h,groupInfo:g,changedGroupInfo:g,operationTime:c,fullGroupInfo:p});break;case S.MEMBER_PROFILE_CHANGE:h=u(Kt([d.optUserInfo]),1)[0];var E=Kt(d.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:l,operatorInfo:h,memberInfo:E,operationTime:c});break;case S.GROUP_REMARK_DELETE:case S.GROUP_REMARK_SET:var b=_===S.GROUP_REMARK_SET?O.ADD:O.REMOVE;null===(s=(a=t._watcher).groupRemarkChangedSync)||void 0===s||s.call(a,{groupId:l,operationType:b,operationTime:c,groupRemark:f})}}))}}),Object.defineProperty(d.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i=e.subChangeType,o=e.businessId,a=e.time,s=e.userGroupIds,u=1===i?O.ADD:O.REMOVE;null===(r=(n=t._watcher).groupFollowsChangedSync)||void 0===r||r.call(n,{groupId:o,operationType:u,operationTime:a,userIds:s})}))}}),Object.defineProperty(d.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,r=[],i=[],o=[];t.forEach((function(e){var t=e.subChangeType,a=e.targetId;e.msgTime;var s=e.operatorId,u=e.busChannelType,l=e.time,c=e.busChannel||"",d={conversationType:F.ULTRA_GROUP,targetId:a,channelId:c},_=n._chat.storage.getModel(d);switch(t){case oe.PRIVATE_TO_PUBLIC:null==_||_.updateAttrs({channelType:ne.PUBLIC}),r.push({targetId:a,channelId:c,changeType:re.PRIVATE_TO_PUBLIC,channelType:ne.PUBLIC});break;case oe.PUBLIC_TO_PRIVATE:null==_||_.updateAttrs({channelType:ne.PRIVATE}),r.push({targetId:a,channelId:c,changeType:re.PUBLIC_TO_PRIVATE,channelType:ne.PRIVATE});break;case oe.PUBLIC_TO_PRIVATE_USER_NOT_IN:_&&n._chat.storage.removeConversation(_),r.push({targetId:a,channelId:c,changeType:re.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:u});break;case oe.CHANNEL_DELETE:_&&n._chat.storage.removeConversation(_),i.push({targetId:a,channelId:c,channelType:u,deleteTime:l});break;case oe.CHANNEL_USER_KICKED:o.push({targetId:a,channelId:c,userId:s,channelType:ne.PRIVATE}),s===n.currentUserId&&_&&n._chat.storage.removeConversation(_);case oe.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:}})),r.length>0&&this._watcher.ultraGroupChannelChangeType(r),i.length>0&&this._watcher.ultraGroupChannelDelete(i),o.length>0&&this._watcher.ultraGroupChannelUserKicked(o)}}),Object.defineProperty(d.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var e,n,r,i,o,s;return a(this,(function(a){return e=[],n=[],r=[],i=[],o=[],t.forEach((function(t){var a=t.type,s=t.targetId,u=t.busChannelType,l=t.busChannel,c=t.userGroupIds;switch(t.subChangeType){case ae.REMOVE_USER_GROUP:e.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.JOIN_USER_GROUP:n.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.EXIT_USER_GROUP:r.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.CHANNEL_BIND_USER_GROUP:i.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c});break;case ae.CHANNEL_UNBIND_USER_GROUP:o.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c})}})),s={},e.length>0&&(s.userGroupDisband=e),n.length>0&&(s.userAdded=n),r.length>0&&(s.userRemoved=r),i.length>0&&(s.userGroupBindChannel=i),o.length>0&&(s.userGroupUnBindChannel=o),this._watcher.userGroupStatus(s),[2]}))}))}}),Object.defineProperty(d.prototype,"_updateUltraGroupWhenRecallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._chat.storage.getModel(e);if(n){var r={},i=e.content,o=i.messageUId,a=i.sentTime,s=n.latestMessage;s&&s.messageUId===o&&(r.latestMessage=Mc(e,!0)),a&&n.lastReadTime<a&&n.unreadCount&&(r.unreadCount=n.unreadCount-1,t!==se.ALL&&t!==se.ME||!n.unreadMentionedCount||(r.unreadMentionedCount=n.unreadMentionedCount-1),t===se.ME&&n.unreadMentionedCount&&(r.unreadMentionedMeCount=n.unreadMentionedMeCount-1));var u=n.updateAttrs(r,e.sentTime);this._chat.storage.updateConversationStorage([n]),u&&this._watcher.conversation([{conversation:n.toIReceivedConversation(),updatedItems:u}])}}}),Object.defineProperty(d.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._subscribeManager.updateSubscribeRelation(e,t,fe.SUBSCRIBE,n)]}))}))}}),Object.defineProperty(d.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,this._subscribeManager.updateSubscribeRelation(e,t,fe.UNSUBSCRIBE)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){return i=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserList(e,t,n),[2,vn(i)]}))}))}}),Object.defineProperty(d.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserStatus(e,t),[2,vn(r||[])]}))}))}}),Object.defineProperty(d.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=Nl.encode(iu,c(this,_,"m",C).call(this,e)),[4,this._connMgr.query(kr.updUserProfile,this.currentUserId,n,void 0)];case 1:return(r=a.sent()).data?(i=Nl.decode(ou,r.data.pbData),r.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,r.wipe()]):(s=i.censorFailedFields,[2,Rn(r.code,"",s&&0!==s.length?{errorKeys:s,errorKey:s[0]}:void 0)])):[2,r.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subscribeManager.getOwnProfile()}}),Object.defineProperty(d.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._subscribeManager.getUserProfiles(e)]}))}))}}),Object.defineProperty(d.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){switch(i.label){case 0:return n?[3,2]:[4,this._connMgr.send(new ho(t,r,e))];case 1:return[2,i.sent().wipe()];case 2:return[4,this._connMgr.query(t,e,r,void 0)];case 3:return[2,i.sent().trans((function(e){return e.pbData}))]}}))}))}}),Object.defineProperty(d.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=Ql(t,n),[4,this.rtcSignaling(e,kr[kr.rtcPing],!0,r)];case 1:return(i=a.sent()).isOk?(o=Nl.decode(il,i.data),[2,vn(o)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"deviceId",{get:function(){return vc()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;(t=e.deviceId)&&(Tc=t),n=e.packageName,mc=n}}),Object.defineProperty(d.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){o(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return od?(cd&&(clearTimeout(cd),cd=null),[4,od]):[2];case 1:return(e=n.sent())&&(t=e.db,fd.push(t)),od=null,[2]}}))}))}}),Object.defineProperty(d.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;if(this._connMgr.setNetwork(e,t),e.status&&this.cloudControllerUri){var r=this._connMgr.getToken();null===(n=this.cloudController)||void 0===n||n.request(this.cloudControllerUri,lr.newWorkChange,r)}}}),Object.defineProperty(d.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return r=Nl.encode(Fs,{key:t,dataContent:n}),[4,this._connMgr.query(kr.reqCall,e,r,Fs)];case 1:return(i=o.sent()).isOk?[2,i.trans((function(e){return{key:e.key,value:e.dataContent}}))]:[2,i.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=Nl.encode(Uu,e),[4,this._connMgr.query(kr.addUnpush,this.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Nl.encode(Du,{nothing:0}),[4,this._connMgr.query(kr.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Nl.encode(Gu,{nothing:0}),[4,this._connMgr.query(kr.qryUnpush,this.currentUserId,e,Vu)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,n=e.spanMinutes,r=e.startTime,i=e.level,o=e.timezone;return t?{spanMinutes:n,startTime:r,level:i,timezone:o}:{spanMinutes:0,startTime:"",level:we.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(d.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,vn(Zn.getStatsUrlList(this.naviInfo))]}))}))}}),Object.defineProperty(d.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,_=this;return a(this,(function(a){switch(a.label){case 0:return i=0===r?e[0].identifier:this.currentUserId,o=this.userSettings.storage.get("value").transLan,s=[],u=[],e.forEach((function(e){var t=e.sourceLanguage,n=e.content,i=e.targetLanguage||o;t!==i?n?s.push({messageUID:e.identifier,sourceLan:e.sourceLanguage,targetLan:e.targetLanguage||o,text:e.content,inputSource:r,transType:1}):u.push({identifier:e.identifier,from:r,code:x.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:Lr.NONE}}):u.push({identifier:e.identifier,from:r,code:x.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:Lr.NONE}})})),0!==s.length?[3,1]:(l=vn(),[3,3]);case 1:return c=Nl.encode(ku,{businessType:3,businessInfo:Nl.encode(Hu,{forceTrans:n,transInfos:s,model:t})}),[4,this._connMgr.query(kr.upConvertMsg,i,c,Fu)];case 2:d=a.sent(),l=d.wipe(),a.label=3;case 3:return u.length>0&&setTimeout((function(){return _._watcher.translateResponse(u)}),0),[2,l]}}))}))}}),Object.defineProperty(d.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return this._subscribeManager?(t=[],n=new Set,this._subscribeManager.getSubscribeUserStatus(_e.ONLINE_STATUS,e).forEach((function(e){var r=e.userId,i=e.details,o=(void 0===i?[]:i).map((function(e){return{platform:e.platform,isOnline:!!e.eventValue,updateTime:e.changeTime}})),a=o.some((function(e){return e.isOnline})),s={userId:r,isOnline:a,details:o};t.push(s),n.add(r)})),0===(r=e.filter((function(e){return!n.has(e)}))).length?[2,vn(t)]:[4,c(this,_,"m",P).call(this,_e.FRIEND_ONLINE_STATUS,r)]):[2,vn([])];case 1:return(i=o.sent()).isOk?(i.data.list.forEach((function(e){var n,r=e.subUserId,i=e.data.map((function(e){return{platform:e.platformInfo,isOnline:!!e.value,updateTime:e.versionTime}})),o=i.some((function(e){return e.isOnline}));t.push((n={userId:r,isOnline:o,details:i},[de.iOS,de.Android,de.Web,de.PC,de.Mini,de.HarmonyOS].forEach((function(e){n.details.some((function(t){return t.platform===e}))||n.details.push({platform:e,isOnline:!1,updateTime:0})})),n))})),[2,vn(t)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._ctx.getAllRobots(!1)]}))}))}}),_=new WeakSet,f=function(e,t,n,r,i){this._watcher.robotsSynced(t,r)},h=function(e,t){this._watcher.readReceiptResponseV5(t)},g=function(e,t){this._watcher.speechToTextResponse(t)},p=function(e,t){this._watcher.messagesModified(t)},v=function(e){this._watcher.messageModifiedSyncCompleted()},R=function(e,t){this._watcher.ultraGroupMessageExpansionUpdated(t)},I=function(e,t){this._watcher.ultraGroupMessageRecalled(t)},m=function(e,t){this._watcher.conversation(t)},N=function(e,t,n){var r=this;t!==Qg?t!==Zg?this._handleEventChangeList(this._connMgr.codec.formatEventChangeList(n)):this._handleConvertEvent(n):n.forEach((function(e){Nl.decode(Mu,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,n,i=Xt(e);null===(n=(t=r._watcher).groupApplicationEvent)||void 0===n||n.call(t,i)}))}))},C=function(e){var t={},n=e.extraProfile;return n&&(delete e.extraProfile,t.userExtProfile=fg(n)),t.userProfile=fg(e),t},P=function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=Nl.encode(ru,{subType:e,subUsers:t.map((function(e){return{subUserId:e}}))}),[4,this._connMgr.query(kr.qrySubData,this.currentUserId,n,tu)];case 1:return[2,r.sent()]}}))}))},i([HE()],d.prototype,"setNotificationQuietHoursWithSetting",null),i([HE()],d.prototype,"removeNotificationQuietHoursSetting",null),i([HE()],d.prototype,"getNotificationQuietHoursSetting",null),d}(zl),WE=function(){function e(e){qE.set(this,void 0),d(this,qE,e,"f")}return Object.defineProperty(e.prototype,"isSpeechToTextEnabled",{get:function(){return!!(1&(c(this,qE,"f").AIBusinessSub||0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConversationListIncludeUltraGroup",{get:function(){return Xp(c(this,qE,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageModifiableMinutes",{get:function(){return c(this,qE,"f").msgModifyMinute||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readReceiptVersion",{get:function(){return e=(e=c(this,qE,"f").grpRRVer)||0,Object.values(Fe).includes(e)?e:Fe.UNKNOWN;var e},enumerable:!1,configurable:!0}),e}();qE=new WeakMap;var KE,JE,QE,XE,ZE,zE,$E,eb=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ctx=e,this.logger=e.logger}return Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e.checkAuthed(!1)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e.checkAuthed(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkAuthed",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.ctx.connectionStatus===ge.CONNECTED||this.ctx.userId&&e?vn(this.ctx.naviInfo):Rn(x.RC_NET_UNAVAILABLE)}}),e}(),tb=function(e){function n(t,n){var r=e.call(this,t)||this;return Object.defineProperty(r,"svr",{enumerable:!0,configurable:!0,writable:!0,value:n}),r}return t(n,e),Object.defineProperty(n.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,extra:r,createIfNotExist:n}),i),[4,In.create("joinChatroom").validate("chatroomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isNumber("count",t,!0).fail(x.INVALID_PARAMETER_COUNT).isString("extra",r).fail(x.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){var i=Math.max(Math.min(t,50),-1)||10;return s.svr.joinChatroom(e,i,n,r)}))];case 1:return o=a.sent(),this.logger.summary(B.A_JOIN_CHATROOM_R,o,i),[2,o]}}))}))}}),Object.defineProperty(n.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_QUIT_CHATROOM_T,JSON.stringify({roomId:e}),n),[4,In.create("quitChatroom").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isString("extra",t).fail(x.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.quitChatroom(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_QUIT_CHATROOM_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_INFO_T,JSON.stringify({roomId:e,count:t,order:n}),r),[4,In.create("getChatroomInfo").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,0,20).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",n,0,2).fail(x.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).next((function(){return o.svr.getChatroomInfo(e,t||0,n||1)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_CHATROOM_INFO_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:n}),r),[4,In.create("setChatroomEntry").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("key",null==t?void 0:t.key,on,!0).fail(x.INVALID_PARAMETER_KEY).validate("value",null==t?void 0:t.value,an,!0).fail(x.INVALID_PARAMETER_VALUE).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(x.INVALID_PARAMETER_NOTIFICATION_EXTRA).isBoolean("isAutoDelete",null==t?void 0:t.isAutoDelete).fail(x.INVALID_PARAMETER_IS_AUTO_DELETE).isBoolean("isSendNotification",null==t?void 0:t.isSendNotification).fail(x.INVALID_PARAMETER_IS_SEND_NOTIFICATION).result().tryTrans(this.validateConnected).next((function(){return o.svr.setChatroomEntry(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_CHATROOM_ENTRY_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),n),[4,In.create("setChatroomEntries").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isTypedArray("entries",null==t?void 0:t.entries,(function(e){return on(null==e?void 0:e.key)&&an(null==e?void 0:e.value)}),!0).fail(x.INVALID_PARAMETER_ENTRIES).isLimitedArray("entryOptions.entries",null==t?void 0:t.entries,10,!0).fail(x.CHATROOM_KV_STORE_OUT_LIMIT).isBoolean("entryOptions.isForce",null==t?void 0:t.isForce).fail(x.INVALID_PARAMETER_IS_FORCE).isBoolean("entryOptions.isAutoDelete",null==t?void 0:t.isAutoDelete).fail(x.INVALID_PARAMETER_IS_AUTO_DELETE).result().tryTrans(this.validateConnected).next((function(){return i.svr.setChatroomEntries(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SET_CHATROOM_ENTRIES_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:n}),r),[4,In.create("removeChatroomEntry").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("entry.key",null==t?void 0:t.key,on,!0).fail(x.INVALID_PARAMETER_KEY).isBoolean("entry.isSendNotification",null==t?void 0:t.isSendNotification).fail(x.INVALID_PARAMETER_IS_SEND_NOTIFICATION).isLimitedString("entry.notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(x.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return o.svr.removeChatroomEntry(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_REMOVE_CHATROOM_ENTRY_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),n),[4,In.create("removeChatroomEntries").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("keys",null==t?void 0:t.keys,10,on,!0).fail(x.INVALID_PARAMETER_KEYS).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(x.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.removeChatroomEntries(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REMOVE_CHATROOM_ENTRIES_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,key:t}),n),[4,In.create("getChatroomEntry").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("key",t,on,!0).fail(x.INVALID_PARAMETER_KEY).result().tryTrans(this.validateConnected).next((function(){return i.svr.getChatroomEntry(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_CHATROOM_ENTRY_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e}),t),[4,In.create("getAllChatroomEntries").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return r.svr.getAllChatroomEntries(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_CHATROOM_ENTRIES_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:t,order:n,timestamp:r}),i),[4,In.create("getChatroomHistoryMessages").validate("roomId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,1,100).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",n,0,1).fail(x.INVALID_PARAMETER_ORDER).isTimestamp("timestamp",r).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return s.svr.getChatroomHistoryMessages(e,r||0,t||20,n||0)}))];case 1:return o=a.sent(),this.logger.summary(B.A_GET_CHATROOM_HISTORY_MESSAGES_R,o,i),[2,o]}}))}))}}),Object.defineProperty(n.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.svr.setCheckChatRoomDuplicateMessage(e)}}),Object.defineProperty(n.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BIND_RTC_FOR_CHATROOM_T,JSON.stringify({option:e}),t),[4,In.create("bindRTCRoomForChatroom").validate("chatRoomId",null==e?void 0:e.chatRoomId,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return r.svr.bindRTCRoomForChatroom(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_BIND_RTC_FOR_CHATROOM_R,n,t),[2,n]}}))}))}}),n}(eb),nb=function(e){e.groupId;var t=e.groupName,n=e.portraitUri,r=e.introduction,i=e.notice;e.extProfile;var o=e.joinPermission,a=e.removeMemberPermission,s=e.invitePermission,u=e.inviteHandlePermission,l=e.groupInfoEditPermission,c=e.memberInfoEditPermission;return JSON.parse(JSON.stringify({name:t,portraitUrl:n,introduction:r,announcement:i,joinPerm:o,removePerm:a,memInvitePerm:s,invitePerm:u,profilePerm:l,memProfilePerm:c}))},rb=function(e){var t,n,r;return{removeMuteStatus:!(null!==(t=null==e?void 0:e.removeMuteStatus)&&void 0!==t&&!t),removeWhiteList:!(null!==(n=null==e?void 0:e.removeWhiteList)&&void 0!==n&&!n),removeFollow:!(null!==(r=null==e?void 0:e.removeFollow)&&void 0!==r&&!r)}},ib=function(e,t,n){return e.validate("groupId",null==t?void 0:t.groupId,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedString("groupName",null==t?void 0:t.groupName,1,64,n).fail(x.INVALID_PARAMETER_GROUP_NAME).isString("portraitUri",null==t?void 0:t.portraitUri).isString("introduction",null==t?void 0:t.introduction).isString("notice",null==t?void 0:t.notice).validate("extProfile",null==t?void 0:t.extProfile,(function(e){if(!At(e))return!1;var t=Object.entries(e);return t.length<=10&&t.every((function(e){var t=u(e,2);t[0];var n=t[1];return Et(n)}))})).isNumberEnum("joinPermission",null==t?void 0:t.joinPermission,v).isNumberEnum("removeMemberPermission",null==t?void 0:t.removeMemberPermission,R).isNumberEnum("invitePermission",null==t?void 0:t.invitePermission,R).isNumberEnum("inviteHandlePermission",null==t?void 0:t.inviteHandlePermission,m).isNumberEnum("groupInfoEditPermission",null==t?void 0:t.groupInfoEditPermission,R).isNumberEnum("memberInfoEditPermission",null==t?void 0:t.memberInfoEditPermission,I).fail(x.INVALID_PARAMETER_GROUP_INFO)},ob=function(e,t,n,r,i){return e.isObject("option",r,i).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("count",null==r?void 0:r.count,1,t,n).fail(x.INVALID_PARAMETER_COUNT).isString("pageToken",null==r?void 0:r.pageToken).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).isBoolean("order",null==r?void 0:r.order).fail(x.INVALID_PARAMETER_ORDER)},ab=function(e){function n(t,n){var r=e.call(this,t)||this;return Object.defineProperty(r,"svr",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"_userProfileEnabled",{enumerable:!0,configurable:!0,writable:!0,value:function(){var e;return 1===(null===(e=r.ctx.naviInfo)||void 0===e?void 0:e.userProfile)?vn():Rn(x.RC_USER_PROFILE_SERVICE_UNAVAILABLE)}}),r}return t(n,e),Object.defineProperty(n.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MY_USER_PROFILE_VISIBILITY_T,e,t),[4,In.create("updateMyUserProfileVisibility").isNumberEnum("visibility",e,he,!0).fail(x.INVALID_PARAMETER_USER_PROFILE_VISIBILITY).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.updateMyUserProfileVisibility(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_UPDATE_MY_USER_PROFILE_VISIBILITY_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_MY_USER_PROFILE_VISIBILITY_T,"",e),[4,this.validateConnected().tryTrans(this._userProfileEnabled).next((function(){return n.svr.getMyUserProfileVisibility()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_MY_USER_PROFILE_VISIBILITY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(n.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T,e,t),[4,In.create("searchUserProfileByUniqueId").isNotEmptyString("uniqueId",e,!0).fail(x.INVALID_PARAMETER_UNIQUE_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.searchUserProfileByUniqueId(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ADD_FRIEND_T,JSON.stringify({userId:e,directionType:t,extra:n}),r),[4,In.create("addFriend").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isNumberEnum("directionType",t,_,!0).fail(x.INVALID_PARAMETER_DIRECTION_TYPE).isLimitedString("extra",n,0,128).fail(x.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.addFriend(e,t,n||"")}))];case 1:return i=a.sent(),this.svr.addFriend(e,t,n||""),this.logger.summary(B.A_ADD_FRIEND_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_DELETE_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),n),[4,In.create("deleteFriends").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,_,!0).fail(x.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.deleteFriends(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_DELETE_FRIENDS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_FRIEND_REQUEST_T,e,t),[4,In.create("acceptFriendRequest").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.acceptFriendRequest(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_ACCEPT_FRIEND_REQUEST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_FRIEND_REQUEST_T,JSON.stringify({userId:e,reason:t}),n),[4,In.create("refuseFriendApplication").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isString("reason",t).fail(x.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.refuseFriendRequest(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REFUSE_FRIEND_REQUEST_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_FRIEND_INFO_T,JSON.stringify({userId:e,remark:t,extProfile:n}),r),[4,In.create("setFriendInfo").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isLimitedString("remark",t,0,64,!0).fail(x.INVALID_PARAMETER_REMARK).validate("extProfile",n,(function(e){if("object"!=typeof n)return!1;var t=Object.entries(n);return!(t.length>10||t.some((function(e){var t=u(e,2);t[0];var n=t[1];return!Et(n)})))})).fail(x.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.setFriendInfo(e,t,n||{})}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_FRIEND_INFO_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_CHECK_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),n),[4,In.create("checkFriends").isLimitedTypedArray("userIds",e,20,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,_,!0).fail(x.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.checkFriends(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_CHECK_FRIENDS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIENDS_T,JSON.stringify({directionType:e,option:t}),n),[4,In.create("getFriends").isNumberEnum("directionType",e,f,!0).fail(x.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE).check((function(e){return ob(e,100,!1,t)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:(null==t?void 0:t.count)||50,pageToken:(null==t?void 0:t.pageToken)||"",order:!!(null==t?void 0:t.order)};return i.svr.getFriends(e,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_FRIENDS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIEND_APPLICATIONS_T,JSON.stringify({option:e,types:t,status:n}),r),[4,In.create("getFriendApplications").check((function(t){return ob(t,100,!1,e)})).check((function(e){e.isTypedArray("types",t,(function(t){return!e.isNumberEnum("type",t,p,!0).isFailed})).fail(x.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE).isTypedArray("status",n,(function(t){return!e.isNumberEnum("status",t,E,!0).isFailed})).fail(x.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:(null==e?void 0:e.count)||50,pageToken:(null==e?void 0:e.pageToken)||"",order:!!(null==e?void 0:e.order)},i=t&&0!==t.length?t:[1,2],a=n&&0!==n.length?n:[0,1,2,3];return o.svr.getFriendApplications(r,i,a)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_FRIEND_APPLICATIONS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIENDS_INFO_T,JSON.stringify({userIds:e}),t),[4,In.create("getFriendsInfo").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getFriendsInfo(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_FRIENDS_INFO_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_FRIENDS_INFO_T,JSON.stringify({nickname:e}),t),[4,In.create("searchFriendsInfo").isLimitedString("nickname",e,1,64,!0).fail(x.INVALID_PARAMETER_NICK_NAME).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.searchFriendsInfo(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SEARCH_FRIENDS_INFO_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_FRIEND_ADD_PERMISSION_T,JSON.stringify({permission:e}),t),[4,In.create("setFriendAddPermission").isNumberEnum("permission",e,h,!0).fail(x.INVALID_PARAMETER_FRIEND_ADD_PERMISSION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.setFriendAddPermission(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SET_FRIEND_ADD_PERMISSION_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIEND_ADD_PERMISSION_T,JSON.stringify({}),e),[4,In.create("getFriendAddPermission").result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getFriendAddPermission()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_FRIEND_ADD_PERMISSION_R,t,e),[2,t]}}))}))}}),Object.defineProperty(n.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_CREATE_GROUP_T,JSON.stringify({groupInfo:e,inviteeUserIds:t}),n),[4,In.create("createGroup").check((function(t){return ib(t,e,!0)})).isLimitedTypedArray("inviteeUserIds",t,30,Ut,!1,0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n=nb(e);return i.svr.createGroup(e.groupId,n,e.extProfile||{},t||[])}))];case 1:return r=o.sent(),this.logger.summary(B.A_CREATE_GROUP_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_GROUP_INFO_T,JSON.stringify({groupInfo:e}),t),[4,In.create("updateGroupInfo").check((function(t){return ib(t,e,!1)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var t=nb(e);return r.svr.updateGroupInfo(e.groupId,t,e.extProfile)}))];case 1:return n=i.sent(),this.logger.summary(B.A_UPDATE_GROUP_INFO_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUPS_INFO_T,JSON.stringify({groupIds:e}),t),[4,In.create("getGroupsInfo").isLimitedTypedArray("groupIds",e,20,Dt,!0,1).fail(x.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getGroupsInfo(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_GROUPS_INFO_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_KICK_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t,config:n}),r),[4,In.create("kickGroupMembers").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.kickGroupMembers(e,t,rb(n))}))];case 1:return i=a.sent(),this.logger.summary(B.A_KICK_GROUP_MEMBERS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_QUIT_GROUP_T,JSON.stringify({groupId:e,config:t}),n),[4,In.create("quitGroup").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.quitGroup(e,rb(t))}))];case 1:return r=o.sent(),this.logger.summary(B.A_QUIT_GROUP_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_DISMISS_GROUP_T,JSON.stringify({groupId:e}),t),[4,In.create("dismissGroup").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.dismissGroup(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_DISMISS_GROUP_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_TRANSFER_GROUP_OWNER_T,JSON.stringify({groupId:e,newOwnerId:t,quit:n,config:r}),i),[4,In.create("transferGroupOwner").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("newOwnerId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.transferGroupOwner(e,t,!!n,rb(r))}))];case 1:return o=a.sent(),this.logger.summary(B.A_TRANSFER_GROUP_OWNER_R,o,i),[2,o]}}))}))}}),Object.defineProperty(n.prototype,"addGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ADD_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),n),[4,In.create("addGroupManagers").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,Ut,!0,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(O.ADD,e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_ADD_GROUP_MANAGERS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"removeGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),n),[4,In.create("removeGroupManagers").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,Ut,!0,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(O.REMOVE,e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REMOVE_GROUP_MANAGERS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t}),n),[4,In.create("getGroupMembers").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.getGroupMembers(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_GROUP_MEMBERS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_SET_GROUP_MEMBER_INFO_T,JSON.stringify({groupId:e,userId:t,nickname:n,extra:r}),i),[4,In.create("setGroupMemberInfo").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("userId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isLimitedString("nickname",n,0,64,!0).fail(x.INVALID_PARAMETER_NICK_NAME).isLimitedString("extra",r,0,128).fail(x.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.setGroupMemberInfo(e,t,n,r)}))];case 1:return o=a.sent(),this.logger.summary(B.A_SET_GROUP_MEMBER_INFO_R,o,i),[2,o]}}))}))}}),Object.defineProperty(n.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_GROUP_MEMBERS_T,JSON.stringify({groupId:e,nickName:t,option:n}),r),[4,In.create("searchGroupMembers").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedString("nickName",t,1,64,!0).fail(x.INVALID_PARAMETER_NICK_NAME).check((function(e){return ob(e,200,!0,n,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var r={count:n.count,pageToken:n.pageToken||"",order:!!n.order};return o.svr.searchGroupMembers(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SEARCH_GROUP_MEMBERS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_MEMBERS_BY_ROLE_T,JSON.stringify({groupId:e,role:t,option:n}),r),[4,In.create("getGroupMembersByRole").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isNumberEnum("role",t,y,!0).fail(x.INVALID_PARAMETER_GROUP_MEMBER_ROLE).isLimitedInteger("count",n.count,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).isString("pageToken",n.pageToken).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).isNumberEnum("filterRobotType",n.filterRobotType,Ve).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:n.count,pageToken:n.pageToken||"",order:!!n.order,filterRobotType:n.filterRobotType||Ve.ALL};return o.svr.getGroupMembersByRole(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_GROUP_MEMBERS_BY_ROLE_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"addGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ADD_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),n),[4,In.create("addGroupFollows").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(O.ADD,e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_ADD_GROUP_FOLLOWS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"removeGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),n),[4,In.create("removeGroupFollows").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(O.REMOVE,e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REMOVE_GROUP_FOLLOWS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_FOLLOWS_T,JSON.stringify({groupId:e}),t),[4,In.create("getGroupFollows").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getGroupFollows(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_GROUP_FOLLOWS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_GROUP_REMARK_T,JSON.stringify({groupId:e,remark:t}),n),[4,In.create("setGroupRemark").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedString("remark",t,0,64,!0).fail(x.INVALID_PARAMETER_REMARK).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupRemark(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SET_GROUP_REMARK_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_JOIN_GROUP_T,JSON.stringify({groupId:e}),t),[4,In.create("joinGroup").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.joinGroup(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_JOIN_GROUP_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_INVITE_USERS_TO_GROUP_T,JSON.stringify({groupId:e,userIds:t}),n),[4,In.create("inviteUsersToGroup").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,30,Ut,!0,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.inviteUsersToGroup(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_INVITE_USERS_TO_GROUP_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"acceptGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t}),n),[4,In.create("acceptGroupInvite").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.memberInviteResponse({groupId:e,inviterId:t,optType:P.APPLICANT,optResult:C.ACCEPT})}))];case 1:return r=o.sent(),this.logger.summary(B.A_ACCEPT_GROUP_INVITE_R,r,n),[2,r.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"refuseGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t,reason:n}),r),[4,In.create("refuseGroupInvite").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isLimitedString("reason",n,0,128).fail(x.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,inviterId:t,optType:P.APPLICANT,optResult:C.REFUSE,reason:n})}))];case 1:return i=a.sent(),this.logger.summary(B.A_REFUSE_GROUP_INVITE_R,i,r),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"acceptGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:n}),r),[4,In.create("acceptGroupApplication").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).validate("inviterId",n,Ut).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n||"",optType:P.MANAGER,optResult:C.ACCEPT})}))];case 1:return i=a.sent(),this.logger.summary(B.A_ACCEPT_GROUP_APPLICATION_R,i,r),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"refuseGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:n,reason:r}),i),[4,In.create("refuseGroupApplication").validate("groupId",e,Dt,!0).fail(x.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).validate("inviterId",n,Ut).fail(x.INVALID_PARAMETER_USER_ID).isLimitedString("reason",r,0,128).fail(x.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n||"",optType:P.MANAGER,optResult:C.REFUSE,reason:r})}))];case 1:return o=a.sent(),this.logger.summary(B.A_REFUSE_GROUP_APPLICATION_R,o,i),[2,o.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_APPLICATIONS_T,JSON.stringify({option:e,directions:t,status:n}),r),i=this.ctx.usingCppEngine,[4,In.create("getGroupApplications").check((function(t){return ob(t,200,!0,e,!0)})).check((function(e){i&&e.isLimitedTypedArray("directions",t,Object.keys(M).length,(function(t){return!e.isNumberEnum("directions",t,M,!0).isFailed}),!0,1).fail(x.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION).isLimitedTypedArray("status",n,Object.keys(N).length,(function(t){return!e.isNumberEnum("status",t,N,!0).isFailed}),!0,1).fail(x.INVALID_PARAMETER_GROUP_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:e.count,pageToken:e.pageToken||"",order:!!e.order};return s.svr.getGroupApplications(r,t||[],n||[])}))];case 1:return o=a.sent(),this.logger.summary(B.A_GET_GROUP_APPLICATIONS_R,o,r),[2,o]}}))}))}}),Object.defineProperty(n.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_JOINED_GROUPS_BY_ROLES_T,JSON.stringify({role:e,option:t}),n),[4,In.create("getJoinedGroupsByRole").isNumberEnum("role",e,y,!0).fail(x.INVALID_PARAMETER_GROUP_MEMBER_ROLE).check((function(e){return ob(e,100,!0,t,!0)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.getJoinedGroupsByRole(e,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_JOINED_GROUPS_BY_ROLES_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_JOINED_GROUPS_T,JSON.stringify({groupName:e,option:t}),n),[4,In.create("searchJoinedGroups").isLimitedString("groupName",e,1,64,!0).fail(x.INVALID_PARAMETER_GROUP_NAME).check((function(e){return ob(e,200,!0,t,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var n={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.searchJoinedGroups(e,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SEARCH_JOINED_GROUPS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_JOINED_GROUPS_T,JSON.stringify({groupIds:e}),t),[4,In.create("getJoinedGroups").isLimitedTypedArray("groupIds",e,20,Dt,!0,1).fail(x.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getJoinedGroups(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_JOINED_GROUPS_R,n,t),[2,n]}}))}))}}),n}(eb),sb=0,ub=function(e){function n(t,n,i){var o=e.call(this,i)||this;return Object.defineProperty(o,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:n}),KE.set(o,void 0),JE.set(o,!1),QE.set(o,!0),XE.set(o,""),Object.defineProperty(o,"_id",{enumerable:!0,configurable:!0,writable:!0,value:++sb}),d(o,KE,r(r({},t),{tagFilter:r({},t.tagFilter)}),"f"),o}return t(n,e),Object.defineProperty(n.prototype,"hasMore",{get:function(){return c(this,QE,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isLoading",{get:function(){return c(this,JE,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"load",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return c(this,JE,"f")?[2,Rn(x.METHOD_BUSY)]:(d(this,JE,!0,"f"),t=this.logger.createTraceId(),this.logger.info(B.A_LOAD_CONVERSATION_LIST_T,JSON.stringify({count:e,loaderId:this._id,pageToken:c(this,XE,"f")}),t),[4,In.create("ConversationListLoader.load").isLimitedInteger("count",e,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){return u._svr.loadConversationList(c(u,XE,"f"),e,c(u,KE,"f"))}))]);case 1:return n=a.sent(),this.logger.summary(B.A_LOAD_CONVERSATION_LIST_R,n,t,{loaderId:this._id},(function(e){return{pageToken:e.pageToken,finished:e.finished}})),d(this,JE,!1,"f"),n.isOk?(r=n.data,i=r.pageToken,o=r.finished,s=r.list,d(this,XE,i,"f"),d(this,QE,!o,"f"),[2,vn(s)]):[2,n.wipe()]}}))}))}}),n}(eb);KE=new WeakMap,JE=new WeakMap,QE=new WeakMap,XE=new WeakMap;var lb,cb,db,_b,fb,hb,gb,pb,Eb,bb=function(e){function n(t,n){var r=e.call(this,t)||this;return ZE.add(r),Object.defineProperty(r,"svr",{enumerable:!0,configurable:!0,writable:!0,value:n}),r}return t(n,e),Object.defineProperty(n.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SAVE_EDITED_MSG_DRAFT_T,JSON.stringify({draft:e,identifier:t}),n),[4,In.create("saveEditedMessageDraft").check((function(e){return cc(e,t,Z)})).isString("draft",null==e?void 0:e.content,!0).fail(x.INVALID_PARAMETER_DRAFT).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateLogin).next((function(){return i.svr.saveEditedMessageDraft(e,c(i,ZE,"m",$E).call(i,t))}))];case 1:return r=o.sent(),this.logger.summary(B.A_SAVE_EDITED_MSG_DRAFT_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,In.create("getEditedMessageDraft").check((function(t){return cc(t,e,Z)})).result().next((function(){return r.svr.getEditedMessageDraft(c(r,ZE,"m",$E).call(r,e))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_EDITED_MSG_DRAFT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,In.create("clearEditedMessageDraft").check((function(t){return cc(t,e,Z)})).result().next((function(){return r.svr.clearEditedMessageDraft(c(r,ZE,"m",$E).call(r,e))}))];case 1:return n=i.sent(),this.logger.summary(B.A_CLEAR_EDITED_MSG_DRAFT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(n.prototype,"createConversationListLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return n=(t=e||{}).conversationTypes,i=t.order,o=t.channelId,s=t.tagFilter,[4,In.create("createConversationListLoader").isTypedArray("conversationTypes",n,(function(e){return te(e,W)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("order",i,0,1).fail(x.INVALID_PARAMETER_ORDER).validate("channelId",o,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).check((function(e){if(s){var t=s.tagIds;e.isLimitedTypedArray("tagIds",t,20,mt,!1,0).fail(x.INVALID_PARAMETER_TAG_ID)}})).result().tryTrans(this.validateConnected).trans((function(){return new ub(r(r({},e),{tagFilter:r({},s)}),u.svr,u.ctx)}))];case 1:return[2,a.sent()]}}))}))}}),Object.defineProperty(n.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),n=null==e?void 0:e.conversationType,this.logger.info(B.A_SEND_UG_TYPING_T,JSON.stringify(e),t),[4,In.create("sendUltraGroupTypingStatus").check((function(t){return cc(t,e,X)})).validate("conversationType",n,(function(){return n===F.ULTRA_GROUP}),!0).fail(x.CONVERSATION_TYPE_NOT_SUPPORT).result().tryTrans(this.validateConnected).next((function(){var t=c(i,ZE,"m",$E).call(i,e);return i.svr.sendUltraGroupTypingStatus(t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SEND_UG_TYPING_R,r,t),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"sendTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_TYPING_STATUS_T,JSON.stringify({identifier:e,typingContentType:t}),n),[4,In.create("sendTypingStatus").check((function(t){return cc(t,e,W)})).isString("typingContentType",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var r={messageType:"RC:TypSts",content:{typingContentType:t}};return i.ctx.sendMessage(e,r,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SEND_TYPING_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"sendSyncReadStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SYNC_READ_STATUS_T,JSON.stringify({identifier:e,timestamp:t}),n),[4,In.create("sendSyncReadStatusMessage").check((function(t){return cc(t,e,W)})).isNumber("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return 1===r.sesDriven?[2,this.svr.updateConversationReadTime(e,t)]:(i={messageType:me.SYNC_READ_STATUS,content:{lastMessageSendTime:t},directionalUserIdList:fn(e.conversationType,[this.ctx.userId])},[4,this.ctx.sendMessage(e,i,n)]);case 1:return[2,o.sent().wipe()]}}))}))}))];case 1:return r=s.sent(),this.logger.summary(B.A_SYNC_READ_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_UNREAD_COUNT_BY_TIME_T,JSON.stringify({identifier:e,timestamp:t}),n),[4,In.create("clearUnreadCountByTimestamp").check((function(t){return cc(t,e,W)})).isTimestamp("timestamp",t).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i.svr.clearUnreadCountByTimestamp(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_CLEAR_UNREAD_COUNT_BY_TIME_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"sendReadReceiptRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_REQ_T,JSON.stringify({identifier:e,messageUId:t}),n),[4,In.create("sendReadReceiptRequest").check((function(t){return cc(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(){var r={messageType:me.READ_RECEIPT_REQUEST,content:{messageUId:t}};return i.ctx.sendMessage(e,r,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_REQ_R,r,n),[2,r.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageUId:t,timestamp:n}),r),[4,In.create("sendReadReceiptMessage").check((function(t){return cc(t,e,$)})).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("timestamp",n,1,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var i={messageType:me.READ_RECEIPT,content:{messageUId:t,lastMessageSendTime:n,type:1}};return o.ctx.sendMessage(e,i,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_R,i,r),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"sendReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageList:t}),n),[4,In.create("sendReadReceipt").check((function(t){return cc(t,e,z)})).fail(x.INVALID_PARAMETER_TARGET_ID).check((function(e){At(t)&&!Object.keys(t).some((function(n){var r=t[n];return e.isLimitedTypedArray("messageList",r,Number.MAX_SAFE_INTEGER,mt,!0).isFailed}))||e.setFailed(x.MSG_LIMIT_ERROR)})).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:return 0!==(i=r.grpRRVer||0)&&1!==i?[2,Rn(x.READ_RECEIPT_ERROR)]:1===i?(o=[],Object.keys(t).forEach((function(e){o.push.apply(o,l([],u(t[e]),!1))})),[2,this.svr.sendReadReceiptV2(e.targetId,o,e.channelId)]):[4,this.ctx.sendMessage(e,{messageType:me.READ_RECEIPT_RESPONSE,content:{receiptMessageDic:t}},n)];case 1:return[2,a.sent().wipe()]}}))}))}))];case 1:return r=s.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_MSG_READER_T,JSON.stringify({targetId:e,messageUId:t,channelId:n}),r),[4,In.create("getMessageReader").validate("targetId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(r){return o(s,void 0,void 0,(function(){return a(this,(function(i){return 1!==r.grpRRVer?[2,Rn(x.READ_RECEIPT_ERROR)]:[2,this.svr.getMessageReader(e,t,n||"")]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_MSG_READER_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,endMsgUid:t,startMsgUid:n}),r),[4,In.create("sendReadReceiptMessageV4").check((function(t){return cc(t,e,W)})).isNotEmptyString("endMsgUid",t,!0).fail(x.INVALID_PARAMETER_END_MESSAGE_UID).isNotEmptyString("startMsgUid",n).fail(x.INVALID_PARAMETER_START_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return o(s,void 0,void 0,(function(){return a(this,(function(i){return 3!==r.grpRRVer?[2,Rn(x.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.sendReadReceiptMessageV4(e,n||"",t)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_V4_R,i,r),[2,i]}}))}))}}),Object.defineProperty(n.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,messageUId:t}),n),[4,In.create("getMessageReadReceiptV4").check((function(t){return cc(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){return a(this,(function(r){return 3!==n.grpRRVer?[2,Rn(x.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.getMessageReadReceiptV4(e,t)]}))}))}))];case 1:return r=s.sent(),this.logger.summary(B.A_GET_READ_RECEIPT_V4_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_BATCH_GET_READ_RECEIPT_INFO_V4_T,JSON.stringify({conversation:e,messageUIds:t}),n),[4,In.create("batchGetMessageReadReceiptInfoV4").check((function(t){return cc(t,e,z)})).isTypedArray("messageUIds",t,mt,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){return a(this,(function(r){return 3!==n.grpRRVer?[2,Rn(x.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}))];case 1:return r=s.sent(),this.logger.summary(B.A_BATCH_GET_READ_RECEIPT_INFO_V4_R,r,n),[2,r]}}))}))}}),Object.defineProperty(n.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T,JSON.stringify({options:e}),t),[4,In.create("getConversationsIncludingRobots").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,2,(function(e){return[F.PRIVATE,F.SYSTEM].includes(e)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var t=r(r({},e),{topPriority:!!e.topPriority});return i.svr.getConversationsIncludingRobots(t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R,n,t),[2,n]}}))}))}}),n}(eb);function Tb(e){return r({},e)}ZE=new WeakSet,zE=function(e){var t;return!!(2&((null===(t=this.ctx.naviInfo)||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e},$E=function(e){return e.conversationType!==F.ULTRA_GROUP?e:r(r({},e),{channelId:c(this,ZE,"m",zE).call(this,e.channelId)})};var vb=function(){function e(e){var t,n,i=this;lb.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,"chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataHosting",{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,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_ugSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[me.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),t[me.INTERCEPT]=this._processInterceptMessage.bind(this),t)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(n={},n[me.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),n[me.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),n[me.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),n)}),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,userSettingsSynced:void 0,userSettingsChanged:void 0,conversationStatusSynced:void 0,robotsSynced: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,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,databaseOpened:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0,readReceiptResponseV5:void 0,speechToTextResponse:void 0,translateResponse:void 0,messagesModified:void 0,messageModifiedSyncCompleted: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:[]}),this._options=r({},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 o={onConnected:function(){return i._onConnectionStatusChange(ge.CONNECTED)},onConnecting:this._onConnectionStatusChange.bind(this,ge.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,ge.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,ge.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),userSettingsSynced:this._onUserSettingsSynced.bind(this),userSettingsChanged:this._onUserSettingsChanged.bind(this),conversationStatusSynced:this._onConversationStatusSynced.bind(this),robotsSynced:this._onRobotsSynced.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),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),databaseOpened:this._databaseOpened.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this),readReceiptResponseV5:this._readReceiptResponseV5.bind(this),speechToTextResponse:this._speechToTextResponse.bind(this),translateResponse:this._translateResponse.bind(this),messagesModified:this._messagesModified.bind(this),messageModifiedSyncCompleted:this._messageModifiedSyncCompleted.bind(this)},a=Vt();this._engine=a?new RCCppEngine(o,this._options):new YE(o,this._options),this.logger=this._engine.logger,this._options.eventLoopBlockingCheck&&cr.start(this.logger),this.sse=new $l(this,a),this.chatroom=new tb(this._engine,this._engine.chatroom),this.dataHosting=new ab(this._engine,this._engine.dataHosting),this.chat=new bb(this._engine,this._engine.chat)}return Object.defineProperty(e,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this._context)return this._context.logger.warn(B.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(B.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(B.L_IMSDK_VER_O,JSON.stringify({commitId:"46a0c133c89d95ba2f200da50ec1ebded4869bbe",version:"5.32.1-c-test-alpha.1"}));var n=this._context._engine;return la.setNetworkStatusListener(n.setNetwork.bind(n)),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 a(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(B.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 n=this.logger.createTraceId();if(this.logger.info(B.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),n),this._pluginInstanseMap[e.tag])return this.logger.warn(B.L_INSTALL_PLUGIN_R,"repeat install",n),this._pluginInstanseMap[e.tag];var r="RCRTC"===e.tag?new rc(this):new nc(this),i=null;try{if(!e.verify(la))return null;i=e.setup(r,la,t)}catch(e){this.logger.error(B.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,n)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(r),this._pluginInstanseMap[e.tag]=i),i}}),Object.defineProperty(e.prototype,"getAppSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.validateLogin().trans((function(e){return new WE(e)}))}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r;this._ugSynced=!1,this.logger.warn(B.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(r=(n=this._watcher).connection)||void 0===r||r.call(n,e,t),this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onconnectionstatechange)||void 0===r||r.call(n,e,t)}))}}),Object.defineProperty(e.prototype,"_processTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._addTypingInfo(Tb(e)),!!this._watcher.typingState}}),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===F.ULTRA_GROUP){var n=e.content.sourceType;if(t.sourceType=n,(n===Ee.MSG_EXPANSION||n===Ee.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(B.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!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,n=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,r=this._engine.userId;n&&Array.isArray(n[r])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,n[r])}}),Object.defineProperty(e.prototype,"_messageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i,o,a,s=this;if(!(null===(i=(r=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(r,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(Tb(e))}catch(e){return s.logger.error(B.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(a=(o=this._watcher).message)||void 0===a||a.call(o,Tb(e),t,n),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=[],o=[],a=[me.READ_RECEIPT,me.READ_RECEIPT_REQUEST,me.READ_RECEIPT_RESPONSE];e.forEach((function(e){var s=r._messageReceiver(e,t,n);s&&a.includes(s.messageType)?o.push(s):s&&i.push(s)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(B.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.forEach((function(e){r._messageProccessor[e.messageType]&&r._messageProccessor[e.messageType](e)}))}}),Object.defineProperty(e.prototype,"_chatroomInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).chatroomState)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).conversationState)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_expansionInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).expansion)||void 0===n||n.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,"_onUserSettingsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userSettingsSynced)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_onUserSettingsChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userSettingsChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_onConversationStatusSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).conversationStatusSynced)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_onRobotsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r;null===(r=(n=this._watcher).robotsSynced)||void 0===r||r.call(n,e,t)}}),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,n;null===(n=(t=this._watcher).typingState)||void 0===n||n.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,n;null===(n=(t=this._watcher).messageBlocked)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_callInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._pluginContextQueue.forEach((function(n){try{n.onCallInfo&&n.onCallInfo(e)}catch(e){t.logger.warn(B.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;this._ugSynced=!0,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(e){var t,n;null===(n=(t=this._watcher).sgRelationsSynced)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_operateStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).operateStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageExpansionUpdatedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageRecalledListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageRecalled)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelChangeTypeListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelChangeType)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelUserKickedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelDeleteListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelDelete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_userGroupStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userGroupStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).messageReadReceipt)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_syncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).syncReadStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedUserStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).subscribedUserStatusChange)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedRelationChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).subscribedRelationChange)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_syncSubscribedUserStatusFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(B.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(n=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ownUserProfileChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(B.L_OWN_USER_PROFILE_CHANGED_S),null===(n=(t=this._watcher).ownUserProfileChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupOperation)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupInfoChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupMemberInfoChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupApplicationEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupApplicationEvent)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupRemarkChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupRemarkChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupFollowsChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupFollowsChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendAdd)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendDelete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendApplicationStatusChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendCleared",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendCleared)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendInfoChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_rtcDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onrtcdatachange)||void 0===r||r.call(n,e,t)}))}}),Object.defineProperty(e.prototype,"_naviDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pluginContextQueue.forEach((function(t){var n;null===(n=t.onnavidatachange)||void 0===n||n.call(t,e)}))}}),Object.defineProperty(e.prototype,"_databaseOpened",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r;null===(r=(n=this._watcher).databaseOpened)||void 0===r||r.call(n,e,t)}}),Object.defineProperty(e.prototype,"_databaseUpgradeWillStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.logger.info(B.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,n;this.logger.info(B.L_DB_UPGRATING_S,e),null===(n=(t=this._watcher).databaseUpgrading)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_databaseUpgradeDidComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(B.L_DB_UPGRATE_COMPLETE_S),null===(n=(t=this._watcher).databaseUpgradeDidComplete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_readReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).readReceiptResponseV5)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_speechToTextResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).speechToTextResponse)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_translateResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).translateResponse)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messagesModified",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).messagesModified)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messageModifiedSyncCompleted",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).messageModifiedSyncCompleted)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"assignWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;Object.keys(this._watcher).forEach((function(n){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];t._watcher[n]=St(r)||At(r)?r: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,n=e.conversationType,r=e.targetId,i=e.content,o=e.channelId,a=i.typingContentType,s=o||"",u="".concat(n,"#").concat(r,"#").concat(s);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===a?this._typingInfo[u][l].timestamp=Date.now():(l>=0&&this._typingInfo[u].splice(l,1),this._typingInfo[u].push({userId:t,messageType:a,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 n=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===n||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.connectedTime}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.serverTime}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.deviceId}}),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.userId}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.connectionStatus}}),Object.defineProperty(e.prototype,"_validateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return 1!==e.userProfile?Rn(x.RC_USER_PROFILE_SERVICE_UNAVAILABLE):vn(e)}}),Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e.checkAuthed(!1)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e.checkAuthed(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkAuthed",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.connectionStatus===ge.CONNECTED||this._engine.userId&&e?vn(this._engine.naviInfo):Rn(x.RC_NET_UNAVAILABLE)}}),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 a(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,c(this,lb,"m",cb).call(this,e,t,n)];case 1:return r=i.sent(),this.logger.summary(B.A_CONNECT_R,r,n,void 0,(function(e){return{userId:e}})),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return this.logger.info(B.A_DISCONNECT_O,JSON.stringify({closeDB:e,disablePush:t})),[2,c(this,lb,"m",db).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_RECONNECT_T,JSON.stringify({reconnectKickEnable:e}),t),[4,c(this,lb,"m",cb).call(this,this.token,!!e,t)];case 1:return n=r.sent(),this.logger.summary(B.A_RECONNECT_R,n,t,void 0,(function(e){return{userId:e}})),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"_channelIdConvert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e!==F.ULTRA_GROUP)return t;var n=this.getNaviInfoFromCache();return!!(2&((null==n?void 0:n.ugDriven)||0))&&!t?"RCDefault":t}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.naviInfo}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,o){void 0===i&&(i=[]),void 0===o&&(o=!1);var a,s,u,l={isPersited:t,isCounted:n,searchProps:i,isStatusMessage:o};a=e,s=l,(u=Rr.get(a))&&!u.isCustom&&console.warn("Builtin message type '".concat(a,"' cannot be registered")),s.isStatusMessage&&(s.isCounted=s.isPersited=!1),Rr.set(a,r(r({},s),{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,"sendMessageByPlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.L_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),r),[4,c(this,lb,"m",fb).call(this,e,t,r,n)];case 1:return i=o.sent(),this.logger.summary(B.L_SEND_MSG_R,i,r,void 0,(function(t){return{messageId:t.messageId,messageUId:t.messageUId,messageType:t.messageType,identifier:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),r),[4,c(this,lb,"m",fb).call(this,e,t,r,n)];case 1:return i=o.sent(),this.logger.summary(B.A_SEND_MSG_R,i,r,void 0,(function(t){return{messageId:t.messageId,messageUId:t.messageUId,messageType:t.messageType,identifier:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"updateMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MSG_EXPANSION_T,JSON.stringify({expansion:e,attrs:t}),n),[4,In.create("updateMessageExpansion").check((function(n){return dc(n,t,Object.keys(e||{}))})).check((function(n){return _c(n,e,t.canIncludeExpansion)})).result().tryTrans(this.validateConnected).next((function(){var i={put:e,mid:t.messageUId},a=r(r({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===F.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(a,i,t.sentTime):c(o,lb,"m",gb).call(o,a,i,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_UPDATE_MSG_EXPANSION_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_MSG_EXPANSION_T,JSON.stringify({keys:e,attrs:t}),n),[4,In.create("removeMessageExpansion").isLimitedTypedArray("keys",e,20,(function(e){return"string"==typeof e&&/^[A-Za-z0-9_=+-]+$/.test(e)}),!0).fail(x.INVALID_PARAMETER_KEYS).check((function(n){return dc(n,t,e)})).result().tryTrans(this.validateConnected).next((function(){var i={del:e,mid:t.messageUId},a=r(r({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===F.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(a,i,t.sentTime):c(o,lb,"m",gb).call(o,a,i,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_REMOVE_MSG_EXPANSION_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeAllMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_ALL_MSG_EXPANSION_T,JSON.stringify({attrs:e}),t),[4,In.create("removeAllMessageExpansion").check((function(t){return dc(t,e,[])})).check((function(t){e.conversationType!==F.ULTRA_GROUP&&t.setFailed(x.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){var n={clear:1,mid:e.messageUId},o=r(r({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)});return e.conversationType===F.ULTRA_GROUP?i._engine.chat.updateUGMessageExpansion(o,n,e.sentTime):c(i,lb,"m",gb).call(i,o,n,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_REMOVE_ALL_MSG_EXPANSION_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=r||this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_V2_T,JSON.stringify({targetId:e,messageUIds:t,channelId:n}),r),[4,In.create("sendReadReceiptV2").validate("targetId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("messageUIds",t,Number.MAX_SAFE_INTEGER,mt,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(r){return o(s,void 0,void 0,(function(){return a(this,(function(i){return 1!==r.grpRRVer?[2,Rn(x.READ_RECEIPT_ERROR,"The read receipt switch is not on, please call the sendMessage method.")]:[2,this._engine.chat.sendReadReceiptV2(e,t,n)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_V2_R,i,r),[2,i]}}))}))}}),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 a(this,(function(t){switch(t.label){case 0:return cr.stop(),this._resetWatcher(),this._engine.destroy(),la.removeNetworkStatusListener(),[4,c(this,lb,"m",db).call(this)];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(B.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){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=null==t?void 0:t.timestamp,r=null==t?void 0:t.count,i=null==t?void 0:t.order,o=null==t?void 0:t.messageType,s=this.logger.createTraceId(),this.logger.info(B.A_GET_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),s),[4,In.create("getHistoryMessage").check((function(t){return cc(t,e,Q)})).isLimitedInteger("timestamp",n,0,Number.MAX_SAFE_INTEGER).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(x.INVALID_PARAMETER_ORDER).isLimitedInteger("count",r,1,100).fail(x.INVALID_PARAMETER_COUNT).isNotEmptyString("messageType",o).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:n||0,count:r||20,order:i||0,messageType:o||""},a=c(l,lb,"m",_b).call(l,e);return l._engine.getHistoryMessage(a,t,!0)}))];case 1:return u=a.sent(),this.logger.summary(B.A_GET_HISTORY_MSG_R,u,s),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_CONTINUOUS_MSGS_T,JSON.stringify({conversation:e,options:t}),n),[4,In.create("getContinuousMessages").check((function(t){return cc(t,e,K)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(x.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateLogin).next((function(){var n=c(i,lb,"m",_b).call(i,e),r={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageType:""};return i._engine.chat.getContinuousMessages(n,r)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_CONTINUOUS_MSGS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_HIS_MSGS_BY_OBJ_NAMES_T,JSON.stringify({conversation:e,option:t}),n),[4,In.create("getHistoryMessagesByObjectNames").check((function(t){return cc(t,e,X)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(x.INVALID_PARAMETER_ORDER).isTypedArray("messageTypes",null==t?void 0:t.messageTypes,mt).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateLogin).next((function(){var n=c(i,lb,"m",_b).call(i,e),r={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageTypes:t.messageTypes||[]};return i._engine.chat.getHistoryMessagesByObjectNames(n,r)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_HIS_MSGS_BY_OBJ_NAMES_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_TOP_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e,channelId:t}),n),[4,In.create("getTopConversationList").isTypedArray("conversationTypes",e,(function(e){return te(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",t,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=Xp(n))&&!this._ugSynced?[2,Rn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTopConversationList(r,e,t)]}))}))}))];case 1:return r=s.sent(),this.logger.summary(B.A_GET_TOP_CONVERSATION_LIST_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e}),t),[4,In.create("getUnreadConversationList").isTypedArray("conversationTypes",e,(function(e){return te(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).next((function(t){return o(r,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=Xp(t))&&!this._ugSynced?[2,Rn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getUnreadConversationList(n,e)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UNREAD_CONVERSATION_LIST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLOCKED_CONVERSATION_LIST_T,"",e),[4,In.create("getBlockedConversationList").result().tryTrans(this.validateConnected).next((function(e){return o(n,void 0,void 0,(function(){var t;return a(this,(function(n){return(t=Xp(e))&&!this._ugSynced?[2,Rn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getBlockedConversationList(t)]}))}))}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_BLOCKED_CONVERSATION_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByPageIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return[4,In.create("getConversationListByPageIndex").isInteger("index",e,!0).fail(x.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",t,!0).fail(x.INVALID_PARAMETER_LIMIT).result().tryTrans(this.validateLogin).next((function(){return n._engine.chat.getConversationListByPageIndex(e,t)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_ALL_CONVERSATION_LIST_T,JSON.stringify({channelId:e}),t),[4,In.create("getAllConversationList").validate("channelId",e,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateLogin).next((function(t){return o(r,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=Xp(t))&&!this._ugSynced?[2,Rn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getAllConversationList(n,e)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_ALL_CONVERSATION_LIST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_LIST_OLD_T,JSON.stringify(e),t),[4,Vt()&&"string"!=typeof(null==e?void 0:e.channelId)?this.getAllConversationList(null==e?void 0:e.channelId):this.getConversationListByTimestamp(e)];case 1:return n=r.sent(),this.logger.summary(B.A_GET_CONVERSATION_LIST_OLD_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_LIST_BY_TIME_T,JSON.stringify(e),t),[4,In.create("getConversationListByTimestamp").isObject("params",e,!0).fail(x.CONVER_GET_ERROR,"params must be an object").isInteger("startTime",null==e?void 0:e.startTime,!0).fail(x.INVALID_PARAMETER_START_TIME).isInteger("count",null==e?void 0:e.count,!0).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==e?void 0:e.order,0,1).fail(x.INVALID_PARAMETER_ORDER).validate("channelId",null==e?void 0:e.channelId,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,(function(e){return te(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans((function(){return r.checkAuthed(Vt())})).next((function(t){return o(r,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=Xp(t))&&!this._ugSynced?[2,Rn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getConversationListByTimestamp(e,n)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_CONVERSATION_LIST_BY_TIME_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_T,JSON.stringify(e),t),[4,In.create("getConversation").check((function(t){return cc(t,e,Q)})).result().tryTrans(this.validateConnected).next((function(){var t=c(r,lb,"m",_b).call(r,e);return r._engine.chat.getConversation(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_CONVERSATION_R,n,t,e),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CONVERSATION_T,JSON.stringify(e),n),[4,In.create("removeConversation").check((function(t){return cc(t,e,J)})).result().tryTrans(this.validateConnected).next((function(){var n=c(i,lb,"m",_b).call(i,e);return i._engine.chat.batchDeleteConversations({identifiers:[n],deleteRemotely:!!t,deleteMessages:!1})}))];case 1:return r=o.sent(),this.logger.summary(B.A_REMOVE_CONVERSATION_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,s,u=this;return a(this,(function(l){switch(l.label){case 0:return t=null==e?void 0:e.identifiers,n=!!(null==e?void 0:e.deleteRemotely),r=!!(null==e?void 0:e.deleteMessages),i=this.logger.createTraceId(),this.logger.info(B.A_BATCH_DEL_CONVERS_T,JSON.stringify({identifiers:t,deleteRemotely:n,deleteMessages:r}),i),[4,In.create("batchDeleteConversations").isLimitedArray("identifiers",t,100,!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected).next((function(){return o(u,void 0,void 0,(function(){var e,i=this;return a(this,(function(o){return 0===(e=t.filter((function(e){return lc("",e,J).result().isOk})).map((function(e){return c(i,lb,"m",_b).call(i,e)}))).length?[2,vn()]:[2,this._engine.chat.batchDeleteConversations({identifiers:e,deleteRemotely:n,deleteMessages:r})]}))}))}))];case 1:return s=l.sent(),this.logger.summary(B.A_BATCH_DEL_CONVERS_R,s,i),[2,s.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return t=null==e?void 0:e.targetId,n=null==e?void 0:e.channelType,r=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_LIST_T,JSON.stringify({targetId:t,channelType:n}),r),[4,In.create("getUltraGroupList").validate("targetId",t,Ut).fail(x.INVALID_PARAMETER_TARGET_ID).isNumberEnum("channelType",n,ne).fail(x.INVALID_PARAMETER_CHANNEL_TYPE).result().tryTrans(this.validateLogin).next((function(){return o(s,void 0,void 0,(function(){return a(this,(function(t){return this._ugSynced?[2,this._engine.chat.getUltraGroupList(e)]:[2,Rn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_UG_LIST_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLOCKED_UG_LIST_T,"",e),[4,In.create("getBlockedUGList").result().tryTrans(this.validateConnected).next((function(){return o(n,void 0,void 0,(function(){return a(this,(function(e){return this._ugSynced?[2,this._engine.chat.getBlockedUGList()]:[2,Rn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_BLOCKED_UG_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_UNREAD_COUNT_T,JSON.stringify(e),t),[4,In.create("clearUnreadCount").check((function(t){return cc(t,e,X)})).result().tryTrans((function(){return r.checkAuthed(e.conversationType!==F.ULTRA_GROUP)})).next((function(){return o(r,void 0,void 0,(function(){var t;return a(this,(function(n){return e.conversationType!==F.ULTRA_GROUP||this._ugSynced?(t=c(this,lb,"m",_b).call(this,e),[2,this._engine.chat.clearConversationUnreadCount(t)]):[2,Rn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_CLEAR_UNREAD_COUNT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_ALL_UNREAD_COUNT_T,null,e),[4,In.create("clearAllUnreadCount").result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.chat.clearAllSGUnreadCount()]}))}))}))];case 1:return t=r.sent(),this.logger.summary(B.A_CLEAR_ALL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_COUNT_T,JSON.stringify(e),t),[4,In.create("getUnreadCount").check((function(t){return cc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return o(r,void 0,void 0,(function(){var t;return a(this,(function(n){return e.conversationType!==F.ULTRA_GROUP||this._ugSynced?(t=c(this,lb,"m",_b).call(this,e),[2,this._engine.chat.getConversationUnreadCount(t)]):[2,Rn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UNREAD_COUNT_R,n,t,void 0,(function(e){return{unreadCount:e}})),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_TOTAL_UNREAD_COUNT_T,JSON.stringify({conversationTypes:e,includeMuted:t,channelId:n}),r),[4,In.create("getTotalUnreadCount").validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",e,(function(e){return te(e,X)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin).next((function(r){return o(s,void 0,void 0,(function(){var i,o;return a(this,(function(a){return!(i=Xp(r))&&e&&e.includes(F.ULTRA_GROUP)?[2,Rn(x.METHOD_NOT_SUPPORT)]:(o=e&&e.length>0?e:ee(i?J:W)).includes(F.ULTRA_GROUP)&&!this._ugSynced?[2,Rn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCount(o,!!t,n)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_TOTAL_UNREAD_COUNT_R,i,r,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T,JSON.stringify({conversationTypes:e,levels:t,isMentioned:n}),r),[4,In.create("getTotalUnreadCountByLevels").isLimitedTypedArray("conversationTypes",e,20,(function(e){return te(e,J)}),!0).fail(x.CONVERSATION_TYPE_NOT_SUPPORT).isTypedArray("levels",t,Lt,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(s,void 0,void 0,(function(){return a(this,(function(r){return e.includes(F.ULTRA_GROUP)&&!this._ugSynced?[2,Rn(x.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCountByLevels(e,t,n)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R,i,r,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FIRST_UNREAD_MEG_T,JSON.stringify(e),t),[4,In.create("getFirstUnreadMessage").check((function(t){return cc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(r,lb,"m",_b).call(r,e);return r._engine.chat.getFirstUnreadMessage(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_FIRST_UNREAD_MSG_R,n,t,e),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,In.create("getFirstUnreadMessageDigest").check((function(t){return cc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(r,lb,"m",_b).call(r,e);return r._engine.chat.getFirstUnreadMessageDigest(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_FIRST_UNREAD_MSG_DIGEST_R,n,t,e),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:t}),n),[4,In.create("batchSetConversationNotificationLevel").isLimitedTypedArray("conversations",e,20,(function(e){return!lc("batchSetConversationNotificationLevel",e,J).isFailed}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("notificationLevel",t,Re,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var n=e.map((function(e){return c(i,lb,"m",_b).call(i,e)}));return i._engine.chat.batchSetConversationNotificationLevel(n,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return i=In.create("batchSetConversationToTop"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return lc("batchSetConversationToTop",e,J).result().isOk}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==F.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?vn():Rn(x.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(s=this.logger.createTraceId(),u=e.map((function(e){return c(d,lb,"m",_b).call(d,e)})),this.logger.info(B.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:u,isTop:t,isUpdateTime:n,isCreateConversation:r}),s),[4,this._engine.chat.batchSetConversationToTop(u,t,n,r)]):[2,o.wipe()];case 1:return l=a.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_TO_TOP_R,l,s),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return n=In.create("batchSetConversationTranslateStrategy"),(r=n.isLimitedTypedArray("conversations",e,20,(function(e){return lc("",e,J).result().isOk}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("strategy",t,wr,!0).fail(x.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),this.logger.info(B.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:t}),i),o=e.map((function(e){return c(u,lb,"m",_b).call(u,e)})),[4,this._engine.chat.batchSetConversationTranslateStrategy(o,t)]):[2,r.wipe()];case 1:return s=a.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return[4,lc("saveTextMessageDraft",e,X).isString("draft",t,!0).fail(x.INVALID_PARAMETER_DRAFT).result().tryTrans(this.validateLogin).next((function(){var r=c(n,lb,"m",_b).call(n,e);return n._engine.saveTextMessageDraft(r,t)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return a(this,(function(n){switch(n.label){case 0:return[4,lc("getTextMessageDraft",e,X).result().tryTrans(this.validateLogin).next((function(){var n=c(t,lb,"m",_b).call(t,e);return t._engine.getTextMessageDraft(n)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return a(this,(function(n){switch(n.label){case 0:return[4,lc("clearTextMessageDraft",e,X).result().tryTrans(this.validateLogin).next((function(){var n=c(t,lb,"m",_b).call(t,e);return t._engine.clearTextMessageDraft(n)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"recallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),r={conversation:e,messageUId:null==t?void 0:t.messageUId},this.logger.info(B.A_RECALL_MESSAGE_T,JSON.stringify(r),n),[4,In.create("recallMessage").check((function(t){return cc(t,e,Q)})).isNotEmptyString("messageUId",t.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(x.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(x.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(x.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,Ut,!1,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){var n=c(o,lb,"m",_b).call(o,e);return o._engine.recallMsg(n,t)}))];case 1:return i=a.sent(),this.logger.summary(B.A_RECALL_MESSAGE_R,i,n,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_DEL_REMOTE_MSGS_T,JSON.stringify({conversation:e,messages:t}),n),[4,In.create("deleteRemoteMessage").check((function(t){return cc(t,e,J)})).isLimitedTypedArray("messages",t,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,n=e.sentTime,r=e.messageDirection;return mt(t)&&(r===be.SEND||r===be.RECEIVE)&&vt({min:0})(n)}),!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var n=c(i,lb,"m",_b).call(i,e);return i._engine.chat.deleteRemoteMessage(n,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_DEL_REMOTE_MSGS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_DEL_REMOTE_MSGS_T,JSON.stringify({identifier:e,timestamp:t}),n),[4,In.create("deleteRemoteMessageByTimestamp").check((function(t){return cc(t,e,Q)})).isInteger("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var n=c(i,lb,"m",_b).call(i,e);return i._engine.chat.deleteRemoteMessageByTimestamp(n,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_DEL_REMOTE_MSGS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var u=this;return a(this,(function(l){return[2,In.create("getFileToken").isNumberEnum("fileType",e,q,!0).fail(x.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(x.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).validate("httpMethod",n,(function(e){return"POST"===e||"PUT"===e})).fail(x.BIZ_ERROR_INVALID_PARAMETER,"`httpMethod` is invalid").isString("queryString",r).fail(x.BIZ_ERROR_INVALID_PARAMETER,"`queryString` is invalid").isString("url",i).fail(x.BIZ_ERROR_INVALID_PARAMETER,"`url` is invalid").isInteger("size",s).fail(x.BIZ_ERROR_INVALID_PARAMETER,"`size` is invalid").result().tryTrans(this.validateConnected).next((function(l){return o(u,void 0,void 0,(function(){var o,u;return a(this,(function(a){switch(a.label){case 0:return o=l.uploadServer||"",u=l.ossConfig||"",[4,this._engine.getFileToken(e,t,n,r,i,s)];case 1:return[2,a.sent().trans((function(e){return Object.assign(e,{qiniu:o,ossConfig:e.ossConfig||u})}))]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var o=this;return a(this,(function(a){switch(a.label){case 0:return[4,In.create("getFileUrl").isNumberEnum("fileType",e,q,!0).fail(x.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(x.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).isString("saveName",i).fail(x.INVALID_PARAMETER_SAVE_NAME).isNumberEnum("serverType",r,n,!0).fail(x.INVALID_PARAMETER_SERVER_TYPE).result().tryTrans(this.validateConnected).next((function(){return o._engine.getFileUrl(e,r,t,i||"")}))];case 1:return[2,a.sent()]}}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,In.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(x.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return r._engine.createTag(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_ADD_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t),[4,In.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((function(){return r._engine.removeTag(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_REMOVE_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,In.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(x.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return r._engine.updateTag(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_UPDATE_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_TAGS_T,"",e),[4,this.validateLogin().next((function(){return n._engine.getTagList()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_TAGS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return(n=In.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",t,(function(e){return lc("",e,W).result().isOk}),!0).fail(x.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==t?void 0:t.length,1,1e3,!0).fail(x.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(r=t.map((function(e){return c(s,lb,"m",_b).call(s,e)})),i=this.logger.createTraceId(),this.logger.info(B.A_ADD_TAG_FOR_CONVERSATIONS_T,JSON.stringify({tagId:e,conversations:r}),i),[4,this._engine.chat.addTagForConversations(e,r)]):[2,n.wipe()];case 1:return o=a.sent(),this.logger.summary(B.A_ADD_TAG_FOR_CONVERSATIONS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return(n=In.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",t,1e3,(function(e){return lc("",e,W).result().isOk}),!0).fail(x.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected)).isOk?(r=t.map((function(e){return c(s,lb,"m",_b).call(s,e)})),i=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_TAG_FOR_CONVERS_T,JSON.stringify({tagId:e,conversations:r}),i),[4,this._engine.chat.removeTagForConversations(e,r)]):[2,n.wipe()];case 1:return o=a.sent(),this.logger.summary(B.A_REMOVE_TAG_FOR_CONVERS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return(n=lc("removeTagsForConversation",e,W).isTypedArray("tagIds",t,(function(e){return Et(e)}),!0).fail(x.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected)).isOk?(r=this.logger.createTraceId(),i=c(this,lb,"m",_b).call(this,e),this.logger.info(B.A_REMOVE_TAGS_FOR_CONVER_T,JSON.stringify({tagIds:t,conversation:i}),r),[4,this._engine.chat.removeTagsForConversation(i,t)]):[2,n.wipe()];case 1:return o=a.sent(),this.logger.summary(B.A_REMOVE_TAGS_FOR_CONVER_R,o,r),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){return(r=In.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isInteger("count",n,!0).fail(x.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",t,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_START_TIME).result().tryTrans((function(){return o.checkAuthed(Vt())}))).isOk?(i=n<=0?20:Math.min(n,1e3),[2,this._engine.chat.getConversationListByTag(e,t,i)]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:t}),n),[4,In.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",t,!0).fail(x.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.getUnreadCountByTag(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_UNREAD_COUNT_BY_TAG_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return(r=lc("setConversationStatusInTag",t,W).isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==n?void 0:n.isTop,!0).fail(x.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),o=c(this,lb,"m",_b).call(this,t),this.logger.info(B.A_SET_CONVER_TO_TOP_IN_TAG_T,JSON.stringify({tagId:e,conversation:o,isTop:n.isTop}),i),[4,this._engine.chat.setConversationStatusInTag(e,o,n)]):[2,r.wipe()];case 1:return s=a.sent(),this.logger.summary(B.A_SET_CONVER_TO_TOP_IN_TAG_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return(t=lc("getTagsForConversation",e,W).result().tryTrans(this.validateLogin)).isOk?(n=this.logger.createTraceId(),r=c(this,lb,"m",_b).call(this,e),this.logger.info(B.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(r),n),[4,this._engine.chat.getTagsForConversation(r)]):[2,t.wipe()];case 1:return i=o.sent(),this.logger.summary(B.A_GET_TAGS_OF_CONVERSATION_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTIONED_COUNT_T,JSON.stringify(e),t),[4,In.create("getUnreadMentionedCount").check((function(t){return cc(t,e,Z)})).result().tryTrans(this.validateLogin).next((function(){return o(r,void 0,void 0,(function(){var t;return a(this,(function(n){return e.conversationType!==F.ULTRA_GROUP||this._ugSynced?(t=c(this,lb,"m",_b).call(this,e),[2,this._engine.chat.getUnreadMentionedCount(t)]):[2,Rn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UNREAD_MENTIONED_COUNT_R,n,t),[2,n.trans(Dc)]}}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_ALL_UNREAD_MENTIONED_COUNT_T,"",e),[4,this.validateLogin().next((function(){return n._engine.chat.getAllUnreadMentionedCount()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_ALL_UNREAD_MENTIONED_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),r=t instanceof Array?t.map((function(e){return null==e?void 0:e.messageUId})):[],i=null==e?void 0:e.conversationType,o=null==e?void 0:e.targetId,s=null==e?void 0:e.channelId,this.logger.info(B.A_GET_UG_MSGS_BY_UID_T,JSON.stringify({conversationType:i,targetId:o,channelId:s,messageUIds:r}),n),[4,In.create("getUltraGroupMessageListByMessageUId").check((function(t){return cc(t,e,J)})).isTypedArray("messages",t,(function(e){return mt(null==e?void 0:e.messageUId)}),!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messages",null==t?void 0:t.length,1,20,!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var n=c(l,lb,"m",_b).call(l,e);return l._engine.chat.getRemoteMessagesByUIds(n,t.map((function(e){return e.messageUId})))}))];case 1:return u=a.sent(),this.logger.summary(B.A_GET_UG_MSGS_BY_UID_R,u,n,u.isOk?{list:u.data.map((function(e){return e.messageUId}))}:void 0),[2,u.trans((function(e){var t={};return e.forEach((function(e){t[e.messageUId]=e})),t}))]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,s=this;return a(this,(function(u){switch(u.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T,JSON.stringify({targetId:e,levels:n,isGetMentioned:t}),r),[4,In.create("getUGUnreadCountForAllChannels").validate("targetId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).check((function(e){e.isTypedArray("levels",n,(function(t){return!e.isNumberEnum("",t,Re,!0).isFailed}))})).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(s,void 0,void 0,(function(){return a(this,(function(r){return this._ugSynced?[2,this._engine.chat.getUGUnreadCountForAllChannels(e,n||[],t)]:[2,Rn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return t=null==e?void 0:e.targetId,n=null==e?void 0:e.channelId,r=null==e?void 0:e.sentTime,i=null==e?void 0:e.count,o=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_MENTIONED_DIGEST_T,JSON.stringify({targetId:t,channelId:n,sentTime:r,count:i}),o),[4,In.create("getUGUnreadMentionedDigest").validate("targetId",t,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isLimitedInteger("count",i,1,50,!0).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("sentTime",r,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return e.channelId=u._channelIdConvert(F.ULTRA_GROUP,n),u._engine.chat.getUGUnreadMentionedDigest(e)}))];case 1:return s=a.sent(),this.logger.summary(B.A_GET_UG_UNREAD_MENTIONED_DIGEST_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i=this;return a(this,(function(s){switch(s.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,In.create("getUGFirstUnreadMessageDigest").validate("targetId",null==e?void 0:e.targetId,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==e?void 0:e.channelId,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){return o(i,void 0,void 0,(function(){var t;return a(this,(function(n){return this._ugSynced?(t=c(this,lb,"m",_b).call(this,r(r({},e),{conversationType:F.ULTRA_GROUP})),[2,this._engine.chat.getUGFirstUnreadMessageDigest(t)]):[2,Rn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return n=s.sent(),this.logger.summary(B.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_INFO_LIST_T,JSON.stringify({targetIds:e}),t),[4,In.create("getUGUnreadInfoList").isLimitedTypedArray("targetIds",e,20,(function(e){return Ut(e)}),!0,1).fail(x.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateLogin).next((function(){return o(r,void 0,void 0,(function(){var t;return a(this,(function(n){return this._ugSynced?(t=new Set(e),[2,this._engine.chat.getUGUnreadInfoList(Array.from(t))]):[2,Rn(x.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UG_UNREAD_INFO_LIST_R,n,t),[2,n]}}))}))}}),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,n){var r=this;return this.validateConnected().next((function(){return r._engine.setCallInfo(e,t,n)}))}}),Object.defineProperty(e.prototype,"_validateSubDriven",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=e.subDriven,r=void 0===n?0:n;switch(t){case _e.ONLINE_STATUS:return 1&r?vn(e):Rn(x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);case _e.USER_PROFILE:return 2&r?vn(e):Rn(x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);default:return Rn(x.INVALID_PARAMETER_SUBSCRIBE_TYPE)}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t,expiry:n}),r),[4,In.create("subscribeUser").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,_e,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("expiry",n,60,2592e3,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_EXPIRY).result().tryTrans(this.validateConnected).tryTrans((function(e){return o._validateSubDriven(e,t)})).next((function(){return o._engine.subscribeUser(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SUBSCRIBE_USER_STATUS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_UNSUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t}),n),[4,In.create("unSubscribeUser").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,_e,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_TYPE).result().tryTrans(this.validateConnected).tryTrans((function(e){return i._validateSubDriven(e,t)})).next((function(){return i._engine.unSubscribeUser(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_UNSUBSCRIBE_USER_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_SUBSCRIBE_USER_STATUS_LIST_T,JSON.stringify({subscribeType:e,count:t,offset:n}),r),[4,In.create("getSubscribeUserList").isNumberEnum("subscribeType",e,_e,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("count",t,1,200,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE).isLimitedInteger("offset",n,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_OFFSET).result().tryTrans(this.validateConnected).tryTrans((function(t){return o._validateSubDriven(t,e)})).next((function(){return o._engine.getSubscribeUserList(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_SUBSCRIBE_USER_STATUS_LIST_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_SUB_USERS_STATUS_T,JSON.stringify({subscribeType:e,userIds:t}),n),[4,In.create("getSubscribeUserStatus").isNumberEnum("subscribeType",e,_e,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedTypedArray("userIds",t,200,Ut,!0).fail(x.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).result().tryTrans(this.validateConnected).tryTrans((function(t){return i._validateSubDriven(t,e)})).next((function(){return i._engine.getSubscribeUserStatus(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_SUB_USERS_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_SUB_USERS_ONLINE_STATUS_T,JSON.stringify({userIds:e}),t),[4,In.create("getSubscribeUsersOnlineStatus").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){return r._engine.getSubscribeUsersOnlineStatus(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_SUB_USERS_ONLINE_STATUS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MY_USER_PROFILE_T,JSON.stringify({profile:e}),t),[4,In.create("updateMyUserProfile").isObject("profile",e,!0).check((function(t){var n=e.name,r=e.portraitUri,i=e.email,o=e.birthday,a=e.gender,s=e.location,l=e.role,c=e.level,d=e.extraProfile;t.isString("name",n).isString("portraitUri",r).isString("email",i).isString("birthday",o).isNumber("gender",a).isString("location",s).isNumber("role",l).isNumber("level",c).isObject("extraProfile",d),!t.isFailed&&d&&Object.entries(d).forEach((function(e){var n=u(e,2);n[0];var r=n[1];t.isString("extraProfile",r,!0)}))})).fail(x.INVALID_PARAMETER_USER_PROFILE).result().tryTrans(this.validateConnected).tryTrans((function(e){return i._validateUserProfile(e)})).next((function(){var t={};return["name","portraitUri","email","birthday","gender","location","role","level"].forEach((function(n){var r=e[n];void 0!==r&&(t[n]=r)})),e.extraProfile&&(t.extraProfile=r({},e.extraProfile)),i._engine.updateMyUserProfile(t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_UPDATE_MY_USER_PROFILE_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_USER_PROFILES_T,JSON.stringify({userIds:e}),t),[4,In.create("getUserProfiles").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateLogin).tryTrans((function(e){return r._validateUserProfile(e)})).next((function(){return r._engine.getUserProfiles(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_USER_PROFILES_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_MY_USER_PROFILE_T,void 0,e),[4,In.create("getMyUserProfile").result().tryTrans(this.validateConnected).tryTrans((function(e){return n._validateUserProfile(e)})).next((function(){return n._engine.getMyUserProfile()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_MY_USER_PROFILE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.chat.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){n.logger.error(B.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(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ADD_TO_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,In.create("addToBlacklist").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return r._engine.addToBlacklist(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_ADD_TO_BLACKLIST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_FROM_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,In.create("removeFromBlacklist").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return r._engine.removeFromBlacklist(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_REMOVE_FROM_BLACKLIST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLACKLIST_T,void 0,e),[4,In.create("getBlacklist").result().tryTrans(this.validateConnected).next((function(){return n._engine.getBlacklist()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_BLACKLIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_BLACKLIST_STATUS_T,JSON.stringify({userId:e}),t),[4,In.create("getBlacklistStatus").validate("userId",e,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return r._engine.getBlacklistStatus(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_BLACKLIST_STATUS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_INSERT_MSG_T,JSON.stringify({conversation:e,params:t}),n),[4,In.create("insertMessage").check((function(t){return cc(t,e,X)})).validate("senderUserId",t.senderUserId,Ut,!0).fail(x.INVALID_PARAMETER_USER_ID).isNotEmptyString("messageType",t.messageType,!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t.content,!0).fail(x.INVALID_PARAMETER_MESSAGE_CONTENT).isNumberEnum("messageDirection",t.messageDirection,be,!0).fail(x.INVALID_MESSAGE_DIRECTION).check((function(e){t.canIncludeExpansion&&t.expansion&&_c(e,t.expansion,!0)})).isTimestamp("sentTime",t.sentTime).fail(x.INVALID_PARAMETER_TIMESTAMP).isNumberEnum("sentStatus",t.sentStatus,ue).fail(x.INVALID_PARAMETER_SENT_STATUS).isTypedArray("directedUserIds",t.directedUserIds,Ut).fail(x.INVALID_PARAMETER_USERIDLIST).isString("searchContent",t.searchContent).fail(x.SEARCH_PROPS_LIMIT_ERROR).result().tryTrans((function(){return uc(t.messageType,t.content)})).tryTrans(this.validateLogin).next((function(){var n=c(i,lb,"m",_b).call(i,e);return i._engine.insertMessage(n,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_INSERT_MSG_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_BATCH_INSERT_MSGS_T,JSON.stringify({count:null==e?void 0:e.length,checkDuplicate:t}),n),i=In.create(""),[4,In.create("batchInsertMessage").isLimitedTypedArray("messages",e,500,(function(e){return"object"==typeof e&&(cc(i,e,X),i.validate("senderUserId",e.senderUserId,Ut,!0).isNotEmptyString("messageType",e.messageType,!0).isObject("content",e.content,!0).isNumberEnum("messageDirection",e.messageDirection,be,!0).check((function(t){e.canIncludeExpansion&&e.expansion&&_c(t,e.expansion,!0)})).isTimestamp("sentTime",e.sentTime).isNumberEnum("sentStatus",e.sentStatus,ue).isString("searchContent",e.searchContent).isNumber("receivedStatus",e.receivedStatus).isObject("receivedStatusInfo",e.receivedStatusInfo).isTypedArray("directedUserIds",e.directedUserIds,Ut),!i.isFailed)}),!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateLogin).next((function(){var n=e.map((function(e){return r(r({},e),{channelId:s._channelIdConvert(e.conversationType,e.channelId)})}));return s._engine.batchInsertMessage(n,t)}))];case 1:return o=a.sent(),this.logger.summary(B.A_BATCH_INSERT_MSGS_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_LOCAL_MSG_COUNT_T,JSON.stringify({conversation:e}),t),[4,In.create("getMessageCount").check((function(t){return cc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(r,lb,"m",_b).call(r,e);return r._engine.getLocalMessageCount(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_LOCAL_MSG_COUNT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_DELETE_LOCAL_MSGS_T,JSON.stringify({messageIds:e}),t),[4,In.create("deleteLocalMessages").isTypedArray("messageIds",e,(function(e){return Number.isInteger(e)}),!0).fail(x.INVALID_PARAMETER_MESSAGE_ARRAY).result().tryTrans(this.validateLogin).next((function(){return r._engine.deleteLocalMessages(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_DELETE_LOCAL_MSGS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DEL_LOCAL_MSGS_BY_TIME_T,JSON.stringify({conversation:e,timestamp:t,cleanSpace:n}),r),[4,In.create("deleteLocalMessagesByTimestamp").check((function(t){return cc(t,e,X)})).isTimestamp("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){var r=c(o,lb,"m",_b).call(o,e);return o._engine.deleteLocalMessagesByTimestamp(r,t,!!n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_DEL_LOCAL_MSGS_BY_TIME_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T,JSON.stringify({options:e}),t),[4,In.create("batchClearLocalMessagesByTimestamp").check((function(t){t.isLimitedTypedArray("options",e,20,(function(e){return cc(t,e,J),!t.isFailed&&vt({min:0})(e.timestamp)})).fail(x.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return r(r({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)})}));return i._engine.batchClearLocalMessagesByTimestamp(t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),n),[4,In.create("batchClearRemoteHistoryMessages").isLimitedArray("options",e,20,!0,1).check((function(t){e.forEach((function(e){cc(t,e,J).isTimestamp("timestamp",null==e?void 0:e.timestamp)}))})).fail(x.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,void 0,!0).check((function(t){e.some((function(e){return e.conversationType===F.ULTRA_GROUP}))&&t.setFailed(x.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.batchClearRemoteHistoryMessages(e,!!t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_BATCH_CLEAR_REMOTE_MSG_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_LOCAL_MSG_T,JSON.stringify({conversation:e}),t),[4,In.create("clearLocalMessages").check((function(t){return cc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return r._engine.clearLocalMessages(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_CLEAR_LOCAL_MSG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),t),[4,In.create("getLocalMessage").validate("messageId",e,(function(){return mt(e)||Tt(e)}),!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).result().next((function(){return r._engine.getMessage(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_LOCAL_MESSAGE_R,n,t,{messageId:e}),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"_innerSetMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.setMessageContent(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_MSG_CONTENT_T,JSON.stringify({messageId:e,messageType:n}),r),[4,In.create("setMessageContent").isInteger("messageId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).isNotEmptyString("messageType",n,!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_CONTENT).result().tryTrans(this.validateLogin).next((function(){var r=JSON.stringify(t);return o._innerSetMessageContent(e,r,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_MSG_CONTENT_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.setMessageSearchField(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_E_SET_MSG_SENT_STATUS_T,JSON.stringify({messageId:e,sentStatus:t}),n),[4,In.create("setMessageSentStatus").isInteger("messageId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).isNumberEnum("sentStatus",t,ue,!0).fail(x.INVALID_PARAMETER_SENT_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageSentStatus(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_E_SET_MSG_SENT_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_E_SET_MSG_RECEIVED_STATUS_T,JSON.stringify({messageId:e,receivedStatus:t}),n),[4,In.create("setMessageReceivedStatus").isInteger("messageId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).isInteger("receivedStatus",t,!0).fail(x.INVALID_PARAMETER_RECEIVED_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageReceivedStatus(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_E_SET_MSG_RECEIVED_STATUS_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setMessageStatusToRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(n=lc("setMessageStatusToRead",e,W).isNumber("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(r=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,s=e.channelId,this.logger.info(B.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),r),[4,this._engine.updateMessageReceiptStatus(i,o,t,s)]):[2,n.wipe()];case 1:return u=a.sent(),this.logger.summary(B.A_E_SET_MESSAGE_STATUS_TO_READ_R,u,r),[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 a(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 a(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 a(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return(i=In.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(x.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return mt(e)})).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",r,(function(e){return te(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(B.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:t,channelId:n,conversationTypes:r}),o),[4,this._engine.chat.searchConversationByContent(e,t&&0!==t.length?t:[me.TEXT,me.FILE],n||"",r&&0!==r.length?r:ee(J))]):[2,i.wipe()];case 1:return s=a.sent(),this.logger.summary(B.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[me.TEXT,me.FILE],n&&0!==n.length?n:ee(J))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,i;return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return(o=lc("searchMessages",e,X).isLimitedString("keyword",null==t?void 0:t.keyword,0,1e3,!0).fail(x.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==t?void 0:t.limit,1,dt,!0).fail(x.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==t?void 0:t.offset,0,dt).fail(x.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==t?void 0:t.order,0,1,!0).fail(x.INVALID_PARAMETER_ORDER).isObject("timeRange",t.timeRange).validate("timeRange",t.timeRange,(function(e){var t=e.startTime,n=e.endTime;return!t&&!n||!(t&&!Tt(t)||n&&!Tt(n))&&(t=null!=t?t:0,n=null!=n?n:Date.now(),t>=0&&t<=n)})).fail(x.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(n=null==t?void 0:t.messageFilter)||void 0===n?void 0:n.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(x.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(i=null==t?void 0:t.messageFilter)||void 0===i?void 0:i.senderIds,Ut).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans((function(){return Vt()?vn():Rn(x.NOT_SUPPORT,"Only support electron platform.")})).tryTrans(this.validateLogin)).isOk?(s=c(this,lb,"m",_b).call(this,e),[4,c(this,lb,"m",pb).call(this,r(r({},t),{conversationFilter:{conversationTypes:[s.conversationType],targetIds:[s.targetId],channelIds:"string"==typeof s.channelId?[s.channelId]:[]}}))]):[2,o.wipe()];case 1:return[2,a.sent().orSync((function(){return vn({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r,i,s,u;return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){return(o=In.create("searchMessagesWithParams").isObject("params",e,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(x.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,dt,!0).fail(x.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,dt).fail(x.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(x.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,n=e.endTime;return!t&&!n||!(t&&!Tt(t)||n&&!Tt(n))&&(t=null!=t?t:0,n=null!=n?n:Date.now(),t>=0&&t<=n)})).fail(x.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(t=null==e?void 0:e.conversationFilter)||void 0===t?void 0:t.conversationTypes,(function(e){return te(e,X)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.targetIds,20,Ut,!1,0).fail(x.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.channelIds,10,wt,!1,0).fail(x.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(i=null==e?void 0:e.messageFilter)||void 0===i?void 0:i.senderIds,20,Ut,!1,0).fail(x.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(s=null==e?void 0:e.messageFilter)||void 0===s?void 0:s.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(x.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin)).isOk?(e.limit=Math.min(e.limit,100),(null===(u=e.messageFilter)||void 0===u?void 0:u.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),[2,c(this,lb,"m",pb).call(this,e)]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_GET_MSGS_AROUND_TIMESTAMP_T,JSON.stringify({conversation:e,timestamp:t,beforeCount:n,afterCount:r}),i),[4,In.create("getMessagesAroundTimestamp").check((function(t){return cc(t,e,X)})).isLimitedInteger("timestamp",t,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("beforeCount",n,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_BEFORE).isLimitedInteger("afterCount",r,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_AFTER).result().tryTrans(this.validateLogin).next((function(){var i=c(s,lb,"m",_b).call(s,e);return s._engine.chat.getMessagesAroundTimestamp(i,t,n,r)}))];case 1:return o=a.sent(),this.logger.summary(B.A_GET_MSGS_AROUND_TIMESTAMP_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTIONED_MSGS_T,JSON.stringify(e),t),[4,In.create("getUnreadMentionedMessages").check((function(t){return cc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(r,lb,"m",_b).call(r,e);return r._engine.chat.getUnreadMentionedMessages(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UNREAD_MENTIONED_MSGS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,channelId:t}),n),[4,In.create("getUltraGroupDefaultNotificationLevel").validate("targetId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",t,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){var n="string"==typeof t?i._channelIdConvert(F.ULTRA_GROUP,t):t;return i._engine.chat.getUGDefaultNotificationLevel(e,n)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_UG_DEFAULT_NTF_LEVEL_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,notificationLevel:t,channelId:n}),r),[4,In.create("setUltraGroupDefaultNotificationLevel").validate("targetId",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",n,wt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isNumberEnum("notificationLevel",t,Re,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var r="string"==typeof n?o._channelIdConvert(F.ULTRA_GROUP,n):n;return o._engine.chat.setUGDefaultNotificationLevel(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_UG_DEFAULT_NTF_LEVEL_R,i,r),[2,i]}}))}))}}),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 a(this,(function(n){return(t=lc("getConversationNotificationLevel",e,J).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(c(this,lb,"m",_b).call(this,e))]:[2,t.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 n;return a(this,(function(r){return(n=In.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return te(e,J)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE).isNumberEnum("level",t,Re,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.setConversationTypeNotificationLevel(e,t)]:[2,n.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 a(this,(function(n){return(t=In.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return te(e,J)}),!0).fail(x.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){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return n=null==t?void 0:t.timestamp,r=null==t?void 0:t.count,i=null==t?void 0:t.order,o=this.logger.createTraceId(),this.logger.info(B.A_GET_REMOTE_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),o),[4,In.create("getRemoteHistoryMessages").check((function(t){return cc(t,e,Q)})).isLimitedInteger("timestamp",n,0,Number.MAX_SAFE_INTEGER).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(x.INVALID_PARAMETER_ORDER).isLimitedInteger("count",r,1,100).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:n||0,count:r||20,order:i||0,messageType:""},o=c(u,lb,"m",_b).call(u,e);return u._engine.getHistoryMessage(o,t,!1)}))];case 1:return s=a.sent(),this.logger.summary(B.A_GET_REMOTE_HISTORY_MSG_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(B.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 o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATIONS_T,JSON.stringify({identifiers:e}),t),[4,In.create("getConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,100,(function(e){return!cc(t,e,X).isFailed}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return c(r,lb,"m",_b).call(r,e)}));return r._engine.chat.getConversations(t)}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_CONVERSATIONS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckDuplicateMessage(!!e)}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i=this;return a(this,(function(o){switch(o.label){case 0:return[4,this.validateConnected().next((function(){return i._engine.rtcSignaling(e,t,n,r)}))];case 1:return[2,o.sent()]}}))}))}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.rtcPing(e,t,n)}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_PROXY_T,JSON.stringify({proxy:e}),t),[4,In.create("setProxy").check((function(t){return fc(t,e)})).result().next((function(){return r._engine.setProxy(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SET_PROXY_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_PROXY_T,JSON.stringify({}),e),[4,this._engine.getProxy()];case 1:return t=n.sent(),this.logger.summary(B.A_GET_PROXY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_TEST_PROXY_T,JSON.stringify({proxy:e,testHost:t}),n),[4,In.create("testProxy").check((function(t){return fc(t,e)})).isString("testHost",t,!0).fail(x.INVALID_PARAMETER_TESTHOST).result().next((function(){return i._engine.testProxy(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_TEST_PROXY_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_REALTIME_CONVERSATIONS_T,JSON.stringify({count:e,startTime:t,order:n}),r),[4,In.create("getRealtimeConversations").isLimitedInteger("count",e,1,50,!0).fail(x.INVALID_PARAMETER_COUNT).isTimestamp("startTime",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",n,0,1,!0).fail(x.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).tryTrans(Uc).next((function(){return o._engine.chat.getRealtimeConversations(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_REALTIME_CONVERSATIONS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T,"",e),[4,this.validateConnected().tryTrans(Uc).next((function(){return n._engine.chat.getRealtimeConTotalUnreadCount()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,this.validateConnected().tryTrans(Uc).next((function(){return r._engine.chat.clearRealtimeConUnreadCount(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_CLEAR_REALTIME_CON_UNREAD_COUNT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_REALTIME_CONVERSATIONS_T,JSON.stringify(e),t),[4,In.create("removeRealtimeConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,20,(function(e){return!cc(t,e,X).isFailed}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Uc).next((function(){return r._engine.chat.removeRealtimeConversations(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_REMOVE_REALTIME_CONVERSATIONS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,In.create("batchGetRealtimeConUnreadCount").check((function(t){t.isLimitedTypedArray("identifiers",e,10,(function(e){return!cc(t,e,X).isFailed}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Uc).next((function(){return r._engine.chat.batchGetRealtimeConUnreadCount(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return In.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(x.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(x.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(x.INVALID_PARAMETER_SPAN_MINUTES).isNumberEnum("level",e.level,we,!0).fail(x.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 n;return a(this,(function(r){return(n=lc("sendReadReceiptResponseV5",e,K).isTypedArray("messageUIdArray",t,(function(e){return Ut(e)}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?vn():Rn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.sendReadReceiptResponseV5(e,t)]:[2,n.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 n,r;return a(this,(function(i){return(n=lc("getMessageReadReceiptInfoV5",e,K).isTypedArray("messageUIdArray",t,(function(e){return Ut(e)}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?vn():Rn(x.READ_RECEIPT_ERROR)}))).isOk?(r=t.map((function(t){return{identifier:e,messageUId:t}})),[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(r)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return t=In.create(""),(n=In.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(function(e){return cc(t,e.identifier,K).isNotEmptyString("messageUId",e.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().isOk}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?vn():Rn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(e)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=lc("getMessageReadReceiptInfoV5",e,K).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isObject("option",n,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",n.pageToken).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",n.pageCount,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?vn():Rn(x.READ_RECEIPT_ERROR)}))).isOk?(n.order=1!==n.order?0:1,n.readStatus=1!==n.readStatus?0:1,[2,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,t,n)]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=lc("getMessagesReadReceiptByUsersV5",e,K).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",n,(function(e){return Ut(e)}),!0).fail(x.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",n.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?vn():Rn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessagesReadReceiptByUsersV5(e,t,n)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:t}),n),[4,In.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((function(e){return!!(1&(e.AIBusinessSub||0))?vn():Rn(x.SPEECH_TO_TEXT_DISABLE)})).next((function(){return i._engine.chat.requestSpeechToTextForMessage(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return[4,In.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).result().tryTrans(this.validateLogin).next((function(){return n._engine.chat.setMessageSpeechToTextVisible(e,!!t)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:t,topPriority:n}),r),[4,In.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isInteger("count",t,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateLogin).next((function(){var r=t<=0?20:Math.min(t,100);return o._engine.chat.getUntaggedConversationListByPage(e,r,!!n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"translateMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=Vt(),[4,In.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof Cr&&e.isValid(!n)}),!0).fail(x.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(t=null==e?void 0:e.list)||void 0===t?void 0:t.length,1,10,!0).fail(x.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,Or).fail(x.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(r=a.sent()).isOk?(i=e.list,o=e.force,s=e.mode,[2,c(this,lb,"m",Eb).call(this,i,0,s,o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"translateTextsWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){switch(o.label){case 0:return[4,In.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof Pr&&e.isValid(!0)}),!0).fail(x.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(t=null==e?void 0:e.list)||void 0===t?void 0:t.length,1,10,!0).fail(x.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,Or).fail(x.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(n=o.sent()).isOk?(r=e.list,i=e.mode,[2,c(this,lb,"m",Eb).call(this,r,1,i)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t),[4,In.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((function(){return r._engine.userSettings.setTranslationLanguage(e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SET_TRANSLATION_LANGUAGE_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_TRANSLATION_LANGUAGE_T,void 0,e),[4,this.validateLogin().next((function(){return n._engine.userSettings.getTranslationLanguage()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_TRANSLATION_LANGUAGE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_AUTO_TRANSLATE_ENABLED_T,JSON.stringify({enabled:!!e}),t),[4,this.validateConnected().next((function(){return r._engine.userSettings.setAutoTranslateEnabled(!!e)}))];case 1:return n=i.sent(),this.logger.summary(B.A_SET_AUTO_TRANSLATE_ENABLED_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_AUTO_TRANSLATE_ENABLED_T,void 0,e),[4,this.validateLogin().next((function(){return n._engine.userSettings.getAutoTranslateEnabled()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_AUTO_TRANSLATE_ENABLED_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),n=null==e?void 0:e.messageUId,r=null==e?void 0:e.messageContent,this.logger.info(B.A_MODIFY_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUId:n,conversation:null==e?void 0:e.conversation}),t),[4,In.create("modifyMessageWithParams").check((function(t){return cc(t,null==e?void 0:e.conversation,Z)})).isNotEmptyString("messageUId",n,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isObject("messageContent",r,!0).fail(x.INVALID_PARAMETER_MESSAGE_CONTENT).isLimitedInteger("messageContent",gc(JSON.stringify(r)),1,qe,!0).fail(x.RC_MSG_CONTENT_EXCEED_LIMIT).result().tryTrans(this.validateConnected).next((function(){return o._engine.chat.modifyMessageWithParams(e)}))];case 1:return i=a.sent(),this.logger.summary(B.A_MODIFY_MESSAGE_WITH_PARAMS_R,i,t),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),n=null==e?void 0:e.messageUIds,this.logger.info(B.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUIds:n}),t),[4,lc("refreshReferenceMessageWithParams",null==e?void 0:e.conversationIdentifier,Z).isObject("params",e,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER).isTypedArray("messageUIds",n,(function(e){return mt(e)}),!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==n?void 0:n.length,1,20,!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.refreshReferenceMessageWithParams(n,e.conversationIdentifier,e.remoteMessageBlock,e.localMessageBlock,e.messageInfoMap)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_SYNC_REMOTE_CONVERSATIONS_T,void 0,e),[4,this.validateConnected().next((function(){return n._engine.chat.syncRemoteConversations()}))];case 1:return t=r.sent(),this.logger.summary(B.A_SYNC_REMOTE_CONVERSATIONS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalUGMessagesForAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T,JSON.stringify({targetId:e,timestamp:t}),n),[4,In.create("deleteLocalUGMessagesForAllChannel").isNotEmptyString("targetId",e,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isTimestamp("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.deleteLocalUGMessagesForAllChannel(e,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T,JSON.stringify({params:e}),t),[4,In.create("getUnreadMentionMeConversationList").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,Number.MAX_SAFE_INTEGER,(function(e){return te(e,J)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(t){return o(r,void 0,void 0,(function(){var n;return a(this,(function(r){if(n=Xp(t)){if(!this._ugSynced)return[2,Rn(x.METHOD_NOT_AVAILABLE)]}else if(e.conversationTypes=e.conversationTypes.filter((function(e){return e!==F.ULTRA_GROUP})),0===e.conversationTypes.length)return[2,vn([])];return[2,this._engine.chat.getUnreadMentionMeConversationList(e,n)]}))}))}))];case 1:return n=i.sent(),this.logger.summary(B.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_ALL_ROBOTS_T,void 0,e),[4,this.validateConnected().next((function(){return n._engine.getAllRobots()}))];case 1:return t=r.sent(),this.logger.summary(B.A_GET_ALL_ROBOTS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getRobotById",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_ROBOT_BY_ID_T,JSON.stringify({id:e}),t),[4,In.create("getRobotById").validate("id",e,Ut,!0).fail(x.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return o(i,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.getAllRobots()]}))}))}))];case 1:return n=s.sent(),r=n.trans((function(t){return t.find((function(t){return t.robotId===e}))||null})),this.logger.summary(B.A_GET_ROBOT_BY_ID_R,n,t,{id:e,robot:r.data}),[2,r]}}))}))}}),e}();lb=new WeakSet,cb=function(e,t,n){var r,i;return o(this,void 0,void 0,(function(){var s,u,l=this;return a(this,(function(c){switch(c.label){case 0:return[4,In.create("connect").isNotEmptyString("token",e).fail(x.RC_CONN_TOKEN_INCORRECT).result().next((function(){return o(l,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return this._token=e,[4,la.getNetworkType()];case 1:return r=o.sent(),this._engine.setNetwork({status:!0,type:r},!0),i=!!this._pluginInstanseMap.RCCallPlus,[2,this._engine.connect(e,t,i,n)]}}))}))}))];case 1:return(s=c.sent()).isOk&&1!==this._engine.naviInfo.type&&(u=ft.getInfo(),null===(i=(r=this._engine).reportSDKInfo)||void 0===i||i.call(r,u)),[2,s]}}))}))},db=function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return r.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){n.logger.error(B.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},_b=function(e){return r(r({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})},fb=function(e,t,n,r){return o(this,void 0,void 0,(function(){var i=this;return a(this,(function(o){switch(o.label){case 0:return[4,In.create("sendMessage").check((function(t){return cc(t,e,X)})).isObject("content",t.content,!0).fail(x.INVALID_PARAMETER_MESSAGE_CONTENT).isString("messageType",t.messageType,!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){var n=uc(t.messageType,t.content);n.isOk||e.setFailed(n.code)})).isNumber("messageId",t.messageId).fail(x.INVALID_PARAMETER_MESSAGE_ID).isBoolean("isStatusMessage",t.isStatusMessage).fail(x.INVALID_PARAMETER_IS_STATUS_MESSAGE).isBoolean("disableNotification",t.disableNotification).fail(x.INVALID_PARAMETER_DISABLE_NOTIFICATION).isString("pushContent",t.pushContent).fail(x.INVALID_PARAMETER_PUSH_CONTENT).isString("pushData",t.pushData).fail(x.INVALID_PARAMETER_PUSH_DATA).isObject("pushConfig",t.pushConfig).fail(x.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("isVoipPush",t.isVoipPush).fail(x.INVALID_PARAMETER_IS_VOIP_PUSH).isBoolean("canIncludeExpansion",t.canIncludeExpansion).fail(x.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION).check((function(e){t.canIncludeExpansion&&t.expansion&&_c(e,t.expansion,!0)})).check((function(n){n.isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(x.INVALID_DISABLE_UPDATE_LAST_MESSAGE),n.isFailed||e.conversationType===F.ULTRA_GROUP&&t.disableUpdateLastMessage&&n.setFailed(x.INVALID_DISABLE_UPDATE_LAST_MESSAGE)})).check((function(n){if(!n.isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,Ut,!1,0).fail(x.INVALID_PARAMETER_USERIDLIST).isFailed&&t.directionalUserIdList&&0!==t.directionalUserIdList.length){var r=e.conversationType;[F.GROUP,F.ULTRA_GROUP,F.APP_PUBLIC_SERVICE,F.PUBLIC_SERVICE].includes(r)||n.setFailed(x.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE)}})).isBoolean("isMentioned",t.isMentioned).fail(x.INVALID_PARAMETER_IS_MENTIONED).check((function(n){var r=e.conversationType;if(!t.isMentioned||r!==F.GROUP&&r!==F.ULTRA_GROUP)delete t.content.mentionedInfo;else{var i=t.content.mentionedInfo||{type:t.mentionedType,userIdList:t.mentionedUserIdList};!n.isNumberEnum("mentionedType",null==i?void 0:i.type,Y,!0).fail(x.INVALID_PARAMETER_MENTIONED_TYPE).isTypedArray("mentionedUserIdList",null==i?void 0:i.userIdList,Ut,(null==i?void 0:i.type)===Y.SINGAL).fail(x.INVALID_PARAMETER_USERIDLIST).isString("mentionedContent",null==i?void 0:i.mentionedContent).fail(x.INVALID_PARAMETER_MESSAGE_CONTENT).isFailed&&(t.content.mentionedInfo=i)}})).result().tryTrans(this.validateConnected).tryTrans((function(n){if(!t.needReceipt)return vn(n);if(n.grpRRVer!==Fe.V5)return Rn(x.READ_RECEIPT_ERROR);var r=e.conversationType,i=Ir(t.messageType),o=i.isPersited,a=i.isStatusMessage;return(r!==F.GROUP&&r!==F.PRIVATE||t.isStatusMessage||a||!o||r===F.GROUP&&t.directionalUserIdList&&t.directionalUserIdList.length>0)&&(t.needReceipt=!1),vn(n)})).tryTrans((function(n){var r=e.conversationType,i=t.messageType;if(r===F.SYSTEM&&i!==me.SYNC_READ_STATUS)return Rn(x.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE);if(i===me.STREAM_MESSAGE)return Rn(x.MESSAGE_NOT_SUPPORT_SENDING);if(i===me.READ_RECEIPT_RESPONSE&&n.grpRRVer)return Rn(x.READ_RECEIPT_ERROR);var o=JSON.stringify(t.content);return gc(o)>qe?Rn(x.RC_MSG_CONTENT_EXCEED_LIMIT):vn()})).next((function(){return c(i,lb,"m",hb).call(i,e,t,n,r)}))];case 1:return[2,o.sent()]}}))}))},hb=function(e,t,n,r){var i=c(this,lb,"m",_b).call(this,e);return i.conversationType===F.ULTRA_GROUP?this._engine.sendUltraMessage(i,t,n,r):this._engine.sendMessage(i,t,n,r)},gb=function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._engine.sendMessage(e,{content:t,messageType:me.EXPANSION_NOTIFY},n)];case 1:return[2,r.sent().wipe()]}}))}))},pb=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.timeRange||{},n=t.startTime,r=t.endTime,i={startTime:null!=n?n:0,endTime:null!=r?r:Number.MAX_SAFE_INTEGER},e.timeRange=i,o=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return s=a.sent(),this.logger.summary(B.A_SEARCH_MSGS_BY_PARAMS_R,s,o),[2,s]}}))}))},Eb=function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,this._engine.translateWithParams(e.map((function(e){return e.toInnerParam()})),n||Or.MECHANICAL,!!r,t)]}))}))};export{vb as APIContext,bc as AppStorage,Hn as AreaCode,tc as AssertRules,zl as BasicEngine,tr as BasicLogger,U as ChatroomEntryType,G as ChatroomSyncStatusReason,V as ChatroomUserChangeType,j as ChrmMemBanType,k as ChrmMemOperateType,D as ChrmSyncStatus,Jl as Codec,Rl as ConnectionStatus,F as ConversationType,_ as DirectionType,x as ErrorCode,ql as EventEmitter,q as FileType,Ve as FilterRobotType,h as FriendAddPermission,E as FriendApplicationStatus,p as FriendApplicationType,g as FriendRelationType,M as GroupApplicationDirection,N as GroupApplicationStatus,w as GroupApplicationType,m as GroupInviteHandlePermission,v as GroupJoinPermission,I as GroupMemberInfoEditPermission,y as GroupMemberRole,A as GroupOperation,R as GroupOperationPermission,P as GroupOperationRole,C as GroupOperationStatus,O as GroupOperationType,Fe as GroupReadReceiptVersion,Ge as HttpMethod,Le as InterruptionLevel,sr as LogDBProxy,Qn as LogL,Tl as LogLevel,vl as LogSource,B as LogTagId,qe as MAX_MESSAGE_CONTENT_BYTES,dt as MAX_U32_INTEGER,We as MAX_UPLOAD_FILE_SIZE,Y as MentionedType,je as MessageAuditType,Ee as MessageBlockSourceType,pe as MessageBlockType,be as MessageDirection,me as MessageType,Re as NotificationLevel,Ie as NotificationStatus,ce as OnlineStatus,le as OperateStatus,bl as PBCodec,de as Platform,nc as PluginContext,Te as PushImportanceHonor,we as PushNotificationQuietHoursLevel,f as QueryFriendsDirectionType,ge as RCConnectionStatus,Tn as RCResult,Al as RTCApiType,Ol as RTCJoinType,Il as RTCMode,rc as RTCPluginContext,ye as ReceivedStatus,Yn as ReferenceMessageStatus,ue as SentStatus,ke as SpeechToTextStatus,Ll as StreamMessageResponseEventType,fe as SubscribeOperationType,_e as SubscribeType,bn as SuspendablePromise,Cr as TranslateMessageParam,Or as TranslateMode,Lr as TranslateStatus,wr as TranslateStrategy,Pr as TranslateTextParam,Ke as UPLOAD_FILE_CHUNK_SIZE,ht as UUId,re as UltraGroupChannelChangeType,ne as UltraGroupChannelType,n as UploadMethod,he as UserProfileVisibility,Wn as UserSettingsChangedKey,xe as UserType,In as Validator,ft as VersionManage,ac as assert,ur as createLogDBProxy,Rn as fail,cn as fixUrlProtocol,Yl as forEach,Ir as getMessageTypeDescription,Rc as getUUID,Ic as getUUID22,mr as hasMessageTypeDescription,Fn as httpRequest,Rt as isArray,bt as isBoolean,St as isFunction,Nt as isHttpUrl,vt as isInteger,It as isLimitedString,Kl as isNull,Tt as isNumber,At as isObject,Et as isString,Ot as isUndefined,Pt as isValidConversationType,Mt as isValidEnum,Gt as isValidFileType,Dt as isValidGroupId,Ut as isValidTargetId,Hl as logger,Wl as map,yt as notEmptyArray,Ct as notEmptyObject,mt as notEmptyString,vn as ok,Sn as promiseWithResolvers,la as runtime,jt as trans2IReceivedStatusInfo,Me as trans2NotificationLevel,Ue as trans2NotificationStatus,kt as transformReceivedStatusFlag,Vt as usingCppEngine,sc as validate};
|