@rongcloud/engine 5.30.0 → 5.32.0-c-rtc-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 +10 -1
- package/index.cjs.js +10 -1
- package/index.d.ts +775 -811
- package/index.esm.js +10 -1
- package/index.mjs +10 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -13,4 +13,13 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r,n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function i(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function o(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function l(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function c(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function d(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}exports.UploadMethod=void 0,(r=exports.UploadMethod||(exports.UploadMethod={}))[r.QINIU=1]="QINIU",r[r.ALI=2]="ALI",r[r.AWS=3]="AWS",r[r.STC=4]="STC",r[r.MINIO=5]="MINIO";var p,f,_,h,E,b,v,T,I,y,m,R,S,A,O,C,N,P,L,M,w,U,D,x,G,V,j,k,F,B,H={L_IMSDK_VER_O:"L-imsdk_ver-O",A_INIT_REPEAT_O:"A_INIT_REPEAT_O",L_INIT_O:"L-init-O",A_DESTROY_O:"A_DESTROY_O",A_CONNECT_T:"A-connect-T",A_CONNECT_R:"A-connect-R",A_CONNECT_S:"A-connect-S",L_QUERY_CMP_T:"L-query_cmp-T",L_QUERY_CMP_R:"L-query_cmp-R",A_DISCONNECT_O:"A-disconnect-O",A_RECONNECT_T:"A-reconnect-T",A_RECONNECT_R:"A_RECONNECT_R",L_CONNECT_T:"L-connect-T",L_CONNECT_O:"L-connect-O",L_CONNECT_R:"L-connect-R",L_CONNECT_S:"L-connect-S",L_DB_UPGRATE_START_S:"L-db_upgrate_start-S",L_DB_UPGRATING_S:"L-db_upgrating-S",L_DB_UPGRATE_COMPLETE_S:"L-db_upgrate_complete-S",L_NOTIFY_ULTRA_ONLINE_S:"L-notify-ultra-online-S",L_ULTRA_SYNC_DONE_S:"L-ultra-sync-done-S",L_BATCH_MESSAGE_O:"L-BATCH_MESSAGE-O",A_MSG_LISTENER_E:"A-MSG_LISTENER-E",O:"L-original-O",T:"L-TEST-O",L_INSTALL_PLUGIN_T:"L-INSTALL_PLUGIN-T",L_INSTALL_PLUGIN_R:"L-INSTALL_PLUGIN-R",L_NAVI_CONF_E:"L-NAVI_CONF_ERROR-E",L_NAVI_CMP_R:"L-NAVI_CPM-R",A_SEND_MSG_T:"A-send_msg-T",A_SEND_MSG_R:"A-send_msg-R",L_SEND_MSG_T:"L-send_msg-T",L_SEND_MSG_R:"L-send_msg-R",L_PULL_MSG_T:"L-pull_msg-T",L_PULL_MSG_R:"L-pull_msg-R",L_PULL_MSG_E:"L-pull_msg-E",L_PULL_MSG_O:"L-pull_msg-O",L_PULL_ULTRA_MSG_T:"L-pull_ultra_msg-T",L_PULL_ULTRA_MSG_R:"L-pull_ultra_msg-R",L_PULL_UG_RELATIONS_T:"L-pull_ug_relations-T",L_PULL_UG_RELATIONS_R:"L-pull_ug_relations-R",L_PULL_CHATROOM_KV_T:"L-pull_chatroom_kv-T",L_PULL_CHATROOM_KV_R:"L-pull_chatroom_kv-R",L_PULL_CHATROOM_MSG_T:"L-pull_chatroom_msg-T",L_PULL_CHATROOM_MSG_R:"L-pull_chatroom_msg-R",L_RECV_MULTI_SYNC_MSG_O:"L-recv_multi_sync_msg-O",L_RECV_S_MSG_O:"L-recv_s_msg-O",A_DELETE_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_SEND_MESSAGE_READ_RECEIPT_V4_T:"A-send_message_read_receipt_V4-T",A_SEND_MESSAGE_READ_RECEIPT_V4_R:"A-send_message_read_receipt_V4-R",A_GET_MESSAGE_READ_RECEIPT_V4_T:"A-get_message_read_receipt_V4-T",A_GET_MESSAGE_READ_RECEIPT_V4_R:"A-get_message_read_receipt_V4-R",A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T:"A-batch_get_message_read_receipt_info_V4-T",A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R:"A-batch_get_message_read_receipt_info_V4-R",A_SYNC_READ_STATUS_T:"A-sync_read_status-T",A_SYNC_READ_STATUS_R:"A-sync_read_status-R",L_PB_ENCODE_E:"L-pb-encode-E",L_PB_DECODE_E:"L-pb-decode-E",L_NOTIFY_NAVI_CHANGE_E:"L-notify_navi_change-E",L_REPORT_FULL_LOG_O:"L-report_full_log-O",L_REPORT_FULL_LOG_T:"L-report_full_log-T",L_REPORT_FULL_LOG_R:"L-report_full_log-R",L_REPORT_LOG_POLICY_E:"L-parse_navi_logpolicy-E",L_UNSUPPORT_INDEXDB_O:"L-unsupport_IndexDB-O",L_LOGDB_OPEN_FAILED_E:"L-logDB_open_failed-E",L_LOGDB_CLOSED_S:"L-logDB_closed-S",L_LOGDB_ERROR_E:"L-logDB_error-S",L_LOGDB_ABORT_S:"L-logDB_abort-S",L_REALTIME_LOG_T:"L_REALTIME_LOG_T",L_REALTIME_LOG_R:"L_REALTIME_LOG_R",L_REALTIME_LOG_O:"L_REALTIME_LOG_O",L_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",A_SET_PROXY_O:"A-set_proxy-O",A_TEST_PROXY_O:"A-test_proxy-O",L_WS_DISACCORD_E:"L-ws_disaccord-E",L_GET_STATIC_CONF_T:"L-get_static_conf-T",L_GET_STATIC_CONF_R:"L-get_static_conf-R",L_GET_STATIC_CONF_E:"L-get_static_conf-E",L_CLOUD_DISABLED:"L-cloud_disabled",L_CLOUD_OVERCLOCK:"L-cloud_overclock",L_CLOUD_APPKEY_REGION_E:"L-cloud_appkey_region_error",L_CLOUD_CONFIG_DATA_E:"L-cloud_config_data_error",L_CLOUD_SET_CACHE_O:"L-cloud_set_cache-O",L_CLOUD_GET_CACHE_O:"L-cloud_get_cache-O",L_CLOUD_SET_AREA_CODE_O:"L-cloud_set_area_code-O",L_CLOUD_SET_MRTR_O:"L-cloud_set_mrtr-O",L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S:"L-sync_subscribed_user_status_finished-S",L_PULL_SUBSCRIBED_USER_RELATION_T:"L-pull_subscribed_user_relation-T",L_PULL_SUBSCRIBED_USER_RELATION_R:"L-pull_subscribed_user_relation-R",L_PULL_SUBSCRIBED_USER_STATUS_T:"L-pull_subscribed_user_status-T",L_PULL_SUBSCRIBED_USER_STATUS_R:"L-pull_subscribed_user_status-R",L_OWN_USER_PROFILE_CHANGED_S:"L-own_user_profile_changed-S",L_QUERY_SUBSCRIBE_DATA_T:"L-query_subscribe_data-T",L_QUERY_SUBSCRIBE_DATA_R:"L-query_subscribe_data-R",L_PULL_USER_PROFILE_T:"L-pull_user_profile-T",L_PULL_USER_PROFILE_R:"L-pull_user_profile-R",L_PULL_OWN_PROFILE_T:"L-pull_own_profile-T",L_PULL_OWN_PROFILE_R:"L-pull_own_profile-R",L_QUERY_FRIEND_LIST_T:"L-query_friend_list-T",L_QUERY_FRIEND_LIST_R:"L-query_friend_list-R",L_PULL_USER_PROFILE_REQ_T:"L-pull_user_profile_req-T",L_PULL_USER_PROFILE_REQ_R:"L-pull_user_profile_req-R",L_SERVER_EVENT_NOTIFY_ONLINE_T:"L-server_event_notify_online-T",L_SERVER_EVENT_NOTIFY_ONLINE_R:"L-server_event_notify_online-R",L_PULL_EVENT_CHANGE_T:"L-pull_event_change-T",L_PULL_EVENT_CHANGE_R:"L-pull_event_change-R",L_PARSE_JSON_E:"L-parse_json-E",L_REQ_STREAM_MSG_CONTENT_T:"L-req_stream_msg_content-T",L_REQ_STREAM_MSG_CONTENT_R:"L-req_stream_msg_content-R",L_REQ_STREAM_MSG_CONTENT_O:"L-req_stream_msg_content-O",L_REQ_STREAM_MSG_CONTENT_E:"L-req_stream_msg_content-E",L_PULL_CONVERSATION_SETTINGS_T:"L-pull_conversation_settings-T",L_PULL_CONVERSATION_SETTINGS_R:"L-pull_conversation_settings-R",L_PULL_SG_RELATIONS_T:"L-pull_sg_relations-T",L_PULL_SG_RELATIONS_R:"L-pull_sg_relations-R",A_REMOVE_CONVERSATION_T:"A-remove_conversation-T",A_REMOVE_CONVERSATION_R:"A-remove_conversation-R",A_GET_CONVERSATION_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",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"};exports.DirectionType=void 0,(p=exports.DirectionType||(exports.DirectionType={}))[p.BOTH=2]="BOTH",exports.QueryFriendsDirectionType=void 0,(f=exports.QueryFriendsDirectionType||(exports.QueryFriendsDirectionType={}))[f.BOTH=2]="BOTH",exports.FriendAddPermission=void 0,(_=exports.FriendAddPermission||(exports.FriendAddPermission={}))[_.FREE=1]="FREE",_[_.NEED_VERIFY=2]="NEED_VERIFY",_[_.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.FriendRelationType=void 0,(h=exports.FriendRelationType||(exports.FriendRelationType={}))[h.NONE=0]="NONE",h[h.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",h[h.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",h[h.BOTH_WAY=3]="BOTH_WAY",exports.FriendApplicationType=void 0,(E=exports.FriendApplicationType||(exports.FriendApplicationType={}))[E.SENT=1]="SENT",E[E.RECEIVED=2]="RECEIVED",exports.FriendApplicationStatus=void 0,(b=exports.FriendApplicationStatus||(exports.FriendApplicationStatus={}))[b.UNHANDLED=0]="UNHANDLED",b[b.ACCEPTED=1]="ACCEPTED",b[b.REFUSED=2]="REFUSED",b[b.EXPIRED=3]="EXPIRED",function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(v||(v={})),function(e){e[e.FRIEND_APPLY=0]="FRIEND_APPLY",e[e.FRIEND_REFUSE=1]="FRIEND_REFUSE",e[e.FRIEND_USER_INFO=2]="FRIEND_USER_INFO",e[e.FRIENDS_INPUT=3]="FRIENDS_INPUT",e[e.FRIEND_CLEAR=4]="FRIEND_CLEAR",e[e.FRIEND_INFO_CHANGE=5]="FRIEND_INFO_CHANGE",e[e.FRIEND_INFO_CHANGE_SYNC=6]="FRIEND_INFO_CHANGE_SYNC"}(T||(T={})),exports.GroupJoinPermission=void 0,(I=exports.GroupJoinPermission||(exports.GroupJoinPermission={}))[I.OWNER_VERIFY=0]="OWNER_VERIFY",I[I.FREE=1]="FREE",I[I.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",I[I.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.GroupOperationPermission=void 0,(y=exports.GroupOperationPermission||(exports.GroupOperationPermission={}))[y.OWNER=0]="OWNER",y[y.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",y[y.EVERYONE=2]="EVERYONE",exports.GroupMemberInfoEditPermission=void 0,(m=exports.GroupMemberInfoEditPermission||(exports.GroupMemberInfoEditPermission={}))[m.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",m[m.OWNER_OR_SELF=1]="OWNER_OR_SELF",m[m.SELF=2]="SELF",exports.GroupInviteHandlePermission=void 0,(R=exports.GroupInviteHandlePermission||(exports.GroupInviteHandlePermission={}))[R.FREE=0]="FREE",R[R.INVITEE_VERIFY=1]="INVITEE_VERIFY",exports.GroupMemberRole=void 0,(S=exports.GroupMemberRole||(exports.GroupMemberRole={}))[S.UNDEF=0]="UNDEF",S[S.NORMAL=1]="NORMAL",S[S.MANAGER=2]="MANAGER",S[S.OWNER=3]="OWNER",exports.GroupOperation=void 0,(A=exports.GroupOperation||(exports.GroupOperation={}))[A.CREATE=0]="CREATE",A[A.JOIN=1]="JOIN",A[A.KICK=2]="KICK",A[A.QUIT=3]="QUIT",A[A.DISMISS=4]="DISMISS",A[A.ADD_MANAGER=5]="ADD_MANAGER",A[A.REMOVE_MANAGER=6]="REMOVE_MANAGER",A[A.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER",function(e){e[e.GROUP_INFO_CHANGE=0]="GROUP_INFO_CHANGE",e[e.MEMBER_PROFILE_CHANGE=1]="MEMBER_PROFILE_CHANGE",e[e.GROUP_REMARK_SET=2]="GROUP_REMARK_SET",e[e.GROUP_REMARK_DELETE=3]="GROUP_REMARK_DELETE"}(O||(O={})),exports.GroupOperationType=void 0,(C=exports.GroupOperationType||(exports.GroupOperationType={}))[C.ADD=1]="ADD",C[C.REMOVE=2]="REMOVE",exports.GroupApplicationStatus=void 0,(N=exports.GroupApplicationStatus||(exports.GroupApplicationStatus={}))[N.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",N[N.MANAGER_REFUSED=1]="MANAGER_REFUSED",N[N.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",N[N.INVITEE_REFUSED=3]="INVITEE_REFUSED",N[N.JOINED=4]="JOINED",N[N.EXPIRED=5]="EXPIRED",exports.GroupOperationStatus=void 0,(P=exports.GroupOperationStatus||(exports.GroupOperationStatus={}))[P.REFUSE=0]="REFUSE",P[P.ACCEPT=1]="ACCEPT",exports.GroupOperationRole=void 0,(L=exports.GroupOperationRole||(exports.GroupOperationRole={}))[L.APPLICANT=0]="APPLICANT",L[L.MANAGER=1]="MANAGER",function(e){e[e.GROUP_OPERATION=11]="GROUP_OPERATION",e[e.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",e[e.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",e[e.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(M||(M={})),exports.GroupApplicationType=void 0,(w=exports.GroupApplicationType||(exports.GroupApplicationType={}))[w.APPLICATION=0]="APPLICATION",w[w.INVITATION=1]="INVITATION",exports.GroupApplicationDirection=void 0,(U=exports.GroupApplicationDirection||(exports.GroupApplicationDirection={}))[U.APPLICATION_SENT=0]="APPLICATION_SENT",U[U.INVITATION_SENT=1]="INVITATION_SENT",U[U.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",U[U.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED",exports.ChatroomEntryType=void 0,(D=exports.ChatroomEntryType||(exports.ChatroomEntryType={}))[D.UPDATE=1]="UPDATE",D[D.DELETE=2]="DELETE",exports.ChrmSyncStatus=void 0,(x=exports.ChrmSyncStatus||(exports.ChrmSyncStatus={}))[x.QUIT=0]="QUIT",x[x.JOIN=1]="JOIN",exports.ChatroomSyncStatusReason=void 0,(G=exports.ChatroomSyncStatusReason||(exports.ChatroomSyncStatusReason={}))[G.LeaveOnMyOwn=0]="LeaveOnMyOwn",G[G.OtherDeviceLogin=1]="OtherDeviceLogin",exports.ChatroomUserChangeType=void 0,(V=exports.ChatroomUserChangeType||(exports.ChatroomUserChangeType={}))[V.QUIT=0]="QUIT",V[V.JOIN=1]="JOIN",exports.ChrmMemBanType=void 0,(j=exports.ChrmMemBanType||(exports.ChrmMemBanType={}))[j.UnmuteUsers=0]="UnmuteUsers",j[j.MuteUsers=1]="MuteUsers",j[j.UnmuteAll=2]="UnmuteAll",j[j.MuteAll=3]="MuteAll",j[j.RemoveWhitelist=4]="RemoveWhitelist",j[j.AddWhitelist=5]="AddWhitelist",j[j.UnmuteGloble=6]="UnmuteGloble",j[j.MuteGloble=7]="MuteGloble",exports.ChrmMemOperateType=void 0,(k=exports.ChrmMemOperateType||(exports.ChrmMemOperateType={}))[k.Deblock=0]="Deblock",k[k.Blocked=1]="Blocked",exports.ErrorCode=void 0,(F=exports.ErrorCode||(exports.ErrorCode={}))[F.SUCCESS=0]="SUCCESS",F[F.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",F[F.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",F[F.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",F[F.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",F[F.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",F[F.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",F[F.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",F[F.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",F[F.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",F[F.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",F[F.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",F[F.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",F[F.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",F[F.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",F[F.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",F[F.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",F[F.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",F[F.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",F[F.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",F[F.NOT_IN_GROUP=22406]="NOT_IN_GROUP",F[F.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",F[F.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",F[F.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",F[F.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",F[F.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",F[F.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",F[F.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",F[F.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",F[F.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",F[F.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",F[F.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",F[F.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",F[F.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",F[F.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",F[F.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",F[F.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",F[F.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",F[F.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",F[F.HAVNODEVICEID=24001]="HAVNODEVICEID",F[F.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",F[F.FEILD=24009]="FEILD",F[F.INTERNALERRROR=24015]="INTERNALERRROR",F[F.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",F[F.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",F[F.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",F[F.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",F[F.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",F[F.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",F[F.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",F[F.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",F[F.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",F[F.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",F[F.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",F[F.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",F[F.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",F[F.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",F[F.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",F[F.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",F[F.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",F[F.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",F[F.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",F[F.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",F[F.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",F[F.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",F[F.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",F[F.RECALL_MESSAGE=25101]="RECALL_MESSAGE",F[F.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",F[F.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",F[F.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",F[F.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",F[F.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",F[F.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",F[F.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",F[F.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",F[F.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",F[F.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",F[F.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",F[F.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",F[F.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",F[F.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",F[F.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",F[F.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",F[F.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",F[F.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",F[F.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",F[F.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",F[F.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",F[F.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",F[F.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",F[F.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",F[F.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",F[F.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",F[F.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",F[F.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",F[F.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",F[F.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",F[F.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",F[F.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",F[F.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",F[F.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",F[F.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",F[F.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",F[F.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",F[F.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",F[F.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",F[F.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",F[F.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",F[F.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",F[F.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",F[F.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",F[F.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",F[F.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",F[F.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",F[F.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",F[F.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",F[F.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",F[F.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",F[F.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",F[F.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",F[F.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",F[F.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",F[F.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",F[F.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",F[F.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",F[F.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",F[F.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",F[F.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",F[F.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",F[F.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",F[F.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",F[F.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",F[F.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",F[F.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",F[F.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",F[F.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",F[F.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",F[F.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",F[F.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",F[F.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",F[F.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",F[F.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",F[F.TRANS_FAILED=28401]="TRANS_FAILED",F[F.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",F[F.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",F[F.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",F[F.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",F[F.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",F[F.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",F[F.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",F[F.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",F[F.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",F[F.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",F[F.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",F[F.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",F[F.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",F[F.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",F[F.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",F[F.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",F[F.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",F[F.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",F[F.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",F[F.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",F[F.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",F[F.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",F[F.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",F[F.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",F[F.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",F[F.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",F[F.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",F[F.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",F[F.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",F[F.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",F[F.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",F[F.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",F[F.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",F[F.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",F[F.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",F[F.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",F[F.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",F[F.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",F[F.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",F[F.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",F[F.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",F[F.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",F[F.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",F[F.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",F[F.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",F[F.RC_OTP_USED=31027]="RC_OTP_USED",F[F.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",F[F.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",F[F.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",F[F.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",F[F.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",F[F.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",F[F.RC_TCP_RESET=32054]="RC_TCP_RESET",F[F.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",F[F.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",F[F.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",F[F.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",F[F.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",F[F.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",F[F.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",F[F.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",F[F.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",F[F.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",F[F.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",F[F.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",F[F.TAG_EXISTS=33101]="TAG_EXISTS",F[F.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",F[F.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",F[F.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",F[F.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",F[F.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",F[F.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",F[F.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",F[F.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",F[F.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",F[F.UPLOAD_FAIL=34011]="UPLOAD_FAIL",F[F.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",F[F.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",F[F.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",F[F.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",F[F.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",F[F.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",F[F.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",F[F.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",F[F.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",F[F.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",F[F.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",F[F.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",F[F.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",F[F.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",F[F.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",F[F.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",F[F.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",F[F.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",F[F.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",F[F.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",F[F.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",F[F.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",F[F.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",F[F.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",F[F.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",F[F.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",F[F.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",F[F.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",F[F.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",F[F.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",F[F.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",F[F.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",F[F.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",F[F.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",F[F.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",F[F.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",F[F.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",F[F.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",F[F.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",F[F.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",F[F.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",F[F.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",F[F.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",F[F.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",F[F.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",F[F.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",F[F.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",F[F.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",F[F.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",F[F.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",F[F.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",F[F.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",F[F.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",F[F.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",F[F.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",F[F.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",F[F.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",F[F.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",F[F.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",F[F.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",F[F.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",F[F.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",F[F.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",F[F.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",F[F.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",F[F.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",F[F.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",F[F.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",F[F.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",F[F.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",F[F.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",F[F.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",F[F.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",F[F.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",F[F.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",F[F.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",F[F.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",F[F.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",F[F.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",F[F.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",F[F.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",F[F.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",F[F.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",F[F.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",F[F.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",F[F.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",F[F.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",F[F.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",F[F.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",F[F.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",F[F.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",F[F.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",F[F.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",F[F.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",F[F.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",F[F.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",F[F.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",F[F.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",F[F.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",F[F.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",F[F.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",F[F.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",F[F.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",F[F.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",F[F.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",F[F.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",F[F.NOT_SUPPORT=35004]="NOT_SUPPORT",F[F.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",F[F.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",F[F.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",F[F.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",F[F.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",F[F.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",F[F.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",F[F.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",F[F.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",F[F.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",F[F.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",F[F.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",F[F.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",F[F.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",F[F.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",F[F.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",F[F.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",F[F.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",F[F.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",F[F.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",F[F.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",F[F.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",F[F.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",F[F.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",F[F.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",F[F.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",F[F.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",F[F.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",F[F.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",F[F.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",F[F.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",F[F.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",F[F.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",F[F.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",F[F.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",F[F.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",F[F.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",F[F.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",F[F.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",F[F.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",F[F.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",F[F.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",F[F.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",F[F.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",F[F.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",F[F.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",F[F.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",F[F.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",F[F.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",F[F.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",F[F.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",F[F.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",F[F.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",F[F.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",F[F.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",F[F.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",F[F.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",F[F.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",F[F.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",F[F.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",F[F.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",F[F.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",F[F.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",F[F.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",F[F.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",F[F.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",F[F.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",F[F.TIMEOUT=-1]="TIMEOUT",exports.ConversationType=void 0,(B=exports.ConversationType||(exports.ConversationType={}))[B.NONE=0]="NONE",B[B.PRIVATE=1]="PRIVATE",B[B.DISCUSSION=2]="DISCUSSION",B[B.GROUP=3]="GROUP",B[B.CHATROOM=4]="CHATROOM",B[B.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",B[B.SYSTEM=6]="SYSTEM",B[B.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",B[B.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",B[B.ULTRA_GROUP=10]="ULTRA_GROUP",B[B.RTC_ROOM=12]="RTC_ROOM";var q,Y,W,K=0,J=1,Q=2,X=3,z=4,Z=5,$=function(e){var t=[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE];switch(e){case K:return t;case J:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP];case Q:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP],!1);case X:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM],!1);case z:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.CUSTOMER_SERVICE,exports.ConversationType.DISCUSSION],!1);case Z:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP]}},ee=function(e,t){return $(t).includes(e)};!function(e){e[e.RMTP=1]="RMTP",e[e.TLS=2]="TLS",e[e.RPP=3]="RPP",e[e.QUIC=4]="QUIC",e[e.WS=5]="WS",e[e.WSS=6]="WSS",e[e.HTTP=11]="HTTP",e[e.HTTPS=12]="HTTPS"}(q||(q={})),exports.FileType=void 0,(Y=exports.FileType||(exports.FileType={}))[Y.IMAGE=1]="IMAGE",Y[Y.AUDIO=2]="AUDIO",Y[Y.VIDEO=3]="VIDEO",Y[Y.FILE=4]="FILE",Y[Y.SIGHT=5]="SIGHT",Y[Y.COMBINE_HTML=6]="COMBINE_HTML",exports.MentionedType=void 0,(W=exports.MentionedType||(exports.MentionedType={}))[W.ALL=1]="ALL",W[W.SINGAL=2]="SINGAL";var te,re,ne,ie,oe,se,ae,ue,le,ce,de,pe,fe,_e,he,ge,Ee,be,ve,Te,Ie,ye={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"};exports.UltraGroupChannelType=void 0,(te=exports.UltraGroupChannelType||(exports.UltraGroupChannelType={}))[te.PUBLIC=0]="PUBLIC",te[te.PRIVATE=1]="PRIVATE",exports.UltraGroupChannelChangeType=void 0,(re=exports.UltraGroupChannelChangeType||(exports.UltraGroupChannelChangeType={}))[re.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",re[re.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",re[re.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN",function(e){e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY",e[e.MSG_RECALL=3]="MSG_RECALL",e[e.CHANNEL_CHANGE=4]="CHANNEL_CHANGE",e[e.USER_GROUP_CHANGE=5]="USER_GROUP_CHANGE",e[e.UG_DEL=6]="UG_DEL"}(ne||(ne={})),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"}(ie||(ie={})),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"}(oe||(oe={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(se||(se={})),exports.SentStatus=void 0,(ae=exports.SentStatus||(exports.SentStatus={}))[ae.SENDING=10]="SENDING",ae[ae.FAILED=20]="FAILED",ae[ae.SENT=30]="SENT",ae[ae.RECEIVED=40]="RECEIVED",ae[ae.READ=50]="READ",ae[ae.DESTROYED=60]="DESTROYED",exports.OperateStatus=void 0,(ue=exports.OperateStatus||(exports.OperateStatus={}))[ue.typing=0]="typing",exports.OnlineStatus=void 0,(le=exports.OnlineStatus||(exports.OnlineStatus={}))[le.ONLINE=1]="ONLINE",le[le.OFFLINE=0]="OFFLINE",exports.Platform=void 0,(ce=exports.Platform||(exports.Platform={}))[ce.Other=0]="Other",ce[ce.iOS=1]="iOS",ce[ce.Android=2]="Android",ce[ce.Web=3]="Web",ce[ce.PC=4]="PC",ce[ce.Mini=5]="Mini",ce[ce.HarmonyOS=6]="HarmonyOS",exports.SubscribeType=void 0,(de=exports.SubscribeType||(exports.SubscribeType={}))[de.ONLINE_STATUS=1]="ONLINE_STATUS",de[de.USER_PROFILE=2]="USER_PROFILE",de[de.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",de[de.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE",exports.SubscribeOperationType=void 0,(pe=exports.SubscribeOperationType||(exports.SubscribeOperationType={}))[pe.SUBSCRIBE=0]="SUBSCRIBE",pe[pe.UNSUBSCRIBE=1]="UNSUBSCRIBE",exports.UserProfileVisibility=void 0,(fe=exports.UserProfileVisibility||(exports.UserProfileVisibility={}))[fe.NOT_SET=0]="NOT_SET",fe[fe.INVISIBLE=1]="INVISIBLE",fe[fe.EVERYONE=2]="EVERYONE",fe[fe.FriendVisible=3]="FriendVisible",exports.RCConnectionStatus=void 0,(_e=exports.RCConnectionStatus||(exports.RCConnectionStatus={}))[_e.CONNECTED=0]="CONNECTED",_e[_e.CONNECTING=1]="CONNECTING",_e[_e.DISCONNECTED=2]="DISCONNECTED",_e[_e.SUSPENDED=3]="SUSPENDED",exports.MessageBlockType=void 0,(he=exports.MessageBlockType||(exports.MessageBlockType={}))[he.GLOBAL=1]="GLOBAL",he[he.CUSTOM=2]="CUSTOM",he[he.THIRD_PARTY=3]="THIRD_PARTY",exports.MessageBlockSourceType=void 0,(ge=exports.MessageBlockSourceType||(exports.MessageBlockSourceType={}))[ge.MSG_ORIGINAL=0]="MSG_ORIGINAL",ge[ge.MSG_EXPANSION=1]="MSG_EXPANSION",ge[ge.MSG_MODIFY=2]="MSG_MODIFY",exports.MessageDirection=void 0,(Ee=exports.MessageDirection||(exports.MessageDirection={}))[Ee.SEND=1]="SEND",Ee[Ee.RECEIVE=2]="RECEIVE",exports.PushImportanceHonor=void 0,(be=exports.PushImportanceHonor||(exports.PushImportanceHonor={})).NORMAL="NORMAL",be.LOW="LOW",function(e){e.IM_NAVI="IM-stats_navi-S",e.IM_WEBSOCKET="IM-stats_websocket-S",e.IM_CONNECTION_DURATION="IM-stats_con_dur-S",e.IM_CMP="IM-stats_cmp-S",e.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",e.IM_STATS_CS="IM-stats_cs-S",e.IM_NETWORK_CHANGE="IM-stats_network_change-S",e.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",e.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",e.IM_MSG_SEND="IM-msg_send-S",e.IM_MSG_RECEIVE="IM-msg_receive-S"}(ve||(ve={})),exports.NotificationLevel=void 0,(Te=exports.NotificationLevel||(exports.NotificationLevel={}))[Te.ALL_MESSAGE=-1]="ALL_MESSAGE",Te[Te.NOT_SET=0]="NOT_SET",Te[Te.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",Te[Te.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",Te[Te.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",Te[Te.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION",exports.NotificationStatus=void 0,(Ie=exports.NotificationStatus||(exports.NotificationStatus={}))[Ie.OPEN=1]="OPEN",Ie[Ie.CLOSE=2]="CLOSE";var me,Re,Se,Ae,Oe,Ce,Ne,Pe,Le,Me=function(e){return e<=exports.NotificationLevel.NOT_SET?exports.NotificationStatus.CLOSE:exports.NotificationStatus.OPEN};exports.ReceivedStatus=void 0,(me=exports.ReceivedStatus||(exports.ReceivedStatus={}))[me.READ=1]="READ",me[me.LISTENED=2]="LISTENED",me[me.DOWNLOADED=4]="DOWNLOADED",me[me.RETRIEVED=8]="RETRIEVED",me[me.UNREAD=0]="UNREAD",function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(Re||(Re={})),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"}(Ae||(Ae={})),function(e){e[e.CURRENT=2]="CURRENT"}(Oe||(Oe={})),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"}(Ne||(Ne={})),exports.InterruptionLevel=void 0,(Pe=exports.InterruptionLevel||(exports.InterruptionLevel={})).PASSIVE="passive",Pe.ACTIVE="active",Pe.TIME_SENSITIVE="time-sensitive",Pe.CRITICAL="critical",exports.PushNotificationQuietHoursLevel=void 0,(Le=exports.PushNotificationQuietHoursLevel||(exports.PushNotificationQuietHoursLevel={}))[Le.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",Le[Le.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",Le[Le.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED";var we,Ue,De={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},xe={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"}(we||(we={})),exports.HttpMethod=void 0,(Ue=exports.HttpMethod||(exports.HttpMethod={})).GET="GET",Ue.POST="POST",Ue.PUT="PUT";var Ge=72e5,Ve=6e4,je=131072,ke="5.30.0".replace(/-.+$/,""),Fe="rongcloudsystem",Be=864e5,He=function(e){return"navi_".concat(e)},qe=function(e,t){return"RC-con-s-ver-".concat(e,"-").concat(t)},Ye=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},We=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},Ke=function(e,t){return"RC-con-type-settings-".concat(e,"-").concat(t)},Je=function(e,t){return"outbox_".concat(e,"_").concat(t)},Qe=function(e,t){return"inbox_".concat(e,"_").concat(t)},Xe=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},ze=function(e,t){return"send_msg_".concat(e,"_").concat(t)},Ze=function(e,t){return"RC-us-".concat(e,"-").concat(t)},$e=function(e){return"rc-static-config-".concat(e)},et=function(e){return"RC-cc-".concat(e)},rt=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},nt=function(e){return"RC-LI-".concat(e)},it=Math.pow(2,31)-1,ot="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};ot.engine="5.30.0";var st=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)&&(ot[e]=t)}}),Object.defineProperty(e,"validEngine",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var r=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return ot.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=r}}),Object.defineProperty(e,"getInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return ot}}),e}();var at={gen:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Math.floor(36*Math.random());return("x"===e?t:3&t|8).toString(36)}))},genWithLen:function(e){void 0===e&&(e=22);var t,r=Date.now(),n=r.toString(36),i=Math.floor(Math.random()*r).toString(36),o=e-n.length-i.length;return[i,n,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},ut=at.genWithLen(22),lt=Date.now(),ct=function(e){return"string"==typeof e},dt=function(e){return"number"==typeof e&&!Number.isNaN(e)},pt=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},ft=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},_t=function(e){return function(t){return ct(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))}},ht=function(e){return ct(e)&&e.length>0},gt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Et=function(e){return"function"==typeof e},bt=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},vt=function(e){return ct(e)&&/https?:\/\//.test(e)},Tt=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},It=function(e){return dt(e)&&Object.prototype.hasOwnProperty.call(exports.ConversationType,e)},yt=function(e){return dt(e)&&Object.prototype.hasOwnProperty.call(exports.NotificationLevel,e)},mt=function(e){var t=!1;return ct(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},Rt=function(e){return _t({minLength:1,maxLength:64})(e)},St=function(e){if(!gt(e)||void 0===e.low||void 0===e.high)return e;var t=e.low;return t<0&&(t+=4294967296),t=t.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(t.length,"}$")),t),16)},At=function(){return"undefined"!=typeof RCCppEngine},Ot=function(e){return{isRead:(e&exports.ReceivedStatus.READ)===exports.ReceivedStatus.READ,isListened:(e&exports.ReceivedStatus.LISTENED)===exports.ReceivedStatus.LISTENED,isDownload:(e&exports.ReceivedStatus.DOWNLOADED)===exports.ReceivedStatus.DOWNLOADED,isRetrieved:(e&exports.ReceivedStatus.RETRIEVED)===exports.ReceivedStatus.RETRIEVED}},Ct=function(e){return[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.HarmonyOS].map((function(t){var r=e.findIndex((function(e){return e.platform===t}));return-1===r?{platform:t,changeTime:0,eventValue:0}:e[r]}))},Nt=function(e,t,r){var n=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return n.userId=e,r.forEach((function(e){n.extraProfile=n.extraProfile||{},n.extraProfile[e.key]=e.value})),n},Pt=function(e,t,r){return t?1===r?q.TLS:q.RMTP:"http"===e?q.WS:q.WSS},Lt=function(e,t){var r=e.server,n=e.backupServer,i=e.bs,o=e.serverAddr,s=e.protocol,a=e.openTLS;if(o)return l([],u(o.filter((function(e){return e.addr}))),!1);var c=[],d=[];return r&&d.push(r),(n||i||"").split(",").forEach((function(e){d.indexOf(e)<0&&d.push(e)})),d.forEach((function(e,n){e&&c.push({addr:e,protocol:Pt(s,t,a),weight:r.length-n,race:!1})})),l([],u(c),!1)},Mt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t,r,n,i,o,s,a,u,l,c=Gt(e.settingProfile)||{},d=e.extProfile||[],p=e.targetId,f=e.baseInfo,_=e.userInfo;return{groupId:p,groupName:null!==(t=c.name)&&void 0!==t?t:"",portraitUri:null!==(r=c.portraitUrl)&&void 0!==r?r:"",introduction:null!==(n=c.introduction)&&void 0!==n?n:"",notice:null!==(i=c.announcement)&&void 0!==i?i:"",extProfile:Gt(d),joinPermission:~~c.joinPerm,removeMemberPermission:~~c.removePerm,invitePermission:~~c.memInvitePerm,inviteHandlePermission:~~c.invitePerm,groupInfoEditPermission:~~c.profilePerm,memberInfoEditPermission:~~c.memProfilePerm,creatorId:null!==(o=null==f?void 0:f.creatorId)&&void 0!==o?o:"",ownerId:null!==(s=null==f?void 0:f.ownerId)&&void 0!==s?s:"",createTime:(null==f?void 0:f.createTime)?St(f.createTime):0,membersCount:null!==(a=null==f?void 0:f.memberCount)&&void 0!==a?a:0,remark:null!==(u=null==_?void 0:_.remarkName)&&void 0!==u?u:"",joinedTime:(null==_?void 0:_.joinTime)?St(_.joinTime):0,role:null!==(l=null==_?void 0:_.role)&&void 0!==l?l:exports.GroupMemberRole.UNDEF}}))},wt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Gt(e.settingProfile),r=e.extProfile||[],i=e.targetId,o=e.baseInfo,s=e.userInfo;return JSON.parse(JSON.stringify(n(n({groupId:i},Dt(t)),{extProfile:r.length>0?Gt(r):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:(null==o?void 0:o.createTime)?St(o.createTime):void 0,membersCount:null==o?void 0:o.memberCount,remark:null==s?void 0:s.remarkName})))}))},Ut=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},Dt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Ut(e.joinPerm),removeMemberPermission:Ut(e.removePerm),invitePermission:Ut(e.memInvitePerm),inviteHandlePermission:Ut(e.invitePerm),groupInfoEditPermission:Ut(e.profilePerm),memberInfoEditPermission:Ut(e.memProfilePerm)}))},xt=function(e){void 0===e&&(e=[]);var t=e.map((function(e){var t=e||{},r=t.ext,n=t.userId,i=t.name,o=t.portraitUrl,s=r||{},a=s.role,u=s.joinTime,l=s.channelNickName,c=s.additional;return{userId:n,name:i||"",portraitUri:o||"",nickname:l||"",role:a||exports.GroupMemberRole.UNDEF,joinedTime:St(u)||0,extra:c||""}}));return t},Gt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Vt=function(e){var t,r,n,i;return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",nickname:null===(t=e.ext)||void 0===t?void 0:t.channelNickName,extra:null===(r=e.ext)||void 0===r?void 0:r.additional,role:null===(n=e.ext)||void 0===n?void 0:n.role,joinedTime:null===(i=e.ext)||void 0===i?void 0:i.joinTime}},jt=function(e){var t=e.joinUserInfo,r=e.inviterInfo,n=e.processInfo;return{groupId:e.targetId,joinMemberInfo:Vt(t),inviterInfo:r&&r.userId?Vt(r):void 0,operatorInfo:n&&n.userId?Vt(n):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},kt=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var r=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return r.length?[e,r.join("&")].join("?"):e};function Ft(e){for(var t=null===window||void 0===window?void 0:window.atob(e),r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r.buffer}var Bt,Ht=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=at.gen(),i=function(e){e=e||"-";var t=new Date,r=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();return"".concat(r).concat(e).concat(n).concat(e).concat(i)}(),o=(new Date).getTime(),s="";if(t){var a=t.split(".");s=".".concat(a[a.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(r,"_").concat(o).concat(n).concat(s)},qt=function(e,t,r){void 0===e&&(e=0);var i=function(e){return{isVoipPush:!!(1&e),isFilerWhiteBlacklist:!!(2&e),disablePushTitle:!!(4&e),forceShowDetailContent:!!(8&e)}}(e),o=i.disablePushTitle,s=i.forceShowDetailContent,a=Yt(null==r?void 0:r.pushConfigs,null==r?void 0:r.pushId);return n({pushTitle:(null==r?void 0:r.title)||"",pushContent:t||"",pushData:"",disablePushTitle:o,forceShowDetailContent:s,templateId:null==r?void 0:r.templateId},a)},Yt=function(e,t){var r={},n={notificationId:t||""},i={};if(!e)return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,s,a,u,l,c,d,p,f,_,h,g=Object.keys(e);if(0!==g.length){var E=g[0];switch(E){case"HW":return n.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,n.importanceHW=null===(o=e[E])||void 0===o?void 0:o.importance,n.imageUrlHW=null===(s=e[E])||void 0===s?void 0:s.image,void(n.categoryHW=null===(a=e[E])||void 0===a?void 0:a.category);case"MI":return void(n.channelIdMi=null===(u=e[E])||void 0===u?void 0:u.channelId);case"OPPO":return void(n.channelIdOPPO=null===(l=e[E])||void 0===l?void 0:l.channelId);case"VIVO":return n.typeVivo=null===(c=e[E])||void 0===c?void 0:c.classification,void(n.categoryVivo=null===(d=e[E])||void 0===d?void 0:d.category);case"APNS":return r.threadId=e[E]["thread-id"],r.apnsCollapseId=e[E]["apns-collapse-id"],r.category=e[E].category,r.richMediaUri=e[E].richMediaUri,void(r.interruptionLevel=e[E]["interruption-level"]);case"FCM":return void(n.googleConfig={collapseKey:e[E].collapse_key||"",imageUrl:e[E].imageUrl||"",priority:e[E].priority||""});case"HONOR":return n.importanceHonor=null===(p=e[E])||void 0===p?void 0:p.importance,void(n.imageUrlHonor=null===(f=e[E])||void 0===f?void 0:f.image);case"OHOS":i.category=null===(_=e[E])||void 0===_?void 0:_.category,i.image=null===(h=e[E])||void 0===h?void 0:h.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}},Wt=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),r=e.length;return t&&(r<=128&&r>=1)},Kt=function(e){var t=e.length;return t<=4096&&t>=1},Jt=(Bt=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),r=e+Bt.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return Bt=2047&++Bt,parseInt(r,2)}),Qt=function(){var e=st.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t},Xt=function(e,t,r){return o(void 0,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return n=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(r)},n,Ft(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function zt(e,t){var r;if(!e)return"";var n="undefined"!=typeof window&&"https:"===(null===(r=null===window||void 0===window?void 0:window.location)||void 0===r?void 0:r.protocol);return/^https?:\/\//.test(e)?n?e.replace(/^https?:\/\//i,"https://"):e:t!==q.HTTP||n?"https://".concat(e):"http://".concat(e)}var Zt=function(e,t){if(!e)return"";var r=e.ossConfig,n=void 0===r?"":r,i="";try{var o=JSON.parse(n);if(o.length>0){var s=o.find((function(e){return e.minio}));s&&(i=s.minio)}}catch(e){t.warn(H.L_PARSE_JSON_E,JSON.stringify({ossConfig:n,error:e}))}return i};var $t,er=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCError",r}return t(r,e),Object.defineProperty(r,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new r("Invalid parameter -> ".concat(e)):new r("Invalid parameters.")}}),Object.defineProperty(r,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new r("Wrong parameter type")}}),r}(Error),tr=function(){function e(){$t.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){d(this,$t,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return c(this,$t,"f")},enumerable:!1,configurable:!0}),e}();$t=new WeakMap;var rr=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_piped",{enumerable:!0,configurable:!0,writable:!0,value:new Set})}return Object.defineProperty(e.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===i&&(i=0);var o=Symbol(),s=this._map.get(e)||this._map.set(e,[]).get(e),a={symbol:o,priority:Math.min(i,100),listener:t.bind(n),once:r},u=s.findIndex((function(e){return e.priority>i}));return-1===u?s.push(a):s.splice(u,0,a),o}}),Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!1,r,n)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!0,r,n)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;try{for(var n=a(this._map),i=n.next();!i.done;i=n.next()){var o=u(i.value,2),s=(o[0],o[1]),l=s.findIndex((function(t){return t.symbol===e}));if(-1!==l)return void s.splice(l,1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map.get(e);if(n&&n.length>0)for(var i=new tr,o=0;o<n.length;o+=1){var s=n[o],a=s.once,c=s.listener;a&&n.splice(o,1);try{c.apply(void 0,l([i],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}l([],u(this._piped.values()),!1).forEach((function(r){return r.emit.apply(r,l([e],u(t),!1))}))}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._map.delete(e)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._piped.clear(),this._map.clear()}}),Object.defineProperty(e.prototype,"pipe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._piped.add(e)}}),e}(),nr=function(e){function r(t){var r=e.call(this)||this;return Object.defineProperty(r,"_name",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(r,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(r,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r}return t(r,e),Object.defineProperty(r.prototype,"length",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setInitVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,(function(){return s(this,(function(r){return-1!==this._dataVersion||(this._dataVersion=e,t&&this._execPulling()),[2]}))}))}}),Object.defineProperty(r.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e<this._dataVersion||(this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling())}}),Object.defineProperty(r.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return this._pullingPromise?[2]:(this._pullingPromise=this._handleSyncData(this._dataVersion),[4,this._pullingPromise]);case 1:if(e=s.sent(),t=e.isOk,r=e.data,this._pullingPromise=null,!t)return[2];if(void 0===(null==r?void 0:r.version)||r.version<this._dataVersion)throw new Error("".concat(this._name,": version error, please check: lastVersion: ").concat(this._dataVersion,", newVersion: ").concat(null==r?void 0:r.version));return n=r.version,i=r.hasNext,o=this._versionQueue.filter((function(e){return e>n})),this._versionQueue=l([],u(o),!1),this._dataVersion=n,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[2,this._execPulling()]):[2]}}))}))}}),Object.defineProperty(r.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((function(){return r._execPulling()}),e))}}),Object.defineProperty(r.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(r.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}),r}(rr),ir=function(){function e(e,t){var r=this;Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onCancel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(t){r._resolve=t,e(r._onResolve.bind(r))})),this._onCancel=t}return Object.defineProperty(e.prototype,"_onResolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),Object.defineProperty(e.prototype,"abort",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._onCancel(this._onResolve.bind(this))}}),e}();!function(){function e(e,t){var r=this;Object.defineProperty(this,"handler",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"validate",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_handlerPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:null}),this._handlerPromise=new Promise((function(e){r._resolve=e}))}Object.defineProperty(e.prototype,"add",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){if(!this._resolve)throw new Error("BatchSync is closed");return this.validate&&!this.validate(e)||this._data.add(e),[2,this._handlerPromise]}))}))}}),Object.defineProperty(e.prototype,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:if(!this._resolve)throw new Error("BatchSync is closed");return e=this._resolve,this._resolve=null,t=l([],u(this._data.values()),!1),this._data.clear(),t.length>0?[4,this.handler(t)]:[3,2];case 1:r.sent(),r.label=2;case 2:return e(),[2,Promise.resolve()]}}))}))}})}();var or=function(){function e(e,t,r){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=r}return Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this.isOk?[2,e(this.data)]:[2,this.wipe()]}))}))}}),Object.defineProperty(e.prototype,"or",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this.isOk?[2,this]:[2,e(this.code)]}))}))}}),Object.defineProperty(e.prototype,"orSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?this:e(this.code)}}),Object.defineProperty(e.prototype,"trans",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?sr(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?sr(void 0,this.msg):ar(this.code,this.msg)}}),e}(),sr=function(e,t){return new or(0,t||"success",e)},ar=function(e,t,r){return new or(e,t||"fail: ".concat(e),r)},ur=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,r){return void 0===r&&(r=!1),this.isFailed&&(0===this._code||r)&&(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?ar(this._code,this._errmsg):sr()}}),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,r,n){if(void 0===n&&(n=!1),this.isFailed)return this;var i=n?r(t):null==t||r(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,r,n){if(void 0===n&&(n=!1),this.isFailed)return this;if(this.validate(e,t,r,n),this.isFailed)throw er.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"isHttpUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isNotEmptyString(e,t,r).validate(e,t,(function(e){return/^https?:\/\//.test(e)}))}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isString(e,t,r).validate(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assertString(e,t,r),this.assert(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isLimitedInteger(e,t,0,0xe677d21fdbff,r)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.isArray(e,t,n).validate(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isArray(e,t,n).validate(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,r,i,o).validate(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,r,i,o),this.assert(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"isValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.validate(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"function"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"function"==typeof e}),r)}}),e}(),lr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function cr(e){var t,r,n,i,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=lr.indexOf(e.charAt(u++))<<2|(i=lr.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=lr.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(s=lr.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(r)),64!==s&&(a+=String.fromCharCode(n));return a}var dr,pr=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},fr=1732584193,_r=4023233417,hr=2562383102,gr=271733878,Er=[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],br=[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 vr(e,t){return e<<t|e>>>32-t}function Tr(e,t,r){return e&r|t&~r}function Ir(e,t,r){return e^t^r}function yr(e,t,r){return t^(e|~r)}function mr(e){for(var t=[],r=0;r<e.length;r+=4)t.push((e[r]||0)|(e[r+1]||0)<<8|(e[r+2]||0)<<16|(e[r+3]||0)<<24);return t}function Rr(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 Sr(e){var t=8*e.length,r=e.length%64<56?56-e.length%64:120-e.length%64,n=new Uint8Array(e.length+r+8);n.set(e),n[e.length]=128;for(var i=1;i<r;i++)n[e.length+i]=0;var o=new Uint8Array(8),s=4294967295&t,a=4294967295&Math.floor(t/4294967296);o.set(Rr(s),0),o.set(Rr(a),4),n.set(o,e.length+r);var u,l=fr,c=_r,d=hr,p=gr;for(i=0;i<n.length;i+=64){for(var f=mr(n.slice(i,i+64)),_=l,h=c,g=d,E=p,b=0;b<64;b++){var v=void 0,T=void 0;b<16?(v=(u=c)&d|~u&p,T=b):b<32?(v=Tr(c,d,p),T=(5*b+1)%16):b<48?(v=Ir(c,d,p),T=(3*b+5)%16):(v=yr(c,d,p),T=7*b%16);var I=p;p=d,d=c,c+=vr(l+v+br[b]+f[T]&4294967295,Er[b]),l=I}l=l+_&4294967295,c=c+h&4294967295,d=d+g&4294967295,p=p+E&4294967295}var y=new Uint8Array(16);return y.set(Rr(l),0),y.set(Rr(c),4),y.set(Rr(d),8),y.set(Rr(p),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(y)}function Ar(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 Sr(t)}function Or(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||Ve,n=e.headers,i=e.query,o=e.body,s=e.onProgress,a=kt(e.url,i),u=new XMLHttpRequest;if(u.open(t,a),n&&u.setRequestHeader)for(var l in n)u.setRequestHeader(l,n[l]);return function(e,t,r,n){return new ir((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},n&&(e.upload.onprogress=function(e){return n(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(r)}),(function(t){e.abort(),t({status:-1})}))}(u,r,o,s)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(dr||(dr={}));var Cr,Nr,Pr=0,Lr={DEFAULT:0,MODIFIED:1,RECALLED:2,DELETE:3},Mr={TranslationLanguage:0,AutoTranslateEnable:1};exports.AreaCode=void 0,(Nr=exports.AreaCode||(exports.AreaCode={}))[Nr.BJ=1]="BJ",Nr[Nr.SG=2]="SG",Nr[Nr.NA=3]="NA",Nr[Nr.SG_A=4]="SG_A",Nr[Nr.SG_B=4]="SG_B",Nr[Nr.SA=5]="SA";var wr=((Cr={})[exports.AreaCode.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Cr[exports.AreaCode.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Cr[exports.AreaCode.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Cr[exports.AreaCode.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Cr[exports.AreaCode.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Cr);function Ur(e){return exports.AreaCode[e]?e:exports.AreaCode.BJ}var Dr,xr=function(){function e(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.initOption=e}}),Object.defineProperty(e.prototype,"getNaviUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this.initOption||{},i=n.areaCode,o=n.navigators,s=(r=i,void 0===r&&(r=exports.AreaCode.BJ),wr[Ur(r)].naviUrlBase64).map((function(e){return cr(e)})),a=[],c=u(e.split("@"),2)[1];t&&(a=c?c.split(";"):[]);var d=o&&o.length>0?l(l([],u(a),!1),u(o),!1):l(l([],u(a),!1),u(s),!1);return d.filter((function(e,t){return d.indexOf(e)===t})).map((function(e){return zt(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,i=e||{},o=i.log,s=i.logPolicy,a=this.initOption||{},c=a.areaCode,d=a.logServerUrl,p=(r=c,void 0===r&&(r=exports.AreaCode.BJ),wr[Ur(r)].logUrlBase64).map((function(e){return n(n({},e),{addr:cr(e.addr)})})),f=[],_={level:1,itv:6,times:5};if(o)f.push.apply(f,l([],u(o.addrs),!1)),Object.assign(_,o.policy);else if(s)try{var h=JSON.parse(s);f.push({addr:h.url,protocol:q.HTTPS,weight:1}),_.level=h.level,_.itv=h.itv,_.times=h.times}catch(r){t.warn(H.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var g=d?l([{addr:d,protocol:q.HTTPS,weight:101}],u(f),!1):l(l([],u(f),!1),u(p),!1);return{policy:_,addrs:g.filter((function(e,t){return g.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return n(n({},e),{addr:zt(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,r=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=exports.AreaCode.BJ),wr[Ur(t)].miniCmpBase64).map((function(e){return cr(e)})),n=(this.initOption||{}).miniCMPProxy;return n&&n.length>0?n:r}}),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=exports.AreaCode.BJ),wr[Ur(t)].staticConfigUrlBase64).map((function(e){return cr(e)}))}}),Object.defineProperty(e.prototype,"getCloudControllerUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(r=n,void 0===r&&(r=exports.AreaCode.BJ),wr[Ur(r)].cloudControllerUrlBase64).map((function(e){return cr(e)}))}}),Object.defineProperty(e.prototype,"getAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:exports.AreaCode.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!exports.AreaCode[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=e||{},i=n.active,o=n.activeServer,s=(null==i?void 0:i.addrs)||[],a=(r=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===r&&(r=exports.AreaCode.BJ),wr[Ur(r)].statsUrlBase64).map((function(e){return cr(e)})),c=[];return 0!==s.length?c.push.apply(c,l([],u(s.sort((function(e,t){return t.weight-e.weight})).map((function(e){return zt(e.addr,e.protocol)}))),!1)):o&&c.push(zt(o,q.HTTPS)),a.forEach((function(e){c.includes(e)||c.push(e)})),c}}),e}(),Gr=new xr,Vr=function(){function e(e,t){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticUrls",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"getStaticConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:if(!(t=this.getCache()))return[3,6];s.label=1;case 1:return s.trys.push([1,4,,5]),r=JSON.parse(t),Date.now()-(null==r?void 0:r.time)<18e5?[4,this.decryptData(r.val)]:[3,3];case 2:return n=s.sent(),(i=n.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return zt(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=s.sent(),this.logger.error(H.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),s.label=6;case 6:return[4,this._requestHandle()];case 7:return(a=s.sent())?[4,this.decryptData(a)]:[2];case 8:return(null==(u=s.sent())?void 0:u.areaCode)!==Gr.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:a})),this.staticUrls=(null==u?void 0:u.bootstrap)||[],(l=null===(e=null==u?void 0:u.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:l.map((function(e){return zt(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,c,d,p,f,_;return s(this,(function(s){switch(s.label){case 0:e=(e=l(l([],u(this.staticUrls),!1),u(Gr.getStaticConfigUrl()),!1).map((function(e){return zt(e)}))).filter((function(t,r){return e.indexOf(t)===r})),s.label=1;case 1:s.trys.push([1,6,7,8]),t=a(e),r=t.next(),s.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(H.L_GET_STATIC_CONF_T,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(o=s.sent(),c=o.code,d=o.data,200===c)return this.logger.info(H.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),[2,d];this.logger.warn(H.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),s.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return p=s.sent(),f={error:p},[3,8];case 7:try{r&&!r.done&&(_=t.return)&&_.call(t)}finally{if(f)throw f.error}return[7];case 8:return[2]}}))}))}}),e}();exports.LogL=void 0,(Dr=exports.LogL||(exports.LogL={}))[Dr.STATISTICS=-2]="STATISTICS",Dr[Dr.RECORD=-1]="RECORD",Dr[Dr.FATAL=0]="FATAL",Dr[Dr.ERROR=1]="ERROR",Dr[Dr.WARN=2]="WARN",Dr[Dr.INFO=3]="INFO",Dr[Dr.DEBUG=4]="DEBUG";var jr,kr,Fr=function(){function e(e,t,r,n){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:exports.LogL.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.STATISTICS)}),Object.defineProperty(this,"record",{enumerable:!0,configurable:!0,writable:!0,value:this.__statistics})}return Object.defineProperty(e.prototype,"_write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.tag,r=e.level,n=e.content,i=e.traceId;/^[\w-]+$/.test(t)?r!==exports.LogL.DEBUG&&this.logDB.write(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(n," | ").concat(i))}}),Object.defineProperty(e.prototype,"createTraceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"".concat(++e._traceIdCount)}}),Object.defineProperty(e.prototype,"getSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return ut}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,r=e.tag,n=e.content,i=e.traceId,o=e.level,s=e.loggerId;if(console&&!(o<=exports.LogL.FATAL||o>this.outputLevel)){var a=["error","warn","info","debug"][o-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=s?s:this._id,"][").concat((a||"stat").toUpperCase(),"]: ").concat(r," | ").concat(n," | ").concat(i);console[a||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[exports.LogL.DEBUG,exports.LogL.INFO,exports.LogL.WARN,exports.LogL.ERROR].some((function(t){return t===e}))})(e)&&(this.outputLevel=e)}}),Object.defineProperty(e.prototype,"_log",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i={time:Date.now(),level:e,tag:t,content:r,traceId:n,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(i),this._write(i)}}),Object.defineProperty(e.prototype,"summary",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o,s){if(void 0===i&&(i={}),t.isOk){var a=null==o?void 0:o(t.data);this.info(e,JSON.stringify(n(n({isOk:!0},i),a)),r)}else{a=null==s?void 0:s(t.data);this.warn(e,JSON.stringify(n(n({code:t.code,msg:t.msg},i),a)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),Br=function(){function e(e,t,r,n,i,o){void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}return Object.defineProperty(e.prototype,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c=this;return s(this,(function(s){switch(s.label){case 0:o=[],s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.logDB.read(e,t,r,n,a)];case 2:return u=s.sent(),ft(u.logs)?o=u.logs.filter((function(e){return!(!e||"object"!=typeof e)||(c.logger.warn(H.L_REALTIME_LOG_R,"Invalid log entry: not an object",i),!1)})):this.logger.warn(H.L_REALTIME_LOG_R,"Invalid logs result: not an array",i),[3,4];case 3:return l=s.sent(),this.logger.warn(H.L_REALTIME_LOG_R,"Error getting logs: ".concat(l instanceof Error?l.message:String(l)),i),[3,4];case 4:return[2,{logs:o}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=Gr.getLogUrlPolicyList(e,this.logger),n=r.policy,i=r.addrs,this.started=!0,this.itvByNavi=n.itv,this.timesByNavi=n.times,i.length>0&&this.realtimeReport(i[0].addr,n.level,n.itv,t)),[2])}))}))}}),Object.defineProperty(e.prototype,"_sendLogs2Realtime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p,f,_;return s(this,(function(s){switch(s.label){case 0:return this.logger.debug(H.L_REALTIME_LOG_O,"compress logs: ".concat(e.length)),[4,this.compressLogs(e)];case 1:return i=s.sent(),o=i.success,a=i.data,o?(this.logger.debug(H.L_REALTIME_LOG_O,"compress done",t),u=vt(r)?r:"https://".concat(r),u+="?version=".concat("5.30.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:a,method:"POST"})]):(this.logger.warn(H.L_REALTIME_LOG_R,"compress failed",t),[2,{isOk:!1,itv:n}]);case 2:if(l=s.sent(),c=l.status,d=l.data,this.logger.debug(H.L_REALTIME_LOG_R,JSON.stringify({status:c,data:d}),t),200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(n+=n),this.reportFailedNumber++,[2,{isOk:!1,itv:n}];if(this.reportFailedNumber=0,d)try{(_=JSON.parse(d)).nextTime&&(n=_.nextTime),p=_.level,f=_.logSwitch}catch(e){this.logger.warn(H.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:p,logSwitch:f}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,c,d,p,f,_,h,g,E=this;return s(this,(function(s){switch(s.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||lt,a=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),this.logger.debug(H.L_REALTIME_LOG_T,JSON.stringify({startTime:o,endTime:a,level:t,itv:r}),c),[4,this._getLogs(o,a,t,!0,c,n)];case 1:return 0!==(d=s.sent().logs).length?[3,2]:(this.logger.debug(H.L_REALTIME_LOG_R,"no logs",c),[3,4]);case 2:return d.length>0?[4,this._sendLogs2Realtime(d,c,e,r)]:[3,4];case 3:p=s.sent(),f=p.itv,_=p.level,h=p.logSwitch,p.isOk&&(g=Math.max.apply(Math,l([],u(d.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(g+1),0===h&&(this.started=!1),void 0!==_&&(t=_)),r=f,s.label=4;case 4:return this.started&&(r>=60&&this.itvByNavi<60&&(r=60),this.timer=setTimeout((function(){return E.realtimeReport(e,t,r,n)}),1e3*r)),[2]}}))}))}}),Object.defineProperty(e.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a,u){return void 0===u&&(u=!1),o(this,void 0,void 0,(function(){var o,l,c,d,p,f,_,h;return s(this,(function(s){switch(s.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(o=this.logger.createTraceId(),this.logger.info(H.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:a,isCloudControl:u}),o),[4,this._getLogs(e,t,exports.LogL.DEBUG,!1,o)]);case 1:return l=s.sent().logs,this.logger.info(H.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),o),c=vt(n)?n:"https://".concat(n),c+="?version=".concat("5.30.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 p=s.sent(),f=p.success,_=p.data,d=f?_:"compress failed",[3,4];case 3:d="no data or no database",s.label=4;case 4:return this.logger.debug(H.L_REPORT_FULL_LOG_O,"compress done",o),u&&(c+="&source=cloud"),[4,this.send({url:c,body:d,method:"POST"})];case 5:return h=s.sent().status,this.logger.info(H.L_REPORT_FULL_LOG_R,JSON.stringify({status:h}),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}(),Hr=function(e){var t=e.sessionId,r=e.level,n=e.loggerId,i=e.traceId,o=e.time,s=e.tag,a=e.type,u=e.content;ct(u)||(u=JSON.stringify(u));var l=r<0?u||"":JSON.stringify({content:u,traceId:i,from:n});return l='"'.concat(l.replace(/"/g,'""'),'"'),"".concat(t,",").concat(o,",").concat(a,",").concat(r,",").concat(s,",").concat(l,"\n")};function qr(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 Yr(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{logs:[]}]}))}))}function Wr(){}var Kr=function(){function e(e,t){jr.set(this,void 0),kr.set(this,void 0),d(this,jr,e,"f"),d(this,kr,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,c(this,jr,"f").call(this,e,t,r,n,i)];case 1:return(o=s.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(qr)}]:[2,{logs:[]}];case 2:return a=s.sent(),console.error("[LogDBProxy] read error",a),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{c(this,kr,"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,jr,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&d(this,kr,e,"f"),this}}),e}();function Jr(){return new Kr(Yr,Wr)}jr=new WeakMap,kr=new WeakMap;var Qr,Xr=function(){function e(){}var t,r,n,i,o,s;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,t,"f",r)||(d(this,t,e,"f",r),e.info(H.L_EVENT_LOOP_BLOCKING_S,"start"),c(this,t,"m",s).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,t,"f",r)&&(c(this,t,"f",r).info(H.L_EVENT_LOOP_BLOCKING_S,"stop"),d(this,t,null,"f",r),c(this,t,"f",n)&&(clearTimeout(c(this,t,"f",n)),d(this,t,null,"f",n)))}}),t=e,s=function e(){var s=this,a=Date.now();d(this,t,setTimeout((function(){var n=Date.now()-a;n>=c(s,t,"f",o)&&c(s,t,"f",r).warn(H.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(n,"ms")),c(s,t,"m",e).call(s)}),c(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},o={value:1500},e}();!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(Qr||(Qr={}));var zr=function(){function e(e){Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"uploadTask",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"taskLock",{enumerable:!0,configurable:!0,writable:!0,value:!0})}return Object.defineProperty(e.prototype,"uploadLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.uploadTask.push(e),this.enqueueTask()}}),Object.defineProperty(e.prototype,"reportLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o=this;this.taskLock=!1;var s=null!==(t=e.startTime)&&void 0!==t?t:0,a=null!==(r=e.endTime)&&void 0!==r?r:0,u=null!==(n=e.platform)&&void 0!==n?n:"",l=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==l&&(this.logId=e.logId,this.reporter.report(s,a,u,l,e.logId,"",!0).finally((function(){o.taskLock=!0,o.uploadTask.length>0&&o.enqueueTask()})))}}),Object.defineProperty(e.prototype,"enqueueTask",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.taskLock){var e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}}}),e}();var Zr,$r,en,tn,rn=function(){function e(e,t,r){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isEable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"expire",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"interval",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"lastRequestTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uploadTaskManage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"changeAreaCode",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.uploadTaskManage=new zr(r)}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(){try{var e=this.getLocalCloudControllerCache();this._cache=e?JSON.parse(e):{timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}catch(e){this._cache={timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}this._cache&&(this.interval=this._cache.cc.interval,this.expire=this._cache.cc.expire,this.timestamp=this._cache.timestamp||0,this.isEable=this._cache.cc.enable,this.lastRequestTime=this._cache.lastRequestTime,this.logCmdMsgTasks(this._cache),this.setMRTRConfig(this._handleMrtrData(this._cache.mrtr)))}}),Object.defineProperty(e.prototype,"isExire",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.timestamp<this.expire}}),Object.defineProperty(e.prototype,"isOverclock",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.lastRequestTime<this.interval}}),Object.defineProperty(e.prototype,"logCmdMsgTasks",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.uploadLog&&e.uploadLog.tasks.forEach((function(e){e.objectName===ye.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,Tt(e)&&(t.timestamp=e.timestamp,e.uploadLog&&!e.uploadLog.temporary&&(t.uploadLog=e.uploadLog),e.cc&&!e.cc.temporary&&(t.cc=e.cc),e.mrtr&&!e.mrtr.temporary&&(t.mrtr=this._handleMrtrData(e.mrtr)),e.mrtr&&this.setMRTRConfig(this._handleMrtrData(e.mrtr))),this.setCloudControllerCache(t),this.expire=t.cc.expire,this.interval=t.cc.interval,this.timestamp=t.timestamp,this.logCmdMsgTasks(e)}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:return!this.isEable&&t===Qr.init&&this.isExire()?(this.logger.info(H.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===Qr.newWorkChange&&this.isOverclock()?(this.logger.info(H.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=zt(e),this.lastRequestTime=(new Date).getTime(),i="".concat(n,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},r&&(o["RC-Token"]=r),a={platform:"web",version:"5.30.0",timestamp:this.timestamp},this.logger.record(ve.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,exports.HttpMethod.POST,o,a)]);case 1:return u=s.sent(),l=u.code,c=u.data,this.logger.record(ve.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===exports.ErrorCode.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(d=c.targetRegion,this.changeAreaCode===d?[2,this.timestamp]:(p=Gr.setAreaCode(d),this.logger.info(H.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:p,originAreaCode:Gr.getAreaCode(),newAreaCode:d})),this.changeAreaCode=d,(f=Gr.getCloudControllerUrl(d))[0]?[2,this.request(f[0],Qr.other)]:(this.logger.info(H.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:i,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))}}),Object.defineProperty(e.prototype,"_handleMrtrData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return{chatroom:(null==e?void 0:e.chatroom)||0,group:(null==e?void 0:e.group)||0,private:(null==e?void 0:e.private)||0,ultraGroup:(null==e?void 0:e.ultraGroup)||0,temporary:!!(null==e?void 0:e.temporary)}}}),e}(),nn=function(e){return e===exports.ErrorCode.RC_CONN_REDIRECTED},on=function(e){function r(t,r,n){var i=e.call(this)||this;return Zr.add(i),Object.defineProperty(i,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_fromSuspend",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"curCmpUrl",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"uuid",{enumerable:!0,configurable:!0,writable:!0,value:""}),tn.set(i,0),Object.defineProperty(i,"_doConnectReason",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_network",{enumerable:!0,configurable:!0,writable:!0,value:{status:!0,type:we.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:exports.RCConnectionStatus.DISCONNECTED}),Object.defineProperty(i,"_crtUserId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"cmpWeightCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_crtConnectionTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_failedCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"ALLOW_FAILED_TIMES",{enumerable:!0,configurable:!0,writable:!0,value:2}),i}return t(r,e),Object.defineProperty(r.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(r.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(r.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===exports.RCConnectionStatus.DISCONNECTED&&e===exports.RCConnectionStatus.CONNECTING&&(this._doConnectReason=Ne.CONNECT,c(this,Zr,"m",en).call(this)),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED&&e===exports.RCConnectionStatus.SUSPENDED&&(t===exports.ErrorCode.RC_PING_EXCEED_LIMIT?this._doConnectReason=Ne.TIMEOUT:t===exports.ErrorCode.RC_CONN_REDIRECTED?this._doConnectReason=Ne.REDIRECTED:this._doConnectReason=Ne.RECONNECT),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED){var r={bid:Qt(),cod:t,net:this.getNetwork().type,dur:Date.now()-c(this,tn,"f"),cid:this.cid};this.logger.record(ve.IM_CONNECTION_DURATION,JSON.stringify(r)),e===exports.RCConnectionStatus.SUSPENDED&&c(this,Zr,"m",en).call(this)}switch(this._crtConnectionStatus=e,e){case exports.RCConnectionStatus.CONNECTED:this.logger.info(H.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),c(this,Zr,"m",$r).call(this).emit("onConnected",this._fromSuspend);break;case exports.RCConnectionStatus.CONNECTING:this.logger.warn(H.L_CONNECT_S,"status: ".concat(e)),c(this,Zr,"m",$r).call(this).emit("onConnecting");break;case exports.RCConnectionStatus.SUSPENDED:this._fromSuspend=!0,this.logger.warn(H.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),nn(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,Zr,"m",$r).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(H.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,Zr,"m",$r).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(r.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t){var r={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(ve.IM_NETWORK_CHANGE,JSON.stringify(r))}this._network=e}}),Object.defineProperty(r.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(r.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED?[2,sr(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2,ar(o)]):(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2,sr(a)])}}))}))}}),Object.defineProperty(r.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,r,n,i),[4,this._crtConnectionTask]);case 1:return o=s.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(r.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,p,f,_,h,g;return s(this,(function(s){switch(s.label){case 0:return o={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(ve.IM_STATS_CS,JSON.stringify(o)),a={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,r,!1,n,a)];case 1:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,ar(l)]:1===(p=c).type?[2,ar(exports.ErrorCode.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(H.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),p,t,n)]);case 2:return f=s.sent(),_=f.code,h=f.data,i||_===exports.ErrorCode.SUCCESS||(this.retryCount+=1),nn(_)?(this.logger.warn(H.L_CONNECT_R,"redirect code: ".concat(_),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,i)]):[exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP,exports.ErrorCode.CONNECTION_REFUSED].includes(_)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),g=this.cmpWeightCache.every((function(e){return e.failed})),i&&g?(this.logger.warn(H.L_CONNECT_R,"cpp code:".concat(_,",reture code:").concat(exports.ErrorCode.SERVER_UNAVAILABLE),n),[2,ar(exports.ErrorCode.SERVER_UNAVAILABLE)]):(this.logger.warn(H.L_CONNECT_R,"cmp ack timeout, code: ".concat(_),n),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,_),this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):_!==exports.ErrorCode.SUCCESS?(this.logger.warn(H.L_CONNECT_R,"code: ".concat(_),n),[2,ar(_)]):(this.logger.info(H.L_CONNECT_R,"userId: ".concat(h),n),d(this,tn,Date.now(),"f"),this._crtUserId=h,[2,sr(h)])}}))}))}}),Object.defineProperty(r.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){return r=this.logger.createTraceId(),this.logger.debug(H.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return o(i,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.SUSPENDED?[2]:(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=s.sent(),o=i.code,a=i.isOk,this.reconnectTimer=null,a?(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2]):[exports.ErrorCode.SERVER_UNAVAILABLE,exports.ErrorCode.TIMEOUT,exports.ErrorCode.RC_SOCKET_DISCONNECTED,exports.ErrorCode.RC_SOCKET_NOT_CREATED,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_NAVI_REQ_FAILED,exports.ErrorCode.RC_NETWORK_DOWN,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTING||(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,o),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(r.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return nn(e)?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===exports.ErrorCode.RC_UDP_DISCONNECTED?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,e)}}),Object.defineProperty(r.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(r.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?(this._failedCount=0,this.logger.debug(H.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(H.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===exports.ErrorCode.SUCCESS?(this.logger.debug(H.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(H.L_CHECK_ALIVE_IM_R,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(H.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,exports.ErrorCode.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,exports.ErrorCode.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,exports.ErrorCode.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(r.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(r.prototype,"getCmpList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return l([],u(this.cmpWeightCache),!1);var r=Lt(e,t);return this.cmpWeightCache=l([],u(r),!1),l([],u(r),!1)}}),Object.defineProperty(r.prototype,"updateCmpWeight",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(this.cmpWeightCache){var n=this.cmpWeightCache.find((function(t){return r?t.addr===e&&t.protocol===q.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==o&&(n.weight=o-1),n.failed=!0}}}}),Object.defineProperty(r.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(r.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this.token=e,this._openCallPlus=r,this.onDisconenctUnusual(n)}}),r}(rr);tn=new WeakMap,Zr=new WeakSet,$r=function(){return this},en=function(){this.uuid=at.gen(),this.retryCount=0};var sn=function(e){return e.replace(/@.+$/,"@")},an=function(){function e(e,t,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}return Object.defineProperty(e.prototype,"getCatchKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e+(this._environment?"-".concat(this._environment):"")}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,r,n,i),[4,this.crtRequest]);case 1:return o=s.sent(),this.crtRequest=null,[2,o]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var a;return o(this,void 0,void 0,(function(){var o,u,l,c,d,p,f,_,h,g,E,b,v,T,I,y,m;return s(this,(function(s){switch(s.label){case 0:return o=sn(e),u=this.getNaviCache(o),!t&&u&&(l=u.timestamp,c=u.naviInfo,r||Date.now()-l<Ge)?(this.logger.info(H.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),n),i&&(d=i.uuid,p=i.retryCount,f=i.reason,_={bid:Qt(),ptc:Se.NAVI,cod:exports.ErrorCode.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(a=c.type)&&void 0!==a?a:0,hos:"",cache:Ae.LOCAL,v:Oe.CURRENT,rsn:f,cid:"".concat(d,"_").concat(p),count:p},this.logger.record(ve.IM_NAVI,JSON.stringify(_),n)),[2,sr(c)]):(h=Gr.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(H.L_GET_NAVI_T,JSON.stringify({token:e,uris:h}),n),[4,this.requestHandler(h,e,n,i)]);case 1:return g=s.sent(),E=g.code,b=g.data,E===exports.ErrorCode.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(v=s.sent())?void 0:v.navi)&&(null==v?void 0:v.navi.length)>0?(T=v.navi,[4,this.requestHandler(T,e,n,i)]):[3,4];case 3:I=s.sent(),E=I.code,b=I.data,s.label=4;case 4:return E!==exports.ErrorCode.SUCCESS?(this.logger.warn(H.L_GET_NAVI_R,E,n),[2,ar(E)]):(y=b).code&&200!==y.code?(this.logger.warn(H.L_GET_NAVI_R,y.code,n),[2,ar(this.transHttpCode(y.code))]):Lt(y).length>0?(this.logger.info(H.L_GET_NAVI_R,JSON.stringify({naviInfo:y}),n),this.setNaviCache(o,y),[2,sr(y)]):(m={server:y.server,backupServer:y.backupServer,serverAddr:y.serverAddr,bs:y.bs},this.logger.warn(H.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(m)),n),[2,ar(exports.ErrorCode.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:i=0,o=e.length,s.label=1;case 1:return i<o?(a=i===e.length-1,u=this.useV2Navi()?this.httpRequestV2:this.httpRequest,l=Date.now(),[4,u.call(this,e[i],this.appkey,t,r,a)]):[3,4];case 2:if(c=s.sent(),d=c.code,p=c.data,f={bid:Qt(),ptc:Se.NAVI,cod:d,net:null==n?void 0:n.type,dur:Date.now()-l,spr:0,pr:(null==p?void 0:p.type)||0,hos:e[i],cache:Ae.REQUEST,v:Oe.CURRENT,rsn:null==n?void 0:n.reason,cid:"".concat(null==n?void 0:n.uuid,"_").concat(null==n?void 0:n.retryCount),count:null==n?void 0:n.retryCount},this.logger.record(ve.IM_NAVI,JSON.stringify(f),r),[exports.ErrorCode.SUCCESS,exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,exports.ErrorCode.RC_LICENSE_EXPIRED].includes(d))return[2,d===exports.ErrorCode.SUCCESS?sr(p):ar(d)];s.label=3;case 3:return i+=1,[3,1];case 4:return[2,ar(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(e.prototype,"transHttpCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){switch(e){case 401:case 403:return exports.ErrorCode.RC_CONN_TOKEN_INCORRECT;case 416:return exports.ErrorCode.RC_LICENSE_EXPIRED;default:return exports.ErrorCode.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(sn(e));return t?t.naviInfo:null}}),Object.defineProperty(e.prototype,"updateVoipCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getNaviInfoFromCache(e);r&&this.setNaviCache(sn(e),n(n({},r),{voipCallInfo:t}))}}),Object.defineProperty(e.prototype,"getNaviV2RequestOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.uri,n=e.token,i=e.platform,o=e.protocol,s=e.mac;t="".concat(r,"/v2/navi.json?cloud=").concat(0);var a="token=".concat(encodeURIComponent(n),"&v=").concat(ke,"&platfrom=").concat(i);return s&&(a+="&m=".concat(s)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(o,";rtc=4;log=2;iptype=v4,v6")},body:a,url:t,timeout:1e4}}}),Object.defineProperty(e.prototype,"useV2Navi",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),un=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 ln(e){return un.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function cn(e){return un.has(e)}var dn,pn,fn,_n={MECHANICAL:0,INTELLIGENT:1},hn=function(){function e(e,t,r,n){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=r,this.text=n}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}(),gn=function(e){function r(t,r,n,i){return e.call(this,t,r,n,i)||this}return t(r,e),r}(hn),En=function(e){function r(t,r,n){return e.call(this,Ar(t),r,n,t)||this}return t(r,e),r}(hn),bn={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},vn={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2},Tn=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],r=0,n=t.length;r<n;r++)if(!e[t[r]])return!1;return!0}(uni))},In=function(){function e(e){dn.add(this),pn.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(this,pn,e,"f"),this._logger=e.logger}return Object.defineProperty(e.prototype,"open",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,c(this,dn,"m",fn).call(this,e,c(this,pn,"f"))]}))}))}}),e}();pn=new WeakMap,dn=new WeakSet,fn=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,a,u=this;return s(this,(function(l){switch(l.label){case 0:return 0===t.length?[2,ar(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(n=t.shift(),i=zt(n.addr,n.protocol),i="".concat(i,"/v3/message/get_stream.json?sdkVersion=").concat("5.30.0","&platform=Websocket&messageUID=").concat(r.msgUId),this._logger.info(H.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(i)),[4,this._openHandler(i,r)]);case 1:return[2,(a=l.sent()).or((function(n){return o(u,void 0,void 0,(function(){return s(this,(function(i){return-1===n?[2,c(this,dn,"m",e).call(this,t,r)]:[2,a]}))}))}))]}}))}))};var yn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a=this;return s(this,(function(s){return r=pr(),n=r.resolve,i=r.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){a._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),n(ar(-1,"timeout"))},o.onreadystatechange=function(r){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),s=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&s){n(sr());var u=0;o.onprogress=function(e){var r=o.response.slice(u);u=o.response.length,t.onRawContent(r)},o.onerror=function(r){a._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);n(ar(e.code,e.message))}}},o.onerror=function(t){a._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),n(ar(-1))},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("App-Key",t.appkey),o.setRequestHeader("Authorization","Bearer ".concat(t.token)),o.send(),[2,i]}))}))}}),r}(In),mn=Tn();var Rn=null,Sn=function(e){return o(void 0,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,On.getNetworkType()];case 1:return t=r.sent(),Rn({status:"online"===e.type,type:t}),[2]}}))}))};var An,On={tag:"browser",httpReq:function(e){return Or(e).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:mn,createWebSocket:function(e,t){var r=new WebSocket(e,t);return r.binaryType="arraybuffer",Promise.resolve(sr({id:Date.now(),onClose:function(e){r.onclose=function(t){var r=t.code,n=t.reason;e(r,n)}},onError:function(e){r.onerror=e},onMessage:function(e){r.onmessage=function(t){e(t.data)}},onOpen:function(e){r.onopen=e},send:function(e){r.send(e)},close:function(e,t){r.close()}}))},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:we.UNKONWN},t=e.type,r=e.effectiveType,n=t||r||we.UNKONWN;return Promise.resolve(n)},setNetworkStatusListener:function(e){Rn=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",Sn),window.addEventListener("online",Sn))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",Sn),window.removeEventListener("online",Sn)),Rn=null},createSSEClient:function(e){return sr(new yn(e))},getApiVer:function(){var e=On.runtimeInfo,t=e.type,r=e.version;return"|".concat(t,"|").concat(r)},get runtimeInfo(){var e,t,r=navigator.userAgent,n={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var i in n)if(n.hasOwnProperty(i)){var o=r.match(n[i]);if(o){t=i,e=o[1]||o[2];break}}return{type:t||"Unknown",version:e||"Unknown"}}};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgS=2]="ppMsgS",e[e.pgMsgS=3]="pgMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.prMsgS=7]="prMsgS",e[e.pbMsgP=8]="pbMsgP",e[e.qryPMsg=9]="qryPMsg",e[e.qryGMsg=10]="qryGMsg",e[e.qryCHMsg=11]="qryCHMsg",e[e.qryCMsg=12]="qryCMsg",e[e.qrySMsg=13]="qrySMsg",e[e.qryMCMsg=14]="qryMCMsg",e[e.qryMPMsg=15]="qryMPMsg",e[e.recallMsg=16]="recallMsg",e[e.rrMsg=17]="rrMsg",e[e.rrList=18]="rrList",e[e.s_ntf=19]="s_ntf",e[e.s_msg=20]="s_msg",e[e.s_stat=21]="s_stat",e[e.s_cmd=22]="s_cmd",e[e.s_us=23]="s_us",e[e.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.delRelation=55]="delRelation",e[e.delRelationBatch=56]="delRelationBatch",e[e.pullSeAtts=57]="pullSeAtts",e[e.setSeAtt=58]="setSeAtt",e[e.qnTkn=59]="qnTkn",e[e.qnUrl=60]="qnUrl",e[e.aliUrl=61]="aliUrl",e[e.s3Url=62]="s3Url",e[e.stcUrl=63]="stcUrl",e[e.minioUrl=64]="minioUrl",e[e.cleanPMsg=65]="cleanPMsg",e[e.cleanGMsg=66]="cleanGMsg",e[e.cleanCMsg=67]="cleanCMsg",e[e.cleanSMsg=68]="cleanSMsg",e[e.cleanMCMsg=69]="cleanMCMsg",e[e.cleanMPMsg=70]="cleanMPMsg",e[e.cleanMsgBatch=71]="cleanMsgBatch",e[e.rtcPing=72]="rtcPing",e[e.rtc_ntf=73]="rtc_ntf",e[e.rtcSetOutData=74]="rtcSetOutData",e[e.rtcQryUserOutData=75]="rtcQryUserOutData",e[e.addSeTag=76]="addSeTag",e[e.delSeTag=77]="delSeTag",e[e.addTag=78]="addTag",e[e.delTag=79]="delTag",e[e.reportsdk=80]="reportsdk",e[e.pullUgSes=81]="pullUgSes",e[e.pullUgMsg=82]="pullUgMsg",e[e.ugMsg=83]="ugMsg",e[e.qryUgMsg=84]="qryUgMsg",e[e.updUgRTime=85]="updUgRTime",e[e.upMsgEx=86]="upMsgEx",e[e.modifyMsg=87]="modifyMsg",e[e.qryMsgChange=88]="qryMsgChange",e[e.qryMsg=89]="qryMsg",e[e.operate=90]="operate",e[e.s_opNtf=91]="s_opNtf",e[e.ugUnpushQuery=92]="ugUnpushQuery",e[e.ugUnpushSet=93]="ugUnpushSet",e[e.setRtcRoomId=94]="setRtcRoomId",e[e.qryUgUal=95]="qryUgUal",e[e.updUserSub=96]="updUserSub",e[e.pullUserSub=97]="pullUserSub",e[e.pullSubData=98]="pullSubData",e[e.qrySubData=99]="qrySubData",e[e.pullUserProfile=100]="pullUserProfile",e[e.pullOwnProfile=101]="pullOwnProfile",e[e.updProfilePermiss=102]="updProfilePermiss",e[e.qProfilePermiss=103]="qProfilePermiss",e[e.searchUserProfile=104]="searchUserProfile",e[e.updUserProfile=105]="updUserProfile",e[e.pullEventChange=106]="pullEventChange",e[e.channelCreate=107]="channelCreate",e[e.upChannelInfo=108]="upChannelInfo",e[e.qChannelInfo=109]="qChannelInfo",e[e.channelMemKick=110]="channelMemKick",e[e.channelMemQuit=111]="channelMemQuit",e[e.channelDismiss=112]="channelDismiss",e[e.channelTransfer=113]="channelTransfer",e[e.upChannelManager=114]="upChannelManager",e[e.qChannelMem=115]="qChannelMem",e[e.qChannelSpeMem=116]="qChannelSpeMem",e[e.upChannelMem=117]="upChannelMem",e[e.channelMemJoin=118]="channelMemJoin",e[e.channelMemInvite=119]="channelMemInvite",e[e.channelApplyResp=120]="channelApplyResp",e[e.qChannelApplyList=121]="qChannelApplyList",e[e.qChannelMemJoin=122]="qChannelMemJoin",e[e.qChannelMemSpeJoin=123]="qChannelMemSpeJoin",e[e.upChannelRemark=124]="upChannelRemark",e[e.qChannelRemark=125]="qChannelRemark",e[e.upChannelFollow=126]="upChannelFollow",e[e.qChannelFollow=127]="qChannelFollow",e[e.qSimpleUserProfile=128]="qSimpleUserProfile",e[e.friendAdd=129]="friendAdd",e[e.friendDel=130]="friendDel",e[e.friendHandle=131]="friendHandle",e[e.friendSetPf=132]="friendSetPf",e[e.friendCheck=133]="friendCheck",e[e.friendsQuery=134]="friendsQuery",e[e.friendApplyDel=135]="friendApplyDel",e[e.friendsInfoQry=136]="friendsInfoQry",e[e.friendAuthSet=137]="friendAuthSet",e[e.friendAuthGet=138]="friendAuthGet",e[e.addUnpush=139]="addUnpush",e[e.qryUnpush=140]="qryUnpush",e[e.delUnpush=141]="delUnpush",e[e.s_pubCall=142]="s_pubCall",e[e.reqCall=143]="reqCall",e[e.pullKvMsg=144]="pullKvMsg",e[e.readReceipt=145]="readReceipt",e[e.qryReceipt=146]="qryReceipt",e[e.qryReceiptBatch=147]="qryReceiptBatch",e[e.upConvertMsg=148]="upConvertMsg",e[e.pullModifyMsg=149]="pullModifyMsg"}(An||(An={}));var Cn=function(e){var t=An[e];return t},Nn=function(e){return An[e]},Pn=0,Ln=1,Mn=2,wn=3,Un=4,Dn=5,xn=6,Gn=7,Vn=12,jn=13,kn=14,Fn=4,Bn=3,Hn="rtcRJoin_data",qn="rtcRExit",Yn="rtcRInfo",Wn="rtcUData",Kn="rtcUPut",Jn="rtcUDel",Qn="rtcSetData",Xn="userSetData",zn="rtcQryData",Zn="rtcDelData",$n="rtcToken",ei="rtcUserState",ti="rtcUList",ri="viewerJoinR",ni="viewerExitR",ii="rtcPullKv",oi="rtcIdentityChange",si="rtcInvite",ai="rtcCancelInvite",ui="rtcInviteAnswer",li="rtcEndInvite",ci="rtcQueryJoined",di=0,pi=1,fi=2,_i=3,hi=4,gi=5,Ei=6,bi=7,vi=8,Ti=9,Ii=10,yi=11,mi=12,Ri=13,Si=14,Ai=15,Oi=16,Ci=17,Ni=18,Pi=19,Li=20,Mi=1,wi=2,Ui=4,Di=5,xi=6,Gi=7,Vi=8,ji=9,ki=function(){function e(){}return Object.defineProperty(e,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this._getBackAndByteSize(e),r=t.back,n=t.byteSize,i=0,o=r.length;i<o;i++)r[i]>255&&(r[i]&=255);return n<=255?[0,n].concat(r):[n>>8,255&n].concat(r)}}),Object.defineProperty(e,"_getBackAndByteSize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],r=0;if("string"==typeof e)for(var n=0,i=e.length;n<i;n++){var o=e.charCodeAt(n);o>=0&&o<=127?(r+=1,t.push(o)):o>=128&&o<=2047?(r+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(r+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:r,back:t}}}),Object.defineProperty(e,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r,n=[],i=-1,o=e,s="";++i<o.length;){var a=Number(o[i]);if(a===(127&a)||(240&~a?224&~a?192&~a||(a=(a^=192)<<6|128^o[++i]):a=(a=(a^=224)<<6|128^o[++i])<<6|128^o[++i]:a=(a=(a=(a^=240)<<6|128^o[++i])<<6|128^o[++i])<<6|128^o[++i]),!Number.isFinite(a)||a<0||a>1114111||Math.floor(a)!==a)throw RangeError("Invalid code point: ".concat(a));a<=65535?n.push(a):(t=(a-=65536)>>10|55296,r=a%1024|56320,n.push(t,r)),(i+1===o.length||n.length>16384)&&(s+=String.fromCharCode.apply(null,n),n.length=0)}return s}}),e}(),Fi=function(){function e(e){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_position",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_poolLen",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._pool=e,this._poolLen=e.length}return Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._position>=this._pool.length}}),Object.defineProperty(e.prototype,"read2Byte",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<2;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n.toString()}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readInt32",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(this.readByte()<<24)+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()}}),Object.defineProperty(e.prototype,"readLong",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<8;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readByte",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e}}),Object.defineProperty(e.prototype,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var r=this._pool.subarray(t,this._position);return ki.readUTF(r)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),Bi=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=ki.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}(),Hi=function(){function e(e,t,r,n){void 0===t&&(t=Ln),void 0===r&&(r=!1),void 0===n&&(n=!1),Object.defineProperty(this,"command",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"qos",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_retain",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"dup",{enumerable:!0,configurable:!0,writable:!0,value:n})}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}(),qi=function(){function e(e){Object.defineProperty(this,"header",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.readMessage(e,t,r)}}),Object.defineProperty(e.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return{stream:e,length:t}}}),e}(),Yi=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 Hi(e,Pn)}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 Bi;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),Wi=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"userId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"sessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(e.readByte(),this.status=e.readByte(),t<=r.MESSAGE_LENGTH)return{stream:e,length:t};if(n===Fn){var i=e.readByte();1&i&&(this.userId=e.readUTF()),2&i&&(this.sessionId=e.readUTF()),4&i&&(this.timestamp=e.readLong()),8&i&&(this.messageId=e.read2Byte())}else this.userId=e.readUTF(),this.sessionId=e.readUTF(),this.timestamp=e.readLong();return{stream:e,length:t}}}),Object.defineProperty(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(qi),Ki=function(e){function r(t){var r=e.call(this,kn)||this;return Object.defineProperty(r,"status",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.writeArr([0,this.status])}}),r}(Yi),Ji=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e.readByte(),this.status=e.readByte(),this.data=e.readAll(),{stream:e,length:t}}}),Object.defineProperty(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(qi),Qi=function(e){function r(){return e.call(this,Vn)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),r}(Yi),Xi=function(e){function r(t){return e.call(this,t)||this}return t(r,e),r}(qi),zi=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=256*e.readByte()+e.readByte();return this.messageId=parseInt(r.toString(),10),{stream:e,length:t}}}),r}(qi),Zi=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.messageId,r=255&t,n=(65280&t)>>8;e.writeByte(n),e.writeByte(r)}}),r}(Yi),$i=function(e){function r(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(r,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r.syncMsg=t.dup,r}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,r),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(zi),eo=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"topic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o.topic="string"==typeof r?r:Nn(r),o}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.writeBuffer(this.pbData)}}),r}(Zi),to=function(e){function r(t,r,n){return e.call(this,Dn,t,n,r)||this}return t(r,e),r}(eo),ro=function(e){function r(t,r,n){return e.call(this,wn,t,n,r)||this}return t(r,e),r}(eo),no=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"millisecond",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageUId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.millisecond=256*t.readByte()+t.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=t.readUTF(),{stream:t,length:r}}}),r}(zi),io=function(e){function r(t){var r=e.call(this,Un)||this;return r.messageId=t,r}return t(r,e),r}(Zi),oo=function(e){function r(t){var r=e.call(this,Gn)||this;return r.messageId=t,r}return t(r,e),r}(Zi),so=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(zi),ao=function(e,t){var r=new Uint8Array(e),n=new Fi(r),i=n.readByte(),o=function(e){var t,r=e.command;switch(r){case Mn:t=new Wi(e);break;case wn:t=new $i(e);break;case Un:t=new no(e);break;case xn:t=new so(e);break;case jn:t=new Xi(e);break;case kn:t=new Ji(e);break;default:console.error("No support for deserializing ".concat(r," messages"))}return t}(Hi.parse(i));return o&&o.read(n,r.length-1,t),o},uo=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=pr(),n=r.resolve,i=r.promise,o=this._logger,s=wx.request({url:e,enableChunked:!0,method:"GET",timeout:t.timeout,header:{"Content-Type":"application/json;charset=UTF-8","App-Key":t.appkey,Authorization:"Bearer ".concat(t.token)},success:function(e){var t;if(200===e.statusCode&&(null===(t=e.header["Content-Type"])||void 0===t?void 0:t.startsWith("text/event-stream")))n(sr());else{var r=JSON.parse(e.data),i=r.code,o=r.message;n(ar(i,o))}},fail:function(t){var r=t.errMsg,i=t.errno;o.warn(H.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:r,errno:i})),n(ar(-1,t.errMsg))},complete:function(){o.debug(H.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return s.onChunkReceived((function(e){var r=ki.readUTF(new Uint8Array(e.data));o.debug(H.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(r)),t.onRawContent(r)})),i}}),r}(In),lo=Tn(),co=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return wx[e].apply(wx,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},po={setItem:co("setStorageSync"),getItem:co("getStorageSync"),removeItem:co("removeStorageSync"),clear:co("clearStorageSync")},fo=null,_o=function(e){var t=e.isConnected,r=e.networkType;fo({status:t,type:r})};var ho={tag:"wechat",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||Ve,n=e.headers,i=e.query,o=e.body,s=kt(e.url,i);return new Promise((function(e){wx.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:po,sessionStorage:po,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:lo,createWebSocket:function(e,t){var r=wx.connectSocket({url:e,protocols:t});return Promise.resolve(sr({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),r.close()}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){fo=e,wx.onNetworkStatusChange(_o)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(_o),fo=null},createSSEClient:function(e){return sr(new uo(e))},get runtimeInfo(){return{type:ho.tag,version:"Unknown"}}},go=Tn(),Eo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var n=my[e]({key:t[0]}).data;return n?JSON.stringify(n):n}catch(e){}}},bo={setItem:Eo("setStorageSync"),getItem:Eo("getStorageSync"),removeItem:Eo("removeStorageSync"),clear:Eo("clearStorageSync")},vo=null,To=function(e){var t=e.isConnected,r=e.networkType;vo({status:t,type:r})};var Io={tag:"alipay",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||Ve,n=e.headers,i=e.query,o=e.body,s=kt(e.url,i),a=e.dataType||"json";return new Promise((function(e){my.request({url:s,method:t,headers:n,timeout:r,data:o,dataType:a,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:bo,sessionStorage:bo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:go,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return Promise.resolve(sr({id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}))},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){vo=e,my.onNetworkStatusChange(To)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(To),vo=null},createSSEClient:function(e){return ar(exports.ErrorCode.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:Io.tag,version:"Unknown"}}},yo=Tn(),mo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return tt[e].apply(tt,l([],u(t),!1))}catch(e){}}},Ro={setItem:mo("setStorageSync"),getItem:mo("getStorageSync"),removeItem:mo("removeStorageSync"),clear:mo("clearStorageSync")},So=null,Ao=function(e){var t=e.isConnected,r=e.networkType;So({status:t,type:r})};var Oo={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:yo,localStorage:Ro,sessionStorage:Ro,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){return new Promise((function(r){var n=tt.connectSocket({url:e,protocols:t,fail:function(e){return r(ar(exports.ErrorCode.RC_SOCKET_DISCONNECTED,e.errMsg))}});r(sr({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){n.close(),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){tt.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){So=e,tt.onNetworkStatusChange(Ao)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Ao),So=null},createSSEClient:function(e){return ar(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Oo.tag,version:"Unknown"}}},Co=Tn(),No=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return swan[e].apply(swan,l([],u(t),!1))}catch(e){}}},Po={setItem:No("setStorageSync"),getItem:No("getStorageSync"),removeItem:No("removeStorageSync"),clear:No("clearStorageSync")},Lo=null,Mo=function(e){var t=e.isConnected,r=e.networkType;Lo({status:t,type:r})};var wo={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Co,localStorage:Po,sessionStorage:Po,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=swan.connectSocket({url:e,protocols:t});return Promise.resolve(sr({id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Lo=e,swan.onNetworkStatusChange(Mo)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Mo),Lo=null},createSSEClient:function(e){return ar(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:wo.tag,version:"Unknown"}}},Uo=Tn(),Do=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return jd[e].apply(jd,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},xo={setItem:Do("setStorageSync"),getItem:Do("getStorageSync"),removeItem:Do("removeStorageSync"),clear:Do("clearStorageSync")},Go=null,Vo=function(e){var t=e.isConnected,r=e.networkType;Go({status:t,type:r})};var jo={tag:"jingdong",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||Ve,n=e.headers,i=e.query,o=e.body,s=kt(e.url,i);return new Promise((function(e){jd.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:xo,sessionStorage:xo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Uo,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),Promise.resolve(sr({id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){Go=e,jd.onNetworkStatusChange(Vo)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Vo),Go=null},createSSEClient:function(e){return ar(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:jo.tag,version:"Unknown"}}},ko=Tn(),Fo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return ks[e].apply(ks,l([],u(t),!1))}catch(e){}}},Bo={setItem:Fo("setStorageSync"),getItem:Fo("getStorageSync"),removeItem:Fo("removeStorageSync"),clear:Fo("clearStorageSync")},Ho=null,qo=function(e){var t=e.isConnected,r=e.networkType;Ho({status:t,type:r})};var Yo={tag:"kuaishou",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ko,localStorage:Bo,sessionStorage:Bo,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 r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=ks.connectSocket({url:e,protocols:t});return Promise.resolve(sr({id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){ks.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ho=e,ks.onNetworkStatusChange(qo)},removeNetworkStatusListener:function(){ks.offNetworkStatusChange(qo),Ho=null},createSSEClient:function(e){return ar(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Yo.tag,version:"Unknown"}}},Wo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return uni[e].apply(uni,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Ko={setItem:Wo("setStorageSync"),getItem:Wo("getStorageSync"),removeItem:Wo("removeStorageSync"),clear:Wo("clearStorageSync")},Jo=null,Qo=function(e){var t=e.isConnected,r=e.networkType;Jo({status:t,type:r})};var Xo,zo,Zo={tag:"uniapp",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||Ve,n=e.headers,i=e.query,o=e.body,s=kt(e.url,i);return new Promise((function(e){uni.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Ko,sessionStorage:Ko,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,r=e.osName;return["app","app-plus"].includes(t)&&r||""},isFromUniapp:!0,createWebSocket:function(e,t){var r={complete:function(){},url:e,protocols:t},n=uni.connectSocket(r);return Promise.resolve(sr({id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){Jo=e,uni.onNetworkStatusChange(Qo)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Qo),Jo=null},createSSEClient:function(e){return ar(exports.ErrorCode.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,r=e.deviceModel,n=e.deviceBrand,i=e.osVersion,o="android"===e.osName?t:i;return"".concat(n||"","|").concat(r||"","|").concat(o||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:Zo.tag,version:"Unknown"}}},$o=function(e){return e&&e.request&&e.getSystemInfo},es="undefined"!=typeof uni&&$o(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return Zo;case"mp-jd":return jo;case"mp-baidu":return wo;case"mp-toutiao":return Oo;case"mp-alipay":return Io;case"mp-weixin":return ho;case"mp-kuaishou":return Yo;default:return On}}():"undefined"!=typeof jd&&$o(jd)?jo:"undefined"!=typeof my&&$o(my)?Io:"undefined"!=typeof tt&&$o(tt)?Oo:"undefined"!=typeof ks&&$o(ks)?Yo:"undefined"!=typeof swan&&$o(swan)?wo:"undefined"!=typeof wx&&$o(wx)?ho:On;function ts(e){var t=function(){function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}function r(e,t){var r,n,o;return t?(o=(e>>>=0)>=0&&e<256)&&(n=u[e])?n:(r=i(e,(0|e)<0?-1:0,!0),o&&(u[e]=r),r):(o=(e|=0)>=-128&&e<128)&&(n=a[e])?n:(r=i(e,e<0?-1:0,!1),o&&(a[e]=r),r)}function n(e,t){if(isNaN(e)||!isFinite(e))return t?h:_;if(t){if(e<0)return h;if(e>=d)return T}else{if(-p>=e)return I;if(e+1>=p)return v}return e<0?n(-e,t).neg():i(0|e%c,0|e/c,t)}function i(t,r,n){return new e(t,r,n)}function o(e,t,r){var i,s,a,u,c,d,p;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return _;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||r>36)throw RangeError("radix");if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(e.substring(1),t,r).neg();for(s=n(l(r,8)),a=_,u=0;u<e.length;u+=8)c=Math.min(8,e.length-u),d=parseInt(e.substring(u,u+c),r),c<8?(p=n(l(r,c)),a=a.mul(p).add(n(d))):a=(a=a.mul(s)).add(n(d));return a.unsigned=t,a}function s(t){return t instanceof e?t:"number"==typeof t?n(t):"string"==typeof t?o(t):i(t.low,t.high,t.unsigned)}var a,u,l,c,d,p,f,_,h,g,E,b,v,T,I,y;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,a={},u={},e.fromInt=r,e.fromNumber=n,e.fromBits=i,l=Math.pow,e.fromString=o,e.fromValue=s,p=(d=(c=4294967296)*c)/2,f=r(16777216),_=r(0),e.ZERO=_,h=r(0,!0),e.UZERO=h,g=r(1),e.ONE=g,E=r(1,!0),e.UONE=E,b=r(-1),e.NEG_ONE=b,v=i(-1,2147483647,!1),e.MAX_VALUE=v,T=i(-1,-1,!0),e.MAX_UNSIGNED_VALUE=T,I=i(0,-2147483648,!1),e.MIN_VALUE=I,(y=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},y.toString=function(e){var t,r,i,o,s,a,u,c;if((e=e||10)<2||e>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(I)?(t=n(e),i=(r=this.div(t)).mul(t).sub(this),r.toString(e)+i.toInt().toString(e)):"-"+this.neg().toString(e);for(o=n(l(e,6),this.unsigned),s=this,a="";;){if(u=s.div(o),c=(s.sub(u.mul(o)).toInt()>>>0).toString(e),(s=u).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){var e,t;if(this.isNegative())return this.eq(I)?64:this.neg().getNumBitsAbs();for(e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},y.isZero=function(){return 0===this.high&&0===this.low},y.isNegative=function(){return!this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return!(1&~this.low)},y.isEven=function(){return!(1&this.low)},y.equals=function(e){return t(e)||(e=s(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},y.eq=y.equals,y.notEquals=function(e){return!this.eq(e)},y.neq=y.notEquals,y.lessThan=function(e){return this.comp(e)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(e){return this.comp(e)<=0},y.lte=y.lessThanOrEqual,y.greaterThan=function(e){return this.comp(e)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(e){return this.comp(e)>=0},y.gte=y.greaterThanOrEqual,y.compare=function(e){if(t(e)||(e=s(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return!this.unsigned&&this.eq(I)?I:this.not().add(g)},y.neg=y.negate,y.add=function(e){var r,n,o,a,u,l,c,d,p,f,_;return t(e)||(e=s(e)),r=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,u=e.high>>>16,l=65535&e.high,c=e.low>>>16,d=0,p=0,f=0,_=0,f+=(_+=a+(65535&e.low))>>>16,p+=(f+=o+c)>>>16,d+=(p+=n+l)>>>16,d+=r+u,i((f&=65535)<<16|(_&=65535),(d&=65535)<<16|(p&=65535),this.unsigned)},y.subtract=function(e){return t(e)||(e=s(e)),this.add(e.neg())},y.sub=y.subtract,y.multiply=function(e){var r,o,a,u,l,c,d,p,h,g,E,b;return this.isZero()?_:(t(e)||(e=s(e)),e.isZero()?_:this.eq(I)?e.isOdd()?I:_:e.eq(I)?this.isOdd()?I:_:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(f)&&e.lt(f)?n(this.toNumber()*e.toNumber(),this.unsigned):(r=this.high>>>16,o=65535&this.high,a=this.low>>>16,u=65535&this.low,l=e.high>>>16,c=65535&e.high,d=e.low>>>16,h=0,g=0,E=0,b=0,E+=(b+=u*(p=65535&e.low))>>>16,g+=(E+=a*p)>>>16,E&=65535,g+=(E+=u*d)>>>16,h+=(g+=o*p)>>>16,g&=65535,h+=(g+=a*d)>>>16,g&=65535,h+=(g+=u*c)>>>16,h+=r*p+o*d+a*c+u*l,i((E&=65535)<<16|(b&=65535),(h&=65535)<<16|(g&=65535),this.unsigned)))},y.mul=y.multiply,y.divide=function(e){var r,i,o,a,u,c,d;if(t(e)||(e=s(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?h:_;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return h;if(e.gt(this.shru(1)))return E;o=h}else{if(this.eq(I))return e.eq(g)||e.eq(b)?I:e.eq(I)?g:(r=this.shr(1).div(e).shl(1)).eq(_)?e.isNegative()?g:b:(i=this.sub(e.mul(r)),o=r.add(i.div(e)));if(e.eq(I))return this.unsigned?h:_;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=_}for(i=this;i.gte(e);){for(r=Math.max(1,Math.floor(i.toNumber()/e.toNumber())),u=(a=Math.ceil(Math.log(r)/Math.LN2))<=48?1:l(2,a-48),d=(c=n(r)).mul(e);d.isNegative()||d.gt(i);)d=(c=n(r-=u,this.unsigned)).mul(e);c.isZero()&&(c=g),o=o.add(c),i=i.sub(d)}return o},y.div=y.divide,y.modulo=function(e){return t(e)||(e=s(e)),this.sub(this.div(e).mul(e))},y.mod=y.modulo,y.not=function(){return i(~this.low,~this.high,this.unsigned)},y.and=function(e){return t(e)||(e=s(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},y.or=function(e){return t(e)||(e=s(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},y.xor=function(e){return t(e)||(e=s(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},y.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):i(0,this.low<<e-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(e){var r;return t(e)&&(e=e.toInt()),0===(e&=63)?this:(r=this.high,e<32?i(this.low>>>e|r<<32-e,r>>>e,this.unsigned):i(32===e?r:r>>>e-32,0,this.unsigned))},y.shru=y.shiftRightUnsigned,y.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},y.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,255&t>>>8,255&t>>>16,255&t>>>24,255&e,255&e>>>8,255&e>>>16,255&e>>>24]},y.toBytesBE=function(){var e=this.high,t=this.low;return[255&e>>>24,255&e>>>16,255&e>>>8,255&e,255&t>>>24,255&t>>>16,255&t>>>8,255&t]},e}(),r=function(e){function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function r(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+a.apply(String,e):(e.length+arguments.length>1024&&(t.push(a.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function n(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,d=r?i-1:0,p=r?-1:1,f=e[t+d];for(d+=p,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+e[t+d],d+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+d],d+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=l}return(f?-1:1)*s*Math.pow(2,o-n)}function i(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,d=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,_=n?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?p/u:p*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=c?(a=0,s=c):s+d>=1?(a=(t*u-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=_,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+f]=255&s,f+=_,s/=256,l-=8);e[r+f-_]|=128*h}var o,s,a,u,l,c=function(e,t,r){if(void 0===e&&(e=c.DEFAULT_CAPACITY),void 0===t&&(t=c.DEFAULT_ENDIAN),void 0===r&&(r=c.DEFAULT_NOASSERT),!r){if((e|=0)<0)throw RangeError("Illegal capacity");t=!!t,r=!!r}this.buffer=0===e?s:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=r};return c.VERSION="5.0.1",c.LITTLE_ENDIAN=!0,c.BIG_ENDIAN=!1,c.DEFAULT_CAPACITY=16,c.DEFAULT_ENDIAN=c.BIG_ENDIAN,c.DEFAULT_NOASSERT=!1,c.Long=e||null,(o=c.prototype).__isByteBuffer__,Object.defineProperty(o,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1}),s=new ArrayBuffer(0),a=String.fromCharCode,c.accessor=function(){return Uint8Array},c.allocate=function(e,t,r){return new c(e,t,r)},c.concat=function(e,t,r,n){var i,o,s,a,u,l;for(("boolean"==typeof t||"string"!=typeof t)&&(n=r,r=t,t=void 0),i=0,s=0,a=e.length;a>s;++s)c.isByteBuffer(e[s])||(e[s]=c.wrap(e[s],t)),(o=e[s].limit-e[s].offset)>0&&(i+=o);if(0===i)return new c(0,r,n);for(l=new c(i,r,n),s=0;a>s;)(o=(u=e[s++]).limit-u.offset)<=0||(l.view.set(u.view.subarray(u.offset,u.limit),l.offset),l.offset+=o);return l.limit=l.offset,l.offset=0,l},c.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},c.type=function(){return ArrayBuffer},c.wrap=function(e,t,r,n){var i,s;if("string"!=typeof t&&(n=r,r=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return c.fromBase64(e,r);case"hex":return c.fromHex(e,r);case"binary":return c.fromBinary(e,r);case"utf8":return c.fromUTF8(e,r);case"debug":return c.fromDebug(e,r);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");if(c.isByteBuffer(e))return(i=o.clone.call(e)).markedOffset=-1,i;if(e instanceof Uint8Array)i=new c(0,r,n),e.length>0&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new c(0,r,n),e.byteLength>0&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");for((i=new c(e.length,r,n)).limit=e.length,s=0;s<e.length;++s)i.view[s]=e[s]}return i},o.writeBitSet=function(e,t){var r,n,i,o,s,a,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for(n=t,o=(i=e.length)>>3,s=0,t+=this.writeVarint32(i,t);o--;)r=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(r,t++);if(i>s){for(a=0,r=0;i>s;)r|=(1&!!e[s++])<<a++;this.writeByte(r,t++)}return u?(this.offset=t,this):t-n},o.readBitSet=function(e){var t,r,n,i,o,s,a,u=void 0===e;for(u&&(e=this.offset),i=(n=(r=this.readVarint32(e)).value)>>3,o=0,s=[],e+=r.length;i--;)t=this.readByte(e++),s[o++]=!!(1&t),s[o++]=!!(2&t),s[o++]=!!(4&t),s[o++]=!!(8&t),s[o++]=!!(16&t),s[o++]=!!(32&t),s[o++]=!!(64&t),s[o++]=!!(128&t);if(n>o)for(a=0,t=this.readByte(e++);n>o;)s[o++]=!!(1&t>>a++);return u&&(this.offset=e),s},o.readBytes=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}return r=this.slice(t,t+e),n&&(this.offset+=e),r},o.writeBytes=o.append,o.writeInt8=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},o.writeByte=o.writeInt8,o.readInt8=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return!(128&~(t=this.view[e]))&&(t=-(255-t+1)),r&&(this.offset+=1),t},o.readByte=o.readInt8,o.writeUint8=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},o.writeUInt8=o.writeUint8,o.readUint8=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=this.view[e],r&&(this.offset+=1),t},o.readUInt8=o.readUint8,o.writeInt16=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},o.writeShort=o.writeInt16,o.readInt16=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),!(32768&~t)&&(t=-(65535-t+1)),r&&(this.offset+=2),t},o.readShort=o.readInt16,o.writeUint16=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},o.writeUInt16=o.writeUint16,o.readUint16=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),r&&(this.offset+=2),t},o.readUInt16=o.readUint16,o.writeInt32=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),n&&(this.offset+=4),this},o.writeInt=o.writeInt32,o.readInt32=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),t|=0,r&&(this.offset+=4),t},o.readInt=o.readInt32,o.writeUint32=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),n&&(this.offset+=4),this},o.writeUInt32=o.writeUint32,o.readUint32=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),r&&(this.offset+=4),t},o.readUInt32=o.readUint32,e&&(o.writeInt64=function(t,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(r+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>r?n:r),r-=8,i=t.low,o=t.high,this.littleEndian?(this.view[r+3]=255&i>>>24,this.view[r+2]=255&i>>>16,this.view[r+1]=255&i>>>8,this.view[r]=255&i,r+=4,this.view[r+3]=255&o>>>24,this.view[r+2]=255&o>>>16,this.view[r+1]=255&o>>>8,this.view[r]=255&o):(this.view[r]=255&o>>>24,this.view[r+1]=255&o>>>16,this.view[r+2]=255&o>>>8,this.view[r+3]=255&o,r+=4,this.view[r]=255&i>>>24,this.view[r+1]=255&i>>>16,this.view[r+2]=255&i>>>8,this.view[r+3]=255&i),s&&(this.offset+=8),this},o.writeLong=o.writeInt64,o.readInt64=function(t){var r,n,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return r=0,n=0,this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),i=new e(r,n,!1),o&&(this.offset+=8),i},o.readLong=o.readInt64,o.writeUint64=function(t,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(r+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>r?n:r),r-=8,i=t.low,o=t.high,this.littleEndian?(this.view[r+3]=255&i>>>24,this.view[r+2]=255&i>>>16,this.view[r+1]=255&i>>>8,this.view[r]=255&i,r+=4,this.view[r+3]=255&o>>>24,this.view[r+2]=255&o>>>16,this.view[r+1]=255&o>>>8,this.view[r]=255&o):(this.view[r]=255&o>>>24,this.view[r+1]=255&o>>>16,this.view[r+2]=255&o>>>8,this.view[r+3]=255&o,r+=4,this.view[r]=255&i>>>24,this.view[r+1]=255&i>>>16,this.view[r+2]=255&i>>>8,this.view[r+3]=255&i),s&&(this.offset+=8),this},o.writeUInt64=o.writeUint64,o.readUint64=function(t){var r,n,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return r=0,n=0,this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),i=new e(r,n,!0),o&&(this.offset+=8),i},o.readUInt64=o.readUint64),o.writeFloat32=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},o.writeFloat=o.writeFloat32,o.readFloat32=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=n(this.view,e,this.littleEndian,23,4),r&&(this.offset+=4),t},o.readFloat=o.readFloat32,o.writeFloat64=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},o.writeDouble=o.writeFloat64,o.readFloat64=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return t=n(this.view,e,this.littleEndian,52,8),r&&(this.offset+=8),t},o.readDouble=o.readFloat64,c.MAX_VARINT32_BYTES=5,c.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:1<<21>e?3:1<<28>e?4:5},c.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},c.zigZagDecode32=function(e){return e>>>1^-(1&e)},o.writeVarint32=function(e,t){var r,n,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for((t+=n=c.calculateVarint32(e))>(i=this.buffer.byteLength)&&this.resize((i*=2)>t?i:t),t-=n,e>>>=0;e>=128;)r=128|127&e,this.view[t++]=r,e>>>=7;return this.view[t++]=e,o?(this.offset=t,this):n},o.writeVarint32ZigZag=function(e,t){return this.writeVarint32(c.zigZagEncode32(e),t)},o.readVarint32=function(e){var t,r,n,i,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}r=0,n=0;do{if(!this.noAssert&&e>this.limit)throw(i=Error("Truncated")).truncated=!0,i;t=this.view[e++],r<5&&(n|=(127&t)<<7*r),++r}while(128&t);return n|=0,o?(this.offset=e,n):{value:n,length:r}},o.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=c.zigZagDecode32(t.value):t=c.zigZagDecode32(t),t},e&&(c.MAX_VARINT64_BYTES=10,c.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,n=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==n?r<16384?r<128?1:2:1<<21>r?3:4:n<16384?n<128?5:6:1<<21>n?7:8:i<128?9:10},c.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},c.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},o.writeVarint64=function(t,r){var n,i,o,s,a,u=void 0===r;if(u&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}switch("number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),n=c.calculateVarint64(t),i=t.toInt()>>>0,o=t.shiftRightUnsigned(28).toInt()>>>0,s=t.shiftRightUnsigned(56).toInt()>>>0,(r+=n)>(a=this.buffer.byteLength)&&this.resize((a*=2)>r?a:r),r-=n,n){case 10:this.view[r+9]=1&s>>>7;case 9:this.view[r+8]=9!==n?128|s:127&s;case 8:this.view[r+7]=8!==n?128|o>>>21:127&o>>>21;case 7:this.view[r+6]=7!==n?128|o>>>14:127&o>>>14;case 6:this.view[r+5]=6!==n?128|o>>>7:127&o>>>7;case 5:this.view[r+4]=5!==n?128|o:127&o;case 4:this.view[r+3]=4!==n?128|i>>>21:127&i>>>21;case 3:this.view[r+2]=3!==n?128|i>>>14:127&i>>>14;case 2:this.view[r+1]=2!==n?128|i>>>7:127&i>>>7;case 1:this.view[r]=1!==n?128|i:127&i}return u?(this.offset+=n,this):n},o.writeVarint64ZigZag=function(e,t){return this.writeVarint64(c.zigZagEncode64(e),t)},o.readVarint64=function(t){var r,n,i,o,s,a,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}if(r=t,n=0,i=0,o=0,s=0,n=127&(s=this.view[t++]),128&s&&(n|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(n|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(n|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(i=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(o=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[t++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");return a=e.fromBits(n|i<<28,i>>>4|o<<24,!1),u?(this.offset=t,a):{value:a,length:t-r}},o.readVarint64ZigZag=function(t){var r=this.readVarint64(t);return r&&r.value instanceof e?r.value=c.zigZagDecode64(r.value):r=c.zigZagDecode64(r),r}),o.writeCString=function(e,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),i=e.length,!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(n=0;i>n;++n)if(0===e.charCodeAt(n))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return i=l.calculateUTF16asUTF8(t(e))[1],r+=i+1,o=this.buffer.byteLength,r>o&&this.resize((o*=2)>r?o:r),r-=i+1,l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),this.view[r++]=0,s?(this.offset=r,this):i},o.readCString=function(e){var t,n,i,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,i=-1,l.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),n=r(),!0),o?(this.offset=e,n()):{string:n(),length:e-t}},o.writeIString=function(e,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(i=r,n=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],r+=4+n,o=this.buffer.byteLength,r>o&&this.resize((o*=2)>r?o:r),r-=4+n,this.littleEndian?(this.view[r+3]=255&n>>>24,this.view[r+2]=255&n>>>16,this.view[r+1]=255&n>>>8,this.view[r]=255&n):(this.view[r]=255&n>>>24,this.view[r+1]=255&n>>>16,this.view[r+2]=255&n>>>8,this.view[r+3]=255&n),r+=4,l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),r!==i+4+n)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+4+n));return s?(this.offset=r,this):r-i},o.readIString=function(e){var t,r,n,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=e,r=this.readUint32(e),n=this.readUTF8String(r,c.METRICS_BYTES,e+=4),e+=n.length,i?(this.offset=e,n.string):{string:n.string,length:e-t}},c.METRICS_CHARS="c",c.METRICS_BYTES="b",o.writeUTF8String=function(e,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return i=r,n=l.calculateUTF16asUTF8(t(e))[1],r+=n,o=this.buffer.byteLength,r>o&&this.resize((o*=2)>r?o:r),r-=n,l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),s?(this.offset=r,this):r-i},o.writeString=o.writeUTF8String,c.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(t(e))[0]},c.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(t(e))[1]},c.calculateString=c.calculateUTF8Bytes,o.readUTF8String=function(e,t,n){var i,o,s,a,u;if("number"==typeof t&&(n=t,t=void 0),(i=void 0===n)&&(n=this.offset),void 0===t&&(t=c.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(s=0,a=n,t===c.METRICS_CHARS){if(o=r(),l.decodeUTF8(function(){return e>s&&n<this.limit?this.view[n++]:null}.bind(this),(function(e){++s,l.UTF8toUTF16(e,o)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=n,o()):{string:o(),length:n-a}}if(t===c.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+e+") <= "+this.buffer.byteLength)}if(u=n+e,l.decodeUTF8toUTF16(function(){return u>n?this.view[n++]:null}.bind(this),o=r(),this.noAssert),n!==u)throw RangeError("Illegal range: Truncated data, "+n+" == "+u);return i?(this.offset=n,o()):{string:o(),length:n-a}}throw TypeError("Unsupported metrics: "+t)},o.readString=o.readUTF8String,o.writeVString=function(e,r){var n,i,o,s,a=void 0===r;if(a&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(o=r,n=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],i=c.calculateVarint32(n),r+=i+n,s=this.buffer.byteLength,r>s&&this.resize((s*=2)>r?s:r),r-=i+n,r+=this.writeVarint32(n,r),l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),r!==o+n+i)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+n+i));return a?(this.offset=r,this):r-o},o.readVString=function(e){var t,r,n,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,r=this.readVarint32(e),n=this.readUTF8String(r.value,c.METRICS_BYTES,e+=r.length),e+=n.length,i?(this.offset=e,n.string):{string:n.string,length:e-t}},o.append=function(e,t,r){var n,i,o;if(("number"==typeof t||"string"!=typeof t)&&(r=t,t=void 0),(n=void 0===r)&&(r=this.offset),!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return e instanceof c||(e=c.wrap(e,t)),(i=e.limit-e.offset)<=0||((r+=i)>(o=this.buffer.byteLength)&&this.resize((o*=2)>r?o:r),r-=i,this.view.set(e.view.subarray(e.offset,e.limit),r),e.offset+=i,n&&(this.offset+=i)),this},o.appendTo=function(e,t){return e.append(this,t),this},o.assert=function(e){return this.noAssert=!e,this},o.capacity=function(){return this.buffer.byteLength},o.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},o.clone=function(e){var t=new c(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},o.compact=function(e,t){var r,n,i;if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return 0===e&&t===this.buffer.byteLength?this:0===(r=t-e)?(this.buffer=s,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this):(n=new ArrayBuffer(r),(i=new Uint8Array(n)).set(this.view.subarray(e,t)),this.buffer=n,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this)},o.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new c(0,this.littleEndian,this.noAssert);var r=t-e,n=new c(r,this.littleEndian,this.noAssert);return n.offset=0,n.limit=r,n.markedOffset>=0&&(n.markedOffset-=e),this.copyTo(n,0,e,t),n},o.copyTo=function(e,t,r,n){var i,o,s;if(!this.noAssert&&!c.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o=void 0===t)?e.offset:0|t,r=(i=void 0===r)?this.offset:0|r,n=void 0===n?this.limit:0|n,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(r<0||n>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+r+" <= "+this.buffer.byteLength);return 0===(s=n-r)?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(r,n),t),i&&(this.offset+=s),o&&(e.offset+=s),this)},o.ensureCapacity=function(e){var t=this.buffer.byteLength;return e>t?this.resize((t*=2)>e?t:e):this},o.fill=function(e,t,r){var n=void 0===t;if(n&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;r>t;)this.view[t++]=e;return n&&(this.offset=t),this},o.flip=function(){return this.limit=this.offset,this.offset=0,this},o.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},o.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},o.LE=function(e){return this.littleEndian=void 0===e||!!e,this},o.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},o.prepend=function(e,t,r){var n,i,o,s,a;if(("number"==typeof t||"string"!=typeof t)&&(r=t,t=void 0),(n=void 0===r)&&(r=this.offset),!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return e instanceof c||(e=c.wrap(e,t)),(i=e.limit-e.offset)<=0||((o=i-r)>0?(s=new ArrayBuffer(this.buffer.byteLength+o),(a=new Uint8Array(s)).set(this.view.subarray(r,this.buffer.byteLength),i),this.buffer=s,this.view=a,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,r+=o):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),r-i),e.offset=e.limit,n&&(this.offset-=i)),this},o.prependTo=function(e,t){return e.prepend(this,t),this},o.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},o.remaining=function(){return this.limit-this.offset},o.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},o.resize=function(e){var t,r;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}return this.buffer.byteLength<e&&(t=new ArrayBuffer(e),(r=new Uint8Array(t)).set(this.view),this.buffer=t,this.view=r),this},o.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},o.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},o.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=e,r.limit=t,r},o.toBuffer=function(e){var t,r=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: Not an integer");if(r>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,r<0||r>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+r+" <= "+n+" <= "+this.buffer.byteLength)}return e||0!==r||n!==this.buffer.byteLength?r===n?s:(t=new ArrayBuffer(n-r),new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(r,n),0),t):this.buffer},o.toArrayBuffer=o.toBuffer,o.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}},u=function(){var e,t,r={},n=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],i=[];for(e=0,t=n.length;t>e;++e)i[n[e]]=e;return r.encode=function(e,t){for(var r,i;null!==(r=e());)t(n[63&r>>2]),i=(3&r)<<4,null!==(r=e())?(t(n[63&((i|=15&r>>4)|15&r>>4)]),i=(15&r)<<2,null!==(r=e())?(t(n[63&(i|3&r>>6)]),t(n[63&r])):(t(n[63&i]),t(61))):(t(n[63&i]),t(61),t(61))},r.decode=function(e,t){function r(e){throw Error("Illegal character code: "+e)}for(var n,o,s;null!==(n=e());)if(void 0===(o=i[n])&&r(n),null!==(n=e())&&(void 0===(s=i[n])&&r(n),t(o<<2>>>0|(48&s)>>4),null!==(n=e()))){if(void 0===(o=i[n])){if(61===n)break;r(n)}if(t((15&s)<<4>>>0|(60&o)>>2),null!==(n=e())){if(void 0===(s=i[n])){if(61===n)break;r(n)}t((3&o)<<6>>>0|s)}}},r.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},r}(),o.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var n;return u.encode(function(){return t>e?this.view[e++]:null}.bind(this),n=r()),n()},c.fromBase64=function(e,r){if("string"!=typeof e)throw TypeError("str");var n=new c(e.length/4*3,r),i=0;return u.decode(t(e),(function(e){n.view[i++]=e})),n.limit=i,n},c.btoa=function(e){return c.fromBinary(e).toBase64()},c.atob=function(e){return c.fromBase64(e).toBinary()},o.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var r=[],n=[];t>e;)r.push(this.view[e++]),r.length>=1024&&(n.push(String.fromCharCode.apply(String,r)),r=[]);return n.join("")+String.fromCharCode.apply(String,r)},c.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var r,n=0,i=e.length,o=new c(i,t);i>n;){if((r=e.charCodeAt(n))>255)throw RangeError("illegal char code: "+r);o.view[n++]=r}return o.limit=i,o},o.toDebug=function(e){for(var t,r=-1,n=this.buffer.byteLength,i="",o="",s="";n>r;){if(-1!==r&&(i+=(t=this.view[r])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==n){for(;i.length<51;)i+=" ";s+=i+o+"\n",i=o=""}i+=r===this.offset&&r===this.limit?r===this.markedOffset?"!":"|":r===this.offset?r===this.markedOffset?"[":"<":r===this.limit?r===this.markedOffset?"]":">":r===this.markedOffset?"'":e||0!==r&&r!==n?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";s+=i+o+"\n"}return e?s:i},c.fromDebug=function(e,t,r){for(var n,i,o=e.length,s=new c(0|(o+1)/3,t,r),a=0,u=0,l=!1,d=!1,p=!1,f=!1,_=!1;o>a;){switch(n=e.charAt(a++)){case"!":if(!r){if(d||p||f){_=!0;break}d=p=f=!0}s.offset=s.markedOffset=s.limit=u,l=!1;break;case"|":if(!r){if(d||f){_=!0;break}d=f=!0}s.offset=s.limit=u,l=!1;break;case"[":if(!r){if(d||p){_=!0;break}d=p=!0}s.offset=s.markedOffset=u,l=!1;break;case"<":if(!r){if(d){_=!0;break}d=!0}s.offset=u,l=!1;break;case"]":if(!r){if(f||p){_=!0;break}f=p=!0}s.limit=s.markedOffset=u,l=!1;break;case">":if(!r){if(f){_=!0;break}f=!0}s.limit=u,l=!1;break;case"'":if(!r){if(p){_=!0;break}p=!0}s.markedOffset=u,l=!1;break;case" ":l=!1;break;default:if(!r&&l){_=!0;break}if(i=parseInt(n+e.charAt(a++),16),!r&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[u++]=i,l=!0}if(_)throw TypeError("Illegal str: Invalid symbol at "+a)}if(!r){if(!d||!f)throw TypeError("Illegal str: Missing offset or limit");if(u<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+u+" < "+o)}return s},o.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var r,n=new Array(t-e);t>e;)(r=this.view[e++])<16?n.push("0",r.toString(16)):n.push(r.toString(16));return n.join("")},c.fromHex=function(e,t,r){var n,i,o,s,a;if(!r){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(i=e.length,o=new c(0|i/2,t),s=0,a=0;i>s;s+=2){if(n=parseInt(e.substring(s,s+2),16),!r&&(!isFinite(n)||n<0||n>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[a++]=n}return o.limit=a,o},l=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(192|31&r>>6),t(128|63&r)):r<65536?(t(224|15&r>>12),t(128|63&r>>6),t(128|63&r)):(t(240|7&r>>18),t(128|63&r>>12),t(128|63&r>>6),t(128|63&r)),r=null},decodeUTF8:function(e,t){for(var r,n,i,o,s=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(r=e());)if(128&r)if(192==(224&r))null===(n=e())&&s([r,n]),t((31&r)<<6|63&n);else if(224==(240&r))(null===(n=e())||null===(i=e()))&&s([r,n,i]),t((15&r)<<12|(63&n)<<6|63&i);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(n=e())||null===(i=e())||null===(o=e()))&&s([r,n,i,o]),t((7&r)<<18|(63&n)<<12|(63&i)<<6|63&o)}else t(r)},UTF16toUTF8:function(e,t){for(var r,n=null;null!==(r=null!==n?n:e());)r>=55296&&r<=57343&&null!==(n=e())&&n>=56320&&n<=57343?(t(1024*(r-55296)+n-56320+65536),n=null):t(r);null!==n&&t(n)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,r)}))},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,r)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,r=0;null!==(t=e());)r+=t<128?1:t<2048?2:t<65536?3:4;return r},calculateUTF16asUTF8:function(t){var r=0,n=0;return e.UTF16toUTF8(t,(function(e){++r,n+=e<128?1:e<2048?2:e<65536?3:4})),[r,n]}};return e}(),o.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n;try{l.decodeUTF8toUTF16(function(){return t>e?this.view[e++]:null}.bind(this),n=r())}catch(r){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return n()},c.fromUTF8=function(e,r,n){if(!n&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new c(l.calculateUTF16asUTF8(t(e),!0)[1],r,n),o=0;return l.encodeUTF16toUTF8(t(e),(function(e){i.view[o++]=e})),i.limit=o,i},c}(t),n=function(t,r){var n,i,o={};return o.ByteBuffer=t,o.c=t,n=t,o.Long=r||null,o.VERSION="5.0.1",o.WIRE_TYPES={},o.WIRE_TYPES.VARINT=0,o.WIRE_TYPES.BITS64=1,o.WIRE_TYPES.LDELIM=2,o.WIRE_TYPES.STARTGROUP=3,o.WIRE_TYPES.ENDGROUP=4,o.WIRE_TYPES.BITS32=5,o.PACKABLE_WIRE_TYPES=[o.WIRE_TYPES.VARINT,o.WIRE_TYPES.BITS64,o.WIRE_TYPES.BITS32],o.TYPES={int32:{name:"int32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},uint64:{name:"uint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.UZERO:void 0},sint64:{name:"sint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},bool:{name:"bool",wireType:o.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:o.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:o.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.ZERO:void 0},float:{name:"float",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:o.WIRE_TYPES.STARTGROUP,defaultValue:null}},o.MAP_KEY_TYPES=[o.TYPES.int32,o.TYPES.sint32,o.TYPES.sfixed32,o.TYPES.uint32,o.TYPES.fixed32,o.TYPES.int64,o.TYPES.sint64,o.TYPES.sfixed64,o.TYPES.uint64,o.TYPES.fixed64,o.TYPES.bool,o.TYPES.string,o.TYPES.bytes],o.ID_MIN=1,o.ID_MAX=536870911,o.convertFieldsToCamelCase=!1,o.populateAccessors=!0,o.populateDefaults=!0,o.Util=function(){var e={};return e.IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.XHR=function(){var e,t=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],r=null;for(e=0;e<t.length;e++){try{r=t[e]()}catch(e){continue}break}if(!r)throw Error("XMLHttpRequest is not supported");return r},e.fetch=function(t,r){if(r&&"function"!=typeof r&&(r=null),e.IS_NODE)if(r)g.readFile(t,(function(e,t){r(e?null:""+t)}));else try{return g.readFileSync(t)}catch(e){return null}else{var n=e.XHR();if(n.open("GET",t,!!r),n.setRequestHeader("Accept","text/plain"),"function"==typeof n.overrideMimeType&&n.overrideMimeType("text/plain"),!r)return n.send(null),200==n.status||0==n.status&&"string"==typeof n.responseText?n.responseText:null;if(n.onreadystatechange=function(){4==n.readyState&&(200==n.status||0==n.status&&"string"==typeof n.responseText?r(n.responseText):r(null))},4==n.readyState)return;n.send(null)}},e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e}(),o.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},o.DotProto=function(e,t){function r(e,r){var n=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))n=parseInt(e);else if(t.NUMBER_HEX.test(e))n=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);n=parseInt(e.substring(1),8)}if(n=0|i*n,!r&&n<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return n}function n(e){var r=1;if("-"==e.charAt(0)&&(r=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return r*parseInt(e,10);if(t.NUMBER_HEX.test(e))return r*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return r*parseInt(e.substring(1),8);if("inf"===e)return 1/0*r;if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return r*parseFloat(e);throw Error("illegal number value: "+(r<0?"-":"")+e)}function i(e,t,r){void 0===e[t]?e[t]=r:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(r))}var o,s,a={},u=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},l=u.prototype;return l._readString=function(){var e,r='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;if(r.lastIndex=this.index-1,!(e=r.exec(this.source)))throw Error("unterminated string");return this.index=r.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,e[1]},l.next=function(){var e,r,n,i,o;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(e=!1;t.WHITESPACE.test(n=this.source.charAt(this.index));)if("\n"===n&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(n=this.source.charAt(this.index)))return"/";do{if("\n"===n&&++this.line,++this.index===this.source.length)return null;r=n,n=this.source.charAt(this.index)}while("*"!==r||"/"!==n);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;if(i=this.index,t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;return('"'===(o=this.source.substring(this.index,this.index=i))||"'"===o)&&(this._stringOpen=o),o},l.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},l.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},l.omit=function(e){return this.peek()===e&&(this.next(),!0)},l.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},a.Tokenizer=u,o=function(e){this.tn=new u(e),this.proto3=!1},(s=o.prototype).parse=function(){var e,r={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},n=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!n||null!==r.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),r.package=e;break;case"import":if(!n)throw Error("unexpected 'import'");"public"===(e=this.tn.peek())&&this.tn.next(),e=this._readString(),this.tn.skip(";"),r.imports.push(e);break;case"syntax":if(!n)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(r.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(r,null),n=!1;break;case"enum":this._parseEnum(r),n=!1;break;case"option":this._parseOption(r);break;case"service":this._parseService(r);break;case"extend":this._parseExtend(r);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete r.name,r},o.parse=function(e){return new o(e).parse()},s._readString=function(){var e,t,r="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);r+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return r},s._readValue=function(e){var r=this.tn.peek();if('"'===r||"'"===r)return this._readString();if(this.tn.next(),t.NUMBER.test(r))return n(r);if(t.BOOL.test(r))return"true"===r.toLowerCase();if(e&&t.TYPEREF.test(r))return r;throw Error("illegal value: "+r)},s._parseOption=function(e,r){var n,i=this.tn.next(),o=!1;if("("===i&&(o=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal option name: "+i);n=i,o&&(this.tn.skip(")"),n="("+n+")",i=this.tn.peek(),t.FQTYPEREF.test(i)&&(n+=i,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,n),r||this.tn.skip(";")},s._parseOptionValue=function(e,r){var n=this.tn.peek();if("{"!==n)i(e.options,r,this._readValue(!0));else for(this.tn.skip("{");"}"!==(n=this.tn.next());){if(!t.NAME.test(n))throw Error("illegal option name: "+r+"."+n);this.tn.omit(":")?i(e.options,r+"."+n,this._readValue(!0)):this._parseOptionValue(e,r+"."+n)}},s._parseService=function(e){var r,n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal service name at line "+this.tn.line+": "+n);for(r={name:n,rpc:{},options:{}},this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(r);else{if("rpc"!==n)throw Error("illegal service token: "+n);this._parseServiceRPC(r)}this.tn.omit(";"),e.services.push(r)},s._parseServiceRPC=function(e){var r,n,i="rpc",o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal rpc service method name: "+o);if(r=o,n={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(n.request_stream=!0,o=this.tn.next()),!t.TYPEREF.test(o))throw Error("illegal rpc service request type: "+o);if(n.request=o,this.tn.skip(")"),"returns"!==(o=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+o);if(this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(n.response_stream=!0,o=this.tn.next()),n.response=o,this.tn.skip(")"),"{"===(o=this.tn.peek())){for(this.tn.next();"}"!==(o=this.tn.next());){if("option"!==o)throw Error("illegal rpc service token: "+o);this._parseOption(n)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[i]&&(e[i]={}),e[i][r]=n},s._parseMessage=function(e,n){var i=!!n,o=this.tn.next(),s={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(o))throw Error("illegal "+(i?"group":"message")+" name: "+o);for(s.name=o,i&&(this.tn.skip("="),n.id=r(this.tn.next()),s.isGroup=!0),"["===(o=this.tn.peek())&&n&&this._parseFieldOptions(n),this.tn.skip("{");"}"!==(o=this.tn.next());)if(t.RULE.test(o))this._parseMessageField(s,o);else if("oneof"===o)this._parseMessageOneOf(s);else if("enum"===o)this._parseEnum(s);else if("message"===o)this._parseMessage(s);else if("option"===o)this._parseOption(s);else if("service"===o)this._parseService(s);else if("extensions"===o)s.extensions=this._parseExtensionRanges();else if("reserved"===o)this._parseIgnored();else if("extend"===o)this._parseExtend(s);else{if(!t.TYPEREF.test(o))throw Error("illegal message token: "+o);if(!this.proto3)throw Error("illegal field rule: "+o);this._parseMessageField(s,"optional",o)}return this.tn.omit(";"),e.messages.push(s),s},s._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},s._parseMessageField=function(e,n,i){var o,s,a;if(!t.RULE.test(n))throw Error("illegal message field rule: "+n);if(o={rule:n,type:"",name:"",options:{},id:0},"map"===n){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field type: "+s);if(o.keytype=s,this.tn.skip(","),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field: "+s);if(o.type=s,this.tn.skip(">"),s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);o.name=s,this.tn.skip("="),o.id=r(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(i=void 0!==i?i:this.tn.next())){if(a=this._parseMessage(e,o),!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);o.type=a.name,o.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(o.type=i,s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);o.name=s,this.tn.skip("="),o.id=r(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},s._parseMessageOneOf=function(e){var r,n,i,o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal oneof name: "+o);for(n=o,i=[],this.tn.skip("{");"}"!==(o=this.tn.next());)(r=this._parseMessageField(e,"optional",o)).oneof=n,i.push(r.id);this.tn.omit(";"),e.oneofs[n]=i},s._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},s._parseEnum=function(e){var n,i={name:"",values:[],options:{}},o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal name: "+o);for(i.name=o,this.tn.skip("{");"}"!==(o=this.tn.next());)if("option"===o)this._parseOption(i);else{if(!t.NAME.test(o))throw Error("illegal name: "+o);this.tn.skip("="),n={name:o,id:r(this.tn.next(),!0)},"["===(o=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),i.values.push(n)}this.tn.omit(";"),e.enums.push(i)},s._parseExtensionRanges=function(){var t,r,i,o=[];do{for(r=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=n(t)}if(r.push(i),2===r.length)break;if("to"!==this.tn.peek()){r.push(i);break}this.tn.next()}o.push(r)}while(this.tn.omit(","));return this.tn.skip(";"),o},s._parseExtend=function(e){var r,n=this.tn.next();if(!t.TYPEREF.test(n))throw Error("illegal extend reference: "+n);for(r={ref:n,fields:[]},this.tn.skip("{");"}"!==(n=this.tn.next());)if(t.RULE.test(n))this._parseMessageField(r,n);else{if(!t.TYPEREF.test(n))throw Error("illegal extend token: "+n);if(!this.proto3)throw Error("illegal field rule: "+n);this._parseMessageField(r,"optional",n)}return this.tn.omit(";"),e.messages.push(r),r},s.toString=function(){return"Parser at line "+this.tn.line},a.Parser=o,a}(o,o.Lang),o.Reflect=function(e){function r(t,r){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===r?t.unsigned:r);if("string"==typeof t)return e.Long.fromString(t,r||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,r||!1);throw Error("not convertible to Long")}function i(t,r){var n=r.readVarint32(),o=7&n,s=n>>>3;switch(o){case e.WIRE_TYPES.VARINT:do{n=r.readUint8()}while(!(128&~n));break;case e.WIRE_TYPES.BITS64:r.offset+=8;break;case e.WIRE_TYPES.LDELIM:n=r.readVarint32(),r.offset+=n;break;case e.WIRE_TYPES.STARTGROUP:i(s,r);break;case e.WIRE_TYPES.ENDGROUP:if(s===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+s+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:r.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+o)}return!0}var o,s,a,u,l,c,d,p,f,_,h,g,E,b,v,T,I={},y=function(e,t,r){this.builder=e,this.parent=t,this.name=r,this.className},m=y.prototype;return m.fqn=function(){for(var e=this.name,t=this;null!=(t=t.parent);)e=t.name+"."+e;return e},m.toString=function(e){return(e?this.className+" ":"")+this.fqn()},m.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},I.T=y,o=function(e,t,r,n,i){y.call(this,e,t,r),this.className="Namespace",this.children=[],this.options=n||{},this.syntax=i||"proto2"},(s=o.prototype=Object.create(y.prototype)).getChildren=function(e){var t,r,n;if(null==(e=e||null))return this.children.slice();for(t=[],r=0,n=this.children.length;n>r;++r)this.children[r]instanceof e&&t.push(this.children[r]);return t},s.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof l.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof l.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},s.getChild=function(e){var t,r,n="number"==typeof e?"id":"name";for(t=0,r=this.children.length;r>t;++t)if(this.children[t][n]===e)return this.children[t];return null},s.resolve=function(e,t){var r,n="string"==typeof e?e.split("."):e,i=this,o=0;if(""===n[o]){for(;null!==i.parent;)i=i.parent;o++}do{do{if(!(i instanceof I.Namespace)){i=null;break}if(!((r=i.getChild(n[o]))&&r instanceof I.T&&(!t||r instanceof I.Namespace))){i=null;break}i=r,o++}while(o<n.length);if(null!=i)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=i);return i},s.qn=function(e){var t,r,n=[],i=e;do{n.unshift(i.name),i=i.parent}while(null!==i);for(t=1;t<=n.length;t++)if(r=n.slice(n.length-t),e===this.resolve(r,e instanceof I.Namespace))return r.join(".");return e.fqn()},s.build=function(){var e,t,r,n={},i=this.children;for(t=0,r=i.length;r>t;++t)(e=i[t])instanceof o&&(n[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt()}),n},s.buildOpt=function(){var e,t,r,n,i={},o=Object.keys(this.options);for(e=0,t=o.length;t>e;++e)r=o[e],n=this.options[o[e]],i[r]=n;return i},s.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},I.Namespace=o,a=function(t,r,n,i){if(this.type=t,this.resolvedType=r,this.isMapKey=n,this.syntax=i,n&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=a.prototype,a.defaultFieldValue=function(t){if("string"==typeof t&&(t=e.TYPES[t]),void 0===t.defaultValue)throw Error("default value for type "+t.name+" is not supported");return t==e.TYPES.bytes?new n(0):t.defaultValue},u.verifyValue=function(n){var i,o,s,a=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this);switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof n||n==n&&n%1!=0)&&a(typeof n,"not an integer"),n>4294967295?0|n:n;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof n||n==n&&n%1!=0)&&a(typeof n,"not an integer"),n<0?n>>>0:n;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return r(n,!1)}catch(e){a(typeof n,e.message)}else a(typeof n,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return r(n,!0)}catch(e){a(typeof n,e.message)}else a(typeof n,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof n&&a(typeof n,"not a boolean"),n;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof n&&a(typeof n,"not a number"),n;case e.TYPES.string:return"string"==typeof n||n&&n instanceof String||a(typeof n,"not a string"),""+n;case e.TYPES.bytes:return t.isByteBuffer(n)?n:t.wrap(n);case e.TYPES.enum:for(i=this.resolvedType.getChildren(e.Reflect.Enum.Value),s=0;s<i.length;s++){if(i[s].name==n)return i[s].id;if(i[s].id==n)return i[s].id}if("proto3"===this.syntax)return("number"!=typeof n||n==n&&n%1!=0)&&a(typeof n,"not an integer"),(n>4294967295||n<0)&&a(typeof n,"not in range for uint32"),n;a(n,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(n&&"object"==typeof n||a(typeof n,"object expected"),n instanceof this.resolvedType.clazz)return n;if(n instanceof e.Builder.Message){for(s in o={},n)n.hasOwnProperty(s)&&(o[s]=n[s]);n=o}return new this.resolvedType.clazz(n)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+n+" (undefined type "+this.type+")")},u.calculateLength=function(t,r){if(null===r)return 0;var i;switch(this.type){case e.TYPES.int32:return r<0?n.calculateVarint64(r):n.calculateVarint32(r);case e.TYPES.uint32:return n.calculateVarint32(r);case e.TYPES.sint32:return n.calculateVarint32(n.zigZagEncode32(r));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return n.calculateVarint64(r);case e.TYPES.sint64:return n.calculateVarint64(n.zigZagEncode64(r));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return n.calculateVarint32(r);case e.TYPES.double:return 8;case e.TYPES.string:return i=n.calculateUTF8Bytes(r),n.calculateVarint32(i)+i;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");return n.calculateVarint32(r.remaining())+r.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(r),n.calculateVarint32(i)+i;case e.TYPES.group:return(i=this.resolvedType.calculate(r))+n.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")},u.encodeValue=function(t,r,i){var o,s;if(null===r)return i;switch(this.type){case e.TYPES.int32:r<0?i.writeVarint64(r):i.writeVarint32(r);break;case e.TYPES.uint32:i.writeVarint32(r);break;case e.TYPES.sint32:i.writeVarint32ZigZag(r);break;case e.TYPES.fixed32:i.writeUint32(r);break;case e.TYPES.sfixed32:i.writeInt32(r);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(r);break;case e.TYPES.sint64:i.writeVarint64ZigZag(r);break;case e.TYPES.fixed64:i.writeUint64(r);break;case e.TYPES.sfixed64:i.writeInt64(r);break;case e.TYPES.bool:"string"==typeof r?i.writeVarint32("false"===r.toLowerCase()?0:!!r):i.writeVarint32(r?1:0);break;case e.TYPES.enum:i.writeVarint32(r);break;case e.TYPES.float:i.writeFloat32(r);break;case e.TYPES.double:i.writeFloat64(r);break;case e.TYPES.string:i.writeVString(r);break;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");o=r.offset,i.writeVarint32(r.remaining()),i.append(r),r.offset=o;break;case e.TYPES.message:s=(new n).LE(),this.resolvedType.encode(r,s),i.writeVarint32(s.offset),i.append(s.flip());break;case e.TYPES.group:this.resolvedType.encode(r,i),i.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")}return i},u.decode=function(t,r,n){if(r!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,n)}throw Error("[INTERNAL] Illegal decode type")},u.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return n.fromBinary(t)}},u.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},I.Element=a,l=function(e,t,r,n,i,s){o.call(this,e,t,r,n,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},(c=l.prototype=Object.create(o.prototype)).build=function(r){var i,o,s,a;if(this.clazz&&!r)return this.clazz;for(i=function(e,r){function i(t,r,o,s){var a,u,l,c,d,p,f;if(null===t||"object"!=typeof t)return s&&s instanceof e.Reflect.Enum&&null!==(a=e.Reflect.Enum.getName(s.object,t))?a:t;if(n.isByteBuffer(t))return r?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return o?t.toString():e.Long.fromValue(t);if(Array.isArray(t))return u=[],t.forEach((function(e,t){u[t]=i(e,r,o,s)})),u;if(u={},t instanceof e.Map){for(c=(l=t.entries()).next();!c.done;c=l.next())u[t.keyElem.valueToString(c.value[0])]=i(c.value[1],r,o,t.valueElem.resolvedType);return u}for(f in d=t.$type,p=void 0,t)t.hasOwnProperty(f)&&(u[f]=d&&(p=d.getChild(f))?i(t[f],r,o,p.resolvedType):i(t[f],r,o));return u}var o,s,a=r.getChildren(e.Reflect.Message.Field),u=r.getChildren(e.Reflect.Message.OneOf),l=function(t){var i,o,s,c;for(e.Builder.Message.call(this),i=0,o=u.length;o>i;++i)this[u[i].name]=null;for(i=0,o=a.length;o>i;++i)this[(s=a[i]).name]=s.repeated?[]:s.map?new e.Map(s):null,!s.required&&"proto3"!==r.syntax||null===s.defaultValue||(this[s.name]=s.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===t||"object"!=typeof t||!("function"!=typeof t.encode||t instanceof l)||Array.isArray(t)||t instanceof e.Map||n.isByteBuffer(t)||t instanceof ArrayBuffer||e.Long&&t instanceof e.Long)for(i=0,o=arguments.length;o>i;++i)void 0!==(c=arguments[i])&&this.$set(a[i].name,c);else this.$set(t)},c=l.prototype=Object.create(e.Builder.Message.prototype);for(c.add=function(t,n,i){var o=r._fieldsByName[t];if(!i){if(!o)throw Error(this+"#"+t+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+t+" is not a repeated field");n=o.verifyValue(n,!0)}return null===this[t]&&(this[t]=[]),this[t].push(n),this},c.$add=c.add,c.set=function(t,n,i){var o,s,a;if(t&&"object"==typeof t){for(o in i=n,t)t.hasOwnProperty(o)&&void 0!==(n=t[o])&&this.$set(o,n,i);return this}if(s=r._fieldsByName[t],i)this[t]=n;else{if(!s)throw Error(this+"#"+t+" is not a field: undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+s.toString(!0));this[s.name]=n=s.verifyValue(n)}return s&&s.oneof&&(a=this[s.oneof.name],null!==n?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===t&&(this[s.oneof.name]=null)),this},c.$set=c.set,c.get=function(t,n){if(n)return this[t];var i=r._fieldsByName[t];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));return this[i.name]},c.$get=c.get,o=0;o<a.length;o++)(s=a[o])instanceof e.Reflect.Message.ExtensionField||r.builder.options.populateAccessors&&function(e){var t,n,i,o=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));o=o.substring(0,1).toUpperCase()+o.substring(1),t=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),n=function(t,r){return this[e.name]=r?t:e.verifyValue(t),this},i=function(){return this[e.name]},null===r.getChild("set"+o)&&(c["set"+o]=n),null===r.getChild("set_"+t)&&(c["set_"+t]=n),null===r.getChild("get"+o)&&(c["get"+o]=i),null===r.getChild("get_"+t)&&(c["get_"+t]=i)}(s);return c.encode=function(e,n){var i,o;"boolean"==typeof e&&(n=e,e=void 0),i=!1,e||(e=new t,i=!0),o=e.littleEndian;try{return r.encode(this,e.LE(),n),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},l.encode=function(e,t,r){return new l(e).encode(t,r)},c.calculate=function(){return r.calculate(this)},c.encodeDelimited=function(e){var t,i=!1;return e||(e=new n,i=!0),t=(new n).LE(),r.encode(this,t).flip(),e.writeVarint32(t.remaining()),e.append(t),i?e.flip():e},c.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},c.toArrayBuffer=c.encodeAB,c.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},c.toBuffer=c.encodeNB,c.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},c.toBase64=c.encode64,c.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},c.toHex=c.encodeHex,c.toRaw=function(e,t){return i(this,!!e,!!t,this.$type)},c.encodeJSON=function(){return JSON.stringify(i(this,!0,!0,this.$type))},l.decode=function(e,t){var i,o;"string"==typeof e&&(e=n.wrap(e,t||"base64")),i=(e=n.isByteBuffer(e)?e:n.wrap(e)).littleEndian;try{return o=r.decode(e.LE()),e.LE(i),o}catch(t){throw e.LE(i),t}},l.decodeDelimited=function(e,t){var i,o,s;if("string"==typeof e&&(e=n.wrap(e,t||"base64")),(e=n.isByteBuffer(e)?e:n.wrap(e)).remaining()<1)return null;if(i=e.offset,o=e.readVarint32(),e.remaining()<o)return e.offset=i,null;try{return s=r.decode(e.slice(e.offset,e.offset+o).LE()),e.offset+=o,s}catch(t){throw e.offset+=o,t}},l.decode64=function(e){return l.decode(e,"base64")},l.decodeHex=function(e){return l.decode(e,"hex")},l.decodeJSON=function(e){return new l(JSON.parse(e))},c.toString=function(){return r.toString()},Object.defineProperty&&(Object.defineProperty(l,"$options",{value:r.buildOpt()}),Object.defineProperty(c,"$options",{value:l.$options}),Object.defineProperty(l,"$type",{value:r}),Object.defineProperty(c,"$type",{value:r})),l}(e,this),this._fields=[],this._fieldsById={},this._fieldsByName={},s=0,a=this.children.length;a>s;s++)if((o=this.children[s])instanceof h||o instanceof l||o instanceof b){if(i.hasOwnProperty(o.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+o.toString(!0)+" cannot override static property '"+o.name+"'");i[o.name]=o.build()}else if(o instanceof l.Field)o.build(),this._fields.push(o),this._fieldsById[o.id]=o,this._fieldsByName[o.name]=o;else if(!(o instanceof l.OneOf||o instanceof E))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[s].toString(!0));return this.clazz=i},c.encode=function(e,t,r){var n,i,o,s,a,u=null;for(o=0,s=this._fields.length;s>o;++o)i=e[(n=this._fields[o]).name],n.required&&null===i?null===u&&(u=n):n.encode(r?i:n.verifyValue(i),t,e);if(null!==u)throw(a=Error("Missing at least one required field for "+this.toString(!0)+": "+u)).encoded=t,a;return t},c.calculate=function(e){for(var t,r,n=0,i=0,o=this._fields.length;o>i;++i){if(r=e[(t=this._fields[i]).name],t.required&&null===r)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);n+=t.calculate(r,e)}return n},c.decode=function(t,r,n){var o,s,a,u,l,c,d,p,f,_,h,g;for(r="number"==typeof r?r:-1,l=t.offset,c=new this.clazz;t.offset<l+r||-1===r&&t.remaining()>0;){if(a=(o=t.readVarint32())>>>3,(s=7&o)===e.WIRE_TYPES.ENDGROUP){if(a!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(n?n+" expected":"not a group")+")");break}if(u=this._fieldsById[a])u.repeated&&!u.options.packed?c[u.name].push(u.decode(s,t)):u.map?(p=u.decode(s,t),c[u.name].set(p[0],p[1])):(c[u.name]=u.decode(s,t),u.oneof&&(null!==(f=c[u.oneof.name])&&f!==u.name&&(c[f]=null),c[u.oneof.name]=u.name));else switch(s){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:d=t.readVarint32(),t.offset+=d;break;case e.WIRE_TYPES.STARTGROUP:for(;i(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+s)}}for(_=0,h=this._fields.length;h>_;++_)if(null===c[(u=this._fields[_]).name])if("proto3"===this.syntax)c[u.name]=u.defaultValue;else{if(u.required)throw(g=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name)).decoded=c,g;e.populateDefaults&&null!==u.defaultValue&&(c[u.name]=u.defaultValue)}return c},I.Message=l,d=function(t,r,n,i,o,s,a,u,c,d){y.call(this,t,r,s),this.className="Message.Field",this.required="required"===n,this.repeated="repeated"===n,this.map="map"===n,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=a,this.options=u||{},this.defaultValue=null,this.oneof=c||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof l.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},(p=d.prototype=Object.create(y.prototype)).build=function(){this.element=new a(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new a(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=a.defaultFieldValue(this.type)},p.verifyValue=function(t,r){var n,i,o;if(r=r||!1,n=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this),null===t)return this.required&&n(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&n(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!r){for(Array.isArray(t)||(t=[t]),o=[],i=0;i<t.length;i++)o.push(this.element.verifyValue(t[i]));return o}return this.map&&!r?t instanceof e.Map?t:(t instanceof Object||n(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&n(typeof t,"no array expected"),this.element.verifyValue(t))},p.hasWirePresence=function(t,r){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&r[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},p.encode=function(t,r,i){var o,s,a,u,l;if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return r;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1),s=r.offset,o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],r);a=r.offset-s,(u=n.calculateVarint32(a))>1&&(l=r.slice(s,r.offset),s+=u-1,r.offset=s,r.append(l)),r.writeVarint32(a,s-u)}else for(o=0;o<t.length;o++)r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[o],r);else this.map?t.forEach((function(t,i){var o=n.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+n.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.writeVarint32(o),r.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,r),r.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,r)}),this):this.hasWirePresence(t,i)&&(r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,r))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return r},p.calculate=function(t,r){var i,o,s;if(t=this.verifyValue(t),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return 0;i=0;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=n.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),s=0,o=0;o<t.length;o++)s+=this.element.calculateLength(this.id,t[o]);i+=n.calculateVarint32(s),i+=s}else for(o=0;o<t.length;o++)i+=n.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[o]);else this.map?t.forEach((function(t,r){var o=n.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+n.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i+=n.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=n.calculateVarint32(o),i+=o}),this):this.hasWirePresence(t,r)&&(i+=n.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},p.decode=function(t,r,n){var i,o,s,u,l,c,d;if(!(!this.map&&t==this.type.wireType||!n&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!n){for(o=r.readVarint32(),o=r.offset+o,s=[];r.offset<o;)s.push(this.decode(this.type.wireType,r,!0));return s}if(this.map){if(u=a.defaultFieldValue(this.keyType),i=a.defaultFieldValue(this.type),o=r.readVarint32(),r.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+r.remaining());for((l=r.clone()).limit=l.offset+o,r.offset+=o;l.remaining()>0;)if(t=7&(c=l.readVarint32()),1===(d=c>>>3))u=this.keyElement.decode(l,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,t,d)}return[u,i]}return this.element.decode(r,t,this.id)},I.Message.Field=d,f=function(e,t,r,n,i,o,s){d.call(this,e,t,r,null,n,i,o,s),this.extension},f.prototype=Object.create(d.prototype),I.Message.ExtensionField=f,_=function(e,t,r){y.call(this,e,t,r),this.fields=[]},I.Message.OneOf=_,h=function(e,t,r,n,i){o.call(this,e,t,r,n,i),this.className="Enum",this.object=null},h.getName=function(e,t){var r,n,i=Object.keys(e);for(n=0;n<i.length;++n)if(e[r=i[n]]===t)return r;return null},(h.prototype=Object.create(o.prototype)).build=function(t){var r,n,i,o;if(this.object&&!t)return this.object;for(r=new e.Builder.Enum,i=0,o=(n=this.getChildren(h.Value)).length;o>i;++i)r[n[i].name]=n[i].id;return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=r},I.Enum=h,g=function(e,t,r,n){y.call(this,e,t,r),this.className="Enum.Value",this.id=n},g.prototype=Object.create(y.prototype),I.Enum.Value=g,E=function(e,t,r,n){y.call(this,e,t,r),this.field=n},E.prototype=Object.create(y.prototype),I.Extension=E,b=function(e,t,r,n){o.call(this,e,t,r,n),this.className="Service",this.clazz=null},(b.prototype=Object.create(o.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){var r,i=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,r){setTimeout(r.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},o=i.prototype=Object.create(e.Builder.Service.prototype),s=t.getChildren(e.Reflect.Service.RPCMethod);for(r=0;r<s.length;r++)!function(e){o[e.name]=function(r,i){try{try{r=e.resolvedRequestType.clazz.decode(n.wrap(r))}catch(e){if(!(e instanceof TypeError))throw e}if(null===r||"object"!=typeof r)throw Error("Illegal arguments");r instanceof e.resolvedRequestType.clazz||(r=new e.resolvedRequestType.clazz(r)),this.rpcImpl(e.fqn(),r,(function(r,n){if(!r){try{n=e.resolvedResponseType.clazz.decode(n)}catch(e){}return n&&n instanceof e.resolvedResponseType.clazz?void i(null,n):void i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}i(r)}))}catch(e){setTimeout(i.bind(this,e),0)}},i[e.name]=function(t,r,n){new i(t)[e.name](r,n)},Object.defineProperty&&(Object.defineProperty(i[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(o[e.name],"$options",{value:i[e.name].$options}))}(s[r]);return Object.defineProperty&&(Object.defineProperty(i,"$options",{value:t.buildOpt()}),Object.defineProperty(o,"$options",{value:i.$options}),Object.defineProperty(i,"$type",{value:t}),Object.defineProperty(o,"$type",{value:t})),i}(e,this)},I.Service=b,v=function(e,t,r,n){y.call(this,e,t,r),this.className="Service.Method",this.options=n||{}},(v.prototype=Object.create(y.prototype)).buildOpt=s.buildOpt,I.Service.Method=v,T=function(e,t,r,n,i,o,s,a){v.call(this,e,t,r,a),this.className="Service.RPCMethod",this.requestName=n,this.responseName=i,this.requestStream=o,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null},T.prototype=Object.create(v.prototype),I.Service.RPCMethod=T,I}(o),o.Builder=function(e,t,r){function n(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,n(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}var i=function(e){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},o=i.prototype;return i.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},i.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},i.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},i.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},i.isExtend=function(e){return"string"==typeof e.ref},o.reset=function(){return this.ptr=this.ns,this},o.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach((function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new r.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},o.create=function(t){var n,o,s,a,u;if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(n=[t];n.length>0;){if(t=n.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){if(o=t.shift(),i.isMessage(o)){if(s=new r.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),a={},o.oneofs&&Object.keys(o.oneofs).forEach((function(e){s.addChild(a[e]=new r.Message.OneOf(this,s,e))}),this),o.fields&&o.fields.forEach((function(e){if(null!==s.getChild(0|e.id))throw Error("duplicate or invalid field id in "+s.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+s.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+s.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,s,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,o.syntax),t&&t.fields.push(e),s.addChild(e)}),this),u=[],o.enums&&o.enums.forEach((function(e){u.push(e)})),o.messages&&o.messages.forEach((function(e){u.push(e)})),o.services&&o.services.forEach((function(e){u.push(e)})),o.extensions&&(s.extensions="number"==typeof o.extensions[0]?[o.extensions]:o.extensions),this.ptr.addChild(s),u.length>0){n.push(t),t=u,u=null,this.ptr=s,s=null;continue}u=null}else if(i.isEnum(o))s=new r.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){s.addChild(new r.Enum.Value(this,s,e.name,e.id))}),this),this.ptr.addChild(s);else if(i.isService(o))s=new r.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];s.addChild(new r.Service.RPCMethod(this,s,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(s);else{if(!i.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(s=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){var n,i,o,a;if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions&&(n=!1,s.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)})),!n))throw Error("illegal extended field id in "+s.name+": "+t.id+" (not within valid ranges)");i=t.name,this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i)),o=new r.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new r.Extension(this,this.ptr,t.name,o),o.extension=a,this.ptr.addChild(a),s.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,s=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},o.import=function(t,r){var i,o,s,a,u,l,c,d,p="/";if("string"==typeof r){if(e.Util.IS_NODE,!0===this.files[r])return this.reset();this.files[r]=!0}else if("object"==typeof r){if(i=r.root,e.Util.IS_NODE,(i.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(p="\\"),o=i+p+r.file,!0===this.files[o])return this.reset();this.files[o]=!0}if(t.imports&&t.imports.length>0){for(a=!1,"object"==typeof r?(this.importRoot=r.root,a=!0,s=this.importRoot,r=r.file,(s.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(p="\\")):"string"==typeof r?this.importRoot?s=this.importRoot:r.indexOf("/")>=0?""===(s=r.replace(/\/[^\/]*$/,""))&&(s="/"):r.indexOf("\\")>=0?(s=r.replace(/\\[^\\]*$/,""),p="\\"):s=".":s=null,u=0;u<t.imports.length;u++)if("string"==typeof t.imports[u]){if(!s)throw Error("cannot determine import root");if("google/protobuf/descriptor.proto"===(l=t.imports[u]))continue;if(l=s+p+l,!0===this.files[l])continue;if(/\.proto$/i.test(l)&&!e.DotProto&&(l=l.replace(/\.proto$/,".json")),null===(c=e.Util.fetch(l)))throw Error("failed to import '"+l+"' in '"+r+"': file not found");/\.json$/i.test(l)?this.import(JSON.parse(c+""),l):this.import(e.DotProto.Parser.parse(c),l)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[u],r.replace(/^(.+)\.(\w+)$/,(function(e,t,r){return t+"_import"+u+"."+r}))):this.import(t.imports[u],r+"_import"+u):this.import(t.imports[u]);a&&(this.importRoot=null)}return t.package&&this.define(t.package),t.syntax&&n(t),d=this.ptr,t.options&&Object.keys(t.options).forEach((function(e){d.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=d),t.enums&&(this.create(t.enums),this.ptr=d),t.services&&(this.create(t.services),this.ptr=d),t.extends&&this.create(t.extends),this.reset()},o.resolveAll=function(){var n;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof r.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(n=(this.ptr instanceof r.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=n,n instanceof r.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==n.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(n instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=n.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((n=this.ptr.parent.resolve(this.ptr.requestName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=n,!((n=this.ptr.parent.resolve(this.ptr.responseName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=n}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},o.build=function(e){var t,r,n;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(t="string"==typeof e?e.split("."):e,r=this.result,n=0;n<t.length;n++){if(!r[t[n]]){r=null;break}r=r[t[n]]}return r},o.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},o.toString=function(){return"Builder"},i.Message=function(){},i.Enum=function(){},i.Service=function(){},i}(o,o.Lang,o.Reflect),o.Map=function(e,t){function r(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var n=function(e,r){var n,i,o,s;if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),r)for(n=Object.keys(r),i=0;i<n.length;i++)o=this.keyElem.valueFromString(n[i]),s=this.valueElem.verifyValue(r[n[i]]),this.map[this.keyElem.valueToString(o)]={key:o,value:s}},i=n.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),r=t in this.map;return delete this.map[t],r},i.entries=function(){var e,t,n=[],i=Object.keys(this.map);for(t=0;t<i.length;t++)n.push([(e=this.map[i[t]]).key,e.value]);return r(n)},i.keys=function(){var e,t=[],n=Object.keys(this.map);for(e=0;e<n.length;e++)t.push(this.map[n[e]].key);return r(t)},i.values=function(){var e,t=[],n=Object.keys(this.map);for(e=0;e<n.length;e++)t.push(this.map[n[e]].value);return r(t)},i.forEach=function(e,t){var r,n,i=Object.keys(this.map);for(n=0;n<i.length;n++)e.call(t,(r=this.map[i[n]]).value,r.key,this)},i.set=function(e,t){var r=this.keyElem.verifyValue(e),n=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(r)]={key:r,value:n},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map?this.map[t].value:void 0},i.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},n}(0,o.Reflect),o.loadProto=function(e,t,r){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(r=t,t=void 0),o.loadJson(o.DotProto.Parser.parse(e),t,r)},o.protoFromString=o.loadProto,o.loadProtoFile=function(e,t,r){if(t&&"object"==typeof t?(r=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(n){if(null!==n)try{t(null,o.loadProto(n,r,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var n=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===n?null:o.loadProto(n,r,e)},o.protoFromFile=o.loadProtoFile,o.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=o.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=o.populateAccessors),new o.Builder(e)},o.loadJson=function(e,t,r){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(r=t,t=null),t&&"object"==typeof t||(t=o.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,r),t.resolveAll(),t},o.loadJsonFile=function(e,t,r){if(t&&"object"==typeof t?(r=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(n){if(null!==n)try{t(null,o.loadJson(JSON.parse(n),r,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var n=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===n?null:o.loadJson(JSON.parse(n),r,e)},i=e,o.loadProto(i,void 0,"").build("Modules").probuf}(r,t);return n}var rs=function(){function e(e,t){Xo.add(this),Object.defineProperty(this,"nestedMap",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbModules=ts(e)}return Object.defineProperty(e.prototype,"_encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=new this.pbModules[e],o="";if(t)try{Object.keys(t).forEach((function(r){var s=t[r];if(void 0!==s){var a=n.nestedMap.get("".concat(e,"_").concat(r));if(o="set".concat(r.charAt(0).toUpperCase()+r.slice(1)),a){var u=s instanceof Array?s.map((function(e){return n._encode(a,e,!0)})):n._encode(a,s,!0);i[o](u)}else i[o](s)}}))}catch(t){var s="name: ".concat(e,", method: ").concat(o,", stack: ").concat(t.stack);null===console||void 0===console||console.error("pb encode error!",s)}return r?i:i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._encode(e,t)}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{var r=this.pbModules[e].decode(t);return c(this,Xo,"m",zo).call(this,r)}catch(t){var n="name: ".concat(e,", stack: ").concat(t.stack);throw null===console||void 0===console||console.error("pb decode error!",n),t}}}),Object.defineProperty(e.prototype,"getModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new this.pbModules[e]}}),e}();Xo=new WeakSet,zo=function e(t){var r,n=this;if(t instanceof Array)return t.map((function(t){return c(n,Xo,"m",e).call(n,t)}));if(r=t,"[object Object]"!==Object.prototype.toString.call(r))return t;if(t.buffer instanceof ArrayBuffer&&"number"==typeof t.offset&&"number"==typeof t.limit){var i=t.buffer,o=t.offset,s=t.limit;return i.slice(o,s)}if(void 0!==t.low&&void 0!==t.high&&Object.prototype.hasOwnProperty.call(t,"unsigned")){var a=t.low;return a<0&&(a+=4294967296),a=a.toString(16),parseInt(t.high.toString(16)+"00000000".replace(new RegExp("0{".concat(a.length,"}$")),a),16)}var u=t;return Object.keys(t).forEach((function(r){u[r]=c(n,Xo,"m",e).call(n,t[r])})),u};var ns,is,os,ss,as="NotifyMsg",us="SyncRequestMsg",ls="UpStreamMessage",cs="PushExtra",ds="DownStreamMessages",ps="ChrmDownStreamMessages",fs="DownStreamMessage",_s="GetQNupTokenInput",hs="GetDownloadUrlInput",gs="GetQNupTokenOutput",Es="GetDownloadUrlOutput",bs="ChrmInput",vs="ChrmOutput",Ts="ChrmPullMsg",Is="RelationQryInput",ys="RelationsOutput",ms="QryRemindListReq",Rs="QryRemindListResp",Ss="CleanHisMsgInput",As="CleanMsgBatchReq",Os="QueryChatRoomInfoInput",Cs="QueryChatRoomInfoOutput",Ns="HistoryMsgInput",Ps="HistoryMsgOuput",Ls="SessionsAttQryInput",Ms="SessionsAttOutput",ws="SessionMsgReadInput",Us="DeleteSessionsInput",Ds="QuerySessionsInput",xs="QuerySessionsOutPut",Gs="RelationDelBatchReq",Vs="DeleteMsgInput",js="SetChrmKV",Fs="SetChrmKVS",Bs="ChrmKVOutput",Hs="ChrmKVSOutput",qs="QueryChrmKV",Ys="SetUserSettingInput",Ws="SetUserSettingOutput",Ks="PullUserSettingInput",Js="PullUserSettingOutput",Qs="SessionReq",Xs="SessionStates",zs="SessionStateModifyReq",Zs="GroupUnpushQuery",$s="GroupUnpushSet",ea="GroupUnpushResult",ta="SessionStateModifyResp",ra="TypeUnpushInput",na="TypeUnpushOutput",ia="GrpReadReceiptMsg",oa="ReadReceipt",sa="QueryReceiptReq",aa="QueryReceiptBatchReq",ua="ReceiptResp",la="QueryReceiptBatchResp",ca="GrpReadReceiptQryResp",da="SessionTagAddInput",pa="SessionTagDelInput",fa="UserSettingNotification",_a="ReportSDKInput",ha="UltraGrpPullSes",ga="UltraGrpPullMsg",Ea="MsgChangeReq",ba="ModifyMsgResp",va="QueryMsgChange",Ta="EventChangeList",Ia="MsgChangeList",ya="MsgQuery",ma="MsgQueryAck",Ra="OperateStatus",Sa="OperateStatusNotify",Aa="SetRtcRoomIdInput",Oa="CallInfoUpStream",Ca="CallInfoDownStream",Na="KvInput",Pa="KvOutput",La="ReadReceiptMsg",Ma="ReceiptQryReq",wa="QueryReceiptResp",Ua="ReceiptCntQryReq",Da="ReceiptCntQryResp",xa="UpdateUserSubReq",Ga="UserSubDetail",Va="UpdateUserSubResp",ja="PullUserSubReq",ka="PUllUserSubResp",Fa="PullSubDataReq",Ba="PullSubDataResp",Ha="SubDataDetail",qa="QrySubDataReq",Ya="UserProfile",Wa="ProfileInfo",Ka="SetUserProfileResp",Ja="PullUserProfileReq",Qa="UserProfiles",Xa="UserProfileInput",za="UserProfilePermission",Za="SearchUserProfile",$a="ChannelsInput",eu="ChannelsOutput",tu="MultiChannels",ru="ModifyChannelsInput",nu="QuitChannelsSetting",iu="ChannelsQueryInput",ou="ChannelsPageParam",su="ChannelsListResult",au="ChannelsInviteStatusInfos",uu="ChannelsUserInfos",lu="ChannelsJoinedInfos",cu="ChannelsMemberUpdateInput",du="ChannelsMemberResponseInput",pu="ChannelsMembersInput",fu="FriendInput",_u="FriendsInput",hu="FriendsCheckOutput",gu="FriendProfileInput",Eu="FriendProfileOutput",bu="FriendQueryInput",vu="FriendsListInput",Tu="FriendLevelSet",Iu="FriendUserInfos",yu="FriendInviteInfos",mu="ChannelApplyInfo",Ru="AddUnpushPeriodInput",Su="DeleteUnpushPeriodInput",Au="QueryUnpushPeriodInput",Ou="QueryUnpushPeriodOutput",Cu="MsgReadEvent",Nu="ConvertMsgInput",Pu="SpeechToTextInfo",Lu="ConvertMsgOutput",Mu="SpeechToTextResult",wu="TransReq",Uu="TransResp",Du="PullModifyMsgReq",xu="PullModifyMsgResp",Gu=new Map([["UpStreamMessage_pushExt","PushExtra"],["DownStreamMessages_list","DownStreamMessage"],["DownStreamMessage_pushExt","PushExtra"],["ChannelInfosOutput_channels","ChannelInfoOutput"],["GroupMembersOutput_members","MemberInfo"],["GroupInput_groupInfo","GroupInfo"],["RelationsInput_msg","DownStreamMessage"],["RelationsOutput_info","RelationInfo"],["RelationInfo_msg","DownStreamMessage"],["RelationInfo_msgInfo","UnreadMsgInfo"],["QryRemindListResp_msgInfo","UnreadMsgInfo"],["CleanMsgBatchReq_input","CleanHisMsgInput"],["HistoryMessagesOuput_list","DownStreamMessage"],["QueryChatRoomInfoOutput_userInfos","ChrmMember"],["MPFollowOutput_info","MpInfo"],["MCFollowOutput_info","MpInfo"],["SearchMpOutput_info","MpInfo"],["PullMpOutput_info","MpInfo"],["HistoryMsgOuput_list","DownStreamMessage"],["DeleteSessionsInput_sessions","SessionInfo"],["QuerySessionsInput_sessions","SessionInfo"],["QuerySessionsOutPut_sessions","SessionInfo"],["RelationDelBatchReq_relation","RelationOpInput"],["DeleteMsgInput_msgs","DeleteMsg"],["SetChrmKV_entry","ChrmKVEntity"],["SetChrmKV_notification","UpStreamMessage"],["SetChrmKVS_entry","ChrmKVEntity"],["SetChrmKVS_notification","UpStreamMessage"],["DeleteChrmKVS_entry","ChrmKVEntity"],["DeleteChrmKVS_notification","UpStreamMessage"],["ChrmKVOutput_entries","ChrmKVEntity"],["ChrmKVSOutput_errorKeys","ChrmKVSOutputEntity"],["ChrmKVSOutput_keysVersion","ChrmKVSVersionEntity"],["PullUserSettingOutput_items","UserSettingItem"],["UserSettingItem_tags","SessionTagItem"],["SessionStates_state","SessionState"],["SessionState_stateItem","SessionStateItem"],["SessionStateItem_tags","SessionTagItem"],["SessionStateModifyReq_state","SessionState"],["QueryReceiptBatchReq_items","QueryReceipt"],["ReceiptResp_resp","QueryReceiptRespItem"],["QueryReceiptBatchResp_item","QueryReceiptBatchRespItem"],["QueryReceiptBatchRespItem_msg","QueryReceiptRespItem"],["QueryReceiptRespItem_readUser","ReceiptUser"],["QueryReceiptRespItem_unreadUser","ReceiptUser"],["GrpReadReceiptQryResp_list","GrpMsgReadUser"],["SessionTagAddInput_tags","SessionTagItem"],["SessionTagDelInput_tags","SessionTagItem"],["ModifyMsgResp_msg","DownStreamMessage"],["EventChangeList_list","EventChange"],["MsgChangeList_list","MsgChange"],["MsgQuery_query","MessageQueryInfo"],["MsgQueryAck_list","DownStreamMessage"],["OperateStatusNotify_info","OperateInfo"],["OperateStatusNotify_summary","OperateSummary"],["KvOutput_info","KvInfo"],["QueryReceiptResp_list","ReceiptUser"],["ReceiptCntQryResp_result","MsgReadCnt"],["UpdateUserSubReq_subUsers","UserSubDetail"],["UpdateUserSubResp_subUsers","UserSubDetail"],["PUllUserSubResp_list","UserSubList"],["UserSubList_subUsers","UserSubDetail"],["PullSubDataResp_list","SubDataDetail"],["SubDataDetail_data","SubData"],["QrySubDataReq_subUsers","UserSubDetail"],["UserProfile_userProfile","ProfileInfo"],["UserProfile_userExtProfile","ProfileInfo"],["UserProfiles_UserProfile","UserProfile"],["ChannelsInput_settingProfile","ProfileInfo"],["ChannelsInput_extProfile","ProfileInfo"],["ChannelsInput_baseInfo","ChannelBaseInfo"],["ChannelsOutput_channelInfo","ChannelsJoinedInfo"],["ChannelsOutput_userInfos","ChannelsUserInfo"],["ChannelsOutput_friendInviteInfo","FriendInviteInfo"],["ChannelsOutput_friendUserInfo","FriendUserInfo"],["MultiChannels_list","ChannelsInput"],["ModifyChannelsInput_settingInfo","QuitChannelsSetting"],["ChannelsQueryInput_page","ChannelsPageParam"],["ChannelsListResult_page","ChannelsPageParam"],["ChannelsInviteStatusInfos_list","ChannelsInviteStatusInfo"],["ChannelsUserInfos_list","ChannelsUserInfo"],["ChannelsJoinedInfos_list","ChannelsJoinedInfo"],["ChannelsUserInfo_ext","ChannelsUserExtInfo"],["ChannelsJoinedInfo_settingProfile","ProfileInfo"],["ChannelsJoinedInfo_extProfile","ProfileInfo"],["ChannelsJoinedInfo_baseInfo","ChannelBaseInfo"],["ChannelsJoinedInfo_userInfo","ChannelsUserExtInfo"],["ChannelsInviteStatusInfo_joinUserInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_inviterInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_processInfo","ChannelsUserInfo"],["FriendsOutput_list","FriendOutput"],["FriendsCheckOutput_list","FriendCheckOutput"],["FriendProfileInput_extProfile","ProfileInfo"],["FriendQueryInput_page","ChannelsPageParam"],["FriendUserInfo_extProfile","ProfileInfo"],["FriendUserInfos_list","FriendUserInfo"],["FriendInviteInfos_list","FriendInviteInfo"],["UpdateChannnelInfo_channelInfo","ChannelsJoinedInfo"],["UpdateChannnelInfo_userInfo","ChannelsUserInfo"],["UpdateUserInfo_updatedUserInfo","ChannelsUserInfo"],["UpdateUserInfo_optUserInfo","ChannelsUserInfo"],["ChannelApplyInfo_statusInfo","ChannelsInviteStatusInfo"],["ChannelEventData_optUserInfo","ChannelsUserInfo"],["ChannelEventData_channelInfo","ChannelsJoinedInfo"],["ChannelEventData_userInfos","ChannelsUserInfo"],["ChannelEventData_channelFullInfo","ChannelsJoinedInfo"],["FriendUpdateEvent_extProfile","ProfileInfo"],["MsgReadEvent_readList","ReceiptUser"],["TransReq_transInfos","TransInfo"],["TransResp_results","TransResult"],["PullModifyMsgResp_msg","ModifyMsg"],["ModifyMsg_msg","DownStreamMessage"]]);!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"}(ns||(ns={})),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"}(is||(is={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(os||(os={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(ss||(ss={}));var Vu,ju,ku,Fu,Bu,Hu,qu,Yu,Wu,Ku=new rs("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 }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n IMAGE = 1;\n AUDIO = 2;\n VIDEO = 3;\n FILE = 4;\n SIGHT = 5;\n COMBINE_HTML = 6;\n }\n message GetQNupTokenInput {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n optional string url = 5;\n optional string ext = 6;\n optional int64 size = 7;\n optional int32 ipType = 8;\n }\n message GetQNdownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message GetDownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4;\n optional int64 size = 5;\n optional int32 ipType = 6;\n }\n message GetQNupTokenOutput {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n optional string minioAuthorization = 20;\n optional string minioContentSha256 = 21;\n optional string minioDate = 22;\n optional string minioBucketName = 23;\n\n optional string downloadAuthInfo = 24;\n optional string ossConfig = 25;\n }\n message GetQNdownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message GetDownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n GROUP_SUCCESS = 0x00;\n GROUP_FAILURE = 0x01;\n }\n message ChrmInput {\n required int32 nothing = 1;\n optional string extra = 2;\n }\n message ChrmOutput {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n optional int64 createTime = 4;\n optional int32 memberCount = 5;\n optional int32 chatroomBanState = 6;\n optional int32 whiteListState = 7;\n }\n message ChrmPullMsg {\n required int64 syncTime = 1;\n required int32 count = 2;\n optional int32 pullMsgType = 3;\n optional bool compressioEnabled = 4;\n }\n message ChrmPullMsgNew {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message RelationQryInput {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n optional bool isEraseMsgContent = 5;\n optional int64 endTime = 6;\n optional bool compressioEnabled = 7;\n optional int32 qryType = 8;\n }\n message RelationsInput {\n required ChannelType type = 1;\n optional DownStreamMessage msg =2;\n optional int32 count = 3;\n repeated string busChannel = 4;\n optional int64 startTime = 5;\n optional int64 endTime = 6;\n }\n message RelationsOutput {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;\n optional int64 pullTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message RelationInfo {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;\n optional int64 versionTime = 7;\n optional int64 remindCount = 8;\n optional int32 busChannelType = 9;\n optional UnreadMsgInfo msgInfo = 10;\n optional int32 remindMeCount = 11;\n }\n message UnreadMsgInfo {\n required string msgId = 1;\n required int64 msgTime= 2;\n optional int32 remindType= 3;\n optional string className = 4;\n }\n message QryRemindListReq {\n required string groupId = 1;\n optional string busChannel = 2;\n optional int64 msgTime = 3;\n optional int32 size = 4;\n }\n message QryRemindListResp {\n repeated UnreadMsgInfo msgInfo = 1;\n }\n message RelationInfoReadTime {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message CleanHisMsgInput {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4;\n }\n message CleanMsgBatchReq {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6; \n optional bytes compressedData = 7;\n }\n message QueryChatRoomInfoInput {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message QueryChatRoomInfoOutput {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput {\n required string id = 1;\n }\n\n message MPFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message HistoryMsgInput {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5;\n optional bool compressioEnabled = 6;\n }\n\n message HistoryMsgOuput {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6;\n optional bytes compressedData = 7;\n }\n message SessionsAttQryInput {\n required int32 nothing = 1;\n }\n message SessionsAttOutput {\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message SessionMsgReadInput {\n required ChannelType type = 1;\n required int64 msgTime = 2;\n required string channelId = 3;\n optional string busChannel = 4;\n }\n message SessionMsgReadOutput {\n optional int32 nothing=1;\n }\n message DeleteSessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message SessionInfo {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 unreadCount = 3;\n optional string busChannel = 4;\n }\n message QuerySessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message QuerySessionsOutPut {\n repeated SessionInfo sessions = 1;\n }\n message DeleteSessionsOutput {\n optional int32 nothing=1;\n }\n message RelationDelBatchReq {\n repeated RelationOpInput relation = 1;\n 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 }\n\n message ChannelsPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n optional bool hasNext = 3 ;\n optional int32 total = 4 ;\n optional int32 order = 5 ;\n }\n\n message ChannelsListResult {\n optional int32 listType = 1;\n optional bytes result = 2;\n optional ChannelsPageParam page = 3;\n }\n \n message ChannelsInviteStatusInfos {\n repeated ChannelsInviteStatusInfo list = 1;\n }\n \n message ChannelsUserInfos {\n repeated ChannelsUserInfo list = 1;\n }\n \n message ChannelsJoinedInfos {\n repeated ChannelsJoinedInfo list = 1;\n }\n\n message ChannelsUserInfo {\n optional string userId = 1;\n optional ChannelsUserExtInfo ext = 2;\n optional int64 opTime = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n\n message ChannelsUserExtInfo {\n optional int32 role = 1;\n optional int64 joinTime = 2;\n optional string channelNickName = 3;\n optional string additional = 4;\n optional string remarkName = 5;\n }\n\n message ChannelsMemberUpdateInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional string userId = 3;\n optional string channelNickName = 4;\n optional string additional = 5;\n optional int32 operateType = 6;\n }\n message ChannelsJoinedInfo {\n optional string targetId = 1;\n repeated ProfileInfo settingProfile = 2;\n repeated ProfileInfo extProfile = 3;\n optional ChannelBaseInfo baseInfo = 4;\n optional ChannelsUserExtInfo userInfo = 5;\n }\n message ChannelsInviteStatusInfo {\n optional string targetId = 1;\n optional ChannelsUserInfo joinUserInfo = 2;\n optional ChannelsUserInfo inviterInfo = 3;\n optional int32 status = 4;\n optional int32 directionType = 5;\n optional int32 joinType = 6;\n optional string detail = 7;\n optional int64 applyTime = 8;\n optional ChannelsUserInfo processInfo = 9;\n optional int64 processTime = 10;\n }\n message ChannelsMemberResponseInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 optType = 3;\n optional int32 optResult = 4;\n optional string joinUserId = 5;\n optional string inviterId = 6;\n optional string detail = 7;\n }\n message ChannelsMembersInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string userIds = 3;\n }\n message FriendInput {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string info = 3;\n }\n message FriendsOutput {\n repeated FriendOutput list = 1;\n }\n message FriendOutput {\n optional string userId = 1;\n optional int64 operateTime = 2;\n optional string flag = 3;\n }\n message FriendsInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendsCheckOutput {\n repeated FriendCheckOutput list = 1;\n }\n\n message FriendCheckOutput {\n optional string targetId = 1;\n optional int32 status = 2;\n }\n message FriendProfileInput {\n optional string targetId = 1;\n optional string remarkName = 2;\n repeated ProfileInfo extProfile = 3;\n }\n message FriendProfileOutput {\n repeated string censorFailedFields = 1;\n }\n message FriendQueryInput {\n optional int32 queryType = 1;\n optional ChannelsPageParam page = 2;\n optional int32 friendType= 3;\n }\n message FriendUserInfo {\n optional string userId = 1;\n optional int64 relationTime = 2;\n optional int32 friendType = 3;\n optional int32 flag = 4;\n optional string remarkName = 5;\n optional string name = 6;\n optional string portraitUrl = 7;\n repeated ProfileInfo extProfile = 8;\n \n }\n message FriendInviteInfo {\n optional string userId = 1;\n optional string name = 2;\n optional string portraitUrl = 3;\n optional int32 type = 4;\n optional int32 status = 5;\n optional int64 operateTime = 6;\n optional string info = 7;\n optional int32 friendType = 8;\n }\n message FriendsListInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendLevelSet {\n optional int32 level = 1;\n }\n\n message FriendPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n }\n message FriendUserInfos {\n repeated FriendUserInfo list = 1;\n }\n\n message FriendInviteInfos {\n repeated FriendInviteInfo list = 1;\n }\n \n message FriendApplyEvent {\n optional int32 applyType = 1;\n optional int32 friendType = 2;\n optional string info = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n message UpdateChannnelInfo {\n optional ChannelsJoinedInfo channelInfo = 1;\n optional ChannelsUserInfo userInfo = 2;\n }\n message UpdateUserInfo {\n optional ChannelsUserInfo updatedUserInfo = 1;\n optional ChannelsUserInfo optUserInfo = 2;\n }\n message ChannelApplyInfo {\n repeated ChannelsInviteStatusInfo statusInfo = 1;\n }\n message ChannelEventData {\n optional ChannelsUserInfo optUserInfo = 1;\n optional ChannelsJoinedInfo channelInfo = 2;\n repeated ChannelsUserInfo userInfos = 3;\n optional ChannelsJoinedInfo channelFullInfo = 4;\n }\n message FriendTypeChangeEvent {\n optional string friendId = 1;\n optional int32 friendType = 2;\n }\n message FriendUpdateEvent {\n optional string remarkname = 1;\n repeated ProfileInfo extProfile = 2;\n }\n message AddUnpushPeriodInput {\n required string startTime = 1;\n required int32 spanMinutes = 2;\n optional int32 level = 3;\n optional string timezone = 4;\n }\n message DeleteUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodOutput {\n required int32 isUnpush = 1;\n optional string startTime = 2;\n optional int32 spanMinutes = 3;\n optional int32 level = 4;\n optional string timezone = 5;\n }\n message RelationDel {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string busChannel = 3;\n optional bool cleanMsg = 4;\n }\n message MsgReadEvent {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int32 readCnt = 4;\n optional int32 unreadCnt = 5;\n repeated ReceiptUser readList =6;\n }\n 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 { \n optional int64 pullVersion = 1;\n optional bool compress = 2;\n }\n message PullModifyMsgResp\n {\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 {\n optional int32 modifyType = 1;\n optional DownStreamMessage msg = 2;\n }\n}\n",Gu);exports.LogLevel=void 0,(Vu=exports.LogLevel||(exports.LogLevel={}))[Vu.LOG=0]="LOG",Vu[Vu.DEBUG=0]="DEBUG",Vu[Vu.INFO=1]="INFO",Vu[Vu.WARN=2]="WARN",Vu[Vu.ERROR=3]="ERROR",Vu[Vu.FATAL=4]="FATAL",Vu[Vu.STATISTICS=6]="STATISTICS",Vu[Vu.NONE=1e3]="NONE",exports.LogSource=void 0,(ju=exports.LogSource||(exports.LogSource={})).IM="IM",ju.RTC="RTC",exports.ConnectionStatus=void 0,(ku=exports.ConnectionStatus||(exports.ConnectionStatus={}))[ku.CONNECTED=0]="CONNECTED",ku[ku.CONNECTING=1]="CONNECTING",ku[ku.DISCONNECTED=2]="DISCONNECTED",ku[ku.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",ku[ku.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",ku[ku.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",ku[ku.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",ku[ku.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",ku[ku.BLOCKED=9]="BLOCKED",ku[ku.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",ku[ku.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",ku[ku.REDIRECT=14]="REDIRECT",ku[ku.USER_LOGOUT=19]="USER_LOGOUT",ku[ku.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",ku[ku.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",ku[ku.ULTRALIMIT=1101]="ULTRALIMIT",ku[ku.REQUEST_NAVI=201]="REQUEST_NAVI",ku[ku.RESPONSE_NAVI=202]="RESPONSE_NAVI",ku[ku.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",ku[ku.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",ku[ku.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",ku[ku.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",exports.RTCMode=void 0,(Fu=exports.RTCMode||(exports.RTCMode={}))[Fu.RTC=0]="RTC",Fu[Fu.LIVE=2]="LIVE",Fu[Fu.SIP=4]="SIP",Fu[Fu.CALL=5]="CALL",Fu[Fu.MEETING=6]="MEETING",Fu[Fu.CROSS_MUTI=7]="CROSS_MUTI",Fu[Fu.CROSS_LIVE=8]="CROSS_LIVE",function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(Bu||(Bu={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(Hu||(Hu={})),exports.RTCApiType=void 0,(qu=exports.RTCApiType||(exports.RTCApiType={}))[qu.ROOM=1]="ROOM",qu[qu.PERSON=2]="PERSON",function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Yu||(Yu={})),exports.RTCJoinType=void 0,(Wu=exports.RTCJoinType||(exports.RTCJoinType={}))[Wu.KICK=0]="KICK",Wu[Wu.REFUSE=1]="REFUSE",Wu[Wu.COEXIST=2]="COEXIST";var Ju=null;function Qu(e,t,r,n){void 0===r&&(r={});var i=["error","warn","info","debug"][3-e];if(Ju&&e<exports.LogLevel.FATAL)try{var o=JSON.stringify(r);Ju[i](t,o)}catch(e){console.error(e)}}var Xu=Qu.bind(null,exports.LogLevel.DEBUG),zu={init:function(e){Ju=e},info:Qu.bind(null,exports.LogLevel.INFO),debug:Xu,warn:Qu.bind(null,exports.LogLevel.WARN),error:Qu.bind(null,exports.LogLevel.ERROR),fatal:Qu.bind(null,exports.LogLevel.FATAL)},Zu=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r})}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r,once:!0})}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e];n&&((n=n.filter((function(e){return e.listener!==t||e.target!==r}))).length?this._map[e]=n:delete this._map[e])}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map[e];if(n)for(var i=0;i<n.length;i+=1){var o=n[i],s=o.target,a=o.once,c=o.listener;a&&(n.splice(i,1),i-=1);try{c.call.apply(c,l([s],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._map[e]}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){Object.keys(this._map).forEach(this.removeAll,this)}}),e}(),$u=function(e,t,r){var n=null==r?void 0:r.isReverse;gt(e)&&function(){for(var r in e)t(e[r],r,e)}(),(ft(e)||ct(e))&&function(){if(n)for(var r=e.length-1;r>=0;r--)t(e[r],r);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()};var el,tl,rl=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},nl=function(){function e(e,t,r){Object.defineProperty(this,"pbmaps",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbModules=ts(t)}return Object.defineProperty(e.prototype,"getModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new this.pbModules[e]}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=new this.pbModules[e];if(t)try{this.pbmaps[e].forEach((function(e){var r=t[e];void 0!==r&&n["set".concat(function(e,t,r){if(void 0===t||void 0===r)return e.toUpperCase();var n=e.slice(t,r);return e.replace(n,(function(e){return e.toUpperCase()}))}(e,0,1))](r)}))}catch(t){var i="pbname: ".concat(e,", stack: ").concat(t.stack);this.logger?this.logger.error(H.L_PB_ENCODE_E,i):null===console||void 0===console||console.error(H.L_PB_ENCODE_E,i)}return r?n:n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.pbModules[e].decode(t);return this.fixInt64Values(r)}}),Object.defineProperty(e.prototype,"fixInt64Values",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(e instanceof Array)return e.map((function(e){return t.fixInt64Values(e)}));if(!gt(e))return e;if(void 0!==e.low&&void 0!==e.high&&Object.prototype.hasOwnProperty.call(e,"unsigned")){var r=e.low;return r<0&&(r+=4294967296),r=r.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(r.length,"}$")),r),16)}for(var n in e)e[n]=this.fixInt64Values(e[n]);return e}}),e}();!function(e){e.RtcInput="RtcInput",e.RtcUserListOutput="RtcUserListOutput",e.SetUserStatusInput="SetUserStatusInput",e.RtcSetDataInput="RtcSetDataInput",e.RtcUserSetDataInput="RtcUserSetDataInput",e.RtcDataInput="RtcDataInput",e.RtcSetOutDataInput="RtcSetOutDataInput",e.MCFollowInput="MCFollowInput",e.RtcTokenOutput="RtcTokenOutput",e.RtcQryOutput="RtcQryOutput",e.RtcQryUserOutDataInput="RtcQryUserOutDataInput",e.RtcUserOutDataOutput="RtcUserOutDataOutput",e.RtcQueryListInput="RtcQueryListInput",e.RtcRoomInfoOutput="RtcRoomInfoOutput",e.RtcValueInfo="RtcValueInfo",e.RtcKeyDeleteInput="RtcKeyDeleteInput",e.RtcNotifyMsg="RtcNotifyMsg",e.RtcPullKV="RtcPullKV",e.RtcKVOutput="RtcKVOutput",e.RtcQueryUserJoinedInput="RtcQueryUserJoinedInput",e.RtcQueryUserJoinedOutput="RtcQueryUserJoinedOutput",e.RtcViewerJoinedOutput="RtcViewerJoinedOutput",e.RtcInviteInput="RtcInviteInput",e.RtcCancelInviteInput="RtcCancelInviteInput",e.RtcInviteAnswerInput="RtcInviteAnswerInput",e.RtcEndInviteInput="RtcEndInviteInput",e.RtcOutput="RtcOutput"}(tl||(tl={}));var il,ol,sl,al,ul,ll,cl,dl,pl,fl,_l,hl=((el={})[tl.RtcInput]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType","innerDatas","outerDatas"],el[tl.RtcUserListOutput]=["users","token","sessionId","roomInfo"],el[tl.SetUserStatusInput]=["status"],el[tl.RtcSetDataInput]=["interior","target","key","value","objectName","content"],el[tl.RtcUserSetDataInput]=["valueInfo","objectName","content"],el[tl.RtcDataInput]=["interior","target","key","objectName","content"],el[tl.RtcSetOutDataInput]=["target","valueInfo","objectName","content"],el[tl.MCFollowInput]=["state"],el[tl.RtcTokenOutput]=["rtcToken"],el[tl.RtcQryOutput]=["outInfo"],el[tl.RtcQryUserOutDataInput]=["userId"],el[tl.RtcUserOutDataOutput]=["user"],el[tl.RtcQueryListInput]=["order"],el[tl.RtcRoomInfoOutput]=["roomId","roomData","userCount","list"],el[tl.RtcValueInfo]=["key","value"],el[tl.RtcKeyDeleteInput]=["key"],el[tl.RtcNotifyMsg]=["type","time","roomId"],el[tl.RtcPullKV]=["timestamp","roomId"],el[tl.RtcKVOutput]=["entries","bFullUpdate","syncTime"],el[tl.RtcQueryUserJoinedInput]=["userId"],el[tl.RtcQueryUserJoinedOutput]=["info"],el[tl.RtcInviteInput]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],el[tl.RtcCancelInviteInput]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],el[tl.RtcInviteAnswerInput]=["inviteUserId","answerCode","inviteRoomId","inviteSessionId","content","key","value"],el[tl.RtcEndInviteInput]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"],el),gl="\npackage Modules;\nmessage probuf {\n enum JoinType {\n KICK = 0; //踢前一个设备\n REFUSE = 1; //当前加入拒绝\n COEXIST = 2; //两个设备共存\n }\n enum targetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message ".concat(tl.SetUserStatusInput,"\n {\n optional int32 status=1;\n }\n message ").concat(tl.MCFollowInput,"\n {\n required string state = 1;\n }\n message ").concat(tl.RtcQueryListInput,"{\n optional int32 order=1;\n }\n message ").concat(tl.RtcKeyDeleteInput,"{\n repeated string key=1;\n }\n message ").concat(tl.RtcValueInfo,"{\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo{\n required string userId=1;\n repeated ").concat(tl.RtcValueInfo," userData=2; //用户资源信息\n }\n message ").concat(tl.RtcUserListOutput,"{\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4; //房间 key value\n repeated RtcKVEntity entries = 5;//直播 KV 属性对象集合\n optional int64 syncTime = 6;//所有属性的最大时间戳(下次拉取 KV 时用)。\n optional int32 offlineKickTime = 7;//server 超时踢人时间,默认 60s\n }\n message RtcRoomInfoOutput{\n optional string roomId = 1;\n repeated ").concat(tl.RtcValueInfo," roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message ").concat(tl.RtcInput,"{\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4; //是否需要同步聊天室\n optional IdentityChangeType identityChangeType = 5; //身份变更类型\n optional JoinType joinType = 6; // 加入房间类型\n repeated ").concat(tl.RtcValueInfo," innerDatas = 7; //用户内部 inner 数据,角色或者连麦信息等\n repeated ").concat(tl.RtcValueInfo," outerDatas = 8; //用户内部 outer 数据,自定义数据结构 RtcInput。\n }\n message ").concat(tl.RtcQryOutput,"{\n repeated ").concat(tl.RtcValueInfo," outInfo=1;\n }\n message ").concat(tl.RtcDataInput,"{\n required bool interior=1;\n required targetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message ").concat(tl.RtcSetDataInput,"{\n required bool interior=1;\n required targetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message ").concat(tl.RtcUserSetDataInput," {\n repeated ").concat(tl.RtcValueInfo," valueInfo = 1;\n required string objectName = 2;\n repeated ").concat(tl.RtcValueInfo," content = 3;\n }\n message RtcQryInput{\n required bool isInterior=1;\n required targetType target=2;\n repeated string key=3;\n }\n message RtcDelDataInput{\n repeated string key=1;\n required bool isInterior=2;\n required targetType target=3;\n }\n message RtcOutput\n {\n optional int32 nothing=1;\n optional int64 version=2;\n }\n message ").concat(tl.RtcTokenOutput,"{\n required string rtcToken=1;\n }\n message ").concat(tl.RtcSetOutDataInput,"{\n required targetType target=1;\n repeated ").concat(tl.RtcValueInfo," valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message ").concat(tl.RtcQryUserOutDataInput,"{\n repeated string userId = 1;\n }\n message ").concat(tl.RtcUserOutDataOutput,"{\n repeated RtcUserInfo user = 1;\n }\n message ").concat(tl.RtcNotifyMsg," \n {\n required int32 type= 1; //(通知类型 1:rtc 房间状态 KV 变更通知)\n optional int64 time= 2; //消息产生时间\n optional string roomId=3; //主播房间 id\n }\n message ").concat(tl.RtcPullKV,"\n {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity \n {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n message ").concat(tl.RtcKVOutput,"\n {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType \n {\n AnchorToViewer = 1; //1 为主播变观众\n ViewerToAnchor = 2; //2 为观众变主播\n }\n message ").concat(tl.RtcQueryUserJoinedInput,"\n {\n required string userId = 1;\n }\n message RtcJoinedInfo\n {\n required string deviceId = 1; //设备 ID\n required string roomId = 2; //加入的房间 ID\n optional int64 joinTime = 3; //加入的时间\n }\n message ").concat(tl.RtcQueryUserJoinedOutput,"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message ").concat(tl.RtcViewerJoinedOutput,"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV 属性对象集合\n optional int64 syncTime = 3;//所有属性的最大时间戳(下次拉取 KV 时用)。\n }\n message ").concat(tl.RtcInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n optional int32 timeoutTime=2; //邀请超时时间 (秒),默认三十秒\n required string invitedRoomId=3; //被邀请的房间\n required string inviteInfo=4; //邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId= 5; //客户端保证唯一性 (建议 roomid_userid_时间戳_随机数)\n }\n message ").concat(tl.RtcCancelInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n required string invitedRoomId=2; //被邀请的房间\n required string inviteInfo=3; //取消邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId=4; //邀请的 sessionId,客户端发起邀请时产生\n }\n message ").concat(tl.RtcInviteAnswerInput,"\n {\n required string inviteUserId=1; //邀请的人的 uid\n required int32 answerCode=2; //是否接受连麦邀请.0 为拒绝,1 为接受\n required string inviteRoomId=3; //邀请的房间\n required string inviteSessionId=4; //邀请的 sessionId\n required string content=5; //需要转发的 content\n optional string key=6; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n optional string value=7; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n }\n message ").concat(tl.RtcEndInviteInput,"\n {\n required string inviteRoomId=1; //邀请的房间\n required string inviteSessionId=2; //邀请的 sessionId\n required string inviteContent=3; //结束连麦的信息 (需要透传给房间内其他人)\n repeated string inviteRoomKeys=4; //需要删除连麦的信息的 key\n }\n}\n"),El=function(e,t,r,n,i,o){var s=i?Object.keys(i).map((function(t){return e.encode(tl.RtcValueInfo,{key:t,value:i[t]},!0)})):void 0,a=o?Object.keys(o).map((function(t){return e.encode(tl.RtcValueInfo,{key:t,value:o[t]},!0)})):void 0;return e.encode(tl.RtcInput,{roomType:t,broadcastType:r,joinType:n,innerDatas:s,outerDatas:a})},bl=function(e,t){var r=e.decode(tl.RtcUserListOutput,t),n=r.users,i=r.token,o=r.sessionId,s=r.roomInfo,a=r.entries,u=r.offlineKickTime,l={};return $u(n,(function(e){var t=e.userId,r=e.userData,n={};$u(r,(function(e){var t=e.key,r=e.value;n[t]=r})),l[t]=n})),{users:l,token:i,sessionId:o,roomInfo:s,kvEntries:a,offlineKickTime:u}},vl=function(){function e(e){Object.defineProperty(this,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pullTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._engine=e}return Object.defineProperty(e.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,r=e.timestamp,(n=this._pullTime)>r?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,n)]);case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS?(this._isPulling=!1,this._pullTime=a||0,this._startPull()):this._startPull(),[2]}}))}))}}),Object.defineProperty(e.prototype,"pullEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._pullTime=0,this._isPulling=!1}}),e}(),Tl=function(){function e(e,t,r,n){Object.defineProperty(this,"rtcCodec",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcKVManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcSignalingListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._appkey=this._options.appkey,this._rtcKVManager=new vl(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,r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=this.rtcCodec.encode(tl.RtcPullKV,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,ii,!0,t)];case 1:return r=s.sent(),i=r.code,o=r.buffer,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:(a=this.rtcCodec.decode(tl.RtcKVOutput,o),u=a.entries,l=a.syncTime,u=(u||[]).map((function(e){return n(n({},e),{timestamp:St(e.timestamp)})})),this._watcher.onRTCDataChange(u,e),[2,{code:i,data:l}])}}))}))}}),Object.defineProperty(e.prototype,"_receiveRtcKv",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=this.rtcCodec.decode(tl.RtcNotifyMsg,e),r=t.time,n=t.type,i=t.roomId;1===n&&this._rtcKVManager.pullEntry(i,St(r))}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),e}();exports.StreamMessageResponseEventType=void 0,(il=exports.StreamMessageResponseEventType||(exports.StreamMessageResponseEventType={})).INIT="INIT",il.DATA="DATA",il.END="END";var Il=function(e){function r(t,r){var n=e.call(this)||this;return ol.add(n),sl.set(n,void 0),al.set(n,new Map),ul.set(n,void 0),d(n,sl,t,"f"),d(n,ul,r,"f"),n}return t(r,e),Object.defineProperty(r.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=c(this,ol,"a",ll).createTraceId(),c(this,ol,"a",ll).info(H.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,ur.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(c(this,sl,"f").validateConnected).tryTrans((function(e){var t,r;return(null===(r=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===r?void 0:r.length)?sr(e.streamServer.addrs):ar(exports.ErrorCode.STREAM_MESSAGE_DISABLE)})).next((function(t){return c(n,ol,"m",_l).call(n,e,t)}))];case 1:return r=i.sent(),c(this,ol,"a",ll).summary(H.L_REQ_STREAM_MSG_CONTENT_R,r,t,{messageUId:e}),[2,r.wipe()]}}))}))}}),r}(rr);sl=new WeakMap,al=new WeakMap,ul=new WeakMap,ol=new WeakSet,ll=function(){return c(this,sl,"f").logger},cl=function(e,t,r){var n=c(this,al,"f").get(e);n&&(c(this,al,"f").delete(e),c(this,ol,"m",dl).call(this,e,exports.StreamMessageResponseEventType.END,t,n.msg))},dl=function(e,t,r,n,i){this.emit("message",{code:r,messageUId:e,type:t,chunk:i,message:n})},pl=function(e,t){e.content=n(n({},e.content),t),c(this,sl,"f")._innerSetMessageContent(e.messageId,JSON.stringify(e.content),e.messageType)},fl=function(e,t,r){var n,i,o=c(this,al,"f").get(t);switch(e){case"init":o.msg&&c(this,ol,"m",pl).call(this,o.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),c(this,ol,"m",dl).call(this,t,exports.StreamMessageResponseEventType.INIT,exports.ErrorCode.SUCCESS,o.msg);break;case"complete":i=(n=r.length?JSON.parse(r):{}).complete||!1,o.msg&&c(this,ol,"m",pl).call(this,o.msg,{stopReason:n.stopReason||0,completeReason:n.completeReason||0,complete:i,isSynced:i}),c(this,ol,"m",cl).call(this,t,n.stopReason||0,i);break;default:n=JSON.parse(r),o.cached+=n.content,o.msg&&c(this,ol,"m",pl).call(this,o.msg,{content:o.cached}),c(this,ol,"m",dl).call(this,t,exports.StreamMessageResponseEventType.DATA,exports.ErrorCode.SUCCESS,o.msg,{content:n.content,fullContent:o.cached})}},_l=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return c(this,al,"f").has(e)?[2,ar(exports.ErrorCode.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:c(this,al,"f").size>=3?[2,ar(exports.ErrorCode.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(r=es.createSSEClient({logger:c(this,ol,"a",ll),msgUId:e,appkey:c(this,sl,"f").appkey,token:c(this,sl,"f").token,timeout:3e4,onRawContent:function(t){t.split("\n\n").forEach((function(t){if(0!==t.length){t.startsWith("data:")&&(t="event:delta\n".concat(t));var r=t.indexOf("\n"),n=t.slice(0,r).replace("event:",""),i=t.slice(r+1+5);c(d,ol,"m",fl).call(d,n,e,i.trim())}}))},onNetworkError:function(t){c(d,ol,"m",cl).call(d,e,t,!1)}}),r.isOk?(n=r.data,i={client:n,cached:"",msg:void 0},c(this,al,"f").set(e,i),c(this,ul,"f")?[4,c(this,sl,"f").getLocalMessage(e)]:[3,2]):[2,r.wipe()]);case 1:if(o=s.sent(),a=o.code,!(u=o.data))return c(this,al,"f").delete(e),[2,ar(a,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return c(this,al,"f").delete(e),[2,ar(exports.ErrorCode.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,s.label=2;case 2:return[4,n.open(t.slice())];case 3:return(l=s.sent()).isOk||c(this,al,"f").delete(e),[2,l.wipe()]}}))}))};var yl,ml,Rl=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 nl(e,t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new rs(e,t)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"getNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getNaviInfoFromCache()}}),Object.defineProperty(e.prototype,"getCoreVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.30.0"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.30.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,r){return this._context.sendMessage(e,t,r,this._context.logger.createTraceId())}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){void 0===n&&(n=[]),this._context.registerMessageType(e,t,r,n)}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getServerTime()}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.setCallInfo(e,t,r)}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getStatsUrlList()}}),e}(),Sl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"joinRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return o=El(this._context.rtcCodec,t,r,n,i,a),[4,this.rtcSignaling(e,Hn,!0,o)];case 1:return u=s.sent(),l=u.code,c=u.buffer,l===exports.ErrorCode.SUCCESS&&c&&(d=bl(this._context.rtcCodec,c)),[2,{code:l,data:d}]}}))}))}}),Object.defineProperty(r.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=this._context.rtcCodec.encode(tl.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,qn,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this._context.rtcPing(e,t,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPingResVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.rtcPing(e,t,r)}}),Object.defineProperty(r.prototype,"getRTCRoomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tl.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Yn,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i&&(o=this._context.rtcCodec.decode(tl.RtcRoomInfoOutput,i)),[2,{code:n,data:o}]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tl.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Wn,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i&&(a=bl(this._context.rtcCodec,i),o={users:a.users}),[2,{code:n,data:o}]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("Method not implemented.")}}),Object.defineProperty(r.prototype,"setRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=this._context.rtcCodec.encode(tl.RtcValueInfo,{key:t,value:r}),[4,this.rtcSignaling(e,Kn,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=this._context.rtcCodec.encode(tl.RtcKeyDeleteInput,{key:t}),[4,this.rtcSignaling(e,Jn,!1,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return o=this._context.rtcCodec.encode(tl.RtcSetDataInput,{interior:n,target:i,key:t,value:r,objectName:null==a?void 0:a.name,content:null==a?void 0:a.content}),[4,this.rtcSignaling(e,Qn,!1,o)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return o={objectName:n,content:this._context.rtcCodec.encode(tl.RtcValueInfo,{key:t.name,value:t.content},!0),valueInfo:[this._context.rtcCodec.encode(tl.RtcValueInfo,{key:"uris",value:r},!0),this._context.rtcCodec.encode(tl.RtcValueInfo,{key:"mcu_uris",value:i},!0)]},a=this._context.rtcCodec.encode(tl.RtcUserSetDataInput,o),[4,this.rtcSignaling(e,Xn,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=this._context.rtcCodec.encode(tl.RtcUserSetDataInput,{objectName:t,valueInfo:this._context.rtcCodec.encode(tl.RtcValueInfo,{key:"cdn_uris",value:r},!0)}),[4,this.rtcSignaling(e,Xn,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return i=this._context.rtcCodec.encode(tl.RtcDataInput,{interior:r,target:n,key:t}),[4,this.rtcSignaling(e,zn,!0,i)];case 1:return o=s.sent(),a=o.code,u=o.buffer,a===exports.ErrorCode.SUCCESS&&u?(l=this._context.rtcCodec.decode(tl.RtcQryOutput,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:a,data:c}]):[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return o=this._context.rtcCodec.encode(tl.RtcDataInput,{interior:r,target:n,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,Zn,!1,o)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(r.prototype,"getRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(r.prototype,"getRTCToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=El(this._context.rtcCodec,t,r),[4,this.rtcSignaling(e,$n,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=this._context.rtcCodec.decode(tl.RtcTokenOutput,a).rtcToken,[2,{code:o,data:{rtcToken:u}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"setRTCState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=this._context.rtcCodec.encode(tl.MCFollowInput,{state:t}),[4,this.rtcSignaling(e,ei,!0,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tl.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,ti,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=bl(this._context.rtcCodec,i),[2,{code:n,data:o}]):[2,{code:n}]}}))}))}}),Object.defineProperty(r.prototype,"joinLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return n=El(this._context.rtcCodec,t,r),[4,this.rtcSignaling(e,ri,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=this._context.rtcCodec.decode(tl.RtcViewerJoinedOutput,a),l=u.rtcToken,c=u.entries,[2,{code:o,data:{token:l,kvEntries:c}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"quitLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=this._context.rtcCodec.encode(tl.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,ni,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcIdentityChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=this._context.rtcCodec.encode(tl.RtcInput,{roomType:exports.RTCMode.LIVE,broadcastType:r,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,oi,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=bl(this._context.rtcCodec,a),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,a=e.roomId,u=this._context.rtcCodec.encode(tl.RtcInviteInput,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(a,si,!0,u)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,a=this._context.rtcCodec.encode(tl.RtcCancelInviteInput,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,inviteInfo:i}),[4,this.rtcSignaling(o,ai,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return t=e.inviteUserId,r=e.inviteRoomId,n=e.inviteSessionId,i=e.content,o=e.key,a=e.value,u=e.agree,l=e.roomId,c=this._context.rtcCodec.encode(tl.RtcInviteAnswerInput,{inviteUserId:t,inviteRoomId:r,inviteSessionId:n,content:i,key:o,value:a,answerCode:u?1:0}),[4,this.rtcSignaling(l,ui,!0,c)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.endRoomId,r=e.sessionId,n=e.content,i=e.keys,o=e.roomId,a=this._context.rtcCodec.encode(tl.RtcEndInviteInput,{inviteRoomId:t,inviteSessionId:r,inviteContent:n,inviteRoomKeys:i}),[4,this.rtcSignaling(o,li,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"registerRTCSignalListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.registerRTCSignalingListener(e)}}),Object.defineProperty(r.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._context.rtcSignaling(e,t,r,n)}}),Object.defineProperty(r.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tl.RtcQueryUserJoinedInput,{userId:e}),[4,this.rtcSignaling("",ci,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=this._context.rtcCodec.decode(tl.RtcQueryUserJoinedOutput,i).info||[],[2,{code:n,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:n}]}}))}))}}),r}(Rl),Al={"set.proxy":exports.ErrorCode.INVALID_PARAMETER_PROXY,"test.proxy":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,"test.proxy.socksHost":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,"test.proxy.socksPort":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,channelId:exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID,count:exports.ErrorCode.INVALID_PARAMETER_COUNT,startTime:exports.ErrorCode.INVALID_PARAMETER_START_TIME,endTime:exports.ErrorCode.INVALID_PARAMETER_END_TIME,offset:exports.ErrorCode.INVALID_PARAMETER_OFFSET,limit:exports.ErrorCode.INVALID_PARAMETER_LIMIT,keyword:exports.ErrorCode.INVALID_PARAMETER_KEYWORD,messageTypes:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,messageType:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,typingContentType:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,conversation:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION,conversationType:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE,targetId:exports.ErrorCode.INVALID_PARAMETER_TARGET_ID,targetIds:exports.ErrorCode.INVALID_PARAMETER_TARGET_ID,userId:exports.ErrorCode.INVALID_PARAMETER_USER_ID,senderUserId:exports.ErrorCode.INVALID_PARAMETER_USER_ID,timestamp:exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP,order:exports.ErrorCode.INVALID_PARAMETER_ORDER,messageId:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID,receivedStatus:exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS,receivedStatusInfo:exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS,sentStatus:exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS,content:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT,messageIds:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY,messageDirection:exports.ErrorCode.INVALID_MESSAGE_DIRECTION,canIncludeExpansion:exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION,expansion:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION,disableNotification:exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION,messages:exports.ErrorCode.MSG_LIMIT_ERROR,checkDuplicate:exports.ErrorCode.INVALID_PARAMETER_CHECK_DUPLICATE,messageUId:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,key:exports.ErrorCode.INVALID_PARAMETER_KEY,keys:exports.ErrorCode.INVALID_PARAMETER_KEYS,value:exports.ErrorCode.INVALID_PARAMETER_VALUE,isAutoDelete:exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE,isSendNotification:exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION,notificationExtra:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA,entries:exports.ErrorCode.INVALID_PARAMETER_ENTRIES,isForce:exports.ErrorCode.INVALID_PARAMETER_IS_FORCE,rtcRoomId:exports.ErrorCode.INVALID_PARAMETER_RTCROOMID,token:exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,conversations:exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS,conversationTypes:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST,levels:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevel:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevels:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationStatus:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,isTop:exports.ErrorCode.INVALID_PARAMETER_IS_TOP,isUpdateTime:exports.ErrorCode.INVALID_PARAMETER_IS_UPDATE_TIME,message:exports.ErrorCode.INVALID_PARAMETER_MESSAGE,mentionedUserIdList:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,directionalUserIdList:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,directedUserIds:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,isStatusMessage:exports.ErrorCode.INVALID_PARAMETER_IS_STATUS_MESSAGE,pushContent:exports.ErrorCode.INVALID_PARAMETER_PUSH_CONTENT,pushData:exports.ErrorCode.INVALID_PARAMETER_PUSH_DATA,isMentioned:exports.ErrorCode.INVALID_PARAMETER_IS_MENTIONED,mentionedType:exports.ErrorCode.INVALID_PARAMETER_MENTIONED_TYPE,isVoipPush:exports.ErrorCode.INVALID_PARAMETER_IS_VOIP_PUSH,pushConfig:exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG,startMsgUId:exports.ErrorCode.INVALID_PARAMETER_START_MESSAGE_UID,endMsgUId:exports.ErrorCode.INVALID_PARAMETER_END_MESSAGE_UID,sentTime:exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP,clearMessageOption:exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,searchContent:exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR,tagId:exports.ErrorCode.INVALID_PARAMETER_TAG_ID,tagIds:exports.ErrorCode.INVALID_PARAMETER_TAG_ID,tagName:exports.ErrorCode.INVALID_PARAMETER_TAG_NAME,containMuted:exports.ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED,channelType:exports.ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE,file:exports.ErrorCode.MEDIA_EXCEPTION,fileType:exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE,contentDisposition:exports.ErrorCode.INVALID_PARAMETER_CONTENT_DISPOSITION,mediaUrl:exports.ErrorCode.INVALID_PARAMETER_MEDIA_URL,filename:exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME,saveName:exports.ErrorCode.INVALID_PARAMETER_SAVE_NAME,serverType:exports.ErrorCode.INVALID_PARAMETER_SERVER_TYPE,subscribeType:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE,expiry:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_EXPIRY,subscribeUserIds:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS,subscribePageSize:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE,conversationList:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST,conversationTypeNotSupport:exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,profile:exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE,userProfileVisibility:exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE_VISIBILITY,uniqueId:exports.ErrorCode.INVALID_PARAMETER_UNIQUE_ID,extra:exports.ErrorCode.INVALID_PARAMETER_EXTRA,disableUpdateLastMessage:exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE};exports.AssertRules=void 0,(ml=exports.AssertRules||(exports.AssertRules={}))[ml.STRING=0]="STRING",ml[ml.ONLY_STRING=1]="ONLY_STRING",ml[ml.NUMBER=2]="NUMBER",ml[ml.BOOLEAN=3]="BOOLEAN",ml[ml.OBJECT=4]="OBJECT",ml[ml.ARRAY=5]="ARRAY",ml[ml.CALLBACK=6]="CALLBACK",ml[ml.CHANNEL_ID=7]="CHANNEL_ID",ml[ml.CONVERSATION=8]="CONVERSATION",ml[ml.CONVERSATION_TYPE=9]="CONVERSATION_TYPE";var Ol,Cl=((yl={})[exports.AssertRules.STRING]=ht,yl[exports.AssertRules.ONLY_STRING]=ct,yl[exports.AssertRules.NUMBER]=dt,yl[exports.AssertRules.BOOLEAN]=function(e){return"boolean"==typeof e},yl[exports.AssertRules.OBJECT]=gt,yl[exports.AssertRules.ARRAY]=ft,yl[exports.AssertRules.CALLBACK]=function(e){var t=!0;return gt(e)||(t=!1),(e=e||{}).onSuccess&&!Et(e.onSuccess)&&(t=!1),e.onError&&!Et(e.onError)&&(t=!1),t},yl[exports.AssertRules.CHANNEL_ID]=mt,yl[exports.AssertRules.CONVERSATION]=function(e){var t=!0;return gt(e)||(t=!1),ct(e.targetId)||(t=!1),It(e.conversationType)||(t=!1),bt(e.channelId)||mt(e.channelId)||(t=!1),t},yl[exports.AssertRules.CONVERSATION_TYPE]=It,yl),Nl=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCAssertError",r}return t(r,e),r}(Error),Pl=function(e,t,r,n){void 0===n&&(n=!1),r=Cl[r]||r;var i=n?r(t):bt(t)||null==t||r(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},Ll=function(){function e(e,t){var r,n;Object.defineProperty(this,"_logTagT",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_logTagR",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"verificationFaileList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"option",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.context=_E.getContext(),this.logger=null===(r=this.context)||void 0===r?void 0:r.logger,this.option=null===(n=this.context)||void 0===n?void 0:n.getOptions()}return Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){if(void 0===n&&(n=!1),this.verificationFaileList.length>0)return this;r=Cl[r]||r;var o=n?r(t):bt(t)||null==t||r(t);if("object"==typeof o){var s=o.valid,a=o.errorKey;return!s&&a&&this.verificationFaileList.push({key:a,value:t,isValid:!1,message:i,code:Al[a]}),this}return o||this.verificationFaileList.push({key:e,value:t,isValid:o,message:i,code:Al[e]}),this}}),Object.defineProperty(e.prototype,"validateParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){if(void 0===i&&(i=!1),this.verificationFaileList.length>0)return this;r=Cl[r]||r;var s=i?r(t):bt(t)||null==t||r(t);if("object"==typeof s){var a=s.valid,u=s.errorKey,l=s.errorCode;return!a&&u&&this.verificationFaileList.push({key:u,value:t,code:l||n,message:o,isValid:!1}),this}return s||this.verificationFaileList.push({key:e,value:t,code:n,message:o,isValid:!1}),this}}),Object.defineProperty(e.prototype,"_getValidationResult",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.verificationFaileList.length>0)return this.verificationFaileList[0]}}),Object.defineProperty(e.prototype,"ifReady",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;if(!this.context)return Promise.resolve({code:exports.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT});var r=this._getValidationResult();if(r){var n=r.code,i=r.value,o=r.message,s=r.key;return null===(t=this.logger)||void 0===t||t.error(this._logTagR,JSON.stringify({code:n})),Promise.resolve({code:n,msg:"'".concat(s,"' is invalid: ").concat(o||JSON.stringify(i))})}var a=this.logger.createTraceId();return e(this.context,this.logger,this.option,a)}}),Object.defineProperty(e.prototype,"try2do",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this.context)throw new Error("Not initialized yet!");return e(this.context,this.logger,this.option)}}),Object.defineProperty(e.prototype,"ifReadySync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;if(!this.context)return{code:exports.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT};var r=this._getValidationResult();if(!r)return e(this.context,this.logger,this.option);var n=r.code,i=r.value,o=r.message,s=r.key;return null===(t=this.logger)||void 0===t||t.warn(this._logTagR,JSON.stringify({code:n})),{code:n,msg:"'".concat(s,"' is invalid: ").concat(o||i)}}}),e}(),Ml=function(e,t){var r=ln(e).searchProps;return r&&0!==r.length?r.every((function(e){return void 0!==t[e]}))?sr():ar(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR):sr()},wl=function(e,t,r){return Ul(ur.create(e),t,r)},Ul=function(e,t,r){return e.isFailed||e.isObject("conversation",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return ee(null==t?void 0:t.conversationType,r)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID),e},Dl=function(e,t,r){return e.check((function(e){return Ul(e,t,Z)})).check((function(e){var n=null==t?void 0:t.messageType;ht(n)?n===ye.STREAM_MESSAGE&&r.includes("RC_Ext_StreamMsgSummary")&&e.setFailed(exports.ErrorCode.STREAM_MESSAGE_EXPANSION_KEY_ERROR):e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE)})).check((function(e){(null==t?void 0:t.canIncludeExpansion)||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isNotEmptyString("messageUId",null==t?void 0:t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTimestamp("sentTime",null==t?void 0:t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP),e},xl=function(e,t,r){return e.check((function(e){r||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isObject("expansion",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION).check((function(e){var r=Object.keys(t);if(r.length>20||0===r.length)e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET);else if(r.some((function(e){return!/^[A-Za-z0-9_=+-]+$/.test(e)||"string"!=typeof t[e]})))e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION);else{r.some((function(e){return e.length>32||t[e].length>4096}))&&e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET)}})),e},Gl=function(){return Ol||(Ol={set:function(e,t){es.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(es.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return es.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in es.localStorage)e.push(t);return e}}),Ol},Vl=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}(),jl=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=Gl();var r=this._rootStorage.get(e)||{};this._cache=new Vl(((t={})[e]=r,t)),this._storageKey=e}return Object.defineProperty(e.prototype,"_get",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;return this._cache.get(e)||{}}}),Object.defineProperty(e.prototype,"_set",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._get();r[e]=t,this._set(r)}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._get();delete t[e],this._set(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._get()[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._get(),t=[];for(var r in e)t.push(r);return t}}),Object.defineProperty(e.prototype,"getValues",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._get()||{}}}),Object.defineProperty(e.prototype,"update",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)}}),e}(),kl="",Fl=function(){var e="";if(kl)return kl;if("browser"===es.tag)return ut;var t="RCDeviceId",r=Gl(),n=r.get(t);return n?e=n:(e=at.genWithLen(22),r.set(t,e)),e},Bl="",Hl=function(){return Bl},ql=function(e,t,r,n,i){var o=0;return e&&(o|=16),t&&(o|=32),r&&(o|=64),n&&(o|=512),i&&(o|=1024),o},Yl=function(e){var t;try{t=JSON.parse(e)}catch(r){t=e}if(null==t?void 0:t.user){var r=t.user,n=r.portrait,i=r.portraitUri,o=n||i;o&&(t.user.portrait=t.user.portraitUri=o)}return t},Wl=function(e){var t={};try{var r=JSON.parse(e);Object.entries(r).forEach((function(e){var r=u(e,2),n=r[0],i=r[1];t[n]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},Kl=function(e,t,r,n){var i,o,s=Ku.decode(ls,e.pbData),a=Cn(e.topic);if(a===An.recallMsg){var u=JSON.parse(s.content);i=u.conversationType,o=u.targetId}else i=function(e){var t;return((t={})[An.ppMsgP]=exports.ConversationType.PRIVATE,t[An.pgMsgP]=exports.ConversationType.GROUP,t[An.chatMsg]=exports.ConversationType.CHATROOM,t[An.ugMsg]=exports.ConversationType.ULTRA_GROUP,t[An.pcMsgP]=exports.ConversationType.CUSTOMER_SERVICE,t[An.pbMsgP]=exports.ConversationType.SYSTEM,t)[e]||exports.ConversationType.PRIVATE}(a),o=e.targetId;var l=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(i),c=l?o:t,d=l?"":o,p=Xl(s.sessionId),f=p.isPersited,_=p.isCounted,h=p.isMentioned,g=p.disableNotification,E=p.canIncludeExpansion;return{fromUserId:c,type:i,groupId:d,classname:s.classname,content:s.content,dataTime:r,status:ql(f,_,h,g,E),msgId:n,direction:exports.MessageDirection.SEND,clientUniqueId:s.clientUniqueId,extraContent:s.extraContent,pushContent:s.pushText,configFlag:s.configFlag,pushExt:s.pushExt,busChannel:s.busChannel,toUserIds:s.toUserIds,optionBits:s.optionBits}},Jl=function(e,t,r,n){void 0===r&&(r=!1);var i,o,s,a=e.type,u=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(a)?n||e.fromUserId:e.groupId||n,l={isPersited:!!(16&(i=e.status)),isCounted:!!(32&i),isMentioned:!!(64&i),disableNotification:!!(512&i),receivedStatus:2&i?exports.ReceivedStatus.RETRIEVED:exports.ReceivedStatus.UNREAD,canIncludeExpansion:!!(1024&i)},c=l.isMentioned,d=l.disableNotification,p=l.receivedStatus,f=l.canIncludeExpansion,_=e.direction===exports.MessageDirection.SEND?exports.MessageDirection.SEND:exports.MessageDirection.RECEIVE,h=qt(e.configFlag||0,e.pushContent,e.pushExt),g=(o=e.extStatus,{isInterrupt:!!(2&(s=o||0)),isModifyMessage:!!(4&s),isPrivateChannel:!!(8&s),isStatusMessage:!!(64&s)}),E=g.isInterrupt,b=g.isModifyMessage,v=g.isPrivateChannel,T=g.isStatusMessage,I=ln(e.classname),y=I.isCounted,m=I.isPersited,R=I.isStatusMessage;return{conversationType:a,targetId:u,senderUserId:_===exports.MessageDirection.SEND?t:e.fromUserId,messageType:e.classname,messageUId:e.msgId,isPersited:m,isCounted:y,isMentioned:c,sentTime:e.dataTime,messageDirection:_,receivedTime:Date.now(),disableNotification:d,receivedStatus:p,receivedStatusInfo:Ot(p),canIncludeExpansion:f,content:Yl(e.content),expansion:e.extraContent?Wl(e.extraContent):null,pushConfig:h,channelId:e.busChannel||"",isInterrupt:E,isModifyMessage:b,messageId:e.clientUniqueId||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:r,channelType:v?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,isStatusMessage:T||!!R,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0,modifyInfo:zl(e.convertExt)}},Ql=function(e,t,r,n,i){var o=0,s=ln(e);return s.isPersited&&!i&&(o|=1),s.isCounted&&!i&&(o|=2),t&&(o|=4),r&&(o|=32),n&&(o|=64),o},Xl=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}},zl=function(e){if(e)try{var t=JSON.parse(e).modify;if(t.time)return{timestamp:t.time,content:{},status:Pr}}catch(t){console.error("parse message modify info error: ".concat(e),t)}};function Zl(e){return 1&~((null==e?void 0:e.sessionMode)||0)?ar(exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):sr()}var $l={};function ec(){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:Gr.getMiniCmpUrlList().join(",")}}var tc,rc,nc,ic,oc,sc,ac=function(e){function r(t,r,n,i,o){void 0===i&&(i="default");var s=e.call(this,t,r,n,es.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),es.useNavi,o)||this;return s._environment=i,s}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return o="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(r),"&callBack=x&v=").concat(ke,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(es.tag),this.logger.debug(H.L_REQUEST_T,"req navi => ".concat(o),n),[4,es.httpReq({url:o,timeout:1e4,dataType:"text"})];case 1:if(200!==(a=s.sent()).status)return this.logger.debug(H.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!es.useNavi&&i?[2,sr(ec())]:[2,ar(this.transHttpCode(a.status))];try{return 0===(u=a.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(u=JSON.parse('"'.concat(u,'"'))),(l=JSON.parse(u)).protocol=/^https/.test(o)?"https":"http",l.code&&200!==l.code?[2,ar(this.transHttpCode(l.code))]:(es.useNavi||(l.server="",l.backupServer=Gr.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,sr(l)])}catch(e){this.logger.error(H.L_PARSE_NAVI_E,a.data,n)}return[2,ar(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:es.tag,protocol:(/^https/.test(e)?q.WSS:q.WS).toString()}),this.logger.debug(H.L_REQUEST_T,"req navi => ".concat(o.url),n),[4,es.httpReq(o)];case 1:if(200!==(a=s.sent()).status)return this.logger.debug(H.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!es.useNavi&&i?[2,sr(ec())]:[2,ar(this.transHttpCode(a.status))];try{return u=a.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(o.url)?"https":"http",es.useNavi||(l.logSwitch=0,c=Gr.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?q.WSS:q.WS,weight:c.length-t}}))),[2,sr(l)]}catch(e){this.logger.error(H.L_PARSE_NAVI_E,a.data,n)}return[2,ar(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=this.getCatchKey(e);if($l[r])return $l[r];var n,i=He(this.appkey),o=es.localStorage;try{var s=o.getItem(i);n=s?JSON.parse(s):[]}catch(e){n=[]}if(0===n.length)return null;var a=n.find((function(r){return r.token===e&&r.environment===t._environment}))||null;return $l[r]=a,a}}),Object.defineProperty(r.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this,i=He(this.appkey),o=es.localStorage;try{var s=o.getItem(i);r=s?JSON.parse(s):[]}catch(e){r=[]}var a=Date.now();r.length>0&&(r=r.filter((function(t){return a-t.timestamp<Ge&&(e!==t.token||n._environment!==t.environment)})));var u={timestamp:a,naviInfo:t,token:e,environment:this._environment};r.push(u),o.setItem(i,JSON.stringify(r)),$l[this.getCatchKey(e)]=u}}),r}(an),uc=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=ze(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)}}),Object.defineProperty(e.prototype,"_getLocalInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=es.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}}}),Object.defineProperty(e.prototype,"setMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageMap[e]=t;var r=ze(this._appkey,this._userId),n=this._getLocalInfo(r);n[e]=t,es.localStorage.setItem(r,JSON.stringify(n))}}),Object.defineProperty(e.prototype,"getSendMessageMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._sendMessageMap}}),Object.defineProperty(e.prototype,"removeByUID",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._sendMessageMap[e]}}),Object.defineProperty(e.prototype,"removeByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ze(this._appkey,this._userId),r=this._getLocalInfo(t);Object.keys(r).forEach((function(t){r[t]<e&&delete r[t]})),es.localStorage.setItem(t,JSON.stringify(r))}}),e}(),lc=function(){function e(e){var t;Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"subscribeData",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[exports.SubscribeType.ONLINE_STATUS]={},t[exports.SubscribeType.USER_PROFILE]={},t)}),Object.defineProperty(this,"_ownProfile",{enumerable:!0,configurable:!0,writable:!0,value:null})}return Object.defineProperty(e.prototype,"clearSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;this.subscribeData=((e={})[exports.SubscribeType.ONLINE_STATUS]={},e[exports.SubscribeType.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===exports.SubscribeType.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].statusMap={}})):e===exports.SubscribeType.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].profile=void 0}))}}),Object.defineProperty(e.prototype,"getSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.subscribeData[e][t];return r?n({},r):void 0}}),Object.defineProperty(e.prototype,"removeSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){delete this.subscribeData[e][t]}}),Object.defineProperty(e.prototype,"updateSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.subscribeData[e][t]=r}}),Object.defineProperty(e.prototype,"clearExpiredData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t in this.subscribeData[e]){var r=this.subscribeData[e][t];r.expiry<(Date.now()+this._delayTime-r.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l([],u(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(r,r+t)}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=n(n({},null===(t=this._ownProfile)||void 0===t?void 0:t.extraProfile),e.extraProfile);this._ownProfile=n(n(n({},this._ownProfile),e),{extraProfile:r})}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ownProfile?n(n({},this._ownProfile),{extraProfile:n({},this._ownProfile.extraProfile)}):null}}),e}(),cc=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 lc(e)}return Object.defineProperty(e.prototype,"updateRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)}}),Object.defineProperty(e.prototype,"getRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._relationshipStatusVersion}}),Object.defineProperty(e.prototype,"updateSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)}}),Object.defineProperty(e.prototype,"getSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subUserStatusVersion}}),Object.defineProperty(e.prototype,"_filterSubscribeRelationData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(r){var n=e.find((function(e){return e.subscribeType===t.subType&&e.userId===r.subUserId}));n?n.subscribeTime<t.subTime&&(n.expiry=t.expiry,n.operationType=t.opType,n.subscribeTime=t.subTime):e.push({userId:r.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=!1);var n=[],i=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,s,a=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===exports.SubscribeOperationType.UNSUBSCRIBE)return r._subStore.removeSubscribeUserData(l,a),void o.push(e);var d=r._subStore.getSubscribeUserData(l,a);if(!(d&&d.subscribeTime>=u)){if(l===exports.SubscribeType.ONLINE_STATUS){n.push(a);var p=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};r._subStore.updateSubscribeUserData(l,a,{subscribeTime:u,expiry:c,userId:a,subscribeType:l,statusMap:p})}else{i.push(a);var f=null===(s=d)||void 0===s?void 0:s.profile;r._subStore.updateSubscribeUserData(l,a,{subscribeTime:u,expiry:c,userId:a,subscribeType:l,profile:f,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:n,newSubscribeUserProfileList:i,subscribeUserChangeList:o}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(exports.SubscribeType.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(exports.SubscribeType.USER_PROFILE)}}),Object.defineProperty(e.prototype,"updateSubscribeUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.subUserId,o=e.data,s=t._subStore.getSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i);if(s){var a=[],u=n({},s.statusMap);o.forEach((function(e){var t=u[e.platformInfo];if(!(t&&t.changeTime>e.versionTime)){var r={eventValue:e.value,changeTime:e.versionTime};u[e.platformInfo]=r,a.push(n(n({},r),{platform:e.platformInfo}))}})),t._subStore.updateSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i,{subscribeTime:s.subscribeTime,expiry:s.expiry,userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,statusMap:u}),r.push({userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,subscribeTime:s.subscribeTime,expiry:s.expiry,details:a})}})),r}}),Object.defineProperty(e.prototype,"updateSubscribeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.userId,o=e.version,s=e.userProfile,a=e.userExtProfile,u=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,i),l=Nt(i,s,a);u?u.profile&&u.profile.version>=o||(t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},isSubscribed:u.isSubscribed}),u.isSubscribed&&r.push({userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:n({},l)})):t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},isSubscribed:!1})})),r}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,i=[];return t.forEach((function(t){var o=r._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+r._delayTime-o.subscribeTime)/1e3)r._subStore.removeSubscribeUserData(e,t);else{var s={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var a=o.statusMap,u=Object.keys(a).map((function(e){return n({platform:~~e},a[~~e])}));s.details=Ct(u)}else if(e===exports.SubscribeType.USER_PROFILE&&!o.isSubscribed)return;i.push(s)}})),i}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[],i=[];return e.forEach((function(e){var o=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,e);if(o&&o.profile){var s=o.profile,a=s.version,u=s.info;if(o.isSubscribed)return t._delayTime+Date.now()-a>6048e5?void i.push(e):void r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}));t._delayTime+Date.now()-a>6e5?i.push(e):r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}))}else i.push(e)})),{list:r,needQueryUserIds:i}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,r).map((function(t){var r={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return n({platform:~~e},t.statusMap[~~e])}));r.details=Ct(i)}return r}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subStore.getOwnProfile()}}),e}(),dc=function(){function e(e,t,r,n,i,o,s){Object.defineProperty(this,"_connectManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_event",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_currentUserId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_isOpenUserProfile",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_subDriven",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_isPullingRelationship",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullRelationshipQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullRelationshipFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_isPullingSubUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullSubUserStatusQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullSubUserStatusFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subscribeService",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subscribeService=new cc(n)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._subDriven?[4,this._syncSubscribeRelationship(!1)]:[3,3];case 1:return e.sent(),[4,this._syncSubscribeUserStatus(!0)];case 2:e.sent(),e.label=3;case 3:return this._isOpenUserProfile?[4,this.syncOwnProfile()]:[3,5];case 4:e.sent(),e.label=5;case 5:return 1&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_USER_PROFILE),[2]}}))}))}}),Object.defineProperty(e.prototype,"startSyncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!0),o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this._isPullingRelationship?[2]:(this._isPullingRelationship=!0,[4,this._pullSubscribeRelationship(e)]);case 1:return t.sent(),this._isPullingRelationship=!1,this._pullRelationshipQueue.length>0?(this._pullRelationshipQueue.length=0,[4,this._syncSubscribeRelationship(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f,_,h,g,E;return s(this,(function(s){switch(s.label){case 0:return r=this._subscribeService.getRelationshipStatusVersion(),n=this._logger.createTraceId(),this._logger.info(H.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:r,_pageToken:t}),n),i=this._connectManager.codec.encodePullUserSubReq({version:r,pageToken:t}),o=new to(An.pullUserSub,i,this._currentUserId),[4,this._connectManager.send(o,ka)];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.SUCCESS&&l?(this._pullRelationshipFailTime=0,c=l.list,d=l.version,p=l.hasNext,f=l.pageToken,d=St(d),c.forEach((function(e){e.subTime=St(e.subTime)})),this._logger.info(H.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:u,data:l}),n),e?(_=this._subscribeService.updateSubscribeRelation(c),h=_.newSubscribeOnlineStatusList,g=_.newSubscribeUserProfileList,(E=_.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(E),h.length>0&&this._queryAndUpdateUserOnlineStatus(h),g.length>0&&this._queryAndUpdateUserProfile(g)):this._subscribeService.updateSubscribeRelation(c,!t),this._subscribeService.updateRelationshipStatusVersion(d),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>d})),p?[4,this._pullSubscribeRelationship(e,f)]:[3,3]):(this._logger.error(H.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:u,failTime:this._pullRelationshipFailTime}),n),this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:s.sent(),s.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"startsyncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this._isPullingSubUserStatus?[2]:(this._isPullingSubUserStatus=!0,[4,this._pullSubscribeUserStatus(e)]);case 1:return t.sent(),this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue.length>0?(this._pullSubUserStatusQueue.length=0,[4,this._syncSubscribeUserStatus(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=""),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f,_;return s(this,(function(s){switch(s.label){case 0:return r=this._subscribeService.getSubscribeUserStatusVersion(),n=this._logger.createTraceId(),this._logger.info(H.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:r,_pageToken:t,needAllData:e}),n),i=Ku.encode(Fa,{versionTime:r,needAllData:e,pageToken:t}),[4,this._connectManager.query(An.pullSubData,this._currentUserId,i,Ba)];case 1:return(o=s.sent()).isOk?(this._pullSubUserStatusFailTime=0,a=o.data,u=a.list,l=a.versionTime,c=a.hasNext,d=a.pageToken,p=a.isFull,l=St(l),this._logger.info(H.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code}),n),u.forEach((function(e){e.data.forEach((function(e){e.versionTime=St(e.versionTime)}))})),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>l})),this._subscribeService.updateSubscribeUserStatusVersion(l),f=[],_=[],u.forEach((function(e){switch(e.subType){case exports.SubscribeType.ONLINE_STATUS:f.push(e);break;case exports.SubscribeType.USER_PROFILE:_.push(e.subUserId);case exports.SubscribeType.FRIEND_ONLINE_STATUS:case exports.SubscribeType.FRIEND_USER_PROFILE:}})),p&&""===t&&this._subscribeService.clearSubscribeStatus(),f.length>0&&this._updateUserOnlineStatus(f,!p),_.length>0?[4,this._queryAndUpdateUserProfile(_,!p)]:[3,3]):(this._logger.warn(H.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code,failTime:this._pullSubUserStatusFailTime}),n),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:s.sent(),s.label=3;case 3:return c?[4,this._pullSubscribeUserStatus(e,d)]:[3,5];case 4:s.sent(),s.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=this._logger.createTraceId(),this._logger.info(H.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),r=Ku.encode(qa,{subType:exports.SubscribeType.ONLINE_STATUS,subUsers:e.map((function(e){return{subUserId:e}}))}),n=new to(An.qrySubData,r,this._currentUserId),[4,this._connectManager.send(n,Ba)];case 1:return i=s.sent(),o=i.code,a=i.data,this._logger.info(H.L_QUERY_SUBSCRIBE_DATA_R,JSON.stringify({code:o,data:a}),t),o===exports.ErrorCode.SUCCESS&&a?(this._updateUserOnlineStatus(a.list),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"_updateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!0);var r=this._subscribeService.updateSubscribeUserOnlineStatus(e);r=r.filter((function(e){return e.details&&e.details.length>0})),t&&r.length>0&&this._event.subscribeUserStatusChanged(r)}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!0),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this._logger.createTraceId(),this._logger.info(H.L_PULL_USER_PROFILE_T,JSON.stringify(e),r),n=Ku.encode(Ja,{userId:e}),i=new to(An.pullUserProfile,n,this._currentUserId),[4,this._connectManager.send(i,Qa)];case 1:return o=s.sent(),a=o.code,u=o.data,this._logger.info(H.L_PULL_USER_PROFILE_R,JSON.stringify({code:a,data:u}),r),a!==exports.ErrorCode.SUCCESS?[2,ar(a)]:(u.UserProfile.forEach((function(e){e.version=St(e.version)})),l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,sr(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,r,n,i;return s(this,(function(o){switch(o.label){case 0:return(t=this._connectManager.codec.decodeByPBName(e.pbData,Ha)).subType!==exports.SubscribeType.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==exports.SubscribeType.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==exports.SubscribeType.FRIEND_ONLINE_STATUS?[3,3]:(r=t.data.map((function(e){return{changeTime:St(e.versionTime),eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:r}]),[3,5]);case 3:return t.subType!==exports.SubscribeType.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:n=o.sent(),(i=n.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Nt(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),o.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subscribeService.getSubscribeUserList(e,t,r)}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return i=this._connectManager.codec.encodeUpdateUserSubReq(t,e,r,n),o=new to(An.updUserSub,i,this._currentUserId),[4,this._connectManager.send(o,Va)];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT&&l?[2,{code:u,data:l.subUsers.map((function(e){return e.subUserId}))}]:u===exports.ErrorCode.SUCCESS&&l?(c=l.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:n,opType:r,subUsers:e.map((function(e){return{subUserId:e}}))}]),r===exports.SubscribeOperationType.SUBSCRIBE&&(t===exports.SubscribeType.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===exports.SubscribeType.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,{code:u}]):[2,{code:u}]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._subscribeService.getUserProfiles(e),r=t.needQueryUserIds,n=t.list,0===r.length?[2,sr(n)]:[4,this._queryAndUpdateUserProfile(r,!1)];case 1:return(i=s.sent()).isOk?(o=i.data.map((function(e){return Nt(e.userId,e.userProfile,e.userExtProfile)})),[2,sr(l(l([],u(n),!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,r,n,i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(H.L_PULL_OWN_PROFILE_T,"",t),r=this._connectManager.codec.encodeUserProfileInput(),n=new to(An.pullOwnProfile,r,this._currentUserId),[4,this._connectManager.send(n,Ya)]):[2,Promise.resolve({code:exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE})];case 1:return i=s.sent(),o=i.code,a=i.data,this._logger.info(H.L_PULL_OWN_PROFILE_R,JSON.stringify({code:o,data:a}),t),o===exports.ErrorCode.SUCCESS&&a?(u=a.userExtProfile,l=a.userProfile,c=a.version,d=a.userId,p=St(c),f=Nt(d,l,u),this._subscribeService.updateOwnProfile(f,p),e&&this._event.ownUserProfileChanged(f),[2,{code:o,data:f}]):[2,{code:o}]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,{code:exports.ErrorCode.SUCCESS,data:e}]:[2,this.syncOwnProfile()]}))}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),pc=function(){function e(e,t,r){Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._storage=new jl(rt(e,t)),this._delayTime=r,this.clear()}return Object.defineProperty(e.prototype,"_getConversationKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"".concat(e.targetId,"_").concat(e.channelId)}}),Object.defineProperty(e.prototype,"_removeExcessData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=Object.keys(e).map((function(t){return{key:t,value:e[t]}})).sort((function(e,t){return e.value.t-t.value.t})).slice(-30),i={};try{for(var o=a(n),s=o.next();!s.done;s=o.next()){var u=s.value;i[u.key]=u.value}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}}),Object.defineProperty(e.prototype,"insert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o){var s;if(!(i<Date.now()-this._delayTime-Be)){var a=this._getConversationKey(e),u=this._storage.get(a)||{};if(!u[t]){var l={t:i,d:r};o&&(l.sId=o);var c=n(n({},u),((s={})[t]=l,s));Object.keys(c).length>30&&(c=this._removeExcessData(c)),this._storage.set(a,c)}}}}),Object.defineProperty(e.prototype,"addReadedUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i,o=this._getConversationKey(e),s=this._storage.get(o)||{},a=s[t];if(a){if(a.us){if(a.us.includes(r))return}else a.us=[];a.us.push(r),this._storage.set(o,n(n({},s),((i={})[t]=a,i)))}}}),Object.defineProperty(e.prototype,"getReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=(this._storage.get(r)||{})[t];return n?{time:n.t,direction:n.d,users:n.us||[],senderId:n.sId}:null}}),Object.defineProperty(e.prototype,"getReceiptMessageDic",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._getConversationKey(e),r=this._storage.get(t)||{},n={};for(var i in r){var o=r[i];o.d===exports.MessageDirection.RECEIVE&&(n[o.sId]||(n[o.sId]=[]),n[o.sId].push(i))}return n}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=this._storage.get(r)||{};n[t]&&(delete n[t],0===Object.keys(n).length?this._storage.remove(r):this._storage.set(r,n))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.getValues(),t={};for(var r in e){var n=e[r],i={};for(var o in n){var s=n[o];Date.now()-this._delayTime-s.t<Be&&(i[o]=s)}Object.keys(i).length&&(t[r]=i)}this._storage.update(t)}}),e}(),fc=function(e){function r(t,r){var n=e.call(this,t,r)||this;return Object.defineProperty(n,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:""}),n._storageKey=$e(t),n}return t(r,e),Object.defineProperty(r.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return es.localStorage.getItem(this._storageKey)}}),Object.defineProperty(r.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){es.localStorage.setItem(this._storageKey,e)}}),Object.defineProperty(r.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){es.localStorage.removeItem(this._storageKey)}}),Object.defineProperty(r.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return[4,es.httpReq({url:e})];case 1:return t=i.sent(),r=t.status,n=t.data,[2,{code:r,data:n}]}}))}))}}),Object.defineProperty(r.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Xt(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(H.L_GET_STATIC_CONF_E,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),r}(Vr),_c=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),hc=48,gc=64,Ec=80,bc=96,vc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Tc=function(e){for(var t={},r=0;r<e.length-1;r++){var n=e.charAt(r)+e.charAt(r+1);t.hasOwnProperty(n)?t[n].push(r):t[n]=[r]}for(var i=[],o=[],s=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=yc(e.length),r=String.fromCharCode(Ec|t.length);i.push(r+t)}else{var n=String.fromCharCode(bc|e.length);i.push(n)}i.push(e)}},a=0;a<e.length;){var u=Ic(t,e,a);if(u.length<2)o.push(e.charAt(a++));else if(u.length<4)o.push(e.substr(a,u.length)),a+=u.length;else{var l=yc(a-u.offset),c=yc(u.length);if(l.length+c.length>=u.length)o.push(e.substr(a,u.length)),a+=u.length;else{s();var d=String.fromCharCode(gc|l.length<<2|c.length);i.push(d+l+c),a+=u.length}}}s();var p=yc(e.length),f=String.fromCharCode(hc|p.length);return i.push(f+p),i.join("")},Ic=function(e,t,r){var n={length:0,offset:-1};if(t.length,r>=t.length-1)return n;var i=e[t.charAt(r)+t.charAt(r+1)];if(i[0]===r)return n;for(var o=t.length-r,s=0,a=i.length;s<a;s++){var u=i[s],l=r-u;if(!(l>238327)){var c=Math.min(o,l);if(c<=n.length)break;if(!(n.length>2&&t.charAt(u+n.length-1)!==t.charAt(r+n.length-1))){for(var d=2,p=d;p<c&&t.charAt(u+p)===t.charAt(r+p);p++)d++;d>=n.length&&(n.length=d,n.offset=u)}}}return n},yc=function(e){var t=[],r=0;do{r=e%62,t.push(vc.charAt(r)),e=(e-r)/62}while(e>0);return t.join("")},mc=((tc={})[Mi]=exports.ErrorCode.RC_DISCONN_KICK,tc[wi]=exports.ErrorCode.RC_DISCONN_EXCEPTION,tc[Di]=exports.ErrorCode.RC_DISCONN_EXCEPTION,tc[xi]=exports.ErrorCode.RC_CONN_REDIRECTED,tc[Gi]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,tc[Vi]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,tc[ji]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,tc),Rc=((rc={})[di]=exports.ErrorCode.SUCCESS,rc[pi]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,rc[fi]=exports.ErrorCode.RC_CONN_IDENTIFIER_REJECTED,rc[_i]=exports.ErrorCode.RC_CONN_SERVER_UNAVAILABLE,rc[hi]=exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,rc[gi]=exports.ErrorCode.RC_CONN_NOT_AUTHRORIZED,rc[Ei]=exports.ErrorCode.RC_CONN_REDIRECTED,rc[bi]=exports.ErrorCode.RC_CONN_PACKAGE_NAME_INVALID,rc[vi]=exports.ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED,rc[Ti]=exports.ErrorCode.RC_CONN_USER_BLOCKED,rc[Ii]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,rc[yi]=exports.ErrorCode.RC_CONN_DEVICE_ERROR,rc[mi]=exports.ErrorCode.RC_CONN_HOSTNAME_ERROR,rc[Ri]=exports.ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE,rc[Si]=exports.ErrorCode.RC_LISCENSE_COUNT_OUT_OF_LIMIT,rc[Ai]=exports.ErrorCode.RC_CONN_WRONG_CLUSTER,rc[Oi]=exports.ErrorCode.RC_APP_AUTH_NOT_PASS,rc[Ci]=exports.ErrorCode.RC_OTP_USED,rc[Ni]=exports.ErrorCode.RC_PLATFORM_ERROR,rc[Pi]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,rc[Li]=exports.ErrorCode.RC_LICENSE_EXPIRED,rc),Sc=function(e){return[An.ppMsgS,An.pgMsgS,An.chatMsgS,An.prMsgS].includes(e)},Ac={1:"ChannelsUserInfos",2:"ChannelsInviteStatusInfos",3:"ChannelsJoinedInfos",11:"FriendUserInfos",12:"FriendInviteInfos"},Oc=((nc={})[M.GROUP_OPERATION]=function(e){return"ChannelEventData"},nc[M.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},nc[v.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},nc),Cc=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"decodeByPBName",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=this,o=e,s=((n={})[ca]=i._formatGrpReadReceiptQryResp,n[wa]=i._formatQueryReceiptResp,n[Sa]=i._formatUltraOperateStatusNotifyList,n[ma]=i._formatUltraMsgList,n[Rs]=i._formatUltraGroupUnreadMentionedList,n[su]=i._formateChannelsListResult,n)[t];try{o=e.length>0&&Ku.decode(t,e),Et(s)&&(o=s.call(this,o,r))}catch(e){this.logger.error(H.L_PB_DECODE_E,t)}return o}}),Object.defineProperty(e.prototype,"_formatJSONContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return JSON.parse(e)}catch(t){return this.logger.error(H.L_PARSE_JSON_E,e),e}}}),Object.defineProperty(e.prototype,"_getUtfContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.user){var t=e.user,r=t.portrait,n=t.portraitUri,i=r||n;i&&(e.user.portrait=e.user.portraitUri=i)}return e}}),Object.defineProperty(e.prototype,"_setExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return e&&(t=function(e){var t={},r=JSON.parse(e);return $u(r,(function(e,r){t[r]=e.v})),t}(e)),t}}),Object.defineProperty(e.prototype,"_formatReceivedMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!e)return e;var r=this,n=t||{},i=n.currentUserId,o=n.connectedTime,s=n.afterDecode,a=e.content,u=e.fromUserId,l=e.type,c=e.groupId,d=e.status,p=e.dataTime,f=e.extraContent,_=e.extStatus,h=e.clientUniqueId,g=e.busChannel,E=e.msgId,b=e.classname,v=e.toUserIds,T=e.optionBits,I=e.direction||exports.MessageDirection.RECEIVE,y=function(e){var t=exports.ReceivedStatus.READ;return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:t=2&e?exports.ReceivedStatus.RETRIEVED:t,canIncludeExpansion:!!(1024&e)}}(d),m=y.isPersited,R=y.isCounted,S=y.isMentioned,A=y.disableNotification,O=y.receivedStatus,C=y.canIncludeExpansion,N=!!(2&(_||0)),P=!!(4&(_||0)),L=!!(64&(_||0)),M=!!(8&(_||0))?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,w=[exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].indexOf(l)>-1?c:u,U=u,D=exports.MessageDirection.RECEIVE;I===exports.MessageDirection.SEND&&(U=i,D=exports.MessageDirection.SEND);var x=St(p),G=x<o,V=l===exports.ConversationType.CHATROOM,j=r._setExpansion(f),k=r._formatJSONContent(a);k=r._getUtfContent(k);var F=qt(e.configFlag,e.pushContent,e.pushExt);V&&u===i&&(D=exports.MessageDirection.SEND);var B={conversationType:l,targetId:w,senderUserId:U,messageType:b,messageUId:E,isPersited:m,isCounted:R,isMentioned:S,sentTime:x,messageDirection:D,receivedTime:Date.now(),disableNotification:A,receivedStatus:O,receivedStatusInfo:Ot(O),canIncludeExpansion:C,content:k,expansion:j,pushConfig:F,channelId:g||"",isInterrupt:N,isModifyMessage:P,messageId:St(h)||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:G,channelType:M,isStatusMessage:L,readReceiptInfo:void 0,directedUserIds:v,disableUpdateLastMessage:!!(1&(T||0)),needReceipt:!!(2&(T||0)),sendReceipt:!!(4&(T||0))||void 0,modifyInfo:zl(e.convertExt)};return(null==s?void 0:s(B))||B}}),Object.defineProperty(e.prototype,"formatEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.map((function(e){var r,n=e.businessId,i=e.time,o=e.changeType,s=e.originalId,a=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,d=e.operatorId,p=e.subChangeType,f=e.secondaryType,_=e.remindType,h=e.isRemindMe,g=e.extIds,E=e.eventData;return E&&(r=t._formatEventData(E,o,p)),{businessId:n,changeType:o,originalId:s,time:St(i),originalTime:St(a),secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:d,subChangeType:p,userGroupIds:g,secondaryType:f,remindType:_,isRemindMe:h,eventData:r}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n={};return e&&Oc[t]&&Oc[t](r)&&(n=Ku.decode(Oc[t](r),e)||{}),n}}),Object.defineProperty(e.prototype,"_formatUltraOperateStatusNotifyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.type,r=e.notifyType,n=e.info,i=e.summary,o=[],s=[],a=!(2&~r),u=!(1&~r);return u&&Array.isArray(n)&&n.forEach((function(e){var t=e.targetId,r=e.busChannel,n=e.userId,i=e.opType,s=e.optime,a=St(s);o.push({targetId:t,channelId:r,userId:n,operationType:i,operationTime:a})})),a&&Array.isArray(i)&&i.forEach((function(e){var t=e.targetId,r=e.busChannel,n=e.count,i=e.opType;s.push({targetId:t,channelId:r,count:n,operationType:i})})),{conversationType:t,info:o,summary:s,hasInfo:u,hasSummary:a}}}),Object.defineProperty(e.prototype,"_formatUltraMsgList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.list;return{list:n&&n.map((function(e){return r._formatReceivedMessage(e,t)}))}}}),Object.defineProperty(e.prototype,"_formatUltraGroupUnreadMentionedList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.msgInfo;return(void 0===t?[]:t).map((function(e){return{messageUId:e.msgId,sentTime:St(e.msgTime),mentionedType:e.remindType,messageType:e.className||""}}))}}),Object.defineProperty(e.prototype,"_formatGrpReadReceiptQryResp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.totalMemberNum,r=e.list;return r.forEach((function(e){e.readTime=St(e.readTime)})),{totalMemberCount:t,list:r}}}),Object.defineProperty(e.prototype,"_formatQueryReceiptResp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.list,r=void 0===t?[]:t,n=e.num,i=e.readCnt;return{list:r.map((function(e){return{readTime:St(e.receiptTime),userId:e.userId}})),totalCount:n,readCount:i}}}),Object.defineProperty(e.prototype,"_formateChannelsListResult",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!e)return{result:{list:[]}};var t=e.listType,r=e.result,n=e.page;return r?{listType:t,result:Ku.decode(Ac[t],r)||[],page:n}:{listType:t,result:{list:[]},page:n}}}),Object.defineProperty(e.prototype,"_calculateFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.isFilerWhiteBlacklist,r=e.isVoipPush,n=e.pushConfig||{},i=0;return i|=r?1:0,i|=t?2:0,i|=n.disablePushTitle?4:0,i|=n.forceShowDetailContent?8:0}}),Object.defineProperty(e.prototype,"_getPushExtraModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.pushTitle,r=e.iOSConfig,n=e.androidConfig,i=e.templateId,o=void 0===i?"":i,s=e.harmonyOSConfig,a=Ku.getModule(cs);if(t&&a.setTitle(t),r||n||s){var u=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,s=t.typeVivo,a=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,d=t.importanceHonor,p=t.imageUrlHonor,f=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.threadId,n=e.apnsCollapseId,i=e.category,o=e.richMediaUri,s=e.interruptionLevel,a=t.googleConfig,u={};u["thread-id"]=r||"",u["apns-collapse-id"]=n||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=s||"active";var l={};l.collapse_key=null==a?void 0:a.collapseKey,l.imageUrl=null==a?void 0:a.imageUrl;var c=null==a?void 0:a.priority;return c&&!["high","normal"].includes(c)&&(c="normal"),l.priority=c,{APNS:u,FCM:l}}(e,t),_=[{HW:{channelId:i||"",importance:a||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:s||"",category:c||""}},{APNS:f.APNS},{FCM:f.FCM},{HONOR:{importance:d||exports.PushImportanceHonor.NORMAL,image:p||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(_)}(r,n,s);a.setPushConfigs(u)}return(null==n?void 0:n.notificationId)&&a.setPushId(null==n?void 0:n.notificationId),a.setTemplateId(o),a}}),Object.defineProperty(e.prototype,"_getUpMsgModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n,i=t.messageType,o=t.content,s=t.directionalUserIdList,l=t.canIncludeExpansion,c=t.expansion,d=t.pushConfig,p=t.channelId,f=t.pushData,_=void 0===f?"":f,h=t.pushContent,g=void 0===h?"":h,E=t.messageId,b=void 0===E?0:E,v=t.disableUpdateLastMessage,T=void 0!==v&&v,I=t.isPersited,y=t.needReceipt,m=e.conversationType,R=e.targetId,S=Ku.getModule(ls),A=function(e){var t=e.isStatusMessage,r=e.isPersited,n=e.isCounted;t&&(r=n=!1);var i=0;return r&&(i|=1),n&&(i|=2),e.isMentioned&&(i|=4),e.disableNotification&&(i|=32),e.canIncludeExpansion&&(i|=64),i}(t),O=d||{},C=O.pushContent,N=void 0===C?g:C,P=O.pushData,L=void 0===P?_:P;S.setSessionId(A),N&&S.setPushText(N),L&&S.setAppData(L),s&&S.setToUserIds(s);var M=this._calculateFlag(t);if(S.setConfigFlag(M),S.setClassname(i),o.user&&o.user.portraitUri&&(o.user.portrait=o.user.portraitUri),S.setContent(JSON.stringify(o)),l&&c){var w={};try{for(var U=a(Object.entries(c)),D=U.next();!D.done;D=U.next()){var x=u(D.value,2),G=x[0],V=x[1];w[G]={v:V}}}catch(e){r={error:e}}finally{try{D&&!D.done&&(n=U.return)&&n.call(U)}finally{if(r)throw r.error}}S.setExtraContent(JSON.stringify(w))}if(d){var j=this._getPushExtraModule(d);S.setPushExt(j)}S.setClientUniqueId(b),bt(p)||S.setBusChannel(p),m===exports.ConversationType.SYSTEM&&S.setSystemId(R);var k=0;return I&&T&&(k|=1),y&&(k|=2),S.setOptionBits(k),S}}),Object.defineProperty(e.prototype,"encodeUpMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._getUpMsgModule(e,t).toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeOldConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=(e=e||{}).count,r=e.type,n=e.startTime,i=e.order;t=t||0,n=n||0,i=i||0;var o=Ku.getModule(Is);return o.setType(r),o.setCount(t),o.setStartTime(n),o.setOrder(i),o.setCompressioEnabled(_c.enable()),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Ku.getModule(ia);return r.setMsgId(e),t&&r.setChannelId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Ku.getModule(ia);return r.setMsgId(e),t&&r.setChannelId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReadReceiptMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Ku.getModule(La),i=e.conversationType,o=e.targetId,s=e.channelId,a=void 0===s?"":s;return n.setType(i),n.setTargetId(o),n.setBusChannel(a),n.setStartMsgId(t),n.setEndMsgId(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReceiptQryReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Ku.getModule(Ma),n=e.targetId,i=e.channelId,o=void 0===i?"":i;return r.setTargetId(n),r.setBusChannel(o),r.setMsgId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReceiptCntQryReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Ku.getModule(Ua),n=e.targetId,i=e.conversationType,o=e.channelId,s=void 0===o?"":o;return r.setChannelId(n),r.setBusChannel(s),r.setType(i),r.setMsgId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUpdateUserSubReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=Ku.getModule(xa);i.setSubType(e),i.setOpType(r),i.setExpiry(n);var o=[];return t.forEach((function(e){var t=Ku.getModule(Ga);t.setSubUserId(e),o.push(t)})),i.setSubUsers(o),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullUserSubReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.version,r=e.pageToken,n=Ku.getModule(ja);return n.setVersion(t),n.setPageToken(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfileInput",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Ku.getModule(Xa);return e.setNothing(1),e.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfilePermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ku.getModule(za);return t.setPermission(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSearchUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ku.getModule(Za);return t.setUniqueId(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ku.getModule(Ya),r=[],n=[];return Object.keys(e).forEach((function(t){if("extraProfile"!==t){var i=e[t],o=Ku.getModule(Wa);o.setKey(t),o.setValue((null==i?void 0:i.toString())||""),r.push(o)}else if(e.extraProfile){var s=e.extraProfile;Object.keys(s).forEach((function(e){var t=s[e],r=Ku.getModule(Wa);r.setKey(e),r.setValue(t.toString()||""),n.push(r)}))}})),t.setUserProfile(r),t.setUserExtProfile(n),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMultiChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ku.getModule(tu),r=[];return e.forEach((function(e){var t=Ku.getModule($a);t.setTargetId(e),r.push(t)})),t.setType(exports.ConversationType.GROUP),t.setList(r),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===r&&(r=[]),void 0===n&&(n=!0);var o=Ku.getModule(ru);if(o.setTargetId(t),o.setType(exports.ConversationType.GROUP),"dismiss"!==e&&i){var s=this.encodeQuitChannelsSetting(i,n);o.setSettingInfo(s)}return"quit"!==e&&"dismiss"!==e&&o.setUsers(r),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuitChannelsSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Ku.getModule(nu);return r.setIsQuit(t),r.setIsDelBan(!!(null==e?void 0:e.removeMuteStatus)),r.setIsDelWhite(!!(null==e?void 0:e.removeWhiteList)),r.setIsDelAttention(!!(null==e?void 0:e.removeFollow)),r}}),Object.defineProperty(e.prototype,"encodeModifyChannelsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Ku.getModule(ru);return n.setTargetId(t),n.setType(exports.ConversationType.GROUP),n.setUsers(r),n.setOperateType(e),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeChannelsQueryInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.type,r=e.groupId,n=e.option,i=e.ids,o=Ku.getModule(iu);if(r&&o.setTargetId(r),o.setType(exports.ConversationType.GROUP),["getGroupMembersByRole","getGroupApplications","getJoinedGroupsByRole"].includes(t)&&n){var s=this.encodePagingQuery(n);o.setPage(s)}return["getGroupMembers","getJoinedGroups"].includes(t)&&o.setIds(null!=i?i:[]),e.roleType&&o.setRoleType(e.roleType),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePagingQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ku.getModule(ou),r=e.count,n=e.order,i=e.pageToken;return t.setSize(r),t.setOrder(n?0:1),t.setPageToken(i),t}}),Object.defineProperty(e.prototype,"encodeJoinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){void 0===r&&(r=[]);var n=Ku.getModule(pu);return n.setTargetId(t),n.setType(exports.ConversationType.GROUP),"invite"===e&&n.setUserIds(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMemberResponseInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.groupId,r=e.inviterId,n=e.optType,i=e.optResult,o=e.joinUserId,s=e.reason,a=Ku.getModule(du);return a.setTargetId(t),a.setType(exports.ConversationType.GROUP),a.setOptType(n),a.setOptResult(i),a.setInviterId(r),n===exports.GroupOperationRole.MANAGER&&a.setJoinUserId(o),i||a.setDetail(null!=s?s:""),a.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Ku.getModule(cu),n=exports.GroupOperationType.ADD;return r.setTargetId(e),r.setType(exports.ConversationType.GROUP),t||(n=exports.GroupOperationType.REMOVE),r.setOperateType(n),r.setChannelNickName(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Ku.getModule(ru);return n.setTargetId(t),n.setType(exports.ConversationType.GROUP),n.setUsers(r),n.setOperateType(e),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeFriendInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ku.getModule(fu);return t.setTargetId(e.targetId),e.type&&t.setType(e.type),e.info&&t.setInfo(e.info),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeFriendsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ku.encode(_u,{targetId:e,type:t})}}),Object.defineProperty(e.prototype,"encodeFriendQueryInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=null!=t?t:{},i=n.count,o=void 0===i?200:i,s=n.pageToken,a=void 0===s?"":s,u=n.order,l=void 0!==u&&u,c=Ku.getModule(bu);c.setQueryType(e),11===e&&c.setFriendType(r);var d=Ku.getModule(ou);return d.setSize(o),d.setOrder(l?0:1),d.setPageToken(a),c.setPage(d),c.toArrayBuffer()}}),e}(),Nc=function(e){function r(t,r,n){var i=e.call(this,t,r,n)||this;return Object.defineProperty(i,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:function(){return i._idCount>=65535&&(i._idCount=0),++i._idCount}}),Object.defineProperty(i,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),i.codec=new Cc(i.logger),i}return t(r,e),Object.defineProperty(r.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(r.prototype,"getLocalConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime}}),Object.defineProperty(r.prototype,"getCrtServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}}),Object.defineProperty(r.prototype,"getDelayTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime-this._connectedTime}}),Object.defineProperty(r.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var r,i,o,a,u,l,c,d,p,f;return s(this,(function(_){switch(_.label){case 0:if(r=t.openAnti,i=t.type,o=t.baggageEnabled,a=this.getCmpList(t),this.logger.debug(H.L_NAVI_CMP_R,JSON.stringify(a),n),0===(u=a.filter((function(e,t){return a.findIndex((function(t){return t.addr===e.addr}))===t})).sort((function(e,t){return e.weight>t.weight?-1:1}))).length)return this.logger.error(H.L_NAVI_CONF_E,"no service available",n),[2,ar(exports.ErrorCode.SERVER_UNAVAILABLE)];l=1===r?Fn:Bn,c=function(t){var r,a,c,p,f,_,h,g,E,b,v;return s(this,(function(s){switch(s.label){case 0:return r=u[t],a=r.protocol,c=r.addr,p=r.weight,f=function(e,t,r,n,i,o,s,a){var u,l=s?"&protocolVer=".concat(s):"",c=Fl(),d=Hl();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(r,"&token=").concat(encodeURIComponent(n),"&sdkVer=").concat(ke,"&pid=").concat(o,"&deviceId=").concat(encodeURIComponent(c)).concat(1===a?"&baggage=".concat(encodeURIComponent("cid=".concat(i))):"","&apiVer=").concat(encodeURIComponent((null===(u=es.getApiVer)||void 0===u?void 0:u.call(es))||"||")).concat(es.connectPlatform?"&platform=".concat(es.connectPlatform):"").concat(l).concat(es.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(d)):"")}(a===q.WS?"ws":"wss",c,d.appkey,e,d.cid,"",l,o),_=Date.now(),[4,d.connectWebSocket(f,l,n)];case 1:return h=s.sent(),g=h.code,E=h.data,b=d.cmpWeightCache.findIndex((function(e){return e.addr===c})),v={bid:Qt(),ptc:Se.WS,cod:g,net:d.getNetwork().type,dur:Date.now()-_,spr:0,pr:i||0,hos:c,idx:b,rct:d.retryCount?Ce.RECONNECT:Ce.CONNECT,cid:d.cid,v:Oe.CURRENT,rsn:d._doConnectReason,count:d.retryCount,weight:p,ssid:d._serverSessionId},d.logger.record(ve.IM_WEBSOCKET,JSON.stringify(v),n),g===exports.ErrorCode.RC_SOCKET_DISCONNECTED||g===exports.ErrorCode.TIMEOUT?[2,"continue"]:g!==exports.ErrorCode.SUCCESS?[2,{value:ar(g)}]:(d._localConnectedTime=Math.floor((Date.now()+_)/2),d._socket=E.socket,d.updateCmpWeight(u[t].addr,!0),d.curCmpUrl=u[t].addr,[2,{value:sr(E.userId)}])}}))},d=this,p=0,_.label=1;case 1:return p<u.length?[5,c(p)]:[3,4];case 2:if("object"==typeof(f=_.sent()))return[2,f.value];_.label=3;case 3:return p+=1,[3,1];case 4:return[2,ar(exports.ErrorCode.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(r.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f=this;return s(this,(function(s){switch(s.label){case 0:return this.logger.info(H.L_CONNECT_O,"connect start: ".concat(e),r),n=pr(),i=n.resolve,o=n.promise,[4,es.createWebSocket(e)];case 1:return a=s.sent(),u=a.data,l=a.code,c=a.msg,l===exports.ErrorCode.SUCCESS&&u?(this._socketIndex=u.id,d=exports.ErrorCode.SUCCESS,p=setTimeout((function(){f.logger.warn(H.L_CONNECT_S,"timeout",r),d=exports.ErrorCode.TIMEOUT,u.close()}),5e3),u.onOpen((function(){f.logger.info(H.L_CONNECT_S,"socket opened",r),clearTimeout(p)})),u.onError((function(e){f.logger.info(H.L_CONNECT_S,"socket error",r),clearTimeout(p);var t=exports.ErrorCode.RC_SOCKET_DISCONNECTED;i(ar(t)),f.onSocketEnd(u,t)})),u.onClose((function(){f.logger.info(H.L_CONNECT_S,"socket close",r);var e=d===exports.ErrorCode.SUCCESS?exports.ErrorCode.RC_SOCKET_DISCONNECTED:d;i(ar(e)),f.onSocketEnd(u,e)})),u.onMessage((function(e){if(f._socketIndex===u.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var n=ao(e,t);if(n){if(n instanceof Wi){var o=n.status;if(o!==di)return f.logger.warn(H.L_CONNECT_O,"connect failed: ".concat(o),r),d=Rc[o],u.close(),void i(ar(d));f.logger.info(H.L_CONNECT_O,"connect success",r);var s=n.timestamp,a=n.userId,l=n.messageId,c=n.sessionId;return f._serverSessionId=c,f._connectedTime=s,f._idCount=l,void i(sr({userId:a,socket:u}))}if(n instanceof Ji){var p=n.status;return f.logger.info(H.T,"recv disconnect signal -> status: ".concat(p)),void f.onRecvDisconnect(p,u)}f._onReceiveSignal(n)}}}else f.logger.warn(H.L_WS_DISACCORD_E,JSON.stringify({socketIndex:f._socketIndex,curSocketId:u.id}))})),[2,o]):[2,ar(l,c)]}}))}))}}),Object.defineProperty(r.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==Pn)return e instanceof $i&&!e.syncMsg?(this.logger.debug(H.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new io(e.messageId))):void(e instanceof so&&this._messageIds[e.messageId]&&(this.logger.debug(H.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new oo(e.messageId))))}}),Object.defineProperty(r.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return t=e.syncMsg,r=e.topic,n=e.messageId,this.logger.debug(H.O,"recv PublishReader -> messageId: ".concat(n," ").concat(r)),r===Xn?[2]:!t||Sc(Cn(r))?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[n]=e}))];case 1:return i=s.sent(),delete this._syncMessageIds[n],this.emit("signal",e,i),[2]}}))}))}}),Object.defineProperty(r.prototype,"_onReceiveSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return e instanceof Xi&&this._pingResolve?(this._pingResolve(exports.ErrorCode.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof no||e instanceof so)&&(t=e.messageId,this.logger.debug(H.O,"recv ack -> messageId: ".concat(t)),(r=this._messageIds[t])&&(r(e),delete this._messageIds[t]),(n=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],n(e))),e instanceof $i?[4,this._publishReader(e)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(r.prototype,"onRecvDisconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return mc[e]}(e)))}}),Object.defineProperty(r.prototype,"onSocketEnd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===e&&(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0))}}),Object.defineProperty(r.prototype,"clearResolves",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(exports.ErrorCode.RC_SOCKET_DISCONNECTED)}}}),Object.defineProperty(r.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._pingResolve=r,setTimeout((function(){return r(exports.ErrorCode.TIMEOUT)}),e),t.sendOnly(new Qi)}))}}),Object.defineProperty(r.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof ro||e instanceof to)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(r.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return this._socket?(t=this._generateMessageId(),e.messageId=t,this._socket.send(e.getArrayBuffer()),[4,new Promise((function(e){i._messageIds[t]=e,setTimeout((function(){i._messageIds[t]&&delete i._messageIds[t],e(exports.ErrorCode.TIMEOUT)}),3e4)}))]):[2,ar(exports.ErrorCode.RC_NET_CHANNEL_INVALID)];case 1:return r=o.sent(),(n="number"==typeof r?r:r.status)!==exports.ErrorCode.SUCCESS&&this.logger.warn(H.L_SEND_RMTP_E,JSON.stringify({messageId:t,code:n,topic:e.topic})),"number"==typeof r?[2,ar(r)]:[2,n===exports.ErrorCode.SUCCESS?sr(r):ar(n,"",r)]}}))}))}}),Object.defineProperty(r.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return o=this.logger.createTraceId(),a=Nn(e),this.logger.debug(H.L_QUERY_CMP_T,JSON.stringify({topic:a,targetId:t}),o),u=new to(e,r,t),i&&u.setHeaderQos(i),[4,this._sendHandler(u)];case 1:return l=s.sent(),this.logger.summary(H.L_QUERY_CMP_R,l,o,{topic:a,targetId:t}),c=l.data,l.isOk&&void 0!==n?[2,sr(Ku.decode(n,c.pbData))]:[2,l]}}))}))}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return[4,this._sendHandler(e)];case 1:return(n=s.sent()).data?n.data instanceof no?[2,n]:(i=n.data,o=t&&i.pbData&&[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,exports.ErrorCode.RC_USER_PROFILE_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,exports.ErrorCode.RC_USER_PROFILE_VALUE_EXCEED_RANGE,exports.ErrorCode.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(i.status)>=0,a=o?this.codec.decodeByPBName(i.pbData,t,r):i,0!==i.status?(this.logger.warn(H.O,"send failed -> messageId: ".concat(i.messageId,", respPBName: ").concat(t,", status: ").concat(i.status)),[2,ar(i.status,void 0,t&&i.pbData?a:null)]):[2,sr(a)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return r?[4,this.sendOnly(new Ki(Ui))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),r}(on),Pc=function(e){function r(t,r,n){var i=e.call(this,r,t,n)||this;Object.defineProperty(i,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});var o=es.runtimeInfo,s=o.type,a=o.version;return i.deviceId=Fl(),i.model="Web|".concat(s,"|").concat(a),i.init(),i}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:return(i=n).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},a=this.logger.createTraceId(),this.logger.info(H.L_REQUEST_T,JSON.stringify(o),a),[4,es.httpReq(o)];case 1:u=s.sent(),l=u.status,c=u.data,d=void 0===c?"":c,this.logger.info(H.L_REQUEST_R,JSON.stringify({status:l,data:d}),a);try{return p=JSON.parse(d),f=p.data,[2,{code:parseInt(p.code,10),data:f}]}catch(e){return this.logger.warn(H.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:l,data:d,error:e})),[2,{code:l,msg:e}]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=et(this.appkey);es.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(H.L_CLOUD_SET_CACHE_O,JSON.stringify(e))}}),Object.defineProperty(r.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=et(this.appkey),t=es.localStorage.getItem(e);return this.logger.info(H.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t}}),Object.defineProperty(r.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(H.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}}),Object.defineProperty(r.prototype,"getMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mrtr}}),r}(rn),Lc=function(e){function r(t,r,n,i){var o=e.call(this,t,r,n,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:r}),Object.defineProperty(o,"_type",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:i}),ic.set(o,void 0),oc.set(o,lt),d(o,ic,new jl(nt(t)),"f"),o}return t(r,e),Object.defineProperty(r.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){d(this,oc,e,"f")}}),Object.defineProperty(r.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,oc,"f")}}),Object.defineProperty(r.prototype,"setConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{return c(this,ic,"f").set(e,t),!0}catch(e){return!1}}}),Object.defineProperty(r.prototype,"getConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return{success:!0,value:c(this,ic,"f").get(e)}}catch(e){return{success:!1}}}}),r}(Fr);ic=new WeakMap,oc=new WeakMap;var Mc=null,wc="RC_LOGS",Uc="RC_STATISTICS",Dc=((sc={})[wc]=["level","time"],sc[Uc]=["level","time"],sc),xc=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),o=IDBKeyRange.upperBound(Date.now()-r),s=i.openCursor(o);s.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},s.onerror=function(){n()}}))},Gc=null,Vc=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return[4,Mc];case 1:return(t=n.sent())?(r=t.db,[4,xc(r,wc,e)]):[2];case 2:return n.sent(),[4,xc(r,Uc,e)];case 3:return n.sent(),Gc=setTimeout((function(){return Vc(e)}),6e5),[2]}}))}))},jc=function(e,t,r){void 0===r&&(r=168),Mc||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==es.runtimeInfo.type?Mc=new Promise((function(n){var i=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(r){r.forEach((function(r){r.name&&e.includes(r.name)&&t.deleteDatabase(r.name)}))}))}(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var o="RC_LOGS_".concat(e),s=i.open(o,2);s.onerror=function(e){t.error(H.L_LOGDB_OPEN_FAILED_E,e.target.error),n(null)},s.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){Mc=null,t.warn(H.L_LOGDB_CLOSED_S)},o.onerror=function(e){Mc=null,t.error(H.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(H.L_LOGDB_ABORT_S,e.target.error)},Vc(3600*Math.max(24,Math.min(168,r))*1e3),n({appkey:e,db:o})):n(null)},s.onupgradeneeded=function(e){var t=e.target.result;Object.keys(Dc).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var r=t.createObjectStore(e,{autoIncrement:!0});Dc[e].forEach((function(e){return r.createIndex(e,e,{unique:!1})}))}))}})):t.warn(H.L_UNSUPPORT_INDEXDB_O))},kc=[],Fc=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite");i.oncomplete=n,i.onabort=n;var o=i.objectStore(t);r.forEach((function(e){try{o.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},Bc=[],Hc=!1,qc=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return Hc||0===Bc.length?[2]:(Hc=!0,t=Bc.filter((function(e){return e.level<exports.LogL.FATAL})),r=Bc.filter((function(e){return e.level>=exports.LogL.FATAL})),Bc.length=0,[4,Fc(e,wc,r)]);case 1:return n.sent(),[4,Fc(e,Uc,t)];case 2:return n.sent(),Hc=!1,0===Bc.length&&kc.length>0&&(kc.forEach((function(e){return e.close()})),kc.length=0),setTimeout((function(){return qc(e)})),[2]}}))}))},Yc=function(){var e=Jr();return e.setLogReader((function(e,t,r,n,i){return void 0===i&&(i=wc),o(void 0,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return[4,Mc];case 1:return(o=s.sent())?[2,new Promise((function(s){var a=o.db.transaction(i,"readonly").objectStore(i),u=[],l=IDBKeyRange.bound(e,t),c=a.index("time").openCursor(l);c.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=r&&(n?i.sessionId===ut:i.level>=0)&&u.push(i),t.continue()}else s({logs:u})},c.onerror=function(){s({logs:[]})}}))]:[2,{logs:[]}]}}))}))})),e.setLogWriter((function(e){!function(e){o(void 0,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,Mc];case 1:if(!(t=r.sent()))return[2];if(e.content&&ct(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return Bc.push(e),qc(t.db),[2]}}))}))}(e)})),e},Wc="REPORT_SESSION",Kc=function(e,t){return o(void 0,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){return r="".concat(Wc,"_").concat(e),n=t.getSessionId(),i=t.getConf(r),o=i.success,a=i.value,o?(n===(null==a?void 0:a.sessionId)||t.setConf(r,{sessionId:n}),[2]):[2]}))}))},Jc=function(e,t){return o(void 0,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){return r=t.getSessionId(),n=t.getConf("".concat(Wc,"_").concat(e)),i=n.success,o=n.value,[2,i&&(null==o?void 0:o.sessionId)===r]}))}))},Qc=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,r){return void 0===t&&(t=Date.now()-Qc),void 0===r&&(r=Date.now()),o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=t<0?Date.now()+t:t,(r=r<=0?Date.now():r)-t>Qc&&(t=r-Qc),n=Jr(),(i=new Lc(e,"RC-IM","IM",n)).debug(H.T,"get logs: startTime ".concat(t," endTime ").concat(r)),jc(e,i),[4,n.read(t,r,exports.LogL.DEBUG,!1)];case 1:return o=s.sent().logs,i.debug(H.T,"get logs ".concat(o.length)),function(e,t){var r=t.map((function(e){var t=e.sessionId,r=e.time,n=e.type,i=e.level,o=e.tag,s=e.traceId,a=e.loggerId,u=e.content;return"".concat(t,",").concat(r,",").concat(n,",").concat(i,",").concat(o,",").concat(s,",").concat(a,',"').concat(u,'"\n')})),n=new Blob(r,{type:"text/csv"}),i=URL.createObjectURL(n),o=document.createElement("a");o.href=i,o.download="".concat(e,".csv"),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}("".concat(e,"-").concat(t,"-").concat(r),o),[2]}}))}))}}}}var Xc,zc,Zc,$c,ed,td=function(e){function r(t,r,n,i){var o,s=Fl(),a=es.runtimeInfo,u=a.type,l=a.version,c="".concat(u,"|").concat(l,"|").concat(r.getSessionId(),"|").concat(es.connectPlatform);return o=e.call(this,t,s,c,i,r)||this,Object.defineProperty(o,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:n}),o}return t(r,e),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return es.httpReq(e)}}),Object.defineProperty(r.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,Kc(t.userId,this.logger)];case 1:return r.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))}}),Object.defineProperty(r.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,{success:!0,data:Tc(e.map(Hr).join(""))}]}))}))}}),Object.defineProperty(r.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,r,n,this.tableName)]}))}))}}),r}(Br),rd=function(e){function r(t,r,n){return e.call(this,t,r,wc,n)||this}return t(r,e),Object.defineProperty(r.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,Jc(this.userId,this.logger)];case 1:return[2,e.sent()]}}))}))}}),Object.defineProperty(r.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n,i,a,u,l){return void 0===l&&(l=!1),o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return[4,this.isReporter()];case 1:return o=s.sent(),this.userId&&!o?[2]:[2,e.prototype.report.call(this,t,r,n,i,a,u,l)]}}))}))}}),r}(td),nd=function(e){function r(t,r,n){return e.call(this,t,r,Uc,n)||this}return t(r,e),r}(td),id=function(e){function r(t,r){var n=e.call(this,"WebConversationSettings")||this;return Xc.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),zc.set(n,!1),n._ctx.on("sCmd",c(n,Xc,"m",$c),n),n._ctx.on("onConnected",c(n,Xc,"m",Zc),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,c(this,Xc,"m",ed).call(this,e)];case 1:return[2,t.sent().trans((function(e){return{version:e.version}}))]}}))}))}}),Object.defineProperty(r.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,c(this,Xc,"m",ed).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),r}(nr);zc=new WeakMap,Xc=new WeakSet,Zc=function(){d(this,zc,!0,"f")},$c=function(e,t){var r=t.type,n=t.time;if(3===r)this.push(n),e.stopPropagation()},ed=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),t.info(H.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),r),n=Ku.encode(Qs,{time:e}),[4,this._ctx.query(An.pullSeAtts,this._ctx.currentUserId,n,Xs)];case 1:return i=s.sent(),t.summary(H.L_PULL_CONVERSATION_SETTINGS_R,i,r,{version:e},(function(t){return{syncTime:t.version,version:e}})),i.isOk&&(o=this._storage.updateBySessionStates(i.data)).length&&this._ctx.emit("conversationStatusChanged",o),c(this,zc,"f")&&(d(this,zc,!1,"f"),this._ctx.emit("conversationStatusSynced",i.code)),[2,i]}}))}))};var od,sd,ad,ud,ld=function(){function e(){Object.defineProperty(this,"_memData",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._memData=this._syncDataHandler(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._memData[e].value}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._memData[e],n=r.key,i=r.stringify;r.value=t;var o=i?JSON.stringify(t):t;es.localStorage.setItem(n,o)}}),e}(),cd=function(e,t,r){return"".concat(null!=r?r:"","_").concat(e,"_").concat(t)},dd=function(e){var t=u(e.split("_")),r=t[0],n=t[1],i=t.slice(2);return{channelId:r,conversationType:parseInt(n,10),targetId:i.join("_")}};function pd(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 fd=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:exports.NotificationLevel.NOT_SET,translateStrategy:vn.DEFAULT,tags:[],channelType:exports.UltraGroupChannelType.PUBLIC,operationTime:0,draft:"",hidden:!1}},_d=function(){function e(e){od.set(this,void 0),sd.set(this,void 0),ad.set(this,void 0),ud.set(this,fd()),d(this,od,e.conversationType,"f"),d(this,sd,e.targetId,"f"),d(this,ad,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return c(this,od,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return c(this,sd,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return c(this,ad,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return c(this,ud,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!c(this,ud,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!c(this,ud,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return c(this,ud,"f").notificationLevel||exports.NotificationLevel.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateStrategy",{get:function(){return c(this,ud,"f").translateStrategy||vn.DEFAULT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(c(this,ud,"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,ud,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return c(this,ud,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return c(this,ud,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!c(this,ud,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return c(this,ud,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return c(this,ud,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return c(this,ud,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return c(this,ud,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return c(this,ud,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return c(this,ud,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return c(this,ud,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return c(this,ud,"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,od,"f"),targetId:c(this,sd,"f"),channelId:c(this,ad,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return cd(c(this,od,"f"),c(this,sd,"f"),c(this,ad,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){return n(n({},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:Me(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft})}}),Object.defineProperty(e.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};return this.isTop&&(e.to=!0),this.notificationLevel!==exports.NotificationLevel.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.translateStrategy!==vn.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(n(n({},fd()),{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 r=this;void 0===t&&(t=0);var n={},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,hidden:void 0};return Object.entries(i).forEach((function(i){var o=u(i,2),s=o[0],a=o[1],l=s;if(Object.prototype.hasOwnProperty.call(e,l)){var d=e[l];c(r,ud,"f")[l]!==d&&(c(r,ud,"f")[l]=d,a&&(n[a]={time:t,val:d}))}})),Object.keys(n).length>0?n:null}}),e}();od=new WeakMap,sd=new WeakMap,ad=new WeakMap,ud=new WeakMap;var hd,gd,Ed,bd,vd=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toStoragItem.call(this);return this.unreadCount>0&&(t.c=this.unreadCount),this.unreadMentionedCount>0&&(t.mc=this.unreadMentionedCount),this.unreadMentionedMeCount>0&&(t.mmc=this.unreadMentionedMeCount),this.hasMentioned&&(t.hm=!0),this.mentionedInfo&&(t.m=this.mentionedInfo),this.firstUnreadMessageUId&&(t.fuid=this.firstUnreadMessageUId),this.firstUnreadMessageType&&(t.fumt=this.firstUnreadMessageType),this.firstUnreadTime&&(t.fut=this.firstUnreadTime),this.lastReadTime&&(t.rt=this.lastReadTime),t}}),r}(_d),Td=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toIReceivedConversation.call(this);return t.channelType=this.channelType,t}}),Object.defineProperty(r.prototype,"isDefaultChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!this.channelId||"RCDefault"===this.channelId}}),r}(_d),Id=function(e){function r(t){var r=e.call(this)||this;return hd.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),gd.set(r,new Map),r}return t(r,e),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=es.localStorage,r=e.appkey,n=e.currentUserId,i=e.isDisableEmptyUGChannelId,o=Qe(r,n),s=Je(r,n),a=Xe(r,n),u=Ye(r,n),l=qe(r,n),d=We(r,n),p=Ke(r,n),f=t.getItem(o)||"0",_=t.getItem(s)||"0",h=t.getItem(a)||"1",g=t.getItem(l)||"0",E=JSON.parse(t.getItem(p)||"{}"),b=JSON.parse(t.getItem(u)||"{}"),v=JSON.parse(t.getItem(d)||"{}");return c(this,hd,"m",Ed).call(this,b,v,E,i),{inboxTime:{value:parseInt(f,10)||0,key:o},outboxTime:{value:parseInt(_,10)||0,key:s},broadcastTime:{value:parseInt(h,10)||0,key:a},conversationStatus:{value:b,key:u,stringify:!0},ultraGroupStatus:{value:v,key:d,stringify:!0},conversationStatusVersion:{value:parseInt(g,10)||0,key:l},conversationTypeGlobalSettings:{value:E,key:p,stringify:!0}}}}),Object.defineProperty(r.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),c(this,gd,"f").clear(),c(this,hd,"m",bd).call(this)}}),Object.defineProperty(r.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("conversationTypeGlobalSettings");t===exports.NotificationLevel.NOT_SET?delete r[e]:r[e]={nl:t},this.set("conversationTypeGlobalSettings",r)}}),Object.defineProperty(r.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)||exports.NotificationLevel.NOT_SET}}),Object.defineProperty(r.prototype,"getOrCreateModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=cd(e.conversationType,e.targetId,e.channelId),n=c(this,gd,"f").get(r);return n||(n=e.conversationType===exports.ConversationType.ULTRA_GROUP?new Td(e):new vd(e),t&&c(this,gd,"f").set(r,n)),n}}),Object.defineProperty(r.prototype,"updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("ultraGroupStatus"),r=this.get("conversationStatus");e.forEach((function(e){var n=e.conversationType,i=e.key,o=e.toStoragItem(),s=Object.keys(o),a=0===s.length||1===s.length&&"h"===s[0],u=n===exports.ConversationType.ULTRA_GROUP?t:r;a?delete u[i]:u[i]=o})),this.set("conversationStatus",r),this.set("ultraGroupStatus",t)}}),Object.defineProperty(r.prototype,"updateBySessionStates",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=e.version,n=e.state;if(this.set("conversationStatusVersion",r),!(null==n?void 0:n.length))return[];var i=new Map,o=new Set;return n.forEach((function(e){var n=e.channelId,s=e.busChannel,a=e.type,u=e.stateItem;e.time;var l={};if(null==u||u.forEach((function(e){var t=e.tags,r=e.sessionStateType,n=e.value;switch(r){case ss.IsSilent:l.notificationLevel=parseInt(n,10);break;case ss.IsTop:l.isTop="1"===n;break;case ss.Tags:l.tags=t;break;case ss.AutoTrans:l.translateStrategy=parseInt(n,10)}})),n){var d=cd(a,n,s),p=dd(d),f=c(t,gd,"f").get(d);f||(f=a===exports.ConversationType.ULTRA_GROUP?new Td(p):new vd(p),c(t,gd,"f").set(d,f)),o.add(f);var _=f.updateAttrs(l,r);if(_)if(i.has(f)){var h=i.get(f);Object.assign(h,_)}else i.set(f,_)}else void 0!==l.notificationLevel&&t.setConversationTypeNotificationLevel(a,l.notificationLevel)})),this.updateConversationStorage(Array.from(o)),Array.from(i.entries()).map((function(e){var t=u(e,2),r=t[0],n=t[1];return{conversation:r.toIReceivedConversation(),updatedItems:n}}))}}),Object.defineProperty(r.prototype,"addRelations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;e.forEach((function(e){var n=e.userId,i=e.type,o=e.busChannel,s=cd(i,n,o),a=dd(s),u=r.getOrCreateModel(a,!0),l=function(e,t){var r,n,i,o=e.msg;return{latestMessage:o?Jl(o,t,!1,e.userId):void 0,lastReadTime:e.readMsgTime,unreadCount:e.unreadCount,operationTime:e.versionTime,unreadMentionedCount:e.remindCount,unreadMentionedMeCount:e.remindMeCount,firstUnreadMessageType:null===(r=e.msgInfo)||void 0===r?void 0:r.className,firstUnreadMessageUId:null===(n=e.msgInfo)||void 0===n?void 0:n.msgId,firstUnreadTime:null===(i=e.msgInfo)||void 0===i?void 0:i.msgTime}}(e,t);i===exports.ConversationType.ULTRA_GROUP?u.updateAttrs(l):u.updateAttrs({latestMessage:l.latestMessage,operationTime:l.operationTime,hidden:!1})}))}}),Object.defineProperty(r.prototype,"getDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=cd(e.conversationType,e.targetId,e.channelId);return(null===(t=c(this,gd,"f").get(r))||void 0===t?void 0:t.draft)||""}}),Object.defineProperty(r.prototype,"setDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}}),Object.defineProperty(r.prototype,"deleteDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=cd(e.conversationType,e.targetId,e.channelId),r=c(this,gd,"f").get(t);r&&r.updateAttrs({draft:""})}}),Object.defineProperty(r.prototype,"getCachedUGConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=cd(exports.ConversationType.ULTRA_GROUP,e,t),n=c(this,gd,"f").get(r);return(null==n?void 0:n.toIReceivedConversation())||null}}),Object.defineProperty(r.prototype,"getAllUGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=c(this,gd,"f").values();return Array.from(e).filter((function(e){return e.conversationType===exports.ConversationType.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllSGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=c(this,gd,"f").values();return Array.from(e).filter((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(c(this,gd,"f").values())}}),Object.defineProperty(r.prototype,"getModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=cd(e.conversationType,e.targetId,e.channelId);return c(this,gd,"f").get(t)||null}}),Object.defineProperty(r.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=cd(t,r,n),o=c(this,gd,"f").get(i);o&&(o.remove(),this.updateConversationStorage([o]))}}),Object.defineProperty(r.prototype,"updateConversationCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getOrCreateModel(e,!0);r.updateAttrs(t),this.updateConversationStorage([r])}}),Object.defineProperty(r.prototype,"getAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=0;return this.getAllSGModels().forEach((function(n){var i,o=n.conversationType;e.includes(o)&&(n.notificationLevel>exports.NotificationLevel.NOT_SET&&!t||(r+=null!==(i=n.unreadCount)&&void 0!==i?i:0))})),r}}),Object.defineProperty(r.prototype,"getTagConversationCountMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Map;return this.getAllModels().forEach((function(t){var r=t.tags;r.length>0&&r.forEach((function(r){e.set(r.tagId,(e.get(r.tagId)||[]).concat(t.identifier))}))})),e}}),Object.defineProperty(r.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getModel(e);if(!r)return null;var n=r.clearUnreadCount(t);return this.updateConversationStorage([r]),n?{conversation:r.toIReceivedConversation(),updatedItems:n}:null}}),r}(ld);gd=new WeakMap,hd=new WeakSet,Ed=function(e,t,r,n){Object.keys(e).forEach((function(t){var n=dd(t);ee(n.conversationType,K)?n.targetId||(r[n.conversationType]={nl:e[t].nl||exports.NotificationLevel.NOT_SET},delete e[t]):delete e[t]})),Object.keys(t).forEach((function(e){var i=dd(e);if(i.conversationType===exports.ConversationType.ULTRA_GROUP)return i.targetId?void(n&&!i.channelId&&delete t[e]):(r[i.conversationType]={nl:t[e].nl||exports.NotificationLevel.NOT_SET},void delete t[e]);delete t[e]}))},bd=function(){var e=this,t=Object.entries(this.get("conversationStatus")),r=Object.entries(this.get("ultraGroupStatus"));l(l([],u(t),!1),u(r),!1).forEach((function(t){var r,n,i,o,s,a,l,c,d,p,f,_,h,g,E,b=u(t,2),v=b[0],T=b[1],I=dd(v);ee(I.conversationType,Q)&&e.getOrCreateModel(I,!0).updateAttrs((n=(r=T).c,i=r.mc,o=r.mmc,s=r.hm,a=r.m,l=r.fut,c=r.fuid,d=r.fumt,p=r.nl,f=r.to,_=r.tg,h=r.rt,g=r.h,E=r.ts,{isTop:f,notificationLevel:p,tags:pd(_),unreadCount:n,unreadMentionedCount:i,unreadMentionedMeCount:o,hasMentioned:s,mentionedInfo:a,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:d,lastReadTime:h,hidden:g,translateStrategy:E}),0)}))};function yd(e){let t=e.length;for(;--t>=0;)e[t]=0}const md=256,Rd=286,Sd=30,Ad=15,Od=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]),Cd=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]),Nd=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Pd=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ld=new Array(576);yd(Ld);const Md=new Array(60);yd(Md);const wd=new Array(512);yd(wd);const Ud=new Array(256);yd(Ud);const Dd=new Array(29);yd(Dd);const xd=new Array(Sd);function Gd(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let Vd,kd,Fd;function Bd(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}yd(xd);const Hd=e=>e<256?wd[e]:wd[256+(e>>>7)],qd=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Yd=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,qd(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},Wd=(e,t,r)=>{Yd(e,r[2*t],r[2*t+1])},Kd=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},Jd=(e,t,r)=>{const n=new Array(16);let i,o,s=0;for(i=1;i<=Ad;i++)s=s+r[i-1]<<1,n[i]=s;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=Kd(n[t]++,t))}},Qd=e=>{let t;for(t=0;t<Rd;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Sd;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},Xd=e=>{e.bi_valid>8?qd(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},zd=(e,t,r,n)=>{const i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},Zd=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&zd(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!zd(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},$d=(e,t,r)=>{let n,i,o,s,a=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+a++],n+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],0===n?Wd(e,i,t):(o=Ud[i],Wd(e,o+md+1,t),s=Od[o],0!==s&&(i-=Dd[o],Yd(e,i,s)),n--,o=Hd(n),Wd(e,o,r),s=Cd[o],0!==s&&(n-=xd[o],Yd(e,n,s)))}while(a<e.sym_next);Wd(e,256,t)},ep=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let s,a,u,l=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<o;s++)0!==r[2*s]?(e.heap[++e.heap_len]=l=s,e.depth[s]=0):r[2*s+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,r[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=n[2*u+1]);for(t.max_code=l,s=e.heap_len>>1;s>=1;s--)Zd(e,r,s);u=o;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Zd(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,r[2*u]=r[2*s]+r[2*a],e.depth[u]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,r[2*s+1]=r[2*a+1]=u,e.heap[1]=u++,Zd(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,d,p,f,_,h=0;for(p=0;p<=Ad;p++)e.bl_count[p]=0;for(r[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],p=r[2*r[2*c+1]+1]+1,p>u&&(p=u,h++),r[2*c+1]=p,c>n||(e.bl_count[p]++,f=0,c>=a&&(f=s[c-a]),_=r[2*c],e.opt_len+=_*(p+f),o&&(e.static_len+=_*(i[2*c+1]+f)));if(0!==h){do{for(p=u-1;0===e.bl_count[p];)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[u]--,h-=2}while(h>0);for(p=u;0!==p;p--)for(c=e.bl_count[p];0!==c;)d=e.heap[--l],d>n||(r[2*d+1]!==p&&(e.opt_len+=(p-r[2*d+1])*r[2*d],r[2*d+1]=p),c--)}})(e,t),Jd(r,l,e.bl_count)},tp=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a<u&&i===s||(a<l?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=i,0===s?(u=138,l=3):i===s?(u=6,l=3):(u=7,l=4))},rp=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++a<u&&i===s)){if(a<l)do{Wd(e,i,e.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(Wd(e,i,e.bl_tree),a--),Wd(e,16,e.bl_tree),Yd(e,a-3,2)):a<=10?(Wd(e,17,e.bl_tree),Yd(e,a-3,3)):(Wd(e,18,e.bl_tree),Yd(e,a-11,7));a=0,o=i,0===s?(u=138,l=3):i===s?(u=6,l=3):(u=7,l=4)}};let np=!1;const ip=(e,t,r,n)=>{Yd(e,0+(n?1:0),3),Xd(e),qd(e,r),qd(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};var op=(e,t,r,n)=>{let i,o,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<md;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),ep(e,e.l_desc),ep(e,e.d_desc),s=(e=>{let t;for(tp(e,e.dyn_ltree,e.l_desc.max_code),tp(e,e.dyn_dtree,e.d_desc.max_code),ep(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Pd[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?ip(e,t,r,n):4===e.strategy||o===i?(Yd(e,2+(n?1:0),3),$d(e,Ld,Md)):(Yd(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(Yd(e,t-257,5),Yd(e,r-1,5),Yd(e,n-4,4),i=0;i<n;i++)Yd(e,e.bl_tree[2*Pd[i]+1],3);rp(e,e.dyn_ltree,t-1),rp(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),$d(e,e.dyn_ltree,e.dyn_dtree)),Qd(e),n&&Xd(e)},sp={_tr_init:e=>{np||((()=>{let e,t,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for(Dd[n]=r,e=0;e<1<<Od[n];e++)Ud[r++]=n;for(Ud[r-1]=n,i=0,n=0;n<16;n++)for(xd[n]=i,e=0;e<1<<Cd[n];e++)wd[i++]=n;for(i>>=7;n<Sd;n++)for(xd[n]=i<<7,e=0;e<1<<Cd[n]-7;e++)wd[256+i++]=n;for(t=0;t<=Ad;t++)o[t]=0;for(e=0;e<=143;)Ld[2*e+1]=8,e++,o[8]++;for(;e<=255;)Ld[2*e+1]=9,e++,o[9]++;for(;e<=279;)Ld[2*e+1]=7,e++,o[7]++;for(;e<=287;)Ld[2*e+1]=8,e++,o[8]++;for(Jd(Ld,287,o),e=0;e<Sd;e++)Md[2*e+1]=5,Md[2*e]=Kd(e,5);Vd=new Gd(Ld,Od,257,Rd,Ad),kd=new Gd(Md,Cd,0,Sd,Ad),Fd=new Gd(new Array(0),Nd,0,19,7)})(),np=!0),e.l_desc=new Bd(e.dyn_ltree,Vd),e.d_desc=new Bd(e.dyn_dtree,kd),e.bl_desc=new Bd(e.bl_tree,Fd),e.bi_buf=0,e.bi_valid=0,Qd(e)},_tr_stored_block:ip,_tr_flush_block:op,_tr_tally:(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(Ud[r]+md+1)]++,e.dyn_dtree[2*Hd(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Yd(e,2,3),Wd(e,256,Ld),(e=>{16===e.bi_valid?(qd(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 ap=(e,t,r,n)=>{let i=65535&e,o=e>>>16&65535,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{i=i+t[n++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16};const up=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var lp=(e,t,r,n)=>{const i=up,o=n+r;e^=-1;for(let r=n;r<o;r++)e=e>>>8^i[255&(e^t[r])];return~e},cp={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"},dp={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:pp,_tr_stored_block:fp,_tr_flush_block:_p,_tr_tally:hp,_tr_align:gp}=sp,{Z_NO_FLUSH:Ep,Z_PARTIAL_FLUSH:bp,Z_FULL_FLUSH:vp,Z_FINISH:Tp,Z_BLOCK:Ip,Z_OK:yp,Z_STREAM_END:mp,Z_STREAM_ERROR:Rp,Z_DATA_ERROR:Sp,Z_BUF_ERROR:Ap,Z_DEFAULT_COMPRESSION:Op,Z_FILTERED:Cp,Z_HUFFMAN_ONLY:Np,Z_RLE:Pp,Z_FIXED:Lp,Z_DEFAULT_STRATEGY:Mp,Z_UNKNOWN:wp,Z_DEFLATED:Up}=dp,Dp=258,xp=262,Gp=42,Vp=113,jp=666,kp=(e,t)=>(e.msg=cp[t],t),Fp=e=>2*e-(e>4?9:0),Bp=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Hp=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do{r=e.head[--n],e.head[n]=r>=i?r-i:0}while(--t);t=i,n=t;do{r=e.prev[--n],e.prev[n]=r>=i?r-i:0}while(--t)};let qp=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const Yp=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},Wp=(e,t)=>{_p(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Yp(e.strm)},Kp=(e,t)=>{e.pending_buf[e.pending++]=t},Jp=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Qp=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=ap(e.adler,t,i,r):2===e.state.wrap&&(e.adler=lp(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},Xp=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match;const u=e.strstart>e.w_size-xp?e.strstart-(e.w_size-xp):0,l=e.window,c=e.w_mask,d=e.prev,p=e.strstart+Dp;let f=l[o+s-1],_=l[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(r=t,l[r+s]===_&&l[r+s-1]===f&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&o<p);if(n=Dp-(p-o),o=p-Dp,n>s){if(e.match_start=t,s=n,n>=a)break;f=l[o+s-1],_=l[o+s]}}}while((t=d[t&c])>u&&0!=--i);return s<=e.lookahead?s:e.lookahead},zp=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-xp)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Hp(e),n+=t),0===e.strm.avail_in)break;if(r=Qp(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=qp(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=qp(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<xp&&0!==e.strm.avail_in)},Zp=(e,t)=>{let r,n,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;do{if(r=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>i&&(r=i),r<o&&(0===r&&t!==Tp||t===Ep||r!==n+e.strm.avail_in))break;s=t===Tp&&r===n+e.strm.avail_in?1:0,fp(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Yp(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(Qp(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===s);return a-=e.strm.avail_in,a&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==Ep&&t!==Tp&&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&&(Qp(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,o=i>e.w_size?e.w_size:i,n=e.strstart-e.block_start,(n>=o||(n||t===Tp)&&t!==Ep&&0===e.strm.avail_in&&n<=i)&&(r=n>i?i:n,s=t===Tp&&0===e.strm.avail_in&&r===n?1:0,fp(e,e.block_start,r,s),e.block_start+=r,Yp(e.strm)),s?3:1)},$p=(e,t)=>{let r,n;for(;;){if(e.lookahead<xp){if(zp(e),e.lookahead<xp&&t===Ep)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=qp(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-xp&&(e.match_length=Xp(e,r)),e.match_length>=3)if(n=hp(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=qp(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=qp(e,e.ins_h,e.window[e.strstart+1]);else n=hp(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Wp(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Tp?(Wp(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Wp(e,!1),0===e.strm.avail_out)?1:2},ef=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<xp){if(zp(e),e.lookahead<xp&&t===Ep)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=qp(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-xp&&(e.match_length=Xp(e,r),e.match_length<=5&&(e.strategy===Cp||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=hp(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=qp(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(Wp(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=hp(e,0,e.window[e.strstart-1]),n&&Wp(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=hp(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Tp?(Wp(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Wp(e,!1),0===e.strm.avail_out)?1:2};function tf(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const rf=[new tf(0,0,0,0,Zp),new tf(4,4,8,4,$p),new tf(4,5,16,8,$p),new tf(4,6,32,32,$p),new tf(4,4,16,16,ef),new tf(8,16,32,32,ef),new tf(8,16,128,128,ef),new tf(8,32,128,256,ef),new tf(32,128,258,1024,ef),new tf(32,258,258,4096,ef)];function nf(){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=Up,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),Bp(this.dyn_ltree),Bp(this.dyn_dtree),Bp(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),Bp(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bp(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 of=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Gp&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Vp&&t.status!==jp?1:0},sf=e=>{if(of(e))return kp(e,Rp);e.total_in=e.total_out=0,e.data_type=wp;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?Gp:Vp,e.adler=2===t.wrap?0:1,t.last_flush=-2,pp(t),yp},af=e=>{const t=sf(e);var r;return t===yp&&((r=e.state).window_size=2*r.w_size,Bp(r.head),r.max_lazy_match=rf[r.level].max_lazy,r.good_match=rf[r.level].good_length,r.nice_match=rf[r.level].nice_length,r.max_chain_length=rf[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},uf=(e,t,r,n,i,o)=>{if(!e)return Rp;let s=1;if(t===Op&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==Up||n<8||n>15||t<0||t>9||o<0||o>Lp||8===n&&1!==s)return kp(e,Rp);8===n&&(n=9);const a=new nf;return e.state=a,a.strm=e,a.status=Gp,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=o,a.method=r,af(e)};var lf={deflateInit:(e,t)=>uf(e,t,Up,15,8,Mp),deflateInit2:uf,deflateReset:af,deflateResetKeep:sf,deflateSetHeader:(e,t)=>of(e)||2!==e.state.wrap?Rp:(e.state.gzhead=t,yp),deflate:(e,t)=>{if(of(e)||t>Ip||t<0)return e?kp(e,Rp):Rp;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===jp&&t!==Tp)return kp(e,0===e.avail_out?Ap:Rp);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(Yp(e),0===e.avail_out)return r.last_flush=-1,yp}else if(0===e.avail_in&&Fp(t)<=Fp(n)&&t!==Tp)return kp(e,Ap);if(r.status===jp&&0!==e.avail_in)return kp(e,Ap);if(r.status===Gp&&0===r.wrap&&(r.status=Vp),r.status===Gp){let t=Up+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=Np||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=n<<6,0!==r.strstart&&(t|=32),t+=31-t%31,Jp(r,t),0!==r.strstart&&(Jp(r,e.adler>>>16),Jp(r,65535&e.adler)),e.adler=1,r.status=Vp,Yp(e),0!==r.pending)return r.last_flush=-1,yp}if(57===r.status)if(e.adler=0,Kp(r,31),Kp(r,139),Kp(r,8),r.gzhead)Kp(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Kp(r,255&r.gzhead.time),Kp(r,r.gzhead.time>>8&255),Kp(r,r.gzhead.time>>16&255),Kp(r,r.gzhead.time>>24&255),Kp(r,9===r.level?2:r.strategy>=Np||r.level<2?4:0),Kp(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Kp(r,255&r.gzhead.extra.length),Kp(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=lp(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(Kp(r,0),Kp(r,0),Kp(r,0),Kp(r,0),Kp(r,0),Kp(r,9===r.level?2:r.strategy>=Np||r.level<2?4:0),Kp(r,3),r.status=Vp,Yp(e),0!==r.pending)return r.last_flush=-1,yp;if(69===r.status){if(r.gzhead.extra){let t=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=lp(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,Yp(e),0!==r.pending)return r.last_flush=-1,yp;t=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>t&&(e.adler=lp(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=lp(e.adler,r.pending_buf,r.pending-n,n)),Yp(e),0!==r.pending)return r.last_flush=-1,yp;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Kp(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=lp(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=lp(e.adler,r.pending_buf,r.pending-n,n)),Yp(e),0!==r.pending)return r.last_flush=-1,yp;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Kp(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=lp(e.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Yp(e),0!==r.pending))return r.last_flush=-1,yp;Kp(r,255&e.adler),Kp(r,e.adler>>8&255),e.adler=0}if(r.status=Vp,Yp(e),0!==r.pending)return r.last_flush=-1,yp}if(0!==e.avail_in||0!==r.lookahead||t!==Ep&&r.status!==jp){let n=0===r.level?Zp(r,t):r.strategy===Np?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(zp(e),0===e.lookahead)){if(t===Ep)return 1;break}if(e.match_length=0,r=hp(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Wp(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Tp?(Wp(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Wp(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===Pp?((e,t)=>{let r,n,i,o;const s=e.window;for(;;){if(e.lookahead<=Dp){if(zp(e),e.lookahead<=Dp&&t===Ep)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){o=e.strstart+Dp;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);e.match_length=Dp-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=hp(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=hp(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Wp(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Tp?(Wp(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Wp(e,!1),0===e.strm.avail_out)?1:2})(r,t):rf[r.level].func(r,t);if(3!==n&&4!==n||(r.status=jp),1===n||3===n)return 0===e.avail_out&&(r.last_flush=-1),yp;if(2===n&&(t===bp?gp(r):t!==Ip&&(fp(r,0,0,!1),t===vp&&(Bp(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Yp(e),0===e.avail_out))return r.last_flush=-1,yp}return t!==Tp?yp:r.wrap<=0?mp:(2===r.wrap?(Kp(r,255&e.adler),Kp(r,e.adler>>8&255),Kp(r,e.adler>>16&255),Kp(r,e.adler>>24&255),Kp(r,255&e.total_in),Kp(r,e.total_in>>8&255),Kp(r,e.total_in>>16&255),Kp(r,e.total_in>>24&255)):(Jp(r,e.adler>>>16),Jp(r,65535&e.adler)),Yp(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?yp:mp)},deflateEnd:e=>{if(of(e))return Rp;const t=e.state.status;return e.state=null,t===Vp?kp(e,Sp):yp},deflateSetDictionary:(e,t)=>{let r=t.length;if(of(e))return Rp;const n=e.state,i=n.wrap;if(2===i||1===i&&n.status!==Gp||n.lookahead)return Rp;if(1===i&&(e.adler=ap(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(Bp(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const o=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,zp(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=qp(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,zp(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=s,e.input=a,e.avail_in=o,n.wrap=i,yp},deflateInfo:"pako deflate (from Nodeca project)"};const cf=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var df={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)cf(r,t)&&(e[t]=r[t])}}return e},flattenChunks:e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=i.length}return r}};let pf=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){pf=!1}const ff=new Uint8Array(256);for(let e=0;e<256;e++)ff[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ff[254]=ff[254]=1;var _f={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,s=e.length,a=0;for(i=0;i<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(a),o=0,i=0;o<a;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},buf2string:(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){o[i++]=t;continue}let s=ff[t];if(s>4)o[i++]=65533,n+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&n<r;)t=t<<6|63&e[n++],s--;s>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&pf)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(o,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+ff[e[r]]>t?r:t}};var hf=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 gf=Object.prototype.toString,{Z_NO_FLUSH:Ef,Z_SYNC_FLUSH:bf,Z_FULL_FLUSH:vf,Z_FINISH:Tf,Z_OK:If,Z_STREAM_END:yf,Z_DEFAULT_COMPRESSION:mf,Z_DEFAULT_STRATEGY:Rf,Z_DEFLATED:Sf}=dp;function Af(e){this.options=df.assign({level:mf,method:Sf,chunkSize:16384,windowBits:15,memLevel:8,strategy:Rf},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 hf,this.strm.avail_out=0;let r=lf.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==If)throw new Error(cp[r]);if(t.header&&lf.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?_f.string2buf(t.dictionary):"[object ArrayBuffer]"===gf.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=lf.deflateSetDictionary(this.strm,e),r!==If)throw new Error(cp[r]);this._dict_set=!0}}Af.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Tf:Ef,"string"==typeof e?r.input=_f.string2buf(e):"[object ArrayBuffer]"===gf.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===bf||o===vf)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=lf.deflate(r,o),i===yf)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=lf.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===If;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Af.prototype.onData=function(e){this.chunks.push(e)},Af.prototype.onEnd=function(e){e===If&&(this.result=df.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Of=16209;var Cf=function(e,t){let r,n,i,o,s,a,u,l,c,d,p,f,_,h,g,E,b,v,T,I,y,m,R,S;const A=e.state;r=e.next_in,R=e.input,n=r+(e.avail_in-5),i=e.next_out,S=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),a=A.dmax,u=A.wsize,l=A.whave,c=A.wnext,d=A.window,p=A.hold,f=A.bits,_=A.lencode,h=A.distcode,g=(1<<A.lenbits)-1,E=(1<<A.distbits)-1;e:do{f<15&&(p+=R[r++]<<f,f+=8,p+=R[r++]<<f,f+=8),b=_[p&g];t:for(;;){if(v=b>>>24,p>>>=v,f-=v,v=b>>>16&255,0===v)S[i++]=65535&b;else{if(!(16&v)){if(64&v){if(32&v){A.mode=16191;break e}e.msg="invalid literal/length code",A.mode=Of;break e}b=_[(65535&b)+(p&(1<<v)-1)];continue t}for(T=65535&b,v&=15,v&&(f<v&&(p+=R[r++]<<f,f+=8),T+=p&(1<<v)-1,p>>>=v,f-=v),f<15&&(p+=R[r++]<<f,f+=8,p+=R[r++]<<f,f+=8),b=h[p&E];;){if(v=b>>>24,p>>>=v,f-=v,v=b>>>16&255,16&v){if(I=65535&b,v&=15,f<v&&(p+=R[r++]<<f,f+=8,f<v&&(p+=R[r++]<<f,f+=8)),I+=p&(1<<v)-1,I>a){e.msg="invalid distance too far back",A.mode=Of;break e}if(p>>>=v,f-=v,v=i-o,I>v){if(v=I-v,v>l&&A.sane){e.msg="invalid distance too far back",A.mode=Of;break e}if(y=0,m=d,0===c){if(y+=u-v,v<T){T-=v;do{S[i++]=d[y++]}while(--v);y=i-I,m=S}}else if(c<v){if(y+=u+c-v,v-=c,v<T){T-=v;do{S[i++]=d[y++]}while(--v);if(y=0,c<T){v=c,T-=v;do{S[i++]=d[y++]}while(--v);y=i-I,m=S}}}else if(y+=c-v,v<T){T-=v;do{S[i++]=d[y++]}while(--v);y=i-I,m=S}for(;T>2;)S[i++]=m[y++],S[i++]=m[y++],S[i++]=m[y++],T-=3;T&&(S[i++]=m[y++],T>1&&(S[i++]=m[y++]))}else{y=i-I;do{S[i++]=S[y++],S[i++]=S[y++],S[i++]=S[y++],T-=3}while(T>2);T&&(S[i++]=S[y++],T>1&&(S[i++]=S[y++]))}break}if(64&v){e.msg="invalid distance code",A.mode=Of;break e}b=h[(65535&b)+(p&(1<<v)-1)]}}break}}while(r<n&&i<s);T=f>>3,r-=T,f-=T<<3,p&=(1<<f)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<s?s-i+257:257-(i-s),A.hold=p,A.bits=f};const Nf=15,Pf=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]),Lf=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]),Mf=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]),wf=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 Uf=(e,t,r,n,i,o,s,a)=>{const u=a.bits;let l,c,d,p,f,_,h=0,g=0,E=0,b=0,v=0,T=0,I=0,y=0,m=0,R=0,S=null;const A=new Uint16Array(16),O=new Uint16Array(16);let C,N,P,L=null;for(h=0;h<=Nf;h++)A[h]=0;for(g=0;g<n;g++)A[t[r+g]]++;for(v=u,b=Nf;b>=1&&0===A[b];b--);if(v>b&&(v=b),0===b)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(E=1;E<b&&0===A[E];E++);for(v<E&&(v=E),y=1,h=1;h<=Nf;h++)if(y<<=1,y-=A[h],y<0)return-1;if(y>0&&(0===e||1!==b))return-1;for(O[1]=0,h=1;h<Nf;h++)O[h+1]=O[h]+A[h];for(g=0;g<n;g++)0!==t[r+g]&&(s[O[t[r+g]]++]=g);if(0===e?(S=L=s,_=20):1===e?(S=Pf,L=Lf,_=257):(S=Mf,L=wf,_=0),R=0,g=0,h=E,f=o,T=v,I=0,d=-1,m=1<<v,p=m-1,1===e&&m>852||2===e&&m>592)return 1;for(;;){C=h-I,s[g]+1<_?(N=0,P=s[g]):s[g]>=_?(N=L[s[g]-_],P=S[s[g]-_]):(N=96,P=0),l=1<<h-I,c=1<<T,E=c;do{c-=l,i[f+(R>>I)+c]=C<<24|N<<16|P}while(0!==c);for(l=1<<h-1;R&l;)l>>=1;if(0!==l?(R&=l-1,R+=l):R=0,g++,0==--A[h]){if(h===b)break;h=t[r+s[g]]}if(h>v&&(R&p)!==d){for(0===I&&(I=v),f+=E,T=h-I,y=1<<T;T+I<b&&(y-=A[T+I],!(y<=0));)T++,y<<=1;if(m+=1<<T,1===e&&m>852||2===e&&m>592)return 1;d=R&p,i[d]=v<<24|T<<16|f-o}}return 0!==R&&(i[f+R]=h-I<<24|64<<16),a.bits=v,0};const{Z_FINISH:Df,Z_BLOCK:xf,Z_TREES:Gf,Z_OK:Vf,Z_STREAM_END:jf,Z_NEED_DICT:kf,Z_STREAM_ERROR:Ff,Z_DATA_ERROR:Bf,Z_MEM_ERROR:Hf,Z_BUF_ERROR:qf,Z_DEFLATED:Yf}=dp,Wf=16180,Kf=16190,Jf=16191,Qf=16192,Xf=16194,zf=16199,Zf=16200,$f=16206,e_=16209,t_=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function r_(){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 n_=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Wf||t.mode>16211?1:0},i_=e=>{if(n_(e))return Ff;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=Wf,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,Vf},o_=e=>{if(n_(e))return Ff;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,i_(e)},s_=(e,t)=>{let r;if(n_(e))return Ff;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Ff:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,o_(e))},a_=(e,t)=>{if(!e)return Ff;const r=new r_;e.state=r,r.strm=e,r.window=null,r.mode=Wf;const n=s_(e,t);return n!==Vf&&(e.state=null),n};let u_,l_,c_=!0;const d_=e=>{if(c_){u_=new Int32Array(512),l_=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(Uf(1,e.lens,0,288,u_,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Uf(2,e.lens,0,32,l_,0,e.work,{bits:5}),c_=!1}e.lencode=u_,e.lenbits=9,e.distcode=l_,e.distbits=5},p_=(e,t,r,n)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(t.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var f_={inflateReset:o_,inflateReset2:s_,inflateResetKeep:i_,inflateInit:e=>a_(e,15),inflateInit2:a_,inflate:(e,t)=>{let r,n,i,o,s,a,u,l,c,d,p,f,_,h,g,E,b,v,T,I,y,m,R=0;const S=new Uint8Array(4);let A,O;const C=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(n_(e)||!e.output||!e.input&&0!==e.avail_in)return Ff;r=e.state,r.mode===Jf&&(r.mode=Qf),s=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,l=r.hold,c=r.bits,d=a,p=u,m=Vf;e:for(;;)switch(r.mode){case Wf:if(0===r.wrap){r.mode=Qf;break}for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(2&r.wrap&&35615===l){0===r.wbits&&(r.wbits=15),r.check=0,S[0]=255&l,S[1]=l>>>8&255,r.check=lp(r.check,S,2,0),l=0,c=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=e_;break}if((15&l)!==Yf){e.msg="unknown compression method",r.mode=e_;break}if(l>>>=4,c-=4,y=8+(15&l),0===r.wbits&&(r.wbits=y),y>15||y>r.wbits){e.msg="invalid window size",r.mode=e_;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&l?16189:Jf,l=0,c=0;break;case 16181:for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(r.flags=l,(255&r.flags)!==Yf){e.msg="unknown compression method",r.mode=e_;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=e_;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&4&r.wrap&&(S[0]=255&l,S[1]=l>>>8&255,r.check=lp(r.check,S,2,0)),l=0,c=0,r.mode=16182;case 16182:for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.head&&(r.head.time=l),512&r.flags&&4&r.wrap&&(S[0]=255&l,S[1]=l>>>8&255,S[2]=l>>>16&255,S[3]=l>>>24&255,r.check=lp(r.check,S,4,0)),l=0,c=0,r.mode=16183;case 16183:for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&4&r.wrap&&(S[0]=255&l,S[1]=l>>>8&255,r.check=lp(r.check,S,2,0)),l=0,c=0,r.mode=16184;case 16184:if(1024&r.flags){for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&4&r.wrap&&(S[0]=255&l,S[1]=l>>>8&255,r.check=lp(r.check,S,2,0)),l=0,c=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(f=r.length,f>a&&(f=a),f&&(r.head&&(y=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+f),y)),512&r.flags&&4&r.wrap&&(r.check=lp(r.check,n,f,o)),a-=f,o+=f,r.length-=f),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===a)break e;f=0;do{y=n[o+f++],r.head&&y&&r.length<65536&&(r.head.name+=String.fromCharCode(y))}while(y&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=lp(r.check,n,f,o)),a-=f,o+=f,y)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===a)break e;f=0;do{y=n[o+f++],r.head&&y&&r.length<65536&&(r.head.comment+=String.fromCharCode(y))}while(y&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=lp(r.check,n,f,o)),a-=f,o+=f,y)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=e_;break}l=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Jf;break;case 16189:for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}e.adler=r.check=t_(l),l=0,c=0,r.mode=Kf;case Kf:if(0===r.havedict)return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,kf;e.adler=r.check=1,r.mode=Jf;case Jf:if(t===xf||t===Gf)break e;case Qf:if(r.last){l>>>=7&c,c-=7&c,r.mode=$f;break}for(;c<3;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}switch(r.last=1&l,l>>>=1,c-=1,3&l){case 0:r.mode=16193;break;case 1:if(d_(r),r.mode=zf,t===Gf){l>>>=2,c-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=e_}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=e_;break}if(r.length=65535&l,l=0,c=0,r.mode=Xf,t===Gf)break e;case Xf:r.mode=16195;case 16195:if(f=r.length,f){if(f>a&&(f=a),f>u&&(f=u),0===f)break e;i.set(n.subarray(o,o+f),s),a-=f,o+=f,u-=f,s+=f,r.length-=f;break}r.mode=Jf;break;case 16196:for(;c<14;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(r.nlen=257+(31&l),l>>>=5,c-=5,r.ndist=1+(31&l),l>>>=5,c-=5,r.ncode=4+(15&l),l>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=e_;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;c<3;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.lens[C[r.have++]]=7&l,l>>>=3,c-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,A={bits:r.lenbits},m=Uf(0,r.lens,0,19,r.lencode,0,r.work,A),r.lenbits=A.bits,m){e.msg="invalid code lengths set",r.mode=e_;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;R=r.lencode[l&(1<<r.lenbits)-1],g=R>>>24,E=R>>>16&255,b=65535&R,!(g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(b<16)l>>>=g,c-=g,r.lens[r.have++]=b;else{if(16===b){for(O=g+2;c<O;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(l>>>=g,c-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=e_;break}y=r.lens[r.have-1],f=3+(3&l),l>>>=2,c-=2}else if(17===b){for(O=g+3;c<O;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=g,c-=g,y=0,f=3+(7&l),l>>>=3,c-=3}else{for(O=g+7;c<O;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=g,c-=g,y=0,f=11+(127&l),l>>>=7,c-=7}if(r.have+f>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=e_;break}for(;f--;)r.lens[r.have++]=y}}if(r.mode===e_)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=e_;break}if(r.lenbits=9,A={bits:r.lenbits},m=Uf(1,r.lens,0,r.nlen,r.lencode,0,r.work,A),r.lenbits=A.bits,m){e.msg="invalid literal/lengths set",r.mode=e_;break}if(r.distbits=6,r.distcode=r.distdyn,A={bits:r.distbits},m=Uf(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,A),r.distbits=A.bits,m){e.msg="invalid distances set",r.mode=e_;break}if(r.mode=zf,t===Gf)break e;case zf:r.mode=Zf;case Zf:if(a>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,Cf(e,p),s=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,l=r.hold,c=r.bits,r.mode===Jf&&(r.back=-1);break}for(r.back=0;R=r.lencode[l&(1<<r.lenbits)-1],g=R>>>24,E=R>>>16&255,b=65535&R,!(g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(E&&!(240&E)){for(v=g,T=E,I=b;R=r.lencode[I+((l&(1<<v+T)-1)>>v)],g=R>>>24,E=R>>>16&255,b=65535&R,!(v+g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=v,c-=v,r.back+=v}if(l>>>=g,c-=g,r.back+=g,r.length=b,0===E){r.mode=16205;break}if(32&E){r.back=-1,r.mode=Jf;break}if(64&E){e.msg="invalid literal/length code",r.mode=e_;break}r.extra=15&E,r.mode=16201;case 16201:if(r.extra){for(O=r.extra;c<O;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;R=r.distcode[l&(1<<r.distbits)-1],g=R>>>24,E=R>>>16&255,b=65535&R,!(g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(!(240&E)){for(v=g,T=E,I=b;R=r.distcode[I+((l&(1<<v+T)-1)>>v)],g=R>>>24,E=R>>>16&255,b=65535&R,!(v+g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=v,c-=v,r.back+=v}if(l>>>=g,c-=g,r.back+=g,64&E){e.msg="invalid distance code",r.mode=e_;break}r.offset=b,r.extra=15&E,r.mode=16203;case 16203:if(r.extra){for(O=r.extra;c<O;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=e_;break}r.mode=16204;case 16204:if(0===u)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=e_;break}f>r.wnext?(f-=r.wnext,_=r.wsize-f):_=r.wnext-f,f>r.length&&(f=r.length),h=r.window}else h=i,_=s-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do{i[s++]=h[_++]}while(--f);0===r.length&&(r.mode=Zf);break;case 16205:if(0===u)break e;i[s++]=r.length,u--,r.mode=Zf;break;case $f:if(r.wrap){for(;c<32;){if(0===a)break e;a--,l|=n[o++]<<c,c+=8}if(p-=u,e.total_out+=p,r.total+=p,4&r.wrap&&p&&(e.adler=r.check=r.flags?lp(r.check,i,p,s-p):ap(r.check,i,p,s-p)),p=u,4&r.wrap&&(r.flags?l:t_(l))!==r.check){e.msg="incorrect data check",r.mode=e_;break}l=0,c=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=e_;break}l=0,c=0}r.mode=16208;case 16208:m=jf;break e;case e_:m=Bf;break e;case 16210:return Hf;default:return Ff}return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,(r.wsize||p!==e.avail_out&&r.mode<e_&&(r.mode<$f||t!==Df))&&p_(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,r.total+=p,4&r.wrap&&p&&(e.adler=r.check=r.flags?lp(r.check,i,p,e.next_out-p):ap(r.check,i,p,e.next_out-p)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Jf?128:0)+(r.mode===zf||r.mode===Xf?256:0),(0===d&&0===p||t===Df)&&m===Vf&&(m=qf),m},inflateEnd:e=>{if(n_(e))return Ff;let t=e.state;return t.window&&(t.window=null),e.state=null,Vf},inflateGetHeader:(e,t)=>{if(n_(e))return Ff;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,Vf):Ff},inflateSetDictionary:(e,t)=>{const r=t.length;let n,i,o;return n_(e)?Ff:(n=e.state,0!==n.wrap&&n.mode!==Kf?Ff:n.mode===Kf&&(i=1,i=ap(i,t,r,0),i!==n.check)?Bf:(o=p_(e,t,r,r),o?(n.mode=16210,Hf):(n.havedict=1,Vf)))},inflateInfo:"pako inflate (from Nodeca project)"};var __=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 h_=Object.prototype.toString,{Z_NO_FLUSH:g_,Z_FINISH:E_,Z_OK:b_,Z_STREAM_END:v_,Z_NEED_DICT:T_,Z_STREAM_ERROR:I_,Z_DATA_ERROR:y_,Z_MEM_ERROR:m_}=dp;function R_(e){this.options=df.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 hf,this.strm.avail_out=0;let r=f_.inflateInit2(this.strm,t.windowBits);if(r!==b_)throw new Error(cp[r]);if(this.header=new __,f_.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=_f.string2buf(t.dictionary):"[object ArrayBuffer]"===h_.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=f_.inflateSetDictionary(this.strm,t.dictionary),r!==b_)))throw new Error(cp[r])}function S_(e,t){const r=new R_(t);if(r.push(e),r.err)throw r.msg||cp[r.err];return r.result}R_.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(s=t===~~t?t:!0===t?E_:g_,"[object ArrayBuffer]"===h_.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=f_.inflate(r,s),o===T_&&i&&(o=f_.inflateSetDictionary(r,i),o===b_?o=f_.inflate(r,s):o===y_&&(o=T_));r.avail_in>0&&o===v_&&r.state.wrap>0&&0!==e[r.next_in];)f_.inflateReset(r),o=f_.inflate(r,s);switch(o){case I_:case y_:case T_:case m_:return this.onEnd(o),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||o===v_))if("string"===this.options.to){let e=_f.utf8border(r.output,r.next_out),t=r.next_out-e,i=_f.buf2string(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==b_||0!==a){if(o===v_)return o=f_.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},R_.prototype.onData=function(e){this.chunks.push(e)},R_.prototype.onEnd=function(e){e===b_&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=df.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var A_={Inflate:R_,inflate:S_,inflateRaw:function(e,t){return(t=t||{}).raw=!0,S_(e,t)},ungzip:S_,constants:dp};const{Inflate:O_,inflate:C_,inflateRaw:N_,ungzip:P_}=A_;var L_=P_;function M_(e){return Object.keys(e).map((function(t){var r=e[t];return"string"!=typeof r&&(r="".concat(r)),{key:t,value:r}}))}function w_(e,t,r,n){return Ku.encode($a,{targetId:e,type:exports.ConversationType.GROUP,users:n,extProfile:r?M_(r):void 0,settingProfile:M_(t)})}var U_,D_,x_,G_,V_,j_,k_,F_,B_,H_=function(e,t){return Ku.encode(ws,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},q_=function(e){var t=Ku.decode(ys,e),r=t.compressioEnabled,n=t.compressedData,i=t.info,o=t.pullTime,s=t.isFinished;if(r){var a=L_(n);return q_(a)}return{info:i,pullTime:o,isFinished:s}},Y_=function(e){var t=Ku.decode(ds,e);if(t.compressioEnabled){var r=L_(t.compressedData);return Y_(r)}return t},W_=function(e){var t=Ku.decode(ps,e);if(t.compressioEnabled){var r=L_(t.compressedData);return W_(r)}return{syncTime:t.syncTime,list:t.list.map((function(e){return Ku.decode(fs,new Uint8Array(e))}))}},K_=function(e){return Ku.encode(sa,n(n({},e),{compress:_c.enable()}))},J_=function(e){var t=Ku.decode(ua,e);if(t.compress){var r=L_(t.compressData);return J_(r)}return t},Q_=function(e){var t=Ku.decode(la,e);if(t.compress){var r=L_(t.compressData);return Q_(r)}return t},X_=function(e){return Ku.encode(Ns,n(n({},e),{compressioEnabled:_c.enable()}))},z_=function(e){var t=Ku.decode(Ps,e);if(t.compressioEnabled){var r=L_(t.compressedData);return z_(r)}return t},Z_=function(e,t){return Ku.encode(zs,{ignoreVersion:!0,version:e,state:t})},$_=function(e){var t=Ku.decode(xu,e);if(t.compress){var r=L_(t.compressedData);return $_(r)}return t},eh=function(e){return Ku.encode(qs,{timestamp:e,compressioEnabled:_c.enable()})},th=function(e){var t=Ku.decode(Bs,e);if(t.compressioEnabled){var r=L_(t.compressedData);return th(r)}return t},rh=function(e){function r(t,r){var n=e.call(this,"WebSGModule")||this;return U_.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),n._ctx.on("sNtf",c(n,U_,"m",G_),n),n._ctx.on("sMsg",c(n,U_,"m",x_),n),n._ctx.on("syncMsg",c(n,U_,"m",D_),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d,p,f,_,h,g,E,b,v,T;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx,r=t.logger,n=t.currentUserId,i=t.connectedTime,o=this._storage.get("inboxTime"),a=this._storage.get("outboxTime"),u=this._storage.get("broadcastTime"),l=r.createTraceId(),r.info(H.L_PULL_MSG_T,JSON.stringify({inboxTime:o,outboxTime:a,broadcastTime:u}),l),c=Ku.encode(us,{ispolling:!1,isPullSend:!0,syncTime:o,sendBoxSyncTime:a,broadcastSyncTime:u,compressioEnabled:_c.enable()}),[4,this._ctx.query(An.pullMsg,this._ctx.currentUserId,c)];case 1:return(d=s.sent()).isOk?(p=Y_(d.data.pbData),_=(f=p).list,h=f.finished,g=f.syncTime,E=f.broadcastSyncTime,b=a,v=_.map((function(e){var t=Jl(e,n,e.dataTime<i);return t.messageDirection===exports.MessageDirection.SEND&&(b=Math.max(b,t.sentTime)),t})),this._storage.set("inboxTime",g),this._storage.set("broadcastTime",E||1),this._storage.set("outboxTime",b),r.info(H.L_PULL_MSG_R,JSON.stringify({code:0,inboxTime:g,broadcastTime:E,outboxTime:b,msgCount:v.length,hasNext:!!h}),l),T=Math.max(g,E||1,b),this._ctx.emit("messagesFromSG",v,!!h,e),[2,sr({version:T,hasNext:!h})]):(r.warn(H.L_PULL_MSG_R,JSON.stringify({code:d.code}),l),[2,d.wipe()])}}))}))}}),r}(nr);U_=new WeakSet,D_=function(e,t,r){var n=t.conversationType,i=t.sentTime;n!==exports.ConversationType.ULTRA_GROUP&&n!==exports.ConversationType.CHATROOM&&(n===exports.ConversationType.RTC_ROOM||Sc(r)||(e.stopPropagation(),this.push(i)))},x_=function(e,t){var r=t.conversationType,n=t.sentTime,i=t.isStatusMessage;r!==exports.ConversationType.CHATROOM&&(e.stopPropagation(),i||r===exports.ConversationType.RTC_ROOM?this._ctx.emit("smsgFromSignalGroup",t):this.push(n))},G_=function(e,t){1===t.type&&(e.stopPropagation(),this.push(t.time))};var nh,ih,oh=function(e){function r(t){var r=e.call(this,"WebUGModule")||this;return V_.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r._ctx.on("syncMsg",c(r,V_,"m",k_),r),r._ctx.on("sCmd",c(r,V_,"m",j_),r),r}return t(r,e),Object.defineProperty(r.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,V_,"m",B_).call(this,0)];case 1:return(e=s.sent()).isOk?(this._ctx.logger.info(H.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,c(this,V_,"m",F_).call(this,0,[])]):(this._ctx.logger.warn(H.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(r=s.sent()).isOk?(n=r.data,i=n.length>0?n[n.length-1].versionTime:0,o=Math.max(t,i),[2,sr({relations:n,msgVersion:o})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){switch(r.label){case 0:return[4,c(this,V_,"m",B_).call(this,e)];case 1:return[2,r.sent().trans((function(e){var r=e,n=r.syncTime,i=r.finished,o=r.list;if(null==o?void 0:o.length){var s=t._ctx.currentUserId,a=o.map((function(e){return Jl(e,s,!1)}));t._ctx.emit("messagesFromUG",a,n)}return{version:n,hasNext:!i}}))]}}))}))}}),r}(nr);V_=new WeakSet,j_=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},k_=function(e,t){t.conversationType===exports.ConversationType.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},F_=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,d,p,f,_,h;return s(this,(function(s){switch(s.label){case 0:return n=this._ctx,i=n.logger,o=i.createTraceId(),i.info(H.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),o),a=Ku.encode(ha,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query(An.pullUgSes,this._ctx.currentUserId,a,void 0)];case 1:return d=s.sent(),i.summary(H.L_PULL_UG_RELATIONS_R,d,o,{ver:t}),d.isOk?(p=q_(d.data.pbData),f=p.info,_=p.isFinished,r.push.apply(r,l([],u(f),!1)),_?[2,sr(r)]:(h=f[f.length-1].versionTime,[2,c(this,V_,"m",e).call(this,h,r)])):[2,d.wipe()]}}))}))},B_=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=n.createTraceId(),n.info(H.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=Ku.encode(ga,{syncTime:l,compressioEnabled:_c.enable()}),[4,this._ctx.query(An.pullUgMsg,r,o)];case 1:return a=s.sent(),n.summary(H.L_PULL_ULTRA_MSG_R,a,i,{version:e}),a.isOk?(u=a.data,[2,sr(Y_(u.pbData))]):[2,a.wipe()]}var l}))}))};var sh,ah,uh,lh=13,ch=36,dh=41,ph=function(e){function r(t,r){var n=e.call(this,"WebServerEventHandler")||this;return nh.add(n),Object.defineProperty(n,"_con",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,l,d=this;return s(this,(function(s){switch(s.label){case 0:return t=this._logger.createTraceId(),this._logger.info(H.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,c(this,nh,"m",ih).call(this,e)];case 1:return r=s.sent(),this._logger.summary(H.L_PULL_EVENT_CHANGE_R,r,t,{version:e}),r.isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i.length&&(l=new Map,i.forEach((function(e){var t=e.changeType;l.has(t)?l.get(t).push(e):l.set(t,[e])})),Array.from(l.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1];d.emit("serverEvent",r,n)}))),[2,sr({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return e=this._logger.createTraceId(),this._logger.info(H.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,c(this,nh,"m",ih).call(this,0)];case 1:return t=r.sent(),this._logger.summary(H.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),r}(nr);nh=new WeakSet,ih=function(e){var t=Ku.encode(va,{syncTime:e});return this._con.query(An.pullEventChange,this._con.getCurrentUserId(),t,Ta)};var fh=function(e){function r(t){var r=e.call(this,"WebUGServerEventHandler")||this;return sh.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=Ku.encode(va,{syncTime:e}),[4,this._ctx.query(An.qryMsgChange,this._ctx.currentUserId,t,Ia)];case 1:return(r=s.sent()).isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i&&i.length&&c(this,sh,"m",ah).call(this,i),[2,sr({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),r}(nr);sh=new WeakSet,ah=function(e){var t=[],r=[],n=[],i=[],o=[];e.forEach((function(e){switch(e.changeType){case 1:r.push(e);break;case 2:t.push(e);break;case 3:n.push(e);break;case 4:i.push(e);break;case 5:o.push(e)}})),r.length&&c(this,sh,"m",uh).call(this,r,1),t.length&&c(this,sh,"m",uh).call(this,t,2),n.length&&this.emit("ugMsgRecalled",e),i.length&&this._ctx.emit("ugChannelChanged",i),o.length&&this._ctx.emit("ugUserGroupChanged",o)},uh=function(e,t){var r=this,n=new Map;e.forEach((function(e){var t=e.targetId,r=e.busChannel,i=e.msgUID,o="".concat(t,"-").concat(r),s=n.get(o);s?s.messageUIds.push(i):n.set(o,{conversationIdentifier:{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:r},messageUIds:[i]})})),Array.from(n.entries()).forEach((function(e){var n=u(e,2);n[0];var i=n[1];1===t?r.emit("ugMsgExpansion",i.conversationIdentifier,i.messageUIds):r.emit("ugMsgModify",i.conversationIdentifier,i.messageUIds)}))};var _h,hh,gh,Eh,bh,vh,Th,Ih,yh,mh,Rh,Sh,Ah,Oh,Ch,Nh,Ph,Lh,Mh,wh,Uh,Dh,xh,Gh,Vh,jh,kh,Fh,Bh,Hh,qh,Yh,Wh,Kh,Jh,Qh=function(){return o(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,exports.ErrorCode.NOT_SUPPORT]}))}))},Xh=function(){return o(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,ar(exports.ErrorCode.NOT_SUPPORT,"Not support")]}))}))},zh=function(e){function r(t,r){var n=e.call(this,"WebSGMsgModifyReceiver")||this;return _h.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),hh.set(n,0),gh.set(n,!0),n._ctx.on("onConnected",c(n,_h,"m",Eh),n),n._ctx.on("messagesFromSG",c(n,_h,"m",bh),n),n}return t(r,e),Object.defineProperty(r.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.setInitVersion(c(this,hh,"f"),!0)}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger.createTraceId(),this._ctx.logger.info(H.L_PULL_MODIFY_MSG_T,JSON.stringify({time:e}),t),p={pullVersion:e},r=Ku.encode(Du,n(n({},p),{compress:_c.enable()})),[4,this._ctx.query(An.pullModifyMsg,this._ctx.currentUserId,r,void 0)];case 1:return i=s.sent(),this._ctx.logger.summary(H.L_PULL_MODIFY_MSG_R,i,t),i.isOk?(o=$_(i.data.pbData),a=o.msg,u=o.nextVersion,l=o.finished,a&&a.length&&c(this,_h,"m",vh).call(this,a),c(this,gh,"f")&&(this._ctx.emit("messageModifiedSyncCompleted",!l),d(this,gh,!1,"f")),[2,sr({version:u,hasNext:!l})]):[2,i.wipe()]}var p}))}))}}),r}(nr);hh=new WeakMap,gh=new WeakMap,_h=new WeakSet,Eh=function(e,t){d(this,gh,!0,"f"),t||(this.reset(),d(this,hh,this._ctx.connectedTime,"f"))},bh=function(e,t,r,n){0===n&&t.length>0&&d(this,hh,t[0].sentTime,"f")},vh=function(e){var t=this,r=[],n=this._ctx.currentUserId;e.forEach((function(e){var i=e.msg,o=Jl(i,n,!1);r.push(o);var s=o.conversationType,a=o.targetId,u=o.channelId,l=t.storage.getModel({conversationType:s,targetId:a,channelId:u});if(l&&l.latestMessage){var c=l.latestMessage,d=c.messageUId,p=c.messageType,f=c.content;if(d!==o.messageUId){if(p===ye.REFERENCE){if(f.referMsgUid!==o.messageUId)return;f.referMsg=o.content}}else l.updateAttrs({latestMessage:o})}})),this._ctx.emit("messageModified",r)};var Zh=18e4,$h=function(){function e(e,t){Ih.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}),yh.set(this,void 0),mh.set(this,void 0),Rh.set(this,void 0),Sh.set(this,void 0),Ph.set(this,1),Object.defineProperty(this,"getConversationListByPageIndex",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),qh.set(this,new Set),Object.defineProperty(this,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"syncRemoteConversations",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"getMessagesAroundTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"deleteLocalUGMessagesForAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"getUnreadMentionedMessages",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"saveEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"getEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(this,"clearEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),this.storage=new Id(e),this.settings=new id(this._ctx,this.storage),d(this,yh,new oh(this._ctx),"f"),d(this,mh,new rh(this._ctx,this.storage),"f"),d(this,Rh,new fh(this._ctx),"f"),d(this,Sh,new zh(this._ctx,this.storage),"f"),c(this,Rh,"f").on("ugMsgModify",c(this,Ih,"m",wh),this),c(this,Rh,"f").on("ugMsgExpansion",c(this,Ih,"m",Uh),this),c(this,Rh,"f").on("ugMsgRecalled",c(this,Ih,"m",Dh),this),this._ctx.on("onConnected",c(this,Ih,"m",Nh),this),this._ctx.on("onDisconnected",c(this,Ih,"m",Vh),this),this._ctx.on("onSuspend",c(this,Ih,"m",Vh),this),this._ctx.on("sCmd",c(this,Ih,"m",jh),this),this._ctx.on("signal",c(this,Ih,"m",kh),this),this._ctx.on("serverEvent",c(this,Ih,"m",Ah),this)}return Object.defineProperty(e.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,Sh,"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 r,n,i,o,a,u,l;return s(this,(function(s){return r=e.count,n=e.startTime,i=e.order,t?(o=0!==n||i?n:Number.MAX_SAFE_INTEGER,a=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>o:e.operationTime<o)})).sort((function(e,t){return e.operationTime-t.operationTime})),u=Math.min(a.length,r),l=i?a.slice(0,u):a.slice(a.length-u),i||l.reverse(),[2,sr(l.map((function(e){return e.toIReceivedConversation()})))]):[2,c(this,Ih,"m",Fh).call(this,n,r,i||0)]}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){return n=((null==t?void 0:t.length)||0)>0?t:$(e?Q:K),i="string"==typeof r&&""!==r,o=this.storage.getAllModels().filter((function(t){return t.isTop&&!t.hidden&&n.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!i||t.channelId===r)||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,Ih,"m",Bh).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 s(this,(function(r){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>exports.NotificationLevel.NOT_SET&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,Ih,"m",Bh).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 r,n;return s(this,(function(i){return r=((null==t?void 0:t.length)||0)>0?t:$(e?Q:K),n=this.storage.getAllModels().filter((function(t){return t.unreadCount>0&&r.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.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,Ih,"m",Bh).call(this,n)]}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r="string"==typeof t,e?(n=this.storage.getAllModels().filter((function(e){return!(e.hidden||(e.conversationType===exports.ConversationType.ULTRA_GROUP||r&&e.channelId!==t)&&e.channelId&&"RCDefault"!==e.channelId)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,sr(n)]):[4,c(this,Ih,"m",Fh).call(this,0,1e3,0)];case 1:return[2,i.sent().trans((function(e){return e.filter((function(e){return!r||e.channelId===t}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){i.unreadCount>0&&e.includes(i.conversationType)&&(i.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!r&&!i.channelId||i.channelId===r)||i.conversationType===exports.ConversationType.ULTRA_GROUP&&(""===i.channelId||"RCDefault"===i.channelId))&&(t||i.notificationLevel<=exports.NotificationLevel.NOT_SET)&&(n+=i.unreadCount)})),[2,sr(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,r,n;return s(this,(function(i){switch(i.label){case 0:return t=this.storage.getOrCreateModel(e,!1),r=t.toIReceivedConversation(),[4,c(this,Ih,"m",Bh).call(this,[r])];case 1:return(n=i.sent()).isOk?[2,n.trans((function(e){return e[0]}))]:[2,sr(r)]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var r,i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,Ih,"m",Hh).call(this,e,r,t)];case 1:return(i=s.sent()).isOk?(o=i.data,a=o.version,u=o.updateVersion,l=e.map((function(e){var r=d.storage.getOrCreateModel(e,!0);return r.updateAttrs({isTop:t,hidden:!n&&r.hidden,operationTime:r.hidden&&n?Date.now():r.operationTime}),r})),this.storage.updateConversationStorage(l),u&&this.storage.set("conversationStatusVersion",a),[2,sr()]):[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 r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,Ih,"m",Hh).call(this,e,r,void 0,t)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.version,a=i.updateVersion,u=e.map((function(e){var r=l.storage.getOrCreateModel(e,!0);return r.updateAttrs({notificationLevel:t}),r})),this.storage.updateConversationStorage(u),a&&this.storage.set("conversationStatusVersion",o),[2,sr()]):[2,n.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 r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,Ih,"m",Hh).call(this,e,r,void 0,void 0,t)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.version,a=i.updateVersion,u=e.map((function(e){var r=l.storage.getOrCreateModel(e,!0);return r.updateAttrs({translateStrategy:t}),r})),this.storage.updateConversationStorage(u),a&&this.storage.set("conversationStatusVersion",o),[2,sr()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getOrCreateModel(e,!1),[2,sr(t.notificationLevel)]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getConversationTypeNotificationLevel(e),[2,sr(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 r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=this._ctx.currentUserId,i=Ku.encode(ra,{type:e,unpushLevel:t,version:r,ignoreVersion:!0}),[4,this._ctx.query(An.setTypeUnpush,n,i,na)];case 1:return(o=s.sent()).isOk?(a=o.data,u=a.version,l=a.updateVersion,this.storage.setConversationTypeNotificationLevel(e,t),l&&this.storage.set("conversationStatusVersion",u),[2,sr()]):[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 s(this,(function(r){return e=this.storage.getAllSGModels(),t=this._ctx.serverTime,e.forEach((function(e){return e.clearUnreadCount(t)})),this.storage.updateConversationStorage(e),[2,sr()]}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return r=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),n=Ku.encode(Vs,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:r}),i=e.conversationType===exports.ConversationType.ULTRA_GROUP?An.delUgMsg:An.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,n)];case 1:return(o=s.sent()).isOk?this._ctx.includeUg?((a=this.storage.getModel(e))&&(u=a.latestMessage)&&t.some((function(e){return e.messageUId===u.messageUId}))&&a.updateAttrs({latestMessage:null}),[2,sr()]):[2,sr()]:[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=Ku.encode(Ss,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),n=sg[e.conversationType],[4,this._ctx.query(n,this._ctx.currentUserId,r)];case 1:return(i=s.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(a=o.latestMessage)&&(0===t||a.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,sr()]):[2,sr()]:[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=Ku.encode(As,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query(An.cleanMsgBatch,this._ctx.currentUserId,t)];case 1:return(r=i.sent()).isOk?(e.forEach((function(e){var t=n.storage.getModel(e);if(t){var r=t.latestMessage;r&&(!e.timestamp||r.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),[2,sr()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=Ku.encode(oa,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),n=t[0],[4,this._ctx.query(An.readReceipt,n,r)];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,r,n,i,o,a,l;return s(this,(function(s){switch(s.label){case 0:return t=new Map,e.forEach((function(e){var r,n=(r=e.identifier,cd(r.conversationType,r.targetId,r.channelId)),i=t.get(n)||new Set;i.add(e.messageUId),t.set(n,i)})),r=Array.from(t.entries()).map((function(e){var t=u(e,2),r=t[0],n=t[1],i=dd(r);return{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgIds:Array.from(n)}})),n=function(e){return Ku.encode(aa,{items:e,compress:_c.enable()})}(r),[4,this._ctx.query(An.qryReceiptBatch,e[0].messageUId,n)];case 1:return(i=s.sent()).isOk?(o=i.data,a=Q_(o.pbData).item,l=[],a.forEach((function(e){var t,r={conversationType:e.type,targetId:e.targetId,channelId:e.busChannel};null===(t=e.msg)||void 0===t||t.forEach((function(e){var t=e.msgId,n=e.unreadCnt,i=e.readCnt,o=e.totalCnt;l.push({identifier:r,messageUId:t,unreadCount:n,readCount:i,totalCount:o})}))})),[2,sr(l)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return n=0===r.readStatus?1:2,i=K_({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:1,pageType:1,pageToken:r.pageToken,pageSize:r.pageCount,readType:n,order:r.order?0:1}),[4,this._ctx.query(An.qryReceipt,t,i)];case 1:return(o=s.sent()).isOk?(a=o.data,u=J_(a.pbData),l=u.resp,c=u.pageToken,d=l[0],[2,sr({pageToken:c||"",totalCount:1===n?d.readCnt:d.unreadCnt,users:(1===n?d.readUser:d.unreadUser).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,c;return s(this,(function(s){switch(s.label){case 0:return n=K_({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:r}),[4,this._ctx.query(An.qryReceipt,t,n)];case 1:return(i=s.sent()).isOk?(o=i.data,a=J_(o.pbData).resp,c=a[0],[2,sr({pageToken:"",totalCount:0,users:l(l([],u(c.readUser),!1),u(c.unreadUser),!1).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=ur.create("requestSpeechToTextForMessage").isObject("option",t,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==t?void 0:t.messageType,(function(e){return e===ye.HQ_VOICE||e===ye.VOICE}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){if(t.messageType===ye.HQ_VOICE)e.validate("numberOfChannels",t.numberOfChannels,(function(e){return 1===e}),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",t.sampleRate,(function(e){return 16e3===e||8e3===e}),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",t.format).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").isHttpUrl("remoteUrl",t.remoteUrl,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid");else{var r=t.content;e.isNotEmptyString("content",r,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid")}})).isLimitedInteger("duration",t.duration,1,60,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid").result()).isOk?c(this,qh,"f").has(e)?[2,ar(exports.ErrorCode.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process")]:(c(this,Ih,"m",Yh).call(this,e,t),[2,sr()]):[2,r.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,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=e.messageUId,r=e.messageContent,n=e.conversation,i=Ku.encode(Ea,{targetId:n.targetId,type:n.conversationType,busChannel:n.channelId,msgUID:t,msgTime:0,content:JSON.stringify(r),fromUserId:""}),[4,this._ctx.query(An.modifyMsg,this._ctx.currentUserId,i,ba)];case 1:return(o=s.sent()).isOk?((a=this.storage.getModel(n))&&(u=a.latestMessage,l=a.conversationType,u&&u.messageUId===t&&(u.content=r,u.isModifyMessage=!0,u.modifyInfo=l===exports.ConversationType.ULTRA_GROUP?void 0:{timestamp:o.data.modifyTime,status:Pr,content:{}},a.updateAttrs({latestMessage:u}))),[2,sr()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a=this;return s(this,(function(s){return(o=ur.create("refreshReferenceMessageWithParams").validate("messageInfoMap",i,(function(t){return t&&e.every((function(e){return t[e]&&ht(t[e])}))}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_INFO_MAP).result()).isOk?(setTimeout((function(){n([]),c(a,Ih,"m",Kh).call(a,e,t,r,i)}),0),[2,sr()]):[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 r,n,i,o,a,l,c,d,p,f,_,h,g=this;return s(this,(function(s){switch(s.label){case 0:return this._userSettins.hasTag(e)?(r=this.storage.get("conversationStatusVersion"),n=Date.now(),i=this._ctx.currentUserId,o=t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:n,stateItem:[{sessionStateType:ss.Tags,value:"",tags:[{tagId:e}]}]}})),a=Z_(r,o),[4,this._ctx.query(An.addTag,i,a,ta)]):[2,ar(exports.ErrorCode.TAG_NOT_EXIST)];case 1:return(l=s.sent()).isOk?(c=l.data,d=c.version,p=c.updateVersion,f=new Map,t.forEach((function(t){var r=g.storage.getOrCreateModel(t,!0),n={},i=r.tags;i.some((function(t){return t.tagId===e}))||(n.tags=i.concat({tagId:e}),f.set(r,n))})),_=[],h=[],Array.from(f.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1];h.push(r);var i=r.updateAttrs(n,d);i&&_.push({conversation:r.toIReceivedConversation(),updatedItems:i})})),this.storage.updateConversationStorage(h),p&&this.storage.set("conversationStatusVersion",d),_.length>0&&this._ctx.emit("conversationStatusChanged",_),[2,sr()]):[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,r,n;return s(this,(function(i){return t=this.storage.getOrCreateModel(e,!1),r=this._userSettins.getTags(),n=t.tags.map((function(e){var t;return{tagId:e.tagId,tagName:null===(t=r[e.tagId])||void 0===t?void 0:t.tagName}})),[2,sr(n)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f,_;return s(this,(function(s){switch(s.label){case 0:return n=this.storage.get("conversationStatusVersion"),i=r.isTop,o=this.storage.getOrCreateModel(t,!1),a=o.tags,(u=a.find((function(t){return t.tagId===e})))?(l=Z_(n,[{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:ss.Tags,value:"",tags:[{tagId:e,isTop:i}]}]}]),c=this._ctx.currentUserId,[4,this._ctx.query(An.addTag,c,l,ta)]):[2,ar(exports.ErrorCode.NO_TAG_IN_CONVER)];case 1:return(d=s.sent()).isOk?(p=d.data,f=p.version,_=p.updateVersion,u.isTop=i,o.updateAttrs({tags:a},f),this.storage.updateConversationStorage([o]),_&&this.storage.set("conversationStatusVersion",f),[2,sr()]):[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 r,n,i,o,a,u,l,c,d=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=Z_(r,[]),i=this._ctx.currentUserId,[4,this._ctx.query(An.delTag,i,n,ta)];case 1:return(o=s.sent()).isOk?(a=o.data,u=a.version,l=a.updateVersion,c=t.map((function(t){var r=d.storage.getOrCreateModel(t,!0),n={tags:r.tags.filter((function(t){return t.tagId!==e}))};return r.updateAttrs(n,u),r})),this.storage.updateConversationStorage(c),l&&this.storage.set("conversationStatusVersion",u),[2,sr()]):[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 r,n,i,o,a,u,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return r=this._ctx.currentUserId,n=this.storage.get("conversationStatusVersion"),i=Z_(n,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:ss.Tags,value:"",tags:t.map((function(e){return{tagId:e}}))}]}]),[4,this._ctx.query(An.delTag,r,i,ta)];case 1:return(o=s.sent()).isOk?(a=o.data,u=a.version,l=a.updateVersion,c=this.storage.getOrCreateModel(e,!0),d=c.tags,p={tags:d.filter((function(e){return!t.includes(e.tagId)}))},c.updateAttrs(p,u),this.storage.updateConversationStorage([c]),l&&this.storage.set("conversationStatusVersion",u),[2,sr()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){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,r)).length?[2,sr([])]:(a=o.map((function(t){return n(n({},t.toIReceivedConversation()),{isTopInTag:t.tags.some((function(t){return t.tagId===e&&t.isTop}))})})),[2,c(this,Ih,"m",Bh).call(this,a)])):[2,sr([])]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return r=0,this.storage.getAllSGModels().forEach((function(n){var i;if(n.tags.some((function(t){return t.tagId===e}))){if(n.notificationLevel>exports.NotificationLevel.NOT_SET&&!t)return;r+=null!==(i=n.unreadCount)&&void 0!==i?i:0}})),[2,sr(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,r,n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return t=e.identifiers,r=e.deleteMessages,n=Ku.encode(Gs,{relation:t.map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),cleanMsg:r}),[4,this._ctx.query(An.delRelationBatch,this._ctx.currentUserId,n,void 0)];case 1:return(i=s.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,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=Ku.encode(ia,{msgId:t,channelId:r}),[4,this._ctx.query(An.rrMsg,e,n)];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,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=e.conversationType,r=e.channelId,n=e.targetId,i=Ku.encode(Ra,{targetId:n,type:t,busChannel:r||"",opType:0}),(o=new ro(An.operate,i,n)).setHeaderQos(Ln),[4,this._ctx.send(o)];case 1:return[2,s.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,r,n;return s(this,(function(i){return t=e.targetId,r=e.channelType,n=this.storage.getAllUGModels().filter((function(e){return!(void 0!==t&&t!==e.targetId||void 0!==r&&r!==e.channelType)})).sort((function(e,t){var r,n,i=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0;return((null===(n=t.latestMessage)||void 0===n?void 0:n.sentTime)||0)-i})).map((function(e){var t=e.toIReceivedConversation();return t.unreadMentionedCount=ag(t.unreadMentionedCount||0),t.unreadMessageCount=ag(t.unreadMessageCount||0),t.unreadMentionedMeCount=ag(t.unreadMentionedMeCount||0),t})),[2,sr(n)]}))}))}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=this._ctx.currentUserId,[4,c(this,Ih,"m",Wh).call(this,e,t)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.list,a=o.map((function(t){return Jl(t,r,!1,e.targetId)})),[2,sr(a)]):[2,n.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,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.targetId,r=e.channelId,n=e.sentTime,i=e.count,o=Ku.encode(ms,{groupId:t,busChannel:r,msgTime:n,size:i}),[4,this._ctx.query(An.qryUgUal,this._ctx.currentUserId,o,Rs)];case 1:return(a=s.sent()).isOk?(u=a.data.msgInfo,[2,sr(u.map((function(e){return{messageUId:e.msgId,sentTime:e.msgTime,messageType:e.className,mentionedType:e.remindType}})))]):[2,a.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i;return o(this,void 0,void 0,(function(){var o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:return o=this._ctx.currentUserId,a=t.mid,u=t.put,l=t.del,c=t.clear,d=Ku.encode(Ea,{fromUserId:o,targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgUID:a,msgTime:r,content:JSON.stringify(t)}),[4,this._ctx.query(An.upMsgEx,e.targetId,d)];case 1:return(p=s.sent()).isOk&&(null==(f=null===(i=this.storage.getModel(e))||void 0===i?void 0:i.latestMessage)?void 0:f.messageUId)===a&&(c?f.expansion={}:u?f.expansion=n(n({},f.expansion),u):l&&f.expansion&&l.forEach((function(e){delete f.expansion[e]}))),[2,p.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=Ku.encode($s,{unpushLevel:t,busChannel:r}),[4,this._ctx.query(An.ugUnpushSet,e,n)];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 r,n,i;return s(this,(function(o){switch(o.label){case 0:return r=Ku.encode(Zs,{busChannel:t}),[4,this._ctx.query(An.ugUnpushQuery,e,r,ea)];case 1:return(n=o.sent()).isOk?(i=n.data.unpushLevel,[2,sr(i)]):[2,n.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 r;return s(this,(function(n){return r=this.storage.getModel(e),[2,sr(null!==(t=null==r?void 0:r.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 s(this,(function(t){return e=this.storage.getAllSGModels().reduce((function(e,t){return e+t.unreadMentionedCount}),0),[2,sr(e)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){if(e.includes(i.conversationType)){var o=i.notificationLevel,s=i.unreadCount,a=i.unreadMentionedCount;(0===t.length||t.includes(o))&&(n+=r?a:s)}})),[2,sr(n)]}))}))}}),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 s(this,(function(r){return t=this.storage.getModel(e),[2,sr(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,r;return s(this,(function(n){return(t=this.storage.getModel(e))?(r=t.firstUnreadMessage,[2,sr(r?{messageUId:r.messageUId||"",sentTime:r.sentTime}:null)]):[2,sr(null)]}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return n=this.storage.getAllUGModels(),i=n.reduce((function(n,i){var o=r?i.unreadMentionedCount:i.unreadCount;if(!o||i.targetId!==e)return n;var s=i.notificationLevel||exports.NotificationLevel.NOT_SET;return!t.length||t.includes(s)?n+o:n}),0),[2,sr(ag(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 s(this,(function(r){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:ag(e.unreadCount||0),mentionedCount:ag(e.unreadMentionedCount||0),mentionedMeCount:ag(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||exports.NotificationLevel.NOT_SET}})),[2,sr(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,r;return s(this,(function(n){return t=this.storage.getModel(e),(r=null==t?void 0:t.firstUnreadMessage)?[2,sr(r)]:[2,ar(exports.ErrorCode.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 s(this,(function(t){return e=this.storage.getAllUGModels().filter((function(e){return e.notificationLevel>exports.NotificationLevel.NOT_SET})).map((function(e){return e.toIReceivedConversation()})),[2,sr(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,r,n,i;return s(this,(function(o){switch(o.label){case 0:return t=this._ctx.serverTime,e.conversationType!==exports.ConversationType.ULTRA_GROUP?[3,2]:(r=H_(e,t),(n=new ro(An.updUgRTime,r,this._ctx.currentUserId)).setHeaderQos(Ln),[4,this._ctx.send(n)]);case 1:if(!(i=o.sent()).isOk)return[2,i.wipe()];o.label=2;case 2:return this.storage.clearConversationUnreadCount(e,t),[2,sr()]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,Ih,"m",Jh).call(this,t,r,e,An.qrySessions)];case 1:return(i=s.sent()).isOk?(o=this._ctx.currentUserId,a=i.data.info.map((function(e){var t=e.unreadCount,r=e.busChannel,i=e.type,s=e.userId,a=e.versionTime,l=e.msg,c=u.storage.getOrCreateModel({conversationType:i,targetId:s,channelId:r||""},!1);return n(n({},c.toIReceivedConversation()),{unreadMessageCount:t,operationTime:a,latestMessage:l?Jl(l,o,!1,s):null})})).sort((function(e,t){var n,i,o=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0,s=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===r?s-o:o-s})),[2,sr(a)]):[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 s(this,(function(t){switch(t.label){case 0:return e=Ku.encode(Ls,{nothing:1}),[4,this._ctx.query(An.qrySessionsAtt,this._ctx.currentUserId,e,Ms)];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,r,n;return s(this,(function(i){switch(i.label){case 0:return t=this._ctx.serverTime,this.storage.clearConversationUnreadCount(e,this._ctx.serverTime),r=H_(e,t),n=new ro(An.updRRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];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 s(this,(function(r){switch(r.label){case 0:return t=Ku.encode(Us,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(An.delSessions,this._ctx.currentUserId,t)];case 1:return[2,r.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 s(this,(function(r){switch(r.label){case 0:return t=Ku.encode(Ds,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(An.qrySessionsUnread,this._ctx.currentUserId,t,xs)];case 1:return[2,r.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 r,n,i,o,a,u;return s(this,(function(s){return r=e.count,n=e.conversationTypes,i=e.timestamp||Number.MAX_SAFE_INTEGER,t?(o=this.storage.getAllModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&n.includes(e.conversationType)&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),[2,sr(o.map((function(e){return e.toIReceivedConversation()})))]):(a=this.storage.getAllSGModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&n.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),u=a.map((function(e){return e.toIReceivedConversation()})),[2,c(this,Ih,"m",Bh).call(this,u)])}))}))}}),e}();yh=new WeakMap,mh=new WeakMap,Rh=new WeakMap,Sh=new WeakMap,Ph=new WeakMap,qh=new WeakMap,Ih=new WeakSet,Ah=function(e,t,r){if(t===ch){e.stopPropagation();var n=[];r.forEach((function(e){if(0===e.subChangeType){var t=Ku.decode(Cu,new Uint8Array(e.eventData)),r=t.msgId,i=t.unreadCnt,o=t.readCnt,s=t.readList,a=t.totalCnt;n.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:r,users:s.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}})),readCount:o,unreadCount:i,totalCount:a})}})),this._ctx.emit("readReceiptResponseV5",n)}},Oh=function(e){e||(c(this,mh,"f").setInitVersion(0),this._ctx.includeUg&&c(this,Ih,"m",Lh).call(this)),c(this,mh,"f").startInterval(Zh,!0)},Ch=function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return e?[3,2]:(this.settings.reset(),[4,this.settings.syncDataFromServer()]);case 1:t=r.sent(),this.settings.setInitVersion(t),r.label=2;case 2:return this._ctx.isConnected&&this.settings.startInterval(Zh,!0),[2]}}))}))},Nh=function(e,t){t||this.storage.syncDataFromLocalStorage(this._ctx),c(this,Ih,"m",Ch).call(this,t),c(this,Ih,"m",Oh).call(this,t),this._ctx.ugEnabel&&c(this,Ih,"m",Gh).call(this,t)},Lh=function e(){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,p=this;return s(this,(function(s){switch(s.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,r=t.createTraceId(),n=c(this,Ph,"f"),t.info(H.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:n}),r),[4,c(this,Ih,"m",Jh).call(this,n,1,1e3)]):[2];case 1:return(i=s.sent()).isOk?(o=i.data,a=o.info,u=o.isFinished,l=o.pullTime,d(this,Ph,l,"f"),t.info(H.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:n,isFinished:u,pullTime:l}),r),this.storage.addRelations(a,this._ctx.currentUserId),u?(this._ctx.emit("sgRelationsSynced",exports.ErrorCode.SUCCESS),[2]):[2,c(this,Ih,"m",e).call(this)]):(t.warn(H.L_PULL_SG_RELATIONS_R,i.errmsg(),r),setTimeout((function(){return c(p,Ih,"m",e).call(p)}),1e3),[2])}}))}))},Mh=function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,Ih,"m",Wh).call(this,e,t)];case 1:return(n=s.sent()).isOk?(i=n.data.list.map((function(t){return Jl(t,u._ctx.currentUserId,!1,e.targetId)})),(o=this.storage.getModel(e))&&o.latestMessage&&(a=i.find((function(e){return e.messageUId===o.latestMessage.messageUId})))&&o.updateAttrs({latestMessage:a}),2===r?this._ctx.emit("messageModified",i):this._ctx.emit("ugMsgExpansionUpdated",i),[2]):[2]}}))}))},wh=function(e,t,r){c(this,Ih,"m",Mh).call(this,t,r,2)},Uh=function(e,t,r){c(this,Ih,"m",Mh).call(this,t,r,1)},Dh=function(e,t){var r=this,i=t.map((function(e){var t=e.targetId,i=e.busChannel,o=e.msgUID,s=e.msgTime,a=e.operatorId,u=e.remindType,l={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:i||""},d=n(n({},l),{messageUId:o,sentTime:s}),p=n(n({},l),{sentTime:s,messageUId:o,senderUserId:a,content:d,messageDirection:1,messageType:ye.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Ot(exports.ReceivedStatus.UNREAD)}),f=r.storage.getModel(l);return f&&c(r,Ih,"m",xh).call(r,f,o,s,u),p}));this._ctx.emit("ugMsgRecalled",i)},xh=function(e,t,r,n){var i={},o=e.latestMessage;o&&o.messageUId===t&&(i.latestMessage=null),r&&e.lastReadTime<r&&e.unreadCount&&(i.unreadCount=e.unreadCount-1,n!==exports.MentionedType.ALL&&n!==exports.MentionedType.SINGAL||!e.unreadMentionedCount||(i.unreadMentionedCount=e.unreadMentionedCount-1),n===exports.MentionedType.SINGAL&&e.unreadMentionedCount&&(i.unreadMentionedMeCount=e.unreadMentionedMeCount-1));var s=e.updateAttrs(i,r);this.storage.updateConversationStorage([e]),s&&this._ctx.emit("conversation",[{conversation:e.toIReceivedConversation(),updatedItems:s}])},Gh=function(e){return o(this,void 0,void 0,(function(){var e,t,r,n;return s(this,(function(i){switch(i.label){case 0:return[4,c(this,yh,"f").markOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,r=t.relations,n=t.msgVersion,this.storage.addRelations(r,this._ctx.currentUserId),this._ctx.emit("ultraGroupEnable"),c(this,yh,"f").setInitVersion(n),c(this,yh,"f").startInterval(Zh,!0),c(this,Rh,"f").setInitVersion(n),c(this,Rh,"f").startInterval(Zh,!0),[2]):[2]}}))}))},Vh=function(){this.settings.stopInterval(),c(this,yh,"f").reset(),c(this,mh,"f").reset(),c(this,Rh,"f").reset()},jh=function(e,t){return 3===t.type?(e.stopPropagation(),void this.settings.push(t.time)):7===t.type?(e.stopPropagation(),void c(this,Rh,"f").push(t.time)):void(12===t.type&&(e.stopPropagation(),c(this,Sh,"f").push(t.time)))},kh=function(e,t,r){var n=t.syncMsg,i=Cn(t.topic);if(n&&i===An.updUgRTime){e.stopPropagation();var o=Ku.decode(ws,t.pbData),s=o.channelId,a=o.busChannel,u=o.msgTime,l=this.storage.clearConversationUnreadCount({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:s,channelId:a||""},u);l&&this._ctx.emit("conversationStatusChanged",[l])}},Fh=function(e,t,r){return o(this,void 0,void 0,(function(){var i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return i=this._ctx.currentUserId,[4,c(this,Ih,"m",Jh).call(this,e,r||0,t)];case 1:return(o=s.sent()).isOk?(a=o.data,u=a.info,l=u.map((function(e){var t=e.userId,r=e.type,o=e.busChannel,s=d.storage.getOrCreateModel({conversationType:r,targetId:t,channelId:o},!1);return n(n({},s.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Jl(e.msg,i,!1,t):null})})),[2,sr(l)]):[2,o.wipe()]}}))}))},Bh=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._ctx.includeUg?[2,sr(e)]:(t=this._ctx.currentUserId,r=e.filter((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP})).map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),0===r.length?[2,sr(e)]:(n=Ku.encode(Gs,{relation:r}),[4,this._ctx.query(An.qryRLBatch,this._ctx.currentUserId,n,void 0)]));case 1:return(i=o.sent()).isOk?(q_(i.data.pbData).info.forEach((function(r){r.msg&&(e.find((function(e){return(e.channelId||"")===(r.busChannel||"")&&e.targetId===r.userId&&e.conversationType===r.type})).latestMessage=Jl(r.msg,t,!1,r.userId))})),[2,sr(e)]):[2,i.wipe()]}}))}))},Hh=function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){return o=[],void 0!==r&&o.push({sessionStateType:ss.IsTop,value:r?"1":"0"}),void 0!==n&&o.push({sessionStateType:ss.IsSilent,value:n.toString()}),void 0!==i&&o.push({sessionStateType:ss.AutoTrans,value:i.toString()}),a=Z_(t,e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:o}}))),[2,this._ctx.query(An.setSeAtt,this._ctx.currentUserId,a,ta)]}))}))},Yh=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return c(this,qh,"f").add(e),r=t.messageType===ye.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},n=Ku.encode(Nu,{businessType:1,businessInfo:Ku.encode(Pu,r)}),[4,this._ctx.query(An.upConvertMsg,e,n,Lu)];case 1:return i=s.sent(),c(this,qh,"f").delete(e),o=i.code,i.isOk?(u=Ku.decode(Mu,new Uint8Array(i.data.businessResult)),a={status:De.SUCCESS,text:u.result}):a={status:De.FAILED,text:""},this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:a}),[2]}}))}))},Wh=function(e,t){var r=e.targetId,n=e.conversationType,i=e.channelId,o=Ku.encode(ya,{targetId:r,type:n,query:t.map((function(e){return{msgTime:0,msgUID:e,busChannel:i}}))});return this._ctx.query(An.qryMsg,this._ctx.currentUserId,o,ma)},Kh=function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,d,p,f,_,h,g,E,b,v=this;return s(this,(function(s){switch(s.label){case 0:return i=Object.values(n),o=l([],u(new Set(l(l([],u(e),!1),u(i),!1))),!1),[4,c(this,Ih,"m",Wh).call(this,t,o)];case 1:return a=s.sent(),d=a.isOk,p=a.code,f=a.data,d?(h=(_=f).list,g=_.notExistMsgId,E=new Map(h.map((function(e){var r=Jl(e,v._ctx.currentUserId,!1,t.targetId);return[r.messageUId,r]}))),b=e.map((function(e){var t=E.get(e);if(!t)return g.includes(e)?{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR};if(t.messageType!==ye.REFERENCE)return{messageUId:e,code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE};var r=n[e],i=E.get(r),o=t.content;return i?(o.referMsg=i.content,o.referMsgStatus=i.isModifyMessage?Lr.MODIFIED:Lr.DEFAULT,{messageUId:e,message:t,code:exports.ErrorCode.SUCCESS}):g.includes(r)?(o.referMsgStatus=Lr.DELETE,{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND,message:t}):(o.referMsgStatus=Lr.DEFAULT,{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR,message:t})})),r(b),[2]):(r(e.map((function(e){return{messageUId:e,code:p}}))),[2])}}))}))},Jh=function(e,t,r,n){return void 0===n&&(n=An.qryRelationR),o(this,void 0,void 0,(function(){var i,o;return s(this,(function(s){switch(s.label){case 0:return i=this._ctx.currentUserId,o=function(e,t,r){return Ku.encode(Is,{startTime:e,order:t,count:r,compressioEnabled:_c.enable()})}(e,t,r),[4,this._ctx.query(n,i,o)];case 1:return[2,s.sent().trans((function(e){return q_(e.pbData)}))]}}))}))};var eg,tg,rg,ng,ig,og,sg=((Th={})[exports.ConversationType.PRIVATE]=An.cleanPMsg,Th[exports.ConversationType.GROUP]=An.cleanGMsg,Th[exports.ConversationType.CUSTOMER_SERVICE]=An.cleanCMsg,Th[exports.ConversationType.SYSTEM]=An.cleanSMsg,Th[exports.ConversationType.APP_PUBLIC_SERVICE]=An.cleanMCMsg,Th[exports.ConversationType.PUBLIC_SERVICE]=An.cleanMPMsg,Th[exports.ConversationType.ULTRA_GROUP]=An.cleanGMsg,Th),ag=function(e){return e>999?999:e},ug=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function lg(e){var t=!(1&~(e.ugMsg||0)),r=!(1&~(e.sessionCfg||0));return t&&r}var cg,dg,pg,fg=[An.chatMsg,An.ugMsg,An.recallMsg,An.ppMsgS,An.pgMsgS,An.ppMsgP,An.pgMsgP,An.pcMsgP,An.prMsgS,An.pbMsgP,An.chatMsgS],_g=function(e){function r(t,r,n,i){var o=e.call(this)||this;return eg.add(o),Object.defineProperty(o,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_navi",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),tg.set(o,void 0),o.userStorage=new ug,d(o,tg,new ph(r,i),"f"),c(o,tg,"f").pipe(o),o.on("onConnected",c(o,eg,"m",rg),o,100),o.on("onDisconnected",c(o,eg,"m",ig),o,100),o.on("onSuspend",c(o,eg,"m",ng),o,100),o.send=o._connMgr.send.bind(o._connMgr),o.query=o._connMgr.query.bind(o._connMgr),o.on("signal",c(o,eg,"m",og),o),o}return t(r,e),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._connMgr.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentToken",{get:function(){return this._connMgr.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ugEnabel",{get:function(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isDisableEmptyUGChannelId",{get:function(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"includeUg",{get:function(){return lg(this.getNaviInfoFromCache())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._navi.getNaviInfoFromCache(this.currentToken)}}),r}(rr);tg=new WeakMap,eg=new WeakSet,rg=function(e,t){return o(this,void 0,void 0,(function(){var e,r,n,i;return s(this,(function(o){switch(o.label){case 0:return[4,c(this,tg,"f").noticeOnline()];case 1:return(e=o.sent()).isOk?(t?c(this,tg,"f").startInterval(18e4,!0):(r=e.data,n=r.syncTime,i=r.hasNext,c(this,tg,"f").setInitVersion(n),c(this,tg,"f").startInterval(18e4,!!i)),[2]):[2]}}))}))},ng=function(e,t){c(this,tg,"f").stopInterval()},ig=function(e,t){c(this,tg,"f").reset()},og=function(e,t,r){var n=t.topic,i=t.syncMsg,o=Cn(n);if(o||(this.logger.warn(H.L_RECV_RMTP_E,"unknown topic: ".concat(n)),e.stopPropagation()),this.logger.debug(H.L_RECV_RMTP_O,n),i&&fg.includes(o)){e.stopPropagation();var s=r||{},a=s.timestamp,u=void 0===a?this.serverTime:a,l=s.messageUId,d=void 0===l?"":l,p=Kl(t,this.currentUserId,u,d),f=Jl(p,this.currentUserId,!1,t.targetId);this.emit("syncMsg",f,o)}else{if(o===An.s_ntf){e.stopPropagation();var _=(E=Ku.decode(as,t.pbData)).type,h=E.chrmId,g=E.time;return this.logger.info(H.L_RECV_S_NTF_O,"type: ".concat(_,", chrmId: ").concat(h,", time: ").concat(g)),void this.emit("sNtf",E)}if(o===An.s_cmd){e.stopPropagation();var E;_=(E=Ku.decode(as,t.pbData)).type,h=E.chrmId,g=E.time;if(this.logger.info(H.L_RECV_S_CMD_O,"type: ".concat(_,", chrmId: ").concat(h,", time: ").concat(g)),11===_)return void c(this,tg,"f").push(g);this.emit("sCmd",E)}if(o===An.s_msg){e.stopPropagation();p=Ku.decode(fs,t.pbData),f=Jl(p,this.currentUserId,!1);this.emit("sMsg",f)}}};var hg,gg=function(e,t,r){var n=0;return e&&(n|=1),t&&(n|=2),r&&(n|=4),n},Eg=function(e,t,r){return{chatroomId:e,key:t.key,value:t.value,timestamp:t.version,type:r?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE}},bg=function(e){function r(t,r){var n=e.call(this,"WebChatroomKVStore")||this;return cg.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),dg.set(n,new Map),Object.defineProperty(n,"_emittedEntriesSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l,d,p,f,_=this;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),i=this._chatroomId,o={chatroomId:i,timestamp:e},t.info(H.L_PULL_CHATROOM_KV_T,JSON.stringify(o),r),[4,this._ctx.query(An.pullKV,i,eh(e),void 0)];case 1:return(a=s.sent()).isOk?(u=th(a.data.pbData),l=u.bFullUpdate,d=u.entries,p=u.syncTime,t.info(H.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{newVersion:p})),r),f=new Map,l&&(Array.from(c(this,dg,"f").values()).forEach((function(e){f.set(e.key,Eg(i,e,!0))})),c(this,dg,"f").clear()),Array.from(d.values()).forEach((function(e){var t,r=(t=e.status,{isAutoDelete:!!(1&t),isOverwrite:!!(2&t),isDelete:!!(4&t)}).isDelete,n=function(e){var t=e.key,r=e.value;return e.timestamp,{key:t,value:r,userId:e.uid,version:e.version}}(e);r?c(_,dg,"f").delete(n.key):c(_,dg,"f").set(n.key,n),f.set(n.key,Eg(i,n,r))})),this._emittedEntriesSynced||(this._emittedEntriesSynced=!0,this._ctx.emit("chatroom",{entriesSynced:i})),f.size>0&&this._ctx.emit("chatroom",{updatedEntries:Array.from(f.values())}),[2,sr({version:p})]):(t.warn(H.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{code:a.code})),r),[2,a.wipe()])}}))}))}}),Object.defineProperty(r.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,c(this,cg,"m",pg).call(this,e,t,!1)];case 1:return(r=n.sent()).isOk&&c(this,dg,"f").set(e.key,{key:e.key,value:e.value,userId:this._ctx.currentUserId,version:this._ctx.serverTime}),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,c(this,cg,"m",pg).call(this,{key:e.key,value:"",isAutoDelete:!1,isSendNotification:e.isSendNotification,notificationExtra:e.notificationExtra},t,!0)];case 1:return(r=n.sent()).isOk&&c(this,dg,"f").delete(e.key),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.serverTime,r=e.entries.map((function(r){var n,i=c(l,dg,"f").get(r.key);return{key:r.key,value:r.value,uid:l._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:t,status:gg(!!e.isAutoDelete,e.isForce||!1,!1)}})),n=Ku.encode(Fs,{entry:r}),[4,this._ctx.query(An.setKVS,this._chatroomId,n,Hs)];case 1:return(i=s.sent()).isOk||i.code===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?(o=i.data,a=o.keysVersion,u=new Map,null==a||a.forEach((function(e){u.set(e.key,e.version)})),e.entries.forEach((function(e){var t=e.key,r=u.get(t);r&&c(l,dg,"f").set(t,{key:t,value:e.value,userId:l._ctx.currentUserId,version:r})})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return t=gg(!1,!1,!0),r=this._ctx.serverTime,n=Ku.encode(Fs,{entry:e.keys.map((function(e){var n,i=c(u,dg,"f").get(e);return{key:e,status:t,value:"",uid:u._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:r}}))}),[4,this._ctx.query(An.delKVS,this._chatroomId,n,Hs)];case 1:return(i=s.sent()).isOk||i.code===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?(o=i.data.errorKeys,a=new Set,null==o||o.forEach((function(e){return a.add(e.key)})),e.keys.forEach((function(e){a.has(e)||c(u,dg,"f").delete(e)})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,dg,"f").has(e)?c(this,dg,"f").get(e).value:null}}),Object.defineProperty(r.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Array.from(c(this,dg,"f").entries()).map((function(e){var t=u(e,2);return[t[0],t[1].value]}));return Object.fromEntries(e)}}),r}(nr);dg=new WeakMap,cg=new WeakSet,pg=function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._ctx.serverTime,o=c(this,dg,"f").get(e.key),a=gg(!!e.isAutoDelete,t,r),u={entry:{key:e.key,value:e.value,uid:this._ctx.currentUserId,version:null!==(n=null==o?void 0:o.version)&&void 0!==n?n:i,status:a}},e.isSendNotification&&(u.type=exports.ConversationType.CHATROOM,u.bNotify=!0,u.notification={sessionId:Ql(ye.CHRM_KV_NOTIFY,!1,!1,!1),classname:ye.CHRM_KV_NOTIFY,content:JSON.stringify({key:e.key,value:e.value,extra:e.notificationExtra,type:r?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE})}),l=Ku.encode(js,u),[4,this._ctx.query(r?An.delKV:An.setKV,this._chatroomId,l)];case 1:return[2,s.sent().wipe()]}}))}))};var vg,Tg,Ig,yg,mg=function(e){function r(t,r,n,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:r}),Object.defineProperty(o,"_handler",{enumerable:!0,configurable:!0,writable:!0,value:i}),hg.set(o,0),d(o,hg,n,"f"),o}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,d,p,f=this;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),n={chatroomId:this._chatroomId,version:e},t.info(H.L_PULL_CHATROOM_MSG_T,JSON.stringify(n),r),i=function(e,t){return Ku.encode(Ts,{syncTime:e,count:t,compressioEnabled:_c.enable()})}(e,c(this,hg,"f")),[4,this._ctx.query(An.chrmPull,this._chatroomId,i,void 0)];case 1:return o=s.sent(),t.summary(H.L_PULL_CHATROOM_MSG_R,o,r,n),o.isOk?(a=this._ctx.currentUserId,u=W_(o.data.pbData),l=u.list,d=u.syncTime,l.length>0&&(p=l.map((function(e){return Jl(e,a,!1,f._chatroomId)})),this._handler(p,this._chatroomId)),[2,sr({version:d})]):[2,o.wipe()]}}))}))}}),r}(nr);hg=new WeakMap;var Rg,Sg,Ag,Og,Cg,Ng,Pg,Lg,Mg,wg,Ug,Dg,xg,Gg,Vg,jg=function(e){function r(t,r,n,i,o){var s=e.call(this)||this;return vg.add(s),Object.defineProperty(s,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(s,"roomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(s,"initCount",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(s,"extra",{enumerable:!0,configurable:!0,writable:!0,value:o}),Tg.set(s,void 0),Ig.set(s,void 0),d(s,Tg,new mg(s._ctx,s.roomId,n,i),"f"),d(s,Ig,new bg(s._ctx,s.roomId),"f"),s}return t(r,e),Object.defineProperty(r.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;c(this,Tg,"f").setInitVersion(0),c(this,Tg,"f").startInterval(e,!0),c(this,vg,"a",yg)&&(c(this,Ig,"f").setInitVersion(0),c(this,Ig,"f").startInterval(e,!0))}}),Object.defineProperty(r.prototype,"restartInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;this.stopInterval(),c(this,Ig,"f").startInterval(e,!0),c(this,Tg,"f").startInterval(e,!0)}}),Object.defineProperty(r.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,Tg,"f").stopInterval(),c(this,Ig,"f").stopInterval()}}),Object.defineProperty(r.prototype,"handleMessageNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,Tg,"f").push(e)}}),Object.defineProperty(r.prototype,"handleKVNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,Ig,"f").push(e)}}),Object.defineProperty(r.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,Ig,"f").setEntry(e,t)]}))}))}}),Object.defineProperty(r.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,Ig,"f").setEntries(e)]}))}))}}),Object.defineProperty(r.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,Ig,"f").removeEntry(e,t)]}))}))}}),Object.defineProperty(r.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,Ig,"f").removeEntries(e)]}))}))}}),Object.defineProperty(r.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,Ig,"f").getEntry(e)}}),Object.defineProperty(r.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,Ig,"f").getAllEntries()}}),r}(rr);Tg=new WeakMap,Ig=new WeakMap,vg=new WeakSet,yg=function(){var e;return!!(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.kvStorage)};var kg,Fg,Bg,Hg,qg=function(e){var t=e.joinTime,r=e.createTime,n=e.memberCount,i=e.chatroomBanState;return{createTime:r,joinTime:t,memberCount:n,isAllChatroomBanned:!(1&~(i||0)),isCurrentUserBanned:!(2&~(i||0)),isCurrentChatroomBanned:!(4&~(i||0)),isCurrentChatroomInWhitelist:!(1&~(e.whiteListState||0))}},Yg=function(e){function r(t){var r=e.call(this)||this;return Rg.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Sg.set(r,new Map),Object.defineProperty(r,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),r.logger=t.logger,r._ctx.on("onConnected",c(r,Rg,"m",Cg),r),r._ctx.on("onDisconnected",c(r,Rg,"m",Ag),r),r._ctx.on("onSuspend",c(r,Rg,"m",Og),r),r._ctx.on("sNtf",c(r,Rg,"m",Lg),r),r._ctx.on("sCmd",c(r,Rg,"m",Mg),r),r._ctx.on("syncMsg",c(r,Rg,"m",Pg),r),r._ctx.on("sMsg",c(r,Rg,"m",Ng),r),r}return t(r,e),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,Rg,"m",Dg).call(this,e,r,n)];case 1:return(i=s.sent()).isOk?((o=c(this,Sg,"f").get(e))||(o=new jg(this._ctx,e,t,c(this,Rg,"m",wg).bind(this),n),c(this,Sg,"f").set(e,o),o.startInterval()),[2,i.trans(qg)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return c(this,Sg,"f").get(e)?(c(this,Rg,"m",xg).call(this,e),t=Ku.encode(bs,{nothing:1}),[4,this._ctx.query(An.exitChrm,e,t)]):[2,sr()];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=Ku.encode(Os,{count:t,order:r}),[4,this._ctx.query(An.queryChrmI,e,n,Cs)];case 1:return[2,i.sent().trans((function(e){return{userCount:e.userTotalNums,userInfos:e.userInfos}}))]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,c(this,Rg,"m",Gg).call(this,e).next((function(e){return e.setEntry(t,r)}))]}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,Rg,"m",Gg).call(this,e).next((function(e){return e.setEntries(t)}))]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,c(this,Rg,"m",Gg).call(this,e).next((function(e){return e.removeEntry(t,r)}))]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,Rg,"m",Gg).call(this,e).next((function(e){return e.removeEntries(t)}))]}))}))}}),Object.defineProperty(r.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return(r=c(this,Sg,"f").get(e))?null===(n=r.getEntry(t))?[2,ar(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST)]:[2,sr(n)]:[4,c(this,Rg,"m",Vg).call(this,e)];case 1:return[2,i.sent().tryTrans((function(e){var r=e[t];return void 0===r?ar(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST):sr(r)}))]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=c(this,Sg,"f").get(e))?[2,sr(t.getAllEntries())]:[2,c(this,Rg,"m",Vg).call(this,e)]}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return i=X_({targetId:e,time:t,count:r,order:n}),o=this._ctx.currentUserId,[4,this._ctx.query(An.qryCHMsg,e,i)];case 1:return(a=s.sent()).isOk?(u=z_(a.data.pbData),[2,sr({hasMore:!!u.hasMsg,list:u.list.map((function(t){return Jl(t,o,!1,e)}))})]):[2,a.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=Ku.encode(Aa,{rtcRoomId:e.rtcRoomId}),[4,this._ctx.query(An.setRtcRoomId,e.chatRoomId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),r}(rr);Sg=new WeakMap,Rg=new WeakSet,Ag=function(){var e,t;try{for(var r=a(c(this,Sg,"f").values()),n=r.next();!n.done;n=r.next()){n.value.stopInterval()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}c(this,Sg,"f").clear()},Og=function(){var e,t;try{for(var r=a(c(this,Sg,"f").values()),n=r.next();!n.done;n=r.next()){n.value.stopInterval()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},Cg=function(e,t){var r,n;if(t)try{for(var i=a(c(this,Sg,"f").values()),o=i.next();!o.done;o=i.next()){var s=o.value;c(this,Rg,"m",Ug).call(this,s)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},Ng=function(e,t){var r=t.conversationType,n=t.targetId;(t.messageType,r===exports.ConversationType.CHATROOM)&&(e.stopPropagation(),c(this,Sg,"f").get(n)&&c(this,Rg,"m",wg).call(this,[t],n))},Pg=function(e,t){t.conversationType===exports.ConversationType.CHATROOM&&(e.stopPropagation(),this.emit("message",[t],t.targetId))},Lg=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r){e.stopPropagation();var o=c(this,Sg,"f").get(n);o&&o.handleMessageNotify(i)}},Mg=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r||4===r){e.stopPropagation();var o=c(this,Sg,"f").get(n);if(o)return 4===r?(c(this,Sg,"f").delete(n),void this._ctx.emit("chatroom",{chatroomDestroyed:n})):void o.handleKVNotify(i)}},wg=function(e,t){var r=this,n=e.filter((function(e){var n,i=e.messageType;if(i===ye.CHATROOM_MERGE_CHANGE){var o=function(e){var t={},r=[],n=e.content.memberCount||0;return Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,r.push({userId:e.userId,action:e.status,extra:e.extra})})),{users:t,chatroomId:e.targetId,memberCount:n,userList:r}}(e);return r._ctx.emit("chatroom",{userChange:o}),!1}if(i===ye.CHATROOM_MERGE_BAN){var s=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 r._ctx.emit("chatroom",{chatroomNotifyBan:s}),!1}if(i===ye.CHATROOM_SYNC_MSG){var a=function(e){var t=e.content;return{chatroomId:t.chatroomId,status:t.status,reason:t.reason,time:t.time,extra:t.extra||""}}(e);return r._ctx.emit("chatroom",{chatroomNotifyMultiLoginSync:a}),!1}if(i===ye.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===exports.ChrmMemOperateType.Blocked&&(null===(n=null==u?void 0:u.userIdList)||void 0===n?void 0:n.includes(r._ctx.currentUserId))&&c(r,Rg,"m",xg).call(r,t),r._ctx.emit("chatroom",{chatroomNotifyBlock:u}),!1}return!0}));this.emit("message",n,t)},Ug=function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l,d;return s(this,(function(s){switch(s.label){case 0:return t=e.roomId,r=e.extra,i=this.logger.createTraceId(),this.logger.info(H.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:t}),i),[4,c(this,Rg,"m",Dg).call(this,t,!1,r)];case 1:return o=s.sent(),this.logger.summary(H.L_REJOIN_CHATROOM_R,o,i,{chatroomId:t}),a=o.code,u=o.isOk,l=o.data,u?(e.restartInterval(),d=qg(l),this._ctx.emit("chatroom",{rejoinedRoom:n(n({chatroomId:t},d),{count:e.initCount})}),[2]):(a!==exports.ErrorCode.RC_CHATROOM_USER_KICKED&&a!==exports.ErrorCode.RC_CHATROOM_NOT_EXIST||c(this,Sg,"f").delete(t),this._ctx.emit("chatroom",{rejoinedRoom:{chatroomId:t,errorCode:a}}),[2])}}))}))},Dg=function(e,t,r){var n=Ku.encode(bs,{extra:r,nothing:1}),i=t?An.joinChrm:An.joinChrmR;return this._ctx.query(i,e,n,vs)},xg=function(e){var t=c(this,Sg,"f").get(e);t&&(t.stopInterval(),c(this,Sg,"f").delete(e))},Gg=function(e){var t=c(this,Sg,"f").get(e);return t?sr(t):ar(exports.ErrorCode.NOT_IN_CHATROOM)},Vg=function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return[4,this._ctx.query(An.pullKV,e,eh(0),void 0)];case 1:return(t=n.sent()).isOk?(r=th(t.data.pbData).entries,[2,sr(r.reduce((function(e,t){return e[t.key]=t.value,e}),{}))]):[2,t.wipe()]}}))}))};var Wg,Kg=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=es.localStorage,r=e.appkey,n=e.currentUserId,i=Ze(r,n),o=t.getItem(i)||"{}",s=JSON.parse(o);return{value:{value:{version:s.version||0,tags:s.tags||{},transLan:s.transLan||"zh",autoTrans:s.autoTrans||!1},key:i,stringify:!0}}}}),Object.defineProperty(r.prototype,"version",{get:function(){return this.get("value").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tags",{get:function(){return this.get("value").tags||{}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"forceUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.set("value",e)}}),Object.defineProperty(r.prototype,"addTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("value"),n=r.tags,i=r.autoTrans,o=r.transLan;n[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:n,autoTrans:i,transLan:o})}}),Object.defineProperty(r.prototype,"deleteTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("value"),n=r.tags,i=r.autoTrans,o=r.transLan;delete n[e],this.set("value",{version:t,tags:n,autoTrans:i,transLan:o})}}),r}(ld),Jg=function(e){function r(t){var r=e.call(this,"UserSettings")||this;return kg.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:void 0}),Fg.set(r,!1),r.storage=new Kg,r._ctx.on("onConnected",r._handleConnected,r),r._ctx.on("onDisconnected",r._handleDisconnected,r),r._ctx.on("onSuspend",r._handleDisconnected,r),r._ctx.on("signal",r._handleSignal,r),r}return t(r,e),Object.defineProperty(r.prototype,"_handleConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.storage.syncDataFromLocalStorage(this._ctx),d(this,Fg,!0,"f");var e=this.storage.version;this.setInitVersion(e),this.push(e)}}),Object.defineProperty(r.prototype,"_handleDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reset()}}),Object.defineProperty(r.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(Cn(t.topic)===An.s_us){var r=Ku.decode(fa,t.pbData).version;this.push(r),e.stopPropagation()}}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,d,p,f,_,h,g,E,b,v,T,I;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=this._ctx.getNaviInfoFromCache(),o=n.createTraceId(),n.info(H.L_SYNC_USER_SETTINGS_T,"version: ".concat(e),o),a=Ku.encode(Ks,{version:e,ipType:i.ipType||0}),[4,this._ctx.query(An.pullUS,r,a,Js)];case 1:return u=s.sent(),n.summary(H.L_SYNC_USER_SETTINGS_R,u,o),u.isOk?(l=u.data,d=l.version,p=l.items,f=!1,_=!1,h=!1,g="",E=this.storage.get("value"),b=E.transLan,v=E.autoTrans,T=E.tags,I={version:d,transLan:b,autoTrans:v,tags:T},null==p||p.forEach((function(e){var t=e.key,r=e.value;switch(t){case"Tag":I.tags={},e.tags.forEach((function(e){I.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),f=!0;break;case"transLan":h=!0,I.transLan=ki.readUTF(new Uint8Array(r));break;case"autoTrans":_=!0,I.autoTrans="1"===ki.readUTF(new Uint8Array(r));break;case"VoipInfo":g=ki.readUTF(new Uint8Array(r))}})),this.storage.set("value",I),f&&this.emit("tagsChanged"),h&&this.emit("userSettingsChanged",{key:Mr.TranslationLanguage,value:I.transLan}),_&&this.emit("userSettingsChanged",{key:Mr.AutoTranslateEnable,value:I.autoTrans}),g&&this.emit("voipInfoChanged",g),c(this,kg,"m",Bg).call(this,u.code),[2,sr({version:d})]):(c(this,kg,"m",Bg).call(this,u.code),[2,u.wipe()])}}))}))}}),Object.defineProperty(r.prototype,"hasTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.storage.tags[e]}}),Object.defineProperty(r.prototype,"getTags",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.storage.tags}}),Object.defineProperty(r.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=Ku.encode(da,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),[4,this._ctx.query(An.addSeTag,r,n,Ws)];case 1:return(i=s.sent()).isOk&&(o=i.data,a=o.version,u=o.updateVersion,this.storage.addTag(e,u?a:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=Ku.encode(pa,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),[4,this._ctx.query(An.delSeTag,r,n,Ws)];case 1:return(i=s.sent()).isOk&&(o=i.data,a=o.version,u=o.updateVersion,this.storage.deleteTag(e,u?a:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,kg,"m",Hg).call(this,An.transLan,e)]}))}))}}),Object.defineProperty(r.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,sr(this.storage.get("value").transLan||"zh")]}))}))}}),Object.defineProperty(r.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,kg,"m",Hg).call(this,An.autoTrans,e?"1":"0")]}))}))}}),Object.defineProperty(r.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,sr(this.storage.get("value").autoTrans)]}))}))}}),r}(nr);Fg=new WeakMap,kg=new WeakSet,Bg=function(e){c(this,Fg,"f")&&(d(this,Fg,!1,"f"),this.emit("userSettingsSynced",e))},Hg=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f,_,h;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.version,n=this._ctx.currentUserId,i=Ku.encode(Ys,{version:r,value:t,ignoreVersion:!0}),[4,this._ctx.query(e,n,i,Ws)];case 1:if((o=s.sent()).isOk){switch(a=o.data,u=a.version,l=a.updateVersion,c=this.storage.get("value"),d=c.transLan,p=c.autoTrans,f=c.tags,_=c.version,h={version:l?u:_,transLan:d,autoTrans:p,tags:f},e){case An.transLan:h.transLan=t;break;case An.autoTrans:h.autoTrans="1"===t}this.storage.set("value",h)}return[2,o.wipe()]}}))}))};var Qg=((Wg={})[exports.ConversationType.PRIVATE]=An.qryPMsg,Wg[exports.ConversationType.GROUP]=An.qryGMsg,Wg[exports.ConversationType.CHATROOM]=An.qryCHMsg,Wg[exports.ConversationType.CUSTOMER_SERVICE]=An.qryCMsg,Wg[exports.ConversationType.SYSTEM]=An.qrySMsg,Wg[exports.ConversationType.APP_PUBLIC_SERVICE]=An.qryMCMsg,Wg[exports.ConversationType.PUBLIC_SERVICE]=An.qryMPMsg,Wg[exports.ConversationType.ULTRA_GROUP]=An.qryUgMsg,Wg),Xg=function(e,t,r,n,i,o,s){return{conversationType:e,targetId:t,senderUserId:o,messageDirection:exports.MessageDirection.SEND,isCounted:!!r.isCounted,isMentioned:!!r.isMentioned,content:r.content,messageType:r.messageType,isOffLineMessage:!1,isPersited:!!r.isPersited,messageUId:n,sentTime:i,receivedTime:0,disableNotification:!!r.disableNotification,isStatusMessage:!!r.isStatusMessage,canIncludeExpansion:!!r.canIncludeExpansion,expansion:r.canIncludeExpansion?r.expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Ot(exports.ReceivedStatus.UNREAD),pushConfig:r.pushConfig,channelId:r.channelId,isInterrupt:r.isInterrupt,messageId:s||0,sentStatus:exports.SentStatus.SENT,directedUserIds:r.directionalUserIdList,disableUpdateLastMessage:r.disableUpdateLastMessage,needReceipt:r.needReceipt}},zg=[M.GROUP_OPERATION,M.GROUP_PROFILE_CHANGE,M.GROUP_APPLICATION_INVITATION,M.GROUP_FOLLOW_USER_CHANGE],Zg=[v.FRIEND_APPLICATION];function $g(){return function(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isConnected?[2,n.apply(this,e)]:[2,Promise.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})]}))}))},r}}function eE(){return function(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isConnected?[2,n.apply(this,e)]:[2,Promise.resolve(ar(exports.ErrorCode.RC_NET_UNAVAILABLE))]}))}))},r}}function tE(e){return e?e.map((function(e){var t;return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,remark:null!==(t=e.remarkName)&&void 0!==t?t:"",directionType:e.friendType,extProfile:e.extProfile,addTime:St(e.relationTime),inBlackList:!!e.flag}})):[]}function rE(e){return e&&e.list?e.list.map((function(e){return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",applicationType:e.type,applicationStatus:e.status,operationTime:St(e.operateTime),extra:e.info||"",friendType:e.friendType}})):[]}var nE,iE=function(e){function r(t,r,n){var i=this,o=n.loggerProxy?n.loggerProxy:Yc();i=e.call(this,t,r,n,new Lc(n.appkey,"IMLib","IM",o))||this,d.add(i),Object.defineProperty(i,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_sendMessageStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_readReceiptManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(i,"_pullOfflineFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"reporterStatistic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_loggerProxy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t,r){var n,o=r.messageType;if(o===ye.SYNC_READ_STATUS&&function(e){return[exports.ConversationType.GROUP,exports.ConversationType.DISCUSSION,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE].includes(e)}(e)&&Object.assign(r,{directionalUserIdList:[i.currentUserId]}),o===ye.READ_RECEIPT_RESPONSE){if(!r.content.receiptMessageDic||0===Object.keys(r.content.receiptMessageDic).length){var s=null===(n=i._readReceiptManager)||void 0===n?void 0:n.getReceiptMessageDic({conversationType:e,targetId:t,channelId:r.channelId});r.content.receiptMessageDic=s||{}}for(var a in r.directionalUserIdList=[],r.content.receiptMessageDic)r.directionalUserIdList.push(a)}return r}}),Object.defineProperty(i,"_isUltraGroupListExist",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"_ultraMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"setUserStatusListener",{enumerable:!0,configurable:!0,writable:!0,value:Qh}),Object.defineProperty(i,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Qh}),Object.defineProperty(i,"subscribeUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Qh}),Object.defineProperty(i,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Qh}),Object.defineProperty(i,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Qh}),Object.defineProperty(i,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"getLocalMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"deleteLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"deleteLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"batchClearLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"clearLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:Qh}),Object.defineProperty(i,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:Qh}),Object.defineProperty(i,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:Qh}),Object.defineProperty(i,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),Object.defineProperty(i,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Qh}),Object.defineProperty(i,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Xh}),i._loggerProxy=o;var s=n.appkey,a=n.logOutputLevel,u=n.logExpireTime,l=n.navigators,v=n.areaCode,T=n.logServerUrl,y=n.miniCMPProxy,m=n.environment,R=n.useNaviV2,S=void 0!==R&&R,A=n.enableReadReceiptStorage;i._environment=m||"default",i._enableReadReceiptStorage=A,i.logger.setOutputLevel(a),Gr.init({areaCode:v,navigators:l,logServerUrl:T,miniCMPProxy:y}),n.loggerProxy||jc(s,i.logger,u),i.reporter=new rd(s,i.logger,i._loggerProxy),i.navi=new ac(s,i.logger,new fc(s,i.logger),i._environment,S),i.reporterStatistic=new nd(s,i.logger,i._loggerProxy),i._sendMessageStore=new uc(s);var O=i._connMgr=new Nc(s,i.navi,i.logger),C=i._ctx=new _g(i._appkey,O,i.navi,i.logger);return i._connMgr.pipe(C),"browser"===es.tag&&i._initCloudController(),i._userSettings=new Jg(C),i._chat=new $h(C,i._userSettings),i._chatroom=new Yg(C),i._chatroom.on("message",i._handleChatroomMessages,i),C.on("conversationStatusChanged",i._conversationStatusChanged,i),C.on("sCmd",i._handleSCmdNotify,i),C.on("signal",i._handleSignal,i),C.on("onConnected",i.onConnected,i),C.on("onDisconnected",i.onDisconnected,i),C.on("onConnecting",i.onConnecting,i),C.on("onSuspend",i.onSuspend,i),C.on("ultraGroupEnable",i._handleUltraGroupEnable,i),C.on("messagesFromUG",i._handleMessagesFromUltraGroup,i),C.on("messagesFromSG",i._handleMessagesFromSignalGroup,i),C.on("smsgFromSignalGroup",i._handleSmsgFromSignalGroup,i),C.on("syncMsg",i._handleSyncMsg,i),C.on("sgRelationsSynced",i._handleSGRelationsSynced,i),C.on("serverEvent",c(i,d,"m",I),i),C.on("readReceiptResponseV5",c(i,d,"m",p),i),C.on("speechToTextResponse",c(i,d,"m",f),i),C.on("ugUserGroupChanged",i._handleUserGroupStatus,i),C.on("ugChannelChanged",i._handleUltraChannelChange,i),C.on("conversationStatusSynced",(function(e,t){return i._watcher.conversationStatusSynced(t)}),i),C.on("messageModified",c(i,d,"m",_),i),C.on("messageModifiedSyncCompleted",c(i,d,"m",h),i),C.on("ugMsgExpansionUpdated",c(i,d,"m",g),i),C.on("ugMsgRecalled",c(i,d,"m",E),i),C.on("conversation",c(i,d,"m",b),i),C.on("chatroom",i._handlerChatroomEvent,i),i._userSettings.on("voipInfoChanged",i._naviChangeHandler,i),i._userSettings.on("tagsChanged",(function(){return i._watcher.tag()}),i),i._userSettings.on("userSettingsSynced",(function(e,t){return i._watcher.userSettingsSynced(t)}),i),i._userSettings.on("userSettingsChanged",(function(e,t){return i._watcher.userSettingsChanged(t)}),i),i}var d,p,f,_,h,g,E,b,I,y,m;return t(r,e),Object.defineProperty(r.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"userSettings",{get:function(){return this._userSettings},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;e=u(Gr.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new Pc(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Qr.init)}}),Object.defineProperty(r.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.navi.getNaviInfoFromCache(this._connMgr.getToken());this._pullOfflineFinished=!1,this._readReceiptManager||(this._readReceiptManager=new pc(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(r),this._sendMessageStore.init(this.currentUserId),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(),this.reporter.checkStart(r),this.reporterStatistic.checkStart(r)}}),Object.defineProperty(r.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}}),Object.defineProperty(r.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.onSuspend(t)}}),Object.defineProperty(r.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(r.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.conversation(t);var r=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));r&&this._watcher.conversationTag()}}),Object.defineProperty(r.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new dc(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var r,n;null===(n=(r=t._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(r,e)},subscribeUserStatusChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedUserStatusChange)||void 0===n||n.call(r,e)},subscribeRelationChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedRelationChange)||void 0===n||n.call(r,e)},ownUserProfileChanged:function(e){var r,n;null===(n=(r=t._watcher).ownUserProfileChanged)||void 0===n||n.call(r,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(r.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new Lc(this._appkey,e,t,this._loggerProxy)}}),Object.defineProperty(r.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(r.prototype,"naviInfo",{get:function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectionStatus",{get:function(){return this._connMgr.getConnectionStatus()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return this._openCallPlus=r,[2,this._connMgr.connect(e,t,r,n)]}))}))}}),Object.defineProperty(r.prototype,"_handleUltraGroupEnable",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._isUltraGroupListExist=!0,this._watcher.ultraGroupEnable()}}),Object.defineProperty(r.prototype,"_handleSGRelationsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.sgRelationsSynced(t)}}),Object.defineProperty(r.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=new Map,o=[];t.forEach((function(e){var t,r,s,a=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,d=e.isMentioned,p=e.isCounted,f=e.senderUserId,_=e.messageType,h=e.sentTime,g=e.channelType,E=e.isPersited;if(n._ultraMsgMap[l])delete n._ultraMsgMap[l];else{var b={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:a,channelId:c||""},v=n._chat.storage.getOrCreateModel(b,!0),T=i.get(v)||{params:{channelType:g},time:h};i.set(v,T),T.time=h;var I=T.params;if(E&&(I.hidden=!1,I.latestMessage=e,I.operationTime=h),p&&f!==n.currentUserId&&_!==ye.RECALL_NOTIFICATION_MESSAGE){I.unreadCount=(I.unreadCount||v.unreadCount)+1;var y=(null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===exports.MentionedType.ALL;d&&(y||(null===(s=null===(r=null==u?void 0:u.mentionedInfo)||void 0===r?void 0:r.userIdList)||void 0===s?void 0:s.includes(n.currentUserId)))&&(I.unreadMentionedCount=(I.unreadMentionedCount||v.unreadMentionedCount)+1,y||(I.unreadMentionedMeCount=(I.unreadMentionedMeCount||v.unreadMentionedMeCount)+1),I.hasMentioned=!0,I.mentionedInfo=null==u?void 0:u.mentionedInfo),v.firstUnreadMessage||I.firstUnreadMessageUId||(I.firstUnreadMessageType=_,I.firstUnreadMessageUId=l,I.firstUnreadTime=h)}o.push(e)}}));var s=[],a=[];Array.from(i.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1],i=n.params,o=n.time;s.push(r);var l=r.updateAttrs(i,o);l&&a.push({conversation:r.toIReceivedConversation(),updatedItems:l})})),this._chat.storage.updateConversationStorage(s),a.length>0&&this._watcher.conversation(a),this._batchMessage(o)}}),Object.defineProperty(r.prototype,"_handleChatroomMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=this._connMgr.getConnectedTime(),o=[];if(t.forEach((function(e){e.sentTime>=i&&n._writeMessagesLog(exports.ConversationType.CHATROOM,e.messageUId)&&o.push(e.messageUId)})),o.length>0){var s=Date.now();this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:s,server_deltatime:s-this._connMgr.getCrtServerTime(),msg_ids:o.join(",")}))}this._watcher.batchMessage(t)}}),Object.defineProperty(r.prototype,"_handlerChatroomEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.chatroom(t)}}),Object.defineProperty(r.prototype,"_handleMessagesFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=this._messageProcessor(t),o=i.newOutboxTime;i.messageUIds;var s=i.messages,a=i.messageExpansionList,u=i.RSMsgList,l=i.msgUIds2Statistic;l.length>0&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:l.join(",")})),this._batchMessage(s),a.forEach((function(e){n._receiveMessageExpansion(e)})),u.forEach((function(e){n._processRSMsg(e)})),this._sendMessageStore.removeByTimestamp(o),r&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this.logger.info(H.L_PULL_OFFLINE_MESSAGE_FINISHED_S),this._watcher.pullFinished(),this._chat.startPullModifyMsg())}}),Object.defineProperty(r.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=t.syncMsg,o=t.topic;if(i)this._receiveSyncMsg(t,r);else switch(Cn(o)){case An.rtc_ntf:this._receiveRtcKv(t.pbData);break;case An.s_opNtf:this._pullOperateStatusNotify(t);break;case An.s_pubCall:this._pubCallInfo(t);break;case An.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(t)}}}),Object.defineProperty(r.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n,i,o=t.time;switch(t.type){case 8:null===(r=this._subscribeManager)||void 0===r||r.startsyncSubscribeUserStatus(o);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(o);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(r.prototype,"_receiveMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,r=e.channelId,n=void 0===r?"":r,i=e.conversationType,o=e.targetId,s=t.put,a=t.del,u=t.mid;s&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:s,channelId:n,conversationType:i,targetId:o}}),a&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:a,channelId:n,conversationType:i,targetId:o}})}}),Object.defineProperty(r.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this._chat.storage.clearConversationUnreadCount({conversationType:e,targetId:t,channelId:r},i);n&&o&&this._watcher.conversation([o])}}),Object.defineProperty(r.prototype,"_setConversationCacheByMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.isPersited,i=e.targetId,o=e.channelId,s=e.sentTime,a=e.disableUpdateLastMessage;e.messageDirection;var u=e.senderUserId,l=e.messageType,c=e.isCounted,d=e.messageUId,p=e.content,f=e.isMentioned;if(ee(t,K)){var _=this.naviInfo,h=this._chat.storage.getOrCreateModel({conversationType:t,targetId:i,channelId:o},!0),g={},E=u===this.currentUserId,b=l===ye.RECALL,v=h.lastReadTime>s;if(c&&!Zl(_).isOk&&!b&&!E&&!v&&(0===h.unreadCount&&(g.firstUnreadMessageUId=d,g.firstUnreadTime=s,g.firstUnreadMessageType=l),g.unreadCount=h.unreadCount+1,f&>(p)&&p.mentionedInfo)){g.hasMentioned=!0,g.mentionedInfo=p.mentionedInfo;var T=p.mentionedInfo,I=T.type,y=T.userIdList;(I===exports.MentionedType.ALL||(y||[]).includes(this.currentUserId))&&(g.unreadMentionedCount=h.unreadMentionedCount+1)}if(b&>(p)){var m=p,R=m.sentTime,S=m.messageUId;!this._ctx.userStorage.recallMsgMap.has(S)&&h.unreadCount>0&&R>h.lastReadTime&&(this._ctx.userStorage.recallMsgMap.add(S),g.unreadCount=h.unreadCount-1,0===h.unreadCount&&(g.firstUnreadMessageUId="",g.firstUnreadTime=0,g.firstUnreadMessageType=""))}if(r&&(b&&!h.hidden||(g.operationTime=s),g.hidden=!1,a||h.latestMessage&&!(h.latestMessage.sentTime<s)||(g.latestMessage=e)),this._ctx.includeUg&&l===ye.EXPANSION_NOTIFY&&h.latestMessage&&h.latestMessage.messageUId===d){var A=p,O=A.put,C=A.del;A.clear?h.latestMessage.expansion={}:O?h.latestMessage.expansion=n(n({},h.latestMessage.expansion),O):C&&h.latestMessage.expansion&&C.forEach((function(e){delete h.latestMessage.expansion[e]}))}var N=h.updateAttrs(g,e.sentTime);this._chat.storage.updateConversationStorage([h]),N&&r&&!a&&this._watcher.conversation([{conversation:h.toIReceivedConversation(),updatedItems:N}])}}}),Object.defineProperty(r.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;switch(Cn(e.topic)){case An.updRTime:this._receivesyncReadStatus(e);break;case An.updUserSub:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(r.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,r=[],n=[],i=[],o=e.length-1;o>=0;o-=1){var s=e[o];s.messageType===ye.LOG_COMMAND&&s.senderUserId===Fe?n.unshift(s):s.messageType===ye.CLOUD_CONTROL&&s.senderUserId===Fe?i.push(s):r.unshift(s)}this._watcher.batchMessage(r),n.forEach((function(e){var r=e.content,n=r.startTime,i=r.endTime,o=r.platform,s=r.logId,a=r.uri;t.reporter.report(parseInt(n,10),parseInt(i,10),o,a,s,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)}}),Object.defineProperty(r.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return e.shift()?(r=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,Qr.other,r)]):[3,2];case 1:n=o.sent()||0,(i=e.filter((function(e){return e.sentTime>n}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(r.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ku.decode(Ca,e.pbData),r=t.key,n=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:r,value:n}]}))}}),Object.defineProperty(r.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ku.decode(ws,e.pbData),r=t.type,n=t.channelId,i=t.msgTime,o=t.busChannel;this._clearConversationUnreadCount(r,n,o||"",!0,i),this._watcher.syncReadStatus({conversationType:r,targetId:n,channelId:o,timestamp:i})}}),Object.defineProperty(r.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n;return s(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=Ku.encode(Na,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._connMgr.query(An.pullKvMsg,this.currentUserId,e,Pa)]):[2];case 1:return t=i.sent(),r=t.isOk,n=t.data,r&&n?(this._latestPullKVMsgTimestamp=n.maxTime,this._watcher.callInfo(JSON.stringify({list:n.info})),[2]):[2]}}))}))}}),Object.defineProperty(r.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_filterMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType;return t===ye.DELIVERED||t===ye.DELIVERED_MSG||t===ye.SYNC_READ_STATUS&&!this._processSRSMsg(e)}}),Object.defineProperty(r.prototype,"_messageProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=0,n=[],i=[],o=[],s=[],a=[];return e.forEach((function(e){var u=e.conversationType,l=e.targetId,c=e.channelId,d=e.messageDirection,p=e.messageUId,f=e.messageType,_=e.sentTime,h=e.senderUserId,g=e.content;if(n.push(p),d===exports.MessageDirection.SEND){r=Math.max(_,r);var E=t._sendMessageStore.getSendMessageMap(),b=f===ye.RECALL?"Cmd:".concat(g.messageUId):p;if(E[b])return void t._sendMessageStore.removeByUID(b)}if(!t._filterMessage(e)){switch(_>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,p)&&a.push(p),f){case ye.EXPANSION_NOTIFY:return void o.push(e);case ye.READ_RECEIPT:h===t.currentUserId&&t._clearConversationUnreadCount(u,l,c,!0,_);break;case ye.READ_STATE:return void s.push(e);case ye.READ_RECEIPT_REQUEST:t._enableReadReceiptStorage&&t._processRRReqMsg(e);break;case ye.READ_RECEIPT_RESPONSE:t._enableReadReceiptStorage&&t._processRRRspMsg(e)}var v=t._handleMsgProperties(e);t._setConversationCacheByMessage(v),i.push(v)}})),{newOutboxTime:r,messageUIds:n,messages:i,messageExpansionList:o,RSMsgList:s,msgUIds2Statistic:a}}}),Object.defineProperty(r.prototype,"_processSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=e.content,o=e.senderUserId,s=e.sentTime;if(o!==this.currentUserId)return!1;var a=this.naviInfo;return this._clearConversationUnreadCount(t,r,n,!0,s),1!==a.sesDriven||(s>this.connectedTime||this._watcher.syncReadStatus({conversationType:t,targetId:r,channelId:n,timestamp:i.lastMessageSendTime}),!1)}}),Object.defineProperty(r.prototype,"_processRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,i=e.channelId,o=e.content,s={conversationType:t,targetId:r,channelId:i};this._watcher.messageReadReceipt(t===exports.ConversationType.PRIVATE?{privateReadReceipt:n(n({},s),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:n(n({},s),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})}}),Object.defineProperty(r.prototype,"_processRRReqMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.conversationType,n=e.channelId,i=e.targetId,o=e.content,s=e.sentTime,a=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:r,channelId:n,targetId:i},o.messageUId,a,s,u)}}),Object.defineProperty(r.prototype,"_processRRRspMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i=this,o=e.conversationType,s=e.channelId,u=e.targetId,l=e.content,c=e.senderUserId,d=l.receiptMessageDic,p=void 0===d?{}:d;if(c===this.currentUserId)for(var f in p){var _=p[f];try{for(var h=(t=void 0,a(_)),g=h.next();!g.done;g=h.next()){var E=g.value;null===(n=this._readReceiptManager)||void 0===n||n.remove({conversationType:o,channelId:s,targetId:u},E)}}catch(e){t={error:e}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}}else(p[this.currentUserId]||[]).forEach((function(e){var t;null===(t=i._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:o,channelId:s,targetId:u},e,c)}))}}),Object.defineProperty(r.prototype,"_handleSmsgFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.conversationType,n=t.senderUserId,i=t.messageUId,o=t.sentTime;this._writeMessagesLog(r,i)&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),n!==this.currentUserId||t.isStatusMessage||this._sendMessageStore.setMessage(i,o),this._handleNotNotifyMsg(t)||(this._handleReadReceiptStorage(t),this._setConversationCacheByMessage(t),this._batchMessage([t]))}}),Object.defineProperty(r.prototype,"_handleReadReceiptStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._enableReadReceiptStorage){var t=e.messageType;t===ye.READ_RECEIPT_REQUEST&&this._processRRReqMsg(e),t===ye.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(e)}}}),Object.defineProperty(r.prototype,"_handleSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageStore.setMessage(t.messageUId,t.sentTime),this.logger.info(H.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),t.messageType!==ye.EXPANSION_NOTIFY?((t.messageType===ye.SYNC_READ_STATUS||t.messageType===ye.READ_RECEIPT&&t.senderUserId===this.currentUserId)&&this._clearConversationUnreadCount(t.conversationType,t.targetId,t.channelId,!0,t.sentTime),t.messageType===ye.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),t.messageType===ye.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._setConversationCacheByMessage(t),this._batchMessage([t])):this._receiveMessageExpansion(t)}}),Object.defineProperty(r.prototype,"_handleNotNotifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType,r=e.senderUserId;return t===ye.DELIVERED||(t===ye.DELIVERED_MSG||(t===ye.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===ye.SYNC_READ_STATUS&&r!==this.currentUserId||t===ye.READ_STATE&&(this._processRSMsg(e),!0)))}}),Object.defineProperty(r.prototype,"_handleMsgProperties",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!1);var r,n=e.messageType,i=e.isStatusMessage,o=e.isCounted,s=void 0!==o&&o,a=e.isPersited,u=void 0!==a&&a;return r=cn(n)?ln(n):{isCounted:s,isPersited:u,isStatusMessage:!1},Object.assign(e,r),t&&!bt(i)&&(e.isStatusMessage=i),e}}),Object.defineProperty(r.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f,_,h,g=this;return s(this,(function(s){switch(s.label){case 0:return r=e.conversationType,n=e.targetId,i=e.channelId,o=t.timestamp,a=t.count,u=t.order,l=Qg[r],c=this.currentUserId,d=X_({targetId:n,busChannel:i,time:o||(1===u?1:this._connMgr.getCrtServerTime()+6e4),count:a,order:u}),p=r===exports.ConversationType.CHATROOM?n:c,[4,this._connMgr.query(l,p,d,void 0)];case 1:return(f=s.sent()).isOk?(_=z_(f.data.pbData),h=_.list.map((function(e){var t,r=Jl(e,c,!1,n),i=null===(t=g._readReceiptManager)||void 0===t?void 0:t.getReadReceiptInfo(r,r.messageUId);if(i){var o=i.users;r.readReceiptInfo={isReceiptRequestMessage:!0,readerList:o}}return r})),[2,sr({hasMore:!!_.hasMsg,list:0===u?h.reverse():h})]):[2,f.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=(t=this).currentUserId,n=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(H.L_VER_REPORT_T,o,i),a=Ku.encode(_a,{sdkInfo:o}),u=new to(An.reportsdk,a,r),[4,n.send(u)]):[2];case 1:return(l=s.sent().code)!==exports.ErrorCode.SUCCESS&&this.logger.warn(H.L_VER_REPORT_R,l,i),[2]}}))}))}}),Object.defineProperty(r.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return this._chat.storage.setDrafts(e,t),[2,sr()]}))}))}}),Object.defineProperty(r.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this._chat.storage.getDrafts(e),[2,sr(t)]}))}))}}),Object.defineProperty(r.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._chat.storage.deleteDrafts(e),[2,sr()]}))}))}}),Object.defineProperty(r.prototype,"_writeMessagesLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=null===(r=this.cloudController)||void 0===r?void 0:r.getMRTRConfig();if(!n)return!1;var i=function(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(t),o=0;switch(e){case exports.ConversationType.PRIVATE:o=n.private;break;case exports.ConversationType.GROUP:o=n.group;break;case exports.ConversationType.CHATROOM:o=n.chatroom;break;case exports.ConversationType.ULTRA_GROUP:o=n.ultraGroup}return!!o&&i%(1/o)==0}}),Object.defineProperty(r.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c,d,p,f,_,h,g,E,b,v,T;return s(this,(function(s){switch(s.label){case 0:return r=this._handleInnerMsgOptions(e,t,r),r=this._handleMsgProperties(r,!0),o=!1,[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP].includes(e)&&(r.isStatusMessage||ln(r.messageType).isStatusMessage)&&(o=!0),u=o?function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=An.ppMsgS,t[exports.ConversationType.GROUP]=An.pgMsgS,t)[e]}(e):function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=An.ppMsgP,t[exports.ConversationType.GROUP]=An.pgMsgP,t[exports.ConversationType.CHATROOM]=An.chatMsg,t[exports.ConversationType.CUSTOMER_SERVICE]=An.pcMsgP,t[exports.ConversationType.RTC_ROOM]=An.prMsgS,t[exports.ConversationType.SYSTEM]=An.pbMsgP,t)[e]}(e)||An.ppMsgP,o&&(r.isPersited=!1,r.isCounted=!1),l=r.messageId?r.messageId:Jt(),r.messageId=l,c=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},r),(d=new ro(An[u],c,e===exports.ConversationType.SYSTEM?this.currentUserId:t)).setHeaderQos(Ln),o?(this._connMgr.sendOnly(d),[2,sr(Xg(e,t,n({},r),"",0,this.currentUserId,l))]):(p=this._connMgr.getCrtServerTime(),f=Xg(e,t,n(n({},r),{isStatusMessage:o}),"",p,this.currentUserId,l),null==a||a(l),this.logger.info(H.L_SEND_MSG_T,JSON.stringify({messageType:r.messageType,conversationType:e,targetId:t,channelId:r.channelId}),i),_=Date.now(),[4,this._connMgr.send(d)]);case 1:return h=s.sent(),g=h.code,E=h.isOk,b=h.msg,v=h.data,E?(this.logger.info(H.L_SEND_MSG_R,JSON.stringify({code:g,messageUId:null==v?void 0:v.messageUId,messageId:null==v?void 0:v.messageId}),i),T=v,this._sendMessageSuccessHandle(f,T),this._writeMessagesLog(e,T.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:T.messageUId,channel:e,start_ts:_,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),[2,sr(f)]):(this.logger.warn(H.L_SEND_MSG_R,JSON.stringify({code:g,messageUId:f.messageUId,messageId:f.messageId}),i),this._writeMessagesLog(e)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:e,start_ts:_,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),f.sentStatus=exports.SentStatus.FAILED,[2,ar(g,b,f)])}}))}))}}),Object.defineProperty(r.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._setConversationCacheByMessage(e);var i=e.messageType,o=e.conversationType,s=e.targetId,a=e.channelId,u=e.sentTime,l=e.content,c=e.messageDirection;if(this._enableReadReceiptStorage){if(i===ye.READ_RECEIPT_REQUEST){var d=l.messageUId;null===(r=this._readReceiptManager)||void 0===r||r.insert({conversationType:o,targetId:s,channelId:a},d,c,u)}if(i===ye.READ_RECEIPT_RESPONSE){var p=l.receiptMessageDic;if(!p)return;for(var f in p)p[f].forEach((function(e){var t;null===(t=n._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:s,channelId:a},e)}))}}}}),Object.defineProperty(r.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p,f,_,h,g,E,b,v,T,I,y;return s(this,(function(s){switch(s.label){case 0:return i=e.targetId,o=e.conversationType,a=e.channelId||"",u=t.user,l=t.extra,c=t.isDelete,d=t.directionalUserIdList,p=t.disableUpdateLastMessage,f=t.messageUId,_=t.sentTime,h={conversationType:o,targetId:i,messageUId:f,sentTime:_,channelId:a,isDelete:c||!1,isAdmin:t.isAdmin},u&&(h.user=u),l&&(h.extra=l),g={content:h,messageType:"RC:RcCmd",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,pushContent:(null===(r=t.pushConfig)||void 0===r?void 0:r.pushContent)||t.pushContent||"",channelId:a,disableUpdateLastMessage:p},[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP].includes(o)&&d&&(g.directionalUserIdList=d),E=this._connMgr.codec.encodeUpMsg({conversationType:o,targetId:i},g),(b=new ro(An.recallMsg,E,this.currentUserId)).setHeaderQos(Ln),[4,this._connMgr.send(b)];case 1:return(v=s.sent()).isOk?(T=v.data,o!==exports.ConversationType.ULTRA_GROUP&&(I="Cmd:".concat(f),T.messageUId=I),y=Xg(o,i,n(n({},g),{isPersited:!0}),T.messageUId,T.timestamp,this.currentUserId),o===exports.ConversationType.ULTRA_GROUP?(this._ultraMsgMap[T.messageUId]=T.timestamp,this._updateUltraGroupWhenRecallMsg(i,a,f)):(this._sendMessageStore.setMessage(T.messageUId,T.timestamp),this._setConversationCacheByMessage(y)),[2,sr(y)]):[2,v.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return this._isConnected?(n=this._connMgr.codec.encodeMessageReader(t,r),i=new to(An[An.rrList],n,e),[2,this._connMgr.send(i,ca)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return n=this._connMgr.codec.encodeReadReceiptMsg(e,t,r),i=new ro(An[An.sendMsgRead],n,e.targetId),[2,this._connMgr.send(i)]}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){return r=this._connMgr.codec.encodeReceiptQryReq(e,t),n=new to(An[An.qryMsgRead],r,e.targetId),[2,this._connMgr.send(n,wa)]}))}))}}),Object.defineProperty(r.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeReceiptCntQryReq(e,t),i=new to(An[An.qryMsgReadCntBatch],r,e.targetId),[4,this._connMgr.send(i,Da)];case 1:return o=s.sent(),a=o.code,u=o.data,l=(u||{result:[]}).result,a===exports.ErrorCode.SUCCESS&&l?[2,{code:a,data:l.map((function(t){return n({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}]:[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=H_(e,t),n=new ro(An.updRTime,r,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._connMgr.getToken();this.navi.updateVoipCallInfo(r,t);var i=this.navi.getNaviInfoFromCache(r);this._watcher.onNaviDataChange(n({},i))}}),Object.defineProperty(r.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,a,u){return o(this,void 0,void 0,(function(){var o,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(o=i&&"uploads"!==i?t||"":Ht(e,t),l=this.naviInfo,c=Zt(l,this.logger),d="",c||(d=JSON.stringify({uploadDomain:c})),p=Ku.encode(_s,{type:e,key:o,httpMethod:r||"",queryString:i||"",url:a||"",ext:d,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._connMgr.query(An.qnTkn,this.currentUserId,p,gs)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,s.sent().trans((function(e){return n(n({},e),{fileName:o,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(r.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this.naviInfo,a="",u="",t===exports.UploadMethod.QINIU?o=An.qnUrl:t===exports.UploadMethod.AWS?o=An.s3Url:t===exports.UploadMethod.STC?o=An.stcUrl:t===exports.UploadMethod.MINIO?(o=An.minioUrl,a=Zt(i,this.logger),u=JSON.stringify({url:a})):o=An.aliUrl,l=Ku.encode(hs,{type:e,key:r,fileName:n,ext:u,size:-1,ipType:i.ipType||0}),[4,this._connMgr.query(o,this.currentUserId,l,Es)];case 1:return[2,s.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect(e,t)];case 1:return r.sent(),this._resetMemoryState(),[2]}}))}))}}),Object.defineProperty(r.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._isUltraGroupListExist=!1,this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager}}),Object.defineProperty(r.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(r.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"userId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,ar(exports.ErrorCode.TAG_EXISTS)]:[2,this._userSettings.createTag(e)]}))}))}}),Object.defineProperty(r.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._userSettings.hasTag(e)?[2,this._userSettings.removeTag(e)]:[2,ar(exports.ErrorCode.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(r.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,this._userSettings.createTag(e)]:[2,ar(exports.ErrorCode.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(r.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){for(i in t=this._userSettings.getTags(),r=this._chat.storage.getTagConversationCountMap(),n=[],t)n.push({tagId:i,tagName:t[i].tagName,createdTime:t[i].createdTime,conversationCount:(null===(e=r.get(i))||void 0===e?void 0:e.length)||0});return[2,sr(n)]}))}))}}),Object.defineProperty(r.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){return(t=this._chat.storage.getModel(e))?(r=this._getUnreadCount(t.unreadMentionedCount),[2,sr(r)]):[2,sr(0)]}))}))}}),Object.defineProperty(r.prototype,"_getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e>999?999:e}}),Object.defineProperty(r.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,d,p,f,_,h,g,E,b;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._handleMsgProperties(t,!0),o=t.messageId?t.messageId:Jt(),t.messageId=o,a=this._connMgr.codec.encodeUpMsg({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e},t),(u=new ro(An[An.ugMsg],a,e)).setHeaderQos(Ln),l=this._connMgr.getCrtServerTime(),c=Xg(exports.ConversationType.ULTRA_GROUP,e,n({},t),"",l,this.currentUserId,o),i&&i(o),this.logger.info(H.L_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t.channelId}),r),d=Date.now(),[4,this._connMgr.send(u)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return p=s.sent(),f=p.code,_=p.data,f!==exports.ErrorCode.SUCCESS?(this.logger.warn(H.L_SEND_MSG_R,JSON.stringify({code:f,messageUId:c.messageUId,messageId:c.messageId}),r),this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentStatus=exports.SentStatus.FAILED,[2,{code:f,data:c}]):(this.logger.info(H.L_SEND_MSG_R,JSON.stringify({code:f,messageUId:null==_?void 0:_.messageUId,messageId:null==_?void 0:_.messageId}),r),h=_,this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP,h.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:h.messageUId,channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentTime=h.timestamp,c.messageUId=h.messageUId,this._ultraMsgMap[h.messageUId]=h.timestamp,g=t.channelId||"",E=this._chat.storage.getOrCreateModel({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:g},!0),(b=E.updateAttrs({operationTime:h.timestamp,latestMessage:n({},c)},h.timestamp))&&this._watcher.conversation([{conversation:E.toIReceivedConversation(),updatedItems:b}]),[2,{code:f,data:c}])}}))}))}}),Object.defineProperty(r.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.pbData,Sa),r=t.conversationType,n=t.info,i=t.summary;this.logger.debug(H.O,"s_opNtf -> type: ".concat(r,", info: ").concat(n,", summary: ").concat(i)),this._watcher.operateStatus(t)}}}),Object.defineProperty(r.prototype,"_handleConvertEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=[];e.filter((function(e){return 0===e.subChangeType})).forEach((function(e){var t=Ku.decode(Uu,new Uint8Array(e.eventData)).results;n.push.apply(n,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===exports.ErrorCode.SUCCESS?bn.SUCCESS:bn.FAILED}}}))),!1))})),n.length&&(null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,n))}}),Object.defineProperty(r.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:zg},Friend:{map:{},types:Zg}},r=function(e,t,r){e[t]||(e[t]=[]),e[t].push(r)};e.forEach((function(e){var n=e.changeType;for(var i in t)if(t[i].types.includes(n)){r(t[i].map,n,e);break}}));var n={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&n[i](t[i].map)}}),Object.defineProperty(r.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=M.GROUP_OPERATION,r=M.GROUP_PROFILE_CHANGE,n=M.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[r]&&this._handleGroupProfileChange(e[r]),e[n]&&this._handleFollowUserChange(e[n])}}),Object.defineProperty(r.prototype,"_processChangeMapFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e[v.FRIEND_APPLICATION]||[]).forEach((function(e){var r,n,i,o,s,a,u,l,c,d,p=e.subChangeType,f=e.businessId,_=e.time,h=e.eventData,g=T.FRIEND_APPLY,E=T.FRIEND_REFUSE,b=T.FRIEND_USER_INFO,v=T.FRIENDS_INPUT,I=T.FRIEND_CLEAR,y=T.FRIEND_INFO_CHANGE,m=T.FRIEND_INFO_CHANGE_SYNC;switch(p){case g:case E:var R=p===g?exports.FriendApplicationStatus.UNHANDLED:exports.FriendApplicationStatus.REFUSED;null===(n=(r=t._watcher).friendApplicationStatusChanged)||void 0===n||n.call(r,{userId:f,applicationType:h.applyType,applicationStatus:R,directionType:h.friendType,operationTime:_,extra:h.info||""});break;case b:null===(o=(i=t._watcher).friendAdd)||void 0===o||o.call(i,{userId:f,name:h.name,portraitUri:h.portraitUrl,directionType:h.friendType,operationTime:_});break;case v:null===(a=(s=t._watcher).friendDelete)||void 0===a||a.call(s,{userIds:h.targetId,directionType:h.type,operationTime:_});break;case I:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,_);break;case y:break;case m:null===(d=(c=t._watcher).friendInfoChangedSync)||void 0===d||d.call(c,{userId:f,remark:h.remarkname,extProfile:h.extProfile,operationTime:_})}}))}}),Object.defineProperty(r.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,s=e.subChangeType,a=e.businessId,l=e.time,c=e.eventData,d=c.optUserInfo,p=c.channelInfo,f=c.userInfos,_={groupId:a,operation:s,operationTime:l};d&&(r=u(xt([d]),1),_.operatorInfo=r[0]),s===exports.GroupOperation.CREATE&&(n=u(Mt([p]),1),_.groupInfo=n[0]),[exports.GroupOperation.CREATE,exports.GroupOperation.DISMISS].includes(s)||(_.memberInfos=xt(f)),null===(o=(i=t._watcher).groupOperation)||void 0===o||o.call(i,_)}))}}),Object.defineProperty(r.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,s,a,l=e.businessId,c=e.time,d=e.eventData,p=e.subChangeType,f=e.secondaryId;switch(p){case O.GROUP_INFO_CHANGE:var _=u(xt([d.optUserInfo]),1)[0],h=u(wt([d.channelInfo]),1)[0],g=u(d.channelFullInfo?wt([d.channelFullInfo]):[void 0],1)[0];null===(n=(r=t._watcher).groupInfoChanged)||void 0===n||n.call(r,{operatorInfo:_,groupInfo:h,changedGroupInfo:h,operationTime:c,fullGroupInfo:g});break;case O.MEMBER_PROFILE_CHANGE:_=u(xt([d.optUserInfo]),1)[0];var E=xt(d.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:l,operatorInfo:_,memberInfo:E,operationTime:c});break;case O.GROUP_REMARK_DELETE:case O.GROUP_REMARK_SET:var b=p===O.GROUP_REMARK_SET?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(a=(s=t._watcher).groupRemarkChangedSync)||void 0===a||a.call(s,{groupId:l,operationType:b,operationTime:c,groupRemark:f})}}))}}),Object.defineProperty(r.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i=e.subChangeType,o=e.businessId,s=e.time,a=e.userGroupIds,u=1===i?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(n=(r=t._watcher).groupFollowsChangedSync)||void 0===n||n.call(r,{groupId:o,operationType:u,operationTime:s,userIds:a})}))}}),Object.defineProperty(r.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=[],o=[];t.forEach((function(e){var t=e.subChangeType,s=e.targetId;e.msgTime;var a=e.operatorId,u=e.busChannelType,l=e.time,c=e.busChannel||"",d={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:s,channelId:c},p=r._chat.storage.getModel(d);switch(t){case ie.PRIVATE_TO_PUBLIC:null==p||p.updateAttrs({channelType:exports.UltraGroupChannelType.PUBLIC}),n.push({targetId:s,channelId:c,changeType:exports.UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC,channelType:exports.UltraGroupChannelType.PUBLIC});break;case ie.PUBLIC_TO_PRIVATE:null==p||p.updateAttrs({channelType:exports.UltraGroupChannelType.PRIVATE}),n.push({targetId:s,channelId:c,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE,channelType:exports.UltraGroupChannelType.PRIVATE});break;case ie.PUBLIC_TO_PRIVATE_USER_NOT_IN:p&&r._chat.storage.removeConversation(p),n.push({targetId:s,channelId:c,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:u});break;case ie.CHANNEL_DELETE:p&&r._chat.storage.removeConversation(p),i.push({targetId:s,channelId:c,channelType:u,deleteTime:l});break;case ie.CHANNEL_USER_KICKED:o.push({targetId:s,channelId:c,userId:a,channelType:exports.UltraGroupChannelType.PRIVATE}),a===r.currentUserId&&p&&r._chat.storage.removeConversation(p);case ie.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),i.length>0&&this._watcher.ultraGroupChannelDelete(i),o.length>0&&this._watcher.ultraGroupChannelUserKicked(o)}}),Object.defineProperty(r.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var e,r,n,i,o,a;return s(this,(function(s){return e=[],r=[],n=[],i=[],o=[],t.forEach((function(t){var s=t.type,a=t.targetId,u=t.busChannelType,l=t.busChannel,c=t.userGroupIds;switch(t.subChangeType){case oe.REMOVE_USER_GROUP:e.push({conversation:{conversationType:s,targetId:a},userGroupIds:c});break;case oe.JOIN_USER_GROUP:r.push({conversation:{conversationType:s,targetId:a},userGroupIds:c});break;case oe.EXIT_USER_GROUP:n.push({conversation:{conversationType:s,targetId:a},userGroupIds:c});break;case oe.CHANNEL_BIND_USER_GROUP:i.push({conversation:{conversationType:s,targetId:a,channelId:l},channelType:u,userGroupIds:c});break;case oe.CHANNEL_UNBIND_USER_GROUP:o.push({conversation:{conversationType:s,targetId:a,channelId:l},channelType:u,userGroupIds:c})}})),a={},e.length>0&&(a.userGroupDisband=e),r.length>0&&(a.userAdded=r),n.length>0&&(a.userRemoved=n),i.length>0&&(a.userGroupBindChannel=i),o.length>0&&(a.userGroupUnBindChannel=o),this._watcher.userGroupStatus(a),[2]}))}))}}),Object.defineProperty(r.prototype,"_updateUltraGroupWhenRecallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this._chat.storage.getModel({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t});if(o){var s={},a=o.latestMessage;a&&a.messageUId===r&&(s.latestMessage=null),n&&o.lastReadTime<n&&o.unreadCount&&(s.unreadCount=o.unreadCount-1,i!==se.ALL&&i!==se.ME||!o.unreadMentionedCount||(s.unreadMentionedCount=o.unreadMentionedCount-1),i===se.ME&&o.unreadMentionedCount&&(s.unreadMentionedMeCount=o.unreadMentionedMeCount-1));var u=o.updateAttrs(s,n);this._chat.storage.updateConversationStorage([o]),u&&this._watcher.conversation([{conversation:o.toIReceivedConversation(),updatedItems:u}])}}}),Object.defineProperty(r.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return this._isConnected?[2,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.SUBSCRIBE,r)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this._isConnected?[4,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.UNSUBSCRIBE)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,{code:r.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i;return s(this,(function(o){return this._isConnected?(i=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserList(e,t,r),[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:i})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserStatus(e,t),[2,sr(n||[])]}))}))}}),Object.defineProperty(r.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=Ku.encode(Ya,c(this,d,"m",y).call(this,e)),[4,this._connMgr.query(An.updUserProfile,this.currentUserId,r,void 0)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(n=s.sent()).data?(i=Ku.decode(Ka,n.data.pbData),n.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,n.wipe()]):(a=i.censorFailedFields,[2,ar(n.code,"",a&&0!==a.length?{errorKeys:a,errorKey:a[0]}:void 0)])):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isConnected?this._subscribeManager.getOwnProfile():Promise.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})}}),Object.defineProperty(r.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._subscribeManager.getUserProfiles(e)]}))}))}}),Object.defineProperty(r.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUserProfilePermission(e),r=new to(An[An.updProfilePermiss],t,this.currentUserId),[4,this._connMgr.send(r)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,{code:n.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodeUserProfileInput(),t=new to(An[An.qProfilePermiss],e,this.currentUserId),[4,this._connMgr.send(t,za)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return r=o.sent(),n=r.code,i=r.data,n!==exports.ErrorCode.SUCCESS?[2,{code:n}]:[2,{code:n,data:null==i?void 0:i.permission}]}}))}))}}),Object.defineProperty(r.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeSearchUserProfile(e),r=new to(An[An.searchUserProfile],t,this.currentUserId),[4,this._connMgr.send(r,Ya)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=Nt(o.userId,o.userProfile,o.userExtProfile),[2,{code:i,data:a}]):[2,{code:i}]}}))}))}}),Object.defineProperty(r.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(i=r?new to(t,n,e):new ro(t,n,e),[4,this._connMgr.send(i)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return o=s.sent(),a=o.code,u=o.data,[2,{code:a,buffer:u instanceof no||null==u?void 0:u.pbData}]}}))}))}}),Object.defineProperty(r.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=El(this.rtcCodec,t,r),[4,this.rtcSignaling(e,An[An.rtcPing],!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:((u=this.rtcCodec.decode(tl.RtcOutput,a)).version=St(u.version),[2,{code:o,data:u}])}}))}))}}),Object.defineProperty(r.prototype,"deviceId",{get:function(){return Fl()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;(t=e.deviceId)&&(kl=t),r=e.packageName,Bl=r}}),Object.defineProperty(r.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){o(void 0,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return Mc?(Gc&&(clearTimeout(Gc),Gc=null),[4,Mc]):[2];case 1:return(e=r.sent())&&(t=e.db,kc.push(t)),Mc=null,[2]}}))}))}}),Object.defineProperty(r.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({status:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;if(this._connMgr.setNetwork(e,t),e.status&&this.cloudControllerUri){var n=this._connMgr.getToken();null===(r=this.cloudController)||void 0===r||r.request(this.cloudControllerUri,Qr.newWorkChange,n)}}}),Object.defineProperty(r.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return i=w_(e,t,r,n),[4,this._connMgr.query(An.channelCreate,e,i,void 0)];case 1:return(o=s.sent()).isOk||!o.data?[2,sr()]:(a=Ku.decode(eu,o.data.pbData),u={errorKeys:a.censorFailedFields,processCode:a.processCode||0},[2,ar(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(r.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=w_(e,t,r),[4,this._connMgr.query(An.upChannelInfo,e,n,void 0)];case 1:return(i=s.sent()).isOk||!i.data?[2,sr()]:(o=Ku.decode(eu,i.data.pbData),[2,ar(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(r.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeMultiChannels(e),r=new to(An[An.qChannelInfo],t,e[0]),[4,this._connMgr.send(r,su)];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=o.result.list,u=Mt(void 0===a?[]:a),[2,{code:i,data:u}]):[2,{code:i}]}}))}))}}),Object.defineProperty(r.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeQuitGroup("kick",e,t,!0,r),o=new to(An[An.channelMemKick],i,e),[4,this._connMgr.send(o,eu)];case 1:return a=s.sent(),u=a.code,l=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:null!==(n=null==l?void 0:l.msg)&&void 0!==n?n:""}]:[2,{code:u}]}}))}))}}),Object.defineProperty(r.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=this._connMgr.codec.encodeQuitGroup("quit",e,[],!0,t),i=new to(An[An.channelMemQuit],n,e),[4,this._connMgr.send(i,eu)];case 1:return o=s.sent(),a=o.code,u=o.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(r=null==u?void 0:u.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeQuitGroup("dismiss",e),n=new to(An[An.channelDismiss],r,e),[4,this._connMgr.send(n,eu)];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o,msg:null!==(t=null==a?void 0:a.msg)&&void 0!==t?t:""}]:[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i;return o(this,void 0,void 0,(function(){var o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return o=this._connMgr.codec.encodeQuitGroup("transfer",e,[t],r,n),a=new to(An[An.channelTransfer],o,e),[4,this._connMgr.send(a,eu)];case 1:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l,msg:null!==(i=null==c?void 0:c.msg)&&void 0!==i?i:""}]:[2,{code:l}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeModifyChannelsInput(e,t,r),o=new to(An[An.upChannelManager],i,t),[4,this._connMgr.send(o,eu)];case 1:return a=s.sent(),u=a.code,l=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:null!==(n=null==l?void 0:l.msg)&&void 0!==n?n:""}]:[2,{code:u}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f,_;return s(this,(function(s){switch(s.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembersByRole",groupId:e,option:r,roleType:t}),i=new to(An[An.qChannelMem],n,e),[4,this._connMgr.send(i,su)];case 1:return o=s.sent(),a=o.code,u=o.data,a===exports.ErrorCode.SUCCESS&&u?(l=u.result,c=u.page,p=(d=c||{}).pageToken,f=d.hasNext,[],_=xt(l.list),[2,{code:a,data:{data:_,pageToken:f&&p?p:""}}]):[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembers",groupId:e,ids:t}),n=new to(An[An.qChannelSpeMem],r,e),[4,this._connMgr.send(n,su)];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:a?(u=a.result,[],l=xt(u.list),[2,{code:o,data:l}]):[2,{code:o,data:[]}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return i=Ku.encode(cu,{targetId:e,type:exports.ConversationType.GROUP,userId:t,channelNickName:r,additional:n}),[4,this._connMgr.query(An.upChannelMem,e,i,void 0)];case 1:return(o=s.sent()).isOk||!o.data?[2,sr()]:(a=Ku.decode(eu,o.data.pbData),[2,ar(o.code,o.msg,{errorKeys:a.censorFailedFields})])}}))}))}}),Object.defineProperty(r.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeJoinGroup("join",e),n=new to(An[An.channelMemJoin],r,e),[4,this._connMgr.send(n,eu)];case 1:return i=s.sent(),o=i.code,a=i.data,[2,{code:o,data:{processCode:null!==(t=null==a?void 0:a.processCode)&&void 0!==t?t:0}}]}}))}))}}),Object.defineProperty(r.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeJoinGroup("invite",e,t),o=new to(An[An.channelMemInvite],i,e),[4,this._connMgr.send(o,eu)];case 1:return a=s.sent(),u=a.code,l=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:null!==(r=null==l?void 0:l.msg)&&void 0!==r?r:""}]:[2,{code:u,data:{processCode:null!==(n=null==l?void 0:l.processCode)&&void 0!==n?n:0}}]}}))}))}}),Object.defineProperty(r.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=this._connMgr.codec.encodeMemberResponseInput(e),i=new to(An[An.channelApplyResp],n,e.groupId),[4,this._connMgr.send(i,eu)];case 1:return o=s.sent(),a=o.code,u=o.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(t=null==u?void 0:u.msg)&&void 0!==t?t:""}]:[2,{code:a,data:{processCode:null!==(r=null==u?void 0:u.processCode)&&void 0!==r?r:0}}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=Ku.encode(iu,{type:exports.ConversationType.GROUP,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this._connMgr.query(An.qChannelApplyList,this.currentUserId,t,su)];case 1:return(r=s.sent()).isOk?(i=function(e){var t=e.listType,r=e.result,i=e.page,o=new Uint8Array(r),s=[];switch(t){case 1:s=Ku.decode(uu,o).list;break;case 2:s=Ku.decode(au,o).list;break;case 3:s=Ku.decode(lu,o).list;break;case 11:s=Ku.decode(Iu,o).list;break;case 13:s=Ku.decode(yu,o).list}return n(n({},i),{list:s})}(r.data),o=i.pageToken,a=i.hasNext,u=i.list,l=u.map(jt),[2,sr({data:l,pageToken:a&&o?o:""})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroupsByRole",option:t,roleType:e}),n=new to(An[An.qChannelMemJoin],r,this.currentUserId),[4,this._connMgr.send(n,su)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&a?(u=a.result,l=a.page,d=(c=l||{}).pageToken,p=c.hasNext,f=Mt(u.list),[2,{code:o,data:{data:f,pageToken:p&&d?d:""}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroups",ids:e}),r=new to(An[An.qChannelMemSpeJoin],t,this.currentUserId),[4,this._connMgr.send(r,su)];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=o.result.list,u=Mt(a),[2,{code:i,data:u}]):[2,{code:i}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=this._connMgr.codec.encodeSetGroupRemark(e,t),n=new to(An[An.upChannelRemark],r,e),[4,this._connMgr.send(n)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n=this._connMgr.codec.encodeSetGroupFollows(e,t,r),i=new to(An[An.upChannelFollow],n,t),[4,this._connMgr.send(i)];case 1:return[2,{code:o.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupFollows",groupId:e}),r=new to(An[An.qChannelFollow],t,this.currentUserId),[4,this._connMgr.send(r,su)];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=o.result,l=a.list,u=l.map((function(e){var t=e.userId,r=e.opTime;return{userId:t,time:St(r)}})),[2,{code:i,data:u}]):[2,{code:i}]}var l}))}))}}),Object.defineProperty(r.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeFriendInput({targetId:e,type:t,info:r}),o=new to(An[An.friendAdd],i,this.currentUserId),[4,this._connMgr.send(o,eu)];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.SUCCESS&&l?[2,{code:u,data:{processCode:null!==(n=null==l?void 0:l.processCode)&&void 0!==n?n:0}}]:[2,{code:u}]}}))}))}}),Object.defineProperty(r.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=this._connMgr.codec.encodeFriendsInput(e,t),n=new to(An[An.friendDel],r,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"acceptFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=this._connMgr.codec.encodeFriendInput({targetId:e,type:1}),r=new to(An[An.friendHandle],t,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:n.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"refuseFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=this._connMgr.codec.encodeFriendInput({targetId:e,type:2,info:t}),n=new to(An[An.friendHandle],r,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=Ku.encode(gu,{targetId:e,remarkName:t,extProfile:M_(r)}),[4,this._connMgr.query(An.friendSetPf,this.currentUserId,n,void 0)];case 1:return(i=s.sent()).isOk||!i.data?[2,i.wipe()]:(o=Ku.decode(Eu,i.data.pbData),[2,ar(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(r.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeFriendsInput(e,t),n=new to(An[An.friendCheck],r,this.currentUserId),[4,this._connMgr.send(n,hu)];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:a?(u=a.list.map((function(e){return{userId:e.targetId,relationType:e.status}})),[2,{code:o,data:u}]):[2,{code:o,data:[]}]}}))}))}}),Object.defineProperty(r.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeFriendQueryInput(11,t,e),n=new to(An[An.friendsQuery],r,this.currentUserId),[4,this._connMgr.send(n,su)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&a?(u=a.result,l=a.page,d=(c=l||{}).pageToken,p=c.hasNext,u&&u.list?[2,{code:o,data:{data:tE(u.list),pageToken:p&&d?d:""}}]:[2,{code:o,data:{data:[],pageToken:p&&d?d:""}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeFriendQueryInput(12,e),r=new to(An[An.friendsQuery],t,this.currentUserId),[4,this._connMgr.send(r,su)];case 1:return n=s.sent(),i=n.code,o=n.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:o?(a=o.result,u=o.page,c=(l=u||{}).pageToken,d=l.hasNext,[2,{code:i,data:{data:rE(a),pageToken:d&&c?c:""}}]):[2,{code:i,data:{data:[],pageToken:""}}]}}))}))}}),Object.defineProperty(r.prototype,"deleteFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=Ku.encode(vu,{targetId:e}),r=new to(An[An.friendsInfoQry],t,this.currentUserId),[4,this._connMgr.send(r,Iu)];case 1:return n=s.sent(),i=n.code,o=n.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:o?[2,{code:i,data:tE(o.list)}]:[2,{code:i,data:[]}]}}))}))}}),Object.defineProperty(r.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})]}))}))}}),Object.defineProperty(r.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=Ku.encode(Tu,{level:e}),r=new to(An.friendAuthSet,t,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return e=this._connMgr.codec.encodeFriendInput({targetId:this.currentUserId}),t=new to(An.friendAuthGet,e,this.currentUserId),[4,this._connMgr.send(t,Tu)];case 1:return r=o.sent(),n=r.code,i=r.data,n===exports.ErrorCode.SUCCESS&&i?[2,{code:n,data:i}]:[2,{code:n}]}}))}))}}),Object.defineProperty(r.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return(n=this._connMgr)?(i=Ku.encode(Oa,{key:t,dataContent:r}),[4,n.send(new to(An.reqCall,i,e),Oa)]):[3,2];case 1:return o=s.sent(),a=o.code,u=o.data,a===exports.ErrorCode.SUCCESS&&u?[2,Promise.resolve({code:a,data:{key:u.key,value:u.dataContent}})]:[2,Promise.resolve({code:a})];case 2:return[2,Promise.resolve({code:exports.ErrorCode.RC_NET_CHANNEL_INVALID})]}}))}))}}),Object.defineProperty(r.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=Ku.encode(Ru,e),[4,this._connMgr.query(An.addUnpush,this.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=Ku.encode(Su,{nothing:0}),[4,this._connMgr.query(An.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=Ku.encode(Au,{nothing:0}),[4,this._connMgr.query(An.qryUnpush,this.currentUserId,e,Ou)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,r=e.spanMinutes,n=e.startTime,i=e.level,o=e.timezone;return t?{spanMinutes:r,startTime:n,level:i,timezone:o}:{spanMinutes:0,startTime:"",level:exports.PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(r.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,sr(Gr.getStatsUrlList(this.naviInfo))]}))}))}}),Object.defineProperty(r.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p=this;return s(this,(function(s){switch(s.label){case 0:return i=0===n?e[0].identifier:this.currentUserId,o=this.userSettings.storage.get("value").transLan,a=[],u=[],e.forEach((function(e){var t=e.sourceLanguage,r=e.content,i=e.targetLanguage||o;t!==i?r?a.push({messageUID:e.identifier,sourceLan:e.sourceLanguage,targetLan:e.targetLanguage||o,text:e.content,inputSource:n,transType:1}):u.push({identifier:e.identifier,from:n,code:exports.ErrorCode.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:bn.NONE}}):u.push({identifier:e.identifier,from:n,code:exports.ErrorCode.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:bn.NONE}})})),0!==a.length?[3,1]:(l=sr(),[3,3]);case 1:return c=Ku.encode(Nu,{businessType:3,businessInfo:Ku.encode(wu,{forceTrans:r,transInfos:a,model:t})}),[4,this._connMgr.query(An.upConvertMsg,i,c,Lu)];case 2:d=s.sent(),l=d.wipe(),s.label=3;case 3:return u.length>0&&setTimeout((function(){return p._watcher.translateResponse(u)}),0),[2,l]}}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._subscribeManager?(t=[],r=new Set,this._subscribeManager.getSubscribeUserStatus(exports.SubscribeType.ONLINE_STATUS,e).forEach((function(e){var n=e.userId,i=e.details,o=(void 0===i?[]:i).map((function(e){return{platform:e.platform,isOnline:!!e.eventValue,updateTime:e.changeTime}})),s=o.some((function(e){return e.isOnline})),a={userId:n,isOnline:s,details:o};t.push(a),r.add(n)})),0===(n=e.filter((function(e){return!r.has(e)}))).length?[2,sr(t)]:[4,c(this,d,"m",m).call(this,exports.SubscribeType.FRIEND_ONLINE_STATUS,n)]):[2,sr([])];case 1:return(i=o.sent()).isOk?(i.data.list.forEach((function(e){var r,n=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((r={userId:n,isOnline:o,details:i},[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.HarmonyOS].forEach((function(e){r.details.some((function(t){return t.platform===e}))||r.details.push({platform:e,isOnline:!1,updateTime:0})})),r))})),[2,sr(t)]):[2,i.wipe()]}}))}))}}),d=new WeakSet,p=function(e,t){this._watcher.readReceiptResponseV5(t)},f=function(e,t){this._watcher.speechToTextResponse(t)},_=function(e,t){this._watcher.messagesModified(t)},h=function(e){this._watcher.messageModifiedSyncCompleted()},g=function(e,t){this._watcher.ultraGroupMessageExpansionUpdated(t)},E=function(e,t){this._watcher.ultraGroupMessageRecalled(t)},b=function(e,t){this._watcher.conversation(t)},I=function(e,t,r){var n=this;t!==lh?t!==dh?this._handleEventChangeList(this._connMgr.codec.formatEventChangeList(r)):this._handleConvertEvent(r):r.forEach((function(e){Ku.decode(mu,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,r,i=jt(e);null===(r=(t=n._watcher).groupApplicationEvent)||void 0===r||r.call(t,i)}))}))},y=function(e){var t={},r=e.extraProfile;return r&&(delete e.extraProfile,t.userExtProfile=M_(r)),t.userProfile=M_(e),t},m=function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=Ku.encode(qa,{subType:e,subUsers:t.map((function(e){return{subUserId:e}}))}),[4,this._connMgr.query(An.qrySubData,this.currentUserId,r,Ba)];case 1:return[2,n.sent()]}}))}))},i([$g()],r.prototype,"createGroup",null),i([$g()],r.prototype,"updateGroupInfo",null),i([$g()],r.prototype,"getGroupsInfo",null),i([$g()],r.prototype,"kickGroupMembers",null),i([$g()],r.prototype,"quitGroup",null),i([$g()],r.prototype,"dismissGroup",null),i([$g()],r.prototype,"transferGroupOwner",null),i([$g()],r.prototype,"setGroupManagers",null),i([$g()],r.prototype,"getGroupMembersByRole",null),i([$g()],r.prototype,"getGroupMembers",null),i([$g()],r.prototype,"setGroupMemberInfo",null),i([$g()],r.prototype,"joinGroup",null),i([$g()],r.prototype,"inviteUsersToGroup",null),i([$g()],r.prototype,"memberInviteResponse",null),i([$g()],r.prototype,"getGroupApplications",null),i([$g()],r.prototype,"getJoinedGroupsByRole",null),i([$g()],r.prototype,"getJoinedGroups",null),i([$g()],r.prototype,"setGroupRemark",null),i([$g()],r.prototype,"setGroupFollows",null),i([$g()],r.prototype,"getGroupFollows",null),i([$g()],r.prototype,"addFriend",null),i([$g()],r.prototype,"deleteFriends",null),i([$g()],r.prototype,"acceptFriendApplication",null),i([$g()],r.prototype,"refuseFriendApplication",null),i([$g()],r.prototype,"setFriendInfo",null),i([$g()],r.prototype,"checkFriends",null),i([$g()],r.prototype,"getFriends",null),i([$g()],r.prototype,"getFriendApplications",null),i([$g()],r.prototype,"deleteFriendApplication",null),i([$g()],r.prototype,"getFriendsInfo",null),i([$g()],r.prototype,"searchFriendsInfo",null),i([$g()],r.prototype,"setFriendAddPermission",null),i([$g()],r.prototype,"getFriendAddPermission",null),i([eE()],r.prototype,"setNotificationQuietHoursWithSetting",null),i([eE()],r.prototype,"removeNotificationQuietHoursSetting",null),i([eE()],r.prototype,"getNotificationQuietHoursSetting",null),r}(Tl),oE=function(){function e(e){nE.set(this,void 0),d(this,nE,e,"f")}return Object.defineProperty(e.prototype,"isSpeechToTextEnabled",{get:function(){return!!(1&(c(this,nE,"f").AIBusinessSub||0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConversationListIncludeUltraGroup",{get:function(){return lg(c(this,nE,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageModifiableMinutes",{get:function(){return c(this,nE,"f").msgModifyMinute||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readReceiptVersion",{get:function(){return e=(e=c(this,nE,"f").grpRRVer)||0,Object.values(xe).includes(e)?e:xe.UNKNOWN;var e},enumerable:!1,configurable:!0}),e}();nE=new WeakMap;var sE,aE,uE,lE=function(){function e(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),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===exports.RCConnectionStatus.CONNECTED||this.ctx.userId&&e?sr(this.ctx.naviInfo):ar(exports.ErrorCode.RC_NET_UNAVAILABLE)}}),e}(),cE=function(e){function r(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"serv",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,extra:n,createIfNotExist:r}),i),[4,ur.create("joinChatroom").validate("chatroomId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNumber("count",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("extra",n).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){var i=Math.max(Math.min(t,50),-1)||10;return a.serv.joinChatroom(e,i,r,n)}))];case 1:return o=s.sent(),this.logger.summary(H.A_JOIN_CHATROOM_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_QUIT_CHATROOM_T,JSON.stringify({roomId:e}),t),[4,ur.create("quitChatroom").validate("roomId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.serv.quitChatroom(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_QUIT_CHATROOM_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_CHATROOM_INFO_T,JSON.stringify({roomId:e,count:t,order:r}),n),[4,ur.create("getChatroomInfo").validate("roomId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,0,20).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,2).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).next((function(){return o.serv.getChatroomInfo(e,t||0,r||1)}))];case 1:return i=s.sent(),this.logger.summary(H.A_GET_CHATROOM_INFO_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_SET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,ur.create("setChatroomEntry").validate("roomId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",null==t?void 0:t.key,Wt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).validate("value",null==t?void 0:t.value,Kt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_VALUE).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).isBoolean("isAutoDelete",null==t?void 0:t.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).isBoolean("isSendNotification",null==t?void 0:t.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).result().tryTrans(this.validateConnected).next((function(){return o.serv.setChatroomEntry(e,t,r)}))];case 1:return i=s.sent(),this.logger.summary(H.A_SET_CHATROOM_ENTRY_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_SET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,ur.create("setChatroomEntries").validate("roomId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTypedArray("entries",null==t?void 0:t.entries,(function(e){return Wt(null==e?void 0:e.key)&&Kt(null==e?void 0:e.value)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_ENTRIES).isLimitedArray("entryOptions.entries",null==t?void 0:t.entries,10,!0).fail(exports.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT).isBoolean("entryOptions.isForce",null==t?void 0:t.isForce).fail(exports.ErrorCode.INVALID_PARAMETER_IS_FORCE).isBoolean("entryOptions.isAutoDelete",null==t?void 0:t.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).result().tryTrans(this.validateConnected).next((function(){return i.serv.setChatroomEntries(e,t)}))];case 1:return n=o.sent(),this.logger.summary(H.A_SET_CHATROOM_ENTRIES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,ur.create("removeChatroomEntry").validate("roomId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("entry.key",null==t?void 0:t.key,Wt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).isBoolean("entry.isSendNotification",null==t?void 0:t.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).isLimitedString("entry.notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return o.serv.removeChatroomEntry(e,t,r)}))];case 1:return i=s.sent(),this.logger.summary(H.A_REMOVE_CHATROOM_ENTRY_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,ur.create("removeChatroomEntries").validate("roomId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("keys",null==t?void 0:t.keys,10,Wt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.serv.removeChatroomEntries(e,t)}))];case 1:return n=o.sent(),this.logger.summary(H.A_REMOVE_CHATROOM_ENTRIES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_GET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,key:t}),r),[4,ur.create("getChatroomEntry").validate("roomId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",t,Wt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).result().tryTrans(this.validateConnected).next((function(){return i.serv.getChatroomEntry(e,t)}))];case 1:return n=o.sent(),this.logger.summary(H.A_GET_CHATROOM_ENTRY_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_GET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e}),t),[4,ur.create("getAllChatroomEntries").validate("roomId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.serv.getAllChatroomEntries(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_GET_CHATROOM_ENTRIES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:t,order:r,timestamp:n}),i),[4,ur.create("getChatroomHistoryMessages").validate("roomId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTimestamp("timestamp",n).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return a.serv.getChatroomHistoryMessages(e,n||0,t||20,r||0)}))];case 1:return o=s.sent(),this.logger.summary(H.A_GET_CHATROOM_HISTORY_MESSAGES_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.serv.setCheckChatRoomDuplicateMessage(e)}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_BIND_RTC_FOR_CHATROOM_T,JSON.stringify({option:e}),t),[4,ur.create("bindRTCRoomForChatroom").validate("chatRoomId",null==e?void 0:e.chatRoomId,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.serv.bindRTCRoomForChatroom(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_BIND_RTC_FOR_CHATROOM_R,r,t),[2,r]}}))}))}}),r}(lE),dE=function(e){function r(t,r){var n=e.call(this,t)||this;return sE.add(n),Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_SAVE_EDITED_MSG_DRAFT_T,JSON.stringify({draft:e,identifier:t}),r),[4,ur.create("saveEditedMessageDraft").check((function(e){return Ul(e,t,Z)})).isString("draft",null==e?void 0:e.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateLogin).next((function(){return i.svr.saveEditedMessageDraft(e,c(i,sE,"m",uE).call(i,t))}))];case 1:return n=o.sent(),this.logger.summary(H.A_SAVE_EDITED_MSG_DRAFT_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_GET_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,ur.create("getEditedMessageDraft").check((function(t){return Ul(t,e,Z)})).result().next((function(){return n.svr.getEditedMessageDraft(c(n,sE,"m",uE).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(H.A_GET_EDITED_MSG_DRAFT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_CLEAR_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,ur.create("clearEditedMessageDraft").check((function(t){return Ul(t,e,Z)})).result().next((function(){return n.svr.clearEditedMessageDraft(c(n,sE,"m",uE).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(H.A_CLEAR_EDITED_MSG_DRAFT_R,r,t),[2,r]}}))}))}}),r}(lE);function pE(e){return n({},e)}function fE(e,t,r){var n=r.value;r.value=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 1!==(null===(e=this.getNaviInfoFromCache())||void 0===e?void 0:e.userProfile)?Promise.resolve({code:exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE}):n.call.apply(n,l([this],u(t),!1))}}sE=new WeakSet,aE=function(e){var t;return!!(2&((null===(t=this.ctx.naviInfo)||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e},uE=function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP?e:n(n({},e),{channelId:c(this,sE,"m",aE).call(this,e.channelId)})};var _E=function(){function e(e){var r,i,o=this;t.add(this),Object.defineProperty(this,"_token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_pluginContextQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pluginInstanseMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"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,"_versionInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_typingInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rtcCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_ugSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(r={},r[ye.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),r[ye.INTERCEPT]=this._processInterceptMessage.bind(this),r)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(i={},i[ye.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),i[ye.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),i[ye.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),i)}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:{message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag:void 0,userSettingsSynced:void 0,userSettingsChanged:void 0,conversationStatusSynced: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=n({},e),this.appkey=this._options.appkey,this._options.typingExpireTime&&(this._options.typingExpireTime<2e3?this._typingExpireTime=2e3:this._options.typingExpireTime>6e3?this._typingExpireTime=6e3:this._typingExpireTime=this._options.typingExpireTime),this._options.navigators=this._options.navigators.map((function(e){return e.replace(/\/$/g,"")}));var s={onConnected:function(){return o._onConnectionStatusChange(exports.RCConnectionStatus.CONNECTED)},onConnecting:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.DISCONNECTED),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),conversationTag:this._conversationTagListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),userSettingsSynced:this._onUserSettingsSynced.bind(this),userSettingsChanged:this._onUserSettingsChanged.bind(this),conversationStatusSynced:this._onConversationStatusSynced.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)};this.rtcCodec=new nl(hl,gl);var a=At();this._engine=a?new RCCppEngine(this.rtcCodec,s,this._options):new iE(this.rtcCodec,s,this._options),this.logger=this._engine.logger,this._options.eventLoopBlockingCheck&&Xr.start(this.logger),this.sse=new Il(this,a),this.chatroom=new cE(this._engine,this._engine.chatroom),this.chat=new dE(this._engine,this._engine.chat)}var t,r,a,d,p;return Object.defineProperty(e,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this._context)return this._context.logger.warn(H.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(H.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(H.L_IMSDK_VER_O,JSON.stringify({commitId:"acab3f166cca4662e50a05343d2bc1135437ab73",version:"5.30.0"}));var r=this._context._engine;return es.setNetworkStatusListener(r.setNetwork.bind(r)),this._context}}),Object.defineProperty(e,"getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"getOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._options}}),Object.defineProperty(e,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(H.A_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))}}),Object.defineProperty(e.prototype,"install",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId();if(this.logger.info(H.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),r),this._pluginInstanseMap[e.tag])return this.logger.warn(H.L_INSTALL_PLUGIN_R,"repeat install",r),this._pluginInstanseMap[e.tag];var n="RCRTC"===e.tag?new Sl(this):new Rl(this),i=null;try{if(!e.verify(es))return null;i=e.setup(n,es,t)}catch(e){this.logger.error(H.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,r)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(n),this._pluginInstanseMap[e.tag]=i),i}}),Object.defineProperty(e.prototype,"getAppSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.validateLogin().trans((function(e){return new oE(e)}))}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;this._ugSynced=!1,this.logger.warn(H.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(n=(r=this._watcher).connection)||void 0===n||n.call(r,e,t),this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onconnectionstatechange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_processTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._addTypingInfo(pE(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===exports.ConversationType.ULTRA_GROUP){var r=e.content.sourceType;if(t.sourceType=r,(r===exports.MessageBlockSourceType.MSG_EXPANSION||r===exports.MessageBlockSourceType.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(H.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0}}),Object.defineProperty(e.prototype,"_processReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.readReceiptReceived&&this._watcher.readReceiptReceived({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.content.lastMessageSendTime,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptRequestMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptResponseMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,n=this._engine.userId;r&&Array.isArray(r[n])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,r[n])}}),Object.defineProperty(e.prototype,"_messageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i,o,s,a=this;if(!(null===(i=(n=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(n,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(pE(e))}catch(e){return a.logger.error(H.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(s=(o=this._watcher).message)||void 0===s||s.call(o,pE(e),t,r),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=[],o=[],s=[ye.READ_RECEIPT,ye.READ_RECEIPT_REQUEST,ye.READ_RECEIPT_RESPONSE];e.forEach((function(e){var a=n._messageReceiver(e,t,r);a&&s.includes(a.messageType)?o.push(a):a&&i.push(a)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(H.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.forEach((function(e){n._messageProccessor[e.messageType]&&n._messageProccessor[e.messageType](e)}))}}),Object.defineProperty(e.prototype,"_chatroomInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).chatroomState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_expansionInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).expansion)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_tagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_onUserSettingsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userSettingsSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onUserSettingsChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userSettingsChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onConversationStatusSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationStatusSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationTagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_typingStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).typingState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_pullFinishedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_MessageBlockedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageBlocked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_callInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._pluginContextQueue.forEach((function(r){try{r.onCallInfo&&r.onCallInfo(e)}catch(e){t.logger.warn(H.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"_ultraGroupEnableListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;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,r;null===(r=(t=this._watcher).sgRelationsSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_operateStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).operateStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageExpansionUpdatedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageRecalledListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageRecalled)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelChangeTypeListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelChangeType)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelUserKickedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelDeleteListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_userGroupStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userGroupStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageReadReceipt)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).syncReadStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedUserStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedUserStatusChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedRelationChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedRelationChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncSubscribedUserStatusFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(r=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ownUserProfileChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_OWN_USER_PROFILE_CHANGED_S),null===(r=(t=this._watcher).ownUserProfileChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupOperation)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupMemberInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupApplicationEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupApplicationEvent)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupRemarkChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupRemarkChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupFollowsChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupFollowsChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendAdd)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendApplicationStatusChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendCleared",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendCleared)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendInfoChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_rtcDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onrtcdatachange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_naviDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pluginContextQueue.forEach((function(t){var r;null===(r=t.onnavidatachange)||void 0===r||r.call(t,e)}))}}),Object.defineProperty(e.prototype,"_databaseOpened",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;null===(n=(r=this._watcher).databaseOpened)||void 0===n||n.call(r,e,t)}}),Object.defineProperty(e.prototype,"_databaseUpgradeWillStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.logger.info(H.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_databaseUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_DB_UPGRATING_S,e),null===(r=(t=this._watcher).databaseUpgrading)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_databaseUpgradeDidComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_DB_UPGRATE_COMPLETE_S),null===(r=(t=this._watcher).databaseUpgradeDidComplete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_readReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).readReceiptResponseV5)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_speechToTextResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).speechToTextResponse)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_translateResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messagesModified",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messagesModified)||void 0===r||r.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(r){if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];t._watcher[r]=Et(n)||gt(n)?n:void 0}}))}}),Object.defineProperty(e.prototype,"_resetWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))}}),Object.defineProperty(e.prototype,"_addTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.senderUserId,r=e.conversationType,n=e.targetId,i=e.content,o=e.channelId,s=i.typingContentType,a=o||"",u="".concat(r,"#").concat(n,"#").concat(a);this._typingInfo[u]||(this._typingInfo[u]=[]);var l=this._typingInfo[u].findIndex((function(e){return e.userId===t}));l>=0&&this._typingInfo[u][l].messageType===s?this._typingInfo[u][l].timestamp=Date.now():(l>=0&&this._typingInfo[u].splice(l,1),this._typingInfo[u].push({userId:t,messageType:s,timestamp:Date.now()}),this._typingChangedList.includes(u)||this._typingChangedList.push(u),this._startCheckTypingInfo())}}),Object.defineProperty(e.prototype,"_startCheckTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var r=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===r||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))}}),Object.defineProperty(e.prototype,"_notifyTypingChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(this._typingChangedList.length>0){var t=this._typingChangedList.map((function(t){return{conversationType:Number(t.split("#")[0]),targetId:t.split("#")[1],channelId:t.split("#")[2],list:e._typingInfo[t]||[]}}));this._typingStatusListener(t),this._typingChangedList=[]}0===Object.keys(this._typingInfo).length&&(clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1)}}),Object.defineProperty(e.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.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?ar(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE):sr(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===exports.RCConnectionStatus.CONNECTED||this._engine.userId&&e?sr(this._engine.naviInfo):ar(exports.ErrorCode.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 s(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i;return o(this,void 0,void 0,(function(){var o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return this._token=e,[4,es.getNetworkType()];case 1:return o=s.sent(),this._engine.setNetwork({status:!0,type:o},!0),a=!!this._pluginInstanseMap.RCCallPlus,[4,this._engine.connect(e,t,a,r)];case 2:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l}]:(1!==this._engine.naviInfo.type&&(d=st.getInfo(),null===(i=(n=this._engine).reportSDKInfo)||void 0===i||i.call(n,d)),[2,{code:l,userId:c}])}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){switch(n.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return n.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){r.logger.error(H.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.connect(this.token,!!e,this.logger.createTraceId())}}),Object.defineProperty(e.prototype,"_channelIdConvert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e!==exports.ConversationType.ULTRA_GROUP)return t;var r=this.getNaviInfoFromCache();return!!(2&((null==r?void 0:r.ugDriven)||0))&&!t?"RCDefault":t}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.naviInfo}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o){void 0===i&&(i=[]),void 0===o&&(o=!1);var s,a,u,l={isPersited:t,isCounted:r,searchProps:i,isStatusMessage:o};s=e,a=l,(u=un.get(s))&&!u.isCustom&&console.warn("Builtin message type '".concat(s,"' cannot be registered")),a.isStatusMessage&&(a.isCounted=a.isPersited=!1),un.set(s,n(n({},a),{isCustom:!0})),this._engine.registerMessageType(e,l)}}),Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._engine.registerRTCSignalingListener(e)}}),Object.defineProperty(e.prototype,"_handleExpansioResult",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t)return exports.ErrorCode.SUCCESS;var r=function(e){var t=!1,r=!1,n=!1;if(gt(e)){var i=Object.keys(e).length;for(var o in t=i>20,e)if(r||(r=ct(o)&&!/^[A-Za-z0-9_=+-]+$/.test(o)),!n){var s=e[o];n=o.length>32||s.length>4096}}return{isExceedLimit:t,isIllgalEx:r,isExKeyOrValLengthExceedLimit:n}}(e),n=r.isIllgalEx,i=r.isExKeyOrValLengthExceedLimit;return r.isExceedLimit||i?exports.ErrorCode.EXPANSION_LIMIT_EXCEET:n?exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION:exports.ErrorCode.SUCCESS}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var a;return o(this,void 0,void 0,(function(){var o,u,l,c,d,p,f,_,h,g,E,b,v,T,I,y,m,R;return s(this,(function(s){switch(s.label){case 0:if(r.needReceipt){if(4!==(null===(a=this.getNaviInfoFromCache())||void 0===a?void 0:a.grpRRVer))return[2,ar(exports.ErrorCode.READ_RECEIPT_ERROR)];(e!==exports.ConversationType.GROUP&&e!==exports.ConversationType.PRIVATE||r.isStatusMessage||!r.isPersited||e===exports.ConversationType.GROUP&&r.directionalUserIdList&&r.directionalUserIdList.length>0)&&(r.needReceipt=!1)}return(o=Ml(r.messageType,r.content)).isOk?e===exports.ConversationType.SYSTEM&&r.messageType!==ye.SYNC_READ_STATUS?[2,ar(exports.ErrorCode.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE)]:r.messageType===ye.STREAM_MESSAGE?[2,ar(exports.ErrorCode.MESSAGE_NOT_SUPPORT_SENDING)]:(u=r.canIncludeExpansion,l=void 0!==u&&u,c=r.expansion,(d=this._handleExpansioResult(c,l))?[2,ar(d)]:(p=r.isMentioned,f=r.mentionedUserIdList,_=r.mentionedType,p?r.content.mentionedInfo=function(e,t,r){var n,i,o;return{userIdList:(null===(n=e.mentionedInfo)||void 0===n?void 0:n.userIdList)||t,type:(null===(i=e.mentionedInfo)||void 0===i?void 0:i.type)||r||exports.MentionedType.ALL,mentionedContent:(null===(o=e.mentionedInfo)||void 0===o?void 0:o.mentionedContent)||""}}(r.content,f,_):delete r.content.mentionedInfo,h=JSON.stringify(r.content),rl(h)>je?[2,ar(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT)]:e!==exports.ConversationType.ULTRA_GROUP?[3,2]:(r.channelId=this._channelIdConvert(e,r.channelId),[4,this._engine.sendUltraMessage(t,r,n,i)]))):[2,o.wipe()];case 1:return g=s.sent(),E=g.code,b=g.data,v=g.msg,[2,E===exports.ErrorCode.SUCCESS?sr(b):ar(E,v,b)];case 2:return(null==(T=this.getNaviInfoFromCache())?void 0:T.grpRRVer)&&r.messageType===ye.READ_RECEIPT_RESPONSE?[2,ar(exports.ErrorCode.READ_RECEIPT_ERROR)]:[4,this._engine.sendMessage(e,t,r,n,i)];case 3:return I=s.sent(),y=I.code,m=I.data,R=I.msg,[2,y===exports.ErrorCode.SUCCESS?sr(m):ar(y,R,m)]}}))}))}}),Object.defineProperty(e.prototype,"updateMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,u=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_UPDATE_MSG_EXPANSION_T,JSON.stringify({expansion:e,attrs:r}),i),[4,ur.create("updateMessageExpansion").check((function(t){return Dl(t,r,Object.keys(e||{}))})).check((function(t){return xl(t,e,r.canIncludeExpansion)})).result().tryTrans(this.validateConnected).next((function(){var o={put:e,mid:r.messageUId},s=n(n({},r),{channelId:u._channelIdConvert(r.conversationType,r.channelId)});return r.conversationType===exports.ConversationType.ULTRA_GROUP?u._engine.chat.updateUGMessageExpansion(s,o,r.sentTime):c(u,t,"m",a).call(u,s,o,i)}))];case 1:return o=s.sent(),this.logger.summary(H.A_UPDATE_MSG_EXPANSION_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,u=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_MSG_EXPANSION_T,JSON.stringify({keys:e,attrs:r}),i),[4,ur.create("removeMessageExpansion").isLimitedTypedArray("keys",e,20,(function(e){return"string"==typeof e&&/^[A-Za-z0-9_=+-]+$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).check((function(t){return Dl(t,r,e)})).result().tryTrans(this.validateConnected).next((function(){var o={del:e,mid:r.messageUId},s=n(n({},r),{channelId:u._channelIdConvert(r.conversationType,r.channelId)});return r.conversationType===exports.ConversationType.ULTRA_GROUP?u._engine.chat.updateUGMessageExpansion(s,o,r.sentTime):c(u,t,"m",a).call(u,s,o,i)}))];case 1:return o=s.sent(),this.logger.summary(H.A_REMOVE_MSG_EXPANSION_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeAllMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var r,i,o=this;return s(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_ALL_MSG_EXPANSION_T,JSON.stringify({attrs:e}),r),[4,ur.create("removeAllMessageExpansion").check((function(t){return Dl(t,e,[])})).check((function(t){e.conversationType!==exports.ConversationType.ULTRA_GROUP&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){var i={clear:1,mid:e.messageUId},s=n(n({},e),{channelId:o._channelIdConvert(e.conversationType,e.channelId)});return e.conversationType===exports.ConversationType.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(s,i,e.sentTime):c(o,t,"m",a).call(o,s,i,r)}))];case 1:return i=s.sent(),this.logger.summary(H.A_REMOVE_ALL_MSG_EXPANSION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(c){switch(c.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_SEND_READ_RECEIPT_T,JSON.stringify({targetId:e,messageList:t,channelId:r}),n),[4,ur.create("sendReadReceipt").validate("targetId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((function(e){gt(t)&&!Object.keys(t).some((function(r){var n=t[r];return e.isLimitedTypedArray("messageList",n,Number.MAX_SAFE_INTEGER,ht,!0).isFailed}))||e.setFailed(exports.ErrorCode.MSG_LIMIT_ERROR)})).validate("channelId",r,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(i){return o(a,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return 0!==(o=i.grpRRVer||0)&&1!==o?[2,ar(exports.ErrorCode.READ_RECEIPT_ERROR)]:1===o?(a=[],Object.keys(t).forEach((function(e){a.push.apply(a,l([],u(t[e]),!1))})),[2,this.sendReadReceiptV2(e,a,r,n)]):[4,this.sendMessage(exports.ConversationType.GROUP,e,{messageType:ye.READ_RECEIPT_RESPONSE,content:{receiptMessageDic:t}},n)];case 1:return[2,s.sent().wipe()]}}))}))}))];case 1:return i=c.sent(),this.logger.summary(H.A_SEND_READ_RECEIPT_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=n||this.logger.createTraceId(),this.logger.info(H.A_SEND_READ_RECEIPT_V2_T,JSON.stringify({targetId:e,messageUIds:t,channelId:r}),n),[4,ur.create("sendReadReceiptV2").validate("targetId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("messageUIds",t,Number.MAX_SAFE_INTEGER,ht,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return o(a,void 0,void 0,(function(){return s(this,(function(i){return 1!==n.grpRRVer?[2,ar(exports.ErrorCode.READ_RECEIPT_ERROR,"The read receipt switch is not on, please call the sendMessage method.")]:[2,this._engine.chat.sendReadReceiptV2(e,t,r)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(H.A_SEND_READ_RECEIPT_V2_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=this.getNaviInfoFromCache(),1!==((null==n?void 0:n.grpRRVer)||0)?[2,{code:exports.ErrorCode.READ_RECEIPT_ERROR}]:[2,this._engine.getMessageReader(e,t,r||"")]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.sendReadReceiptMessageV4(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.getMessageReadReceiptV4(e,t)]}))}))}}),Object.defineProperty(e.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.updateConversationReadTime(e,t)]}))}))}}),Object.defineProperty(e.prototype,"_destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){switch(t.label){case 0:return Xr.stop(),this._resetWatcher(),this._engine.destroy(),es.removeNetworkStatusListener(),[4,this.disconnect()];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(H.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,d,p=this;return s(this,(function(s){switch(s.label){case 0:return i=null==n?void 0:n.timestamp,o=null==n?void 0:n.count,a=null==n?void 0:n.order,u=null==n?void 0:n.messageType,l=this.logger.createTraceId(),this.logger.info(H.A_GET_HISTORY_MSG_T,JSON.stringify({conversation:e,options:n}),l),[4,ur.create("getHistoryMessage").check((function(t){return Ul(t,e,X)})).isLimitedInteger("timestamp",i,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",a,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",o,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isNotEmptyString("messageType",u).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var n={timestamp:i||0,count:o||20,order:a||0,messageType:u||""},s=c(p,t,"m",r).call(p,e);return p._engine.getHistoryMessage(s,n,!0)}))];case 1:return d=s.sent(),this.logger.summary(H.A_GET_HISTORY_MSG_R,d,l),[2,d]}}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_GET_CONTINUOUS_MSGS_T,JSON.stringify({conversation:e,options:n}),i),[4,ur.create("getContinuousMessages").check((function(t){return Ul(t,e,J)})).isLimitedInteger("timestamp",null==n?void 0:n.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==n?void 0:n.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==n?void 0:n.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateLogin).next((function(){var i=c(a,t,"m",r).call(a,e),o={timestamp:n.timestamp||0,count:n.count||20,order:n.order||0,messageType:""};return a._engine.chat.getContinuousMessages(i,o)}))];case 1:return o=s.sent(),this.logger.summary(H.A_GET_CONTINUOUS_MSGS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_GET_HIS_MSGS_BY_OBJ_NAMES_T,JSON.stringify({conversation:e,option:n}),i),[4,ur.create("getHistoryMessagesByObjectNames").check((function(t){return Ul(t,e,z)})).isLimitedInteger("timestamp",null==n?void 0:n.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==n?void 0:n.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==n?void 0:n.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTypedArray("messageTypes",null==n?void 0:n.messageTypes,ht).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateLogin).next((function(){var i=c(a,t,"m",r).call(a,e),o={timestamp:n.timestamp||0,count:n.count||20,order:n.order||0,messageTypes:n.messageTypes||[]};return a._engine.chat.getHistoryMessagesByObjectNames(i,o)}))];case 1:return o=s.sent(),this.logger.summary(H.A_GET_HIS_MSGS_BY_OBJ_NAMES_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_GET_TOP_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e,channelId:t}),r),[4,ur.create("getTopConversationList").isTypedArray("conversationTypes",e,(function(e){return ee(e,Q)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",t,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=lg(r))&&!this._ugSynced?[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTopConversationList(n,e,t)]}))}))}))];case 1:return n=a.sent(),this.logger.summary(H.A_GET_TOP_CONVERSATION_LIST_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_GET_UNREAD_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e}),t),[4,ur.create("getUnreadConversationList").isTypedArray("conversationTypes",e,(function(e){return ee(e,Q)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=lg(t))&&!this._ugSynced?[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getUnreadConversationList(r,e)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(H.A_GET_UNREAD_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_BLOCKED_CONVERSATION_LIST_T,"",e),[4,ur.create("getBlockedConversationList").result().tryTrans(this.validateConnected).next((function(e){return o(r,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=lg(e))&&!this._ugSynced?[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getBlockedConversationList(t)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(H.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 r=this;return s(this,(function(n){switch(n.label){case 0:return[4,ur.create("getConversationListByPageIndex").isInteger("index",e,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).result().tryTrans(this.validateLogin).next((function(){return r._engine.chat.getConversationListByPageIndex(e,t)}))];case 1:return[2,n.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,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_GET_ALL_CONVERSATION_LIST_T,JSON.stringify({channelId:e}),t),[4,ur.create("getAllConversationList").validate("channelId",e,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateLogin).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=lg(t))&&!this._ugSynced?[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getAllConversationList(r,e)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(H.A_GET_ALL_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATION_LIST_OLD_T,JSON.stringify(e),t),[4,At()&&"string"!=typeof(null==e?void 0:e.channelId)?this.getAllConversationList(null==e?void 0:e.channelId):this.getConversationListByTimestamp(e)];case 1:return r=n.sent(),this.logger.summary(H.A_GET_CONVERSATION_LIST_OLD_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATION_LIST_BY_TIME_T,JSON.stringify(e),t),[4,ur.create("getConversationListByTimestamp").isObject("params",e,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"params must be an object").isInteger("startTime",null==e?void 0:e.startTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).isInteger("count",null==e?void 0:e.count,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==e?void 0:e.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",null==e?void 0:e.channelId,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,(function(e){return ee(e,Q)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans((function(){return n.checkAuthed(At())})).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=lg(t))&&!this._ugSynced?[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getConversationListByTimestamp(e,r)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(H.A_GET_CONVERSATION_LIST_BY_TIME_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATION_T,JSON.stringify(e),n),[4,ur.create("getConversation").check((function(t){return Ul(t,e,X)})).result().tryTrans(this.validateConnected).next((function(){var n=c(o,t,"m",r).call(o,e);return o._engine.chat.getConversation(n)}))];case 1:return i=s.sent(),this.logger.summary(H.A_GET_CONVERSATION_R,i,n,e),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_CONVERSATION_T,JSON.stringify(e),i),[4,ur.create("removeConversation").check((function(t){return Ul(t,e,Q)})).result().tryTrans(this.validateConnected).next((function(){var i=c(a,t,"m",r).call(a,e);return a._engine.chat.batchDeleteConversations({identifiers:[i],deleteRemotely:!!n,deleteMessages:!1})}))];case 1:return o=s.sent(),this.logger.summary(H.A_REMOVE_CONVERSATION_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n,i,a,u,l,d=this;return s(this,(function(p){switch(p.label){case 0:return n=null==e?void 0:e.identifiers,i=!!(null==e?void 0:e.deleteRemotely),a=!!(null==e?void 0:e.deleteMessages),u=this.logger.createTraceId(),this.logger.info(H.A_BATCH_DEL_CONVERS_T,JSON.stringify({identifiers:n,deleteRemotely:i,deleteMessages:a}),u),[4,ur.create("batchDeleteConversations").isLimitedArray("identifiers",n,100,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected).next((function(){return o(d,void 0,void 0,(function(){var e,o=this;return s(this,(function(s){return 0===(e=n.filter((function(e){return wl("",e,Q).result().isOk})).map((function(e){return c(o,t,"m",r).call(o,e)}))).length?[2,sr()]:[2,this._engine.chat.batchDeleteConversations({identifiers:e,deleteRemotely:i,deleteMessages:a})]}))}))}))];case 1:return l=p.sent(),this.logger.summary(H.A_BATCH_DEL_CONVERS_R,l,u),[2,l.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,r,n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelType,n=this.logger.createTraceId(),this.logger.info(H.A_GET_UG_LIST_T,JSON.stringify({targetId:t,channelType:r}),n),[4,ur.create("getUltraGroupList").validate("targetId",t,Rt).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isValueOf("channelType",r,exports.UltraGroupChannelType).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE).result().tryTrans(this.validateLogin).next((function(){return o(a,void 0,void 0,(function(){return s(this,(function(t){return this._ugSynced?[2,this._engine.chat.getUltraGroupList(e)]:[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(H.A_GET_UG_LIST_R,i,n),[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,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_BLOCKED_UG_LIST_T,"",e),[4,ur.create("getBlockedUGList").result().tryTrans(this.validateConnected).next((function(){return o(r,void 0,void 0,(function(){return s(this,(function(e){return this._ugSynced?[2,this._engine.chat.getBlockedUGList()]:[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(H.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 n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_CLEAR_UNREAD_COUNT_T,JSON.stringify(e),n),[4,ur.create("clearUnreadCount").check((function(t){return Ul(t,e,z)})).result().tryTrans((function(){return a.checkAuthed(e.conversationType!==exports.ConversationType.ULTRA_GROUP)})).next((function(){return o(a,void 0,void 0,(function(){var n;return s(this,(function(i){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(n=c(this,t,"m",r).call(this,e),[2,this._engine.chat.clearConversationUnreadCount(n)]):[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(H.A_CLEAR_UNREAD_COUNT_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_CLEAR_ALL_UNREAD_COUNT_T,null,e),[4,ur.create("clearAllUnreadCount").result().tryTrans(this.validateLogin).next((function(){return o(r,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.chat.clearAllSGUnreadCount()]}))}))}))];case 1:return t=n.sent(),this.logger.summary(H.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 n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_UNREAD_COUNT_T,JSON.stringify(e),n),[4,ur.create("getUnreadCount").check((function(t){return Ul(t,e,z)})).result().tryTrans(this.validateLogin).next((function(){return o(a,void 0,void 0,(function(){var n;return s(this,(function(i){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(n=c(this,t,"m",r).call(this,e),[2,this._engine.chat.getConversationUnreadCount(n)]):[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(H.A_GET_UNREAD_COUNT_R,i,n,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_TOTAL_UNREAD_COUNT_T,JSON.stringify({conversationTypes:e,includeMuted:t,channelId:r}),n),[4,ur.create("getTotalUnreadCount").validate("channelId",r,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",e,It).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin).next((function(n){return o(a,void 0,void 0,(function(){var i,o;return s(this,(function(s){return!(i=lg(n))&&e&&e.includes(exports.ConversationType.ULTRA_GROUP)?[2,ar(exports.ErrorCode.METHOD_NOT_SUPPORT)]:(o=e&&e.length>0?e:$(i?Q:K)).includes(exports.ConversationType.ULTRA_GROUP)&&!this._ugSynced?[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCount(o,!!t,r)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(H.A_GET_TOTAL_UNREAD_COUNT_R,i,n,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T,JSON.stringify({conversationTypes:e,levels:t,isMentioned:r}),n),[4,ur.create("getTotalUnreadCountByLevels").isLimitedTypedArray("conversationTypes",e,20,(function(e){return ee(e,Q)}),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).isTypedArray("levels",t,yt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(a,void 0,void 0,(function(){return s(this,(function(n){return e.includes(exports.ConversationType.ULTRA_GROUP)&&!this._ugSynced?[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCountByLevels(e,t,r)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(H.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R,i,n,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 n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_FIRST_UNREAD_MEG_T,JSON.stringify(e),n),[4,ur.create("getFirstUnreadMessage").check((function(t){return Ul(t,e,z)})).result().tryTrans(this.validateLogin).next((function(){var n=c(o,t,"m",r).call(o,e);return o._engine.chat.getFirstUnreadMessage(n)}))];case 1:return i=s.sent(),this.logger.summary(H.A_GET_FIRST_UNREAD_MSG_R,i,n,e),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),n),[4,ur.create("getFirstUnreadMessageDigest").check((function(t){return Ul(t,e,z)})).result().tryTrans(this.validateLogin).next((function(){var n=c(o,t,"m",r).call(o,e);return o._engine.chat.getFirstUnreadMessageDigest(n)}))];case 1:return i=s.sent(),this.logger.summary(H.A_GET_FIRST_UNREAD_MSG_DIGEST_R,i,n,e),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:n}),i),[4,ur.create("batchSetConversationNotificationLevel").isLimitedTypedArray("conversations",e,20,(function(e){return!wl("batchSetConversationNotificationLevel",e,Q).isFailed}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isValueOf("notificationLevel",n,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var i=e.map((function(e){return c(a,t,"m",r).call(a,e)}));return a._engine.chat.batchSetConversationNotificationLevel(i,n)}))];case 1:return o=s.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,i,a){return o(this,void 0,void 0,(function(){var o,u,l,d,p,f=this;return s(this,(function(s){switch(s.label){case 0:return o=ur.create("batchSetConversationToTop"),(u=o.isLimitedTypedArray("conversations",e,20,(function(e){return wl("batchSetConversationToTop",e,Q).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?sr():ar(exports.ErrorCode.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(l=this.logger.createTraceId(),d=e.map((function(e){return c(f,t,"m",r).call(f,e)})),this.logger.info(H.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:d,isTop:n,isUpdateTime:i,isCreateConversation:a}),l),[4,this._engine.chat.batchSetConversationToTop(d,n,i,a)]):[2,u.wipe()];case 1:return p=s.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_TO_TOP_R,p,l),[2,p]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return i=ur.create("batchSetConversationTranslateStrategy"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return wl("",e,Q).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isValueOf("strategy",n,vn,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected)).isOk?(a=this.logger.createTraceId(),this.logger.info(H.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:n}),a),u=e.map((function(e){return c(d,t,"m",r).call(d,e)})),[4,this._engine.chat.batchSetConversationTranslateStrategy(u,n)]):[2,o.wipe()];case 1:return l=s.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,l,a),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i=this;return s(this,(function(o){switch(o.label){case 0:return[4,wl("saveTextMessageDraft",e,z).isString("draft",n,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).result().tryTrans(this.validateLogin).next((function(){var o=c(i,t,"m",r).call(i,e);return i._engine.saveTextMessageDraft(o,n)}))];case 1:return[2,o.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n=this;return s(this,(function(i){switch(i.label){case 0:return[4,wl("getTextMessageDraft",e,z).result().tryTrans(this.validateLogin).next((function(){var i=c(n,t,"m",r).call(n,e);return n._engine.getTextMessageDraft(i)}))];case 1:return[2,i.sent()]}}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n=this;return s(this,(function(i){switch(i.label){case 0:return[4,wl("clearTextMessageDraft",e,z).result().tryTrans(this.validateLogin).next((function(){var i=c(n,t,"m",r).call(n,e);return n._engine.clearTextMessageDraft(i)}))];case 1:return[2,i.sent()]}}))}))}}),Object.defineProperty(e.prototype,"recallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),o={conversation:e,messageUId:null==n?void 0:n.messageUId},this.logger.info(H.A_RECALL_MESSAGE_T,JSON.stringify(o),i),[4,wl("recallMessage",e,X).isString("messageUId",n.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",n.sentTime,!1).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",n.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",n.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",n.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",n.directionalUserIdList,300,Rt,!1,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){var i=c(u,t,"m",r).call(u,e);return u._engine.recallMsg(i,n)}))];case 1:return a=s.sent(),this.logger.summary(H.A_RECALL_MESSAGE_R,a,i,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_DEL_REMOTE_MSGS_T,JSON.stringify({conversation:e,messages:n}),i),[4,ur.create("deleteRemoteMessage").check((function(t){return Ul(t,e,Q)})).isLimitedTypedArray("messages",n,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,r=e.sentTime,n=e.messageDirection;return ht(t)&&(n===exports.MessageDirection.SEND||n===exports.MessageDirection.RECEIVE)&&pt({min:0})(r)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var i=c(a,t,"m",r).call(a,e);return a._engine.chat.deleteRemoteMessage(i,n)}))];case 1:return o=s.sent(),this.logger.summary(H.A_DEL_REMOTE_MSGS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_DEL_REMOTE_MSGS_T,JSON.stringify({identifier:e,timestamp:n}),i),[4,ur.create("deleteRemoteMessageByTimestamp").check((function(t){return Ul(t,e,X)})).isInteger("timestamp",n,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var i=c(a,t,"m",r).call(a,e);return a._engine.chat.deleteRemoteMessageByTimestamp(i,n)}))];case 1:return o=s.sent(),this.logger.summary(H.A_DEL_REMOTE_MSGS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return o=this.getNaviInfoFromCache(),u=(null==o?void 0:o.uploadServer)||"",l=(null==o?void 0:o.ossConfig)||"",[4,this._engine.getFileToken(e,t,r,n,i,a)];case 1:return c=s.sent(),d=c.code,p=c.data,d===exports.ErrorCode.SUCCESS&&p?[2,Promise.resolve(Object.assign(p,{qiniu:u,ossConfig:p.ossConfig||l}))]:[2,Promise.reject(d)]}}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i=this;return s(this,(function(o){return[2,this.validateConnected().next((function(){return i._engine.getFileUrl(e,r,t,n||"")}))]}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,ur.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.createTag(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_ADD_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t),[4,ur.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeTag(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_REMOVE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,ur.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.updateTag(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_UPDATE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_TAGS_T,"",e),[4,this.validateLogin().next((function(){return r._engine.getTagList()}))];case 1:return t=n.sent(),this.logger.summary(H.A_GET_TAGS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return(i=ur.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",n,(function(e){return wl("",e,K).result().isOk}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==n?void 0:n.length,1,1e3,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(o=n.map((function(e){return c(l,t,"m",r).call(l,e)})),a=this.logger.createTraceId(),this.logger.info(H.A_ADD_TAG_FOR_CONVERSATIONS_T,JSON.stringify({tagId:e,conversations:o}),a),[4,this._engine.chat.addTagForConversations(e,o)]):[2,i.wipe()];case 1:return u=s.sent(),this.logger.summary(H.A_ADD_TAG_FOR_CONVERSATIONS_R,u,a),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return(i=ur.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",n,1e3,(function(e){return wl("",e,K).result().isOk}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected)).isOk?(o=n.map((function(e){return c(l,t,"m",r).call(l,e)})),a=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_TAG_FOR_CONVERS_T,JSON.stringify({tagId:e,conversations:o}),a),[4,this._engine.chat.removeTagForConversations(e,o)]):[2,i.wipe()];case 1:return u=s.sent(),this.logger.summary(H.A_REMOVE_TAG_FOR_CONVERS_R,u,a),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return(i=wl("removeTagsForConversation",e,K).isTypedArray("tagIds",n,(function(e){return ct(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected)).isOk?(o=this.logger.createTraceId(),a=c(this,t,"m",r).call(this,e),this.logger.info(H.A_REMOVE_TAGS_FOR_CONVER_T,JSON.stringify({tagIds:n,conversation:a}),o),[4,this._engine.chat.removeTagsForConversation(a,n)]):[2,i.wipe()];case 1:return u=s.sent(),this.logger.summary(H.A_REMOVE_TAGS_FOR_CONVER_R,u,o),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){return(n=ur.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isInteger("count",r,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",t,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).result().tryTrans((function(){return o.checkAuthed(At())}))).isOk?(i=r<=0?20:Math.min(r,1e3),[2,this._engine.chat.getConversationListByTag(e,t,i)]):[2,n.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 r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:t}),r),[4,ur.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.getUnreadCountByTag(e,t)}))];case 1:return n=o.sent(),this.logger.summary(H.A_GET_UNREAD_COUNT_BY_TAG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return(o=wl("setConversationStatusInTag",n,K).isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==i?void 0:i.isTop,!0).fail(exports.ErrorCode.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected)).isOk?(a=this.logger.createTraceId(),u=c(this,t,"m",r).call(this,n),this.logger.info(H.A_SET_CONVER_TO_TOP_IN_TAG_T,JSON.stringify({tagId:e,conversation:u,isTop:i.isTop}),a),[4,this._engine.chat.setConversationStatusInTag(e,u,i)]):[2,o.wipe()];case 1:return l=s.sent(),this.logger.summary(H.A_SET_CONVER_TO_TOP_IN_TAG_R,l,a),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return(n=wl("getTagsForConversation",e,K).result().tryTrans(this.validateLogin)).isOk?(i=this.logger.createTraceId(),o=c(this,t,"m",r).call(this,e),this.logger.info(H.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(o),i),[4,this._engine.chat.getTagsForConversation(o)]):[2,n.wipe()];case 1:return a=s.sent(),this.logger.summary(H.A_GET_TAGS_OF_CONVERSATION_R,a,i),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_UNREAD_MENTIONED_COUNT_T,JSON.stringify(e),n),[4,ur.create("getUnreadMentionedCount").check((function(t){return Ul(t,e,Z)})).result().tryTrans(this.validateLogin).next((function(){return o(a,void 0,void 0,(function(){var n;return s(this,(function(i){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(n=c(this,t,"m",r).call(this,e),[2,this._engine.chat.getUnreadMentionedCount(n)]):[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(H.A_GET_UNREAD_MENTIONED_COUNT_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_ALL_UNREAD_MENTIONED_COUNT_T,"",e),[4,this.validateLogin().next((function(){return r._engine.chat.getAllUnreadMentionedCount()}))];case 1:return t=n.sent(),this.logger.summary(H.A_GET_ALL_UNREAD_MENTIONED_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),i=null==e?void 0:e.conversationType,o=null==e?void 0:e.targetId,a=null==e?void 0:e.channelId,this.logger.info(H.A_SEND_UG_TYPING_T,JSON.stringify({conversationType:i,targetId:o,channelId:a}),n),[4,ur.create("sendUltraGroupTypingStatus").check((function(t){return Ul(t,e,z)})).validate("conversationType",i,(function(){return i===exports.ConversationType.ULTRA_GROUP}),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).result().tryTrans(this.validateConnected).next((function(){var n=c(l,t,"m",r).call(l,e);return l._engine.chat.sendUltraGroupTypingStatus(n)}))];case 1:return u=s.sent(),this.logger.summary(H.A_SEND_UG_TYPING_R,u,n),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,d,p=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),o=n instanceof Array?n.map((function(e){return null==e?void 0:e.messageUId})):[],a=null==e?void 0:e.conversationType,u=null==e?void 0:e.targetId,l=null==e?void 0:e.channelId,this.logger.info(H.A_GET_UG_MSGS_BY_UID_T,JSON.stringify({conversationType:a,targetId:u,channelId:l,messageUIds:o}),i),[4,ur.create("getUltraGroupMessageListByMessageUId").check((function(t){return Ul(t,e,Q)})).isTypedArray("messages",n,(function(e){return ht(null==e?void 0:e.messageUId)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messages",null==n?void 0:n.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var i=c(p,t,"m",r).call(p,e);return p._engine.chat.getRemoteMessagesByUIds(i,n.map((function(e){return e.messageUId})))}))];case 1:return d=s.sent(),this.logger.summary(H.A_GET_UG_MSGS_BY_UID_R,d,i,d.isOk?{list:d.data.map((function(e){return e.messageUId}))}:void 0),[2,d.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,r){return o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T,JSON.stringify({targetId:e,levels:r,isGetMentioned:t}),n),[4,ur.create("getUGUnreadCountForAllChannels").validate("targetId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((function(e){e.isTypedArray("levels",r,(function(t){return!e.isValueOf("",t,exports.NotificationLevel,!0).isFailed}))})).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(a,void 0,void 0,(function(){return s(this,(function(n){return this._ugSynced?[2,this._engine.chat.getUGUnreadCountForAllChannels(e,r||[],t)]:[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(H.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R,i,n),[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,r,n,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelId,n=null==e?void 0:e.sentTime,i=null==e?void 0:e.count,o=this.logger.createTraceId(),this.logger.info(H.A_GET_UG_UNREAD_MENTIONED_DIGEST_T,JSON.stringify({targetId:t,channelId:r,sentTime:n,count:i}),o),[4,ur.create("getUGUnreadMentionedDigest").validate("targetId",t,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedInteger("count",i,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("sentTime",n,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return e.channelId=u._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r),u._engine.chat.getUGUnreadMentionedDigest(e)}))];case 1:return a=s.sent(),this.logger.summary(H.A_GET_UG_UNREAD_MENTIONED_DIGEST_R,a,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var i,a,u=this;return s(this,(function(l){switch(l.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),i),[4,ur.create("getUGFirstUnreadMessageDigest").validate("targetId",null==e?void 0:e.targetId,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==e?void 0:e.channelId,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){return o(u,void 0,void 0,(function(){var i;return s(this,(function(o){return this._ugSynced?(i=c(this,t,"m",r).call(this,n(n({},e),{conversationType:exports.ConversationType.ULTRA_GROUP})),[2,this._engine.chat.getUGFirstUnreadMessageDigest(i)]):[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return a=l.sent(),this.logger.summary(H.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R,a,i),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_GET_UG_UNREAD_INFO_LIST_T,JSON.stringify({targetIds:e}),t),[4,ur.create("getUGUnreadInfoList").isLimitedTypedArray("targetIds",e,20,(function(e){return Rt(e)}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){var t;return s(this,(function(r){return this._ugSynced?(t=new Set(e),[2,this._engine.chat.getUGUnreadInfoList(Array.from(t))]):[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(H.A_GET_UG_UNREAD_INFO_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.setCallInfo(e,t,r)}}),Object.defineProperty(e.prototype,"_isEnableSubDriven",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=(this.getNaviInfoFromCache()||{}).subDriven,r=void 0===t?0:t;switch(e){case exports.SubscribeType.ONLINE_STATUS:return!!(1&r);case exports.SubscribeType.USER_PROFILE:return!!(2&r);default:return!1}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._isEnableSubDriven(t)?this._engine.subscribeUser(e,t,r):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isEnableSubDriven(t)?this._engine.unSubscribeUser(e,t):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserList(e,t,r):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_GET_SUB_USERS_STATUS_T,JSON.stringify({subscribeType:e,userIds:t}),r),[4,ur.create("getSubscribeUserStatus").validate("subscribeType",e,(function(t){return[exports.SubscribeType.ONLINE_STATUS,exports.SubscribeType.USER_PROFILE].includes(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).validate("subscribeType",e,(function(t){return i._isEnableSubDriven(e)}),!0).fail(exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE).isLimitedTypedArray("userIds",t,200,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).result().tryTrans(this.validateConnected).next((function(){return i._engine.getSubscribeUserStatus(e,t)}))];case 1:return n=o.sent(),this.logger.summary(H.A_GET_SUB_USERS_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_GET_SUB_USERS_ONLINE_STATUS_T,JSON.stringify({userIds:e}),t),[4,ur.create("getSubscribeUsersOnlineStatus").isLimitedTypedArray("userIds",e,200,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){return n._engine.getSubscribeUsersOnlineStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_GET_SUB_USERS_ONLINE_STATUS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.updateMyUserProfile(e)}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_GET_USER_PROFILES_T,JSON.stringify({userIds:e}),t),[4,ur.create("getUserProfiles").isLimitedTypedArray("userIds",e,100,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateLogin).tryTrans((function(e){return n._validateUserProfile(e)})).next((function(){return n._engine.getUserProfiles(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_GET_USER_PROFILES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMyUserProfile()}}),Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.updateMyUserProfileVisibility(e)}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMyUserProfileVisibility()}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.searchUserProfileByUniqueId(e)}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.chat.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){r.logger.error(H.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.addToBlacklist(e)]}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.removeFromBlacklist(e)]}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.getBlacklist()]}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.getBlacklistStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(H.A_INSERT_MSG_T,JSON.stringify({conversation:e,params:n}),i),[4,ur.create("insertMessage").check((function(t){return Ul(t,e,z)})).validate("senderUserId",n.senderUserId,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isNotEmptyString("messageType",n.messageType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",n.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isValueOf("messageDirection",n.messageDirection,exports.MessageDirection,!0).fail(exports.ErrorCode.INVALID_MESSAGE_DIRECTION).check((function(e){n.canIncludeExpansion&&n.expansion&&xl(e,n.expansion,!0)})).isTimestamp("sentTime",n.sentTime).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isValueOf("sentStatus",n.sentStatus,exports.SentStatus).fail(exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS).isTypedArray("directedUserIds",n.directedUserIds,Rt).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isString("searchContent",n.searchContent).fail(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR).result().tryTrans((function(){return Ml(n.messageType,n.content)})).tryTrans(this.validateLogin).next((function(){var i=c(a,t,"m",r).call(a,e);return a._engine.insertMessage(i,n)}))];case 1:return o=s.sent(),this.logger.summary(H.A_INSERT_MSG_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_BATCH_INSERT_MSGS_T,JSON.stringify({count:null==e?void 0:e.length,checkDuplicate:t}),r),i=ur.create(""),[4,ur.create("batchInsertMessage").isLimitedTypedArray("messages",e,500,(function(e){return"object"==typeof e&&(Ul(i,e,z),i.validate("senderUserId",e.senderUserId,Rt,!0).isNotEmptyString("messageType",e.messageType,!0).isObject("content",e.content,!0).isValueOf("messageDirection",e.messageDirection,exports.MessageDirection,!0).check((function(t){e.canIncludeExpansion&&e.expansion&&xl(t,e.expansion,!0)})).isTimestamp("sentTime",e.sentTime).isValueOf("sentStatus",e.sentStatus,exports.SentStatus).isString("searchContent",e.searchContent).isNumber("receivedStatus",e.receivedStatus).isObject("receivedStatusInfo",e.receivedStatusInfo).isTypedArray("directedUserIds",e.directedUserIds,Rt),!i.isFailed)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateLogin).next((function(){var r=e.map((function(e){return n(n({},e),{channelId:a._channelIdConvert(e.conversationType,e.channelId)})}));return a._engine.batchInsertMessage(r,t)}))];case 1:return o=s.sent(),this.logger.summary(H.A_BATCH_INSERT_MSGS_R,o,r),[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 n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_LOCAL_MSG_COUNT_T,JSON.stringify({conversation:e}),n),[4,ur.create("getMessageCount").check((function(t){return Ul(t,e,z)})).result().tryTrans(this.validateLogin).next((function(){var n=c(o,t,"m",r).call(o,e);return o._engine.getLocalMessageCount(n)}))];case 1:return i=s.sent(),this.logger.summary(H.A_GET_LOCAL_MSG_COUNT_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_DELETE_LOCAL_MSGS_T,JSON.stringify({messageIds:e}),t),[4,ur.create("deleteLocalMessages").isTypedArray("messageIds",e,(function(e){return Number.isInteger(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY).result().tryTrans(this.validateLogin).next((function(){return n._engine.deleteLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_DELETE_LOCAL_MSGS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,i){return o(this,void 0,void 0,(function(){var o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return o=this.logger.createTraceId(),this.logger.info(H.A_DEL_LOCAL_MSGS_BY_TIME_T,JSON.stringify({conversation:e,timestamp:n,cleanSpace:i}),o),[4,ur.create("deleteLocalMessagesByTimestamp").check((function(t){return Ul(t,e,z)})).isTimestamp("timestamp",n,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){var o=c(u,t,"m",r).call(u,e);return u._engine.deleteLocalMessagesByTimestamp(o,n,!!i)}))];case 1:return a=s.sent(),this.logger.summary(H.A_DEL_LOCAL_MSGS_BY_TIME_R,a,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T,JSON.stringify({options:e}),t),[4,ur.create("batchClearLocalMessagesByTimestamp").check((function(t){t.isLimitedTypedArray("options",e,20,(function(e){return Ul(t,e,Q),!t.isFailed&&pt({min:0})(e.timestamp)})).fail(exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return n(n({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)})}));return i._engine.batchClearLocalMessagesByTimestamp(t)}))];case 1:return r=o.sent(),this.logger.summary(H.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),r),[4,ur.create("batchClearRemoteHistoryMessages").isLimitedArray("options",e,20,!0,1).check((function(t){e.forEach((function(e){Ul(t,e,Q).isTimestamp("timestamp",null==e?void 0:e.timestamp)}))})).fail(exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,void 0,!0).check((function(t){e.some((function(e){return e.conversationType===exports.ConversationType.ULTRA_GROUP}))&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.batchClearRemoteHistoryMessages(e,!!t)}))];case 1:return n=o.sent(),this.logger.summary(H.A_BATCH_CLEAR_REMOTE_MSG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_CLEAR_LOCAL_MSG_T,JSON.stringify({conversation:e}),t),[4,ur.create("clearLocalMessages").check((function(t){return Ul(t,e,z)})).result().tryTrans(this.validateLogin).next((function(){return n._engine.clearLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_CLEAR_LOCAL_MSG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),t),[4,ur.create("getLocalMessage").validate("messageId",e,(function(){return ht(e)||dt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result().next((function(){return n._engine.getMessage(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_GET_LOCAL_MESSAGE_R,r,t,{messageId:e}),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"_innerSetMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.setMessageContent(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_SET_MSG_CONTENT_T,JSON.stringify({messageId:e,messageType:r}),n),[4,ur.create("setMessageContent").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isNotEmptyString("messageType",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).result().tryTrans(this.validateLogin).next((function(){var n=JSON.stringify(t);return o._innerSetMessageContent(e,n,r)}))];case 1:return i=s.sent(),this.logger.summary(H.A_SET_MSG_CONTENT_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.setMessageSearchField(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.setMessageSentStatus(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.setMessageReceivedStatus(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setMessageStatusToRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return(r=wl("setMessageStatusToRead",e,K).isNumber("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(n=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,a=e.channelId,this.logger.info(H.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),n),[4,this._engine.updateMessageReceiptStatus(i,o,t,a)]):[2,r.wipe()];case 1:return u=s.sent(),this.logger.summary(H.A_E_SET_MESSAGE_STATUS_TO_READ_R,u,n),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return(i=ur.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return ht(e)})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",r,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",n,(function(e){return ee(e,Q)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(H.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:t,channelId:r,conversationTypes:n}),o),[4,this._engine.chat.searchConversationByContent(e,t&&0!==t.length?t:[ye.TEXT,ye.FILE],r||"",n&&0!==n.length?n:$(Q))]):[2,i.wipe()];case 1:return a=s.sent(),this.logger.summary(H.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[ye.TEXT,ye.FILE],r&&0!==r.length?r:$(Q))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,i){var a,u;return o(this,void 0,void 0,(function(){var o,l;return s(this,(function(s){switch(s.label){case 0:return(o=wl("searchMessages",e,z).isLimitedString("keyword",null==i?void 0:i.keyword,0,1e3,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==i?void 0:i.limit,1,it,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==i?void 0:i.offset,0,it).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==i?void 0:i.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",i.timeRange).validate("timeRange",i.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!dt(t)||r&&!dt(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(a=null==i?void 0:i.messageFilter)||void 0===a?void 0:a.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(u=null==i?void 0:i.messageFilter)||void 0===u?void 0:u.senderIds,Rt).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans((function(){return At()?sr():ar(exports.ErrorCode.NOT_SUPPORT,"Only support electron platform.")})).tryTrans(this.validateLogin)).isOk?(l=c(this,t,"m",r).call(this,e),[4,c(this,t,"m",d).call(this,n(n({},i),{conversationFilter:{conversationTypes:[l.conversationType],targetIds:[l.targetId],channelIds:"string"==typeof l.channelId?[l.channelId]:[]}}))]):[2,o.wipe()];case 1:return[2,s.sent().orSync((function(){return sr({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r,n,i,a,u,l;return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){return(o=ur.create("searchMessagesWithParams").isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,it,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,it).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",null==e?void 0:e.timeRange).validate("timeRange",null==e?void 0:e.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!dt(t)||r&&!dt(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.conversationTypes,(function(e){return ee(e,z)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.targetIds,20,Rt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(i=null==e?void 0:e.conversationFilter)||void 0===i?void 0:i.channelIds,10,mt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(a=null==e?void 0:e.messageFilter)||void 0===a?void 0:a.senderIds,20,Rt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(u=null==e?void 0:e.messageFilter)||void 0===u?void 0:u.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin)).isOk?(e.limit=Math.min(e.limit,100),(null===(l=e.messageFilter)||void 0===l?void 0:l.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),[2,c(this,t,"m",d).call(this,e)]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,i,a){return o(this,void 0,void 0,(function(){var o,u,l=this;return s(this,(function(s){switch(s.label){case 0:return o=this.logger.createTraceId(),this.logger.info(H.A_GET_MSGS_AROUND_TIMESTAMP_T,JSON.stringify({conversation:e,timestamp:n,beforeCount:i,afterCount:a}),o),[4,ur.create("getMessagesAroundTimestamp").check((function(t){return Ul(t,e,z)})).isLimitedInteger("timestamp",n,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("beforeCount",i,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_BEFORE).isLimitedInteger("afterCount",a,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_AFTER).result().tryTrans(this.validateLogin).next((function(){var o=c(l,t,"m",r).call(l,e);return l._engine.chat.getMessagesAroundTimestamp(o,n,i,a)}))];case 1:return u=s.sent(),this.logger.summary(H.A_GET_MSGS_AROUND_TIMESTAMP_R,u,o),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_UNREAD_MENTIONED_MSGS_T,JSON.stringify(e),n),[4,ur.create("getUnreadMentionedMessages").check((function(t){return Ul(t,e,z)})).result().tryTrans(this.validateLogin).next((function(){var n=c(o,t,"m",r).call(o,e);return o._engine.chat.getUnreadMentionedMessages(n)}))];case 1:return i=s.sent(),this.logger.summary(H.A_GET_UNREAD_MENTIONED_MSGS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=""),this._engine.clearUnreadCountByTimestamp(e,t,r,n)}}),Object.defineProperty(e.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_GET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,channelId:t}),r),[4,ur.create("getUltraGroupDefaultNotificationLevel").validate("targetId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",t,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){var r="string"==typeof t?i._channelIdConvert(exports.ConversationType.ULTRA_GROUP,t):t;return i._engine.chat.getUGDefaultNotificationLevel(e,r)}))];case 1:return n=o.sent(),this.logger.summary(H.A_GET_UG_DEFAULT_NTF_LEVEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_SET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,notificationLevel:t,channelId:r}),n),[4,ur.create("setUltraGroupDefaultNotificationLevel").validate("targetId",e,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isValueOf("notificationLevel",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var n="string"==typeof r?o._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r):r;return o._engine.chat.setUGDefaultNotificationLevel(e,t,n)}))];case 1:return i=s.sent(),this.logger.summary(H.A_SET_UG_DEFAULT_NTF_LEVEL_R,i,n),[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 n;return s(this,(function(i){return(n=wl("getConversationNotificationLevel",e,Q).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(c(this,t,"m",r).call(this,e))]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=ur.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return ee(e,Q)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).isValueOf("level",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.setConversationTypeNotificationLevel(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=ur.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return ee(e,Q)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.getConversationTypeNotificationLevel(e)]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return i=null==n?void 0:n.timestamp,o=null==n?void 0:n.count,a=null==n?void 0:n.order,u=this.logger.createTraceId(),this.logger.info(H.A_GET_REMOTE_HISTORY_MSG_T,JSON.stringify({conversation:e,options:n}),u),[4,ur.create("getRemoteHistoryMessages").check((function(t){return Ul(t,e,X)})).isLimitedInteger("timestamp",i,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",a,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",o,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){var n={timestamp:i||0,count:o||20,order:a||0,messageType:""},s=c(d,t,"m",r).call(d,e);return d._engine.getHistoryMessage(s,n,!1)}))];case 1:return l=s.sent(),this.logger.summary(H.A_GET_REMOTE_HISTORY_MSG_R,l,u),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(H.A_CLEAR_LOCAL_CACHE_O),this._engine.clearLocalData()}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATIONS_T,JSON.stringify({identifiers:e}),n),[4,ur.create("getConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,100,(function(e){return!Ul(t,e,z).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)})).result().tryTrans(this.validateLogin).next((function(){var n=e.map((function(e){return c(o,t,"m",r).call(o,e)}));return o._engine.chat.getConversations(n)}))];case 1:return i=s.sent(),this.logger.summary(H.A_GET_CONVERSATIONS_R,i,n),[2,i]}}))}))}}),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,r,n){return this._engine.rtcSignaling(e,t,r,n)}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.rtcPing(e,t,r)}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setProxy(e)}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProxy()}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.testProxy(e,t)}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=[]),this._engine.createGroup(e,t,r,n)}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.updateGroupInfo(e,t,r)}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getGroupsInfo(e)}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.kickGroupMembers(e,t,r)}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.quitGroup(e,t)}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.dismissGroup(e)}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this._engine.transferGroupOwner(e,t,n,r)}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.setGroupManagers(e,t,r)}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getGroupMembersByRole(e,t,r)}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getGroupMembers(e,t)}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._engine.setGroupMemberInfo(e,t,r,n)}}),Object.defineProperty(e.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.searchGroupMembers(e,t,r)}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.joinGroup(e)}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.inviteUsersToGroup(e,t)}}),Object.defineProperty(e.prototype,"acceptGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:exports.GroupOperationStatus.ACCEPT})}}),Object.defineProperty(e.prototype,"refuseGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:exports.GroupOperationStatus.REFUSE,reason:r})}}),Object.defineProperty(e.prototype,"acceptGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r,optType:1,optResult:exports.GroupOperationStatus.ACCEPT})}}),Object.defineProperty(e.prototype,"refuseGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r,optType:1,optResult:exports.GroupOperationStatus.REFUSE,reason:n})}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getGroupApplications(e,t,r)}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getJoinedGroupsByRole(e,t)}}),Object.defineProperty(e.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.searchJoinedGroups(e,t)}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getJoinedGroups(e)}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupRemark(e,t)}}),Object.defineProperty(e.prototype,"addGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupFollows(exports.GroupOperationType.ADD,e,t)}}),Object.defineProperty(e.prototype,"removeGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupFollows(exports.GroupOperationType.REMOVE,e,t)}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getGroupFollows(e)}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.addFriend(e,t,r)}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.deleteFriends(e,t)}}),Object.defineProperty(e.prototype,"acceptFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.acceptFriendApplication(e)}}),Object.defineProperty(e.prototype,"refuseFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.refuseFriendApplication(e,t)}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.setFriendInfo(e,t,r)}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.checkFriends(e,t)}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getFriends(e,t)}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getFriendApplications(e,t,r)}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getFriendsInfo(e)}}),Object.defineProperty(e.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.searchFriendsInfo(e)}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setFriendAddPermission(e)}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getFriendAddPermission()}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_REALTIME_CONVERSATIONS_T,JSON.stringify({count:e,startTime:t,order:r}),n),[4,ur.create("getRealtimeConversations").isLimitedInteger("count",e,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isTimestamp("startTime",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",r,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).tryTrans(Zl).next((function(){return o._engine.chat.getRealtimeConversations(e,t,r)}))];case 1:return i=s.sent(),this.logger.summary(H.A_GET_REALTIME_CONVERSATIONS_R,i,n),[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,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T,"",e),[4,this.validateConnected().tryTrans(Zl).next((function(){return r._engine.chat.getRealtimeConTotalUnreadCount()}))];case 1:return t=n.sent(),this.logger.summary(H.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,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_CLEAR_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,this.validateConnected().tryTrans(Zl).next((function(){return n._engine.chat.clearRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_CLEAR_REALTIME_CON_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_REALTIME_CONVERSATIONS_T,JSON.stringify(e),t),[4,ur.create("removeRealtimeConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,20,(function(e){return!Ul(t,e,z).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Zl).next((function(){return n._engine.chat.removeRealtimeConversations(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_REMOVE_REALTIME_CONVERSATIONS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,ur.create("batchGetRealtimeConUnreadCount").check((function(t){t.isLimitedTypedArray("identifiers",e,10,(function(e){return!Ul(t,e,z).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Zl).next((function(){return n._engine.chat.batchGetRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return ur.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SPAN_MINUTES).isValueOf("level",e.level,exports.PushNotificationQuietHoursLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.removeNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getStatsUrlList()}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=wl("sendReadReceiptResponseV5",e,J).isTypedArray("messageUIdArray",t,(function(e){return Rt(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?sr():ar(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.sendReadReceiptResponseV5(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){return(r=wl("getMessageReadReceiptInfoV5",e,J).isTypedArray("messageUIdArray",t,(function(e){return Rt(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?sr():ar(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?(n=t.map((function(t){return{identifier:e,messageUId:t}})),[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(n)]):[2,r.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,r;return s(this,(function(n){return t=ur.create(""),(r=ur.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(function(e){return Ul(t,e.identifier,J).isNotEmptyString("messageUId",e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().isOk}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?sr():ar(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(e)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=wl("getMessageReadReceiptInfoV5",e,J).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("option",r,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",r.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",r.pageCount,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?sr():ar(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?(r.order=1!==r.order?0:1,r.readStatus=1!==r.readStatus?0:1,[2,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,t,r)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=wl("getMessagesReadReceiptByUsersV5",e,J).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",r,(function(e){return Rt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",r.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?sr():ar(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessagesReadReceiptByUsersV5(e,t,r)]:[2,n.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 r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:t}),r),[4,ur.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((function(e){return!!(1&(e.AIBusinessSub||0))?sr():ar(exports.ErrorCode.SPEECH_TO_TEXT_DISABLE)})).next((function(){return i._engine.chat.requestSpeechToTextForMessage(e,t)}))];case 1:return n=o.sent(),this.logger.summary(H.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){switch(n.label){case 0:return[4,ur.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result().tryTrans(this.validateLogin).next((function(){return r._engine.chat.setMessageSpeechToTextVisible(e,!!t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:t,topPriority:r}),n),[4,ur.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isInteger("count",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateLogin).next((function(){var n=t<=0?20:Math.min(t,100);return o._engine.chat.getUntaggedConversationListByPage(e,n,!!r)}))];case 1:return i=s.sent(),this.logger.summary(H.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"translateMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r;return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=At(),[4,ur.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof gn&&e.isValid(!n)}),!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(r=null==e?void 0:e.list)||void 0===r?void 0:r.length,1,10,!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isValueOf("mode",null==e?void 0:e.mode,_n).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(i=s.sent()).isOk?(o=e.list,a=e.force,u=e.mode,[2,c(this,t,"m",p).call(this,o,0,u,a)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"translateTextsWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r;return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return[4,ur.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof En&&e.isValid(!0)}),!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(r=null==e?void 0:e.list)||void 0===r?void 0:r.length,1,10,!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isValueOf("mode",null==e?void 0:e.mode,_n).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(n=s.sent()).isOk?(i=e.list,o=e.mode,[2,c(this,t,"m",p).call(this,i,1,o)]):[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,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t),[4,ur.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((function(){return n._engine.userSettings.setTranslationLanguage(e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_SET_TRANSLATION_LANGUAGE_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_TRANSLATION_LANGUAGE_T,void 0,e),[4,this.validateLogin().next((function(){return r._engine.userSettings.getTranslationLanguage()}))];case 1:return t=n.sent(),this.logger.summary(H.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,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_SET_AUTO_TRANSLATE_ENABLED_T,JSON.stringify({enabled:!!e}),t),[4,this.validateConnected().next((function(){return n._engine.userSettings.setAutoTranslateEnabled(!!e)}))];case 1:return r=i.sent(),this.logger.summary(H.A_SET_AUTO_TRANSLATE_ENABLED_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_AUTO_TRANSLATE_ENABLED_T,void 0,e),[4,this.validateLogin().next((function(){return r._engine.userSettings.getAutoTranslateEnabled()}))];case 1:return t=n.sent(),this.logger.summary(H.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,r,n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUId,n=null==e?void 0:e.messageContent,this.logger.info(H.A_MODIFY_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUId:r,conversation:null==e?void 0:e.conversation}),t),[4,ur.create("modifyMessageWithParams").check((function(t){return Ul(t,null==e?void 0:e.conversation,Z)})).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("messageContent",n,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isLimitedInteger("messageContent",rl(JSON.stringify(n)),1,je,!0).fail(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT).result().tryTrans(this.validateConnected).next((function(){return o._engine.chat.modifyMessageWithParams(e)}))];case 1:return i=s.sent(),this.logger.summary(H.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,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUIds,this.logger.info(H.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUIds:r}),t),[4,wl("refreshReferenceMessageWithParams",null==e?void 0:e.conversationIdentifier,Z).isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isTypedArray("messageUIds",r,(function(e){return ht(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==r?void 0:r.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.refreshReferenceMessageWithParams(r,e.conversationIdentifier,e.remoteMessageBlock,e.localMessageBlock,e.messageInfoMap)}))];case 1:return n=o.sent(),this.logger.summary(H.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_SYNC_REMOTE_CONVERSATIONS_T,void 0,e),[4,this.validateConnected().next((function(){return r._engine.chat.syncRemoteConversations()}))];case 1:return t=n.sent(),this.logger.summary(H.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 r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T,JSON.stringify({targetId:e,timestamp:t}),r),[4,ur.create("deleteLocalUGMessagesForAllChannel").isNotEmptyString("targetId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTimestamp("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.deleteLocalUGMessagesForAllChannel(e,t)}))];case 1:return n=o.sent(),this.logger.summary(H.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T,JSON.stringify({params:e}),t),[4,ur.create("getUnreadMentionMeConversationList").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,Number.MAX_SAFE_INTEGER,(function(e){return ee(e,Q)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){if(r=lg(t)){if(!this._ugSynced)return[2,ar(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}else if(e.conversationTypes=e.conversationTypes.filter((function(e){return e!==exports.ConversationType.ULTRA_GROUP})),0===e.conversationTypes.length)return[2,sr([])];return[2,this._engine.chat.getUnreadMentionMeConversationList(e,r)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(H.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),t=new WeakSet,r=function(e){return n(n({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})},a=function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return n=e.channelId,i=e.conversationType,o=e.targetId,[4,this._engine.sendMessage(i,o,{content:t,messageType:ye.EXPANSION_NOTIFY,channelId:n},r)];case 1:return[2,(a=s.sent().code)===exports.ErrorCode.SUCCESS?sr():ar(a)]}}))}))},d=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.timeRange||{},r=t.startTime,n=t.endTime,i={startTime:null!=r?r:0,endTime:null!=n?n:Number.MAX_SAFE_INTEGER},e.timeRange=i,o=this.logger.createTraceId(),this.logger.info(H.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return a=s.sent(),this.logger.summary(H.A_SEARCH_MSGS_BY_PARAMS_R,a,o),[2,a]}}))}))},p=function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,this._engine.translateWithParams(e.map((function(e){return e.toInnerParam()})),r||_n.MECHANICAL,!!n,t)]}))}))},i([fE],e.prototype,"updateMyUserProfile",null),i([fE],e.prototype,"getMyUserProfile",null),i([fE],e.prototype,"updateMyUserProfileVisibility",null),i([fE],e.prototype,"getMyUserProfileVisibility",null),i([fE],e.prototype,"searchUserProfileByUniqueId",null),i([fE],e.prototype,"createGroup",null),i([fE],e.prototype,"updateGroupInfo",null),i([fE],e.prototype,"getGroupsInfo",null),i([fE],e.prototype,"kickGroupMembers",null),i([fE],e.prototype,"quitGroup",null),i([fE],e.prototype,"dismissGroup",null),i([fE],e.prototype,"transferGroupOwner",null),i([fE],e.prototype,"setGroupManagers",null),i([fE],e.prototype,"getGroupMembersByRole",null),i([fE],e.prototype,"getGroupMembers",null),i([fE],e.prototype,"setGroupMemberInfo",null),i([fE],e.prototype,"searchGroupMembers",null),i([fE],e.prototype,"joinGroup",null),i([fE],e.prototype,"inviteUsersToGroup",null),i([fE],e.prototype,"acceptGroupInvite",null),i([fE],e.prototype,"refuseGroupInvite",null),i([fE],e.prototype,"acceptGroupApplication",null),i([fE],e.prototype,"refuseGroupApplication",null),i([fE],e.prototype,"getGroupApplications",null),i([fE],e.prototype,"getJoinedGroupsByRole",null),i([fE],e.prototype,"searchJoinedGroups",null),i([fE],e.prototype,"getJoinedGroups",null),i([fE],e.prototype,"setGroupRemark",null),i([fE],e.prototype,"addGroupFollows",null),i([fE],e.prototype,"removeGroupFollows",null),i([fE],e.prototype,"getGroupFollows",null),i([fE],e.prototype,"addFriend",null),i([fE],e.prototype,"deleteFriends",null),i([fE],e.prototype,"acceptFriendApplication",null),i([fE],e.prototype,"refuseFriendApplication",null),i([fE],e.prototype,"setFriendInfo",null),i([fE],e.prototype,"checkFriends",null),i([fE],e.prototype,"getFriends",null),i([fE],e.prototype,"getFriendApplications",null),i([fE],e.prototype,"getFriendsInfo",null),i([fE],e.prototype,"searchFriendsInfo",null),i([fE],e.prototype,"setFriendAddPermission",null),i([fE],e.prototype,"getFriendAddPermission",null),e}();exports.APIContext=_E,exports.AppStorage=jl,exports.BasicEngine=Tl,exports.BasicLogger=Fr,exports.Codec=nl,exports.EventEmitter=Zu,exports.GroupReadReceiptVersion=xe,exports.LogDBProxy=Kr,exports.LogTagId=H,exports.MAX_MESSAGE_CONTENT_BYTES=je,exports.MAX_U32_INTEGER=it,exports.MAX_UPLOAD_FILE_SIZE=5368709120,exports.MessageAuditType={DISALLOW:0,ALLOW:1},exports.MessageType=ye,exports.PBCodec=rs,exports.PluginContext=Rl,exports.RCResult=or,exports.RTCPluginContext=Sl,exports.ReferenceMessageStatus=Lr,exports.SpeechToTextStatus=De,exports.SuspendablePromise=ir,exports.TranslateMessageParam=gn,exports.TranslateMode=_n,exports.TranslateStatus=bn,exports.TranslateStrategy=vn,exports.TranslateTextParam=En,exports.UPLOAD_FILE_CHUNK_SIZE=10485760,exports.UUId=at,exports.UserSettingsChangedKey=Mr,exports.UserType={NORMAL:0,ROBOT:1},exports.Validator=ur,exports.ValidatorManage=Ll,exports.VersionManage=st,exports.assert=function(e,t,r,n){if(void 0===n&&(n=!1),!Pl(e,t,r,n))throw new Nl("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},exports.createLogDBProxy=Jr,exports.fail=ar,exports.fixUrlProtocol=zt,exports.forEach=$u,exports.getMessageTypeDescription=ln,exports.getUUID=function(){return at.gen()},exports.getUUID22=function(){return at.genWithLen(22)},exports.hasMessageTypeDescription=cn,exports.httpRequest=Or,exports.isArray=ft,exports.isBoolean=function(e){return"boolean"==typeof e},exports.isFunction=Et,exports.isHttpUrl=vt,exports.isInteger=pt,exports.isLimitedArray=function(e){return function(t){if(!ft(t)||void 0!==e.minLength&&t.length<e.minLength||void 0!==e.maxLength&&t.length>e.maxLength)return!1;if(!e.itemValidator)return!0;var r=!0;return t.every((function(t){var n=e.itemValidator&&e.itemValidator(t);return"object"==typeof n?n.errorKey?(r={errorKey:n.errorKey,valid:n.valid},!1):(r=n.valid,n.valid):(r=!!n,n)})),r}},exports.isLimitedString=_t,exports.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},exports.isNumber=dt,exports.isObject=gt,exports.isString=ct,exports.isUndefined=bt,exports.isValidConversation=function(e,t){var r;return gt(e)?(t&&!t.includes(e.conversationType)&&(r="conversationTypeNotSupport"),Rt(e.targetId)||(r="targetId"),It(e.conversationType)||(r="conversationType"),bt(e.channelId)||mt(e.channelId)||(r="channelId"),bt(r)?{valid:!0}:{valid:bt(r),errorKey:r}):{valid:!1,errorKey:"conversation"}},exports.isValidConversationType=It,exports.isValidEnum=function(e){return Object.values(e.type).includes(e.value)},exports.isValidFileType=function(e){return dt(e)&&Object.prototype.hasOwnProperty.call(exports.FileType,e)},exports.isValidGroupId=function(e){return _t({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},exports.isValidTargetId=Rt,exports.logger=zu,exports.map=function(e,t){return $u(e,(function(r,n){e[n]=t(r,n)})),e},exports.notEmptyArray=function(e){return ft(e)&&e.length>0},exports.notEmptyObject=Tt,exports.notEmptyString=ht,exports.ok=sr,exports.runtime=es,exports.trans2IReceivedStatusInfo=Ot,exports.trans2NotificationLevel=function(e){return e===exports.NotificationStatus.OPEN?exports.NotificationLevel.AT_MESSAGE_NOTIFICATION:exports.NotificationLevel.NOT_SET},exports.trans2NotificationStatus=Me,exports.transformReceivedStatusFlag=function(e){var t=exports.ReceivedStatus.UNREAD;return(null==e?void 0:e.isRead)&&(t|=exports.ReceivedStatus.READ),(null==e?void 0:e.isListened)&&(t|=exports.ReceivedStatus.LISTENED),(null==e?void 0:e.isDownload)&&(t|=exports.ReceivedStatus.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=exports.ReceivedStatus.RETRIEVED),t},exports.usingCppEngine=At,exports.validate=Pl;
|
|
16
|
+
var extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},extendStatics(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)},UploadMethod;function __decorate(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function __awaiter(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}function __generator(e,t){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=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],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function __spreadArray(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function __classPrivateFieldGet(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function __classPrivateFieldSet(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}exports.UploadMethod=void 0,UploadMethod=exports.UploadMethod||(exports.UploadMethod={}),UploadMethod[UploadMethod.QINIU=1]="QINIU",UploadMethod[UploadMethod.ALI=2]="ALI",UploadMethod[UploadMethod.AWS=3]="AWS",UploadMethod[UploadMethod.STC=4]="STC",UploadMethod[UploadMethod.MINIO=5]="MINIO";var Log={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",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_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"},DirectionType,QueryFriendsDirectionType,FriendAddPermission,FriendRelationType,FriendApplicationType,FriendApplicationStatus,FriendMsgChangeType,FriendEventType,GroupJoinPermission,GroupOperationPermission,GroupMemberInfoEditPermission,GroupInviteHandlePermission,GroupMemberRole,GroupOperation,GroupInfoChangeSubChangeType,GroupOperationType,GroupApplicationStatus,GroupOperationStatus,GroupOperationRole,GroupMsgChangeType,GroupApplicationType,GroupApplicationDirection,ChatroomEntryType,ChrmSyncStatus,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ErrorCode,ConversationType;exports.DirectionType=void 0,DirectionType=exports.DirectionType||(exports.DirectionType={}),DirectionType[DirectionType.BOTH=2]="BOTH",exports.QueryFriendsDirectionType=void 0,QueryFriendsDirectionType=exports.QueryFriendsDirectionType||(exports.QueryFriendsDirectionType={}),QueryFriendsDirectionType[QueryFriendsDirectionType.BOTH=2]="BOTH",exports.FriendAddPermission=void 0,FriendAddPermission=exports.FriendAddPermission||(exports.FriendAddPermission={}),FriendAddPermission[FriendAddPermission.FREE=1]="FREE",FriendAddPermission[FriendAddPermission.NEED_VERIFY=2]="NEED_VERIFY",FriendAddPermission[FriendAddPermission.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.FriendRelationType=void 0,FriendRelationType=exports.FriendRelationType||(exports.FriendRelationType={}),FriendRelationType[FriendRelationType.NONE=0]="NONE",FriendRelationType[FriendRelationType.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",FriendRelationType[FriendRelationType.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",FriendRelationType[FriendRelationType.BOTH_WAY=3]="BOTH_WAY",exports.FriendApplicationType=void 0,FriendApplicationType=exports.FriendApplicationType||(exports.FriendApplicationType={}),FriendApplicationType[FriendApplicationType.SENT=1]="SENT",FriendApplicationType[FriendApplicationType.RECEIVED=2]="RECEIVED",exports.FriendApplicationStatus=void 0,FriendApplicationStatus=exports.FriendApplicationStatus||(exports.FriendApplicationStatus={}),FriendApplicationStatus[FriendApplicationStatus.UNHANDLED=0]="UNHANDLED",FriendApplicationStatus[FriendApplicationStatus.ACCEPTED=1]="ACCEPTED",FriendApplicationStatus[FriendApplicationStatus.REFUSED=2]="REFUSED",FriendApplicationStatus[FriendApplicationStatus.EXPIRED=3]="EXPIRED",function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(FriendMsgChangeType||(FriendMsgChangeType={})),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"}(FriendEventType||(FriendEventType={})),exports.GroupJoinPermission=void 0,GroupJoinPermission=exports.GroupJoinPermission||(exports.GroupJoinPermission={}),GroupJoinPermission[GroupJoinPermission.OWNER_VERIFY=0]="OWNER_VERIFY",GroupJoinPermission[GroupJoinPermission.FREE=1]="FREE",GroupJoinPermission[GroupJoinPermission.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",GroupJoinPermission[GroupJoinPermission.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.GroupOperationPermission=void 0,GroupOperationPermission=exports.GroupOperationPermission||(exports.GroupOperationPermission={}),GroupOperationPermission[GroupOperationPermission.OWNER=0]="OWNER",GroupOperationPermission[GroupOperationPermission.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",GroupOperationPermission[GroupOperationPermission.EVERYONE=2]="EVERYONE",exports.GroupMemberInfoEditPermission=void 0,GroupMemberInfoEditPermission=exports.GroupMemberInfoEditPermission||(exports.GroupMemberInfoEditPermission={}),GroupMemberInfoEditPermission[GroupMemberInfoEditPermission.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",GroupMemberInfoEditPermission[GroupMemberInfoEditPermission.OWNER_OR_SELF=1]="OWNER_OR_SELF",GroupMemberInfoEditPermission[GroupMemberInfoEditPermission.SELF=2]="SELF",exports.GroupInviteHandlePermission=void 0,GroupInviteHandlePermission=exports.GroupInviteHandlePermission||(exports.GroupInviteHandlePermission={}),GroupInviteHandlePermission[GroupInviteHandlePermission.FREE=0]="FREE",GroupInviteHandlePermission[GroupInviteHandlePermission.INVITEE_VERIFY=1]="INVITEE_VERIFY",exports.GroupMemberRole=void 0,GroupMemberRole=exports.GroupMemberRole||(exports.GroupMemberRole={}),GroupMemberRole[GroupMemberRole.UNDEF=0]="UNDEF",GroupMemberRole[GroupMemberRole.NORMAL=1]="NORMAL",GroupMemberRole[GroupMemberRole.MANAGER=2]="MANAGER",GroupMemberRole[GroupMemberRole.OWNER=3]="OWNER",exports.GroupOperation=void 0,GroupOperation=exports.GroupOperation||(exports.GroupOperation={}),GroupOperation[GroupOperation.CREATE=0]="CREATE",GroupOperation[GroupOperation.JOIN=1]="JOIN",GroupOperation[GroupOperation.KICK=2]="KICK",GroupOperation[GroupOperation.QUIT=3]="QUIT",GroupOperation[GroupOperation.DISMISS=4]="DISMISS",GroupOperation[GroupOperation.ADD_MANAGER=5]="ADD_MANAGER",GroupOperation[GroupOperation.REMOVE_MANAGER=6]="REMOVE_MANAGER",GroupOperation[GroupOperation.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER",function(e){e[e.GROUP_INFO_CHANGE=0]="GROUP_INFO_CHANGE",e[e.MEMBER_PROFILE_CHANGE=1]="MEMBER_PROFILE_CHANGE",e[e.GROUP_REMARK_SET=2]="GROUP_REMARK_SET",e[e.GROUP_REMARK_DELETE=3]="GROUP_REMARK_DELETE"}(GroupInfoChangeSubChangeType||(GroupInfoChangeSubChangeType={})),exports.GroupOperationType=void 0,GroupOperationType=exports.GroupOperationType||(exports.GroupOperationType={}),GroupOperationType[GroupOperationType.ADD=1]="ADD",GroupOperationType[GroupOperationType.REMOVE=2]="REMOVE",exports.GroupApplicationStatus=void 0,GroupApplicationStatus=exports.GroupApplicationStatus||(exports.GroupApplicationStatus={}),GroupApplicationStatus[GroupApplicationStatus.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",GroupApplicationStatus[GroupApplicationStatus.MANAGER_REFUSED=1]="MANAGER_REFUSED",GroupApplicationStatus[GroupApplicationStatus.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",GroupApplicationStatus[GroupApplicationStatus.INVITEE_REFUSED=3]="INVITEE_REFUSED",GroupApplicationStatus[GroupApplicationStatus.JOINED=4]="JOINED",GroupApplicationStatus[GroupApplicationStatus.EXPIRED=5]="EXPIRED",exports.GroupOperationStatus=void 0,GroupOperationStatus=exports.GroupOperationStatus||(exports.GroupOperationStatus={}),GroupOperationStatus[GroupOperationStatus.REFUSE=0]="REFUSE",GroupOperationStatus[GroupOperationStatus.ACCEPT=1]="ACCEPT",exports.GroupOperationRole=void 0,GroupOperationRole=exports.GroupOperationRole||(exports.GroupOperationRole={}),GroupOperationRole[GroupOperationRole.APPLICANT=0]="APPLICANT",GroupOperationRole[GroupOperationRole.MANAGER=1]="MANAGER",function(e){e[e.GROUP_OPERATION=11]="GROUP_OPERATION",e[e.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",e[e.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",e[e.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(GroupMsgChangeType||(GroupMsgChangeType={})),exports.GroupApplicationType=void 0,GroupApplicationType=exports.GroupApplicationType||(exports.GroupApplicationType={}),GroupApplicationType[GroupApplicationType.APPLICATION=0]="APPLICATION",GroupApplicationType[GroupApplicationType.INVITATION=1]="INVITATION",exports.GroupApplicationDirection=void 0,GroupApplicationDirection=exports.GroupApplicationDirection||(exports.GroupApplicationDirection={}),GroupApplicationDirection[GroupApplicationDirection.APPLICATION_SENT=0]="APPLICATION_SENT",GroupApplicationDirection[GroupApplicationDirection.INVITATION_SENT=1]="INVITATION_SENT",GroupApplicationDirection[GroupApplicationDirection.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",GroupApplicationDirection[GroupApplicationDirection.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED",exports.ChatroomEntryType=void 0,ChatroomEntryType=exports.ChatroomEntryType||(exports.ChatroomEntryType={}),ChatroomEntryType[ChatroomEntryType.UPDATE=1]="UPDATE",ChatroomEntryType[ChatroomEntryType.DELETE=2]="DELETE",exports.ChrmSyncStatus=void 0,ChrmSyncStatus=exports.ChrmSyncStatus||(exports.ChrmSyncStatus={}),ChrmSyncStatus[ChrmSyncStatus.QUIT=0]="QUIT",ChrmSyncStatus[ChrmSyncStatus.JOIN=1]="JOIN",exports.ChatroomSyncStatusReason=void 0,ChatroomSyncStatusReason=exports.ChatroomSyncStatusReason||(exports.ChatroomSyncStatusReason={}),ChatroomSyncStatusReason[ChatroomSyncStatusReason.LeaveOnMyOwn=0]="LeaveOnMyOwn",ChatroomSyncStatusReason[ChatroomSyncStatusReason.OtherDeviceLogin=1]="OtherDeviceLogin",exports.ChatroomUserChangeType=void 0,ChatroomUserChangeType=exports.ChatroomUserChangeType||(exports.ChatroomUserChangeType={}),ChatroomUserChangeType[ChatroomUserChangeType.QUIT=0]="QUIT",ChatroomUserChangeType[ChatroomUserChangeType.JOIN=1]="JOIN",exports.ChrmMemBanType=void 0,ChrmMemBanType=exports.ChrmMemBanType||(exports.ChrmMemBanType={}),ChrmMemBanType[ChrmMemBanType.UnmuteUsers=0]="UnmuteUsers",ChrmMemBanType[ChrmMemBanType.MuteUsers=1]="MuteUsers",ChrmMemBanType[ChrmMemBanType.UnmuteAll=2]="UnmuteAll",ChrmMemBanType[ChrmMemBanType.MuteAll=3]="MuteAll",ChrmMemBanType[ChrmMemBanType.RemoveWhitelist=4]="RemoveWhitelist",ChrmMemBanType[ChrmMemBanType.AddWhitelist=5]="AddWhitelist",ChrmMemBanType[ChrmMemBanType.UnmuteGloble=6]="UnmuteGloble",ChrmMemBanType[ChrmMemBanType.MuteGloble=7]="MuteGloble",exports.ChrmMemOperateType=void 0,ChrmMemOperateType=exports.ChrmMemOperateType||(exports.ChrmMemOperateType={}),ChrmMemOperateType[ChrmMemOperateType.Deblock=0]="Deblock",ChrmMemOperateType[ChrmMemOperateType.Blocked=1]="Blocked",exports.ErrorCode=void 0,ErrorCode=exports.ErrorCode||(exports.ErrorCode={}),ErrorCode[ErrorCode.SUCCESS=0]="SUCCESS",ErrorCode[ErrorCode.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",ErrorCode[ErrorCode.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",ErrorCode[ErrorCode.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",ErrorCode[ErrorCode.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",ErrorCode[ErrorCode.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",ErrorCode[ErrorCode.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",ErrorCode[ErrorCode.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",ErrorCode[ErrorCode.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",ErrorCode[ErrorCode.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",ErrorCode[ErrorCode.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",ErrorCode[ErrorCode.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",ErrorCode[ErrorCode.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",ErrorCode[ErrorCode.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",ErrorCode[ErrorCode.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",ErrorCode[ErrorCode.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",ErrorCode[ErrorCode.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",ErrorCode[ErrorCode.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",ErrorCode[ErrorCode.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",ErrorCode[ErrorCode.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",ErrorCode[ErrorCode.NOT_IN_GROUP=22406]="NOT_IN_GROUP",ErrorCode[ErrorCode.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",ErrorCode[ErrorCode.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",ErrorCode[ErrorCode.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",ErrorCode[ErrorCode.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",ErrorCode[ErrorCode.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",ErrorCode[ErrorCode.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",ErrorCode[ErrorCode.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",ErrorCode[ErrorCode.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",ErrorCode[ErrorCode.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",ErrorCode[ErrorCode.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",ErrorCode[ErrorCode.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",ErrorCode[ErrorCode.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",ErrorCode[ErrorCode.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",ErrorCode[ErrorCode.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",ErrorCode[ErrorCode.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",ErrorCode[ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",ErrorCode[ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",ErrorCode[ErrorCode.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",ErrorCode[ErrorCode.HAVNODEVICEID=24001]="HAVNODEVICEID",ErrorCode[ErrorCode.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",ErrorCode[ErrorCode.FEILD=24009]="FEILD",ErrorCode[ErrorCode.INTERNALERRROR=24015]="INTERNALERRROR",ErrorCode[ErrorCode.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",ErrorCode[ErrorCode.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",ErrorCode[ErrorCode.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",ErrorCode[ErrorCode.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",ErrorCode[ErrorCode.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",ErrorCode[ErrorCode.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",ErrorCode[ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",ErrorCode[ErrorCode.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",ErrorCode[ErrorCode.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",ErrorCode[ErrorCode.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",ErrorCode[ErrorCode.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",ErrorCode[ErrorCode.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",ErrorCode[ErrorCode.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",ErrorCode[ErrorCode.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",ErrorCode[ErrorCode.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",ErrorCode[ErrorCode.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",ErrorCode[ErrorCode.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",ErrorCode[ErrorCode.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",ErrorCode[ErrorCode.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",ErrorCode[ErrorCode.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",ErrorCode[ErrorCode.RECALL_MESSAGE=25101]="RECALL_MESSAGE",ErrorCode[ErrorCode.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",ErrorCode[ErrorCode.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",ErrorCode[ErrorCode.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",ErrorCode[ErrorCode.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",ErrorCode[ErrorCode.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",ErrorCode[ErrorCode.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",ErrorCode[ErrorCode.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",ErrorCode[ErrorCode.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",ErrorCode[ErrorCode.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",ErrorCode[ErrorCode.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",ErrorCode[ErrorCode.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",ErrorCode[ErrorCode.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",ErrorCode[ErrorCode.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",ErrorCode[ErrorCode.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",ErrorCode[ErrorCode.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",ErrorCode[ErrorCode.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",ErrorCode[ErrorCode.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",ErrorCode[ErrorCode.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",ErrorCode[ErrorCode.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",ErrorCode[ErrorCode.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",ErrorCode[ErrorCode.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",ErrorCode[ErrorCode.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",ErrorCode[ErrorCode.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",ErrorCode[ErrorCode.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",ErrorCode[ErrorCode.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",ErrorCode[ErrorCode.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",ErrorCode[ErrorCode.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",ErrorCode[ErrorCode.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",ErrorCode[ErrorCode.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",ErrorCode[ErrorCode.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",ErrorCode[ErrorCode.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",ErrorCode[ErrorCode.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",ErrorCode[ErrorCode.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",ErrorCode[ErrorCode.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",ErrorCode[ErrorCode.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",ErrorCode[ErrorCode.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",ErrorCode[ErrorCode.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",ErrorCode[ErrorCode.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",ErrorCode[ErrorCode.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",ErrorCode[ErrorCode.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",ErrorCode[ErrorCode.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",ErrorCode[ErrorCode.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",ErrorCode[ErrorCode.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",ErrorCode[ErrorCode.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",ErrorCode[ErrorCode.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",ErrorCode[ErrorCode.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",ErrorCode[ErrorCode.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",ErrorCode[ErrorCode.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",ErrorCode[ErrorCode.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",ErrorCode[ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",ErrorCode[ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",ErrorCode[ErrorCode.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",ErrorCode[ErrorCode.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",ErrorCode[ErrorCode.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",ErrorCode[ErrorCode.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",ErrorCode[ErrorCode.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",ErrorCode[ErrorCode.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",ErrorCode[ErrorCode.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",ErrorCode[ErrorCode.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",ErrorCode[ErrorCode.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",ErrorCode[ErrorCode.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",ErrorCode[ErrorCode.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",ErrorCode[ErrorCode.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",ErrorCode[ErrorCode.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",ErrorCode[ErrorCode.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",ErrorCode[ErrorCode.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",ErrorCode[ErrorCode.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",ErrorCode[ErrorCode.TRANS_FAILED=28401]="TRANS_FAILED",ErrorCode[ErrorCode.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",ErrorCode[ErrorCode.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",ErrorCode[ErrorCode.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",ErrorCode[ErrorCode.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",ErrorCode[ErrorCode.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",ErrorCode[ErrorCode.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",ErrorCode[ErrorCode.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",ErrorCode[ErrorCode.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",ErrorCode[ErrorCode.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",ErrorCode[ErrorCode.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",ErrorCode[ErrorCode.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",ErrorCode[ErrorCode.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",ErrorCode[ErrorCode.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",ErrorCode[ErrorCode.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",ErrorCode[ErrorCode.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",ErrorCode[ErrorCode.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",ErrorCode[ErrorCode.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",ErrorCode[ErrorCode.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",ErrorCode[ErrorCode.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",ErrorCode[ErrorCode.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",ErrorCode[ErrorCode.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",ErrorCode[ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",ErrorCode[ErrorCode.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",ErrorCode[ErrorCode.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",ErrorCode[ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",ErrorCode[ErrorCode.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",ErrorCode[ErrorCode.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",ErrorCode[ErrorCode.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",ErrorCode[ErrorCode.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",ErrorCode[ErrorCode.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",ErrorCode[ErrorCode.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",ErrorCode[ErrorCode.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",ErrorCode[ErrorCode.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",ErrorCode[ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",ErrorCode[ErrorCode.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",ErrorCode[ErrorCode.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",ErrorCode[ErrorCode.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",ErrorCode[ErrorCode.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",ErrorCode[ErrorCode.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",ErrorCode[ErrorCode.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",ErrorCode[ErrorCode.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",ErrorCode[ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",ErrorCode[ErrorCode.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",ErrorCode[ErrorCode.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",ErrorCode[ErrorCode.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",ErrorCode[ErrorCode.RC_OTP_USED=31027]="RC_OTP_USED",ErrorCode[ErrorCode.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",ErrorCode[ErrorCode.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",ErrorCode[ErrorCode.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",ErrorCode[ErrorCode.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",ErrorCode[ErrorCode.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",ErrorCode[ErrorCode.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",ErrorCode[ErrorCode.RC_TCP_RESET=32054]="RC_TCP_RESET",ErrorCode[ErrorCode.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",ErrorCode[ErrorCode.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",ErrorCode[ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",ErrorCode[ErrorCode.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",ErrorCode[ErrorCode.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",ErrorCode[ErrorCode.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",ErrorCode[ErrorCode.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",ErrorCode[ErrorCode.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",ErrorCode[ErrorCode.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",ErrorCode[ErrorCode.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",ErrorCode[ErrorCode.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",ErrorCode[ErrorCode.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",ErrorCode[ErrorCode.TAG_EXISTS=33101]="TAG_EXISTS",ErrorCode[ErrorCode.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",ErrorCode[ErrorCode.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",ErrorCode[ErrorCode.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",ErrorCode[ErrorCode.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",ErrorCode[ErrorCode.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",ErrorCode[ErrorCode.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",ErrorCode[ErrorCode.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",ErrorCode[ErrorCode.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",ErrorCode[ErrorCode.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",ErrorCode[ErrorCode.UPLOAD_FAIL=34011]="UPLOAD_FAIL",ErrorCode[ErrorCode.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",ErrorCode[ErrorCode.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",ErrorCode[ErrorCode.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",ErrorCode[ErrorCode.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",ErrorCode[ErrorCode.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",ErrorCode[ErrorCode.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",ErrorCode[ErrorCode.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",ErrorCode[ErrorCode.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",ErrorCode[ErrorCode.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",ErrorCode[ErrorCode.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",ErrorCode[ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",ErrorCode[ErrorCode.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",ErrorCode[ErrorCode.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",ErrorCode[ErrorCode.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",ErrorCode[ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",ErrorCode[ErrorCode.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",ErrorCode[ErrorCode.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",ErrorCode[ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",ErrorCode[ErrorCode.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",ErrorCode[ErrorCode.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",ErrorCode[ErrorCode.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",ErrorCode[ErrorCode.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",ErrorCode[ErrorCode.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",ErrorCode[ErrorCode.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",ErrorCode[ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",ErrorCode[ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",ErrorCode[ErrorCode.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",ErrorCode[ErrorCode.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",ErrorCode[ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",ErrorCode[ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",ErrorCode[ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",ErrorCode[ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",ErrorCode[ErrorCode.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",ErrorCode[ErrorCode.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",ErrorCode[ErrorCode.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",ErrorCode[ErrorCode.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",ErrorCode[ErrorCode.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",ErrorCode[ErrorCode.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",ErrorCode[ErrorCode.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",ErrorCode[ErrorCode.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",ErrorCode[ErrorCode.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",ErrorCode[ErrorCode.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",ErrorCode[ErrorCode.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",ErrorCode[ErrorCode.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",ErrorCode[ErrorCode.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",ErrorCode[ErrorCode.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",ErrorCode[ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",ErrorCode[ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",ErrorCode[ErrorCode.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",ErrorCode[ErrorCode.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",ErrorCode[ErrorCode.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",ErrorCode[ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",ErrorCode[ErrorCode.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",ErrorCode[ErrorCode.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",ErrorCode[ErrorCode.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",ErrorCode[ErrorCode.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",ErrorCode[ErrorCode.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",ErrorCode[ErrorCode.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",ErrorCode[ErrorCode.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",ErrorCode[ErrorCode.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",ErrorCode[ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",ErrorCode[ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",ErrorCode[ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",ErrorCode[ErrorCode.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",ErrorCode[ErrorCode.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",ErrorCode[ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",ErrorCode[ErrorCode.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",ErrorCode[ErrorCode.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",ErrorCode[ErrorCode.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",ErrorCode[ErrorCode.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",ErrorCode[ErrorCode.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",ErrorCode[ErrorCode.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",ErrorCode[ErrorCode.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",ErrorCode[ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",ErrorCode[ErrorCode.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",ErrorCode[ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",ErrorCode[ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",ErrorCode[ErrorCode.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",ErrorCode[ErrorCode.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",ErrorCode[ErrorCode.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",ErrorCode[ErrorCode.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",ErrorCode[ErrorCode.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",ErrorCode[ErrorCode.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",ErrorCode[ErrorCode.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",ErrorCode[ErrorCode.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",ErrorCode[ErrorCode.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",ErrorCode[ErrorCode.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",ErrorCode[ErrorCode.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",ErrorCode[ErrorCode.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",ErrorCode[ErrorCode.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",ErrorCode[ErrorCode.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",ErrorCode[ErrorCode.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",ErrorCode[ErrorCode.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",ErrorCode[ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",ErrorCode[ErrorCode.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",ErrorCode[ErrorCode.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",ErrorCode[ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",ErrorCode[ErrorCode.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",ErrorCode[ErrorCode.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",ErrorCode[ErrorCode.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",ErrorCode[ErrorCode.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",ErrorCode[ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",ErrorCode[ErrorCode.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",ErrorCode[ErrorCode.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",ErrorCode[ErrorCode.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",ErrorCode[ErrorCode.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",ErrorCode[ErrorCode.NOT_SUPPORT=35004]="NOT_SUPPORT",ErrorCode[ErrorCode.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",ErrorCode[ErrorCode.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",ErrorCode[ErrorCode.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",ErrorCode[ErrorCode.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",ErrorCode[ErrorCode.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",ErrorCode[ErrorCode.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",ErrorCode[ErrorCode.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",ErrorCode[ErrorCode.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",ErrorCode[ErrorCode.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",ErrorCode[ErrorCode.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",ErrorCode[ErrorCode.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",ErrorCode[ErrorCode.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",ErrorCode[ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",ErrorCode[ErrorCode.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",ErrorCode[ErrorCode.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",ErrorCode[ErrorCode.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",ErrorCode[ErrorCode.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",ErrorCode[ErrorCode.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",ErrorCode[ErrorCode.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",ErrorCode[ErrorCode.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",ErrorCode[ErrorCode.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",ErrorCode[ErrorCode.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",ErrorCode[ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",ErrorCode[ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",ErrorCode[ErrorCode.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",ErrorCode[ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",ErrorCode[ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",ErrorCode[ErrorCode.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",ErrorCode[ErrorCode.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",ErrorCode[ErrorCode.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",ErrorCode[ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",ErrorCode[ErrorCode.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",ErrorCode[ErrorCode.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",ErrorCode[ErrorCode.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",ErrorCode[ErrorCode.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",ErrorCode[ErrorCode.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",ErrorCode[ErrorCode.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",ErrorCode[ErrorCode.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",ErrorCode[ErrorCode.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",ErrorCode[ErrorCode.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",ErrorCode[ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",ErrorCode[ErrorCode.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",ErrorCode[ErrorCode.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",ErrorCode[ErrorCode.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",ErrorCode[ErrorCode.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",ErrorCode[ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",ErrorCode[ErrorCode.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",ErrorCode[ErrorCode.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",ErrorCode[ErrorCode.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",ErrorCode[ErrorCode.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",ErrorCode[ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",ErrorCode[ErrorCode.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",ErrorCode[ErrorCode.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",ErrorCode[ErrorCode.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",ErrorCode[ErrorCode.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",ErrorCode[ErrorCode.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",ErrorCode[ErrorCode.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",ErrorCode[ErrorCode.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",ErrorCode[ErrorCode.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",ErrorCode[ErrorCode.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",ErrorCode[ErrorCode.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",ErrorCode[ErrorCode.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",ErrorCode[ErrorCode.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",ErrorCode[ErrorCode.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",ErrorCode[ErrorCode.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",ErrorCode[ErrorCode.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",ErrorCode[ErrorCode.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",ErrorCode[ErrorCode.TIMEOUT=-1]="TIMEOUT",exports.ConversationType=void 0,ConversationType=exports.ConversationType||(exports.ConversationType={}),ConversationType[ConversationType.NONE=0]="NONE",ConversationType[ConversationType.PRIVATE=1]="PRIVATE",ConversationType[ConversationType.DISCUSSION=2]="DISCUSSION",ConversationType[ConversationType.GROUP=3]="GROUP",ConversationType[ConversationType.CHATROOM=4]="CHATROOM",ConversationType[ConversationType.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",ConversationType[ConversationType.SYSTEM=6]="SYSTEM",ConversationType[ConversationType.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",ConversationType[ConversationType.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",ConversationType[ConversationType.ULTRA_GROUP=10]="ULTRA_GROUP",ConversationType[ConversationType.RTC_ROOM=12]="RTC_ROOM";var ConversationTypes={BASE:0,SG:1,INCLUDE_UG:2,INCLUDE_UG_CHATROOM:3,ANY:4,SG_UG:5,ONLY_GROUP:6,PRIVATE_ONLY:7},getConversationTypes=function(e){var t=[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE];switch(e){case ConversationTypes.BASE:return t;case ConversationTypes.SG:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP];case ConversationTypes.INCLUDE_UG:return __spreadArray(__spreadArray([],__read(t),!1),[exports.ConversationType.ULTRA_GROUP],!1);case ConversationTypes.INCLUDE_UG_CHATROOM:return __spreadArray(__spreadArray([],__read(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM],!1);case ConversationTypes.ANY:return __spreadArray(__spreadArray([],__read(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.CUSTOMER_SERVICE,exports.ConversationType.DISCUSSION],!1);case ConversationTypes.SG_UG:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP];case ConversationTypes.ONLY_GROUP:return[exports.ConversationType.GROUP];case ConversationTypes.PRIVATE_ONLY:return[exports.ConversationType.PRIVATE]}},isInConversationTypeList=function(e,t){return getConversationTypes(t).includes(e)},EConnectProtocol,FileType,MentionedType;!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"}(EConnectProtocol||(EConnectProtocol={})),exports.FileType=void 0,FileType=exports.FileType||(exports.FileType={}),FileType[FileType.IMAGE=1]="IMAGE",FileType[FileType.AUDIO=2]="AUDIO",FileType[FileType.VIDEO=3]="VIDEO",FileType[FileType.FILE=4]="FILE",FileType[FileType.SIGHT=5]="SIGHT",FileType[FileType.COMBINE_HTML=6]="COMBINE_HTML",exports.MentionedType=void 0,MentionedType=exports.MentionedType||(exports.MentionedType={}),MentionedType[MentionedType.ALL=1]="ALL",MentionedType[MentionedType.SINGAL=2]="SINGAL";var MessageType={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"},UltraGroupChannelType,UltraGroupChannelChangeType,UltraMsgChangeType,UltraMsgSubChangeType,UserGroupChangeType,UltraMentionedType,SentStatus,OperateStatus,OnlineStatus,Platform,SubscribeType,SubscribeOperationType,UserProfileVisibility,RCConnectionStatus,MessageBlockType,MessageBlockSourceType,MessageDirection,PushImportanceHonor,StatisticsTag,NotificationLevel,NotificationStatus;exports.UltraGroupChannelType=void 0,UltraGroupChannelType=exports.UltraGroupChannelType||(exports.UltraGroupChannelType={}),UltraGroupChannelType[UltraGroupChannelType.PUBLIC=0]="PUBLIC",UltraGroupChannelType[UltraGroupChannelType.PRIVATE=1]="PRIVATE",exports.UltraGroupChannelChangeType=void 0,UltraGroupChannelChangeType=exports.UltraGroupChannelChangeType||(exports.UltraGroupChannelChangeType={}),UltraGroupChannelChangeType[UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",UltraGroupChannelChangeType[UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",UltraGroupChannelChangeType[UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN",function(e){e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY",e[e.MSG_RECALL=3]="MSG_RECALL",e[e.CHANNEL_CHANGE=4]="CHANNEL_CHANGE",e[e.USER_GROUP_CHANGE=5]="USER_GROUP_CHANGE",e[e.UG_DEL=6]="UG_DEL"}(UltraMsgChangeType||(UltraMsgChangeType={})),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"}(UltraMsgSubChangeType||(UltraMsgSubChangeType={})),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"}(UserGroupChangeType||(UserGroupChangeType={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(UltraMentionedType||(UltraMentionedType={})),exports.SentStatus=void 0,SentStatus=exports.SentStatus||(exports.SentStatus={}),SentStatus[SentStatus.SENDING=10]="SENDING",SentStatus[SentStatus.FAILED=20]="FAILED",SentStatus[SentStatus.SENT=30]="SENT",SentStatus[SentStatus.RECEIVED=40]="RECEIVED",SentStatus[SentStatus.READ=50]="READ",SentStatus[SentStatus.DESTROYED=60]="DESTROYED",exports.OperateStatus=void 0,OperateStatus=exports.OperateStatus||(exports.OperateStatus={}),OperateStatus[OperateStatus.typing=0]="typing",exports.OnlineStatus=void 0,OnlineStatus=exports.OnlineStatus||(exports.OnlineStatus={}),OnlineStatus[OnlineStatus.ONLINE=1]="ONLINE",OnlineStatus[OnlineStatus.OFFLINE=0]="OFFLINE",exports.Platform=void 0,Platform=exports.Platform||(exports.Platform={}),Platform[Platform.Other=0]="Other",Platform[Platform.iOS=1]="iOS",Platform[Platform.Android=2]="Android",Platform[Platform.Web=3]="Web",Platform[Platform.PC=4]="PC",Platform[Platform.Mini=5]="Mini",Platform[Platform.HarmonyOS=6]="HarmonyOS",exports.SubscribeType=void 0,SubscribeType=exports.SubscribeType||(exports.SubscribeType={}),SubscribeType[SubscribeType.ONLINE_STATUS=1]="ONLINE_STATUS",SubscribeType[SubscribeType.USER_PROFILE=2]="USER_PROFILE",SubscribeType[SubscribeType.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",SubscribeType[SubscribeType.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE",exports.SubscribeOperationType=void 0,SubscribeOperationType=exports.SubscribeOperationType||(exports.SubscribeOperationType={}),SubscribeOperationType[SubscribeOperationType.SUBSCRIBE=0]="SUBSCRIBE",SubscribeOperationType[SubscribeOperationType.UNSUBSCRIBE=1]="UNSUBSCRIBE",exports.UserProfileVisibility=void 0,UserProfileVisibility=exports.UserProfileVisibility||(exports.UserProfileVisibility={}),UserProfileVisibility[UserProfileVisibility.NOT_SET=0]="NOT_SET",UserProfileVisibility[UserProfileVisibility.INVISIBLE=1]="INVISIBLE",UserProfileVisibility[UserProfileVisibility.EVERYONE=2]="EVERYONE",UserProfileVisibility[UserProfileVisibility.FriendVisible=3]="FriendVisible",exports.RCConnectionStatus=void 0,RCConnectionStatus=exports.RCConnectionStatus||(exports.RCConnectionStatus={}),RCConnectionStatus[RCConnectionStatus.CONNECTED=0]="CONNECTED",RCConnectionStatus[RCConnectionStatus.CONNECTING=1]="CONNECTING",RCConnectionStatus[RCConnectionStatus.DISCONNECTED=2]="DISCONNECTED",RCConnectionStatus[RCConnectionStatus.SUSPENDED=3]="SUSPENDED",exports.MessageBlockType=void 0,MessageBlockType=exports.MessageBlockType||(exports.MessageBlockType={}),MessageBlockType[MessageBlockType.GLOBAL=1]="GLOBAL",MessageBlockType[MessageBlockType.CUSTOM=2]="CUSTOM",MessageBlockType[MessageBlockType.THIRD_PARTY=3]="THIRD_PARTY",exports.MessageBlockSourceType=void 0,MessageBlockSourceType=exports.MessageBlockSourceType||(exports.MessageBlockSourceType={}),MessageBlockSourceType[MessageBlockSourceType.MSG_ORIGINAL=0]="MSG_ORIGINAL",MessageBlockSourceType[MessageBlockSourceType.MSG_EXPANSION=1]="MSG_EXPANSION",MessageBlockSourceType[MessageBlockSourceType.MSG_MODIFY=2]="MSG_MODIFY",exports.MessageDirection=void 0,MessageDirection=exports.MessageDirection||(exports.MessageDirection={}),MessageDirection[MessageDirection.SEND=1]="SEND",MessageDirection[MessageDirection.RECEIVE=2]="RECEIVE",exports.PushImportanceHonor=void 0,PushImportanceHonor=exports.PushImportanceHonor||(exports.PushImportanceHonor={}),PushImportanceHonor.NORMAL="NORMAL",PushImportanceHonor.LOW="LOW",function(e){e.IM_NAVI="IM-stats_navi-S",e.IM_WEBSOCKET="IM-stats_websocket-S",e.IM_CONNECTION_DURATION="IM-stats_con_dur-S",e.IM_CMP="IM-stats_cmp-S",e.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",e.IM_STATS_CS="IM-stats_cs-S",e.IM_NETWORK_CHANGE="IM-stats_network_change-S",e.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",e.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",e.IM_MSG_SEND="IM-msg_send-S",e.IM_MSG_RECEIVE="IM-msg_receive-S"}(StatisticsTag||(StatisticsTag={})),exports.NotificationLevel=void 0,NotificationLevel=exports.NotificationLevel||(exports.NotificationLevel={}),NotificationLevel[NotificationLevel.ALL_MESSAGE=-1]="ALL_MESSAGE",NotificationLevel[NotificationLevel.NOT_SET=0]="NOT_SET",NotificationLevel[NotificationLevel.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",NotificationLevel[NotificationLevel.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",NotificationLevel[NotificationLevel.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",NotificationLevel[NotificationLevel.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION",exports.NotificationStatus=void 0,NotificationStatus=exports.NotificationStatus||(exports.NotificationStatus={}),NotificationStatus[NotificationStatus.OPEN=1]="OPEN",NotificationStatus[NotificationStatus.CLOSE=2]="CLOSE";var trans2NotificationLevel=function(e){return e===exports.NotificationStatus.OPEN?exports.NotificationLevel.AT_MESSAGE_NOTIFICATION:exports.NotificationLevel.NOT_SET},trans2NotificationStatus=function(e){return e<=exports.NotificationLevel.NOT_SET?exports.NotificationStatus.CLOSE:exports.NotificationStatus.OPEN},ReceivedStatus,EnterpriseType,ProtocalType,NaviCacheType,StatisticsVersion,ConnectType,ConnectReason,InterruptionLevel,PushNotificationQuietHoursLevel;exports.ReceivedStatus=void 0,ReceivedStatus=exports.ReceivedStatus||(exports.ReceivedStatus={}),ReceivedStatus[ReceivedStatus.READ=1]="READ",ReceivedStatus[ReceivedStatus.LISTENED=2]="LISTENED",ReceivedStatus[ReceivedStatus.DOWNLOADED=4]="DOWNLOADED",ReceivedStatus[ReceivedStatus.RETRIEVED=8]="RETRIEVED",ReceivedStatus[ReceivedStatus.UNREAD=0]="UNREAD",function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(EnterpriseType||(EnterpriseType={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(ProtocalType||(ProtocalType={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(NaviCacheType||(NaviCacheType={})),function(e){e[e.CURRENT=2]="CURRENT"}(StatisticsVersion||(StatisticsVersion={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(ConnectType||(ConnectType={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(ConnectReason||(ConnectReason={})),exports.InterruptionLevel=void 0,InterruptionLevel=exports.InterruptionLevel||(exports.InterruptionLevel={}),InterruptionLevel.PASSIVE="passive",InterruptionLevel.ACTIVE="active",InterruptionLevel.TIME_SENSITIVE="time-sensitive",InterruptionLevel.CRITICAL="critical",exports.PushNotificationQuietHoursLevel=void 0,PushNotificationQuietHoursLevel=exports.PushNotificationQuietHoursLevel||(exports.PushNotificationQuietHoursLevel={}),PushNotificationQuietHoursLevel[PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",PushNotificationQuietHoursLevel[PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",PushNotificationQuietHoursLevel[PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED";var MessageAuditType={DISALLOW:0,ALLOW:1},SpeechToTextStatus={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},UserType={NORMAL:0,ROBOT:1},GroupReadReceiptVersion={UNKNOWN:-1,V1:0,V2:1,V4:3,V5:4},trans2GroupReadReceiptVersion=function(e){return e=e||0,Object.values(GroupReadReceiptVersion).includes(e)?e:GroupReadReceiptVersion.UNKNOWN},NetworkType,HttpMethod;!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"}(NetworkType||(NetworkType={})),exports.HttpMethod=void 0,HttpMethod=exports.HttpMethod||(exports.HttpMethod={}),HttpMethod.GET="GET",HttpMethod.POST="POST",HttpMethod.PUT="PUT";var NAVI_CACHE_DURATION=72e5,HTTP_TIMEOUT=6e4,NAVI_REQ_TIMEOUT=1e4,MAX_MESSAGE_CONTENT_BYTES=131072,MAX_MESSAGE_EXPANSION_KEY_LENGTH=32,MAX_MESSAGE_EXPANSION_VAL_LENGTH=4096,STATIC_CONFIG_KEY="cd4936151214ce45dc1d12673a59d94c",STATIC_CONFIG_IV="51ad078e5eb17a91",VERSION="5.32.0-c-rtc-alpha.1",FORMATED_VERSION=VERSION.replace(/-.+$/,""),MAX_UPLOAD_FILE_SIZE=5368709120,UPLOAD_FILE_CHUNK_SIZE=10485760,STATIC_CONFIG_CACHE_TIME=18e5,RC_DEFAULT_USER="rongcloudsystem",READ_RECEIPT_CATCH_TIME=864e5,SUBSCRIBE_USER_PROFILE_VALID_TIME=6048e5,NON_SUBSCRIBE_USER_PROFILE_VALID_TIME=6e5,LOCAL_STORAGE_KEYS={NAVI_KEY:function(e){return"navi_".concat(e)},CONVER_SETTINGS_VER_KEY:function(e,t){return"RC-con-s-ver-".concat(e,"-").concat(t)},OLD_CONVER_STATE_KEY:function(e,t){return"RCV4-con-".concat(e,"-").concat(t)},CONVER_STATE_KEY:function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},ULTRA_GROUP_STATE_KEY:function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},CONVER_TYPE_SETTINGS_KEY:function(e,t){return"RC-con-type-settings-".concat(e,"-").concat(t)},OUTBOX_TIME_KEY:function(e,t){return"outbox_".concat(e,"_").concat(t)},INBOX_TIME_KEY:function(e,t){return"inbox_".concat(e,"_").concat(t)},BROADCASTBOX_TIME_KEY:function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},SEND_MSG_KEY:function(e,t){return"send_msg_".concat(e,"_").concat(t)},USER_SETTING_KEY:function(e,t){return"RC-us-".concat(e,"-").concat(t)},STATIC_CONFIG_KEY:function(e){return"rc-static-config-".concat(e)},CLOUD_CONTROL_KEY:function(e){return"RC-cc-".concat(e)},READ_RECEIPT_KEY:function(e,t){return"RC-RR-".concat(e,"-").concat(t)},LOG_INFO_KEY:function(e){return"RC-LI-".concat(e)}},MAX_U32_INTEGER=Math.pow(2,31)-1,versionInfo="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};versionInfo.engine="5.32.0-c-rtc-alpha.1";var VersionManage=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)&&(versionInfo[e]=t)}}),Object.defineProperty(e,"validEngine",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var r=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return versionInfo.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=r}}),Object.defineProperty(e,"getInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return versionInfo}}),e}();function random(e){return Array.from({length:e}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")}var UUId={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=Date.now(),r=t.toString(36),n=Math.floor(Math.random()*t).toString(36),i=e-r.length-n.length;return[n,r,i>0?random(i):""].join("").slice(0,e)}},SESSION_ID=UUId.genWithLen(22),SESSION_CREATE_TIME=Date.now(),isString=function(e){return"string"==typeof e},isBoolean=function(e){return"boolean"==typeof e},isNumber=function(e){return"number"==typeof e&&!Number.isNaN(e)},isInteger=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},isArray=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},isLimitedString=function(e){return function(t){return isString(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))}},notEmptyString=function(e){return isString(e)&&e.length>0},notEmptyArray=function(e){return isArray(e)&&e.length>0},isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},isFunction=function(e){return"function"==typeof e},isUndefined=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},isHttpUrl=function(e){return isString(e)&&/https?:\/\//.test(e)},notEmptyObject=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},isValidConversationType=function(e){return isNumber(e)&&Object.prototype.hasOwnProperty.call(exports.ConversationType,e)},isValidNotificationLevel=function(e){return isNumber(e)&&Object.prototype.hasOwnProperty.call(exports.NotificationLevel,e)},isValidChannelId=function(e){var t=!1;return isString(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},isValidEnum=function(e){return Object.values(e.type).includes(e.value)},isValidTargetId=function(e){return isLimitedString({minLength:1,maxLength:64})(e)},isValidGroupId=function(e){return isLimitedString({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},isValidFileType=function(e){return isNumber(e)&&Object.prototype.hasOwnProperty.call(exports.FileType,e)},usingCppEngine=function(){return"undefined"!=typeof RCCppEngine},trans2IReceivedStatusInfo=function(e){return{isRead:(e&exports.ReceivedStatus.READ)===exports.ReceivedStatus.READ,isListened:(e&exports.ReceivedStatus.LISTENED)===exports.ReceivedStatus.LISTENED,isDownload:(e&exports.ReceivedStatus.DOWNLOADED)===exports.ReceivedStatus.DOWNLOADED,isRetrieved:(e&exports.ReceivedStatus.RETRIEVED)===exports.ReceivedStatus.RETRIEVED}},transformReceivedStatusFlag=function(e){var t=exports.ReceivedStatus.UNREAD;return(null==e?void 0:e.isRead)&&(t|=exports.ReceivedStatus.READ),(null==e?void 0:e.isListened)&&(t|=exports.ReceivedStatus.LISTENED),(null==e?void 0:e.isDownload)&&(t|=exports.ReceivedStatus.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=exports.ReceivedStatus.RETRIEVED),t},completeSubscriptionPlatformStatus=function(e){return[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.HarmonyOS].map((function(t){var r=e.findIndex((function(e){return e.platform===t}));return-1===r?{platform:t,changeTime:0,eventValue:0}:e[r]}))},addFullPlatfromStatus=function(e){return[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.HarmonyOS].forEach((function(t){e.details.some((function(e){return e.platform===t}))||e.details.push({platform:t,isOnline:!1,updateTime:0})})),e},transformUserProfiles=function(e,t,r){var n=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return n.userId=e,r.forEach((function(e){n.extraProfile=n.extraProfile||{},n.extraProfile[e.key]=e.value})),n},getProtocol=function(e,t,r){return t?1===r?EConnectProtocol.TLS:EConnectProtocol.RMTP:"http"===e?EConnectProtocol.WS:EConnectProtocol.WSS},formatCmpList=function(e,t){var r=e.server,n=e.backupServer,i=e.bs,o=e.serverAddr,a=e.protocol,s=e.openTLS;if(o)return __spreadArray([],__read(o.filter((function(e){return e.addr}))),!1);var u=[],l=[];return r&&l.push(r),(n||i||"").split(",").forEach((function(e){l.indexOf(e)<0&&l.push(e)})),l.forEach((function(e,n){e&&u.push({addr:e,protocol:getProtocol(a,t,s),weight:r.length-n,race:!1})})),__spreadArray([],__read(u),!1)},isSupportDirectMessage=function(e){return[exports.ConversationType.GROUP,exports.ConversationType.DISCUSSION,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE].includes(e)},formatGetGroupsInfo=function(e){return void 0===e&&(e=[]),e.map((function(e){var t,r,n,i,o,a,s,u,l,c=transforServerProfileInfo(e.settingProfile)||{},_=e.extProfile||[],d=e.targetId,p=e.baseInfo,g=e.userInfo;return{groupId:d,groupName:null!==(t=c.name)&&void 0!==t?t:"",portraitUri:null!==(r=c.portraitUrl)&&void 0!==r?r:"",introduction:null!==(n=c.introduction)&&void 0!==n?n:"",notice:null!==(i=c.announcement)&&void 0!==i?i:"",extProfile:transforServerProfileInfo(_),joinPermission:~~c.joinPerm,removeMemberPermission:~~c.removePerm,invitePermission:~~c.memInvitePerm,inviteHandlePermission:~~c.invitePerm,groupInfoEditPermission:~~c.profilePerm,memberInfoEditPermission:~~c.memProfilePerm,creatorId:null!==(o=null==p?void 0:p.creatorId)&&void 0!==o?o:"",ownerId:null!==(a=null==p?void 0:p.ownerId)&&void 0!==a?a:"",createTime:(null==p?void 0:p.createTime)||0,membersCount:null!==(s=null==p?void 0:p.memberCount)&&void 0!==s?s:0,remark:null!==(u=null==g?void 0:g.remarkName)&&void 0!==u?u:"",joinedTime:(null==g?void 0:g.joinTime)||0,role:null!==(l=null==g?void 0:g.role)&&void 0!==l?l:exports.GroupMemberRole.UNDEF}}))},formatGroupsInfo=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=transforServerProfileInfo(e.settingProfile),r=e.extProfile||[],n=e.targetId,i=e.baseInfo,o=e.userInfo;return JSON.parse(JSON.stringify(__assign(__assign({groupId:n},formatGroupBaseInfo(t)),{extProfile:r.length>0?transforServerProfileInfo(r):void 0,creatorId:null==i?void 0:i.creatorId,ownerId:null==i?void 0:i.ownerId,createTime:null==i?void 0:i.createTime,membersCount:null==i?void 0:i.memberCount,remark:null==o?void 0:o.remarkName})))}))},undefinedOrNumber=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},formatGroupBaseInfo=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:undefinedOrNumber(e.joinPerm),removeMemberPermission:undefinedOrNumber(e.removePerm),invitePermission:undefinedOrNumber(e.memInvitePerm),inviteHandlePermission:undefinedOrNumber(e.invitePerm),groupInfoEditPermission:undefinedOrNumber(e.profilePerm),memberInfoEditPermission:undefinedOrNumber(e.memProfilePerm)}))},formatGroupMembers=function(e){return void 0===e&&(e=[]),e.map(trans2IGroupMemberInfo)},transforServerProfileInfo=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},trans2IGroupMemberInfo=function(e){var t=e.userId,r=e.name,n=e.portraitUrl,i=e.ext||{},o=i.role,a=i.joinTime;return{userId:t,name:r||"",portraitUri:n||"",nickname:i.channelNickName,extra:i.additional,role:o||exports.GroupMemberRole.UNDEF,joinedTime:a}},trans2IGroupApplicationInfo=function(e){var t=e.joinUserInfo,r=e.inviterInfo,n=e.processInfo;return{groupId:e.targetId,joinMemberInfo:trans2IGroupMemberInfo(t),inviterInfo:r&&r.userId?trans2IGroupMemberInfo(r):void 0,operatorInfo:n&&n.userId?trans2IGroupMemberInfo(n):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},arrayToKeyValue=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},appendUrl=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var r=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return r.length?[e,r.join("&")].join("?"):e};function string2Buffer(e){for(var t=null===window||void 0===window?void 0:window.atob(e),r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r.buffer}var formatDate=function(e){e=e||"-";var t=new Date,r=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();return"".concat(r).concat(e).concat(n).concat(e).concat(i)},getUploadFileName=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=UUId.gen(),i=formatDate(),o=(new Date).getTime(),a="";if(t){var s=t.split(".");a=".".concat(s[s.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(r,"_").concat(o).concat(n).concat(a)},_handeleApnsAndFcm=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.threadId,n=e.apnsCollapseId,i=e.category,o=e.richMediaUri,a=e.interruptionLevel,s=t.googleConfig,u={};u["thread-id"]=r||"",u["apns-collapse-id"]=n||"",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}},pushConfigsToJSON=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,a=t.typeVivo,s=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,_=t.importanceHonor,d=t.imageUrlHonor,p=_handeleApnsAndFcm(e,t),g=[{HW:{channelId:i||"",importance:s||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:a||"",category:c||""}},{APNS:p.APNS},{FCM:p.FCM},{HONOR:{importance:_||exports.PushImportanceHonor.NORMAL,image:d||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(g)},parseConfigFlag=function(e){return{isVoipPush:!!(1&e),isFilerWhiteBlacklist:!!(2&e),disablePushTitle:!!(4&e),forceShowDetailContent:!!(8&e)}},trans2IPushConfig=function(e,t,r){void 0===e&&(e=0);var n=parseConfigFlag(e),i=n.disablePushTitle,o=n.forceShowDetailContent,a=parsePBPushExtraConfigs(null==r?void 0:r.pushConfigs,null==r?void 0:r.pushId);return __assign({pushTitle:(null==r?void 0:r.title)||"",pushContent:t||"",pushData:"",disablePushTitle:i,forceShowDetailContent:o,templateId:null==r?void 0:r.templateId},a)},parsePBPushExtraConfigs=function(e,t){var r={},n={notificationId:t||""},i={};if(!e)return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,a,s,u,l,c,_,d,p,g,f,h=Object.keys(e);if(0!==h.length){var E=h[0];switch(E){case"HW":return n.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,n.importanceHW=null===(o=e[E])||void 0===o?void 0:o.importance,n.imageUrlHW=null===(a=e[E])||void 0===a?void 0:a.image,void(n.categoryHW=null===(s=e[E])||void 0===s?void 0:s.category);case"MI":return void(n.channelIdMi=null===(u=e[E])||void 0===u?void 0:u.channelId);case"OPPO":return void(n.channelIdOPPO=null===(l=e[E])||void 0===l?void 0:l.channelId);case"VIVO":return n.typeVivo=null===(c=e[E])||void 0===c?void 0:c.classification,void(n.categoryVivo=null===(_=e[E])||void 0===_?void 0:_.category);case"APNS":return r.threadId=e[E]["thread-id"],r.apnsCollapseId=e[E]["apns-collapse-id"],r.category=e[E].category,r.richMediaUri=e[E].richMediaUri,void(r.interruptionLevel=e[E]["interruption-level"]);case"FCM":return void(n.googleConfig={collapseKey:e[E].collapse_key||"",imageUrl:e[E].imageUrl||"",priority:e[E].priority||""});case"HONOR":return n.importanceHonor=null===(d=e[E])||void 0===d?void 0:d.importance,void(n.imageUrlHonor=null===(p=e[E])||void 0===p?void 0:p.image);case"OHOS":i.category=null===(g=e[E])||void 0===g?void 0:g.category,i.image=null===(f=e[E])||void 0===f?void 0:f.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}},isValidChrmEntryKey=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),r=e.length;return t&&(r<=128&&r>=1)},isValidChrmEntryValue=function(e){var t=e.length;return t<=4096&&t>=1},getClientMessageId=(offset=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),r=e+offset.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return offset=2047&++offset,parseInt(r,2)}),offset,getbundleId=function(){var e=VersionManage.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t},decryptCBC=function(e,t,r){return __awaiter(void 0,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){switch(o.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return n=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(r)},n,string2Buffer(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function fixUrlProtocol(e,t){var r;if(!e)return"";var n="undefined"!=typeof window&&"https:"===(null===(r=null===window||void 0===window?void 0:window.location)||void 0===r?void 0:r.protocol);return/^https?:\/\//.test(e)?n?e.replace(/^https?:\/\//i,"https://"):e:t!==EConnectProtocol.HTTP||n?"https://".concat(e):"http://".concat(e)}function getMessageUIdHash(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t|=0}return Math.abs(t)}var getMinionURL=function(e,t){if(!e)return"";var r=e.ossConfig,n=void 0===r?"":r,i="";try{var o=JSON.parse(n);if(o.length>0){var a=o.find((function(e){return e.minio}));a&&(i=a.minio)}}catch(e){t.warn(Log.L_PARSE_JSON_E,JSON.stringify({ossConfig:n,error:e}))}return i};function parseChrmMemChangeMessage(e){var t={},r=[],n=e.content.memberCount||0;return Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,r.push({userId:e.userId,action:e.status,extra:e.extra})})),{users:t,chatroomId:e.targetId,memberCount:n,userList:r}}function parseChrmSyncMsg(e){var t=e.content;return{chatroomId:t.chatroomId,status:t.status,reason:t.reason,time:t.time,extra:t.extra||""}}function parseChrmBlockMsg(e){var t=e.content;return{chatroomId:t.chatroomId,operateType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}function parseChrmBanMsg(e){var t=e.content;return{chatroomId:t.chatroomId,banType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}var RCError=function(e){function t(t){var r=e.call(this,t)||this;return r.name="RCError",r}return __extends(t,e),Object.defineProperty(t,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new t("Invalid parameter -> ".concat(e)):new t("Invalid parameters.")}}),Object.defineProperty(t,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new t("Wrong parameter type")}}),t}(Error),_EventTransmitter_stopPropagation,EventTransmitter=function(){function e(){_EventTransmitter_stopPropagation.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){__classPrivateFieldSet(this,_EventTransmitter_stopPropagation,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return __classPrivateFieldGet(this,_EventTransmitter_stopPropagation,"f")},enumerable:!1,configurable:!0}),e}();_EventTransmitter_stopPropagation=new WeakMap;var EventDispatcher=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_piped",{enumerable:!0,configurable:!0,writable:!0,value:new Set})}return Object.defineProperty(e.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===i&&(i=0);var o=Symbol(),a=this._map.get(e)||this._map.set(e,[]).get(e),s={symbol:o,priority:Math.min(i,100),listener:t.bind(n),once:r},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,r,n){return void 0===n&&(n=0),this._addItem(e,t,!1,r,n)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!0,r,n)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;try{for(var n=__values(this._map),i=n.next();!i.done;i=n.next()){var o=__read(i.value,2),a=(o[0],o[1]),s=a.findIndex((function(t){return t.symbol===e}));if(-1!==s)return void a.splice(s,1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map.get(e);if(n&&n.length>0)for(var i=new EventTransmitter,o=0;o<n.length;o+=1){var a=n[o],s=a.once,u=a.listener;s&&n.splice(o,1);try{u.apply(void 0,__spreadArray([i],__read(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}__spreadArray([],__read(this._piped.values()),!1).forEach((function(r){return r.emit.apply(r,__spreadArray([e],__read(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}(),LinearQuery=function(e){function t(t){var r=e.call(this)||this;return Object.defineProperty(r,"_name",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(r,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(r,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r}return __extends(t,e),Object.defineProperty(t.prototype,"length",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setInitVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return-1!==this._dataVersion||(this._dataVersion=e,t&&this._execPulling()),[2]}))}))}}),Object.defineProperty(t.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(t.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,i,o;return __generator(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,r=e.data,this._pullingPromise=null,!t)return[2];if(void 0===(null==r?void 0:r.version)||r.version<this._dataVersion)throw new Error("".concat(this._name,": version error, please check: lastVersion: ").concat(this._dataVersion,", newVersion: ").concat(null==r?void 0:r.version));return n=r.version,i=r.hasNext,o=this._versionQueue.filter((function(e){return e>n})),this._versionQueue=__spreadArray([],__read(o),!1),this._dataVersion=n,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[2,this._execPulling()]):[2]}}))}))}}),Object.defineProperty(t.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((function(){return r._execPulling()}),e))}}),Object.defineProperty(t.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(t.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}),t}(EventDispatcher),SuspendablePromise=function(){function e(e,t){var r=this;Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onCancel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(t){r._resolve=t,e(r._onResolve.bind(r))})),this._onCancel=t}return Object.defineProperty(e.prototype,"_onResolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),Object.defineProperty(e.prototype,"abort",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._onCancel(this._onResolve.bind(this))}}),e}(),RCResult=function(){function e(e,t,r){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=r}return Object.defineProperty(e,"from",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return new e(t,r||"fail: ".concat(t),n)}}),Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(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 __awaiter(this,void 0,void 0,(function(){return __generator(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?ok(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?ok(void 0,this.msg):fail(this.code,this.msg)}}),e}(),ok=function(e,t){return new RCResult(0,t||"success",e)},fail=function(e,t,r){return new RCResult(e,t||"fail: ".concat(e),r)},Validator=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,r){return void 0===r&&(r=!1),this.isFailed&&(0===this._code||r)&&(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?fail(this._code,this._errmsg):ok()}}),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,r,n){if(void 0===n&&(n=!1),this.isFailed)return this;var i=n?r(t):null==t||r(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,r,n){if(void 0===n&&(n=!1),this.isFailed)return this;if(this.validate(e,t,r,n),this.isFailed)throw RCError.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"isHttpUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isNotEmptyString(e,t,r).validate(e,t,(function(e){return/^https?:\/\//.test(e)}))}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isString(e,t,r).validate(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assertString(e,t,r),this.assert(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isLimitedInteger(e,t,0,0xe677d21fdbff,r)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.isArray(e,t,n).validate(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isArray(e,t,n).validate(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,r,i,o).validate(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,r,i,o),this.assert(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"isValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.validate(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"function"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"function"==typeof e}),r)}}),e}(),chars$1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function base64Decode(e){var t,r,n,i,o,a,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=chars$1.indexOf(e.charAt(u++))<<2|(i=chars$1.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=chars$1.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(a=chars$1.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==o&&(s+=String.fromCharCode(r)),64!==a&&(s+=String.fromCharCode(n));return s}var promiseWithResolvers=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},MD5_A=1732584193,MD5_B=4023233417,MD5_C=2562383102,MD5_D=271733878,S=[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],K=[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],TagChangeType;function leftRotate(e,t){return e<<t|e>>>32-t}function F(e,t,r){return e&t|~e&r}function G(e,t,r){return e&r|t&~r}function H(e,t,r){return e^t^r}function I(e,t,r){return t^(e|~r)}function stringToBytes$1(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)}function bytesToWords(e){for(var t=[],r=0;r<e.length;r+=4)t.push((e[r]||0)|(e[r+1]||0)<<8|(e[r+2]||0)<<16|(e[r+3]||0)<<24);return t}function numberToBytes(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 bytesToHex(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}function md5Core(e){var t=8*e.length,r=e.length%64<56?56-e.length%64:120-e.length%64,n=new Uint8Array(e.length+r+8);n.set(e),n[e.length]=128;for(var i=1;i<r;i++)n[e.length+i]=0;var o=new Uint8Array(8),a=4294967295&t,s=4294967295&Math.floor(t/4294967296);o.set(numberToBytes(a),0),o.set(numberToBytes(s),4),n.set(o,e.length+r);var u=MD5_A,l=MD5_B,c=MD5_C,_=MD5_D;for(i=0;i<n.length;i+=64){for(var d=bytesToWords(n.slice(i,i+64)),p=u,g=l,f=c,h=_,E=0;E<64;E++){var T=void 0,b=void 0;E<16?(T=F(l,c,_),b=E):E<32?(T=G(l,c,_),b=(5*E+1)%16):E<48?(T=H(l,c,_),b=(3*E+5)%16):(T=I(l,c,_),b=7*E%16);var v=_;_=c,c=l,l+=leftRotate(u+T+K[E]+d[b]&4294967295,S[E]),u=v}u=u+p&4294967295,l=l+g&4294967295,c=c+f&4294967295,_=_+h&4294967295}var R=new Uint8Array(16);return R.set(numberToBytes(u),0),R.set(numberToBytes(l),4),R.set(numberToBytes(c),8),R.set(numberToBytes(_),12),bytesToHex(R)}function md5(e){return md5Core(stringToBytes$1(e))}function sendXMLHttpRequest(e,t,r,n){return new SuspendablePromise((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},n&&(e.upload.onprogress=function(e){return n(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(r)}),(function(t){e.abort(),t({status:-1})}))}function httpRequest(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||HTTP_TIMEOUT,n=e.headers,i=e.query,o=e.body,a=e.onProgress,s=appendUrl(e.url,i),u=new XMLHttpRequest;if(u.open(t,s),n&&u.setRequestHeader)for(var l in n)u.setRequestHeader(l,n[l]);return sendXMLHttpRequest(u,r,o,a)}function isStartCloudController(){return!0}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(TagChangeType||(TagChangeType={}));var MessageModifyStatus={SUCCESS:0,UPDATING:1,FAILED:2},ReferenceMessageStatus={DEFAULT:0,MODIFIED:1,RECALLED:2,DELETE:3},UserSettingsChangedKey={TranslationLanguage:0,AutoTranslateEnable:1},_a$7,AreaCode;exports.AreaCode=void 0,AreaCode=exports.AreaCode||(exports.AreaCode={}),AreaCode[AreaCode.BJ=1]="BJ",AreaCode[AreaCode.SG=2]="SG",AreaCode[AreaCode.NA=3]="NA",AreaCode[AreaCode.SG_A=4]="SG_A",AreaCode[AreaCode.SG_B=4]="SG_B",AreaCode[AreaCode.SA=5]="SA";var urlProfile=(_a$7={},_a$7[exports.AreaCode.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:EConnectProtocol.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},_a$7[exports.AreaCode.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:EConnectProtocol.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},_a$7[exports.AreaCode.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:EConnectProtocol.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},_a$7[exports.AreaCode.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:EConnectProtocol.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},_a$7[exports.AreaCode.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:EConnectProtocol.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},_a$7);function getCode(e){return exports.AreaCode[e]?e:exports.AreaCode.BJ}function getLocalNaviUrlList(e){return void 0===e&&(e=exports.AreaCode.BJ),urlProfile[getCode(e)].naviUrlBase64}function getLocalLogUrlList(e){return void 0===e&&(e=exports.AreaCode.BJ),urlProfile[getCode(e)].logUrlBase64}function getLocalMiniCmpUrlList(e){return void 0===e&&(e=exports.AreaCode.BJ),urlProfile[getCode(e)].miniCmpBase64}function getLocalStaticConfigUrlList(e){return void 0===e&&(e=exports.AreaCode.BJ),urlProfile[getCode(e)].staticConfigUrlBase64}function getLocalCloudControllerUrlList(e){return void 0===e&&(e=exports.AreaCode.BJ),urlProfile[getCode(e)].cloudControllerUrlBase64}function getLocalStatsUrlList(e){return void 0===e&&(e=exports.AreaCode.BJ),urlProfile[getCode(e)].statsUrlBase64}var UrlCenter=function(){function e(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.initOption=e}}),Object.defineProperty(e.prototype,"getNaviUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.initOption||{},n=r.areaCode,i=r.navigators,o=getLocalNaviUrlList(n).map((function(e){return base64Decode(e)})),a=[],s=__read(e.split("@"),2)[1];t&&(a=s?s.split(";"):[]);var u=i&&i.length>0?__spreadArray(__spreadArray([],__read(a),!1),__read(i),!1):__spreadArray(__spreadArray([],__read(a),!1),__read(o),!1);return u.filter((function(e,t){return u.indexOf(e)===t})).map((function(e){return fixUrlProtocol(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e||{},n=r.log,i=r.logPolicy,o=this.initOption||{},a=o.areaCode,s=o.logServerUrl,u=getLocalLogUrlList(a).map((function(e){return __assign(__assign({},e),{addr:base64Decode(e.addr)})})),l=[],c={level:1,itv:6,times:5};if(n)l.push.apply(l,__spreadArray([],__read(n.addrs),!1)),Object.assign(c,n.policy);else if(i)try{var _=JSON.parse(i);l.push({addr:_.url,protocol:EConnectProtocol.HTTPS,weight:1}),c.level=_.level,c.itv=_.itv,c.times=_.times}catch(r){t.warn(Log.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var d=s?__spreadArray([{addr:s,protocol:EConnectProtocol.HTTPS,weight:101}],__read(l),!1):__spreadArray(__spreadArray([],__read(l),!1),__read(u),!1);return{policy:c,addrs:d.filter((function(e,t){return d.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return __assign(__assign({},e),{addr:fixUrlProtocol(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=getLocalMiniCmpUrlList(null===(e=this.initOption)||void 0===e?void 0:e.areaCode).map((function(e){return base64Decode(e)})),r=(this.initOption||{}).miniCMPProxy;return r&&r.length>0?r:t}}),Object.defineProperty(e.prototype,"getStaticConfigUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return getLocalStaticConfigUrlList(null===(e=this.initOption)||void 0===e?void 0:e.areaCode).map((function(e){return base64Decode(e)}))}}),Object.defineProperty(e.prototype,"getCloudControllerUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return getLocalCloudControllerUrlList(null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode).map((function(e){return base64Decode(e)}))}}),Object.defineProperty(e.prototype,"getAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:exports.AreaCode.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!exports.AreaCode[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e||{},n=r.active,i=r.activeServer,o=(null==n?void 0:n.addrs)||[],a=getLocalStatsUrlList(null===(t=this.initOption)||void 0===t?void 0:t.areaCode).map((function(e){return base64Decode(e)})),s=[];return 0!==o.length?s.push.apply(s,__spreadArray([],__read(o.sort((function(e,t){return t.weight-e.weight})).map((function(e){return fixUrlProtocol(e.addr,e.protocol)}))),!1)):i&&s.push(fixUrlProtocol(i,EConnectProtocol.HTTPS)),a.forEach((function(e){s.includes(e)||s.push(e)})),s}}),e}(),urlCenter=new UrlCenter,BasicStaticConfigManager=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 __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u;return __generator(this,(function(l){switch(l.label){case 0:if(!(t=this.getCache()))return[3,6];l.label=1;case 1:return l.trys.push([1,4,,5]),r=JSON.parse(t),Date.now()-(null==r?void 0:r.time)<STATIC_CONFIG_CACHE_TIME?[4,this.decryptData(r.val)]:[3,3];case 2:return n=l.sent(),(i=n.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return fixUrlProtocol(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=l.sent(),this.logger.error(Log.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),l.label=6;case 6:return[4,this._requestHandle()];case 7:return(a=l.sent())?[4,this.decryptData(a)]:[2];case 8:return(null==(s=l.sent())?void 0:s.areaCode)!==urlCenter.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:a})),this.staticUrls=(null==s?void 0:s.bootstrap)||[],(u=null===(e=null==s?void 0:s.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:u.map((function(e){return fixUrlProtocol(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,s,u,l,c;return __generator(this,(function(_){switch(_.label){case 0:e=(e=__spreadArray(__spreadArray([],__read(this.staticUrls),!1),__read(urlCenter.getStaticConfigUrl()),!1).map((function(e){return fixUrlProtocol(e)}))).filter((function(t,r){return e.indexOf(t)===r})),_.label=1;case 1:_.trys.push([1,6,7,8]),t=__values(e),r=t.next(),_.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(Log.L_GET_STATIC_CONF_T,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(o=_.sent(),a=o.code,s=o.data,200===a)return this.logger.info(Log.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:a,duration:Date.now()-i})),[2,s];this.logger.warn(Log.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:a,duration:Date.now()-i})),_.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return u=_.sent(),l={error:u},[3,8];case 7:try{r&&!r.done&&(c=t.return)&&c.call(t)}finally{if(l)throw l.error}return[7];case 8:return[2]}}))}))}}),e}(),LogL;exports.LogL=void 0,LogL=exports.LogL||(exports.LogL={}),LogL[LogL.STATISTICS=-2]="STATISTICS",LogL[LogL.RECORD=-1]="RECORD",LogL[LogL.FATAL=0]="FATAL",LogL[LogL.ERROR=1]="ERROR",LogL[LogL.WARN=2]="WARN",LogL[LogL.INFO=3]="INFO",LogL[LogL.DEBUG=4]="DEBUG";var isEnableLogL=function(e){return[exports.LogL.DEBUG,exports.LogL.INFO,exports.LogL.WARN,exports.LogL.ERROR].some((function(t){return t===e}))},BasicLogger=function(){function e(e,t,r,n){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:exports.LogL.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.STATISTICS)}),Object.defineProperty(this,"record",{enumerable:!0,configurable:!0,writable:!0,value:this.__statistics})}return Object.defineProperty(e.prototype,"_write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.tag,r=e.level,n=e.content,i=e.traceId;/^[\w-]+$/.test(t)?r!==exports.LogL.DEBUG&&this.logDB.write(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(n," | ").concat(i))}}),Object.defineProperty(e.prototype,"createTraceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"".concat(++e._traceIdCount)}}),Object.defineProperty(e.prototype,"getSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return SESSION_ID}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,r=e.tag,n=e.content,i=e.traceId,o=e.level,a=e.loggerId;if(console&&!(o<=exports.LogL.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(r," | ").concat(n," | ").concat(i);console[s||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){isEnableLogL(e)&&(this.outputLevel=e)}}),Object.defineProperty(e.prototype,"_log",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i={time:Date.now(),level:e,tag:t,content:r,traceId:n,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(i),this._write(i)}}),Object.defineProperty(e.prototype,"summary",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){if(void 0===n&&(n={}),t.isOk){var a=null==i?void 0:i(t.data);this.info(e,JSON.stringify(__assign(__assign({isOk:!0},n),a)),r)}else{a=null==o?void 0:o(t.data);this.warn(e,JSON.stringify(__assign(__assign({code:t.code,msg:t.msg},n),a)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),BasicReporter=function(){function e(e,t,r,n,i,o){void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}return Object.defineProperty(e.prototype,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return __awaiter(this,void 0,void 0,(function(){var a,s,u,l=this;return __generator(this,(function(c){switch(c.label){case 0:a=[],c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.logDB.read(e,t,r,n,o)];case 2:return s=c.sent(),isArray(s.logs)?a=s.logs.filter((function(e){return!(!e||"object"!=typeof e)||(l.logger.warn(Log.L_REALTIME_LOG_R,"Invalid log entry: not an object",i),!1)})):this.logger.warn(Log.L_REALTIME_LOG_R,"Invalid logs result: not an array",i),[3,4];case 3:return u=c.sent(),this.logger.warn(Log.L_REALTIME_LOG_R,"Error getting logs: ".concat(u instanceof Error?u.message:String(u)),i),[3,4];case 4:return[2,{logs:a}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=urlCenter.getLogUrlPolicyList(e,this.logger),n=r.policy,i=r.addrs,this.started=!0,this.itvByNavi=n.itv,this.timesByNavi=n.times,i.length>0&&this.realtimeReport(i[0].addr,n.level,n.itv,t)),[2])}))}))}}),Object.defineProperty(e.prototype,"_sendLogs2Realtime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,u,l,c,_,d,p;return __generator(this,(function(g){switch(g.label){case 0:return this.logger.debug(Log.L_REALTIME_LOG_O,"compress logs: ".concat(e.length)),[4,this.compressLogs(e)];case 1:return i=g.sent(),o=i.success,a=i.data,o?(this.logger.debug(Log.L_REALTIME_LOG_O,"compress done",t),s=isHttpUrl(r)?r:"https://".concat(r),s+="?version=".concat("5.32.0-c-rtc-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:s,body:a,method:"POST"})]):(this.logger.warn(Log.L_REALTIME_LOG_R,"compress failed",t),[2,{isOk:!1,itv:n}]);case 2:if(u=g.sent(),l=u.status,c=u.data,this.logger.debug(Log.L_REALTIME_LOG_R,JSON.stringify({status:l,data:c}),t),200!==l)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(n+=n),this.reportFailedNumber++,[2,{isOk:!1,itv:n}];if(this.reportFailedNumber=0,c)try{(p=JSON.parse(c)).nextTime&&(n=p.nextTime),_=p.level,d=p.logSwitch}catch(e){this.logger.warn(Log.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:_,logSwitch:d}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,u,l,c,_,d,p,g=this;return __generator(this,(function(f){switch(f.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||SESSION_CREATE_TIME,a=Math.max(i-3e4,o+1),s=this.logger.createTraceId(),this.logger.debug(Log.L_REALTIME_LOG_T,JSON.stringify({startTime:o,endTime:a,level:t,itv:r}),s),[4,this._getLogs(o,a,t,!0,s,n)];case 1:return 0!==(u=f.sent().logs).length?[3,2]:(this.logger.debug(Log.L_REALTIME_LOG_R,"no logs",s),[3,4]);case 2:return u.length>0?[4,this._sendLogs2Realtime(u,s,e,r)]:[3,4];case 3:l=f.sent(),c=l.itv,_=l.level,d=l.logSwitch,l.isOk&&(p=Math.max.apply(Math,__spreadArray([],__read(u.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(p+1),0===d&&(this.started=!1),void 0!==_&&(t=_)),r=c,f.label=4;case 4:return this.started&&(r>=60&&this.itvByNavi<60&&(r=60),this.timer=setTimeout((function(){return g.realtimeReport(e,t,r,n)}),1e3*r)),[2]}}))}))}}),Object.defineProperty(e.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,a){return void 0===a&&(a=!1),__awaiter(this,void 0,void 0,(function(){var s,u,l,c,_,d,p,g;return __generator(this,(function(f){switch(f.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(s=this.logger.createTraceId(),this.logger.info(Log.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:o,isCloudControl:a}),s),[4,this._getLogs(e,t,exports.LogL.DEBUG,!1,s)]);case 1:return u=f.sent().logs,this.logger.info(Log.L_REPORT_FULL_LOG_O,JSON.stringify({count:u.length}),s),l=isHttpUrl(n)?n:"https://".concat(n),l+="?version=".concat("5.32.0-c-rtc-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),u.length>0?[4,this.compressLogs(u)]:[3,3];case 2:return _=f.sent(),d=_.success,p=_.data,c=d?p:"compress failed",[3,4];case 3:c="no data or no database",f.label=4;case 4:return this.logger.debug(Log.L_REPORT_FULL_LOG_O,"compress done",s),a&&(l+="&source=cloud"),[4,this.send({url:l,body:c,method:"POST"})];case 5:return g=f.sent().status,this.logger.info(Log.L_REPORT_FULL_LOG_R,JSON.stringify({status:g}),s),[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}(),transcsv=function(e){var t=e.sessionId,r=e.level,n=e.loggerId,i=e.traceId,o=e.time,a=e.tag,s=e.type,u=e.content;isString(u)||(u=JSON.stringify(u));var l=r<0?u||"":JSON.stringify({content:u,traceId:i,from:n});return l='"'.concat(l.replace(/"/g,'""'),'"'),"".concat(t,",").concat(o,",").concat(s,",").concat(r,",").concat(a,",").concat(l,"\n")},_LogDBProxy_reader,_LogDBProxy_writer;function validateLogData(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 defaultReader(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,{logs:[]}]}))}))}function defaultWriter(){}var LogDBProxy=function(){function e(e,t){_LogDBProxy_reader.set(this,void 0),_LogDBProxy_writer.set(this,void 0),__classPrivateFieldSet(this,_LogDBProxy_reader,e,"f"),__classPrivateFieldSet(this,_LogDBProxy_writer,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,a;return __generator(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,__classPrivateFieldGet(this,_LogDBProxy_reader,"f").call(this,e,t,r,n,i)];case 1:return(o=s.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(validateLogData)}]:[2,{logs:[]}];case 2:return a=s.sent(),console.error("[LogDBProxy] read error",a),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{__classPrivateFieldGet(this,_LogDBProxy_writer,"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&&__classPrivateFieldSet(this,_LogDBProxy_reader,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&__classPrivateFieldSet(this,_LogDBProxy_writer,e,"f"),this}}),e}();function createLogDBProxy(){return new LogDBProxy(defaultReader,defaultWriter)}_LogDBProxy_reader=new WeakMap,_LogDBProxy_writer=new WeakMap;var EventLoopChecker=function(){function e(){}var t,r,n,i,o,a;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){__classPrivateFieldGet(this,t,"f",r)||(__classPrivateFieldSet(this,t,e,"f",r),e.info(Log.L_EVENT_LOOP_BLOCKING_S,"start"),__classPrivateFieldGet(this,t,"m",a).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){__classPrivateFieldGet(this,t,"f",r)&&(__classPrivateFieldGet(this,t,"f",r).info(Log.L_EVENT_LOOP_BLOCKING_S,"stop"),__classPrivateFieldSet(this,t,null,"f",r),__classPrivateFieldGet(this,t,"f",n)&&(clearTimeout(__classPrivateFieldGet(this,t,"f",n)),__classPrivateFieldSet(this,t,null,"f",n)))}}),t=e,a=function e(){var a=this,s=Date.now();__classPrivateFieldSet(this,t,setTimeout((function(){var n=Date.now()-s;n>=__classPrivateFieldGet(a,t,"f",o)&&__classPrivateFieldGet(a,t,"f",r).warn(Log.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(n,"ms")),__classPrivateFieldGet(a,t,"m",e).call(a)}),__classPrivateFieldGet(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},o={value:1500},e}(),InvokerType;!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(InvokerType||(InvokerType={}));var UploadTaskManage=function(){function e(e){Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"uploadTask",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"taskLock",{enumerable:!0,configurable:!0,writable:!0,value:!0})}return Object.defineProperty(e.prototype,"uploadLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.uploadTask.push(e),this.enqueueTask()}}),Object.defineProperty(e.prototype,"reportLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o=this;this.taskLock=!1;var a=null!==(t=e.startTime)&&void 0!==t?t:0,s=null!==(r=e.endTime)&&void 0!==r?r:0,u=null!==(n=e.platform)&&void 0!==n?n:"",l=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==l&&(this.logId=e.logId,this.reporter.report(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}();function getDefaultCloudControllerData(){return{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}}}var BaseCloudController=function(){function e(e,t,r){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isEable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"expire",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"interval",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"lastRequestTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uploadTaskManage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"changeAreaCode",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.uploadTaskManage=new UploadTaskManage(r)}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(){try{var e=this.getLocalCloudControllerCache();this._cache=e?JSON.parse(e):getDefaultCloudControllerData()}catch(e){this._cache=getDefaultCloudControllerData()}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===MessageType.LOG_COMMAND&&t.uploadTaskManage.uploadLogCmdTask(e)}))}}),Object.defineProperty(e.prototype,"dataHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._cache;t.lastRequestTime=this.lastRequestTime,notEmptyObject(e)&&(t.timestamp=e.timestamp,e.uploadLog&&!e.uploadLog.temporary&&(t.uploadLog=e.uploadLog),e.cc&&!e.cc.temporary&&(t.cc=e.cc),e.mrtr&&!e.mrtr.temporary&&(t.mrtr=this._handleMrtrData(e.mrtr)),e.mrtr&&this.setMRTRConfig(this._handleMrtrData(e.mrtr))),this.setCloudControllerCache(t),this.expire=t.cc.expire,this.interval=t.cc.interval,this.timestamp=t.timestamp,this.logCmdMsgTasks(e)}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s,u,l,c,_,d;return __generator(this,(function(p){switch(p.label){case 0:return!this.isEable&&t===InvokerType.init&&this.isExire()?(this.logger.info(Log.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===InvokerType.newWorkChange&&this.isOverclock()?(this.logger.info(Log.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=fixUrlProtocol(e),this.lastRequestTime=(new Date).getTime(),i="".concat(n,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},r&&(o["RC-Token"]=r),a={platform:"web",version:"5.32.0-c-rtc-alpha.1",timestamp:this.timestamp},this.logger.record(StatisticsTag.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,exports.HttpMethod.POST,o,a)]);case 1:return s=p.sent(),u=s.code,l=s.data,this.logger.record(StatisticsTag.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:l})),u===exports.ErrorCode.CLOUD_DATA_CENTER_INVALID&&l&&l.targetRegion?(c=l.targetRegion,this.changeAreaCode===c?[2,this.timestamp]:(_=urlCenter.setAreaCode(c),this.logger.info(Log.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:_,originAreaCode:urlCenter.getAreaCode(),newAreaCode:c})),this.changeAreaCode=c,(d=urlCenter.getCloudControllerUrl(c))[0]?[2,this.request(d[0],InvokerType.other)]:(this.logger.info(Log.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:i,msg:"appkey region error"})),[2,this.timestamp]))):(l&&this.dataHandle(l),[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}(),_BaseConnectionManager_instances,_BaseConnectionManager_asNamedDispatcher,_BaseConnectionManager_resetUUId,_BaseConnectionManager_connectedTime,IM_PING_INTERVAL_TIME=15e3,IM_PING_TIMEOUT=15e3,isRedirectCode=function(e){return e===exports.ErrorCode.RC_CONN_REDIRECTED},BaseConnectionManager=function(e){function t(t,r,n){var i=e.call(this)||this;return _BaseConnectionManager_instances.add(i),Object.defineProperty(i,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_fromSuspend",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"curCmpUrl",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"uuid",{enumerable:!0,configurable:!0,writable:!0,value:""}),_BaseConnectionManager_connectedTime.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:NetworkType.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:exports.RCConnectionStatus.DISCONNECTED}),Object.defineProperty(i,"_crtUserId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"cmpWeightCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_crtConnectionTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_failedCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"ALLOW_FAILED_TIMES",{enumerable:!0,configurable:!0,writable:!0,value:2}),i}return __extends(t,e),Object.defineProperty(t.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(t.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(t.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===exports.RCConnectionStatus.DISCONNECTED&&e===exports.RCConnectionStatus.CONNECTING&&(this._doConnectReason=ConnectReason.CONNECT,__classPrivateFieldGet(this,_BaseConnectionManager_instances,"m",_BaseConnectionManager_resetUUId).call(this)),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED&&e===exports.RCConnectionStatus.SUSPENDED&&(t===exports.ErrorCode.RC_PING_EXCEED_LIMIT?this._doConnectReason=ConnectReason.TIMEOUT:t===exports.ErrorCode.RC_CONN_REDIRECTED?this._doConnectReason=ConnectReason.REDIRECTED:this._doConnectReason=ConnectReason.RECONNECT),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED){var r={bid:getbundleId(),cod:t,net:this.getNetwork().type,dur:Date.now()-__classPrivateFieldGet(this,_BaseConnectionManager_connectedTime,"f"),cid:this.cid};this.logger.record(StatisticsTag.IM_CONNECTION_DURATION,JSON.stringify(r)),e===exports.RCConnectionStatus.SUSPENDED&&__classPrivateFieldGet(this,_BaseConnectionManager_instances,"m",_BaseConnectionManager_resetUUId).call(this)}switch(this._crtConnectionStatus=e,e){case exports.RCConnectionStatus.CONNECTED:this.logger.info(Log.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),__classPrivateFieldGet(this,_BaseConnectionManager_instances,"m",_BaseConnectionManager_asNamedDispatcher).call(this).emit("onConnected",this._fromSuspend);break;case exports.RCConnectionStatus.CONNECTING:this.logger.warn(Log.L_CONNECT_S,"status: ".concat(e)),__classPrivateFieldGet(this,_BaseConnectionManager_instances,"m",_BaseConnectionManager_asNamedDispatcher).call(this).emit("onConnecting");break;case exports.RCConnectionStatus.SUSPENDED:this._fromSuspend=!0,this.logger.warn(Log.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),isRedirectCode(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),__classPrivateFieldGet(this,_BaseConnectionManager_instances,"m",_BaseConnectionManager_asNamedDispatcher).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(Log.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),__classPrivateFieldGet(this,_BaseConnectionManager_instances,"m",_BaseConnectionManager_asNamedDispatcher).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(t.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(t.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t){var r={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(StatisticsTag.IM_NETWORK_CHANGE,JSON.stringify(r))}this._network=e}}),Object.defineProperty(t.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(t.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED?[2,ok(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2,fail(o)]):(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2,ok(a)])}}))}))}}),Object.defineProperty(t.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(a){switch(a.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,r,n,i),[4,this._crtConnectionTask]);case 1:return o=a.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(t.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,a,s,u,l,c,_,d,p,g;return __generator(this,(function(f){switch(f.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(StatisticsTag.IM_STATS_CS,JSON.stringify(o)),a={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,r,!1,n,a)];case 1:return s=f.sent(),u=s.code,l=s.data,u!==exports.ErrorCode.SUCCESS?[2,fail(u)]:1===(c=l).type?[2,fail(exports.ErrorCode.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(Log.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),c,t,n)]);case 2:return _=f.sent(),d=_.code,p=_.data,i||d===exports.ErrorCode.SUCCESS||(this.retryCount+=1),isRedirectCode(d)?(this.logger.warn(Log.L_CONNECT_R,"redirect code: ".concat(d),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,i)]):[exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP,exports.ErrorCode.CONNECTION_REFUSED].includes(d)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),g=this.cmpWeightCache.every((function(e){return e.failed})),i&&g?(this.logger.warn(Log.L_CONNECT_R,"cpp code:".concat(d,",reture code:").concat(exports.ErrorCode.SERVER_UNAVAILABLE),n),[2,fail(exports.ErrorCode.SERVER_UNAVAILABLE)]):(this.logger.warn(Log.L_CONNECT_R,"cmp ack timeout, code: ".concat(d),n),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,d),this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):d!==exports.ErrorCode.SUCCESS?(this.logger.warn(Log.L_CONNECT_R,"code: ".concat(d),n),[2,fail(d)]):(this.logger.info(Log.L_CONNECT_R,"userId: ".concat(p),n),__classPrivateFieldSet(this,_BaseConnectionManager_connectedTime,Date.now(),"f"),this._crtUserId=p,[2,ok(p)])}}))}))}}),Object.defineProperty(t.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){return r=this.logger.createTraceId(),this.logger.debug(Log.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return __awaiter(i,void 0,void 0,(function(){var i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.SUSPENDED?[2]:(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=s.sent(),o=i.code,a=i.isOk,this.reconnectTimer=null,a?(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2]):[exports.ErrorCode.SERVER_UNAVAILABLE,exports.ErrorCode.TIMEOUT,exports.ErrorCode.RC_SOCKET_DISCONNECTED,exports.ErrorCode.RC_SOCKET_NOT_CREATED,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_NAVI_REQ_FAILED,exports.ErrorCode.RC_NETWORK_DOWN,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTING||(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,o),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(t.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return isRedirectCode(e)?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===exports.ErrorCode.RC_UDP_DISCONNECTED?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,e)}}),Object.defineProperty(t.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(t.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?(this._failedCount=0,this.logger.debug(Log.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(Log.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(IM_PING_TIMEOUT)]);case 1:return(t=n.sent())===exports.ErrorCode.SUCCESS?(this.logger.debug(Log.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),IM_PING_INTERVAL_TIME),[2]):this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(Log.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(Log.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,exports.ErrorCode.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,exports.ErrorCode.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(t.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,exports.ErrorCode.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(t.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(t.prototype,"getCmpList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return __spreadArray([],__read(this.cmpWeightCache),!1);var r=formatCmpList(e,t);return this.cmpWeightCache=__spreadArray([],__read(r),!1),__spreadArray([],__read(r),!1)}}),Object.defineProperty(t.prototype,"updateCmpWeight",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(this.cmpWeightCache){var n=this.cmpWeightCache.find((function(t){return r?t.addr===e&&t.protocol===EConnectProtocol.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,__spreadArray([],__read(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,__spreadArray([],__read(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==o&&(n.weight=o-1),n.failed=!0}}}}),Object.defineProperty(t.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(t.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this.token=e,this._openCallPlus=r,this.onDisconenctUnusual(n)}}),t}(EventDispatcher);_BaseConnectionManager_connectedTime=new WeakMap,_BaseConnectionManager_instances=new WeakSet,_BaseConnectionManager_asNamedDispatcher=function(){return this},_BaseConnectionManager_resetUUId=function(){this.uuid=UUId.gen(),this.retryCount=0};var formatToken=function(e){return e.replace(/@.+$/,"@")},BasicNavi=function(){function e(e,t,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}return Object.defineProperty(e.prototype,"getCatchKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e+(this._environment?"-".concat(this._environment):"")}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(a){switch(a.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,r,n,i),[4,this.crtRequest]);case 1:return o=a.sent(),this.crtRequest=null,[2,o]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o;return __awaiter(this,void 0,void 0,(function(){var a,s,u,l,c,_,d,p,g,f,h,E,T,b,v,R,I;return __generator(this,(function(C){switch(C.label){case 0:return a=formatToken(e),s=this.getNaviCache(a),!t&&s&&(u=s.timestamp,l=s.naviInfo,r||Date.now()-u<NAVI_CACHE_DURATION)?(this.logger.info(Log.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:l}),n),i&&(c=i.uuid,_=i.retryCount,d=i.reason,p={bid:getbundleId(),ptc:ProtocalType.NAVI,cod:exports.ErrorCode.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(o=l.type)&&void 0!==o?o:0,hos:"",cache:NaviCacheType.LOCAL,v:StatisticsVersion.CURRENT,rsn:d,cid:"".concat(c,"_").concat(_),count:_},this.logger.record(StatisticsTag.IM_NAVI,JSON.stringify(p),n)),[2,ok(l)]):(g=urlCenter.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(Log.L_GET_NAVI_T,JSON.stringify({token:e,uris:g}),n),[4,this.requestHandler(g,e,n,i)]);case 1:return f=C.sent(),h=f.code,E=f.data,h===exports.ErrorCode.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(T=C.sent())?void 0:T.navi)&&(null==T?void 0:T.navi.length)>0?(b=T.navi,[4,this.requestHandler(b,e,n,i)]):[3,4];case 3:v=C.sent(),h=v.code,E=v.data,C.label=4;case 4:return h!==exports.ErrorCode.SUCCESS?(this.logger.warn(Log.L_GET_NAVI_R,h,n),[2,fail(h)]):(R=E).code&&200!==R.code?(this.logger.warn(Log.L_GET_NAVI_R,R.code,n),[2,fail(this.transHttpCode(R.code))]):formatCmpList(R).length>0?(this.logger.info(Log.L_GET_NAVI_R,JSON.stringify({naviInfo:R}),n),this.setNaviCache(a,R),[2,ok(R)]):(I={server:R.server,backupServer:R.backupServer,serverAddr:R.serverAddr,bs:R.bs},this.logger.warn(Log.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(I)),n),[2,fail(exports.ErrorCode.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,u,l,c,_,d;return __generator(this,(function(p){switch(p.label){case 0:i=0,o=e.length,p.label=1;case 1:return i<o?(a=i===e.length-1,s=this.useV2Navi()?this.httpRequestV2:this.httpRequest,u=Date.now(),[4,s.call(this,e[i],this.appkey,t,r,a)]):[3,4];case 2:if(l=p.sent(),c=l.code,_=l.data,d={bid:getbundleId(),ptc:ProtocalType.NAVI,cod:c,net:null==n?void 0:n.type,dur:Date.now()-u,spr:0,pr:(null==_?void 0:_.type)||0,hos:e[i],cache:NaviCacheType.REQUEST,v:StatisticsVersion.CURRENT,rsn:null==n?void 0:n.reason,cid:"".concat(null==n?void 0:n.uuid,"_").concat(null==n?void 0:n.retryCount),count:null==n?void 0:n.retryCount},this.logger.record(StatisticsTag.IM_NAVI,JSON.stringify(d),r),[exports.ErrorCode.SUCCESS,exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,exports.ErrorCode.RC_LICENSE_EXPIRED].includes(c))return[2,c===exports.ErrorCode.SUCCESS?ok(_):fail(c)];p.label=3;case 3:return i+=1,[3,1];case 4:return[2,fail(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(e.prototype,"transHttpCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){switch(e){case 401:case 403:return exports.ErrorCode.RC_CONN_TOKEN_INCORRECT;case 416:return exports.ErrorCode.RC_LICENSE_EXPIRED;default:return exports.ErrorCode.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(formatToken(e));return t?t.naviInfo:null}}),Object.defineProperty(e.prototype,"updateVoipCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getNaviInfoFromCache(e);r&&this.setNaviCache(formatToken(e),__assign(__assign({},r),{voipCallInfo:t}))}}),Object.defineProperty(e.prototype,"getNaviV2RequestOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.uri,n=e.token,i=e.platform,o=e.protocol,a=e.mac;t="".concat(r,"/v2/navi.json?cloud=").concat(0);var s="token=".concat(encodeURIComponent(n),"&v=").concat(FORMATED_VERSION,"&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:NAVI_REQ_TIMEOUT}}}),Object.defineProperty(e.prototype,"useV2Navi",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),messageTypeDescription=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 registerMessageType(e,t){var r=messageTypeDescription.get(e);r&&!r.isCustom&&console.warn("Builtin message type '".concat(e,"' cannot be registered")),t.isStatusMessage&&(t.isCounted=t.isPersited=!1),messageTypeDescription.set(e,__assign(__assign({},t),{isCustom:!0}))}function getMessageTypeDescription(e){return messageTypeDescription.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function hasMessageTypeDescription(e){return messageTypeDescription.has(e)}var TranslateMode={MECHANICAL:0,INTELLIGENT:1},BaseTranslateParam=function(){function e(e,t,r,n){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=r,this.text=n}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}(),TranslateMessageParam=function(e){function t(t,r,n,i){return e.call(this,t,r,n,i)||this}return __extends(t,e),t}(BaseTranslateParam),TranslateTextParam=function(e){function t(t,r,n){return e.call(this,md5(t),r,n,t)||this}return __extends(t,e),t}(BaseTranslateParam),TranslateStatus={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},TranslateStrategy={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2},hasMiniBaseEvent=function(e){for(var t=["request","getSystemInfo"],r=0,n=t.length;r<n;r++){if(!e[t[r]])return!1}return!0},isFromUniappEnv=function(){return!("undefined"==typeof uni||!hasMiniBaseEvent(uni))},_SSEClient_instances,_SSEClient_initOpts,_SSEClient_tryOpen,SSEClient=function(){function e(e){_SSEClient_instances.add(this),_SSEClient_initOpts.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),__classPrivateFieldSet(this,_SSEClient_initOpts,e,"f"),this._logger=e.logger}return Object.defineProperty(e.prototype,"open",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,__classPrivateFieldGet(this,_SSEClient_instances,"m",_SSEClient_tryOpen).call(this,e,__classPrivateFieldGet(this,_SSEClient_initOpts,"f"))]}))}))}}),e}();_SSEClient_initOpts=new WeakMap,_SSEClient_instances=new WeakSet,_SSEClient_tryOpen=function e(t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return 0===t.length?[2,fail(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(n=t.shift(),i=fixUrlProtocol(n.addr,n.protocol),i="".concat(i,"/v3/message/get_stream.json?sdkVersion=").concat("5.32.0-c-rtc-alpha.1","&platform=Websocket&messageUID=").concat(r.msgUId),this._logger.info(Log.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(i)),[4,this._openHandler(i,r)]);case 1:return[2,(o=s.sent()).or((function(n){return __awaiter(a,void 0,void 0,(function(){return __generator(this,(function(i){return-1===n?[2,__classPrivateFieldGet(this,_SSEClient_instances,"m",e).call(this,t,r)]:[2,o]}))}))}))]}}))}))};var BrowserSSEClient=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a=this;return __generator(this,(function(s){return r=promiseWithResolvers(),n=r.resolve,i=r.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){a._logger.warn(Log.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),n(fail(-1,"timeout"))},o.onreadystatechange=function(r){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),s=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&s){n(ok());var u=0;o.onprogress=function(e){var r=o.response.slice(u);u=o.response.length,t.onRawContent(r)},o.onerror=function(r){a._logger.warn(Log.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);n(fail(e.code,e.message))}}},o.onerror=function(t){a._logger.warn(Log.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),n(fail(-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]}))}))}}),t}(SSEClient),isFromUniapp$6=isFromUniappEnv();function createWebSocket(e,t){var r=new WebSocket(e,t);return r.binaryType="arraybuffer",Promise.resolve(ok({id:Date.now(),onClose:function(e){r.onclose=function(t){var r=t.code,n=t.reason;e(r,n)}},onError:function(e){r.onerror=e},onMessage:function(e){r.onmessage=function(t){e(t.data)}},onOpen:function(e){r.onopen=e},send:function(e){r.send(e)},close:function(e,t){r.close()}}))}var callback$7=null,listener$7=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return[4,browser.getNetworkType()];case 1:return t=r.sent(),callback$7({status:"online"===e.type,type:t}),[2]}}))}))};function setNetworkStatusListener$7(e){callback$7=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",listener$7),window.addEventListener("online",listener$7))}function removeNetworkStatusListener$7(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",listener$7),window.removeEventListener("online",listener$7)),callback$7=null}var browser={tag:"browser",httpReq:function(e){return httpRequest(e).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:isFromUniapp$6,createWebSocket:createWebSocket,getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:NetworkType.UNKONWN},t=e.type,r=e.effectiveType,n=t||r||NetworkType.UNKONWN;return Promise.resolve(n)},setNetworkStatusListener:setNetworkStatusListener$7,removeNetworkStatusListener:removeNetworkStatusListener$7,createSSEClient:function(e){return ok(new BrowserSSEClient(e))},getApiVer:function(){var e=browser.runtimeInfo,t=e.type,r=e.version;return"|".concat(t,"|").concat(r)},get runtimeInfo(){var e,t,r=navigator.userAgent,n={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var i in n)if(n.hasOwnProperty(i)){var o=r.match(n[i]);if(o){t=i,e=o[1]||o[2];break}}return{type:t||"Unknown",version:e||"Unknown"}}},Topic;!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.delRelation=55]="delRelation",e[e.delRelationBatch=56]="delRelationBatch",e[e.pullSeAtts=57]="pullSeAtts",e[e.setSeAtt=58]="setSeAtt",e[e.qnTkn=59]="qnTkn",e[e.qnUrl=60]="qnUrl",e[e.aliUrl=61]="aliUrl",e[e.s3Url=62]="s3Url",e[e.stcUrl=63]="stcUrl",e[e.minioUrl=64]="minioUrl",e[e.cleanPMsg=65]="cleanPMsg",e[e.cleanGMsg=66]="cleanGMsg",e[e.cleanCMsg=67]="cleanCMsg",e[e.cleanSMsg=68]="cleanSMsg",e[e.cleanMCMsg=69]="cleanMCMsg",e[e.cleanMPMsg=70]="cleanMPMsg",e[e.cleanMsgBatch=71]="cleanMsgBatch",e[e.rtcPing=72]="rtcPing",e[e.rtc_ntf=73]="rtc_ntf",e[e.rtcSetOutData=74]="rtcSetOutData",e[e.rtcQryUserOutData=75]="rtcQryUserOutData",e[e.addSeTag=76]="addSeTag",e[e.delSeTag=77]="delSeTag",e[e.addTag=78]="addTag",e[e.delTag=79]="delTag",e[e.reportsdk=80]="reportsdk",e[e.pullUgSes=81]="pullUgSes",e[e.pullUgMsg=82]="pullUgMsg",e[e.ugMsg=83]="ugMsg",e[e.qryUgMsg=84]="qryUgMsg",e[e.updUgRTime=85]="updUgRTime",e[e.upMsgEx=86]="upMsgEx",e[e.modifyMsg=87]="modifyMsg",e[e.qryMsgChange=88]="qryMsgChange",e[e.qryMsg=89]="qryMsg",e[e.operate=90]="operate",e[e.s_opNtf=91]="s_opNtf",e[e.ugUnpushQuery=92]="ugUnpushQuery",e[e.ugUnpushSet=93]="ugUnpushSet",e[e.setRtcRoomId=94]="setRtcRoomId",e[e.qryUgUal=95]="qryUgUal",e[e.updUserSub=96]="updUserSub",e[e.pullUserSub=97]="pullUserSub",e[e.pullSubData=98]="pullSubData",e[e.qrySubData=99]="qrySubData",e[e.pullUserProfile=100]="pullUserProfile",e[e.pullOwnProfile=101]="pullOwnProfile",e[e.updProfilePermiss=102]="updProfilePermiss",e[e.qProfilePermiss=103]="qProfilePermiss",e[e.searchUserProfile=104]="searchUserProfile",e[e.updUserProfile=105]="updUserProfile",e[e.pullEventChange=106]="pullEventChange",e[e.channelCreate=107]="channelCreate",e[e.upChannelInfo=108]="upChannelInfo",e[e.qChannelInfo=109]="qChannelInfo",e[e.channelMemKick=110]="channelMemKick",e[e.channelMemQuit=111]="channelMemQuit",e[e.channelDismiss=112]="channelDismiss",e[e.channelTransfer=113]="channelTransfer",e[e.upChannelManager=114]="upChannelManager",e[e.qChannelMem=115]="qChannelMem",e[e.qChannelSpeMem=116]="qChannelSpeMem",e[e.upChannelMem=117]="upChannelMem",e[e.channelMemJoin=118]="channelMemJoin",e[e.channelMemInvite=119]="channelMemInvite",e[e.channelApplyResp=120]="channelApplyResp",e[e.qChannelApplyList=121]="qChannelApplyList",e[e.qChannelMemJoin=122]="qChannelMemJoin",e[e.qChannelMemSpeJoin=123]="qChannelMemSpeJoin",e[e.upChannelRemark=124]="upChannelRemark",e[e.qChannelRemark=125]="qChannelRemark",e[e.upChannelFollow=126]="upChannelFollow",e[e.qChannelFollow=127]="qChannelFollow",e[e.qSimpleUserProfile=128]="qSimpleUserProfile",e[e.friendAdd=129]="friendAdd",e[e.friendDel=130]="friendDel",e[e.friendHandle=131]="friendHandle",e[e.friendSetPf=132]="friendSetPf",e[e.friendCheck=133]="friendCheck",e[e.friendsQuery=134]="friendsQuery",e[e.friendApplyDel=135]="friendApplyDel",e[e.friendsInfoQry=136]="friendsInfoQry",e[e.friendAuthSet=137]="friendAuthSet",e[e.friendAuthGet=138]="friendAuthGet",e[e.addUnpush=139]="addUnpush",e[e.qryUnpush=140]="qryUnpush",e[e.delUnpush=141]="delUnpush",e[e.s_pubCall=142]="s_pubCall",e[e.reqCall=143]="reqCall",e[e.pullKvMsg=144]="pullKvMsg",e[e.readReceipt=145]="readReceipt",e[e.qryReceipt=146]="qryReceipt",e[e.qryReceiptBatch=147]="qryReceiptBatch",e[e.upConvertMsg=148]="upConvertMsg",e[e.pullModifyMsg=149]="pullModifyMsg"}(Topic||(Topic={}));var string2Topic=function(e){var t=Topic[e];return t},topic2String=function(e){return Topic[e]},Qos={AT_MOST_ONCE:0,AT_LEAST_ONCE:1,EXACTLY_ONCE:2,DEFAULT:3},Command={SYMMETRIC:0,CONNECT:1,CONN_ACK:2,PUBLISH:3,PUB_ACK:4,QUERY:5,QUERY_ACK:6,QUERY_CONFIRM:7,PING:12,PONG:13,DISCONNECT:14,PCONNECT:8,PCONNECT_ACK:9,RESERVED:10,RESERVED_2:11,RESERVED_3:15},ConnAckProtocolVer={V4:4,V3:3},RTC_API={rtcRJoin_data:"rtcRJoin_data",rtcRExit:"rtcRExit",rtcRInfo:"rtcRInfo",rtcUData:"rtcUData",rtcUPut:"rtcUPut",rtcUDel:"rtcUDel",rtcSetData:"rtcSetData",userSetData:"userSetData",rtcQryData:"rtcQryData",rtcDelData:"rtcDelData",rtcToken:"rtcToken",rtcUserState:"rtcUserState",rtcUList:"rtcUList",viewerJoinR:"viewerJoinR",viewerExitR:"viewerExitR",rtcPullKv:"rtcPullKv",rtcIdentityChange:"rtcIdentityChange",rtcInvite:"rtcInvite",rtcCancelInvite:"rtcCancelInvite",rtcInviteAnswer:"rtcInviteAnswer",rtcEndInvite:"rtcEndInvite",rtcQueryJoined:"rtcQueryJoined"},ConnectAckStatus={ACCEPTED:0,UNACCEPTABLE_PROTOCOL_VERSION:1,IDENTIFIER_REJECTED:2,SERVER_UNAVAILABLE:3,TOKEN_INCORRECT:4,NOT_AUTHORIZED:5,REDIRECT:6,PACKAGE_ERROR:7,APP_BLOCK_OR_DELETE:8,BLOCK:9,TOKEN_EXPIRE:10,DEVICE_ERROR:11,HOSTNAME_ERROR:12,HASOHTERSAMECLIENTONLINE:13,OUT_OF_LIMIT:14,IN_OTHER_CLUSTER:15,APP_AUTH_NOT_PASS:16,OTP_USED:17,PLATFORM_ERROR:18,ACCOUNT_CANCELLATION:19,LICENSE_EXPIRED:20},DisconnectReason={OTHER_DEVICE_LOGIN:1,BLOCK:2,LOGOUT:4,BLOCK_NEW:5,REDIRECT_NEW:6,TOKEN_EXPIRED:7,ILLEGAL_PROTOCOL_VERSION:8,ACCOUNT_CANCELLATION:9},BinaryHelper=function(){function e(){}return Object.defineProperty(e,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this._getBackAndByteSize(e),r=t.back,n=t.byteSize,i=0,o=r.length;i<o;i++)r[i]>255&&(r[i]&=255);return n<=255?[0,n].concat(r):[n>>8,255&n].concat(r)}}),Object.defineProperty(e,"_getBackAndByteSize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],r=0;if("string"==typeof e)for(var n=0,i=e.length;n<i;n++){var o=e.charCodeAt(n);o>=0&&o<=127?(r+=1,t.push(o)):o>=128&&o<=2047?(r+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(r+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:r,back:t}}}),Object.defineProperty(e,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r,n=[],i=-1,o=e,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?n.push(s):(t=(s-=65536)>>10|55296,r=s%1024|56320,n.push(t,r)),(i+1===o.length||n.length>16384)&&(a+=String.fromCharCode.apply(null,n),n.length=0)}return a}}),e}(),StreamReader=function(){function e(e){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_position",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_poolLen",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._pool=e,this._poolLen=e.length}return Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._position>=this._pool.length}}),Object.defineProperty(e.prototype,"read2Byte",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<2;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n.toString()}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readInt32",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(this.readByte()<<24)+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()}}),Object.defineProperty(e.prototype,"readLong",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<8;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readByte",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e}}),Object.defineProperty(e.prototype,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var r=this._pool.subarray(t,this._position);return BinaryHelper.readUTF(r)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),StreamWriter=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(__spreadArray([],__read(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=BinaryHelper.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}(),Header=function(){function e(e,t,r,n){void 0===t&&(t=Qos.AT_LEAST_ONCE),void 0===r&&(r=!1),void 0===n&&(n=!1),Object.defineProperty(this,"command",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"qos",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_retain",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"dup",{enumerable:!0,configurable:!0,writable:!0,value:n})}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}(),BaseReader=function(){function e(e){Object.defineProperty(this,"header",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.readMessage(e,t,r)}}),Object.defineProperty(e.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return{stream:e,length:t}}}),e}(),BaseWriter=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 Header(e,Qos.AT_MOST_ONCE)}return Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getHeaderFlag();e.writeByte(t),this.writeMessage(e)}}),Object.defineProperty(e.prototype,"setHeaderQos",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._header.qos=e}}),Object.defineProperty(e.prototype,"getHeaderFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._header.encode()}}),Object.defineProperty(e.prototype,"getArrayBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new StreamWriter;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),ConnAckReader=function(e){function t(){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 __extends(t,e),Object.defineProperty(t.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,n){if(e.readByte(),this.status=e.readByte(),r<=t.MESSAGE_LENGTH)return{stream:e,length:r};if(n===ConnAckProtocolVer.V4){var i=e.readByte();1&i&&(this.userId=e.readUTF()),2&i&&(this.sessionId=e.readUTF()),4&i&&(this.timestamp=e.readLong()),8&i&&(this.messageId=e.read2Byte())}else this.userId=e.readUTF(),this.sessionId=e.readUTF(),this.timestamp=e.readLong();return{stream:e,length:r}}}),Object.defineProperty(t,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),t}(BaseReader),DisconnectWriter=function(e){function t(t){var r=e.call(this,Command.DISCONNECT)||this;return Object.defineProperty(r,"status",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return __extends(t,e),Object.defineProperty(t.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.writeArr([0,this.status])}}),t}(BaseWriter),DisconnectReader=function(e){function t(){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 __extends(t,e),Object.defineProperty(t.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(t,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),t}(BaseReader),PingReqWriter=function(e){function t(){return e.call(this,Command.PING)||this}return __extends(t,e),Object.defineProperty(t.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),t}(BaseWriter),PingRespReader=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t}(BaseReader),RetryableReader=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return __extends(t,e),Object.defineProperty(t.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=256*e.readByte()+e.readByte();return this.messageId=parseInt(r.toString(),10),{stream:e,length:t}}}),t}(BaseReader),RetryableWriter=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.messageId,r=255&t,n=(65280&t)>>8;e.writeByte(n),e.writeByte(r)}}),t}(BaseWriter),PublishReader=function(e){function t(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(r,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r.syncMsg=t.dup,r}return __extends(t,e),Object.defineProperty(t.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,r),this.pbData=t.readAll(),{stream:t,length:r}}}),t}(RetryableReader),ExtendableWriter=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"topic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o.topic="string"==typeof r?r:topic2String(r),o}return __extends(t,e),Object.defineProperty(t.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)}}),t}(RetryableWriter),QueryWriter=function(e){function t(t,r,n){return e.call(this,Command.QUERY,t,n,r)||this}return __extends(t,e),t}(ExtendableWriter),PublishWriter=function(e){function t(t,r,n){return e.call(this,Command.PUBLISH,t,n,r)||this}return __extends(t,e),t}(ExtendableWriter),PubAckReader=function(e){function t(){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 __extends(t,e),Object.defineProperty(t.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.millisecond=256*t.readByte()+t.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=t.readUTF(),{stream:t,length:r}}}),t}(RetryableReader),PubAckWriter=function(e){function t(t){var r=e.call(this,Command.PUB_ACK)||this;return r.messageId=t,r}return __extends(t,e),t}(RetryableWriter),QueryConWriter=function(e){function t(t){var r=e.call(this,Command.QUERY_CONFIRM)||this;return r.messageId=t,r}return __extends(t,e),t}(RetryableWriter),QueryAckReader=function(e){function t(){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 __extends(t,e),Object.defineProperty(t.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:r}}}),t}(RetryableReader),getReaderByHeader=function(e){var t,r=e.command;switch(r){case Command.CONN_ACK:t=new ConnAckReader(e);break;case Command.PUBLISH:t=new PublishReader(e);break;case Command.PUB_ACK:t=new PubAckReader(e);break;case Command.QUERY_ACK:t=new QueryAckReader(e);break;case Command.PONG:t=new PingRespReader(e);break;case Command.DISCONNECT:t=new DisconnectReader(e);break;default:console.error("No support for deserializing ".concat(r," messages"))}return t},readWSBuffer=function(e,t){var r=new Uint8Array(e),n=new StreamReader(r),i=n.readByte(),o=Header.parse(i),a=getReaderByHeader(o);return a&&a.read(n,r.length-1,t),a},WechatSSEClient=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=promiseWithResolvers(),n=r.resolve,i=r.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")))n(ok());else{var r=JSON.parse(e.data),i=r.code,o=r.message;n(fail(i,o))}},fail:function(t){var r=t.errMsg,i=t.errno;o.warn(Log.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:r,errno:i})),n(fail(-1,t.errMsg))},complete:function(){o.debug(Log.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return a.onChunkReceived((function(e){var r=BinaryHelper.readUTF(new Uint8Array(e.data));o.debug(Log.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(r)),t.onRawContent(r)})),i}}),t}(SSEClient),isFromUniapp$5=isFromUniappEnv(),createFunc$6=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return wx[e].apply(wx,__spreadArray([],__read(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},storage$6={setItem:createFunc$6("setStorageSync"),getItem:createFunc$6("getStorageSync"),removeItem:createFunc$6("removeStorageSync"),clear:createFunc$6("clearStorageSync")},callback$6=null,listener$6=function(e){var t=e.isConnected,r=e.networkType;callback$6({status:t,type:r})};function setNetworkStatusListener$6(e){callback$6=e,wx.onNetworkStatusChange(listener$6)}function removeNetworkStatusListener$6(){wx.offNetworkStatusChange(listener$6),callback$6=null}var wechat={tag:"wechat",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||HTTP_TIMEOUT,n=e.headers,i=e.query,o=e.body,a=appendUrl(e.url,i);return new Promise((function(e){wx.request({url:a,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:storage$6,sessionStorage:storage$6,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:isFromUniapp$5,createWebSocket:function(e,t){var r=wx.connectSocket({url:e,protocols:t});return Promise.resolve(ok({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),r.close()}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(NetworkType.UNKONWN)}})}))},setNetworkStatusListener:setNetworkStatusListener$6,removeNetworkStatusListener:removeNetworkStatusListener$6,createSSEClient:function(e){return ok(new WechatSSEClient(e))},get runtimeInfo(){return{type:wechat.tag,version:"Unknown"}}},isFromUniapp$4=isFromUniappEnv(),createFunc$5=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var n=my[e]({key:t[0]}).data;return n?JSON.stringify(n):n}catch(e){}}},storage$5={setItem:createFunc$5("setStorageSync"),getItem:createFunc$5("getStorageSync"),removeItem:createFunc$5("removeStorageSync"),clear:createFunc$5("clearStorageSync")},callback$5=null,listener$5=function(e){var t=e.isConnected,r=e.networkType;callback$5({status:t,type:r})};function setNetworkStatusListener$5(e){callback$5=e,my.onNetworkStatusChange(listener$5)}function removeNetworkStatusListener$5(){my.offNetworkStatusChange(listener$5),callback$5=null}var alipay={tag:"alipay",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||HTTP_TIMEOUT,n=e.headers,i=e.query,o=e.body,a=appendUrl(e.url,i),s=e.dataType||"json";return new Promise((function(e){my.request({url:a,method:t,headers:n,timeout:r,data:o,dataType:s,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:storage$5,sessionStorage:storage$5,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:isFromUniapp$4,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return Promise.resolve(ok({id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}))},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(NetworkType.UNKONWN)}})}))},setNetworkStatusListener:setNetworkStatusListener$5,removeNetworkStatusListener:removeNetworkStatusListener$5,createSSEClient:function(e){return fail(exports.ErrorCode.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:alipay.tag,version:"Unknown"}}},isFromUniapp$3=isFromUniappEnv(),createFunc$4=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return tt[e].apply(tt,__spreadArray([],__read(t),!1))}catch(e){}}},storage$4={setItem:createFunc$4("setStorageSync"),getItem:createFunc$4("getStorageSync"),removeItem:createFunc$4("removeStorageSync"),clear:createFunc$4("clearStorageSync")},callback$4=null,listener$4=function(e){var t=e.isConnected,r=e.networkType;callback$4({status:t,type:r})};function setNetworkStatusListener$4(e){callback$4=e,tt.onNetworkStatusChange(listener$4)}function removeNetworkStatusListener$4(){tt.offNetworkStatusChange(listener$4),callback$4=null}var toutiao={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:isFromUniapp$3,localStorage:storage$4,sessionStorage:storage$4,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){return new Promise((function(r){var n=tt.connectSocket({url:e,protocols:t,fail:function(e){return r(fail(exports.ErrorCode.RC_SOCKET_DISCONNECTED,e.errMsg))}});r(ok({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){n.close(),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){tt.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(NetworkType.UNKONWN)}})}))},setNetworkStatusListener:setNetworkStatusListener$4,removeNetworkStatusListener:removeNetworkStatusListener$4,createSSEClient:function(e){return fail(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:toutiao.tag,version:"Unknown"}}},isFromUniapp$2=isFromUniappEnv(),createFunc$3=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return swan[e].apply(swan,__spreadArray([],__read(t),!1))}catch(e){}}},storage$3={setItem:createFunc$3("setStorageSync"),getItem:createFunc$3("getStorageSync"),removeItem:createFunc$3("removeStorageSync"),clear:createFunc$3("clearStorageSync")},callback$3=null,listener$3=function(e){var t=e.isConnected,r=e.networkType;callback$3({status:t,type:r})};function setNetworkStatusListener$3(e){callback$3=e,swan.onNetworkStatusChange(listener$3)}function removeNetworkStatusListener$3(){swan.offNetworkStatusChange(listener$3),callback$3=null}var baidu={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:isFromUniapp$2,localStorage:storage$3,sessionStorage:storage$3,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=swan.connectSocket({url:e,protocols:t});return Promise.resolve(ok({id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(NetworkType.UNKONWN)}})}))]}))}))},setNetworkStatusListener:setNetworkStatusListener$3,removeNetworkStatusListener:removeNetworkStatusListener$3,createSSEClient:function(e){return fail(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:baidu.tag,version:"Unknown"}}},isFromUniapp$1=isFromUniappEnv(),createFunc$2=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return jd[e].apply(jd,__spreadArray([],__read(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},storage$2={setItem:createFunc$2("setStorageSync"),getItem:createFunc$2("getStorageSync"),removeItem:createFunc$2("removeStorageSync"),clear:createFunc$2("clearStorageSync")},callback$2=null,listener$2=function(e){var t=e.isConnected,r=e.networkType;callback$2({status:t,type:r})};function setNetworkStatusListener$2(e){callback$2=e,jd.onNetworkStatusChange(listener$2)}function removeNetworkStatusListener$2(){jd.offNetworkStatusChange(listener$2),callback$2=null}var jingdong={tag:"jingdong",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||HTTP_TIMEOUT,n=e.headers,i=e.query,o=e.body,a=appendUrl(e.url,i);return new Promise((function(e){jd.request({url:a,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:storage$2,sessionStorage:storage$2,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:isFromUniapp$1,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),Promise.resolve(ok({id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(NetworkType.UNKONWN)}})}))},setNetworkStatusListener:setNetworkStatusListener$2,removeNetworkStatusListener:removeNetworkStatusListener$2,createSSEClient:function(e){return fail(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:jingdong.tag,version:"Unknown"}}},isFromUniapp=isFromUniappEnv(),createFunc$1=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return ks[e].apply(ks,__spreadArray([],__read(t),!1))}catch(e){}}},storage$1={setItem:createFunc$1("setStorageSync"),getItem:createFunc$1("getStorageSync"),removeItem:createFunc$1("removeStorageSync"),clear:createFunc$1("clearStorageSync")},callback$1=null,listener$1=function(e){var t=e.isConnected,r=e.networkType;callback$1({status:t,type:r})};function setNetworkStatusListener$1(e){callback$1=e,ks.onNetworkStatusChange(listener$1)}function removeNetworkStatusListener$1(){ks.offNetworkStatusChange(listener$1),callback$1=null}var kuaishou={tag:"kuaishou",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:isFromUniapp,localStorage:storage$1,sessionStorage:storage$1,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 r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=ks.connectSocket({url:e,protocols:t});return Promise.resolve(ok({id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){ks.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(NetworkType.UNKONWN)}})}))},setNetworkStatusListener:setNetworkStatusListener$1,removeNetworkStatusListener:removeNetworkStatusListener$1,createSSEClient:function(e){return fail(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:kuaishou.tag,version:"Unknown"}}},createFunc=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return uni[e].apply(uni,__spreadArray([],__read(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},storage={setItem:createFunc("setStorageSync"),getItem:createFunc("getStorageSync"),removeItem:createFunc("removeStorageSync"),clear:createFunc("clearStorageSync")},callback=null,listener=function(e){var t=e.isConnected,r=e.networkType;callback({status:t,type:r})};function setNetworkStatusListener(e){callback=e,uni.onNetworkStatusChange(listener)}function removeNetworkStatusListener(){uni.offNetworkStatusChange(listener),callback=null}var appPlus={tag:"uniapp",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||HTTP_TIMEOUT,n=e.headers,i=e.query,o=e.body,a=appendUrl(e.url,i);return new Promise((function(e){uni.request({url:a,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:storage,sessionStorage:storage,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,r=e.osName;return["app","app-plus"].includes(t)&&r||""},isFromUniapp:!0,createWebSocket:function(e,t){var r={complete:function(){},url:e,protocols:t},n=uni.connectSocket(r);return Promise.resolve(ok({id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(NetworkType.UNKONWN)}})}))},setNetworkStatusListener:setNetworkStatusListener,removeNetworkStatusListener:removeNetworkStatusListener,createSSEClient:function(e){return fail(exports.ErrorCode.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,r=e.deviceModel,n=e.deviceBrand,i=e.osVersion,o="android"===e.osName?t:i;return"".concat(n||"","|").concat(r||"","|").concat(o||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:appPlus.tag,version:"Unknown"}}},uniapp=function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return appPlus;case"mp-jd":return jingdong;case"mp-baidu":return baidu;case"mp-toutiao":return toutiao;case"mp-alipay":return alipay;case"mp-weixin":return wechat;case"mp-kuaishou":return kuaishou;default:return browser}},isMiniPrograme=function(e){return e&&e.request&&e.getSystemInfo},runtime="undefined"!=typeof uni&&isMiniPrograme(uni)?uniapp():"undefined"!=typeof jd&&isMiniPrograme(jd)?jingdong:"undefined"!=typeof my&&isMiniPrograme(my)?alipay:"undefined"!=typeof tt&&isMiniPrograme(tt)?toutiao:"undefined"!=typeof ks&&isMiniPrograme(ks)?kuaishou:"undefined"!=typeof swan&&isMiniPrograme(swan)?baidu:"undefined"!=typeof wx&&isMiniPrograme(wx)?wechat:browser,commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},protobuf_min={exports:{}};
|
|
17
|
+
/*!
|
|
18
|
+
* protobuf.js v7.5.4 (c) 2016, daniel wirtz
|
|
19
|
+
* compiled fri, 15 aug 2025 23:28:55 utc
|
|
20
|
+
* licensed under the bsd-3-clause license
|
|
21
|
+
* see: https://github.com/dcodeio/protobuf.js for details
|
|
22
|
+
*/
|
|
23
|
+
(function(module){!function(g){var r,e,i;r={1:[function(e,t,r){t.exports=function(e,t){for(var r=Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,a){r[n]=function(e){if(o)if(o=!1,e)a(e);else{for(var t=Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){o&&(o=!1,a(e))}}))}},{}],2:[function(e,t,r){r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;1<--t%4&&"="==(e[0|t]||"");)++r;return Math.ceil(3*e.length)/4-r};for(var n=Array(64),i=Array(123),o=0;o<64;)i[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,r){for(var i,o=null,a=[],s=0,u=0;t<r;){var l=e[t++];switch(u){case 0:a[s++]=n[l>>2],i=(3&l)<<4,u=1;break;case 1:a[s++]=n[i|l>>4],i=(15&l)<<2,u=2;break;case 2:a[s++]=n[i|l>>6],a[s++]=n[63&l],u=0}8191<s&&((o=o||[]).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=n[i],a[s++]=61,1===u&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";r.decode=function(e,t,r){for(var n,o=r,s=0,u=0;u<e.length;){var l=e.charCodeAt(u++);if(61==l&&1<s)break;if((l=i[l])===g)throw Error(a);switch(s){case 0:n=l,s=1;break;case 1:t[r++]=n<<2|(48&l)>>4,n=l,s=2;break;case 2:t[r++]=(15&n)<<4|(60&l)>>2,n=l,s=3;break;case 3:t[r++]=(3&n)<<6|l,s=0}}if(1===s)throw Error(a);return r-o},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},{}],3:[function(e,t,r){(t.exports=function e(t,r){"string"==typeof t&&(r=t,t=g);var n=[];function i(t){if("string"!=typeof t){var r=o();if(e.verbose&&console.log("codegen: "+r),r="return "+r,t){for(var a=Object.keys(t),s=Array(a.length+1),u=Array(a.length),l=0;l<a.length;)s[l]=a[l],u[l]=t[a[l++]];return s[l]=r,Function.apply(null,s).apply(null,u)}return Function(r)()}for(var c=Array(arguments.length-1),_=0;_<c.length;)c[_]=arguments[++_];if(_=0,t=t.replace(/%([%dfijs])/g,(function(e,t){var r=c[_++];switch(t){case"d":case"f":return""+ +(""+r);case"i":return""+Math.floor(r);case"j":return JSON.stringify(r);case"s":return""+r}return"%"})),_!==c.length)throw Error("parameter count mismatch");return n.push(t),i}function o(e){return"function "+(e||r||"")+"("+(t&&t.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return i.toString=o,i}).verbose=!1},{}],4:[function(e,t,r){function n(){this.t={}}(t.exports=n).prototype.on=function(e,t,r){return(this.t[e]||(this.t[e]=[])).push({fn:t,ctx:r||this}),this},n.prototype.off=function(e,t){if(e===g)this.t={};else if(t===g)this.t[e]=[];else for(var r=this.t[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},n.prototype.emit=function(e){var t=this.t[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},{}],5:[function(e,t,r){t.exports=o;var n=e(1),i=e(7)("fs");function o(e,t,r){return t="function"==typeof t?(r=t,{}):t||{},r?!t.xhr&&i&&i.readFile?i.readFile(e,(function(n,i){return n&&"undefined"!=typeof XMLHttpRequest?o.xhr(e,t,r):n?r(n):r(null,t.binary?i:i.toString("utf8"))})):o.xhr(e,t,r):n(o,this,e,t)}o.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4!==n.readyState)return g;if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){if(!(e=n.response))for(var e=[],i=0;i<n.responseText.length;++i)e.push(255&n.responseText.charCodeAt(i));return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},{1:1,7:7}],6:[function(e,t,r){function n(e){function t(e,t,r,n){var i=t<0?1:0;e(0===(t=i?-t:t)?0<1/t?0:2147483648:isNaN(t)?2143289344:34028234663852886e22<t?(i<<31|2139095040)>>>0:t<11754943508222875e-54?(i<<31|Math.round(t/1401298464324817e-60))>>>0:(i<<31|127+(e=Math.floor(Math.log(t)/Math.LN2))<<23|8388607&Math.round(t*Math.pow(2,-e)*8388608))>>>0,r,n)}function r(e,t,r){return t=2*((e=e(t,r))>>31)+1,r=e>>>23&255,e&=8388607,255==r?e?NaN:1/0*t:0==r?1401298464324817e-60*t*e:t*Math.pow(2,r-150)*(8388608+e)}function n(e,t,r){_[0]=e,t[r]=d[0],t[r+1]=d[1],t[r+2]=d[2],t[r+3]=d[3]}function u(e,t,r){_[0]=e,t[r]=d[3],t[r+1]=d[2],t[r+2]=d[1],t[r+3]=d[0]}function l(e,t){return d[0]=e[t],d[1]=e[t+1],d[2]=e[t+2],d[3]=e[t+3],_[0]}function c(e,t){return d[3]=e[t],d[2]=e[t+1],d[1]=e[t+2],d[0]=e[t+3],_[0]}var _,d,p,g,f;function h(e,t,r,n,i,o){var a,s=n<0?1:0;0===(n=s?-n:n)?(e(0,i,o+t),e(0<1/n?0:2147483648,i,o+r)):isNaN(n)?(e(0,i,o+t),e(2146959360,i,o+r)):17976931348623157e292<n?(e(0,i,o+t),e((s<<31|2146435072)>>>0,i,o+r)):n<22250738585072014e-324?(e((a=n/5e-324)>>>0,i,o+t),e((s<<31|a/4294967296)>>>0,i,o+r)):(e(4503599627370496*(a=n*Math.pow(2,-(n=1024===(n=Math.floor(Math.log(n)/Math.LN2))?1023:n)))>>>0,i,o+t),e((s<<31|n+1023<<20|1048576*a&1048575)>>>0,i,o+r))}function E(e,t,r,n,i){return t=e(n,i+t),n=2*((e=e(n,i+r))>>31)+1,r=4294967296*(1048575&e)+t,2047==(i=e>>>20&2047)?r?NaN:1/0*n:0==i?5e-324*n*r:n*Math.pow(2,i-1075)*(r+4503599627370496)}function T(e,t,r){p[0]=e,t[r]=g[0],t[r+1]=g[1],t[r+2]=g[2],t[r+3]=g[3],t[r+4]=g[4],t[r+5]=g[5],t[r+6]=g[6],t[r+7]=g[7]}function b(e,t,r){p[0]=e,t[r]=g[7],t[r+1]=g[6],t[r+2]=g[5],t[r+3]=g[4],t[r+4]=g[3],t[r+5]=g[2],t[r+6]=g[1],t[r+7]=g[0]}function v(e,t){return g[0]=e[t],g[1]=e[t+1],g[2]=e[t+2],g[3]=e[t+3],g[4]=e[t+4],g[5]=e[t+5],g[6]=e[t+6],g[7]=e[t+7],p[0]}function R(e,t){return g[7]=e[t],g[6]=e[t+1],g[5]=e[t+2],g[4]=e[t+3],g[3]=e[t+4],g[2]=e[t+5],g[1]=e[t+6],g[0]=e[t+7],p[0]}return"undefined"!=typeof Float32Array?(_=new Float32Array([-0]),f=128===(d=new Uint8Array(_.buffer))[3],e.writeFloatLE=f?n:u,e.writeFloatBE=f?u:n,e.readFloatLE=f?l:c,e.readFloatBE=f?c:l):(e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,o),e.readFloatLE=r.bind(null,a),e.readFloatBE=r.bind(null,s)),"undefined"!=typeof Float64Array?(p=new Float64Array([-0]),f=128===(g=new Uint8Array(p.buffer))[7],e.writeDoubleLE=f?T:b,e.writeDoubleBE=f?b:T,e.readDoubleLE=f?v:R,e.readDoubleBE=f?R:v):(e.writeDoubleLE=h.bind(null,i,0,4),e.writeDoubleBE=h.bind(null,o,4,0),e.readDoubleLE=E.bind(null,a,0,4),e.readDoubleBE=E.bind(null,s,4,0)),e}function i(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}t.exports=n(n)},{}],7:[function(t,i,n){function r(t){try{var i=eval("require")(t);if(i&&(i.length||Object.keys(i).length))return i}catch(t){}return null}i.exports=r},{}],8:[function(e,t,r){var n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e);e="",r&&(e=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?0<i&&".."!==t[i-1]?t.splice(--i,2):r?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return e+t.join("/")};r.resolve=function(e,t,r){return r||(t=i(t)),!n(t)&&(e=(e=r?e:i(e)).replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t}},{}],9:[function(e,t,r){t.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,a=n;return function(r){return r<1||i<r?e(r):(n<a+r&&(o=e(n),a=0),r=t.call(o,a,a+=r),7&a&&(a=1+(7|a)),r)}}},{}],10:[function(e,t,r){r.length=function(e){for(var t,r=0,n=0;n<e.length;++n)(t=e.charCodeAt(n))<128?r+=1:t<2048?r+=2:55296==(64512&t)&&56320==(64512&e.charCodeAt(n+1))?(++n,r+=4):r+=3;return r},r.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,o=[],a=0;t<r;)(n=e[t++])<128?o[a++]=n:191<n&&n<224?o[a++]=(31&n)<<6|63&e[t++]:239<n&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(n>>10),o[a++]=56320+(1023&n)):o[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],8191<a&&((i=i||[]).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},r.write=function(e,t,r){for(var n,i,o=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(a+1)))?(++a,t[r++]=(n=65536+((1023&n)<<10)+(1023&i))>>18|240,t[r++]=n>>12&63|128):t[r++]=n>>12|224,t[r++]=n>>6&63|128),t[r++]=63&n|128);return r-o}},{}],11:[function(e,t,r){var n=e(14),i=e(33);function o(e,t,r,i){var o=!1;if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(d%s){",i);for(var a=t.resolvedType.values,s=Object.keys(a),u=0;u<s.length;++u)a[s[u]]!==t.typeDefault||o||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',i,i,i),t.repeated||e("break"),o=!0),e("case%j:",s[u])("case %i:",a[s[u]])("m%s=%j",i,a[s[u]])("break");e("}")}else e('if(typeof d%s!=="object")',i)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",i,r,i);else{var l=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",i,i);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",i,i);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",i,i);break;case"uint64":l=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,l)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,l?"true":"");break;case"bytes":e('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length >= 0)",i)("m%s=d%s",i,i);break;case"string":e("m%s=String(d%s)",i,i);break;case"bool":e("m%s=Boolean(d%s)",i,i)}}return e}function a(e,t,r,i){if(t.resolvedType)t.resolvedType instanceof n?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",i,r,i,i,r,i,i):e("d%s=types[%i].toObject(m%s,o)",i,r,i);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",i,i,i,i,o?"true":"",i);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",i,i,i,i,i);break;default:e("d%s=m%s",i,i)}}return e}r.fromObject=function(e){var t=e.fieldsArray,r=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var a=0;a<t.length;++a){var s=t[a].resolve(),u=i.safeProp(s.name);s.map?(r("if(d%s){",u)('if(typeof d%s!=="object")',u)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",u)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",u),o(r,s,a,u+"[ks[i]]")("}")("}")):s.repeated?(r("if(d%s){",u)("if(!Array.isArray(d%s))",u)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",u)("for(var i=0;i<d%s.length;++i){",u),o(r,s,a,u+"[i]")("}")("}")):(s.resolvedType instanceof n||r("if(d%s!=null){",u),o(r,s,a,u),s.resolvedType instanceof n||r("}"))}return r("return m")},r.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var r=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),o=[],s=[],u=[],l=0;l<t.length;++l)t[l].partOf||(t[l].resolve().repeated?o:t[l].map?s:u).push(t[l]);if(o.length){for(r("if(o.arrays||o.defaults){"),l=0;l<o.length;++l)r("d%s=[]",i.safeProp(o[l].name));r("}")}if(s.length){for(r("if(o.objects||o.defaults){"),l=0;l<s.length;++l)r("d%s={}",i.safeProp(s[l].name));r("}")}if(u.length){for(r("if(o.defaults){"),l=0;l<u.length;++l){var c,_=u[l],d=i.safeProp(_.name);_.resolvedType instanceof n?r("d%s=o.enums===String?%j:%j",d,_.resolvedType.valuesById[_.typeDefault],_.typeDefault):_.long?r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",_.typeDefault.low,_.typeDefault.high,_.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",d)("}else")("d%s=o.longs===String?%j:%i",d,_.typeDefault.toString(),_.typeDefault.toNumber()):_.bytes?(c="["+Array.prototype.slice.call(_.typeDefault).join(",")+"]",r("if(o.bytes===String)d%s=%j",d,String.fromCharCode.apply(String,_.typeDefault))("else{")("d%s=%s",d,c)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",d,d)("}")):r("d%s=%j",d,_.typeDefault)}r("}")}var p=!1;for(l=0;l<t.length;++l){_=t[l];var g=e.i.indexOf(_);d=i.safeProp(_.name),_.map?(p||(p=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",d,d)("d%s={}",d)("for(var j=0;j<ks2.length;++j){"),a(r,_,g,d+"[ks2[j]]")("}")):_.repeated?(r("if(m%s&&m%s.length){",d,d)("d%s=[]",d)("for(var j=0;j<m%s.length;++j){",d),a(r,_,g,d+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",d,_.name),a(r,_,g,d),_.partOf&&r("if(o.oneofs)")("d%s=%j",i.safeProp(_.partOf.name),_.name)),r("}")}return r("return d")}},{14:14,33:33}],12:[function(e,t,r){t.exports=function(e){for(var t=o.codegen(["r","l","e"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),r=0;r<e.fieldsArray.length;++r){var a=e.i[r].resolve(),s=a.resolvedType instanceof n?"int32":a.type,u="m"+o.safeProp(a.name);t("case %i: {",a.id),a.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),i.defaults[a.keyType]!==g?t("k=%j",i.defaults[a.keyType]):t("k=null"),i.defaults[s]!==g?t("value=%j",i.defaults[s]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),i.basic[s]===g?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",s),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),i.long[a.keyType]!==g?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),i.packed[s]!==g&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,s)("}else"),i.basic[s]===g?t(a.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,s)):i.basic[s]===g?t(a.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,s),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e.i.length;++r){var l=e.i[r];l.required&&t("if(!m.hasOwnProperty(%j))",l.name)("throw util.ProtocolError(%j,{instance:m})","missing required '"+l.name+"'")}return t("return m")};var n=e(14),i=e(32),o=e(33)},{14:14,32:32,33:33}],13:[function(e,t,r){t.exports=function(e){for(var t,r=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(o.compareFieldsById),u=0;u<s.length;++u){var l=s[u].resolve(),c=e.i.indexOf(l),_=l.resolvedType instanceof n?"int32":l.type,d=i.basic[_];t="m"+o.safeProp(l.name),l.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,l.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(l.id<<3|2)>>>0,8|i.mapKey[l.keyType],l.keyType),d===g?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",c,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|d,_,t),r("}")("}")):l.repeated?(r("if(%s!=null&&%s.length){",t,t),l.packed&&i.packed[_]!==g?r("w.uint32(%i).fork()",(l.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",_,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),d===g?a(r,l,c,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(l.id<<3|d)>>>0,_,t)),r("}")):(l.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,l.name),d===g?a(r,l,c,t):r("w.uint32(%i).%s(%s)",(l.id<<3|d)>>>0,_,t))}return r("return w")};var n=e(14),i=e(32),o=e(33);function a(e,t,r,n){t.delimited?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},{14:14,32:32,33:33}],14:[function(e,t,r){t.exports=a;var n=e(22),i=(((a.prototype=Object.create(n.prototype)).constructor=a).className="Enum",e(21)),o=e(33);function a(e,t,r,i,o,a){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.valuesOptions=a,this.n={},this.reserved=g,t)for(var s=Object.keys(t),u=0;u<s.length;++u)"number"==typeof t[s[u]]&&(this.valuesById[this.values[s[u]]=t[s[u]]]=s[u])}a.prototype.r=function(e){return e=this.e||e,n.prototype.r.call(this,e),Object.keys(this.values).forEach((e=>{var t=Object.assign({},this.o);this.n[e]=Object.assign(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)})),this},a.fromJSON=function(e,t){return(e=new a(e,t.values,t.options,t.comment,t.comments)).reserved=t.reserved,t.edition&&(e.e=t.edition),e.u="proto3",e},a.prototype.toJSON=function(e){return e=!!e&&!!e.keepComments,o.toObject(["edition",this.h(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:g,"comment",e?this.comment:g,"comments",e?this.comments:g])},a.prototype.add=function(e,t,r,n){if(!o.isString(e))throw TypeError("name must be a string");if(!o.isInteger(t))throw TypeError("id must be an integer");if(this.values[e]!==g)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[t]!==g){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return n&&(this.valuesOptions===g&&(this.valuesOptions={}),this.valuesOptions[e]=n||null),this.comments[e]=r||null,this},a.prototype.remove=function(e){if(!o.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},a.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},{21:21,22:22,33:33}],15:[function(e,t,r){t.exports=l;var n,i=e(22),o=(((l.prototype=Object.create(i.prototype)).constructor=l).className="Field",e(14)),a=e(32),s=e(33),u=/^required|optional|repeated$/;function l(e,t,r,n,o,l,c){if(s.isObject(n)?(c=o,l=n,n=o=g):s.isObject(o)&&(c=l,l=o,o=g),i.call(this,e,l),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(r))throw TypeError("type must be a string");if(n!==g&&!u.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(o!==g&&!s.isString(o))throw TypeError("extend must be a string");this.rule=(n="proto3_optional"===n?"optional":n)&&"optional"!==n?n:g,this.type=r,this.id=t,this.extend=o||g,this.repeated="repeated"===n,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&a.long[r]!==g,this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=c}l.fromJSON=function(e,t){return e=new l(e,t.id,t.type,t.rule,t.extend,t.options,t.comment),t.edition&&(e.e=t.edition),e.u="proto3",e},Object.defineProperty(l.prototype,"required",{get:function(){return"LEGACY_REQUIRED"===this.o.field_presence}}),Object.defineProperty(l.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(l.prototype,"delimited",{get:function(){return this.resolvedType instanceof n&&"DELIMITED"===this.o.message_encoding}}),Object.defineProperty(l.prototype,"packed",{get:function(){return"PACKED"===this.o.repeated_field_encoding}}),Object.defineProperty(l.prototype,"hasPresence",{get:function(){return!this.repeated&&!this.map&&(this.partOf||this.declaringField||this.extensionField||"IMPLICIT"!==this.o.field_presence)}}),l.prototype.setOption=function(e,t,r){return i.prototype.setOption.call(this,e,t,r)},l.prototype.toJSON=function(e){return e=!!e&&!!e.keepComments,s.toObject(["edition",this.h(),"rule","optional"!==this.rule&&this.rule||g,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",e?this.comment:g])},l.prototype.resolve=function(){var e;return this.resolved?this:((this.typeDefault=a.defaults[this.type])===g?(this.resolvedType=(this.declaringField||this).parent.lookupTypeOrEnum(this.type),this.resolvedType instanceof n?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed===g||!this.resolvedType||this.resolvedType instanceof o||delete this.options.packed,Object.keys(this.options).length||(this.options=g)),this.long?(this.typeDefault=s.Long.fromNumber(this.typeDefault,"u"==(this.type[0]||"")),Object.freeze&&Object.freeze(this.typeDefault)):this.bytes&&"string"==typeof this.typeDefault&&(s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e),this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof n&&(this.parent.ctor.prototype[this.name]=this.defaultValue),i.prototype.resolve.call(this))},l.prototype.f=function(e){var t;return"proto2"!==e&&"proto3"!==e?{}:(e={},"required"===this.rule&&(e.field_presence="LEGACY_REQUIRED"),this.parent&&a.defaults[this.type]===g&&(t=this.parent.get(this.type.split(".").pop()))&&t instanceof n&&t.group&&(e.message_encoding="DELIMITED"),!0===this.getOption("packed")?e.repeated_field_encoding="PACKED":!1===this.getOption("packed")&&(e.repeated_field_encoding="EXPANDED"),e)},l.prototype.r=function(e){return i.prototype.r.call(this,this.e||e)},l.d=function(e,t,r,n){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"==typeof t&&(t=s.decorateEnum(t).name),function(i,o){s.decorateType(i.constructor).add(new l(o,e,t,r,{default:n}))}},l.c=function(e){n=e}},{14:14,22:22,32:32,33:33}],16:[function(e,t,r){var n=t.exports=e(17);n.build="light",n.load=function(e,t,r){return(t="function"==typeof t?(r=t,new n.Root):t||new n.Root).load(e,r)},n.loadSync=function(e,t){return(t=t||new n.Root).loadSync(e)},n.encoder=e(13),n.decoder=e(12),n.verifier=e(36),n.converter=e(11),n.ReflectionObject=e(22),n.Namespace=e(21),n.Root=e(26),n.Enum=e(14),n.Type=e(31),n.Field=e(15),n.OneOf=e(23),n.MapField=e(18),n.Service=e(30),n.Method=e(20),n.Message=e(19),n.wrappers=e(37),n.types=e(32),n.util=e(33),n.ReflectionObject.c(n.Root),n.Namespace.c(n.Type,n.Service,n.Enum),n.Root.c(n.Type),n.Field.c(n.Type)},{11:11,12:12,13:13,14:14,15:15,17:17,18:18,19:19,20:20,21:21,22:22,23:23,26:26,30:30,31:31,32:32,33:33,36:36,37:37}],17:[function(e,t,r){var n=r;function i(){n.util.c(),n.Writer.c(n.BufferWriter),n.Reader.c(n.BufferReader)}n.build="minimal",n.Writer=e(38),n.BufferWriter=e(39),n.Reader=e(24),n.BufferReader=e(25),n.util=e(35),n.rpc=e(28),n.roots=e(27),n.configure=i,i()},{24:24,25:25,27:27,28:28,35:35,38:38,39:39}],18:[function(e,t,r){t.exports=a;var n=e(15),i=(((a.prototype=Object.create(n.prototype)).constructor=a).className="MapField",e(32)),o=e(33);function a(e,t,r,i,a,s){if(n.call(this,e,t,i,g,g,a,s),!o.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){return e=!!e&&!!e.keepComments,o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",e?this.comment:g])},a.prototype.resolve=function(){if(this.resolved)return this;if(i.mapKey[this.keyType]===g)throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,r){return"function"==typeof r?r=o.decorateType(r).name:r&&"object"==typeof r&&(r=o.decorateEnum(r).name),function(n,i){o.decorateType(n.constructor).add(new a(i,e,t,r))}}},{15:15,32:32,33:33}],19:[function(e,t,r){t.exports=i;var n=e(35);function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},{35:35}],20:[function(e,t,r){t.exports=o;var n=e(22),i=(((o.prototype=Object.create(n.prototype)).constructor=o).className="Method",e(33));function o(e,t,r,o,a,s,u,l,c){if(i.isObject(a)?(u=a,a=s=g):i.isObject(s)&&(u=s,s=g),t!==g&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(r))throw TypeError("requestType must be a string");if(!i.isString(o))throw TypeError("responseType must be a string");n.call(this,e,u),this.type=t||"rpc",this.requestType=r,this.requestStream=!!a||g,this.responseType=o,this.responseStream=!!s||g,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=l,this.parsedOptions=c}o.fromJSON=function(e,t){return new o(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},o.prototype.toJSON=function(e){return e=!!e&&!!e.keepComments,i.toObject(["type","rpc"!==this.type&&this.type||g,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",e?this.comment:g,"parsedOptions",this.parsedOptions])},o.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},{22:22,33:33}],21:[function(e,t,r){t.exports=_;var n,i,o,a=e(22),s=(((_.prototype=Object.create(a.prototype)).constructor=_).className="Namespace",e(15)),u=e(33),l=e(23);function c(e,t){if(!e||!e.length)return g;for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}function _(e,t){a.call(this,e,t),this.nested=g,this.a=null,this.l={},this.v=!0,this.b=!0}function d(e){e.a=null,e.l={};for(var t=e;t=t.parent;)t.l={};return e}_.fromJSON=function(e,t){return new _(e,t.options).addJSON(t.nested)},_.arrayToJSON=c,_.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},_.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(_.prototype,"nestedArray",{get:function(){return this.a||(this.a=u.toArray(this.nested))}}),_.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",c(this.nestedArray,e)])},_.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),a=0;a<r.length;++a)t=e[r[a]],this.add((t.fields!==g?n:t.values!==g?o:t.methods!==g?i:t.id!==g?s:_).fromJSON(r[a],t));return this},_.prototype.get=function(e){return this.nested&&this.nested[e]||null},_.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof o)return this.nested[e].values;throw Error("no such enum: "+e)},_.prototype.add=function(e){if(!(e instanceof s&&e.extend!==g||e instanceof n||e instanceof l||e instanceof o||e instanceof i||e instanceof _))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof _&&e instanceof _)||t instanceof n||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,a=0;a<r.length;++a)e.add(r[a]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};this.nested[e.name]=e,this instanceof n||this instanceof i||this instanceof o||this instanceof s||e.e||(e.e=e.u),this.v=!0,this.b=!0;for(var u=this;u=u.parent;)u.v=!0,u.b=!0;return e.onAdd(this),d(this)},_.prototype.remove=function(e){if(!(e instanceof a))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=g),e.onRemove(this),d(this)},_.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;0<e.length;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof _))throw Error("path conflicts with non-namespace objects")}else r.add(r=new _(n))}return t&&r.addJSON(t),r},_.prototype.resolveAll=function(){if(this.b){this.p(this.e);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof _?e[t++].resolveAll():e[t++].resolve();this.b=!1}return this},_.prototype.p=function(e){return this.v&&(this.v=!1,e=this.e||e,a.prototype.p.call(this,e),this.nestedArray.forEach((t=>{t.p(e)}))),this},_.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=g):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;var n=e.join(".");if(""===e[0])return this.root.lookup(e.slice(1),t);var i=this.root.y&&this.root.y["."+n];if(i&&(!t||~t.indexOf(i.constructor)))return i;if((i=this.w(e,n))&&(!t||~t.indexOf(i.constructor)))return i;if(!r)for(var o=this;o.parent;){if((i=o.parent.w(e,n))&&(!t||~t.indexOf(i.constructor)))return i;o=o.parent}return null},_.prototype.w=function(e,t){if(Object.prototype.hasOwnProperty.call(this.l,t))return this.l[t];var r=this.get(e[0]),n=null;if(r)1===e.length?n=r:r instanceof _&&(e=e.slice(1),n=r.w(e,e.join(".")));else for(var i=0;i<this.nestedArray.length;++i)this.a[i]instanceof _&&(r=this.a[i].w(e,t))&&(n=r);return this.l[t]=n},_.prototype.lookupType=function(e){var t=this.lookup(e,[n]);if(t)return t;throw Error("no such type: "+e)},_.prototype.lookupEnum=function(e){var t=this.lookup(e,[o]);if(t)return t;throw Error("no such Enum '"+e+"' in "+this)},_.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[n,o]);if(t)return t;throw Error("no such Type or Enum '"+e+"' in "+this)},_.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(t)return t;throw Error("no such Service '"+e+"' in "+this)},_.c=function(e,t,r){n=e,i=t,o=r}},{15:15,22:22,23:23,33:33}],22:[function(e,t,r){(t.exports=l).className="ReflectionObject";const n=e(23);var i,o=e(33),a={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},s={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},u={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function l(e,t){if(!o.isString(e))throw TypeError("name must be a string");if(t&&!o.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.e=null,this.u="proto2",this.o={},this.g=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(l.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),l.prototype.toJSON=function(){throw Error()},l.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1,(e=e.root)instanceof i&&e.j(this)},l.prototype.onRemove=function(e){(e=e.root)instanceof i&&e.O(this),this.parent=null,this.resolved=!1},l.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},l.prototype.p=function(e){return this.r(this.e||e)},l.prototype.r=function(e){if(!this.g){var t={};if(!e)throw Error("Unknown edition for "+this.fullName);var r=Object.assign(this.options?Object.assign({},this.options.features):{},this.f(e));if(this.e){if("proto2"===e)t=Object.assign({},s);else if("proto3"===e)t=Object.assign({},u);else{if("2023"!==e)throw Error("Unknown edition: "+e);t=Object.assign({},a)}this.o=Object.assign(t,r||{})}else{if(this.partOf instanceof n)e=Object.assign({},this.partOf.o),this.o=Object.assign(e,r||{});else if(!this.declaringField){if(!this.parent)throw Error("Unable to find a parent for "+this.fullName);t=Object.assign({},this.parent.o),this.o=Object.assign(t,r||{})}this.extensionField&&(this.extensionField.o=this.o)}this.g=!0}},l.prototype.f=function(){return{}},l.prototype.getOption=function(e){return this.options?this.options[e]:g},l.prototype.setOption=function(e,t,r){return this.options||(this.options={}),/^features\./.test(e)?o.setProperty(this.options,e,t,r):r&&this.options[e]!==g||(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this},l.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n,i,a=this.parsedOptions;return r?(n=a.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)})))?(i=n[e],o.setProperty(i,r,t)):((n={})[e]=o.setProperty({},r,t),a.push(n)):((i={})[e]=t,a.push(i)),this},l.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},l.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},l.prototype.h=function(){return this.e&&"proto3"!==this.e?this.e:g},l.c=function(e){i=e}},{23:23,33:33}],23:[function(e,t,r){t.exports=a;var n=e(22),i=(((a.prototype=Object.create(n.prototype)).constructor=a).className="OneOf",e(15)),o=e(33);function a(e,t,r,i){if(Array.isArray(t)||(r=t,t=g),n.call(this,e,r),t!==g&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){return e=!!e&&!!e.keepComments,o.toObject(["options",this.options,"oneof",this.oneof,"comment",e?this.comment:g])},a.prototype.add=function(e){if(e instanceof i)return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),s(e.partOf=this),this;throw TypeError("field must be a Field")},a.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),-1<(t=this.oneof.indexOf(e.name))&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this).fieldsArray.push(r)}s(this)},a.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},Object.defineProperty(a.prototype,"isProto3Optional",{get:function(){var e;return null!=this.fieldsArray&&1===this.fieldsArray.length&&null!=(e=this.fieldsArray[0]).options&&!0===e.options.proto3_optional}}),a.d=function(){for(var e=Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){o.decorateType(t.constructor).add(new a(r,e)),Object.defineProperty(t,r,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},{15:15,22:22,33:33}],24:[function(e,t,r){t.exports=u;var n,i=e(35),o=i.LongBits,a=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}function l(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new n(e):_(e)})(e)}:_}var c,_="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")};function d(){var e=new o(0,0),t=0;if(!(4<this.len-this.pos)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,4<this.len-this.pos){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function g(){if(this.pos+8>this.len)throw s(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}u.create=l(),u.prototype.k=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128||(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128||!((this.pos+=5)>this.len))))))return c;throw this.pos=this.len,s(this,10)}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return p(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|p(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?(e=i.Buffer)?e.alloc(0):new this.buf.constructor(0):this.k.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u.c=function(e){n=e,u.create=l(),n.c();var t=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return g.call(this)[t](!0)},sfixed64:function(){return g.call(this)[t](!1)}})}},{35:35}],25:[function(e,t,r){t.exports=o;var n=e(24),i=((o.prototype=Object.create(n.prototype)).constructor=o,e(35));function o(e){n.call(this,e)}o.c=function(){i.Buffer&&(o.prototype.k=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o.c()},{24:24,35:35}],26:[function(e,t,r){t.exports=_;var n,i,o,a=e(21),s=(((_.prototype=Object.create(a.prototype)).constructor=_).className="Root",e(15)),u=e(14),l=e(23),c=e(33);function _(e){a.call(this,"",e),this.deferred=[],this.files=[],this.e="proto2",this.y={}}function d(){}_.fromJSON=function(e,t){return t=t||new _,e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()},_.prototype.resolvePath=c.path.resolve,_.prototype.fetch=c.fetch,_.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=g);var a=this;if(!n)return c.asPromise(e,a,t,r);var s=n===d;function u(e,t){if(n){if(s)throw e;t&&t.resolveAll();var r=n;n=null,r(e,t)}}function l(e){var t=e.lastIndexOf("google/protobuf/");return-1<t&&(e=e.substring(t))in o?e:null}function _(e,t){try{if(c.isString(t)&&"{"==(t[0]||"")&&(t=JSON.parse(t)),c.isString(t)){i.filename=e;var n,o=i(t,a,r),_=0;if(o.imports)for(;_<o.imports.length;++_)(n=l(o.imports[_])||a.resolvePath(e,o.imports[_]))&&p(n);if(o.weakImports)for(_=0;_<o.weakImports.length;++_)(n=l(o.weakImports[_])||a.resolvePath(e,o.weakImports[_]))&&p(n,!0)}else a.setOptions(t.options).addJSON(t.nested)}catch(e){u(e)}s||f||u(null,a)}function p(e,t){if(e=l(e)||e,!~a.files.indexOf(e))if(a.files.push(e),e in o)s?_(e,o[e]):(++f,setTimeout((function(){--f,_(e,o[e])})));else if(s){var r;try{r=c.fs.readFileSync(e).toString("utf8")}catch(r){return void(t||u(r))}_(e,r)}else++f,a.fetch(e,(function(r,i){--f,n&&(r?t?f||u(null,a):u(r):_(e,i))}))}var f=0;c.isString(t)&&(t=[t]);for(var h,E=0;E<t.length;++E)(h=a.resolvePath("",t[E]))&&p(h);return s?a.resolveAll():f||u(null,a),a},_.prototype.loadSync=function(e,t){if(c.isNode)return this.load(e,t,d);throw Error("not supported")},_.prototype.resolveAll=function(){if(!this.b)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return a.prototype.resolveAll.call(this)};var p=/^[A-Z]/;function f(e,t){var r,n=t.parent.lookup(t.extend);if(n)return r=new s(t.fullName,t.id,t.type,t.rule,g,t.options),n.get(r.name)||((r.declaringField=t).extensionField=r,n.add(r)),1}_.prototype.j=function(e){if(e instanceof s)e.extend===g||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof u)p.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof l)){if(e instanceof n)for(var t=0;t<this.deferred.length;)f(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this.j(e.a[r]);p.test(e.name)&&(e.parent[e.name]=e)}(e instanceof n||e instanceof u||e instanceof s)&&(this.y[e.fullName]=e)},_.prototype.O=function(e){var t;if(e instanceof s)e.extend!==g&&(e.extensionField?(e.extensionField.parent.remove(e.extensionField),e.extensionField=null):-1<(t=this.deferred.indexOf(e))&&this.deferred.splice(t,1));else if(e instanceof u)p.test(e.name)&&delete e.parent[e.name];else if(e instanceof a){for(var r=0;r<e.nestedArray.length;++r)this.O(e.a[r]);p.test(e.name)&&delete e.parent[e.name]}delete this.y[e.fullName]},_.c=function(e,t,r){n=e,i=t,o=r}},{14:14,15:15,21:21,23:23,33:33}],27:[function(e,t,r){t.exports={}},{}],28:[function(e,t,r){r.Service=e(29)},{29:29}],29:[function(e,t,r){t.exports=i;var n=e(35);function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}((i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i).prototype.rpcCall=function e(t,r,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,i,o);if(!s.rpcImpl)return setTimeout((function(){a(Error("already ended"))}),0),g;try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return s.emit("error",e,t),a(e);if(null===r)return s.end(!0),g;if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)}))}catch(e){return s.emit("error",e,t),setTimeout((function(){a(e)}),0),g}},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{35:35}],30:[function(e,t,r){t.exports=s;var n=e(21),i=(((s.prototype=Object.create(n.prototype)).constructor=s).className="Service",e(20)),o=e(33),a=e(28);function s(e,t){n.call(this,e,t),this.methods={},this.A=null}function u(e){return e.A=null,e}s.fromJSON=function(e,t){var r=new s(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),o=0;o<n.length;++o)r.add(i.fromJSON(n[o],t.methods[n[o]]));return t.nested&&r.addJSON(t.nested),t.edition&&(r.e=t.edition),r.comment=t.comment,r.u="proto3",r},s.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&!!e.keepComments;return o.toObject(["edition",this.h(),"options",t&&t.options||g,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||g,"comment",r?this.comment:g])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this.A||(this.A=o.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},s.prototype.resolveAll=function(){if(this.b){n.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve()}return this},s.prototype.p=function(e){return this.v&&(e=this.e||e,n.prototype.p.call(this,e),this.methodsArray.forEach((t=>{t.p(e)}))),this},s.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?u((this.methods[e.name]=e).parent=this):n.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,u(this)}return n.prototype.remove.call(this,e)},s.prototype.create=function(e,t,r){for(var n,i=new a.Service(e,t,r),s=0;s<this.methodsArray.length;++s){var u=o.lcFirst((n=this.A[s]).resolve().name).replace(/[^$\w_]/g,"");i[u]=o.codegen(["r","c"],o.isReserved(u)?u+"_":u)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return i}},{20:20,21:21,28:28,33:33}],31:[function(e,t,r){t.exports=b;var n=e(21),i=(((b.prototype=Object.create(n.prototype)).constructor=b).className="Type",e(14)),o=e(23),a=e(15),s=e(18),u=e(30),l=e(19),c=e(24),_=e(38),d=e(33),p=e(13),f=e(12),h=e(36),E=e(11),T=e(37);function b(e,t){n.call(this,e,t),this.fields={},this.oneofs=g,this.extensions=g,this.reserved=g,this.group=g,this.T=null,this.i=null,this.S=null,this.x=null}function v(e){return e.T=e.i=e.S=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(!this.T){this.T={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this.T[n])throw Error("duplicate id "+n+" in "+this);this.T[n]=r}}return this.T}},fieldsArray:{get:function(){return this.i||(this.i=d.toArray(this.fields))}},oneofsArray:{get:function(){return this.S||(this.S=d.toArray(this.oneofs))}},ctor:{get:function(){return this.x||(this.ctor=b.generateConstructor(this)())},set:function(e){for(var t=e.prototype,r=(t instanceof l||((e.prototype=new l).constructor=e,d.merge(e.prototype,t)),e.$type=e.prototype.$type=this,d.merge(e,l,!0),this.x=e,0);r<this.fieldsArray.length;++r)this.i[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this.S[r].resolve().name]={get:d.oneOfGetter(this.S[r].oneof),set:d.oneOfSetter(this.S[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),b.generateConstructor=function(e){for(var t,r=d.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e.i[n]).map?r("this%s={}",d.safeProp(t.name)):t.repeated&&r("this%s=[]",d.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(e,t){for(var r=new b(e,t.options),l=(r.extensions=t.extensions,r.reserved=t.reserved,Object.keys(t.fields)),c=0;c<l.length;++c)r.add((void 0!==t.fields[l[c]].keyType?s:a).fromJSON(l[c],t.fields[l[c]]));if(t.oneofs)for(l=Object.keys(t.oneofs),c=0;c<l.length;++c)r.add(o.fromJSON(l[c],t.oneofs[l[c]]));if(t.nested)for(l=Object.keys(t.nested),c=0;c<l.length;++c){var _=t.nested[l[c]];r.add((_.id!==g?a:_.fields!==g?b:_.values!==g?i:_.methods!==g?u:n).fromJSON(l[c],_))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),t.edition&&(r.e=t.edition),r.u="proto3",r},b.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&!!e.keepComments;return d.toObject(["edition",this.h(),"options",t&&t.options||g,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:g,"reserved",this.reserved&&this.reserved.length?this.reserved:g,"group",this.group||g,"nested",t&&t.nested||g,"comment",r?this.comment:g])},b.prototype.resolveAll=function(){if(this.b){n.prototype.resolveAll.call(this);for(var e=this.oneofsArray,t=0;t<e.length;)e[t++].resolve();var r=this.fieldsArray;for(t=0;t<r.length;)r[t++].resolve()}return this},b.prototype.p=function(e){return this.v&&(e=this.e||e,n.prototype.p.call(this,e),this.oneofsArray.forEach((t=>{t.r(e)})),this.fieldsArray.forEach((t=>{t.r(e)}))),this},b.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},b.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof a&&e.extend===g){if((this.T||this.fieldsById)[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),(this.fields[e.name]=e).message=this,e.onAdd(this),v(this)}return e instanceof o?(this.oneofs||(this.oneofs={}),(this.oneofs[e.name]=e).onAdd(this),v(this)):n.prototype.add.call(this,e)},b.prototype.remove=function(e){if(e instanceof a&&e.extend===g){if(this.fields&&this.fields[e.name]===e)return delete this.fields[e.name],e.parent=null,e.onRemove(this),v(this);throw Error(e+" is not a member of "+this)}if(e instanceof o){if(this.oneofs&&this.oneofs[e.name]===e)return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),v(this);throw Error(e+" is not a member of "+this)}return n.prototype.remove.call(this,e)},b.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},b.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},b.prototype.create=function(e){return new this.ctor(e)},b.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this.i[r].resolve().resolvedType);var n;return this.encode=p(this)({Writer:_,types:t,util:d}),this.decode=f(this)({Reader:c,types:t,util:d}),this.verify=h(this)({types:t,util:d}),this.fromObject=E.fromObject(this)({types:t,util:d}),this.toObject=E.toObject(this)({types:t,util:d}),(e=T[e])&&((n=Object.create(this)).fromObject=this.fromObject,this.fromObject=e.fromObject.bind(n),n.toObject=this.toObject,this.toObject=e.toObject.bind(n)),this},b.prototype.encode=function(e,t){return this.setup().encode(e,t)},b.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},b.prototype.decode=function(e,t){return this.setup().decode(e,t)},b.prototype.decodeDelimited=function(e){return e instanceof c||(e=c.create(e)),this.decode(e,e.uint32())},b.prototype.verify=function(e){return this.setup().verify(e)},b.prototype.fromObject=function(e){return this.setup().fromObject(e)},b.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},b.d=function(e){return function(t){d.decorateType(t,e)}}},{11:11,12:12,13:13,14:14,15:15,18:18,19:19,21:21,23:23,24:24,30:30,33:33,36:36,37:37,38:38}],32:[function(e,t,r){e=e(33);var n=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function i(e,t){var r=0,i={};for(t|=0;r<e.length;)i[n[r+t]]=e[r++];return i}r.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),r.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",e.emptyArray,null]),r.long=i([0,0,0,1,1],7),r.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),r.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])},{33:33}],33:[function(e,t,r){var n,i,o=t.exports=e(35),a=e(27),s=(o.codegen=e(3),o.fetch=e(5),o.path=e(8),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],i=e[r++];i!==g&&(t[n]=i)}return t},/\\/g),u=/"/g,l=(o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.isReserved(e)?'["'+e.replace(s,"\\\\").replace(u,'\\"')+'"]':"."+e},o.ucFirst=function(e){return(e[0]||"").toUpperCase()+e.substring(1)},/_([a-z])/g),c=(o.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(l,(function(e,t){return t.toUpperCase()}))},o.compareFieldsById=function(e,t){return e.id-t.id},o.decorateType=function(t,r){return t.$type?(r&&t.$type.name!==r&&(o.decorateRoot.remove(t.$type),t.$type.name=r,o.decorateRoot.add(t.$type)),t.$type):(r=new(n=n||e(31))(r||t.name),o.decorateRoot.add(r),r.ctor=t,Object.defineProperty(t,"$type",{value:r,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:r,enumerable:!1}),r)},0);o.decorateEnum=function(t){var r;return t.$type||(r=new(i=i||e(14))("Enum"+c++,t),o.decorateRoot.add(r),Object.defineProperty(t,"$type",{value:r,enumerable:!1}),r)},o.setProperty=function(e,t,r,n){if("object"!=typeof e)throw TypeError("dst must be an object");if(t)return function e(t,r,i){var o=r.shift();if("__proto__"!==o&&"prototype"!==o)if(0<r.length)t[o]=e(t[o]||{},r,i);else{if((r=t[o])&&n)return t;r&&(i=[].concat(r).concat(i)),t[o]=i}return t}(e,t=t.split("."),r);throw TypeError("path must be specified")},Object.defineProperty(o,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(e(26)))}})},{14:14,26:26,27:27,3:3,31:31,35:35,5:5,8:8}],34:[function(e,t,r){t.exports=i;var n=e(35);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0),a=(o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1},i.zeroHash="\0\0\0\0\0\0\0\0",i.fromNumber=function(e){var t,r;return 0===e?o:(r=(e=(t=e<0)?-e:e)>>>0,e=(e-r)/4294967296>>>0,t&&(e=~e>>>0,r=~r>>>0,4294967295<++r&&(r=0,4294967295<++e&&(e=0))),new i(r,e))},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){var t;return!e&&this.hi>>>31?(e=1+~this.lo>>>0,t=~this.hi>>>0,-(e+4294967296*(t=e?t:t+1>>>0))):this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,!!e):{low:0|this.lo,high:0|this.hi,unsigned:!!e}},String.prototype.charCodeAt);i.fromHash=function(e){return"\0\0\0\0\0\0\0\0"===e?o:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0==r?0==t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},{35:35}],35:[function(e,t,r){var n=r;function i(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)e[n[i]]!==g&&r||(e[n[i]]=t[n[i]]);return e}function o(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack||""}),r&&i(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:g,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}n.asPromise=e(1),n.base64=e(2),n.EventEmitter=e(4),n.float=e(6),n.inquire=e(7),n.utf8=e(10),n.pool=e(9),n.LongBits=e(34),n.isNode=!!(void 0!==commonjsGlobal&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),n.global=n.isNode&&commonjsGlobal||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return null!=r&&e.hasOwnProperty(t)&&("object"!=typeof r||0<(Array.isArray(r)?r:Object.keys(r)).length)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._=null,n.N=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n.N(e):new n.Array(e):n.Buffer?n._(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){return e=n.LongBits.fromHash(e),n.Long?n.Long.fromBits(e.lo,e.hi,t):e.toNumber(!!t)},n.merge=i,n.lcFirst=function(e){return(e[0]||"").toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;-1<r;--r)if(1===t[e[r]]&&this[e[r]]!==g&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n.c=function(){var e=n.Buffer;e?(n._=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n.N=e.allocUnsafe||function(t){return new e(t)}):n._=n.N=null}},{1:1,10:10,2:2,34:34,4:4,6:6,7:7,9:9}],36:[function(e,t,r){t.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var s,u=e.i[n].resolve(),l="m"+i.safeProp(u.name);u.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",l,u.name),u.map?(t("if(!util.isObject(%s))",l)("return%j",o(u,"object"))("var k=Object.keys(%s)",l)("for(var i=0;i<k.length;++i){"),function(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",o(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",o(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",o(t,"boolean key"))}}(t,u,"k[i]"),a(t,u,n,l+"[k[i]]")("}")):u.repeated?(t("if(!Array.isArray(%s))",l)("return%j",o(u,"array"))("for(var i=0;i<%s.length;++i){",l),a(t,u,n,l+"[i]")("}")):(u.partOf&&(s=i.safeProp(u.partOf.name),1===r[u.partOf.name]&&t("if(p%s===1)",s)("return%j",u.partOf.name+": multiple values"),r[u.partOf.name]=1,t("p%s=1",s)),a(t,u,n,l)),u.optional&&t("}")}return t("return null")};var n=e(14),i=e(33);function o(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,r,i){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",i)("default:")("return%j",o(t,"enum value"));for(var a=Object.keys(t.resolvedType.values),s=0;s<a.length;++s)e("case %i:",t.resolvedType.values[a[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,i)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",i)("return%j",o(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",o(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",o(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",o(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",o(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",o(t,"buffer"))}return e}},{14:14,33:33}],37:[function(e,t,r){var n=e(19);r[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t,r=e["@type"].substring(1+e["@type"].lastIndexOf("/"));if(r=this.lookup(r))return~(t="."==(e["@type"][0]||"")?e["@type"].slice(1):e["@type"]).indexOf("/")||(t="/"+t),this.create({type_url:t,value:r.encode(r.fromObject(e)).finish()})}return this.fromObject(e)},toObject:function(e,t){var r,i,o="",a="";return t&&t.json&&e.type_url&&e.value&&(a=e.type_url.substring(1+e.type_url.lastIndexOf("/")),o=e.type_url.substring(0,1+e.type_url.lastIndexOf("/")),(r=this.lookup(a))&&(e=r.decode(e.value))),!(e instanceof this.ctor)&&e instanceof n?(r=e.$type.toObject(e,t),i="."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName,r["@type"]=a=(o=""===o?"type.googleapis.com/":o)+i,r):this.toObject(e,t)}}},{19:19}],38:[function(e,t,r){t.exports=_;var n,i=e(35),o=i.LongBits,a=i.base64,s=i.utf8;function u(e,t,r){this.fn=e,this.len=t,this.next=g,this.val=r}function l(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function _(){this.len=0,this.head=new u(l,0,0),this.tail=this.head,this.states=null}function d(){return i.Buffer?function(){return(_.create=function(){return new n})()}:function(){return new _}}function p(e,t,r){t[r]=255&e}function f(e,t){this.len=e,this.next=g,this.val=t}function h(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;127<e.lo;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function E(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}_.create=d(),_.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(_.alloc=i.pool(_.alloc,i.Array.prototype.subarray)),_.prototype.I=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},(f.prototype=Object.create(u.prototype)).fn=function(e,t,r){for(;127<e;)t[r++]=127&e|128,e>>>=7;t[r]=e},_.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},_.prototype.int32=function(e){return e<0?this.I(h,10,o.fromNumber(e)):this.uint32(e)},_.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},_.prototype.int64=_.prototype.uint64=function(e){return e=o.from(e),this.I(h,e.length(),e)},_.prototype.sint64=function(e){return e=o.from(e).zzEncode(),this.I(h,e.length(),e)},_.prototype.bool=function(e){return this.I(p,1,e?1:0)},_.prototype.sfixed32=_.prototype.fixed32=function(e){return this.I(E,4,e>>>0)},_.prototype.sfixed64=_.prototype.fixed64=function(e){return e=o.from(e),this.I(E,4,e.lo).I(E,4,e.hi)},_.prototype.float=function(e){return this.I(i.float.writeFloatLE,4,e)},_.prototype.double=function(e){return this.I(i.float.writeDoubleLE,8,e)};var T=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};_.prototype.bytes=function(e){var t,r=e.length>>>0;return r?(i.isString(e)&&(t=_.alloc(r=a.length(e)),a.decode(e,t,0),e=t),this.uint32(r).I(T,r,e)):this.I(p,1,0)},_.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t).I(s.write,t,e):this.I(p,1,0)},_.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new u(l,0,0),this.len=0,this},_.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(l,0,0),this.len=0),this},_.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},_.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},_.c=function(e){n=e,_.create=d(),n.c()}},{35:35}],39:[function(e,t,r){t.exports=o;var n=e(38),i=((o.prototype=Object.create(n.prototype)).constructor=o,e(35));function o(){n.call(this)}function a(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o.c=function(){o.alloc=i.N,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},o.prototype.bytes=function(e){var t=(e=i.isString(e)?i._(e,"base64"):e).length>>>0;return this.uint32(t),t&&this.I(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this.I(a,t,e),this},o.c()},{35:35,38:38}]},e={},i=function t(n){var i=e[n];return i||r[n][0].call(i=e[n]={exports:{}},t,i,i.exports),i.exports}(16),i.util.global.protobuf=i,module&&module.exports&&(module.exports=i)}()})(protobuf_min);var enumRegexp=/^enum\s+[A-Z]/,messageRegexp=/^message\s+[A-Z]/,messsageLineRegexp=/^(repeated|optional|required)/,enumLineRegexp=/^[\w]+\s*=/,commentLineRegexp=/^\/{2}/,endLineRegexp=/^}/,parseMessageField=function(e,t,r){var n=__read(e.trim().split(/\s*\/{2}\s*/)),i=n[0],o=n.slice(1),a=__read(i.split(/\s*=\s*|\s*;|\s+/),4),s=a[0],u=a[1],l=a[2],c=a[3];if(!/repeated|optional|required/.test(s))throw new Error("parseField error in line ".concat(t,": fieldType error"));return{fieldType:s,type:u,name:l,order:c,comment:"".concat(r,"\n").concat(o.join(""))}},parseEnumField=function(e,t){var r=__read(e.trim().split(/\s*\/{2}\s*/)),n=r[0],i=r.slice(1),o=__read(n.split(/\s*=\s*|\s*;/),2);return{key:o[0],value:o[1],comment:"".concat(t,"\n").concat(i.join(""))}},parseBlockLine=function(e,t){var r=__read(e.trim().split(/\s*\/{2}\s*/)),n=r[0],i=r.slice(1);return{name:__read(n.split(/\s+/),2)[1].replace(/\{/,""),comment:"".concat(t,"\n").concat(i.join("")),fields:[]}};function parseEnum(e,t,r){var n=e[t],i=parseBlockLine(n,r),o="";do{var a=e[t+=1];if(commentLineRegexp.test(a))o+="".concat(a.replace(/\/\/\s*/g,""),"\n");else if(enumLineRegexp.test(a)){var s=parseEnumField(a,o);o="",i.fields.push(s)}else o=""}while(!endLineRegexp.test(e[t+1]));return[i,t+1]}function parseMessage(e,t,r){var n=e[t],i=parseBlockLine(n,r),o="";do{var a=e[t+=1];if(commentLineRegexp.test(a))o+="".concat(a.replace(/\/\/\s*/g,""),"\n");else if(messsageLineRegexp.test(a)){var s=parseMessageField(a,t,o);o="",i.fields.push(s)}else o=""}while(!endLineRegexp.test(e[t+1]));return[i,t+1]}var parseProtoFile=function(e){for(var t=e.split("\n").map((function(e){return e.trim()})).filter((function(e){return e.trim().length})).slice(2),r=new Map,n=new Map,i="",o=0;o<t.length;o++){var a=t[o];if(commentLineRegexp.test(a))i+="".concat(a.replace(/\/\/\s*/g,""),"\n");else if(messageRegexp.test(a)){var s=__read(parseMessage(t,o,i),2),u=s[0],l=s[1];if(0===u.fields.length)throw new Error("message 结构解析失败 -> ".concat(u.name));r.set(u.name,u),o=l,i=""}else if(enumRegexp.test(a)){var c=__read(parseEnum(t,o,i),2),_=c[0];l=c[1];if(0===_.fields.length)throw new Error("message 结构解析失败 -> ".concat(_.name));n.set(_.name,_),o=l,i=""}else i=""}return[r,n]},parseProtoToRoot=function(e){var t=__read(parseProtoFile(e),2),r=t[0],n=t[1],i=new protobuf_min.exports.Root;return __spreadArray([],__read(n.entries()),!1).forEach((function(e){var t=__read(e,2),r=t[0],n=t[1],o=new protobuf_min.exports.Enum(r);n.fields.forEach((function(e){var t=e.key,r=e.value;e.comment,o.values[t]=+r})),i.add(o)})),__spreadArray([],__read(r.entries()),!1).forEach((function(e){var t=__read(e,2),r=t[0],n=t[1],o=new protobuf_min.exports.Type(r);n.fields.forEach((function(e){var t=e.fieldType,r=e.type,n=e.name,i=e.order;e.comment;var a=new protobuf_min.exports.Field(n,+i,r,t);o.add(a)})),i.add(o)})),i},Codec$1=function(){function e(e){Object.defineProperty(this,"protoRoot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.protoRoot=parseProtoToRoot(e)}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.protoRoot[e],n=r.create(t),i=r.encode(n).finish();return new Uint8Array(i).buffer}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.protoRoot[e].decode(t)}}),e}(),IMPB={SetUserStatusOutput:"SetUserStatusOutput",GetUserStatusInput:"GetUserStatusInput",GetUserStatusOutput:"GetUserStatusOutput",SubUserStatusInput:"SubUserStatusInput",SubUserStatusOutput:"SubUserStatusOutput",VoipDynamicInput:"VoipDynamicInput",VoipDynamicOutput:"VoipDynamicOutput",NotifyMsg:"NotifyMsg",SyncRequestMsg:"SyncRequestMsg",UpStreamMessage:"UpStreamMessage",PushExtra:"PushExtra",DownStreamMessages:"DownStreamMessages",ChrmDownStreamMessages:"ChrmDownStreamMessages",DownStreamMessage:"DownStreamMessage",CreateDiscussionInput:"CreateDiscussionInput",CreateDiscussionOutput:"CreateDiscussionOutput",ChannelInvitationInput:"ChannelInvitationInput",LeaveChannelInput:"LeaveChannelInput",ChannelEvictionInput:"ChannelEvictionInput",RenameChannelInput:"RenameChannelInput",ChannelInfoInput:"ChannelInfoInput",ChannelInfoOutput:"ChannelInfoOutput",ChannelInfosInput:"ChannelInfosInput",ChannelInfosOutput:"ChannelInfosOutput",MemberInfo:"MemberInfo",GroupMembersInput:"GroupMembersInput",GroupMembersOutput:"GroupMembersOutput",GetUserInfoInput:"GetUserInfoInput",GetUserInfoOutput:"GetUserInfoOutput",GetSessionIdInput:"GetSessionIdInput",GetSessionIdOutput:"GetSessionIdOutput",GetQNupTokenInput:"GetQNupTokenInput",GetQNdownloadUrlInput:"GetQNdownloadUrlInput",GetDownloadUrlInput:"GetDownloadUrlInput",GetQNupTokenOutput:"GetQNupTokenOutput",GetQNdownloadUrlOutput:"GetQNdownloadUrlOutput",GetDownloadUrlOutput:"GetDownloadUrlOutput",Add2BlackListInput:"Add2BlackListInput",RemoveFromBlackListInput:"RemoveFromBlackListInput",QueryBlackListInput:"QueryBlackListInput",QueryBlackListOutput:"QueryBlackListOutput",BlackListStatusInput:"BlackListStatusInput",BlockPushInput:"BlockPushInput",ModifyPermissionInput:"ModifyPermissionInput",GroupInput:"GroupInput",GroupOutput:"GroupOutput",GroupInfo:"GroupInfo",GroupHashInput:"GroupHashInput",GroupHashOutput:"GroupHashOutput",ChrmInput:"ChrmInput",ChrmOutput:"ChrmOutput",ChrmPullMsg:"ChrmPullMsg",ChrmPullMsgNew:"ChrmPullMsgNew",RelationQryInput:"RelationQryInput",RelationsOutput:"RelationsOutput",RelationInfo:"RelationInfo",UnreadMsgInfo:"UnreadMsgInfo",QryRemindListReq:"QryRemindListReq",QryRemindListResp:"QryRemindListResp",RelationInfoReadTime:"RelationInfoReadTime",CleanHisMsgInput:"CleanHisMsgInput",CleanMsgBatchReq:"CleanMsgBatchReq",HistoryMessageInput:"HistoryMessageInput",HistoryMessagesOuput:"HistoryMessagesOuput",QueryChatRoomInfoInput:"QueryChatRoomInfoInput",QueryChatRoomInfoOutput:"QueryChatRoomInfoOutput",ChrmMember:"ChrmMember",MPFollowInput:"MPFollowInput",MPFollowOutput:"MPFollowOutput",MCFollowOutput:"MCFollowOutput",MpInfo:"MpInfo",SearchMpInput:"SearchMpInput",SearchMpOutput:"SearchMpOutput",PullMpInput:"PullMpInput",PullMpOutput:"PullMpOutput",HistoryMsgInput:"HistoryMsgInput",HistoryMsgOuput:"HistoryMsgOuput",SessionsAttQryInput:"SessionsAttQryInput",SessionsAttOutput:"SessionsAttOutput",SessionMsgReadInput:"SessionMsgReadInput",SessionMsgReadOutput:"SessionMsgReadOutput",DeleteSessionsInput:"DeleteSessionsInput",SessionInfo:"SessionInfo",QuerySessionsInput:"QuerySessionsInput",QuerySessionsOutPut:"QuerySessionsOutPut",DeleteSessionsOutput:"DeleteSessionsOutput",RelationDelBatchReq:"RelationDelBatchReq",RelationOpInput:"RelationOpInput",DeleteMsgInput:"DeleteMsgInput",DeleteMsg:"DeleteMsg",ChrmKVEntity:"ChrmKVEntity",SetChrmKV:"SetChrmKV",SetChrmKVS:"SetChrmKVS",DeleteChrmKVS:"DeleteChrmKVS",ChrmKVOutput:"ChrmKVOutput",ChrmKVSVersionEntity:"ChrmKVSVersionEntity",ChrmKVSOutput:"ChrmKVSOutput",ChrmKVSOutputEntity:"ChrmKVSOutputEntity",QueryChrmKV:"QueryChrmKV",SetUserSettingInput:"SetUserSettingInput",SetUserSettingOutput:"SetUserSettingOutput",PullUserSettingInput:"PullUserSettingInput",PullUserSettingOutput:"PullUserSettingOutput",UserSettingItem:"UserSettingItem",SessionReq:"SessionReq",SessionStates:"SessionStates",SessionState:"SessionState",SessionStateItem:"SessionStateItem",SessionStateModifyReq:"SessionStateModifyReq",GroupUnpushQuery:"GroupUnpushQuery",GroupUnpushSet:"GroupUnpushSet",GroupUnpushResult:"GroupUnpushResult",SessionStateModifyResp:"SessionStateModifyResp",TypeUnpushInput:"TypeUnpushInput",TypeUnpushOutput:"TypeUnpushOutput",GrpReadReceiptMsg:"GrpReadReceiptMsg",GrpReadReceiptQryReq:"GrpReadReceiptQryReq",ReadReceipt:"ReadReceipt",QueryReceiptReq:"QueryReceiptReq",QueryReceiptBatchReq:"QueryReceiptBatchReq",QueryReceipt:"QueryReceipt",ReceiptResp:"ReceiptResp",QueryReceiptBatchResp:"QueryReceiptBatchResp",QueryReceiptBatchRespItem:"QueryReceiptBatchRespItem",QueryReceiptRespItem:"QueryReceiptRespItem",GrpReadReceiptQryResp:"GrpReadReceiptQryResp",GrpMsgReadUser:"GrpMsgReadUser",SessionTagAddInput:"SessionTagAddInput",SessionTagItem:"SessionTagItem",SessionTagDelInput:"SessionTagDelInput",SessionDisTagReq:"SessionDisTagReq",UserSettingNotification:"UserSettingNotification",ReportSDKInput:"ReportSDKInput",ReportSDKOutput:"ReportSDKOutput",UltraGrpPullSes:"UltraGrpPullSes",UltraGrpPullMsg:"UltraGrpPullMsg",MsgChangeReq:"MsgChangeReq",ModifyMsgResp:"ModifyMsgResp",QueryMsgChange:"QueryMsgChange",EventChangeList:"EventChangeList",EventChange:"EventChange",MsgChangeList:"MsgChangeList",MsgChange:"MsgChange",MsgQuery:"MsgQuery",MessageQueryInfo:"MessageQueryInfo",MsgQueryAck:"MsgQueryAck",OperateStatus:"OperateStatus",OperateStatusNotify:"OperateStatusNotify",OperateInfo:"OperateInfo",OperateSummary:"OperateSummary",SetRtcRoomIdInput:"SetRtcRoomIdInput",SetRtcRoomIdOutput:"SetRtcRoomIdOutput",CallInfoUpStream:"CallInfoUpStream",CallInfoDownStream:"CallInfoDownStream",KvInput:"KvInput",KvOutput:"KvOutput",KvInfo:"KvInfo",ReadReceiptMsg:"ReadReceiptMsg",ReceiptQryReq:"ReceiptQryReq",QueryReceiptResp:"QueryReceiptResp",ReceiptUser:"ReceiptUser",ReceiptCntQryReq:"ReceiptCntQryReq",ReceiptCntQryResp:"ReceiptCntQryResp",MsgReadCnt:"MsgReadCnt",UpdateUserSubReq:"UpdateUserSubReq",UserSubDetail:"UserSubDetail",UpdateUserSubResp:"UpdateUserSubResp",PullUserSubReq:"PullUserSubReq",PUllUserSubResp:"PUllUserSubResp",UserSubList:"UserSubList",PullSubDataReq:"PullSubDataReq",PullSubDataResp:"PullSubDataResp",SubDataDetail:"SubDataDetail",SubData:"SubData",QrySubDataReq:"QrySubDataReq",UserProfile:"UserProfile",ProfileInfo:"ProfileInfo",SetUserProfileResp:"SetUserProfileResp",PullUserProfileReq:"PullUserProfileReq",UserProfiles:"UserProfiles",UserProfileInput:"UserProfileInput",UserProfilePermission:"UserProfilePermission",UserProfileOutput:"UserProfileOutput",SearchUserProfile:"SearchUserProfile",ChannelsInput:"ChannelsInput",ChannelBaseInfo:"ChannelBaseInfo",ChannelsOutput:"ChannelsOutput",MultiChannels:"MultiChannels",ModifyChannelsInput:"ModifyChannelsInput",QuitChannelsSetting:"QuitChannelsSetting",ChannelsQueryInput:"ChannelsQueryInput",ChannelsPageParam:"ChannelsPageParam",ChannelsListResult:"ChannelsListResult",ChannelsInviteStatusInfos:"ChannelsInviteStatusInfos",ChannelsUserInfos:"ChannelsUserInfos",ChannelsJoinedInfos:"ChannelsJoinedInfos",ChannelsUserInfo:"ChannelsUserInfo",ChannelsUserExtInfo:"ChannelsUserExtInfo",ChannelsMemberUpdateInput:"ChannelsMemberUpdateInput",ChannelsJoinedInfo:"ChannelsJoinedInfo",ChannelsInviteStatusInfo:"ChannelsInviteStatusInfo",ChannelsMemberResponseInput:"ChannelsMemberResponseInput",ChannelsMembersInput:"ChannelsMembersInput",FriendInput:"FriendInput",FriendsOutput:"FriendsOutput",FriendOutput:"FriendOutput",FriendsInput:"FriendsInput",FriendsCheckOutput:"FriendsCheckOutput",FriendCheckOutput:"FriendCheckOutput",FriendProfileInput:"FriendProfileInput",FriendProfileOutput:"FriendProfileOutput",FriendQueryInput:"FriendQueryInput",FriendUserInfo:"FriendUserInfo",FriendInviteInfo:"FriendInviteInfo",FriendsListInput:"FriendsListInput",FriendLevelSet:"FriendLevelSet",FriendPageParam:"FriendPageParam",FriendUserInfos:"FriendUserInfos",FriendInviteInfos:"FriendInviteInfos",FriendApplyEvent:"FriendApplyEvent",UpdateChannnelInfo:"UpdateChannnelInfo",UpdateUserInfo:"UpdateUserInfo",ChannelApplyInfo:"ChannelApplyInfo",ChannelEventData:"ChannelEventData",FriendTypeChangeEvent:"FriendTypeChangeEvent",FriendUpdateEvent:"FriendUpdateEvent",AddUnpushPeriodInput:"AddUnpushPeriodInput",DeleteUnpushPeriodInput:"DeleteUnpushPeriodInput",QueryUnpushPeriodInput:"QueryUnpushPeriodInput",QueryUnpushPeriodOutput:"QueryUnpushPeriodOutput",RelationDel:"RelationDel",MsgReadEvent:"MsgReadEvent",ConvertMsgInput:"ConvertMsgInput",SpeechToTextInfo:"SpeechToTextInfo",ConvertMsgOutput:"ConvertMsgOutput",SpeechToTextResult:"SpeechToTextResult",TransReq:"TransReq",TransResp:"TransResp",TransInfo:"TransInfo",TransResult:"TransResult",PullModifyMsgReq:"PullModifyMsgReq",PullModifyMsgResp:"PullModifyMsgResp",ModifyMsg:"ModifyMsg"},desc="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 }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n IMAGE = 1;\n AUDIO = 2;\n VIDEO = 3;\n FILE = 4;\n SIGHT = 5;\n COMBINE_HTML = 6;\n }\n message GetQNupTokenInput {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n optional string url = 5;\n optional string ext = 6;\n optional int64 size = 7;\n optional int32 ipType = 8;\n }\n message GetQNdownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message GetDownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4;\n optional int64 size = 5;\n optional int32 ipType = 6;\n }\n message GetQNupTokenOutput {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n optional string minioAuthorization = 20;\n optional string minioContentSha256 = 21;\n optional string minioDate = 22;\n optional string minioBucketName = 23;\n\n optional string downloadAuthInfo = 24;\n optional string ossConfig = 25;\n }\n message GetQNdownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message GetDownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n GROUP_SUCCESS = 0x00;\n GROUP_FAILURE = 0x01;\n }\n message ChrmInput {\n required int32 nothing = 1;\n optional string extra = 2;\n }\n message ChrmOutput {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n optional int64 createTime = 4;\n optional int32 memberCount = 5;\n optional int32 chatroomBanState = 6;\n optional int32 whiteListState = 7;\n }\n message ChrmPullMsg {\n required int64 syncTime = 1;\n required int32 count = 2;\n optional int32 pullMsgType = 3;\n optional bool compressioEnabled = 4;\n }\n message ChrmPullMsgNew {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message RelationQryInput {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n optional bool isEraseMsgContent = 5;\n optional int64 endTime = 6;\n optional bool compressioEnabled = 7;\n optional int32 qryType = 8;\n }\n message RelationsOutput {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;\n optional int64 pullTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message RelationInfo {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;\n optional int64 versionTime = 7;\n optional int64 remindCount = 8;\n optional int32 busChannelType = 9;\n optional UnreadMsgInfo msgInfo = 10;\n optional int32 remindMeCount = 11;\n }\n message UnreadMsgInfo {\n required string msgId = 1;\n required int64 msgTime= 2;\n optional int32 remindType= 3;\n optional string className = 4;\n }\n message QryRemindListReq {\n required string groupId = 1;\n optional string busChannel = 2;\n optional int64 msgTime = 3;\n optional int32 size = 4;\n }\n message QryRemindListResp {\n repeated UnreadMsgInfo msgInfo = 1;\n }\n message RelationInfoReadTime {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message CleanHisMsgInput {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4;\n }\n message CleanMsgBatchReq {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6; \n optional bytes compressedData = 7;\n }\n message QueryChatRoomInfoInput {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message QueryChatRoomInfoOutput {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput {\n required string id = 1;\n }\n\n message MPFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message HistoryMsgInput {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5;\n optional bool compressioEnabled = 6;\n 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 }\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 }\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}\n",PBEnumChannelType,PBEnumFileType,PBEnumGroupHashType,PBEnumSessionStateType;!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"}(PBEnumChannelType||(PBEnumChannelType={})),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"}(PBEnumFileType||(PBEnumFileType={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(PBEnumGroupHashType||(PBEnumGroupHashType={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(PBEnumSessionStateType||(PBEnumSessionStateType={}));var codec=new Codec$1(desc),LogLevel,LogSource,ConnectionStatus,RTCMode,LiveType,LiveRole,RTCApiType,RTCIdentityChangeType,RTCJoinType;exports.LogLevel=void 0,LogLevel=exports.LogLevel||(exports.LogLevel={}),LogLevel[LogLevel.LOG=0]="LOG",LogLevel[LogLevel.DEBUG=0]="DEBUG",LogLevel[LogLevel.INFO=1]="INFO",LogLevel[LogLevel.WARN=2]="WARN",LogLevel[LogLevel.ERROR=3]="ERROR",LogLevel[LogLevel.FATAL=4]="FATAL",LogLevel[LogLevel.STATISTICS=6]="STATISTICS",LogLevel[LogLevel.NONE=1e3]="NONE",exports.LogSource=void 0,LogSource=exports.LogSource||(exports.LogSource={}),LogSource.IM="IM",LogSource.RTC="RTC",exports.ConnectionStatus=void 0,ConnectionStatus=exports.ConnectionStatus||(exports.ConnectionStatus={}),ConnectionStatus[ConnectionStatus.CONNECTED=0]="CONNECTED",ConnectionStatus[ConnectionStatus.CONNECTING=1]="CONNECTING",ConnectionStatus[ConnectionStatus.DISCONNECTED=2]="DISCONNECTED",ConnectionStatus[ConnectionStatus.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",ConnectionStatus[ConnectionStatus.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",ConnectionStatus[ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",ConnectionStatus[ConnectionStatus.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",ConnectionStatus[ConnectionStatus.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",ConnectionStatus[ConnectionStatus.BLOCKED=9]="BLOCKED",ConnectionStatus[ConnectionStatus.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",ConnectionStatus[ConnectionStatus.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",ConnectionStatus[ConnectionStatus.REDIRECT=14]="REDIRECT",ConnectionStatus[ConnectionStatus.USER_LOGOUT=19]="USER_LOGOUT",ConnectionStatus[ConnectionStatus.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",ConnectionStatus[ConnectionStatus.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",ConnectionStatus[ConnectionStatus.ULTRALIMIT=1101]="ULTRALIMIT",ConnectionStatus[ConnectionStatus.REQUEST_NAVI=201]="REQUEST_NAVI",ConnectionStatus[ConnectionStatus.RESPONSE_NAVI=202]="RESPONSE_NAVI",ConnectionStatus[ConnectionStatus.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",ConnectionStatus[ConnectionStatus.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",ConnectionStatus[ConnectionStatus.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",ConnectionStatus[ConnectionStatus.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",exports.RTCMode=void 0,RTCMode=exports.RTCMode||(exports.RTCMode={}),RTCMode[RTCMode.RTC=0]="RTC",RTCMode[RTCMode.LIVE=2]="LIVE",RTCMode[RTCMode.SIP=4]="SIP",RTCMode[RTCMode.CALL=5]="CALL",RTCMode[RTCMode.MEETING=6]="MEETING",RTCMode[RTCMode.CROSS_MUTI=7]="CROSS_MUTI",RTCMode[RTCMode.CROSS_LIVE=8]="CROSS_LIVE",function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(LiveType||(LiveType={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(LiveRole||(LiveRole={})),exports.RTCApiType=void 0,RTCApiType=exports.RTCApiType||(exports.RTCApiType={}),RTCApiType[RTCApiType.ROOM=1]="ROOM",RTCApiType[RTCApiType.PERSON=2]="PERSON",function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(RTCIdentityChangeType||(RTCIdentityChangeType={})),exports.RTCJoinType=void 0,RTCJoinType=exports.RTCJoinType||(exports.RTCJoinType={}),RTCJoinType[RTCJoinType.KICK=0]="KICK",RTCJoinType[RTCJoinType.REFUSE=1]="REFUSE",RTCJoinType[RTCJoinType.COEXIST=2]="COEXIST";var _logger=null;function init(e){_logger=e}function log(e,t,r,n){void 0===r&&(r={});var i=["error","warn","info","debug"][3-e];if(_logger&&e<exports.LogLevel.FATAL)try{var o=JSON.stringify(r);_logger[i](t,o)}catch(e){console.error(e)}}var debug=log.bind(null,exports.LogLevel.DEBUG),info=log.bind(null,exports.LogLevel.INFO),warn=log.bind(null,exports.LogLevel.WARN),error=log.bind(null,exports.LogLevel.ERROR),fatal=log.bind(null,exports.LogLevel.FATAL),logger={init:init,info:info,debug:debug,warn:warn,error:error,fatal:fatal},EventEmitter=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r})}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r,once:!0})}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e];n&&((n=n.filter((function(e){return e.listener!==t||e.target!==r}))).length?this._map[e]=n:delete this._map[e])}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map[e];if(n)for(var i=0;i<n.length;i+=1){var o=n[i],a=o.target,s=o.once,u=o.listener;s&&(n.splice(i,1),i-=1);try{u.call.apply(u,__spreadArray([a],__read(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}(),forEach=function(e,t,r){var n=null==r?void 0:r.isReverse;isObject(e)&&function(){for(var r in e)t(e[r],r,e)}(),(isArray(e)||isString(e))&&function(){if(n)for(var r=e.length-1;r>=0;r--)t(e[r],r);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},map=function(e,t){return forEach(e,(function(r,n){e[n]=t(r,n)})),e},isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},Codec=function(){function e(e){Object.defineProperty(this,"protoRoot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.protoRoot=parseProtoToRoot(e)}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(r)return t;var n=this.protoRoot[e],i=n.create(t),o=n.encode(i).finish();return new Uint8Array(o).buffer}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.protoRoot[e].decode(t)}}),e}(),_a$6,RTCPB;!function(e){e.RtcInput="RtcInput",e.RtcUserListOutput="RtcUserListOutput",e.SetUserStatusInput="SetUserStatusInput",e.RtcSetDataInput="RtcSetDataInput",e.RtcUserSetDataInput="RtcUserSetDataInput",e.RtcDataInput="RtcDataInput",e.RtcSetOutDataInput="RtcSetOutDataInput",e.MCFollowInput="MCFollowInput",e.RtcTokenOutput="RtcTokenOutput",e.RtcQryOutput="RtcQryOutput",e.RtcQryUserOutDataInput="RtcQryUserOutDataInput",e.RtcUserOutDataOutput="RtcUserOutDataOutput",e.RtcQueryListInput="RtcQueryListInput",e.RtcRoomInfoOutput="RtcRoomInfoOutput",e.RtcValueInfo="RtcValueInfo",e.RtcKeyDeleteInput="RtcKeyDeleteInput",e.RtcNotifyMsg="RtcNotifyMsg",e.RtcPullKV="RtcPullKV",e.RtcKVOutput="RtcKVOutput",e.RtcQueryUserJoinedInput="RtcQueryUserJoinedInput",e.RtcQueryUserJoinedOutput="RtcQueryUserJoinedOutput",e.RtcViewerJoinedOutput="RtcViewerJoinedOutput",e.RtcInviteInput="RtcInviteInput",e.RtcCancelInviteInput="RtcCancelInviteInput",e.RtcInviteAnswerInput="RtcInviteAnswerInput",e.RtcEndInviteInput="RtcEndInviteInput",e.RtcOutput="RtcOutput"}(RTCPB||(RTCPB={})),_a$6={},_a$6[RTCPB.RtcInput]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType","innerDatas","outerDatas"],_a$6[RTCPB.RtcUserListOutput]=["users","token","sessionId","roomInfo"],_a$6[RTCPB.SetUserStatusInput]=["status"],_a$6[RTCPB.RtcSetDataInput]=["interior","target","key","value","objectName","content"],_a$6[RTCPB.RtcUserSetDataInput]=["valueInfo","objectName","content"],_a$6[RTCPB.RtcDataInput]=["interior","target","key","objectName","content"],_a$6[RTCPB.RtcSetOutDataInput]=["target","valueInfo","objectName","content"],_a$6[RTCPB.MCFollowInput]=["state"],_a$6[RTCPB.RtcTokenOutput]=["rtcToken"],_a$6[RTCPB.RtcQryOutput]=["outInfo"],_a$6[RTCPB.RtcQryUserOutDataInput]=["userId"],_a$6[RTCPB.RtcUserOutDataOutput]=["user"],_a$6[RTCPB.RtcQueryListInput]=["order"],_a$6[RTCPB.RtcRoomInfoOutput]=["roomId","roomData","userCount","list"],_a$6[RTCPB.RtcValueInfo]=["key","value"],_a$6[RTCPB.RtcKeyDeleteInput]=["key"],_a$6[RTCPB.RtcNotifyMsg]=["type","time","roomId"],_a$6[RTCPB.RtcPullKV]=["timestamp","roomId"],_a$6[RTCPB.RtcKVOutput]=["entries","bFullUpdate","syncTime"],_a$6[RTCPB.RtcQueryUserJoinedInput]=["userId"],_a$6[RTCPB.RtcQueryUserJoinedOutput]=["info"],_a$6[RTCPB.RtcInviteInput]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],_a$6[RTCPB.RtcCancelInviteInput]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],_a$6[RTCPB.RtcInviteAnswerInput]=["inviteUserId","answerCode","inviteRoomId","inviteSessionId","content","key","value"],_a$6[RTCPB.RtcEndInviteInput]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"];var RTCProtoDesc="\npackage Modules;\nmessage probuf {\n enum JoinType {\n KICK = 0; //踢前一个设备\n REFUSE = 1; //当前加入拒绝\n COEXIST = 2; //两个设备共存\n }\n enum targetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message ".concat(RTCPB.SetUserStatusInput,"\n {\n optional int32 status=1;\n }\n message ").concat(RTCPB.MCFollowInput,"\n {\n required string state = 1;\n }\n message ").concat(RTCPB.RtcQueryListInput,"{\n optional int32 order=1;\n }\n message ").concat(RTCPB.RtcKeyDeleteInput,"{\n repeated string key=1;\n }\n message ").concat(RTCPB.RtcValueInfo,"{\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo{\n required string userId=1;\n repeated ").concat(RTCPB.RtcValueInfo," userData=2; //用户资源信息\n }\n message ").concat(RTCPB.RtcUserListOutput,"{\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4; //房间 key value\n repeated RtcKVEntity entries = 5;//直播 KV 属性对象集合\n optional int64 syncTime = 6;//所有属性的最大时间戳(下次拉取 KV 时用)。\n optional int32 offlineKickTime = 7;//server 超时踢人时间,默认 60s\n }\n message RtcRoomInfoOutput{\n optional string roomId = 1;\n repeated ").concat(RTCPB.RtcValueInfo," roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message ").concat(RTCPB.RtcInput,"{\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4; //是否需要同步聊天室\n optional IdentityChangeType identityChangeType = 5; //身份变更类型\n optional JoinType joinType = 6; // 加入房间类型\n repeated ").concat(RTCPB.RtcValueInfo," innerDatas = 7; //用户内部 inner 数据,角色或者连麦信息等\n repeated ").concat(RTCPB.RtcValueInfo," outerDatas = 8; //用户内部 outer 数据,自定义数据结构 RtcInput。\n }\n message ").concat(RTCPB.RtcQryOutput,"{\n repeated ").concat(RTCPB.RtcValueInfo," outInfo=1;\n }\n message ").concat(RTCPB.RtcDataInput,"{\n required bool interior=1;\n required targetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message ").concat(RTCPB.RtcSetDataInput,"{\n required bool interior=1;\n required targetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message ").concat(RTCPB.RtcUserSetDataInput," {\n repeated ").concat(RTCPB.RtcValueInfo," valueInfo = 1;\n required string objectName = 2;\n repeated ").concat(RTCPB.RtcValueInfo," content = 3;\n }\n message RtcQryInput{\n required bool isInterior=1;\n required targetType target=2;\n repeated string key=3;\n }\n message RtcDelDataInput{\n repeated string key=1;\n required bool isInterior=2;\n required targetType target=3;\n }\n message RtcOutput\n {\n optional int32 nothing=1;\n optional int64 version=2;\n }\n message ").concat(RTCPB.RtcTokenOutput,"{\n required string rtcToken=1;\n }\n message ").concat(RTCPB.RtcSetOutDataInput,"{\n required targetType target=1;\n repeated ").concat(RTCPB.RtcValueInfo," valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message ").concat(RTCPB.RtcQryUserOutDataInput,"{\n repeated string userId = 1;\n }\n message ").concat(RTCPB.RtcUserOutDataOutput,"{\n repeated RtcUserInfo user = 1;\n }\n message ").concat(RTCPB.RtcNotifyMsg," \n {\n required int32 type= 1; //(通知类型 1:rtc 房间状态 KV 变更通知)\n optional int64 time= 2; //消息产生时间\n optional string roomId=3; //主播房间 id\n }\n message ").concat(RTCPB.RtcPullKV,"\n {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity \n {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n message ").concat(RTCPB.RtcKVOutput,"\n {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType \n {\n AnchorToViewer = 1; //1 为主播变观众\n ViewerToAnchor = 2; //2 为观众变主播\n }\n message ").concat(RTCPB.RtcQueryUserJoinedInput,"\n {\n required string userId = 1;\n }\n message RtcJoinedInfo\n {\n required string deviceId = 1; //设备 ID\n required string roomId = 2; //加入的房间 ID\n optional int64 joinTime = 3; //加入的时间\n }\n message ").concat(RTCPB.RtcQueryUserJoinedOutput,"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message ").concat(RTCPB.RtcViewerJoinedOutput,"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV 属性对象集合\n optional int64 syncTime = 3;//所有属性的最大时间戳(下次拉取 KV 时用)。\n }\n message ").concat(RTCPB.RtcInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n optional int32 timeoutTime=2; //邀请超时时间 (秒),默认三十秒\n required string invitedRoomId=3; //被邀请的房间\n required string inviteInfo=4; //邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId= 5; //客户端保证唯一性 (建议 roomid_userid_时间戳_随机数)\n }\n message ").concat(RTCPB.RtcCancelInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n required string invitedRoomId=2; //被邀请的房间\n required string inviteInfo=3; //取消邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId=4; //邀请的 sessionId,客户端发起邀请时产生\n }\n message ").concat(RTCPB.RtcInviteAnswerInput,"\n {\n required string inviteUserId=1; //邀请的人的 uid\n required int32 answerCode=2; //是否接受连麦邀请.0 为拒绝,1 为接受\n required string inviteRoomId=3; //邀请的房间\n required string inviteSessionId=4; //邀请的 sessionId\n required string content=5; //需要转发的 content\n optional string key=6; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n optional string value=7; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n }\n message ").concat(RTCPB.RtcEndInviteInput,"\n {\n required string inviteRoomId=1; //邀请的房间\n required string inviteSessionId=2; //邀请的 sessionId\n required string inviteContent=3; //结束连麦的信息 (需要透传给房间内其他人)\n repeated string inviteRoomKeys=4; //需要删除连麦的信息的 key\n }\n}\n"),encodeRtcInput=function(e,t,r,n,i,o){var a=i?Object.keys(i).map((function(t){return e.encode(RTCPB.RtcValueInfo,{key:t,value:i[t]},!0)})):void 0,s=o?Object.keys(o).map((function(t){return e.encode(RTCPB.RtcValueInfo,{key:t,value:o[t]},!0)})):void 0;return e.encode(RTCPB.RtcInput,{roomType:t,broadcastType:r,joinType:n,innerDatas:a,outerDatas:s})},decodeRtcUserListOutput=function(e,t){var r=e.decode(RTCPB.RtcUserListOutput,t),n=r.users,i=r.token,o=r.sessionId,a=r.roomInfo,s=r.entries,u=r.offlineKickTime,l={};return forEach(n,(function(e){var t=e.userId,r=e.userData,n={};forEach(r,(function(e){var t=e.key,r=e.value;n[t]=r})),l[t]=n})),{users:l,token:i,sessionId:o,roomInfo:a,kvEntries:s,offlineKickTime:u}},RTCEntryHandler=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 __awaiter(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,r=e.timestamp,(n=this._pullTime)>r?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,n)]);case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS?(this._isPulling=!1,this._pullTime=a||0,this._startPull()):this._startPull(),[2]}}))}))}}),Object.defineProperty(e.prototype,"pullEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._pullTime=0,this._isPulling=!1}}),e}(),BasicEngine=function(){function e(e,t,r,n){Object.defineProperty(this,"rtcCodec",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcKVManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcSignalingListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._appkey=this._options.appkey,this._rtcKVManager=new RTCEntryHandler(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 __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return t=this.rtcCodec.encode(RTCPB.RtcPullKV,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,RTC_API.rtcPullKv,!0,t)];case 1:return(r=a.sent()).isOk?(n=this.rtcCodec.decode(RTCPB.RtcKVOutput,r.data),i=n.entries,o=n.syncTime,i=(i||[]).map((function(e){return __assign(__assign({},e),{timestamp:e.timestamp})})),this._watcher.onRTCDataChange(i,e),[2,ok(o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"_receiveRtcKv",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=this.rtcCodec.decode(RTCPB.RtcNotifyMsg,e),r=t.time,n=t.type,i=t.roomId;1===n&&this._rtcKVManager.pullEntry(i,r)}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),e}(),StreamMessageResponseEventType,_SSEModule_instances,_SSEModule_context,_SSEModule_sseCache,_SSEModule_inElectron,_SSEModule_logger_get,_SSEModule_onSSEClientClose,_SSEModule_emitStreamMessageResponseEvent,_SSEModule_updateMessageContent,_SSEModule_parseSSEEvent,_SSEModule_createSSEConnection;exports.StreamMessageResponseEventType=void 0,StreamMessageResponseEventType=exports.StreamMessageResponseEventType||(exports.StreamMessageResponseEventType={}),StreamMessageResponseEventType.INIT="INIT",StreamMessageResponseEventType.DATA="DATA",StreamMessageResponseEventType.END="END";var SSEModule=function(e){function t(t,r){var n=e.call(this)||this;return _SSEModule_instances.add(n),_SSEModule_context.set(n,void 0),_SSEModule_sseCache.set(n,new Map),_SSEModule_inElectron.set(n,void 0),__classPrivateFieldSet(n,_SSEModule_context,t,"f"),__classPrivateFieldSet(n,_SSEModule_inElectron,r,"f"),n}return __extends(t,e),Object.defineProperty(t.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=__classPrivateFieldGet(this,_SSEModule_instances,"a",_SSEModule_logger_get).createTraceId(),__classPrivateFieldGet(this,_SSEModule_instances,"a",_SSEModule_logger_get).info(Log.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,Validator.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(__classPrivateFieldGet(this,_SSEModule_context,"f").validateConnected).tryTrans((function(e){var t,r;return(null===(r=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===r?void 0:r.length)?ok(e.streamServer.addrs):fail(exports.ErrorCode.STREAM_MESSAGE_DISABLE)})).next((function(t){return __classPrivateFieldGet(n,_SSEModule_instances,"m",_SSEModule_createSSEConnection).call(n,e,t)}))];case 1:return r=i.sent(),__classPrivateFieldGet(this,_SSEModule_instances,"a",_SSEModule_logger_get).summary(Log.L_REQ_STREAM_MSG_CONTENT_R,r,t,{messageUId:e}),[2,r.wipe()]}}))}))}}),t}(EventDispatcher);_SSEModule_context=new WeakMap,_SSEModule_sseCache=new WeakMap,_SSEModule_inElectron=new WeakMap,_SSEModule_instances=new WeakSet,_SSEModule_logger_get=function(){return __classPrivateFieldGet(this,_SSEModule_context,"f").logger},_SSEModule_onSSEClientClose=function(e,t,r){var n=__classPrivateFieldGet(this,_SSEModule_sseCache,"f").get(e);n&&(__classPrivateFieldGet(this,_SSEModule_sseCache,"f").delete(e),__classPrivateFieldGet(this,_SSEModule_instances,"m",_SSEModule_emitStreamMessageResponseEvent).call(this,e,exports.StreamMessageResponseEventType.END,t,n.msg))},_SSEModule_emitStreamMessageResponseEvent=function(e,t,r,n,i){this.emit("message",{code:r,messageUId:e,type:t,chunk:i,message:n})},_SSEModule_updateMessageContent=function(e,t){e.content=__assign(__assign({},e.content),t),__classPrivateFieldGet(this,_SSEModule_context,"f")._innerSetMessageContent(e.messageId,JSON.stringify(e.content),e.messageType)},_SSEModule_parseSSEEvent=function(e,t,r){var n,i,o=__classPrivateFieldGet(this,_SSEModule_sseCache,"f").get(t);switch(e){case"init":o.msg&&__classPrivateFieldGet(this,_SSEModule_instances,"m",_SSEModule_updateMessageContent).call(this,o.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),__classPrivateFieldGet(this,_SSEModule_instances,"m",_SSEModule_emitStreamMessageResponseEvent).call(this,t,exports.StreamMessageResponseEventType.INIT,exports.ErrorCode.SUCCESS,o.msg);break;case"complete":i=(n=r.length?JSON.parse(r):{}).complete||!1,o.msg&&__classPrivateFieldGet(this,_SSEModule_instances,"m",_SSEModule_updateMessageContent).call(this,o.msg,{stopReason:n.stopReason||0,completeReason:n.completeReason||0,complete:i,isSynced:i}),__classPrivateFieldGet(this,_SSEModule_instances,"m",_SSEModule_onSSEClientClose).call(this,t,n.stopReason||0,i);break;default:n=JSON.parse(r),o.cached+=n.content,o.msg&&__classPrivateFieldGet(this,_SSEModule_instances,"m",_SSEModule_updateMessageContent).call(this,o.msg,{content:o.cached}),__classPrivateFieldGet(this,_SSEModule_instances,"m",_SSEModule_emitStreamMessageResponseEvent).call(this,t,exports.StreamMessageResponseEventType.DATA,exports.ErrorCode.SUCCESS,o.msg,{content:n.content,fullContent:o.cached})}},_SSEModule_createSSEConnection=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,l=this;return __generator(this,(function(c){switch(c.label){case 0:return __classPrivateFieldGet(this,_SSEModule_sseCache,"f").has(e)?[2,fail(exports.ErrorCode.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:__classPrivateFieldGet(this,_SSEModule_sseCache,"f").size>=3?[2,fail(exports.ErrorCode.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(r=runtime.createSSEClient({logger:__classPrivateFieldGet(this,_SSEModule_instances,"a",_SSEModule_logger_get),msgUId:e,appkey:__classPrivateFieldGet(this,_SSEModule_context,"f").appkey,token:__classPrivateFieldGet(this,_SSEModule_context,"f").token,timeout:3e4,onRawContent:function(t){t.split("\n\n").forEach((function(t){if(0!==t.length){t.startsWith("data:")&&(t="event:delta\n".concat(t));var r=t.indexOf("\n"),n=t.slice(0,r).replace("event:",""),i=t.slice(r+1+5);__classPrivateFieldGet(l,_SSEModule_instances,"m",_SSEModule_parseSSEEvent).call(l,n,e,i.trim())}}))},onNetworkError:function(t){__classPrivateFieldGet(l,_SSEModule_instances,"m",_SSEModule_onSSEClientClose).call(l,e,t,!1)}}),r.isOk?(n=r.data,i={client:n,cached:"",msg:void 0},__classPrivateFieldGet(this,_SSEModule_sseCache,"f").set(e,i),__classPrivateFieldGet(this,_SSEModule_inElectron,"f")?[4,__classPrivateFieldGet(this,_SSEModule_context,"f").getLocalMessage(e)]:[3,2]):[2,r.wipe()]);case 1:if(o=c.sent(),a=o.code,!(s=o.data))return __classPrivateFieldGet(this,_SSEModule_sseCache,"f").delete(e),[2,fail(a,"message not found, msgUId: ".concat(e))];if(s.content.isSynced)return __classPrivateFieldGet(this,_SSEModule_sseCache,"f").delete(e),[2,fail(exports.ErrorCode.STREAM_MESSAGE_SYNCED,"synced")];i.msg=s,c.label=2;case 2:return[4,n.open(t.slice())];case 3:return(u=c.sent()).isOk||__classPrivateFieldGet(this,_SSEModule_sseCache,"f").delete(e),[2,u.wipe()]}}))}))};var PluginContext=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 Codec(t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new Codec$1(e)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(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-c-rtc-alpha.1"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.32.0-c-rtc-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,r){return console.warn("[PluginContext] sendMessage is deprecated, please use sendMessageTo instead"),this.sendMessageTo({conversationType:e,targetId:t,channelId:r.channelId},r)}}),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,r,n){void 0===n&&(n=[]),this._context.registerMessageType(e,t,r,n)}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getServerTime()}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.setCallInfo(e,t,r)}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getStatsUrlList()}}),e}(),RTCPluginContext=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"joinRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return __awaiter(this,void 0,void 0,(function(){var a,s,u,l,c;return __generator(this,(function(_){switch(_.label){case 0:return a=encodeRtcInput(this._context.rtcCodec,t,r,n,i,o),[4,this.rtcSignaling(e,RTC_API.rtcRJoin_data,!0,a)];case 1:return s=_.sent(),u=s.code,l=s.buffer,u===exports.ErrorCode.SUCCESS&&l&&(c=decodeRtcUserListOutput(this._context.rtcCodec,l)),[2,{code:u,data:c}]}}))}))}}),Object.defineProperty(t.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=this._context.rtcCodec.encode(RTCPB.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,RTC_API.rtcRExit,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,this._context.rtcPing(e,t,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"rtcPingResVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.rtcPing(e,t,r)}}),Object.defineProperty(t.prototype,"getRTCRoomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(RTCPB.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,RTC_API.rtcRInfo,!0,t)];case 1:return r=a.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i&&(o=this._context.rtcCodec.decode(RTCPB.RtcRoomInfoOutput,i)),[2,{code:n,data:o}]}}))}))}}),Object.defineProperty(t.prototype,"getRTCUserInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(RTCPB.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,RTC_API.rtcUData,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i&&(a=decodeRtcUserListOutput(this._context.rtcCodec,i),o={users:a.users}),[2,{code:n,data:o}]}}))}))}}),Object.defineProperty(t.prototype,"getRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("Method not implemented.")}}),Object.defineProperty(t.prototype,"setRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=this._context.rtcCodec.encode(RTCPB.RtcValueInfo,{key:t,value:r}),[4,this.rtcSignaling(e,RTC_API.rtcUPut,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"removeRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=this._context.rtcCodec.encode(RTCPB.RtcKeyDeleteInput,{key:t}),[4,this.rtcSignaling(e,RTC_API.rtcUDel,!1,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"setRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return __awaiter(this,void 0,void 0,(function(){var a;return __generator(this,(function(s){switch(s.label){case 0:return a=this._context.rtcCodec.encode(RTCPB.RtcSetDataInput,{interior:n,target:i,key:t,value:r,objectName:null==o?void 0:o.name,content:null==o?void 0:o.content}),[4,this.rtcSignaling(e,RTC_API.rtcSetData,!1,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=""),__awaiter(this,void 0,void 0,(function(){var o,a;return __generator(this,(function(s){switch(s.label){case 0:return o={objectName:n,content:this._context.rtcCodec.encode(RTCPB.RtcValueInfo,{key:t.name,value:t.content},!0),valueInfo:[this._context.rtcCodec.encode(RTCPB.RtcValueInfo,{key:"uris",value:r},!0),this._context.rtcCodec.encode(RTCPB.RtcValueInfo,{key:"mcu_uris",value:i},!0)]},a=this._context.rtcCodec.encode(RTCPB.RtcUserSetDataInput,o),[4,this.rtcSignaling(e,RTC_API.userSetData,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=this._context.rtcCodec.encode(RTCPB.RtcUserSetDataInput,{objectName:t,valueInfo:this._context.rtcCodec.encode(RTCPB.RtcValueInfo,{key:"cdn_uris",value:r},!0)}),[4,this.rtcSignaling(e,RTC_API.userSetData,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"getRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,u,l;return __generator(this,(function(c){switch(c.label){case 0:return i=this._context.rtcCodec.encode(RTCPB.RtcDataInput,{interior:r,target:n,key:t}),[4,this.rtcSignaling(e,RTC_API.rtcQryData,!0,i)];case 1:return o=c.sent(),a=o.code,s=o.buffer,a===exports.ErrorCode.SUCCESS&&s?(u=this._context.rtcCodec.decode(RTCPB.RtcQryOutput,s).outInfo,l={},u.forEach((function(e){l[e.key]=e.value})),[2,{code:a,data:l}]):[2,{code:a}]}}))}))}}),Object.defineProperty(t.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(a){switch(a.label){case 0:return o=this._context.rtcCodec.encode(RTCPB.RtcDataInput,{interior:r,target:n,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,RTC_API.rtcDelData,!1,o)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(t.prototype,"getRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(t.prototype,"getRTCToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return n=encodeRtcInput(this._context.rtcCodec,t,r),[4,this.rtcSignaling(e,RTC_API.rtcToken,!0,n)];case 1:return i=u.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(s=this._context.rtcCodec.decode(RTCPB.RtcTokenOutput,a).rtcToken,[2,{code:o,data:{rtcToken:s}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(t.prototype,"setRTCState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=this._context.rtcCodec.encode(RTCPB.MCFollowInput,{state:t}),[4,this.rtcSignaling(e,RTC_API.rtcUserState,!0,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(RTCPB.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,RTC_API.rtcUList,!0,t)];case 1:return r=a.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=decodeRtcUserListOutput(this._context.rtcCodec,i),[2,{code:n,data:o}]):[2,{code:n}]}}))}))}}),Object.defineProperty(t.prototype,"joinLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s,u,l;return __generator(this,(function(c){switch(c.label){case 0:return n=encodeRtcInput(this._context.rtcCodec,t,r),[4,this.rtcSignaling(e,RTC_API.viewerJoinR,!0,n)];case 1:return i=c.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(s=this._context.rtcCodec.decode(RTCPB.RtcViewerJoinedOutput,a),u=s.rtcToken,l=s.entries,[2,{code:o,data:{token:u,kvEntries:l}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(t.prototype,"quitLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=this._context.rtcCodec.encode(RTCPB.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,RTC_API.viewerExitR,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"rtcIdentityChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return n=this._context.rtcCodec.encode(RTCPB.RtcInput,{roomType:exports.RTCMode.LIVE,broadcastType:r,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,RTC_API.rtcIdentityChange,!0,n)];case 1:return i=u.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(s=decodeRtcUserListOutput(this._context.rtcCodec,a),[2,{code:o,data:s}]):[2,{code:o}]}}))}))}}),Object.defineProperty(t.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,a=e.roomId,s=this._context.rtcCodec.encode(RTCPB.RtcInviteInput,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(a,RTC_API.rtcInvite,!0,s)];case 1:return[2,u.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,a=this._context.rtcCodec.encode(RTCPB.RtcCancelInviteInput,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,inviteInfo:i}),[4,this.rtcSignaling(o,RTC_API.rtcCancelInvite,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,l;return __generator(this,(function(c){switch(c.label){case 0:return t=e.inviteUserId,r=e.inviteRoomId,n=e.inviteSessionId,i=e.content,o=e.key,a=e.value,s=e.agree,u=e.roomId,l=this._context.rtcCodec.encode(RTCPB.RtcInviteAnswerInput,{inviteUserId:t,inviteRoomId:r,inviteSessionId:n,content:i,key:o,value:a,answerCode:s?1:0}),[4,this.rtcSignaling(u,RTC_API.rtcInviteAnswer,!0,l)];case 1:return[2,c.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return t=e.endRoomId,r=e.sessionId,n=e.content,i=e.keys,o=e.roomId,a=this._context.rtcCodec.encode(RTCPB.RtcEndInviteInput,{inviteRoomId:t,inviteSessionId:r,inviteContent:n,inviteRoomKeys:i}),[4,this.rtcSignaling(o,RTC_API.rtcEndInvite,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(t.prototype,"registerRTCSignalListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.registerRTCSignalingListener(e)}}),Object.defineProperty(t.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(o){switch(o.label){case 0:return[4,this._context.rtcSignaling(e,t,r,n)];case 1:return[2,{code:(i=o.sent()).code,buffer:i.data}]}}))}))}}),Object.defineProperty(t.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(RTCPB.RtcQueryUserJoinedInput,{userId:e}),[4,this.rtcSignaling("",RTC_API.rtcQueryJoined,!0,t)];case 1:return r=a.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=this._context.rtcCodec.decode(RTCPB.RtcQueryUserJoinedOutput,i).info||[],[2,{code:n,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:n}]}}))}))}}),t}(PluginContext),_a$5,AssertRules;exports.AssertRules=void 0,AssertRules=exports.AssertRules||(exports.AssertRules={}),AssertRules[AssertRules.STRING=0]="STRING",AssertRules[AssertRules.ONLY_STRING=1]="ONLY_STRING",AssertRules[AssertRules.NUMBER=2]="NUMBER",AssertRules[AssertRules.BOOLEAN=3]="BOOLEAN",AssertRules[AssertRules.OBJECT=4]="OBJECT",AssertRules[AssertRules.ARRAY=5]="ARRAY",AssertRules[AssertRules.CALLBACK=6]="CALLBACK",AssertRules[AssertRules.CHANNEL_ID=7]="CHANNEL_ID";var validators=(_a$5={},_a$5[exports.AssertRules.STRING]=notEmptyString,_a$5[exports.AssertRules.ONLY_STRING]=isString,_a$5[exports.AssertRules.NUMBER]=isNumber,_a$5[exports.AssertRules.BOOLEAN]=function(e){return"boolean"==typeof e},_a$5[exports.AssertRules.OBJECT]=isObject,_a$5[exports.AssertRules.ARRAY]=isArray,_a$5[exports.AssertRules.CALLBACK]=function(e){var t=!0;return isObject(e)||(t=!1),(e=e||{}).onSuccess&&!isFunction(e.onSuccess)&&(t=!1),e.onError&&!isFunction(e.onError)&&(t=!1),t},_a$5[exports.AssertRules.CHANNEL_ID]=isValidChannelId,_a$5),RCAssertError=function(e){function t(t){var r=e.call(this,t)||this;return r.name="RCAssertError",r}return __extends(t,e),t}(Error),assert=function(e,t,r,n){if(void 0===n&&(n=!1),!validate(e,t,r,n))throw new RCAssertError("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},validate=function(e,t,r,n){void 0===n&&(n=!1),r=validators[r]||r;var i=n?r(t):isUndefined(t)||null==t||r(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},validateMessageSearchProps=function(e,t){var r=getMessageTypeDescription(e).searchProps;return r&&0!==r.length?r.every((function(e){return void 0!==t[e]}))?ok():fail(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR):ok()},createConversationValidator=function(e,t,r){return validateConversation(Validator.create(e),t,r)},validateConversation=function(e,t,r){return e.isFailed||e.isObject("conversation",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return isInConversationTypeList(null==t?void 0:t.conversationType,r)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID),e},validateMessageAttrsForUpdateExpansion=function(e,t,r){return e.check((function(e){return validateConversation(e,t,ConversationTypes.SG_UG)})).check((function(e){var n=null==t?void 0:t.messageType;notEmptyString(n)?n===MessageType.STREAM_MESSAGE&&r.includes("RC_Ext_StreamMsgSummary")&&e.setFailed(exports.ErrorCode.STREAM_MESSAGE_EXPANSION_KEY_ERROR):e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE)})).check((function(e){(null==t?void 0:t.canIncludeExpansion)||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isNotEmptyString("messageUId",null==t?void 0:t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTimestamp("sentTime",null==t?void 0:t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP),e},validateMessageExpansion=function(e,t,r){return e.check((function(e){r||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isObject("expansion",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION).check((function(e){var r=Object.keys(t);if(r.length>20||0===r.length)e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET);else if(r.some((function(e){return!/^[A-Za-z0-9_=+-]+$/.test(e)||"string"!=typeof t[e]})))e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION);else{r.some((function(e){return e.length>MAX_MESSAGE_EXPANSION_KEY_LENGTH||t[e].length>MAX_MESSAGE_EXPANSION_VAL_LENGTH}))&&e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET)}})),e},validateProxy=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(exports.ErrorCode.INVALID_PARAMETER_PROXY),e):e};function stringToBytes(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)}var getByteLength=function(e){return stringToBytes(e).byteLength},rootStorage,createRootStorage=function(){return rootStorage||(rootStorage={set:function(e,t){runtime.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(runtime.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return runtime.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in runtime.localStorage)e.push(t);return e}}),rootStorage},AppCache=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}(),AppStorage=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=createRootStorage();var r=this._rootStorage.get(e)||{};this._cache=new AppCache(((t={})[e]=r,t)),this._storageKey=e}return Object.defineProperty(e.prototype,"_get",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;return this._cache.get(e)||{}}}),Object.defineProperty(e.prototype,"_set",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._get();r[e]=t,this._set(r)}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._get();delete t[e],this._set(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._get()[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._get(),t=[];for(var r in e)t.push(r);return t}}),Object.defineProperty(e.prototype,"getValues",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._get()||{}}}),Object.defineProperty(e.prototype,"update",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)}}),e}(),customDeviceId="",getDeviceId=function(){var e="";if(customDeviceId)return customDeviceId;if("browser"===runtime.tag)return SESSION_ID;var t="RCDeviceId",r=createRootStorage(),n=r.get(t);return n?e=n:(e=UUId.genWithLen(22),r.set(t,e)),e},setDeviceId=function(e){e&&(customDeviceId=e)},getUUID=function(){return UUId.gen()},getUUID22=function(){return UUId.genWithLen(22)},packageName="",getPackageName=function(){return packageName},setPackageName=function(e){packageName=e},parseDownStreamMessageStatus=function(e){return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:!!(2&e)?exports.ReceivedStatus.RETRIEVED:exports.ReceivedStatus.UNREAD,canIncludeExpansion:!!(1024&e)}},calcDownStreamMessageStatus=function(e,t,r,n,i){var o=0;return e&&(o|=16),t&&(o|=32),r&&(o|=64),n&&(o|=512),i&&(o|=1024),o},parseMessageContent=function(e){var t;try{t=JSON.parse(e)}catch(r){t=e}if(null==t?void 0:t.user){var r=t.user,n=r.portrait,i=r.portraitUri,o=n||i;o&&(t.user.portrait=t.user.portraitUri=o)}return t},parseMessageExpansion=function(e){var t={};try{var r=JSON.parse(e);Object.entries(r).forEach((function(e){var r=__read(e,2),n=r[0],i=r[1];t[n]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},parseDownStreamMessageExtStatus=function(e){var t=e||0;return{isInterrupt:!!(2&t),isModifyMessage:!!(4&t),isPrivateChannel:!!(8&t),isStatusMessage:!!(64&t)}},getConversation=function(e){var t;return((t={})[Topic.ppMsgP]=exports.ConversationType.PRIVATE,t[Topic.pgMsgP]=exports.ConversationType.GROUP,t[Topic.chatMsg]=exports.ConversationType.CHATROOM,t[Topic.ugMsg]=exports.ConversationType.ULTRA_GROUP,t[Topic.pcMsgP]=exports.ConversationType.CUSTOMER_SERVICE,t[Topic.pbMsgP]=exports.ConversationType.SYSTEM,t)[e]||exports.ConversationType.PRIVATE},parseIPBUpStreamMessage=function(e,t,r,n){var i,o,a=codec.decode(IMPB.UpStreamMessage,e.pbData),s=string2Topic(e.topic);if(s===Topic.recallMsg){var u=JSON.parse(a.content);i=u.conversationType,o=u.targetId}else i=getConversation(s),o=e.targetId;var l=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(i),c=l?o:t,_=l?"":o,d=parseUpStreamMessageSessionId(a.sessionId),p=d.isPersited,g=d.isCounted,f=d.isMentioned,h=d.disableNotification,E=d.canIncludeExpansion;return{fromUserId:c,type:i,groupId:_,classname:a.classname,content:a.content,dataTime:r,status:calcDownStreamMessageStatus(p,g,f,h,E),msgId:n,direction:exports.MessageDirection.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}},trans2IReceivedMessage=function(e,t,r,n){void 0===r&&(r=!1);var i=e.type,o=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(i)?n||e.fromUserId:e.groupId||n,a=parseDownStreamMessageStatus(e.status),s=a.isMentioned,u=a.disableNotification,l=a.receivedStatus,c=a.canIncludeExpansion,_=e.direction===exports.MessageDirection.SEND?exports.MessageDirection.SEND:exports.MessageDirection.RECEIVE,d=trans2IPushConfig(e.configFlag||0,e.pushContent,e.pushExt),p=parseDownStreamMessageExtStatus(e.extStatus),g=p.isInterrupt,f=p.isModifyMessage,h=p.isPrivateChannel,E=p.isStatusMessage,T=getMessageTypeDescription(e.classname),b=T.isCounted,v=T.isPersited,R=T.isStatusMessage;return{conversationType:i,targetId:o,senderUserId:_===exports.MessageDirection.SEND?t:e.fromUserId,messageType:e.classname,messageUId:e.msgId,isPersited:v,isCounted:b,isMentioned:s,sentTime:e.dataTime,messageDirection:_,receivedTime:Date.now(),disableNotification:u,receivedStatus:l,receivedStatusInfo:trans2IReceivedStatusInfo(l),canIncludeExpansion:c,content:parseMessageContent(e.content),expansion:e.extraContent?parseMessageExpansion(e.extraContent):null,pushConfig:d,channelId:e.busChannel||"",isInterrupt:g,isModifyMessage:f,messageId:e.clientUniqueId||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:r,channelType:h?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,isStatusMessage:E||!!R,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0,modifyInfo:handleModifyInfo(e.convertExt)}},encodeUpStreamStreamSessionId=function(e,t,r,n,i){var o=0,a=getMessageTypeDescription(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),r&&(o|=32),n&&(o|=64),o},parseUpStreamMessageSessionId=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}},encodeUpStreamMessageConfigFlag=function(e,t,r,n){var i=0;return e&&(i|=1),t&&(i|=2),r&&(i|=4),n&&(i|=8),i},handleModifyInfo=function(e){if(e)try{var t=JSON.parse(e).modify;if(t.time)return{timestamp:t.time,content:{},status:MessageModifyStatus.SUCCESS}}catch(t){console.error("parse message modify info error: ".concat(e),t)}},transRcCmd2RcNtf=function(e,t){var r=e.content,n=r.sentTime,i=r.messageUId,o=r.isDelete,a=r.isAdmin,s=r.directionalUserIdList,u={recallTime:n,recallActionTime:e.sentTime,admin:!!a,delete:!!o,isDelete:!!o,operatorId:e.senderUserId},l=__assign(__assign({},e),{content:u,messageType:MessageType.RECALL_NOTIFICATION_MESSAGE});return t&&(l.messageUId=i,l.sentTime=n,l.directedUserIds=s),l};function isEnableRealtimeSession(e){return 1&~((null==e?void 0:e.sessionMode)||0)?fail(exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):ok()}function onlyElectron(){return function(){return usingCppEngine()?ok():fail(exports.ErrorCode.NOT_SUPPORT,"Only support electron platform.")}}function correctUnreadCount(e){return Math.min(e,999)}var naviMemoryCatch={};function getDefaultNaviInfo(){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:urlCenter.getMiniCmpUrlList().join(",")}}var WebSocketNavi=function(e){function t(t,r,n,i,o){void 0===i&&(i="default");var a=e.call(this,t,r,n,runtime.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),runtime.useNavi,o)||this;return a._environment=i,a}return __extends(t,e),Object.defineProperty(t.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,a,s,u;return __generator(this,(function(l){switch(l.label){case 0:return o="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(r),"&callBack=x&v=").concat(FORMATED_VERSION,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(runtime.tag),this.logger.debug(Log.L_REQUEST_T,"req navi => ".concat(o),n),[4,runtime.httpReq({url:o,timeout:NAVI_REQ_TIMEOUT,dataType:"text"})];case 1:if(200!==(a=l.sent()).status)return this.logger.debug(Log.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!runtime.useNavi&&i?[2,ok(getDefaultNaviInfo())]:[2,fail(this.transHttpCode(a.status))];try{return 0===(s=a.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(s=JSON.parse('"'.concat(s,'"'))),(u=JSON.parse(s)).protocol=/^https/.test(o)?"https":"http",u.code&&200!==u.code?[2,fail(this.transHttpCode(u.code))]:(runtime.useNavi||(u.server="",u.backupServer=urlCenter.getMiniCmpUrlList().join(","),u.logSwitch=0),[2,ok(u)])}catch(e){this.logger.error(Log.L_PARSE_NAVI_E,a.data,n)}return[2,fail(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(t.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,a,s,u,l;return __generator(this,(function(c){switch(c.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:runtime.tag,protocol:(/^https/.test(e)?EConnectProtocol.WSS:EConnectProtocol.WS).toString()}),this.logger.debug(Log.L_REQUEST_T,"req navi => ".concat(o.url),n),[4,runtime.httpReq(o)];case 1:if(200!==(a=c.sent()).status)return this.logger.debug(Log.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!runtime.useNavi&&i?[2,ok(getDefaultNaviInfo())]:[2,fail(this.transHttpCode(a.status))];try{return s=a.data,(u="object"!=typeof s?JSON.parse(s):s).protocol=/^https/.test(o.url)?"https":"http",runtime.useNavi||(u.logSwitch=0,l=urlCenter.getMiniCmpUrlList(),u.serverAddr=l.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?EConnectProtocol.WSS:EConnectProtocol.WS,weight:l.length-t}}))),[2,ok(u)]}catch(e){this.logger.error(Log.L_PARSE_NAVI_E,a.data,n)}return[2,fail(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(t.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=this.getCatchKey(e);if(naviMemoryCatch[r])return naviMemoryCatch[r];var n,i=LOCAL_STORAGE_KEYS.NAVI_KEY(this.appkey),o=runtime.localStorage;try{var a=o.getItem(i);n=a?JSON.parse(a):[]}catch(e){n=[]}if(0===n.length)return null;var s=n.find((function(r){return r.token===e&&r.environment===t._environment}))||null;return naviMemoryCatch[r]=s,s}}),Object.defineProperty(t.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this,i=LOCAL_STORAGE_KEYS.NAVI_KEY(this.appkey),o=runtime.localStorage;try{var a=o.getItem(i);r=a?JSON.parse(a):[]}catch(e){r=[]}var s=Date.now();r.length>0&&(r=r.filter((function(t){return s-t.timestamp<NAVI_CACHE_DURATION&&(e!==t.token||n._environment!==t.environment)})));var u={timestamp:s,naviInfo:t,token:e,environment:this._environment};r.push(u),o.setItem(i,JSON.stringify(r)),naviMemoryCatch[this.getCatchKey(e)]=u}}),t}(BasicNavi),SendMessageStore=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=LOCAL_STORAGE_KEYS.SEND_MSG_KEY(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)}}),Object.defineProperty(e.prototype,"_getLocalInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=runtime.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}}}),Object.defineProperty(e.prototype,"setMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageMap[e]=t;var r=LOCAL_STORAGE_KEYS.SEND_MSG_KEY(this._appkey,this._userId),n=this._getLocalInfo(r);n[e]=t,runtime.localStorage.setItem(r,JSON.stringify(n))}}),Object.defineProperty(e.prototype,"getSendMessageMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._sendMessageMap}}),Object.defineProperty(e.prototype,"removeByUID",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._sendMessageMap[e]}}),Object.defineProperty(e.prototype,"removeByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=LOCAL_STORAGE_KEYS.SEND_MSG_KEY(this._appkey,this._userId),r=this._getLocalInfo(t);Object.keys(r).forEach((function(t){r[t]<e&&delete r[t]})),runtime.localStorage.setItem(t,JSON.stringify(r))}}),e}(),SubscribeStore=function(){function e(e){var t;Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"subscribeData",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[exports.SubscribeType.ONLINE_STATUS]={},t[exports.SubscribeType.USER_PROFILE]={},t)}),Object.defineProperty(this,"_ownProfile",{enumerable:!0,configurable:!0,writable:!0,value:null})}return Object.defineProperty(e.prototype,"clearSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;this.subscribeData=((e={})[exports.SubscribeType.ONLINE_STATUS]={},e[exports.SubscribeType.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===exports.SubscribeType.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].statusMap={}})):e===exports.SubscribeType.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].profile=void 0}))}}),Object.defineProperty(e.prototype,"getSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.subscribeData[e][t];return r?__assign({},r):void 0}}),Object.defineProperty(e.prototype,"removeSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){delete this.subscribeData[e][t]}}),Object.defineProperty(e.prototype,"updateSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.subscribeData[e][t]=r}}),Object.defineProperty(e.prototype,"clearExpiredData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t in this.subscribeData[e]){var r=this.subscribeData[e][t];r.expiry<(Date.now()+this._delayTime-r.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __spreadArray([],__read(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(r,r+t)}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=__assign(__assign({},null===(t=this._ownProfile)||void 0===t?void 0:t.extraProfile),e.extraProfile);this._ownProfile=__assign(__assign(__assign({},this._ownProfile),e),{extraProfile:r})}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ownProfile?__assign(__assign({},this._ownProfile),{extraProfile:__assign({},this._ownProfile.extraProfile)}):null}}),e}(),SubscribeService=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 SubscribeStore(e)}return Object.defineProperty(e.prototype,"updateRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)}}),Object.defineProperty(e.prototype,"getRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._relationshipStatusVersion}}),Object.defineProperty(e.prototype,"updateSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)}}),Object.defineProperty(e.prototype,"getSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subUserStatusVersion}}),Object.defineProperty(e.prototype,"_filterSubscribeRelationData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(r){var n=e.find((function(e){return e.subscribeType===t.subType&&e.userId===r.subUserId}));n?n.subscribeTime<t.subTime&&(n.expiry=t.expiry,n.operationType=t.opType,n.subscribeTime=t.subTime):e.push({userId:r.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=!1);var n=[],i=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,a,s=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===exports.SubscribeOperationType.UNSUBSCRIBE)return r._subStore.removeSubscribeUserData(l,s),void o.push(e);var _=r._subStore.getSubscribeUserData(l,s);if(!(_&&_.subscribeTime>=u)){if(l===exports.SubscribeType.ONLINE_STATUS){n.push(s);var d=(null===(t=_)||void 0===t?void 0:t.statusMap)||{};r._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,statusMap:d})}else{i.push(s);var p=null===(a=_)||void 0===a?void 0:a.profile;r._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,profile:p,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:n,newSubscribeUserProfileList:i,subscribeUserChangeList:o}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(exports.SubscribeType.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(exports.SubscribeType.USER_PROFILE)}}),Object.defineProperty(e.prototype,"updateSubscribeUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var n=e.subUserId,i=e.data,o=t._subStore.getSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,n);if(o){var a=[],s=__assign({},o.statusMap);i.forEach((function(e){var t=e.platformInfo,r=e.versionTime,n=s[t];if(!(n&&n.changeTime>r)){var i={eventValue:e.value,changeTime:r};s[t]=i,a.push(__assign(__assign({},i),{platform:t}))}})),t._subStore.updateSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,n,{subscribeTime:o.subscribeTime,expiry:o.expiry,userId:n,subscribeType:exports.SubscribeType.ONLINE_STATUS,statusMap:s}),r.push({userId:n,subscribeType:exports.SubscribeType.ONLINE_STATUS,subscribeTime:o.subscribeTime,expiry:o.expiry,details:a})}})),r}}),Object.defineProperty(e.prototype,"updateSubscribeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var n=e.userId,i=e.version,o=e.userProfile,a=e.userExtProfile,s=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,n),u=transformUserProfiles(n,o,a);s?s.profile&&s.profile.version>=i||(t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,n,{subscribeTime:s.subscribeTime,expiry:s.expiry,userId:n,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:u,version:i},isSubscribed:s.isSubscribed}),s.isSubscribed&&r.push({userId:n,subscribeType:exports.SubscribeType.USER_PROFILE,subscribeTime:s.subscribeTime,expiry:s.expiry,userProfile:__assign({},u)})):t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,n,{subscribeTime:0,expiry:0,userId:n,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:u,version:i},isSubscribed:!1})})),r}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[];return t.forEach((function(t){var i=r._subStore.getSubscribeUserData(e,t);if(!i||i.expiry<(Date.now()+r._delayTime-i.subscribeTime)/1e3)r._subStore.removeSubscribeUserData(e,t);else{var o={subscribeTime:i.subscribeTime,expiry:i.expiry,userId:i.userId,subscribeType:i.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var a=i.statusMap,s=Object.keys(a).map((function(e){return __assign({platform:~~e},a[~~e])}));o.details=completeSubscriptionPlatformStatus(s)}else if(e===exports.SubscribeType.USER_PROFILE&&!i.isSubscribed)return;n.push(o)}})),n}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[],n=[];return e.forEach((function(e){var i=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,e);if(i&&i.profile){var o=i.profile,a=o.version,s=o.info;if(i.isSubscribed)return t._delayTime+Date.now()-a>SUBSCRIBE_USER_PROFILE_VALID_TIME?void n.push(e):void r.push(__assign(__assign({},s),{extraProfile:__assign({},s.extraProfile)}));t._delayTime+Date.now()-a>NON_SUBSCRIBE_USER_PROFILE_VALID_TIME?n.push(e):r.push(__assign(__assign({},s),{extraProfile:__assign({},s.extraProfile)}))}else n.push(e)})),{list:r,needQueryUserIds:n}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,r).map((function(t){var r={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var n=Object.keys(t.statusMap).map((function(e){return __assign({platform:~~e},t.statusMap[~~e])}));r.details=completeSubscriptionPlatformStatus(n)}return r}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subStore.getOwnProfile()}}),e}(),SubscribeManager=function(){function e(e,t,r,n,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:r}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_isOpenUserProfile",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_subDriven",{enumerable:!0,configurable:!0,writable:!0,value: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 SubscribeService(n)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return this._subDriven?[4,this._syncSubscribeRelationship(!1)]:[3,3];case 1:return e.sent(),[4,this._syncSubscribeUserStatus(!0)];case 2:e.sent(),e.label=3;case 3:return this._isOpenUserProfile?[4,this.syncOwnProfile()]:[3,5];case 4:e.sent(),e.label=5;case 5:return 1&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_USER_PROFILE),[2]}}))}))}}),Object.defineProperty(e.prototype,"startSyncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(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),__awaiter(this,void 0,void 0,(function(){return __generator(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=""),__awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,l,c,_,d,p,g;return __generator(this,(function(f){switch(f.label){case 0:return r=this._subscribeService.getRelationshipStatusVersion(),n=this._logger.createTraceId(),this._logger.info(Log.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:r,_pageToken:t}),n),i=codec.encode(IMPB.PullUserSubReq,{version:r,pageToken:t}),[4,this._connectManager.query(Topic.pullUserSub,this._currentUserId,i,IMPB.PUllUserSubResp)];case 1:return o=f.sent(),this._logger.summary(Log.L_PULL_SUBSCRIBED_USER_RELATION_R,o,n),o.isOk?(this._pullRelationshipFailTime=0,a=o.data,s=a.list,u=a.version,l=a.hasNext,c=a.pageToken,e?(_=this._subscribeService.updateSubscribeRelation(s),d=_.newSubscribeOnlineStatusList,p=_.newSubscribeUserProfileList,(g=_.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(g),d.length>0&&this._queryAndUpdateUserOnlineStatus(d),p.length>0&&this._queryAndUpdateUserProfile(p)):this._subscribeService.updateSubscribeRelation(s,!t),this._subscribeService.updateRelationshipStatusVersion(u),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>u})),l?[4,this._pullSubscribeRelationship(e,c)]:[3,3]):(this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:f.sent(),f.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"startsyncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(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),__awaiter(this,void 0,void 0,(function(){return __generator(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=""),__awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,l,c,_,d,p;return __generator(this,(function(g){switch(g.label){case 0:return r=this._subscribeService.getSubscribeUserStatusVersion(),n=this._logger.createTraceId(),this._logger.info(Log.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:r,_pageToken:t,needAllData:e}),n),i=codec.encode(IMPB.PullSubDataReq,{versionTime:r,needAllData:e,pageToken:t}),[4,this._connectManager.query(Topic.pullSubData,this._currentUserId,i,IMPB.PullSubDataResp)];case 1:return(o=g.sent()).isOk?(this._pullSubUserStatusFailTime=0,a=o.data,s=a.list,u=a.versionTime,l=a.hasNext,c=a.pageToken,_=a.isFull,this._logger.info(Log.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code}),n),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>u})),this._subscribeService.updateSubscribeUserStatusVersion(u),d=[],p=[],s.forEach((function(e){switch(e.subType){case exports.SubscribeType.ONLINE_STATUS:d.push(e);break;case exports.SubscribeType.USER_PROFILE:p.push(e.subUserId);case exports.SubscribeType.FRIEND_ONLINE_STATUS:case exports.SubscribeType.FRIEND_USER_PROFILE:}})),_&&""===t&&this._subscribeService.clearSubscribeStatus(),d.length>0&&this._updateUserOnlineStatus(d,!_),p.length>0?[4,this._queryAndUpdateUserProfile(p,!_)]:[3,3]):(this._logger.warn(Log.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code,failTime:this._pullSubUserStatusFailTime}),n),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:g.sent(),g.label=3;case 3:return l?[4,this._pullSubscribeUserStatus(e,c)]:[3,5];case 4:g.sent(),g.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return t=this._logger.createTraceId(),this._logger.info(Log.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),r=codec.encode(IMPB.QrySubDataReq,{subType:exports.SubscribeType.ONLINE_STATUS,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._connectManager.query(Topic.qrySubData,this._currentUserId,r,IMPB.PullSubDataResp)];case 1:return n=i.sent(),this._logger.summary(Log.L_QUERY_SUBSCRIBE_DATA_R,n,t),n.isOk?(this._updateUserOnlineStatus(n.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 r=this._subscribeService.updateSubscribeUserOnlineStatus(e);r=r.filter((function(e){return e.details&&e.details.length>0})),t&&r.length>0&&this._event.subscribeUserStatusChanged(r)}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!0),__awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u;return __generator(this,(function(l){switch(l.label){case 0:return r=this._logger.createTraceId(),this._logger.info(Log.L_PULL_USER_PROFILE_T,JSON.stringify(e),r),n=codec.encode(IMPB.PullUserProfileReq,{userId:e}),i=new QueryWriter(Topic.pullUserProfile,n,this._currentUserId),[4,this._connectManager.send(i,IMPB.UserProfiles)];case 1:return o=l.sent(),a=o.code,s=o.data,this._logger.info(Log.L_PULL_USER_PROFILE_R,JSON.stringify({code:a,data:s}),r),a!==exports.ErrorCode.SUCCESS?[2,fail(a)]:(u=this._subscribeService.updateSubscribeUserProfile(s.UserProfile),t&&u.length>0&&this._event.subscribeUserStatusChanged(u),[2,ok(s.UserProfile)])}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return(t=codec.decode(IMPB.SubDataDetail,e.pbData)).subType!==exports.SubscribeType.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==exports.SubscribeType.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==exports.SubscribeType.FRIEND_ONLINE_STATUS?[3,3]:(r=t.data.map((function(e){return{changeTime:e.versionTime,eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:r}]),[3,5]);case 3:return t.subType!==exports.SubscribeType.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:n=o.sent(),(i=n.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:transformUserProfiles(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),o.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subscribeService.getSubscribeUserList(e,t,r)}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),__awaiter(this,void 0,void 0,(function(){var i,o,a,s,u,l;return __generator(this,(function(c){switch(c.label){case 0:return i=codec.encode(IMPB.UpdateUserSubReq,{subType:t,opType:r,expiry:n,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._connectManager.query(Topic.updUserSub,this._currentUserId,i,IMPB.UpdateUserSubResp)];case 1:return o=c.sent(),a=o.code,s=o.data,u=o.isOk,a===exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT?[2,fail(a,"",s.subUsers.map((function(e){return e.subUserId})))]:u?(l=s.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:l,expiry:n,opType:r,subUsers:e.map((function(e){return{subUserId:e}}))}]),r===exports.SubscribeOperationType.SUBSCRIBE&&(t===exports.SubscribeType.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===exports.SubscribeType.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,o.wipe()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return t=this._subscribeService.getUserProfiles(e),r=t.needQueryUserIds,n=t.list,0===r.length?[2,ok(n)]:[4,this._queryAndUpdateUserProfile(r,!1)];case 1:return(i=a.sent()).isOk?(o=i.data.map((function(e){return transformUserProfiles(e.userId,e.userProfile,e.userExtProfile)})),[2,ok(__spreadArray(__spreadArray([],__read(n),!1),__read(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),__awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,l;return __generator(this,(function(c){switch(c.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(Log.L_PULL_OWN_PROFILE_T,"",t),r=codec.encode(IMPB.UserProfileInput,{nothing:1}),[4,this._connectManager.query(Topic.pullOwnProfile,this._currentUserId,r,IMPB.UserProfile)]):[2,fail(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE)];case 1:return n=c.sent(),this._logger.summary(Log.L_PULL_OWN_PROFILE_R,n,t),n.isOk?(i=n.data,o=i.userExtProfile,a=i.userProfile,s=i.version,u=i.userId,l=transformUserProfiles(u,a,o),this._subscribeService.updateOwnProfile(l,s),e&&this._event.ownUserProfileChanged(l),[2,ok(l)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,ok(e)]:[2,this.syncOwnProfile()]}))}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),ReadReceiptManager=function(){function e(e,t,r){Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._storage=new AppStorage(LOCAL_STORAGE_KEYS.READ_RECEIPT_KEY(e,t)),this._delayTime=r,this.clear()}return Object.defineProperty(e.prototype,"_getConversationKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"".concat(e.targetId,"_").concat(e.channelId)}}),Object.defineProperty(e.prototype,"_removeExcessData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=Object.keys(e).map((function(t){return{key:t,value:e[t]}})).sort((function(e,t){return e.value.t-t.value.t})).slice(-30),i={};try{for(var o=__values(n),a=o.next();!a.done;a=o.next()){var s=a.value;i[s.key]=s.value}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}}),Object.defineProperty(e.prototype,"insert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o;if(!(n<Date.now()-this._delayTime-READ_RECEIPT_CATCH_TIME)){var a=this._getConversationKey(e),s=this._storage.get(a)||{};if(!s[t]){var u={t:n,d:r};i&&(u.sId=i);var l=__assign(__assign({},s),((o={})[t]=u,o));Object.keys(l).length>30&&(l=this._removeExcessData(l)),this._storage.set(a,l)}}}}),Object.defineProperty(e.prototype,"addReadedUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=this._getConversationKey(e),o=this._storage.get(i)||{},a=o[t];if(a){if(a.us){if(a.us.includes(r))return}else a.us=[];a.us.push(r),this._storage.set(i,__assign(__assign({},o),((n={})[t]=a,n)))}}}),Object.defineProperty(e.prototype,"getReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=(this._storage.get(r)||{})[t];return n?{time:n.t,direction:n.d,users:n.us||[],senderId:n.sId}:null}}),Object.defineProperty(e.prototype,"getReceiptMessageDic",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._getConversationKey(e),r=this._storage.get(t)||{},n={};for(var i in r){var o=r[i];o.d===exports.MessageDirection.RECEIVE&&(n[o.sId]||(n[o.sId]=[]),n[o.sId].push(i))}return n}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=this._storage.get(r)||{};n[t]&&(delete n[t],0===Object.keys(n).length?this._storage.remove(r):this._storage.set(r,n))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.getValues(),t={};for(var r in e){var n=e[r],i={};for(var o in n){var a=n[o];Date.now()-this._delayTime-a.t<READ_RECEIPT_CATCH_TIME&&(i[o]=a)}Object.keys(i).length&&(t[r]=i)}this._storage.update(t)}}),e}(),WebSocketStaticConfigManager=function(e){function t(t,r){var n=e.call(this,t,r)||this;return Object.defineProperty(n,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:""}),n._storageKey=LOCAL_STORAGE_KEYS.STATIC_CONFIG_KEY(t),n}return __extends(t,e),Object.defineProperty(t.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return runtime.localStorage.getItem(this._storageKey)}}),Object.defineProperty(t.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){runtime.localStorage.setItem(this._storageKey,e)}}),Object.defineProperty(t.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){runtime.localStorage.removeItem(this._storageKey)}}),Object.defineProperty(t.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,runtime.httpReq({url:e})];case 1:return t=i.sent(),r=t.status,n=t.data,[2,{code:r,data:n}]}}))}))}}),Object.defineProperty(t.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,decryptCBC(e,STATIC_CONFIG_KEY,STATIC_CONFIG_IV)];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(Log.L_GET_STATIC_CONF_E,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),t}(BasicStaticConfigManager),_a$4,friendEventPBMap=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},groupOperationPBMap=function(e){return"ChannelEventData"},groupProfileChangePBMap=function(e){return"ChannelEventData"},ChangeTypeMap=(_a$4={},_a$4[GroupMsgChangeType.GROUP_OPERATION]=groupOperationPBMap,_a$4[GroupMsgChangeType.GROUP_PROFILE_CHANGE]=groupProfileChangePBMap,_a$4[FriendMsgChangeType.FRIEND_APPLICATION]=friendEventPBMap,_a$4),DataCodec=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"decodeByPBName",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=e,i={}[t];try{n=e.length>0&&codec.decode(t,e),isFunction(i)&&(n=i.call(this,n,r))}catch(e){this.logger.error(Log.L_PB_DECODE_E,t)}return n}}),Object.defineProperty(e.prototype,"formatEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.map((function(e){var r,n=e.businessId,i=e.time,o=e.changeType,a=e.originalId,s=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,_=e.operatorId,d=e.subChangeType,p=e.secondaryType,g=e.remindType,f=e.isRemindMe,h=e.extIds,E=e.eventData;return E&&(r=t._formatEventData(E,o,d)),{businessId:n,changeType:o,originalId:a,time:i,originalTime:s,secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:_,subChangeType:d,userGroupIds:h,secondaryType:p,remindType:g,isRemindMe:f,eventData:r}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n={};return e&&ChangeTypeMap[t]&&ChangeTypeMap[t](r)&&(n=codec.decode(ChangeTypeMap[t](r),e)||{}),n}}),e}(),_a$3,_b,disconnectMaps=(_a$3={},_a$3[DisconnectReason.OTHER_DEVICE_LOGIN]=exports.ErrorCode.RC_DISCONN_KICK,_a$3[DisconnectReason.BLOCK]=exports.ErrorCode.RC_DISCONN_EXCEPTION,_a$3[DisconnectReason.BLOCK_NEW]=exports.ErrorCode.RC_DISCONN_EXCEPTION,_a$3[DisconnectReason.REDIRECT_NEW]=exports.ErrorCode.RC_CONN_REDIRECTED,_a$3[DisconnectReason.TOKEN_EXPIRED]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,_a$3[DisconnectReason.ILLEGAL_PROTOCOL_VERSION]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,_a$3[DisconnectReason.ACCOUNT_CANCELLATION]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,_a$3),connAckMaps=(_b={},_b[ConnectAckStatus.ACCEPTED]=exports.ErrorCode.SUCCESS,_b[ConnectAckStatus.UNACCEPTABLE_PROTOCOL_VERSION]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,_b[ConnectAckStatus.IDENTIFIER_REJECTED]=exports.ErrorCode.RC_CONN_IDENTIFIER_REJECTED,_b[ConnectAckStatus.SERVER_UNAVAILABLE]=exports.ErrorCode.RC_CONN_SERVER_UNAVAILABLE,_b[ConnectAckStatus.TOKEN_INCORRECT]=exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,_b[ConnectAckStatus.NOT_AUTHORIZED]=exports.ErrorCode.RC_CONN_NOT_AUTHRORIZED,_b[ConnectAckStatus.REDIRECT]=exports.ErrorCode.RC_CONN_REDIRECTED,_b[ConnectAckStatus.PACKAGE_ERROR]=exports.ErrorCode.RC_CONN_PACKAGE_NAME_INVALID,_b[ConnectAckStatus.APP_BLOCK_OR_DELETE]=exports.ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED,_b[ConnectAckStatus.BLOCK]=exports.ErrorCode.RC_CONN_USER_BLOCKED,_b[ConnectAckStatus.TOKEN_EXPIRE]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,_b[ConnectAckStatus.DEVICE_ERROR]=exports.ErrorCode.RC_CONN_DEVICE_ERROR,_b[ConnectAckStatus.HOSTNAME_ERROR]=exports.ErrorCode.RC_CONN_HOSTNAME_ERROR,_b[ConnectAckStatus.HASOHTERSAMECLIENTONLINE]=exports.ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE,_b[ConnectAckStatus.OUT_OF_LIMIT]=exports.ErrorCode.RC_LISCENSE_COUNT_OUT_OF_LIMIT,_b[ConnectAckStatus.IN_OTHER_CLUSTER]=exports.ErrorCode.RC_CONN_WRONG_CLUSTER,_b[ConnectAckStatus.APP_AUTH_NOT_PASS]=exports.ErrorCode.RC_APP_AUTH_NOT_PASS,_b[ConnectAckStatus.OTP_USED]=exports.ErrorCode.RC_OTP_USED,_b[ConnectAckStatus.PLATFORM_ERROR]=exports.ErrorCode.RC_PLATFORM_ERROR,_b[ConnectAckStatus.ACCOUNT_CANCELLATION]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,_b[ConnectAckStatus.LICENSE_EXPIRED]=exports.ErrorCode.RC_LICENSE_EXPIRED,_b),transDisconnectReason2ErroCode=function(e){return disconnectMaps[e]},transConnAckStatus2ErrorCode=function(e){return connAckMaps[e]},checkIsStatusMessage=function(e){return[Topic.ppMsgS,Topic.pgMsgS,Topic.chatMsgS,Topic.prMsgS].includes(e)},WEB_SOCKET_TIMEOUT=5e3,IM_SIGNAL_TIMEOUT=3e4,formatWSUrl=function(e,t,r,n,i,o,a,s){var u,l=a?"&protocolVer=".concat(a):"",c=getDeviceId(),_=getPackageName();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(r,"&token=").concat(encodeURIComponent(n),"&sdkVer=").concat(FORMATED_VERSION,"&pid=").concat(o,"&deviceId=").concat(encodeURIComponent(c)).concat(1===s?"&baggage=".concat(encodeURIComponent("cid=".concat(i))):"","&apiVer=").concat(encodeURIComponent((null===(u=runtime.getApiVer)||void 0===u?void 0:u.call(runtime))||"||")).concat(runtime.connectPlatform?"&platform=".concat(runtime.connectPlatform):"").concat(l).concat(runtime.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(_)):"")},WebSocketManager=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return Object.defineProperty(i,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:function(){return i._idCount>=65535&&(i._idCount=0),++i._idCount}}),Object.defineProperty(i,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),i.codec=new DataCodec(i.logger),i}return __extends(t,e),Object.defineProperty(t.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(t.prototype,"getLocalConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime}}),Object.defineProperty(t.prototype,"getCrtServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}}),Object.defineProperty(t.prototype,"getDelayTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime-this._connectedTime}}),Object.defineProperty(t.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var r,i,o,a,s,u,l,c,_,d;return __generator(this,(function(p){switch(p.label){case 0:if(r=t.openAnti,i=t.type,o=t.baggageEnabled,a=this.getCmpList(t),this.logger.debug(Log.L_NAVI_CMP_R,JSON.stringify(a),n),0===(s=a.filter((function(e,t){return a.findIndex((function(t){return t.addr===e.addr}))===t})).sort((function(e,t){return e.weight>t.weight?-1:1}))).length)return this.logger.error(Log.L_NAVI_CONF_E,"no service available",n),[2,fail(exports.ErrorCode.SERVER_UNAVAILABLE)];u=1===r?ConnAckProtocolVer.V4:ConnAckProtocolVer.V3,l=function(t){var r,a,l,_,d,p,g,f,h,E,T;return __generator(this,(function(b){switch(b.label){case 0:return r=s[t],a=r.protocol,l=r.addr,_=r.weight,d=formatWSUrl(a===EConnectProtocol.WS?"ws":"wss",l,c.appkey,e,c.cid,"",u,o),p=Date.now(),[4,c.connectWebSocket(d,u,n)];case 1:return g=b.sent(),f=g.code,h=g.data,E=c.cmpWeightCache.findIndex((function(e){return e.addr===l})),T={bid:getbundleId(),ptc:ProtocalType.WS,cod:f,net:c.getNetwork().type,dur:Date.now()-p,spr:0,pr:i||0,hos:l,idx:E,rct:c.retryCount?ConnectType.RECONNECT:ConnectType.CONNECT,cid:c.cid,v:StatisticsVersion.CURRENT,rsn:c._doConnectReason,count:c.retryCount,weight:_,ssid:c._serverSessionId},c.logger.record(StatisticsTag.IM_WEBSOCKET,JSON.stringify(T),n),f===exports.ErrorCode.RC_SOCKET_DISCONNECTED||f===exports.ErrorCode.TIMEOUT?[2,"continue"]:f!==exports.ErrorCode.SUCCESS?[2,{value:fail(f)}]:(c._localConnectedTime=Math.floor((Date.now()+p)/2),c._socket=h.socket,c.updateCmpWeight(s[t].addr,!0),c.curCmpUrl=s[t].addr,[2,{value:ok(h.userId)}])}}))},c=this,_=0,p.label=1;case 1:return _<s.length?[5,l(_)]:[3,4];case 2:if("object"==typeof(d=p.sent()))return[2,d.value];p.label=3;case 3:return _+=1,[3,1];case 4:return[2,fail(exports.ErrorCode.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(t.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s,u,l,c,_,d=this;return __generator(this,(function(p){switch(p.label){case 0:return this.logger.info(Log.L_CONNECT_O,"connect start: ".concat(e),r),n=promiseWithResolvers(),i=n.resolve,o=n.promise,[4,runtime.createWebSocket(e)];case 1:return a=p.sent(),s=a.data,u=a.code,l=a.msg,u===exports.ErrorCode.SUCCESS&&s?(this._socketIndex=s.id,c=exports.ErrorCode.SUCCESS,_=setTimeout((function(){d.logger.warn(Log.L_CONNECT_S,"timeout",r),c=exports.ErrorCode.TIMEOUT,s.close()}),WEB_SOCKET_TIMEOUT),s.onOpen((function(){d.logger.info(Log.L_CONNECT_S,"socket opened",r),clearTimeout(_)})),s.onError((function(e){d.logger.info(Log.L_CONNECT_S,"socket error",r),clearTimeout(_);var t=exports.ErrorCode.RC_SOCKET_DISCONNECTED;i(fail(t)),d.onSocketEnd(s,t)})),s.onClose((function(){d.logger.info(Log.L_CONNECT_S,"socket close",r);var e=c===exports.ErrorCode.SUCCESS?exports.ErrorCode.RC_SOCKET_DISCONNECTED:c;i(fail(e)),d.onSocketEnd(s,e)})),s.onMessage((function(e){if(d._socketIndex===s.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var n=readWSBuffer(e,t);if(n){if(n instanceof ConnAckReader){var o=n.status;if(o!==ConnectAckStatus.ACCEPTED)return d.logger.warn(Log.L_CONNECT_O,"connect failed: ".concat(o),r),c=transConnAckStatus2ErrorCode(o),s.close(),void i(fail(c));d.logger.info(Log.L_CONNECT_O,"connect success",r);var a=n.timestamp,u=n.userId,l=n.messageId,_=n.sessionId;return d._serverSessionId=_,d._connectedTime=a,d._idCount=l,void i(ok({userId:u,socket:s}))}if(n instanceof DisconnectReader){var p=n.status;return d.logger.info(Log.T,"recv disconnect signal -> status: ".concat(p)),void d.onRecvDisconnect(p,s)}d._onReceiveSignal(n)}}}else d.logger.warn(Log.L_WS_DISACCORD_E,JSON.stringify({socketIndex:d._socketIndex,curSocketId:s.id}))})),[2,o]):[2,fail(u,l)]}}))}))}}),Object.defineProperty(t.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==Qos.AT_MOST_ONCE)return e instanceof PublishReader&&!e.syncMsg?(this.logger.debug(Log.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new PubAckWriter(e.messageId))):void(e instanceof QueryAckReader&&this._messageIds[e.messageId]&&(this.logger.debug(Log.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new QueryConWriter(e.messageId))))}}),Object.defineProperty(t.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return t=e.syncMsg,r=e.topic,n=e.messageId,this.logger.debug(Log.O,"recv PublishReader -> messageId: ".concat(n," ").concat(r)),r===RTC_API.userSetData?[2]:!t||checkIsStatusMessage(string2Topic(r))?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[n]=e}))];case 1:return i=a.sent(),delete this._syncMessageIds[n],this.emit("signal",e,i),[2]}}))}))}}),Object.defineProperty(t.prototype,"_onReceiveSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return e instanceof PingRespReader&&this._pingResolve?(this._pingResolve(exports.ErrorCode.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof PubAckReader||e instanceof QueryAckReader)&&(t=e.messageId,this.logger.debug(Log.O,"recv ack -> messageId: ".concat(t)),(r=this._messageIds[t])&&(r(e),delete this._messageIds[t]),(n=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],n(e))),e instanceof PublishReader?[4,this._publishReader(e)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(t.prototype,"onRecvDisconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(transDisconnectReason2ErroCode(e)))}}),Object.defineProperty(t.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(t.prototype,"clearResolves",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(exports.ErrorCode.RC_SOCKET_DISCONNECTED)}}}),Object.defineProperty(t.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._pingResolve=r,setTimeout((function(){return r(exports.ErrorCode.TIMEOUT)}),e),t.sendOnly(new PingReqWriter)}))}}),Object.defineProperty(t.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof PublishWriter||e instanceof QueryWriter)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(t.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return this._socket?(t=this._generateMessageId(),e.messageId=t,this._socket.send(e.getArrayBuffer()),[4,new Promise((function(e){i._messageIds[t]=e,setTimeout((function(){i._messageIds[t]&&delete i._messageIds[t],e(exports.ErrorCode.TIMEOUT)}),IM_SIGNAL_TIMEOUT)}))]):[2,fail(exports.ErrorCode.RC_NET_CHANNEL_INVALID)];case 1:return r=o.sent(),(n="number"==typeof r?r:r.status)!==exports.ErrorCode.SUCCESS&&this.logger.warn(Log.L_SEND_RMTP_E,JSON.stringify({messageId:t,code:n,topic:e.topic})),"number"==typeof r?[2,fail(r)]:[2,n===exports.ErrorCode.SUCCESS?ok(r):fail(n,"",r)]}}))}))}}),Object.defineProperty(t.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,a,s,u,l;return __generator(this,(function(c){switch(c.label){case 0:return o=this.logger.createTraceId(),a=topic2String(e),this.logger.info(Log.L_QUERY_CMP_T,JSON.stringify({method:a,targetId:t}),o),s=new QueryWriter(e,r,t),i&&s.setHeaderQos(i),[4,this._sendHandler(s)];case 1:return u=c.sent(),this.logger.summary(Log.L_QUERY_CMP_R,u,o,{method:a,targetId:t}),l=u.data,u.isOk&&void 0!==n?[2,ok(codec.decode(n,l.pbData))]:[2,u]}}))}))}}),Object.defineProperty(t.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return[4,this._sendHandler(e)];case 1:return(r=a.sent()).data?r.data instanceof PubAckReader?[2,r]:(n=r.data,i=t&&n.pbData&&[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,exports.ErrorCode.RC_USER_PROFILE_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,exports.ErrorCode.RC_USER_PROFILE_VALUE_EXCEED_RANGE,exports.ErrorCode.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(n.status)>=0,o=i?codec.decode(t,n.pbData):n,0!==n.status?(this.logger.warn(Log.O,"send failed -> messageId: ".concat(n.messageId,", respPBName: ").concat(t,", status: ").concat(n.status)),[2,fail(n.status,void 0,t&&n.pbData?o:null)]):[2,ok(o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return r?[4,this.sendOnly(new DisconnectWriter(DisconnectReason.LOGOUT))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),t}(BaseConnectionManager),WebCloudController=function(e){function t(t,r,n){var i=e.call(this,r,t,n)||this;Object.defineProperty(i,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});var o=runtime.runtimeInfo,a=o.type,s=o.version;return i.deviceId=getDeviceId(),i.model="Web|".concat(a,"|").concat(s),i.init(),i}return __extends(t,e),Object.defineProperty(t.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,u,l,c,_,d;return __generator(this,(function(p){switch(p.label){case 0:return(i=n).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},a=this.logger.createTraceId(),this.logger.info(Log.L_REQUEST_T,JSON.stringify(o),a),[4,runtime.httpReq(o)];case 1:s=p.sent(),u=s.status,l=s.data,c=void 0===l?"":l,this.logger.info(Log.L_REQUEST_R,JSON.stringify({status:u,data:c}),a);try{return _=JSON.parse(c),d=_.data,[2,{code:parseInt(_.code,10),data:d}]}catch(e){return this.logger.warn(Log.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:u,data:c,error:e})),[2,{code:u,msg:e}]}return[2]}}))}))}}),Object.defineProperty(t.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=LOCAL_STORAGE_KEYS.CLOUD_CONTROL_KEY(this.appkey);runtime.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(Log.L_CLOUD_SET_CACHE_O,JSON.stringify(e))}}),Object.defineProperty(t.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=LOCAL_STORAGE_KEYS.CLOUD_CONTROL_KEY(this.appkey),t=runtime.localStorage.getItem(e);return this.logger.info(Log.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t}}),Object.defineProperty(t.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(Log.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}}),Object.defineProperty(t.prototype,"getMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mrtr}}),t}(BaseCloudController),_Logger_storage,_Logger_realtimeReportTimestamp,Logger=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n,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:r}),Object.defineProperty(o,"_type",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:i}),_Logger_storage.set(o,void 0),_Logger_realtimeReportTimestamp.set(o,SESSION_CREATE_TIME),__classPrivateFieldSet(o,_Logger_storage,new AppStorage(LOCAL_STORAGE_KEYS.LOG_INFO_KEY(t)),"f"),o}return __extends(t,e),Object.defineProperty(t.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){__classPrivateFieldSet(this,_Logger_realtimeReportTimestamp,e,"f")}}),Object.defineProperty(t.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __classPrivateFieldGet(this,_Logger_realtimeReportTimestamp,"f")}}),Object.defineProperty(t.prototype,"setConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{return __classPrivateFieldGet(this,_Logger_storage,"f").set(e,t),!0}catch(e){return!1}}}),Object.defineProperty(t.prototype,"getConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return{success:!0,value:__classPrivateFieldGet(this,_Logger_storage,"f").get(e)}}catch(e){return{success:!1}}}}),t}(BasicLogger),_a$2;_Logger_storage=new WeakMap,_Logger_realtimeReportTimestamp=new WeakMap;var dbPromise=null,DB_VERSION=2,LOG_TABLE="RC_LOGS",STATISTIC_TABLE="RC_STATISTICS",TableIndex=(_a$2={},_a$2[LOG_TABLE]=["level","time"],_a$2[STATISTIC_TABLE]=["level","time"],_a$2),isSupportIndexDB=function(){return"undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==runtime.runtimeInfo.type},clearOldIndexDB=function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(r){r.forEach((function(r){r.name&&e.includes(r.name)&&t.deleteDatabase(r.name)}))}))},cleanTable=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),o=IDBKeyRange.upperBound(Date.now()-r),a=i.openCursor(o);a.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},a.onerror=function(){n()}}))},timer=null,startDBCleaner=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,dbPromise];case 1:return(t=n.sent())?(r=t.db,[4,cleanTable(r,LOG_TABLE,e)]):[2];case 2:return n.sent(),[4,cleanTable(r,STATISTIC_TABLE,e)];case 3:return n.sent(),timer=setTimeout((function(){return startDBCleaner(e)}),6e5),[2]}}))}))},initLogDB=function(e,t,r){void 0===r&&(r=168),dbPromise||(isSupportIndexDB()?dbPromise=new Promise((function(n){var i=window.indexedDB;clearOldIndexDB(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var o="RC_LOGS_".concat(e),a=i.open(o,DB_VERSION);a.onerror=function(e){t.error(Log.L_LOGDB_OPEN_FAILED_E,e.target.error),n(null)},a.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){dbPromise=null,t.warn(Log.L_LOGDB_CLOSED_S)},o.onerror=function(e){dbPromise=null,t.error(Log.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(Log.L_LOGDB_ABORT_S,e.target.error)},startDBCleaner(3600*Math.max(24,Math.min(168,r))*1e3),n({appkey:e,db:o})):n(null)},a.onupgradeneeded=function(e){var t=e.target.result;Object.keys(TableIndex).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var r=t.createObjectStore(e,{autoIncrement:!0});TableIndex[e].forEach((function(e){return r.createIndex(e,e,{unique:!1})}))}))}})):t.warn(Log.L_UNSUPPORT_INDEXDB_O))},waitingToCloseDB=[],write2Table=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite");i.oncomplete=n,i.onabort=n;var o=i.objectStore(t);r.forEach((function(e){try{o.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},deInitLogDB=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return dbPromise?(timer&&(clearTimeout(timer),timer=null),[4,dbPromise]):[2];case 1:return(e=r.sent())&&(t=e.db,waitingToCloseDB.push(t)),dbPromise=null,[2]}}))}))},queue=[],locked=!1,check2Save=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:return locked||0===queue.length?[2]:(locked=!0,t=queue.filter((function(e){return e.level<exports.LogL.FATAL})),r=queue.filter((function(e){return e.level>=exports.LogL.FATAL})),queue.length=0,[4,write2Table(e,LOG_TABLE,r)]);case 1:return n.sent(),[4,write2Table(e,STATISTIC_TABLE,t)];case 2:return n.sent(),locked=!1,0===queue.length&&waitingToCloseDB.length>0&&(waitingToCloseDB.forEach((function(e){return e.close()})),waitingToCloseDB.length=0),setTimeout((function(){return check2Save(e)})),[2]}}))}))},addLog=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return[4,dbPromise];case 1:if(!(t=r.sent()))return[2];if(e.content&&isString(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return queue.push(e),check2Save(t.db),[2]}}))}))},createEngineWebLogDBProxy=function(){var e=createLogDBProxy();return e.setLogReader((function(e,t,r,n,i){return void 0===i&&(i=LOG_TABLE),__awaiter(void 0,void 0,void 0,(function(){var o;return __generator(this,(function(a){switch(a.label){case 0:return[4,dbPromise];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<=r&&(n?i.sessionId===SESSION_ID:i.level>=0)&&u.push(i),t.continue()}else a({logs:u})},c.onerror=function(){a({logs:[]})}}))]:[2,{logs:[]}]}}))}))})),e.setLogWriter((function(e){addLog(e)})),e},REPORT_SESSION="REPORT_SESSION",apply2BeReporter=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,n,i,o,a;return __generator(this,(function(s){return r="".concat(REPORT_SESSION,"_").concat(e),n=t.getSessionId(),i=t.getConf(r),o=i.success,a=i.value,o?(n===(null==a?void 0:a.sessionId)||t.setConf(r,{sessionId:n}),[2]):[2]}))}))},applyForReport=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){return r=t.getSessionId(),n=t.getConf("".concat(REPORT_SESSION,"_").concat(e)),i=n.success,o=n.value,[2,i&&(null==o?void 0:o.sessionId)===r]}))}))},MAX_TIME_LENGTH=144e5;if("undefined"!=typeof window){var exportLog_1=function(e,t){var r=t.map((function(e){var t=e.sessionId,r=e.time,n=e.type,i=e.level,o=e.tag,a=e.traceId,s=e.loggerId,u=e.content;return"".concat(t,",").concat(r,",").concat(n,",").concat(i,",").concat(o,",").concat(a,",").concat(s,',"').concat(u,'"\n')})),n=new Blob(r,{type:"text/csv"}),i=URL.createObjectURL(n),o=document.createElement("a");o.href=i,o.download="".concat(e,".csv"),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)};window.__rongcloud_devtools__={logger:{get:function(e,t,r){return void 0===t&&(t=Date.now()-MAX_TIME_LENGTH),void 0===r&&(r=Date.now()),__awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return t=t<0?Date.now()+t:t,(r=r<=0?Date.now():r)-t>MAX_TIME_LENGTH&&(t=r-MAX_TIME_LENGTH),n=createLogDBProxy(),(i=new Logger(e,"RC-IM","IM",n)).debug(Log.T,"get logs: startTime ".concat(t," endTime ").concat(r)),initLogDB(e,i),[4,n.read(t,r,exports.LogL.DEBUG,!1)];case 1:return o=a.sent().logs,i.debug(Log.T,"get logs ".concat(o.length)),exportLog_1("".concat(e,"-").concat(t,"-").concat(r),o),[2]}}))}))}}}}var GzipCompressor=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),dataType={Tail:48,Compressed:64,NormalExt:80,Normal:96,Mark:112},chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",scale=chars.length,max=238327,compress=function(e){for(var t={},r=0;r<e.length-1;r++){var n=e.charAt(r)+e.charAt(r+1);t.hasOwnProperty(n)?t[n].push(r):t[n]=[r]}for(var i=[],o=[],a=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=numberEncode(e.length),r=String.fromCharCode(dataType.NormalExt|t.length);i.push(r+t)}else{var n=String.fromCharCode(dataType.Normal|e.length);i.push(n)}i.push(e)}},s=0;s<e.length;){var u=indexOf(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=numberEncode(s-u.offset),c=numberEncode(u.length);if(l.length+c.length>=u.length)o.push(e.substr(s,u.length)),s+=u.length;else{a();var _=String.fromCharCode(dataType.Compressed|l.length<<2|c.length);i.push(_+l+c),s+=u.length}}}a();var d=numberEncode(e.length),p=String.fromCharCode(dataType.Tail|d.length);return i.push(p+d),i.join("")},indexOf=function(e,t,r){var n={length:0,offset:-1};if(t.length,r>=t.length-1)return n;var i=e[t.charAt(r)+t.charAt(r+1)];if(i[0]===r)return n;for(var o=t.length-r,a=0,s=i.length;a<s;a++){var u=i[a],l=r-u;if(!(l>max)){var c=Math.min(o,l);if(c<=n.length)break;if(!(n.length>2&&t.charAt(u+n.length-1)!==t.charAt(r+n.length-1))){for(var _=2,d=_;d<c&&t.charAt(u+d)===t.charAt(r+d);d++)_++;_>=n.length&&(n.length=_,n.offset=u)}}}return n},numberEncode=function(e){var t=[],r=0;do{r=e%scale,t.push(chars.charAt(r)),e=(e-r)/scale}while(e>0);return t.join("")},IndexDBReporter=function(e){function t(t,r,n,i){var o,a=getDeviceId(),s=runtime.runtimeInfo,u=s.type,l=s.version,c="".concat(u,"|").concat(l,"|").concat(r.getSessionId(),"|").concat(runtime.connectPlatform);return o=e.call(this,t,a,c,i,r)||this,Object.defineProperty(o,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:n}),o}return __extends(t,e),Object.defineProperty(t.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return runtime.httpReq(e)}}),Object.defineProperty(t.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,apply2BeReporter(t.userId,this.logger)];case 1:return r.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))}}),Object.defineProperty(t.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,{success:!0,data:compress(e.map(transcsv).join(""))}]}))}))}}),Object.defineProperty(t.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,r,n,this.tableName)]}))}))}}),t}(BasicReporter),LoggerReporter=function(e){function t(t,r,n){return e.call(this,t,r,LOG_TABLE,n)||this}return __extends(t,e),Object.defineProperty(t.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,applyForReport(this.userId,this.logger)];case 1:return[2,e.sent()]}}))}))}}),Object.defineProperty(t.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n,i,o,a,s){return void 0===s&&(s=!1),__awaiter(this,void 0,void 0,(function(){var u;return __generator(this,(function(l){switch(l.label){case 0:return[4,this.isReporter()];case 1:return u=l.sent(),this.userId&&!u?[2]:[2,e.prototype.report.call(this,t,r,n,i,o,a,s)]}}))}))}}),t}(IndexDBReporter),StatisticReporter=function(e){function t(t,r,n){return e.call(this,t,r,STATISTIC_TABLE,n)||this}return __extends(t,e),t}(IndexDBReporter),_WebConversationSettings_instances,_WebConversationSettings_firstSyncAfterConnected,_WebConversationSettings_onConnected,_WebConversationSettings_onSCmd,_WebConversationSettings_requestSettings,WebConversationSettings=function(e){function t(t,r){var n=e.call(this,"WebConversationSettings")||this;return _WebConversationSettings_instances.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),_WebConversationSettings_firstSyncAfterConnected.set(n,!1),n._ctx.on("sCmd",__classPrivateFieldGet(n,_WebConversationSettings_instances,"m",_WebConversationSettings_onSCmd),n),n._ctx.on("onConnected",__classPrivateFieldGet(n,_WebConversationSettings_instances,"m",_WebConversationSettings_onConnected),n),n}return __extends(t,e),Object.defineProperty(t.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,__classPrivateFieldGet(this,_WebConversationSettings_instances,"m",_WebConversationSettings_requestSettings).call(this,e)];case 1:return[2,t.sent().trans((function(e){return{version:e.version}}))]}}))}))}}),Object.defineProperty(t.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,__classPrivateFieldGet(this,_WebConversationSettings_instances,"m",_WebConversationSettings_requestSettings).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),t}(LinearQuery);_WebConversationSettings_firstSyncAfterConnected=new WeakMap,_WebConversationSettings_instances=new WeakSet,_WebConversationSettings_onConnected=function(){__classPrivateFieldSet(this,_WebConversationSettings_firstSyncAfterConnected,!0,"f")},_WebConversationSettings_onSCmd=function(e,t){var r=t.type,n=t.time;if(3===r)this.push(n),e.stopPropagation()},_WebConversationSettings_requestSettings=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),t.info(Log.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),r),n=codec.encode(IMPB.SessionReq,{time:e}),[4,this._ctx.query(Topic.pullSeAtts,this._ctx.currentUserId,n,IMPB.SessionStates)];case 1:return i=a.sent(),t.summary(Log.L_PULL_CONVERSATION_SETTINGS_R,i,r,{version:e},(function(t){return{syncTime:t.version,version:e}})),i.isOk&&(o=this._storage.updateBySessionStates(i.data)).length&&this._ctx.emit("conversationStatusChanged",o),__classPrivateFieldGet(this,_WebConversationSettings_firstSyncAfterConnected,"f")&&(__classPrivateFieldSet(this,_WebConversationSettings_firstSyncAfterConnected,!1,"f"),this._ctx.emit("conversationStatusSynced",i.code)),[2,i]}}))}))};var ModuleStorage=function(){function e(){Object.defineProperty(this,"_memData",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._memData=this._syncDataHandler(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._memData[e].value}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._memData[e],n=r.key,i=r.stringify;r.value=t;var o=i?JSON.stringify(t):t;runtime.localStorage.setItem(n,o)}}),e}(),keyofConversation=function(e,t,r){return"".concat(null!=r?r:"","_").concat(e,"_").concat(t)},keyofConversation2=function(e){return keyofConversation(e.conversationType,e.targetId,e.channelId)},parseKeyofConversation=function(e){var t=__read(e.split("_")),r=t[0],n=t[1],i=t.slice(2);return{channelId:r,conversationType:parseInt(n,10),targetId:i.join("_")}},_WebConversationModel_conversationType,_WebConversationModel_targetId,_WebConversationModel_channelId,_WebConversationModel_data;function convertTags(e){if(e){if(Array.isArray(e))return e;var t=Object.entries(e).map((function(e){var t=__read(e,2);return{tagId:t[0],isTop:t[1].isTop}}));return t}}var trans2IConversationModelUpdateParams=function(e){var t=e.c,r=e.mc,n=e.mmc,i=e.hm,o=e.m,a=e.fut,s=e.fuid,u=e.fumt,l=e.nl,c=e.to,_=e.tg,d=e.rt,p=e.h,g=e.ts;return{isTop:c,notificationLevel:l,tags:convertTags(_),unreadCount:t,unreadMentionedCount:r,unreadMentionedMeCount:n,hasMentioned:i,mentionedInfo:o,firstUnreadTime:a,firstUnreadMessageUId:s,firstUnreadMessageType:u,lastReadTime:d,hidden:p,translateStrategy:g}},trans2IConversationModelUpdateParamsByIPBRelationInfo=function(e,t){var r,n,i,o=e.msg;return{latestMessage:o?trans2IReceivedMessage(o,t,!1,e.userId):void 0,lastReadTime:e.readMsgTime,unreadCount:e.unreadCount,operationTime:e.versionTime,unreadMentionedCount:e.remindCount,unreadMentionedMeCount:e.remindMeCount,firstUnreadMessageType:null===(r=e.msgInfo)||void 0===r?void 0:r.className,firstUnreadMessageUId:null===(n=e.msgInfo)||void 0===n?void 0:n.msgId,firstUnreadTime:null===(i=e.msgInfo)||void 0===i?void 0:i.msgTime}},defaultData=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:exports.NotificationLevel.NOT_SET,translateStrategy:TranslateStrategy.DEFAULT,tags:[],channelType:exports.UltraGroupChannelType.PUBLIC,operationTime:0,draft:"",hidden:!1}},WebConversationModel=function(){function e(e){_WebConversationModel_conversationType.set(this,void 0),_WebConversationModel_targetId.set(this,void 0),_WebConversationModel_channelId.set(this,void 0),_WebConversationModel_data.set(this,defaultData()),__classPrivateFieldSet(this,_WebConversationModel_conversationType,e.conversationType,"f"),__classPrivateFieldSet(this,_WebConversationModel_targetId,e.targetId,"f"),__classPrivateFieldSet(this,_WebConversationModel_channelId,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_conversationType,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_targetId,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_channelId,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!__classPrivateFieldGet(this,_WebConversationModel_data,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!__classPrivateFieldGet(this,_WebConversationModel_data,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").notificationLevel||exports.NotificationLevel.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateStrategy",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").translateStrategy||TranslateStrategy.DEFAULT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(__classPrivateFieldGet(this,_WebConversationModel_data,"f").tags||[]).map((function(e){return{tagId:e.tagId,isTop:e.isTop}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadCount",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!__classPrivateFieldGet(this,_WebConversationModel_data,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return __classPrivateFieldGet(this,_WebConversationModel_data,"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:__classPrivateFieldGet(this,_WebConversationModel_conversationType,"f"),targetId:__classPrivateFieldGet(this,_WebConversationModel_targetId,"f"),channelId:__classPrivateFieldGet(this,_WebConversationModel_channelId,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return keyofConversation(__classPrivateFieldGet(this,_WebConversationModel_conversationType,"f"),__classPrivateFieldGet(this,_WebConversationModel_targetId,"f"),__classPrivateFieldGet(this,_WebConversationModel_channelId,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __assign(__assign({},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:trans2NotificationStatus(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft})}}),Object.defineProperty(e.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};return this.isTop&&(e.to=!0),this.notificationLevel!==exports.NotificationLevel.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.translateStrategy!==TranslateStrategy.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(__assign(__assign({},defaultData()),{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 r=this;void 0===t&&(t=0);var n={},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,hidden:void 0};return Object.entries(i).forEach((function(i){var o=__read(i,2),a=o[0],s=o[1],u=a;if(Object.prototype.hasOwnProperty.call(e,u)){var l=e[u];__classPrivateFieldGet(r,_WebConversationModel_data,"f")[u]!==l&&(__classPrivateFieldGet(r,_WebConversationModel_data,"f")[u]=l,s&&(n[s]={time:t,val:l}))}})),Object.keys(n).length>0?n:null}}),e}();_WebConversationModel_conversationType=new WeakMap,_WebConversationModel_targetId=new WeakMap,_WebConversationModel_channelId=new WeakMap,_WebConversationModel_data=new WeakMap;var WebSGConversationModel=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.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}}),t}(WebConversationModel),WebUGConversationModel=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.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(t.prototype,"isDefaultChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!this.channelId||"RCDefault"===this.channelId}}),t}(WebConversationModel),_WebChatStorage_instances,_WebChatStorage_transformStorageData,_WebChatStorage_initConversations,WebChatStorage=function(e){function t(t){var r=e.call(this)||this;return _WebChatStorage_instances.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"models",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),r}return __extends(t,e),Object.defineProperty(t.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=runtime.localStorage,r=e.appkey,n=e.currentUserId,i=e.isDisableEmptyUGChannelId,o=LOCAL_STORAGE_KEYS.INBOX_TIME_KEY(r,n),a=LOCAL_STORAGE_KEYS.OUTBOX_TIME_KEY(r,n),s=LOCAL_STORAGE_KEYS.BROADCASTBOX_TIME_KEY(r,n),u=LOCAL_STORAGE_KEYS.CONVER_STATE_KEY(r,n),l=LOCAL_STORAGE_KEYS.CONVER_SETTINGS_VER_KEY(r,n),c=LOCAL_STORAGE_KEYS.ULTRA_GROUP_STATE_KEY(r,n),_=LOCAL_STORAGE_KEYS.CONVER_TYPE_SETTINGS_KEY(r,n),d=t.getItem(o)||"0",p=t.getItem(a)||"0",g=t.getItem(s)||"1",f=t.getItem(l)||"0",h=JSON.parse(t.getItem(_)||"{}"),E=JSON.parse(t.getItem(u)||"{}"),T=JSON.parse(t.getItem(c)||"{}");return __classPrivateFieldGet(this,_WebChatStorage_instances,"m",_WebChatStorage_transformStorageData).call(this,E,T,h,i),{inboxTime:{value:parseInt(d,10)||0,key:o},outboxTime:{value:parseInt(p,10)||0,key:a},broadcastTime:{value:parseInt(g,10)||0,key:s},conversationStatus:{value:E,key:u,stringify:!0},ultraGroupStatus:{value:T,key:c,stringify:!0},conversationStatusVersion:{value:parseInt(f,10)||0,key:l},conversationTypeGlobalSettings:{value:h,key:_,stringify:!0}}}}),Object.defineProperty(t.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),this.models.clear(),__classPrivateFieldGet(this,_WebChatStorage_instances,"m",_WebChatStorage_initConversations).call(this)}}),Object.defineProperty(t.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("conversationTypeGlobalSettings");t===exports.NotificationLevel.NOT_SET?delete r[e]:r[e]={nl:t},this.set("conversationTypeGlobalSettings",r)}}),Object.defineProperty(t.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)||exports.NotificationLevel.NOT_SET}}),Object.defineProperty(t.prototype,"getOrCreateModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=keyofConversation(e.conversationType,e.targetId,e.channelId),n=this.models.get(r);return n||(n=e.conversationType===exports.ConversationType.ULTRA_GROUP?new WebUGConversationModel(e):new WebSGConversationModel(e),t&&this.models.set(r,n)),n}}),Object.defineProperty(t.prototype,"updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("ultraGroupStatus"),r=this.get("conversationStatus");e.forEach((function(e){var n=e.conversationType,i=e.key,o=e.toStoragItem(),a=Object.keys(o),s=0===a.length||1===a.length&&"h"===a[0],u=n===exports.ConversationType.ULTRA_GROUP?t:r;s?delete u[i]:u[i]=o})),this.set("conversationStatus",r),this.set("ultraGroupStatus",t)}}),Object.defineProperty(t.prototype,"updateBySessionStates",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=e.version,n=e.state;if(this.set("conversationStatusVersion",r),!(null==n?void 0:n.length))return[];var i=new Map,o=new Set;return n.forEach((function(e){var n=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,r=e.sessionStateType,n=e.value;switch(r){case PBEnumSessionStateType.IsSilent:l.notificationLevel=parseInt(n,10);break;case PBEnumSessionStateType.IsTop:l.isTop="1"===n;break;case PBEnumSessionStateType.Tags:l.tags=t;break;case PBEnumSessionStateType.AutoTrans:l.translateStrategy=parseInt(n,10)}})),n){var c=keyofConversation(s,n,a),_=parseKeyofConversation(c),d=t.models.get(c);d||(d=s===exports.ConversationType.ULTRA_GROUP?new WebUGConversationModel(_):new WebSGConversationModel(_),t.models.set(c,d)),o.add(d);var p=d.updateAttrs(l,r);if(p)if(i.has(d)){var g=i.get(d);Object.assign(g,p)}else i.set(d,p)}else void 0!==l.notificationLevel&&t.setConversationTypeNotificationLevel(s,l.notificationLevel)})),this.updateConversationStorage(Array.from(o)),Array.from(i.entries()).map((function(e){var t=__read(e,2),r=t[0],n=t[1];return{conversation:r.toIReceivedConversation(),updatedItems:n}}))}}),Object.defineProperty(t.prototype,"addRelations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;e.forEach((function(e){var n=e.userId,i=e.type,o=e.busChannel,a=keyofConversation(i,n,o),s=parseKeyofConversation(a),u=r.getOrCreateModel(s,!0),l=trans2IConversationModelUpdateParamsByIPBRelationInfo(e,t);i===exports.ConversationType.ULTRA_GROUP?u.updateAttrs(l):u.updateAttrs({latestMessage:l.latestMessage,operationTime:l.operationTime,hidden:!1})}))}}),Object.defineProperty(t.prototype,"getDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=keyofConversation(e.conversationType,e.targetId,e.channelId);return(null===(t=this.models.get(r))||void 0===t?void 0:t.draft)||""}}),Object.defineProperty(t.prototype,"setDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}}),Object.defineProperty(t.prototype,"deleteDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=keyofConversation(e.conversationType,e.targetId,e.channelId),r=this.models.get(t);r&&r.updateAttrs({draft:""})}}),Object.defineProperty(t.prototype,"getCachedUGConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=keyofConversation(exports.ConversationType.ULTRA_GROUP,e,t),n=this.models.get(r);return(null==n?void 0:n.toIReceivedConversation())||null}}),Object.defineProperty(t.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===exports.ConversationType.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(t.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!==exports.ConversationType.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(t.prototype,"getAllModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(this.models.values())}}),Object.defineProperty(t.prototype,"getModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=keyofConversation(e.conversationType,e.targetId,e.channelId);return this.models.get(t)||null}}),Object.defineProperty(t.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=keyofConversation(t,r,n),o=this.models.get(i);o&&(o.remove(),this.updateConversationStorage([o]))}}),Object.defineProperty(t.prototype,"updateConversationCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getOrCreateModel(e,!0);r.updateAttrs(t),this.updateConversationStorage([r])}}),Object.defineProperty(t.prototype,"getAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=0;return this.getAllSGModels().forEach((function(n){var i,o=n.conversationType;e.includes(o)&&(n.notificationLevel>exports.NotificationLevel.NOT_SET&&!t||(r+=null!==(i=n.unreadCount)&&void 0!==i?i:0))})),r}}),Object.defineProperty(t.prototype,"getTagConversationCountMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Map;return this.getAllModels().forEach((function(t){var r=t.tags;r.length>0&&r.forEach((function(r){e.set(r.tagId,(e.get(r.tagId)||[]).concat(t.identifier))}))})),e}}),Object.defineProperty(t.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getModel(e);if(!r)return null;var n=r.clearUnreadCount(t);return this.updateConversationStorage([r]),n?{conversation:r.toIReceivedConversation(),updatedItems:n}:null}}),t}(ModuleStorage);_WebChatStorage_instances=new WeakSet,_WebChatStorage_transformStorageData=function(e,t,r,n){Object.keys(e).forEach((function(t){var n=parseKeyofConversation(t);isInConversationTypeList(n.conversationType,ConversationTypes.BASE)?n.targetId||(r[n.conversationType]={nl:e[t].nl||exports.NotificationLevel.NOT_SET},delete e[t]):delete e[t]})),Object.keys(t).forEach((function(e){var i=parseKeyofConversation(e);if(i.conversationType===exports.ConversationType.ULTRA_GROUP)return i.targetId?void(n&&!i.channelId&&delete t[e]):(r[i.conversationType]={nl:t[e].nl||exports.NotificationLevel.NOT_SET},void delete t[e]);delete t[e]}))},_WebChatStorage_initConversations=function(){var e=this,t=Object.entries(this.get("conversationStatus")),r=Object.entries(this.get("ultraGroupStatus"));__spreadArray(__spreadArray([],__read(t),!1),__read(r),!1).forEach((function(t){var r=__read(t,2),n=r[0],i=r[1],o=parseKeyofConversation(n);isInConversationTypeList(o.conversationType,ConversationTypes.INCLUDE_UG)&&e.getOrCreateModel(o,!0).updateAttrs(trans2IConversationModelUpdateParams(i),0)}))};
|
|
24
|
+
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
|
|
25
|
+
const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(e){let t=e.length;for(;--t>=0;)e[t]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=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]),extra_dbits=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]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array(2*(L_CODES$1+2));zero$1(static_ltree);const static_dtree=new Array(2*D_CODES$1);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);function StaticTreeDesc(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}zero$1(base_dist);const d_code=e=>e<256?_dist_code[e]:_dist_code[256+(e>>>7)],put_short=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},send_bits=(e,t,r)=>{e.bi_valid>Buf_size-r?(e.bi_buf|=t<<e.bi_valid&65535,put_short(e,e.bi_buf),e.bi_buf=t>>Buf_size-e.bi_valid,e.bi_valid+=r-Buf_size):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},send_code=(e,t,r)=>{send_bits(e,r[2*t],r[2*t+1])},bi_reverse=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},bi_flush=e=>{16===e.bi_valid?(put_short(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)},gen_bitlen=(e,t)=>{const r=t.dyn_tree,n=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,p,g,f=0;for(d=0;d<=MAX_BITS$1;d++)e.bl_count[d]=0;for(r[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<HEAP_SIZE$1;l++)c=e.heap[l],d=r[2*r[2*c+1]+1]+1,d>u&&(d=u,f++),r[2*c+1]=d,c>n||(e.bl_count[d]++,p=0,c>=s&&(p=a[c-s]),g=r[2*c],e.opt_len+=g*(d+p),o&&(e.static_len+=g*(i[2*c+1]+p)));if(0!==f){do{for(d=u-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[u]--,f-=2}while(f>0);for(d=u;0!==d;d--)for(c=e.bl_count[d];0!==c;)_=e.heap[--l],_>n||(r[2*_+1]!==d&&(e.opt_len+=(d-r[2*_+1])*r[2*_],r[2*_+1]=d),c--)}},gen_codes=(e,t,r)=>{const n=new Array(MAX_BITS$1+1);let i,o,a=0;for(i=1;i<=MAX_BITS$1;i++)a=a+r[i-1]<<1,n[i]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=bi_reverse(n[t]++,t))}},tr_static_init=()=>{let e,t,r,n,i;const o=new Array(MAX_BITS$1+1);for(r=0,n=0;n<LENGTH_CODES$1-1;n++)for(base_length[n]=r,e=0;e<1<<extra_lbits[n];e++)_length_code[r++]=n;for(_length_code[r-1]=n,i=0,n=0;n<16;n++)for(base_dist[n]=i,e=0;e<1<<extra_dbits[n];e++)_dist_code[i++]=n;for(i>>=7;n<D_CODES$1;n++)for(base_dist[n]=i<<7,e=0;e<1<<extra_dbits[n]-7;e++)_dist_code[256+i++]=n;for(t=0;t<=MAX_BITS$1;t++)o[t]=0;for(e=0;e<=143;)static_ltree[2*e+1]=8,e++,o[8]++;for(;e<=255;)static_ltree[2*e+1]=9,e++,o[9]++;for(;e<=279;)static_ltree[2*e+1]=7,e++,o[7]++;for(;e<=287;)static_ltree[2*e+1]=8,e++,o[8]++;for(gen_codes(static_ltree,L_CODES$1+1,o),e=0;e<D_CODES$1;e++)static_dtree[2*e+1]=5,static_dtree[2*e]=bi_reverse(e,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=e=>{let t;for(t=0;t<L_CODES$1;t++)e.dyn_ltree[2*t]=0;for(t=0;t<D_CODES$1;t++)e.dyn_dtree[2*t]=0;for(t=0;t<BL_CODES$1;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*END_BLOCK]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},bi_windup=e=>{e.bi_valid>8?put_short(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},smaller=(e,t,r,n)=>{const i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},pqdownheap=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&smaller(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!smaller(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},compress_block=(e,t,r)=>{let n,i,o,a,s=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+s++],n+=(255&e.pending_buf[e.sym_buf+s++])<<8,i=e.pending_buf[e.sym_buf+s++],0===n?send_code(e,i,t):(o=_length_code[i],send_code(e,o+LITERALS$1+1,t),a=extra_lbits[o],0!==a&&(i-=base_length[o],send_bits(e,i,a)),n--,o=d_code(n),send_code(e,o,r),a=extra_dbits[o],0!==a&&(n-=base_dist[o],send_bits(e,n,a)))}while(s<e.sym_next);send_code(e,END_BLOCK,t)},build_tree=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u,l=-1;for(e.heap_len=0,e.heap_max=HEAP_SIZE$1,a=0;a<o;a++)0!==r[2*a]?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):r[2*a+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,r[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=n[2*u+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)pqdownheap(e,r,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pqdownheap(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[2*u]=r[2*a]+r[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[2*a+1]=r[2*s+1]=u,e.heap[1]=u++,pqdownheap(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],gen_bitlen(e,t),gen_codes(r,l,e.bl_count)},scan_tree=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+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[2*REP_3_6]++):s<=10?e.bl_tree[2*REPZ_3_10]++:e.bl_tree[2*REPZ_11_138]++,s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4))},send_tree=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<u&&i===a)){if(s<l)do{send_code(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(send_code(e,i,e.bl_tree),s--),send_code(e,REP_3_6,e.bl_tree),send_bits(e,s-3,2)):s<=10?(send_code(e,REPZ_3_10,e.bl_tree),send_bits(e,s-3,3)):(send_code(e,REPZ_11_138,e.bl_tree),send_bits(e,s-11,7));s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4)}},build_bl_tree=e=>{let t;for(scan_tree(e,e.dyn_ltree,e.l_desc.max_code),scan_tree(e,e.dyn_dtree,e.d_desc.max_code),build_tree(e,e.bl_desc),t=BL_CODES$1-1;t>=3&&0===e.bl_tree[2*bl_order[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t},send_all_trees=(e,t,r,n)=>{let i;for(send_bits(e,t-257,5),send_bits(e,r-1,5),send_bits(e,n-4,4),i=0;i<n;i++)send_bits(e,e.bl_tree[2*bl_order[i]+1],3);send_tree(e,e.dyn_ltree,t-1),send_tree(e,e.dyn_dtree,r-1)},detect_data_type=e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return Z_BINARY;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Z_TEXT;for(t=32;t<LITERALS$1;t++)if(0!==e.dyn_ltree[2*t])return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=e=>{static_init_done||(tr_static_init(),static_init_done=!0),e.l_desc=new TreeDesc(e.dyn_ltree,static_l_desc),e.d_desc=new TreeDesc(e.dyn_dtree,static_d_desc),e.bl_desc=new TreeDesc(e.bl_tree,static_bl_desc),e.bi_buf=0,e.bi_valid=0,init_block(e)},_tr_stored_block$1=(e,t,r,n)=>{send_bits(e,(STORED_BLOCK<<1)+(n?1:0),3),bi_windup(e),put_short(e,r),put_short(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r},_tr_align$1=e=>{send_bits(e,STATIC_TREES<<1,3),send_code(e,END_BLOCK,static_ltree),bi_flush(e)},_tr_flush_block$1=(e,t,r,n)=>{let i,o,a=0;e.level>0?(e.strm.data_type===Z_UNKNOWN$1&&(e.strm.data_type=detect_data_type(e)),build_tree(e,e.l_desc),build_tree(e,e.d_desc),a=build_bl_tree(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?_tr_stored_block$1(e,t,r,n):e.strategy===Z_FIXED$1||o===i?(send_bits(e,(STATIC_TREES<<1)+(n?1:0),3),compress_block(e,static_ltree,static_dtree)):(send_bits(e,(DYN_TREES<<1)+(n?1:0),3),send_all_trees(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),compress_block(e,e.dyn_ltree,e.dyn_dtree)),init_block(e),n&&bi_windup(e)},_tr_tally$1=(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(_length_code[r]+LITERALS$1+1)]++,e.dyn_dtree[2*d_code(t)]++),e.sym_next===e.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(e,t,r,n)=>{let i=65535&e,o=e>>>16&65535,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{i=i+t[n++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16};var adler32_1=adler32;const makeTable=()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t},crcTable=new Uint32Array(makeTable()),crc32=(e,t,r,n)=>{const i=crcTable,o=n+r;e^=-1;for(let r=n;r<o;r++)e=e>>>8^i[255&(e^t[r])];return~e};var crc32_1=crc32,messages={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"},constants$2={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:_tr_init,_tr_stored_block:_tr_stored_block,_tr_flush_block:_tr_flush_block,_tr_tally:_tr_tally,_tr_align:_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH:Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED:Z_FILTERED,Z_HUFFMAN_ONLY:Z_HUFFMAN_ONLY,Z_RLE:Z_RLE,Z_FIXED:Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN:Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(e,t)=>(e.msg=messages[t],t),rank=e=>2*e-(e>4?9:0),zero=e=>{let t=e.length;for(;--t>=0;)e[t]=0},slide_hash=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do{r=e.head[--n],e.head[n]=r>=i?r-i:0}while(--t);t=i,n=t;do{r=e.prev[--n],e.prev[n]=r>=i?r-i:0}while(--t)};let HASH_ZLIB=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask,HASH=HASH_ZLIB;const flush_pending=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},flush_block_only=(e,t)=>{_tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,flush_pending(e.strm)},put_byte=(e,t)=>{e.pending_buf[e.pending++]=t},putShortMSB=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},read_buf=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=adler32_1(e.adler,t,i,r):2===e.state.wrap&&(e.adler=crc32_1(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},longest_match=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-MIN_LOOKAHEAD?e.strstart-(e.w_size-MIN_LOOKAHEAD):0,l=e.window,c=e.w_mask,_=e.prev,d=e.strstart+MAX_MATCH;let p=l[o+a-1],g=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,l[r+a]===g&&l[r+a-1]===p&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&o<d);if(n=MAX_MATCH-(d-o),o=d-MAX_MATCH,n>a){if(e.match_start=t,a=n,n>=s)break;p=l[o+a-1],g=l[o+a]}}}while((t=_[t&c])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead},fill_window=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-MIN_LOOKAHEAD)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),slide_hash(e),n+=t),0===e.strm.avail_in)break;if(r=read_buf(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=MIN_MATCH)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=HASH(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=HASH(e,e.ins_h,e.window[i+MIN_MATCH-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<MIN_MATCH)););}while(e.lookahead<MIN_LOOKAHEAD&&0!==e.strm.avail_in)},deflate_stored=(e,t)=>{let r,n,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(r=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>i&&(r=i),r<o&&(0===r&&t!==Z_FINISH$3||t===Z_NO_FLUSH$2||r!==n+e.strm.avail_in))break;a=t===Z_FINISH$3&&r===n+e.strm.avail_in?1:0,_tr_stored_block(e,0,0,a),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,flush_pending(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(read_buf(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===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?BS_FINISH_DONE:t!==Z_NO_FLUSH$2&&t!==Z_FINISH$3&&0===e.strm.avail_in&&e.strstart===e.block_start?BS_BLOCK_DONE:(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&&(read_buf(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,o=i>e.w_size?e.w_size:i,n=e.strstart-e.block_start,(n>=o||(n||t===Z_FINISH$3)&&t!==Z_NO_FLUSH$2&&0===e.strm.avail_in&&n<=i)&&(r=n>i?i:n,a=t===Z_FINISH$3&&0===e.strm.avail_in&&r===n?1:0,_tr_stored_block(e,e.block_start,r,a),e.block_start+=r,flush_pending(e.strm)),a?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(e,t)=>{let r,n;for(;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(0===e.lookahead)break}if(r=0,e.lookahead>=MIN_MATCH&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,r)),e.match_length>=MIN_MATCH)if(n=_tr_tally(e,e.strstart-e.match_start,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=MIN_MATCH){e.match_length--;do{e.strstart++,e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+1]);else n=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(flush_block_only(e,!1),0===e.strm.avail_out))return BS_NEED_MORE}return e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$3?(flush_block_only(e,!0),0===e.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),0===e.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(0===e.lookahead)break}if(r=0,e.lookahead>=MIN_MATCH&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=MIN_MATCH-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,r),e.match_length<=5&&(e.strategy===Z_FILTERED||e.match_length===MIN_MATCH&&e.strstart-e.match_start>4096)&&(e.match_length=MIN_MATCH-1)),e.prev_length>=MIN_MATCH&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-MIN_MATCH,n=_tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-MIN_MATCH),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=MIN_MATCH-1,e.strstart++,n&&(flush_block_only(e,!1),0===e.strm.avail_out))return BS_NEED_MORE}else if(e.match_available){if(n=_tr_tally(e,0,e.window[e.strstart-1]),n&&flush_block_only(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return BS_NEED_MORE}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=_tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$3?(flush_block_only(e,!0),0===e.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),0===e.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(e,t)=>{let r,n,i,o;const a=e.window;for(;;){if(e.lookahead<=MAX_MATCH){if(fill_window(e),e.lookahead<=MAX_MATCH&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=MIN_MATCH&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+MAX_MATCH;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=MAX_MATCH-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=MIN_MATCH?(r=_tr_tally(e,1,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(flush_block_only(e,!1),0===e.strm.avail_out))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$3?(flush_block_only(e,!0),0===e.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),0===e.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(e,t)=>{let r;for(;;){if(0===e.lookahead&&(fill_window(e),0===e.lookahead)){if(t===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(e.match_length=0,r=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(flush_block_only(e,!1),0===e.strm.avail_out))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$3?(flush_block_only(e,!0),0===e.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),0===e.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=e=>{e.window_size=2*e.w_size,zero(e.head),e.max_lazy_match=configuration_table[e.level].max_lazy,e.good_match=configuration_table[e.level].good_length,e.nice_match=configuration_table[e.level].nice_length,e.max_chain_length=configuration_table[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=MIN_MATCH-1,e.match_available=0,e.ins_h=0};function DeflateState(){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=Z_DEFLATED$2,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(2*HEAP_SIZE),this.dyn_dtree=new Uint16Array(2*(2*D_CODES+1)),this.bl_tree=new Uint16Array(2*(2*BL_CODES+1)),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(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 deflateStateCheck=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==INIT_STATE&&t.status!==GZIP_STATE&&t.status!==EXTRA_STATE&&t.status!==NAME_STATE&&t.status!==COMMENT_STATE&&t.status!==HCRC_STATE&&t.status!==BUSY_STATE&&t.status!==FINISH_STATE?1:0},deflateResetKeep=e=>{if(deflateStateCheck(e))return err(e,Z_STREAM_ERROR$2);e.total_in=e.total_out=0,e.data_type=Z_UNKNOWN;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?GZIP_STATE:t.wrap?INIT_STATE:BUSY_STATE,e.adler=2===t.wrap?0:1,t.last_flush=-2,_tr_init(t),Z_OK$3},deflateReset=e=>{const t=deflateResetKeep(e);return t===Z_OK$3&&lm_init(e.state),t},deflateSetHeader=(e,t)=>deflateStateCheck(e)||2!==e.state.wrap?Z_STREAM_ERROR$2:(e.state.gzhead=t,Z_OK$3),deflateInit2=(e,t,r,n,i,o)=>{if(!e)return Z_STREAM_ERROR$2;let a=1;if(t===Z_DEFAULT_COMPRESSION$1&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>MAX_MEM_LEVEL||r!==Z_DEFLATED$2||n<8||n>15||t<0||t>9||o<0||o>Z_FIXED||8===n&&1!==a)return err(e,Z_STREAM_ERROR$2);8===n&&(n=9);const s=new DeflateState;return e.state=s,s.strm=e,s.status=INIT_STATE,s.wrap=a,s.gzhead=null,s.w_bits=n,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+MIN_MATCH-1)/MIN_MATCH),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=r,deflateReset(e)},deflateInit=(e,t)=>deflateInit2(e,t,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(e,t)=>{if(deflateStateCheck(e)||t>Z_BLOCK$1||t<0)return e?err(e,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===FINISH_STATE&&t!==Z_FINISH$3)return err(e,0===e.avail_out?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(flush_pending(e),0===e.avail_out)return r.last_flush=-1,Z_OK$3}else if(0===e.avail_in&&rank(t)<=rank(n)&&t!==Z_FINISH$3)return err(e,Z_BUF_ERROR$1);if(r.status===FINISH_STATE&&0!==e.avail_in)return err(e,Z_BUF_ERROR$1);if(r.status===INIT_STATE&&0===r.wrap&&(r.status=BUSY_STATE),r.status===INIT_STATE){let t=Z_DEFLATED$2+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=Z_HUFFMAN_ONLY||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=n<<6,0!==r.strstart&&(t|=PRESET_DICT),t+=31-t%31,putShortMSB(r,t),0!==r.strstart&&(putShortMSB(r,e.adler>>>16),putShortMSB(r,65535&e.adler)),e.adler=1,r.status=BUSY_STATE,flush_pending(e),0!==r.pending)return r.last_flush=-1,Z_OK$3}if(r.status===GZIP_STATE)if(e.adler=0,put_byte(r,31),put_byte(r,139),put_byte(r,8),r.gzhead)put_byte(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),put_byte(r,255&r.gzhead.time),put_byte(r,r.gzhead.time>>8&255),put_byte(r,r.gzhead.time>>16&255),put_byte(r,r.gzhead.time>>24&255),put_byte(r,9===r.level?2:r.strategy>=Z_HUFFMAN_ONLY||r.level<2?4:0),put_byte(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(put_byte(r,255&r.gzhead.extra.length),put_byte(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=crc32_1(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=EXTRA_STATE;else if(put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,9===r.level?2:r.strategy>=Z_HUFFMAN_ONLY||r.level<2?4:0),put_byte(r,OS_CODE),r.status=BUSY_STATE,flush_pending(e),0!==r.pending)return r.last_flush=-1,Z_OK$3;if(r.status===EXTRA_STATE){if(r.gzhead.extra){let t=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=crc32_1(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,flush_pending(e),0!==r.pending)return r.last_flush=-1,Z_OK$3;t=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>t&&(e.adler=crc32_1(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=NAME_STATE}if(r.status===NAME_STATE){if(r.gzhead.name){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=crc32_1(e.adler,r.pending_buf,r.pending-n,n)),flush_pending(e),0!==r.pending)return r.last_flush=-1,Z_OK$3;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,put_byte(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=crc32_1(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=COMMENT_STATE}if(r.status===COMMENT_STATE){if(r.gzhead.comment){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=crc32_1(e.adler,r.pending_buf,r.pending-n,n)),flush_pending(e),0!==r.pending)return r.last_flush=-1,Z_OK$3;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,put_byte(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=crc32_1(e.adler,r.pending_buf,r.pending-n,n))}r.status=HCRC_STATE}if(r.status===HCRC_STATE){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(flush_pending(e),0!==r.pending))return r.last_flush=-1,Z_OK$3;put_byte(r,255&e.adler),put_byte(r,e.adler>>8&255),e.adler=0}if(r.status=BUSY_STATE,flush_pending(e),0!==r.pending)return r.last_flush=-1,Z_OK$3}if(0!==e.avail_in||0!==r.lookahead||t!==Z_NO_FLUSH$2&&r.status!==FINISH_STATE){let n=0===r.level?deflate_stored(r,t):r.strategy===Z_HUFFMAN_ONLY?deflate_huff(r,t):r.strategy===Z_RLE?deflate_rle(r,t):configuration_table[r.level].func(r,t);if(n!==BS_FINISH_STARTED&&n!==BS_FINISH_DONE||(r.status=FINISH_STATE),n===BS_NEED_MORE||n===BS_FINISH_STARTED)return 0===e.avail_out&&(r.last_flush=-1),Z_OK$3;if(n===BS_BLOCK_DONE&&(t===Z_PARTIAL_FLUSH?_tr_align(r):t!==Z_BLOCK$1&&(_tr_stored_block(r,0,0,!1),t===Z_FULL_FLUSH$1&&(zero(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),flush_pending(e),0===e.avail_out))return r.last_flush=-1,Z_OK$3}return t!==Z_FINISH$3?Z_OK$3:r.wrap<=0?Z_STREAM_END$3:(2===r.wrap?(put_byte(r,255&e.adler),put_byte(r,e.adler>>8&255),put_byte(r,e.adler>>16&255),put_byte(r,e.adler>>24&255),put_byte(r,255&e.total_in),put_byte(r,e.total_in>>8&255),put_byte(r,e.total_in>>16&255),put_byte(r,e.total_in>>24&255)):(putShortMSB(r,e.adler>>>16),putShortMSB(r,65535&e.adler)),flush_pending(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Z_OK$3:Z_STREAM_END$3)},deflateEnd=e=>{if(deflateStateCheck(e))return Z_STREAM_ERROR$2;const t=e.state.status;return e.state=null,t===BUSY_STATE?err(e,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(e,t)=>{let r=t.length;if(deflateStateCheck(e))return Z_STREAM_ERROR$2;const n=e.state,i=n.wrap;if(2===i||1===i&&n.status!==INIT_STATE||n.lookahead)return Z_STREAM_ERROR$2;if(1===i&&(e.adler=adler32_1(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(zero(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,fill_window(n);n.lookahead>=MIN_MATCH;){let e=n.strstart,t=n.lookahead-(MIN_MATCH-1);do{n.ins_h=HASH(n,n.ins_h,n.window[e+MIN_MATCH-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=MIN_MATCH-1,fill_window(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=MIN_MATCH-1,n.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,n.wrap=i,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo:deflateInfo};const _has=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var assign=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)_has(r,t)&&(e[t]=r[t])}}return e},flattenChunks=e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=i.length}return r},common={assign:assign,flattenChunks:flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let e=0;e<256;e++)_utf8len[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t};const buf2binstring=(e,t)=>{if(t<65534&&e.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r};var buf2string=(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){o[i++]=t;continue}let a=_utf8len[t];if(a>4)o[i++]=65533,n+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&n<r;)t=t<<6|63&e[n++],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 buf2binstring(o,i)},utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+_utf8len[e[r]]>t?r:t},strings={string2buf:string2buf,buf2string:buf2string,utf8border:utf8border};function ZStream(){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}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH:Z_SYNC_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(e){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},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 zstream,this.strm.avail_out=0;let r=deflate_1$2.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Z_OK$2)throw new Error(messages[r]);if(t.header&&deflate_1$2.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?strings.string2buf(t.dictionary):"[object ArrayBuffer]"===toString$1.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=deflate_1$2.deflateSetDictionary(this.strm,e),r!==Z_OK$2)throw new Error(messages[r]);this._dict_set=!0}}Deflate$1.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Z_FINISH$2:Z_NO_FLUSH$1,"string"==typeof e?r.input=strings.string2buf(e):"[object ArrayBuffer]"===toString$1.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===Z_SYNC_FLUSH||o===Z_FULL_FLUSH)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=deflate_1$2.deflate(r,o),i===Z_STREAM_END$2)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=deflate_1$2.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Z_OK$2;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Deflate$1.prototype.onData=function(e){this.chunks.push(e)},Deflate$1.prototype.onEnd=function(e){e===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const BAD$1=16209,TYPE$1=16191;var inffast=function(e,t){let r,n,i,o,a,s,u,l,c,_,d,p,g,f,h,E,T,b,v,R,I,C,m,y;const S=e.state;r=e.next_in,m=e.input,n=r+(e.avail_in-5),i=e.next_out,y=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,_=S.window,d=S.hold,p=S.bits,g=S.lencode,f=S.distcode,h=(1<<S.lenbits)-1,E=(1<<S.distbits)-1;e:do{p<15&&(d+=m[r++]<<p,p+=8,d+=m[r++]<<p,p+=8),T=g[d&h];t:for(;;){if(b=T>>>24,d>>>=b,p-=b,b=T>>>16&255,0===b)y[i++]=65535&T;else{if(!(16&b)){if(64&b){if(32&b){S.mode=TYPE$1;break e}e.msg="invalid literal/length code",S.mode=BAD$1;break e}T=g[(65535&T)+(d&(1<<b)-1)];continue t}for(v=65535&T,b&=15,b&&(p<b&&(d+=m[r++]<<p,p+=8),v+=d&(1<<b)-1,d>>>=b,p-=b),p<15&&(d+=m[r++]<<p,p+=8,d+=m[r++]<<p,p+=8),T=f[d&E];;){if(b=T>>>24,d>>>=b,p-=b,b=T>>>16&255,16&b){if(R=65535&T,b&=15,p<b&&(d+=m[r++]<<p,p+=8,p<b&&(d+=m[r++]<<p,p+=8)),R+=d&(1<<b)-1,R>s){e.msg="invalid distance too far back",S.mode=BAD$1;break e}if(d>>>=b,p-=b,b=i-o,R>b){if(b=R-b,b>l&&S.sane){e.msg="invalid distance too far back",S.mode=BAD$1;break e}if(I=0,C=_,0===c){if(I+=u-b,b<v){v-=b;do{y[i++]=_[I++]}while(--b);I=i-R,C=y}}else if(c<b){if(I+=u+c-b,b-=c,b<v){v-=b;do{y[i++]=_[I++]}while(--b);if(I=0,c<v){b=c,v-=b;do{y[i++]=_[I++]}while(--b);I=i-R,C=y}}}else if(I+=c-b,b<v){v-=b;do{y[i++]=_[I++]}while(--b);I=i-R,C=y}for(;v>2;)y[i++]=C[I++],y[i++]=C[I++],y[i++]=C[I++],v-=3;v&&(y[i++]=C[I++],v>1&&(y[i++]=C[I++]))}else{I=i-R;do{y[i++]=y[I++],y[i++]=y[I++],y[i++]=y[I++],v-=3}while(v>2);v&&(y[i++]=y[I++],v>1&&(y[i++]=y[I++]))}break}if(64&b){e.msg="invalid distance code",S.mode=BAD$1;break e}T=f[(65535&T)+(d&(1<<b)-1)]}}break}}while(r<n&&i<a);v=p>>3,r-=v,p-=v<<3,d&=(1<<p)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<a?a-i+257:257-(i-a),S.hold=d,S.bits=p};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=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]),lext=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]),dbase=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]),dext=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]),inflate_table=(e,t,r,n,i,o,a,s)=>{const u=s.bits;let l,c,_,d,p,g,f=0,h=0,E=0,T=0,b=0,v=0,R=0,I=0,C=0,m=0,y=null;const S=new Uint16Array(MAXBITS+1),A=new Uint16Array(MAXBITS+1);let O,P,N,M=null;for(f=0;f<=MAXBITS;f++)S[f]=0;for(h=0;h<n;h++)S[t[r+h]]++;for(b=u,T=MAXBITS;T>=1&&0===S[T];T--);if(b>T&&(b=T),0===T)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(E=1;E<T&&0===S[E];E++);for(b<E&&(b=E),I=1,f=1;f<=MAXBITS;f++)if(I<<=1,I-=S[f],I<0)return-1;if(I>0&&(e===CODES$1||1!==T))return-1;for(A[1]=0,f=1;f<MAXBITS;f++)A[f+1]=A[f]+S[f];for(h=0;h<n;h++)0!==t[r+h]&&(a[A[t[r+h]]++]=h);if(e===CODES$1?(y=M=a,g=20):e===LENS$1?(y=lbase,M=lext,g=257):(y=dbase,M=dext,g=0),m=0,h=0,f=E,p=o,v=b,R=0,_=-1,C=1<<b,d=C-1,e===LENS$1&&C>ENOUGH_LENS$1||e===DISTS$1&&C>ENOUGH_DISTS$1)return 1;for(;;){O=f-R,a[h]+1<g?(P=0,N=a[h]):a[h]>=g?(P=M[a[h]-g],N=y[a[h]-g]):(P=96,N=0),l=1<<f-R,c=1<<v,E=c;do{c-=l,i[p+(m>>R)+c]=O<<24|P<<16|N}while(0!==c);for(l=1<<f-1;m&l;)l>>=1;if(0!==l?(m&=l-1,m+=l):m=0,h++,0==--S[f]){if(f===T)break;f=t[r+a[h]]}if(f>b&&(m&d)!==_){for(0===R&&(R=b),p+=E,v=f-R,I=1<<v;v+R<T&&(I-=S[v+R],!(I<=0));)v++,I<<=1;if(C+=1<<v,e===LENS$1&&C>ENOUGH_LENS$1||e===DISTS$1&&C>ENOUGH_DISTS$1)return 1;_=m&d,i[_]=b<<24|v<<16|p-o}}return 0!==m&&(i[p+m]=f-R<<24|64<<16),s.bits=b,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK:Z_BLOCK,Z_TREES:Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR:Z_BUF_ERROR,Z_DEFLATED:Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function InflateState(){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 inflateStateCheck=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<HEAD||t.mode>SYNC?1:0},inflateResetKeep=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;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=HEAD,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(ENOUGH_LENS),t.distcode=t.distdyn=new Int32Array(ENOUGH_DISTS),t.sane=1,t.back=-1,Z_OK$1},inflateReset=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,inflateResetKeep(e)},inflateReset2=(e,t)=>{let r;if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Z_STREAM_ERROR$1:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,inflateReset(e))},inflateInit2=(e,t)=>{if(!e)return Z_STREAM_ERROR$1;const r=new InflateState;e.state=r,r.strm=e,r.window=null,r.mode=HEAD;const n=inflateReset2(e,t);return n!==Z_OK$1&&(e.state=null),n},inflateInit=e=>inflateInit2(e,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=e=>{if(virgin){lenfix=new Int32Array(512),distfix=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(inftrees(LENS,e.lens,0,288,lenfix,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;inftrees(DISTS,e.lens,0,32,distfix,0,e.work,{bits:5}),virgin=!1}e.lencode=lenfix,e.lenbits=9,e.distcode=distfix,e.distbits=5},updatewindow=(e,t,r,n)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(t.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0},inflate$2=(e,t)=>{let r,n,i,o,a,s,u,l,c,_,d,p,g,f,h,E,T,b,v,R,I,C,m=0;const y=new Uint8Array(4);let S,A;const O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(e)||!e.output||!e.input&&0!==e.avail_in)return Z_STREAM_ERROR$1;r=e.state,r.mode===TYPE&&(r.mode=TYPEDO),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,c=r.bits,_=s,d=u,C=Z_OK$1;e:for(;;)switch(r.mode){case HEAD:if(0===r.wrap){r.mode=TYPEDO;break}for(;c<16;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(2&r.wrap&&35615===l){0===r.wbits&&(r.wbits=15),r.check=0,y[0]=255&l,y[1]=l>>>8&255,r.check=crc32_1(r.check,y,2,0),l=0,c=0,r.mode=FLAGS;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=BAD;break}if((15&l)!==Z_DEFLATED){e.msg="unknown compression method",r.mode=BAD;break}if(l>>>=4,c-=4,I=8+(15&l),0===r.wbits&&(r.wbits=I),I>15||I>r.wbits){e.msg="invalid window size",r.mode=BAD;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&l?DICTID:TYPE,l=0,c=0;break;case FLAGS:for(;c<16;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(r.flags=l,(255&r.flags)!==Z_DEFLATED){e.msg="unknown compression method",r.mode=BAD;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=BAD;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&4&r.wrap&&(y[0]=255&l,y[1]=l>>>8&255,r.check=crc32_1(r.check,y,2,0)),l=0,c=0,r.mode=TIME;case TIME:for(;c<32;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.head&&(r.head.time=l),512&r.flags&&4&r.wrap&&(y[0]=255&l,y[1]=l>>>8&255,y[2]=l>>>16&255,y[3]=l>>>24&255,r.check=crc32_1(r.check,y,4,0)),l=0,c=0,r.mode=OS;case OS:for(;c<16;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&4&r.wrap&&(y[0]=255&l,y[1]=l>>>8&255,r.check=crc32_1(r.check,y,2,0)),l=0,c=0,r.mode=EXLEN;case EXLEN:if(1024&r.flags){for(;c<16;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&4&r.wrap&&(y[0]=255&l,y[1]=l>>>8&255,r.check=crc32_1(r.check,y,2,0)),l=0,c=0}else r.head&&(r.head.extra=null);r.mode=EXTRA;case EXTRA:if(1024&r.flags&&(p=r.length,p>s&&(p=s),p&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+p),I)),512&r.flags&&4&r.wrap&&(r.check=crc32_1(r.check,n,p,o)),s-=p,o+=p,r.length-=p),r.length))break e;r.length=0,r.mode=NAME;case NAME:if(2048&r.flags){if(0===s)break e;p=0;do{I=n[o+p++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I))}while(I&&p<s);if(512&r.flags&&4&r.wrap&&(r.check=crc32_1(r.check,n,p,o)),s-=p,o+=p,I)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=COMMENT;case COMMENT:if(4096&r.flags){if(0===s)break e;p=0;do{I=n[o+p++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I))}while(I&&p<s);if(512&r.flags&&4&r.wrap&&(r.check=crc32_1(r.check,n,p,o)),s-=p,o+=p,I)break e}else r.head&&(r.head.comment=null);r.mode=HCRC;case HCRC:if(512&r.flags){for(;c<16;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=BAD;break}l=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=TYPE;break;case DICTID:for(;c<32;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}e.adler=r.check=zswap32(l),l=0,c=0,r.mode=DICT;case DICT:if(0===r.havedict)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=l,r.bits=c,Z_NEED_DICT$1;e.adler=r.check=1,r.mode=TYPE;case TYPE:if(t===Z_BLOCK||t===Z_TREES)break e;case TYPEDO:if(r.last){l>>>=7&c,c-=7&c,r.mode=CHECK;break}for(;c<3;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}switch(r.last=1&l,l>>>=1,c-=1,3&l){case 0:r.mode=STORED;break;case 1:if(fixedtables(r),r.mode=LEN_,t===Z_TREES){l>>>=2,c-=2;break e}break;case 2:r.mode=TABLE;break;case 3:e.msg="invalid block type",r.mode=BAD}l>>>=2,c-=2;break;case STORED:for(l>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=BAD;break}if(r.length=65535&l,l=0,c=0,r.mode=COPY_,t===Z_TREES)break e;case COPY_:r.mode=COPY;case COPY:if(p=r.length,p){if(p>s&&(p=s),p>u&&(p=u),0===p)break e;i.set(n.subarray(o,o+p),a),s-=p,o+=p,u-=p,a+=p,r.length-=p;break}r.mode=TYPE;break;case TABLE:for(;c<14;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(r.nlen=257+(31&l),l>>>=5,c-=5,r.ndist=1+(31&l),l>>>=5,c-=5,r.ncode=4+(15&l),l>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=BAD;break}r.have=0,r.mode=LENLENS;case LENLENS:for(;r.have<r.ncode;){for(;c<3;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.lens[O[r.have++]]=7&l,l>>>=3,c-=3}for(;r.have<19;)r.lens[O[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},C=inftrees(CODES,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,C){e.msg="invalid code lengths set",r.mode=BAD;break}r.have=0,r.mode=CODELENS;case CODELENS:for(;r.have<r.nlen+r.ndist;){for(;m=r.lencode[l&(1<<r.lenbits)-1],h=m>>>24,E=m>>>16&255,T=65535&m,!(h<=c);){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(T<16)l>>>=h,c-=h,r.lens[r.have++]=T;else{if(16===T){for(A=h+2;c<A;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(l>>>=h,c-=h,0===r.have){e.msg="invalid bit length repeat",r.mode=BAD;break}I=r.lens[r.have-1],p=3+(3&l),l>>>=2,c-=2}else if(17===T){for(A=h+3;c<A;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}l>>>=h,c-=h,I=0,p=3+(7&l),l>>>=3,c-=3}else{for(A=h+7;c<A;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}l>>>=h,c-=h,I=0,p=11+(127&l),l>>>=7,c-=7}if(r.have+p>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=BAD;break}for(;p--;)r.lens[r.have++]=I}}if(r.mode===BAD)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=BAD;break}if(r.lenbits=9,S={bits:r.lenbits},C=inftrees(LENS,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,C){e.msg="invalid literal/lengths set",r.mode=BAD;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},C=inftrees(DISTS,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,C){e.msg="invalid distances set",r.mode=BAD;break}if(r.mode=LEN_,t===Z_TREES)break e;case LEN_:r.mode=LEN;case LEN:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=l,r.bits=c,inffast(e,d),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,c=r.bits,r.mode===TYPE&&(r.back=-1);break}for(r.back=0;m=r.lencode[l&(1<<r.lenbits)-1],h=m>>>24,E=m>>>16&255,T=65535&m,!(h<=c);){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(E&&!(240&E)){for(b=h,v=E,R=T;m=r.lencode[R+((l&(1<<b+v)-1)>>b)],h=m>>>24,E=m>>>16&255,T=65535&m,!(b+h<=c);){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}l>>>=b,c-=b,r.back+=b}if(l>>>=h,c-=h,r.back+=h,r.length=T,0===E){r.mode=LIT;break}if(32&E){r.back=-1,r.mode=TYPE;break}if(64&E){e.msg="invalid literal/length code",r.mode=BAD;break}r.extra=15&E,r.mode=LENEXT;case LENEXT:if(r.extra){for(A=r.extra;c<A;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=DIST;case DIST:for(;m=r.distcode[l&(1<<r.distbits)-1],h=m>>>24,E=m>>>16&255,T=65535&m,!(h<=c);){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(!(240&E)){for(b=h,v=E,R=T;m=r.distcode[R+((l&(1<<b+v)-1)>>b)],h=m>>>24,E=m>>>16&255,T=65535&m,!(b+h<=c);){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}l>>>=b,c-=b,r.back+=b}if(l>>>=h,c-=h,r.back+=h,64&E){e.msg="invalid distance code",r.mode=BAD;break}r.offset=T,r.extra=15&E,r.mode=DISTEXT;case DISTEXT:if(r.extra){for(A=r.extra;c<A;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=BAD;break}r.mode=MATCH;case MATCH:if(0===u)break e;if(p=d-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=BAD;break}p>r.wnext?(p-=r.wnext,g=r.wsize-p):g=r.wnext-p,p>r.length&&(p=r.length),f=r.window}else f=i,g=a-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do{i[a++]=f[g++]}while(--p);0===r.length&&(r.mode=LEN);break;case LIT:if(0===u)break e;i[a++]=r.length,u--,r.mode=LEN;break;case CHECK:if(r.wrap){for(;c<32;){if(0===s)break e;s--,l|=n[o++]<<c,c+=8}if(d-=u,e.total_out+=d,r.total+=d,4&r.wrap&&d&&(e.adler=r.check=r.flags?crc32_1(r.check,i,d,a-d):adler32_1(r.check,i,d,a-d)),d=u,4&r.wrap&&(r.flags?l:zswap32(l))!==r.check){e.msg="incorrect data check",r.mode=BAD;break}l=0,c=0}r.mode=LENGTH;case LENGTH:if(r.wrap&&r.flags){for(;c<32;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=BAD;break}l=0,c=0}r.mode=DONE;case DONE:C=Z_STREAM_END$1;break e;case BAD:C=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;default:return Z_STREAM_ERROR$1}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=l,r.bits=c,(r.wsize||d!==e.avail_out&&r.mode<BAD&&(r.mode<CHECK||t!==Z_FINISH$1))&&updatewindow(e,e.output,e.next_out,d-e.avail_out),_-=e.avail_in,d-=e.avail_out,e.total_in+=_,e.total_out+=d,r.total+=d,4&r.wrap&&d&&(e.adler=r.check=r.flags?crc32_1(r.check,i,d,e.next_out-d):adler32_1(r.check,i,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===TYPE?128:0)+(r.mode===LEN_||r.mode===COPY_?256:0),(0===_&&0===d||t===Z_FINISH$1)&&C===Z_OK$1&&(C=Z_BUF_ERROR),C},inflateEnd=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;let t=e.state;return t.window&&(t.window=null),e.state=null,Z_OK$1},inflateGetHeader=(e,t)=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,Z_OK$1):Z_STREAM_ERROR$1},inflateSetDictionary=(e,t)=>{const r=t.length;let n,i,o;return inflateStateCheck(e)?Z_STREAM_ERROR$1:(n=e.state,0!==n.wrap&&n.mode!==DICT?Z_STREAM_ERROR$1:n.mode===DICT&&(i=1,i=adler32_1(i,t,r,0),i!==n.check)?Z_DATA_ERROR$1:(o=updatewindow(e,t,r,r),o?(n.mode=MEM,Z_MEM_ERROR$1):(n.havedict=1,Z_OK$1)))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo:inflateInfo};function GZheader(){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}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH,Z_FINISH:Z_FINISH,Z_OK:Z_OK,Z_STREAM_END:Z_STREAM_END,Z_NEED_DICT:Z_NEED_DICT,Z_STREAM_ERROR:Z_STREAM_ERROR,Z_DATA_ERROR:Z_DATA_ERROR,Z_MEM_ERROR:Z_MEM_ERROR}=constants$2;function Inflate$1(e){this.options=common.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 zstream,this.strm.avail_out=0;let r=inflate_1$2.inflateInit2(this.strm,t.windowBits);if(r!==Z_OK)throw new Error(messages[r]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=strings.string2buf(t.dictionary):"[object ArrayBuffer]"===toString.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=inflate_1$2.inflateSetDictionary(this.strm,t.dictionary),r!==Z_OK)))throw new Error(messages[r])}function inflate$1(e,t){const r=new Inflate$1(t);if(r.push(e),r.err)throw r.msg||messages[r.err];return r.result}function inflateRaw$1(e,t){return(t=t||{}).raw=!0,inflate$1(e,t)}Inflate$1.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Z_FINISH:Z_NO_FLUSH,"[object ArrayBuffer]"===toString.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=inflate_1$2.inflate(r,a),o===Z_NEED_DICT&&i&&(o=inflate_1$2.inflateSetDictionary(r,i),o===Z_OK?o=inflate_1$2.inflate(r,a):o===Z_DATA_ERROR&&(o=Z_NEED_DICT));r.avail_in>0&&o===Z_STREAM_END&&r.state.wrap>0&&0!==e[r.next_in];)inflate_1$2.inflateReset(r),o=inflate_1$2.inflate(r,a);switch(o){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(o),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(0===r.avail_out||o===Z_STREAM_END))if("string"===this.options.to){let e=strings.utf8border(r.output,r.next_out),t=r.next_out-e,i=strings.buf2string(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==Z_OK||0!==s){if(o===Z_STREAM_END)return o=inflate_1$2.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Inflate$1.prototype.onData=function(e){this.chunks.push(e)},Inflate$1.prototype.onEnd=function(e){e===Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,constants=constants$2,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1,constants:constants};const{Inflate:Inflate,inflate:inflate,inflateRaw:inflateRaw,ungzip:ungzip}=inflate_1$1;var ungzip_1=ungzip;function trans2IPBProfileInfo(e){return Object.keys(e).map((function(t){var r=e[t];return"string"!=typeof r&&(r="".concat(r)),{key:t,value:r}}))}function encodeChannelsInput(e,t,r,n){return codec.encode(IMPB.ChannelsInput,{targetId:e,type:exports.ConversationType.GROUP,users:n,extProfile:r?trans2IPBProfileInfo(r):void 0,settingProfile:trans2IPBProfileInfo(t)})}var encodeSessionMsgReadInput=function(e,t){return codec.encode(IMPB.SessionMsgReadInput,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},encodeRelationQryInput=function(e,t,r){return codec.encode(IMPB.RelationQryInput,{startTime:e,order:t,count:r,compressioEnabled:GzipCompressor.enable()})},decodeRelationsOutput=function(e){var t=codec.decode(IMPB.RelationsOutput,e),r=t.compressioEnabled,n=t.compressedData,i=t.info,o=t.pullTime,a=t.isFinished;if(r){var s=ungzip_1(n);return decodeRelationsOutput(s)}return{info:i,pullTime:o,isFinished:a}},encodeUltraGrpPullMsg=function(e){return codec.encode(IMPB.UltraGrpPullMsg,{syncTime:e,compressioEnabled:GzipCompressor.enable()})},decodeDownStreamMessages=function(e){var t=codec.decode(IMPB.DownStreamMessages,e);if(t.compressioEnabled){var r=ungzip_1(t.compressedData);return decodeDownStreamMessages(r)}return t},encodeChrmPullMsg=function(e,t){return codec.encode(IMPB.ChrmPullMsg,{syncTime:e,count:t,compressioEnabled:GzipCompressor.enable()})},decodeChrmDownStreamMessages=function(e){var t=codec.decode(IMPB.ChrmDownStreamMessages,e);if(t.compressioEnabled){var r=ungzip_1(t.compressedData);return decodeChrmDownStreamMessages(r)}return{syncTime:t.syncTime,list:t.list.map((function(e){return codec.decode(IMPB.DownStreamMessage,new Uint8Array(e))}))}},encodeQueryReceiptReq=function(e){return codec.encode(IMPB.QueryReceiptReq,__assign(__assign({},e),{compress:GzipCompressor.enable()}))},decodeQueryReceiptResp=function(e){var t=codec.decode(IMPB.ReceiptResp,e);if(t.compress){var r=ungzip_1(t.compressData);return decodeQueryReceiptResp(r)}return t},encodeQueryReceiptBatchReq=function(e){return codec.encode(IMPB.QueryReceiptBatchReq,{items:e,compress:GzipCompressor.enable()})},decodeQueryReceiptBatchResp=function(e){var t=codec.decode(IMPB.QueryReceiptBatchResp,e);if(t.compress){var r=ungzip_1(t.compressData);return decodeQueryReceiptBatchResp(r)}return t},decodeChannelsListResult=function(e){var t=e.listType,r=e.result,n=e.page,i=new Uint8Array(r),o=[];switch(t){case 1:o=codec.decode(IMPB.ChannelsUserInfos,i).list;break;case 2:o=codec.decode(IMPB.ChannelsInviteStatusInfos,i).list;break;case 3:o=codec.decode(IMPB.ChannelsJoinedInfos,i).list;break;case 11:o=codec.decode(IMPB.FriendUserInfos,i).list;break;case 13:o=codec.decode(IMPB.FriendInviteInfos,i).list}return __assign(__assign({},n),{list:o})},encodeHistoryMsgInput=function(e){return codec.encode(IMPB.HistoryMsgInput,__assign(__assign({},e),{compressioEnabled:GzipCompressor.enable(),ignoreCmd:!0}))},decodeHistoryMsgOuput=function(e){var t=codec.decode(IMPB.HistoryMsgOuput,e);if(t.compressioEnabled){var r=ungzip_1(t.compressedData);return decodeHistoryMsgOuput(r)}return t},encodeSessionStateModifyReq=function(e,t){return codec.encode(IMPB.SessionStateModifyReq,{ignoreVersion:!0,version:e,state:t})},encodePullModifyMsgReq=function(e){return codec.encode(IMPB.PullModifyMsgReq,__assign(__assign({},e),{modifyType:[1],compress:GzipCompressor.enable()}))},decodePullModifyMsgResp=function(e){var t=codec.decode(IMPB.PullModifyMsgResp,e);if(t.compress){var r=ungzip_1(t.compressedData);return decodePullModifyMsgResp(r)}return t},encodeQueryChrmKV=function(e){return codec.encode(IMPB.QueryChrmKV,{timestamp:e,compressioEnabled:GzipCompressor.enable()})},decodeChrmKVOutput=function(e){var t=codec.decode(IMPB.ChrmKVOutput,e);if(t.compressioEnabled){var r=ungzip_1(t.compressedData);return decodeChrmKVOutput(r)}return t},encodeUpStreamMessage=function(e,t){var r,n,i,o,a=e.targetId,s=e.conversationType,u=e.channelId,l=t.messageType,c=t.isMentioned,_=t.disableNotification,d=t.canIncludeExpansion,p=t.pushConfig,g=t.directionalUserIdList,f=t.isVoipPush,h=t.isFilerWhiteBlacklist,E=t.content,T=t.pushContent,b=t.pushData,v=t.expansion,R=t.messageId,I=t.needReceipt,C=t.disableUpdateLastMessage,m=t.isStatusMessage,y=getMessageTypeDescription(l).isPersited,S=encodeUpStreamStreamSessionId(l,c,_,d,m),A=encodeUpStreamMessageConfigFlag(!!f,!h,!!(null==p?void 0:p.disablePushTitle),!!(null==p?void 0:p.forceShowDetailContent));if(E.user&&E.user.portraitUri&&(E.user.portrait=E.user.portraitUri),d&&v){i={};try{for(var O=__values(Object.entries(v)),P=O.next();!P.done;P=O.next()){var N=__read(P.value,2),M=N[0],L=N[1];i[M]={v:L}}}catch(e){r={error:e}}finally{try{P&&!P.done&&(n=O.return)&&n.call(O)}finally{if(r)throw r.error}}}if(p){var U=p.pushTitle,w=p.iOSConfig,D=p.androidConfig,G=p.templateId,x=p.harmonyOSConfig;o={title:U,pushConfigs:pushConfigsToJSON(w,D,x),pushId:null==D?void 0:D.notificationId,templateId:G}}var V=s===exports.ConversationType.SYSTEM?a:void 0,F=0;return y&&C&&(F|=1),I&&(F|=2),codec.encode(IMPB.UpStreamMessage,{sessionId:S,pushText:(null==p?void 0:p.pushContent)||T,appData:(null==p?void 0:p.pushData)||b,toUserIds:g,configFlag:A,classname:l,content:JSON.stringify(E),extraContent:i?JSON.stringify(i):void 0,pushExt:o,clientUniqueId:R,busChannel:u,systemId:V,optionBits:F})},encodeChannelsQueryInput=function(e){return codec.encode(IMPB.ChannelsQueryInput,__assign(__assign({},e),{type:exports.ConversationType.GROUP}))},encodeChannelsMemberUpdateInput=function(e){return codec.encode(IMPB.ChannelsMemberUpdateInput,__assign(__assign({},e),{type:exports.ConversationType.GROUP}))},encodeModifyChannelsInput=function(e){return codec.encode(IMPB.ModifyChannelsInput,__assign(__assign({},e),{type:exports.ConversationType.GROUP}))},_WebSGModule_instances,_WebSGModule_onSyncMsg,_WebSGModule_onSMsg,_WebSGModule_onSNtf,WebSGModule=function(e){function t(t,r){var n=e.call(this,"WebSGModule")||this;return _WebSGModule_instances.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),n._ctx.on("sNtf",__classPrivateFieldGet(n,_WebSGModule_instances,"m",_WebSGModule_onSNtf),n),n._ctx.on("sMsg",__classPrivateFieldGet(n,_WebSGModule_instances,"m",_WebSGModule_onSMsg),n),n._ctx.on("syncMsg",__classPrivateFieldGet(n,_WebSGModule_instances,"m",_WebSGModule_onSyncMsg),n),n}return __extends(t,e),Object.defineProperty(t.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,l,c,_,d,p,g,f,h,E,T,b;return __generator(this,(function(v){switch(v.label){case 0:return t=this._ctx,r=t.logger,n=t.currentUserId,i=t.connectedTime,o=this._storage.get("inboxTime"),a=this._storage.get("outboxTime"),s=this._storage.get("broadcastTime"),u=r.createTraceId(),r.info(Log.L_PULL_MSG_T,JSON.stringify({inboxTime:o,outboxTime:a,broadcastTime:s}),u),l=codec.encode(IMPB.SyncRequestMsg,{ispolling:!1,isPullSend:!0,syncTime:o,sendBoxSyncTime:a,broadcastSyncTime:s,compressioEnabled:GzipCompressor.enable()}),[4,this._ctx.query(Topic.pullMsg,this._ctx.currentUserId,l)];case 1:return(c=v.sent()).isOk?(_=decodeDownStreamMessages(c.data.pbData),p=(d=_).list,g=d.finished,f=d.syncTime,h=d.broadcastSyncTime,E=a,T=p.map((function(e){var t=trans2IReceivedMessage(e,n,e.dataTime<i);return t.messageDirection===exports.MessageDirection.SEND&&(E=Math.max(E,t.sentTime)),t})),this._storage.set("inboxTime",f),this._storage.set("broadcastTime",h||1),this._storage.set("outboxTime",E),r.info(Log.L_PULL_MSG_R,JSON.stringify({code:0,inboxTime:f,broadcastTime:h,outboxTime:E,msgCount:T.length,hasNext:!!g}),u),b=Math.max(f,h||1,E),this._ctx.emit("messagesFromSG",T,!!g,e),[2,ok({version:b,hasNext:!g})]):(r.warn(Log.L_PULL_MSG_R,JSON.stringify({code:c.code}),u),[2,c.wipe()])}}))}))}}),t}(LinearQuery),_WebUGModule_instances,_WebUGModule_handleSCmdNotify,_WebUGModule_handleSyncMsg,_WebUGModule_pullUgRelation,_WebUGModule_pullUgMsg;_WebSGModule_instances=new WeakSet,_WebSGModule_onSyncMsg=function(e,t,r){var n=t.conversationType,i=t.sentTime;n!==exports.ConversationType.ULTRA_GROUP&&n!==exports.ConversationType.CHATROOM&&(n===exports.ConversationType.RTC_ROOM||checkIsStatusMessage(r)||(e.stopPropagation(),this.push(i)))},_WebSGModule_onSMsg=function(e,t){var r=t.conversationType,n=t.sentTime,i=t.isStatusMessage;r!==exports.ConversationType.CHATROOM&&(e.stopPropagation(),i||r===exports.ConversationType.RTC_ROOM?this._ctx.emit("smsgFromSignalGroup",t):this.push(n))},_WebSGModule_onSNtf=function(e,t){1===t.type&&(e.stopPropagation(),this.push(t.time))};var WebUGModule=function(e){function t(t){var r=e.call(this,"WebUGModule")||this;return _WebUGModule_instances.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r._ctx.on("syncMsg",__classPrivateFieldGet(r,_WebUGModule_instances,"m",_WebUGModule_handleSyncMsg),r),r._ctx.on("sCmd",__classPrivateFieldGet(r,_WebUGModule_instances,"m",_WebUGModule_handleSCmdNotify),r),r}return __extends(t,e),Object.defineProperty(t.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return[4,__classPrivateFieldGet(this,_WebUGModule_instances,"m",_WebUGModule_pullUgMsg).call(this,0)];case 1:return(e=a.sent()).isOk?(this._ctx.logger.info(Log.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,__classPrivateFieldGet(this,_WebUGModule_instances,"m",_WebUGModule_pullUgRelation).call(this,0,[])]):(this._ctx.logger.warn(Log.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(r=a.sent()).isOk?(n=r.data,i=n.length>0?n[n.length-1].versionTime:0,o=Math.max(t,i),[2,ok({relations:n,msgVersion:o})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,__classPrivateFieldGet(this,_WebUGModule_instances,"m",_WebUGModule_pullUgMsg).call(this,e)];case 1:return[2,r.sent().trans((function(e){var r=e,n=r.syncTime,i=r.finished,o=r.list;if(null==o?void 0:o.length){var a=t._ctx.currentUserId,s=o.map((function(e){return trans2IReceivedMessage(e,a,!1)}));t._ctx.emit("messagesFromUG",s,n)}return{version:n,hasNext:!i}}))]}}))}))}}),t}(LinearQuery),_WebServerEventHandler_instances,_WebServerEventHandler_reqHandler;_WebUGModule_instances=new WeakSet,_WebUGModule_handleSCmdNotify=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},_WebUGModule_handleSyncMsg=function(e,t){t.conversationType===exports.ConversationType.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},_WebUGModule_pullUgRelation=function e(t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s,u,l,c,_;return __generator(this,(function(d){switch(d.label){case 0:return(n=this._ctx).currentUserId,i=n.logger,o=i.createTraceId(),i.info(Log.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),o),a=codec.encode(IMPB.UltraGrpPullSes,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query(Topic.pullUgSes,this._ctx.currentUserId,a,void 0)];case 1:return s=d.sent(),i.summary(Log.L_PULL_UG_RELATIONS_R,s,o,{ver:t}),s.isOk?(u=decodeRelationsOutput(s.data.pbData),l=u.info,c=u.isFinished,r.push.apply(r,__spreadArray([],__read(l),!1)),c?[2,ok(r)]:(_=l[l.length-1].versionTime,[2,__classPrivateFieldGet(this,_WebUGModule_instances,"m",e).call(this,_,r)])):[2,s.wipe()]}}))}))},_WebUGModule_pullUgMsg=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=n.createTraceId(),n.info(Log.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),o=encodeUltraGrpPullMsg(e),[4,this._ctx.query(Topic.pullUgMsg,r,o)];case 1:return a=u.sent(),n.summary(Log.L_PULL_ULTRA_MSG_R,a,i,{version:e}),a.isOk?(s=a.data,[2,ok(decodeDownStreamMessages(s.pbData))]):[2,a.wipe()]}}))}))};var ServerEventType={MSG_EXPANSION:1,MSG_MODIFY:2,MSG_RECALL:3,CHANNEL_CHANGE:4,USER_GROUP_CHANGE:5,UG_DEL:6,GROUP_OPERATION:11,GROUP_PROFILE_CHANGE:12,GROUP_APPLICATION_INVITATION:13,GROUP_FOLLOW_USER_CHANGE:14,FRIEND_APPLICATION:31,READ_EVENT:36,CONVERT:41},WebServerEventHandler=function(e){function t(t,r){var n=e.call(this,"WebServerEventHandler")||this;return _WebServerEventHandler_instances.add(n),Object.defineProperty(n,"_con",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return __extends(t,e),Object.defineProperty(t.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u=this;return __generator(this,(function(l){switch(l.label){case 0:return t=this._logger.createTraceId(),this._logger.info(Log.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,__classPrivateFieldGet(this,_WebServerEventHandler_instances,"m",_WebServerEventHandler_reqHandler).call(this,e)];case 1:return r=l.sent(),this._logger.summary(Log.L_PULL_EVENT_CHANGE_R,r,t,{version:e}),r.isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i.length&&(s=new Map,i.forEach((function(e){var t=e.changeType;s.has(t)?s.get(t).push(e):s.set(t,[e])})),Array.from(s.entries()).forEach((function(e){var t=__read(e,2),r=t[0],n=t[1];u.emit("serverEvent",r,n)}))),[2,ok({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return e=this._logger.createTraceId(),this._logger.info(Log.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,__classPrivateFieldGet(this,_WebServerEventHandler_instances,"m",_WebServerEventHandler_reqHandler).call(this,0)];case 1:return t=r.sent(),this._logger.summary(Log.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),t}(LinearQuery),_WebUGServerEventHandler_instances,_WebUGServerEventHandler_handleUGEvent,_WebUGServerEventHandler_handleUGMsgChanged;_WebServerEventHandler_instances=new WeakSet,_WebServerEventHandler_reqHandler=function(e){var t=codec.encode(IMPB.QueryMsgChange,{syncTime:e});return this._con.query(Topic.pullEventChange,this._con.getCurrentUserId(),t,IMPB.EventChangeList)};var WebUGServerEventHandler=function(e){function t(t){var r=e.call(this,"WebUGServerEventHandler")||this;return _WebUGServerEventHandler_instances.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return __extends(t,e),Object.defineProperty(t.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return t=codec.encode(IMPB.QueryMsgChange,{syncTime:e}),[4,this._ctx.query(Topic.qryMsgChange,this._ctx.currentUserId,t,IMPB.MsgChangeList)];case 1:return(r=s.sent()).isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i&&i.length&&__classPrivateFieldGet(this,_WebUGServerEventHandler_instances,"m",_WebUGServerEventHandler_handleUGEvent).call(this,i),[2,ok({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),t}(LinearQuery);_WebUGServerEventHandler_instances=new WeakSet,_WebUGServerEventHandler_handleUGEvent=function(e){var t=[],r=[],n=[],i=[],o=[];e.forEach((function(e){switch(e.changeType){case 1:r.push(e);break;case 2:t.push(e);break;case 3:n.push(e);break;case 4:i.push(e);break;case 5:o.push(e)}})),r.length&&__classPrivateFieldGet(this,_WebUGServerEventHandler_instances,"m",_WebUGServerEventHandler_handleUGMsgChanged).call(this,r,1),t.length&&__classPrivateFieldGet(this,_WebUGServerEventHandler_instances,"m",_WebUGServerEventHandler_handleUGMsgChanged).call(this,t,2),n.length&&this.emit("ugMsgRecalled",e),i.length&&this._ctx.emit("ugChannelChanged",i),o.length&&this._ctx.emit("ugUserGroupChanged",o)},_WebUGServerEventHandler_handleUGMsgChanged=function(e,t){var r=this,n=new Map;e.forEach((function(e){var t=e.targetId,r=e.busChannel,i=e.msgUID,o="".concat(t,"-").concat(r),a=n.get(o);a?a.messageUIds.push(i):n.set(o,{conversationIdentifier:{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:r},messageUIds:[i]})})),Array.from(n.entries()).forEach((function(e){var n=__read(e,2);n[0];var i=n[1];1===t?r.emit("ugMsgExpansion",i.conversationIdentifier,i.messageUIds):r.emit("ugMsgModify",i.conversationIdentifier,i.messageUIds)}))};var unsupportedReturnCode=function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return[2,exports.ErrorCode.NOT_SUPPORT]}))}))},unsupportedSync=function(){return fail(exports.ErrorCode.NOT_SUPPORT,"Not support")},unsupported=function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return[2,unsupportedSync()]}))}))},_WebSGMsgModifyReceiver_instances,_WebSGMsgModifyReceiver_initVersion,_WebSGMsgModifyReceiver_needDispatchMessageModifiedSyncCompleted,_WebSGMsgModifyReceiver_onConnected,_WebSGMsgModifyReceiver_onMessagesFromSG,_WebSGMsgModifyReceiver_handleModifyMsgs,WebSGMsgModifyReceiver=function(e){function t(t,r){var n=e.call(this,"WebSGMsgModifyReceiver")||this;return _WebSGMsgModifyReceiver_instances.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),_WebSGMsgModifyReceiver_initVersion.set(n,0),_WebSGMsgModifyReceiver_needDispatchMessageModifiedSyncCompleted.set(n,!0),n._ctx.on("onConnected",__classPrivateFieldGet(n,_WebSGMsgModifyReceiver_instances,"m",_WebSGMsgModifyReceiver_onConnected),n),n._ctx.on("messagesFromSG",__classPrivateFieldGet(n,_WebSGMsgModifyReceiver_instances,"m",_WebSGMsgModifyReceiver_onMessagesFromSG),n),n}return __extends(t,e),Object.defineProperty(t.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.setInitVersion(__classPrivateFieldGet(this,_WebSGMsgModifyReceiver_initVersion,"f"),!0)}}),Object.defineProperty(t.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return t=this._ctx.logger.createTraceId(),this._ctx.logger.info(Log.L_PULL_MODIFY_MSG_T,JSON.stringify({time:e}),t),r=encodePullModifyMsgReq({pullVersion:e}),[4,this._ctx.query(Topic.pullModifyMsg,this._ctx.currentUserId,r,void 0)];case 1:return n=u.sent(),this._ctx.logger.summary(Log.L_PULL_MODIFY_MSG_R,n,t),n.isOk?(i=decodePullModifyMsgResp(n.data.pbData),o=i.msg,a=i.nextVersion,s=i.finished,o&&o.length&&__classPrivateFieldGet(this,_WebSGMsgModifyReceiver_instances,"m",_WebSGMsgModifyReceiver_handleModifyMsgs).call(this,o),__classPrivateFieldGet(this,_WebSGMsgModifyReceiver_needDispatchMessageModifiedSyncCompleted,"f")&&(this._ctx.emit("messageModifiedSyncCompleted",!s),__classPrivateFieldSet(this,_WebSGMsgModifyReceiver_needDispatchMessageModifiedSyncCompleted,!1,"f")),[2,ok({version:a,hasNext:!s})]):[2,n.wipe()]}}))}))}}),t}(LinearQuery),_a$1,_WebChatService_instances,_WebChatService_ugMsgReceiver,_WebChatService_sgMsgReceiver,_WebChatService_ugEventReceiver,_WebChatService_sgModifyMsgReceiver,_WebChatService_handleServerEvent,_WebChatService_handleSGConnected,_WebChatService_handleSettingConnected,_WebChatService_onConnected,_WebChatService_sgRelationsVersion,_WebChatService_fetchSGRelations,_WebChatService_handleUGMessageChanged,_WebChatService_handleUGMsgModify,_WebChatService_handleUGMsgExpansion,_WebChatService_handleUGMsgRecalled,_WebChatService_updateUGModelWhileRecallMsg,_WebChatService_handleUgWhileConnected,_WebChatService_stopScheduleTask,_WebChatService_handleSCmdNotify,_WebChatService_handleSignal,_WebChatService_getConversationListFromServer,_WebChatService_addLatestMessageForConversations,_WebChatService_batchSetConversationStatus,_WebChatService_requestingSet,_WebChatService_requestSpeechToText,_WebChatService_qryMsg,_WebChatService_handleMsgQuery,_WebChatService_decodeRelationsOutput,_WebChatService_qryRelation;_WebSGMsgModifyReceiver_initVersion=new WeakMap,_WebSGMsgModifyReceiver_needDispatchMessageModifiedSyncCompleted=new WeakMap,_WebSGMsgModifyReceiver_instances=new WeakSet,_WebSGMsgModifyReceiver_onConnected=function(e,t){__classPrivateFieldSet(this,_WebSGMsgModifyReceiver_needDispatchMessageModifiedSyncCompleted,!0,"f"),t||(this.reset(),__classPrivateFieldSet(this,_WebSGMsgModifyReceiver_initVersion,this._ctx.connectedTime,"f"))},_WebSGMsgModifyReceiver_onMessagesFromSG=function(e,t,r,n){0===n&&t.length>0&&__classPrivateFieldSet(this,_WebSGMsgModifyReceiver_initVersion,t[0].sentTime,"f")},_WebSGMsgModifyReceiver_handleModifyMsgs=function(e){var t=this,r=[],n=this._ctx.currentUserId;e.forEach((function(e){var i=e.msg;if(1===e.modifyType){var o=trans2IReceivedMessage(i,n,!1);r.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,_=c.messageUId,d=c.messageType,p=c.content;if(_!==o.messageUId){if(d===MessageType.REFERENCE){if(p.referMsgUid!==o.messageUId)return;p.referMsg=o.content}}else l.updateAttrs({latestMessage:o})}}})),r.length&&this._ctx.emit("messageModified",r)};var INTERVAL=18e4,WebChatService=function(){function e(e,t){_WebChatService_instances.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}),_WebChatService_ugMsgReceiver.set(this,void 0),_WebChatService_sgMsgReceiver.set(this,void 0),_WebChatService_ugEventReceiver.set(this,void 0),_WebChatService_sgModifyMsgReceiver.set(this,void 0),_WebChatService_sgRelationsVersion.set(this,1),Object.defineProperty(this,"getConversationListByPageIndex",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),_WebChatService_requestingSet.set(this,new Set),Object.defineProperty(this,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"syncRemoteConversations",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"getMessagesAroundTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"deleteLocalUGMessagesForAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"getUnreadMentionedMessages",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"saveEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"getEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"clearEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),this.storage=new WebChatStorage(e),this.settings=new WebConversationSettings(this._ctx,this.storage),__classPrivateFieldSet(this,_WebChatService_ugMsgReceiver,new WebUGModule(this._ctx),"f"),__classPrivateFieldSet(this,_WebChatService_sgMsgReceiver,new WebSGModule(this._ctx,this.storage),"f"),__classPrivateFieldSet(this,_WebChatService_ugEventReceiver,new WebUGServerEventHandler(this._ctx),"f"),__classPrivateFieldSet(this,_WebChatService_sgModifyMsgReceiver,new WebSGMsgModifyReceiver(this._ctx,this.storage),"f"),__classPrivateFieldGet(this,_WebChatService_ugEventReceiver,"f").on("ugMsgModify",__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_handleUGMsgModify),this),__classPrivateFieldGet(this,_WebChatService_ugEventReceiver,"f").on("ugMsgExpansion",__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_handleUGMsgExpansion),this),__classPrivateFieldGet(this,_WebChatService_ugEventReceiver,"f").on("ugMsgRecalled",__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_handleUGMsgRecalled),this),this._ctx.on("onConnected",__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_onConnected),this),this._ctx.on("onDisconnected",__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_stopScheduleTask),this),this._ctx.on("onSuspend",__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_stopScheduleTask),this),this._ctx.on("sCmd",__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_handleSCmdNotify),this),this._ctx.on("signal",__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_handleSignal),this),this._ctx.on("serverEvent",__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_handleServerEvent),this)}return Object.defineProperty(e.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){__classPrivateFieldGet(this,_WebChatService_sgModifyMsgReceiver,"f").startPullModifyMsg()}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u;return __generator(this,(function(l){return r=e.count,n=e.startTime,i=e.order,e.conversationTypes,t?(o=0!==n||i?n:Number.MAX_SAFE_INTEGER,a=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>o:e.operationTime<o)})).sort((function(e,t){return e.operationTime-t.operationTime})),s=Math.min(a.length,r),u=i?a.slice(0,s):a.slice(a.length-s),i||u.reverse(),[2,ok(u.map((function(e){return e.toIReceivedConversation()})))]):[2,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_getConversationListFromServer).call(this,n,r,i||0)]}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(a){return n=((null==t?void 0:t.length)||0)>0?t:getConversationTypes(e?ConversationTypes.INCLUDE_UG:ConversationTypes.BASE),i="string"==typeof r&&""!==r,o=this.storage.getAllModels().filter((function(t){return t.isTop&&!t.hidden&&n.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!i||t.channelId===r)||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_addLatestMessageForConversations).call(this,o)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>exports.NotificationLevel.NOT_SET&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_addLatestMessageForConversations).call(this,t)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){return r=((null==t?void 0:t.length)||0)>0?t:getConversationTypes(e?ConversationTypes.INCLUDE_UG:ConversationTypes.BASE),n=this.storage.getAllModels().filter((function(t){return t.unreadCount>0&&r.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_addLatestMessageForConversations).call(this,n)]}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:return r="string"==typeof t,e?(n=this.storage.getAllModels().filter((function(e){return!(e.hidden||(e.conversationType===exports.ConversationType.ULTRA_GROUP||r&&e.channelId!==t)&&e.channelId&&"RCDefault"!==e.channelId)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,ok(n)]):[4,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_getConversationListFromServer).call(this,0,1e3,0)];case 1:return[2,i.sent().trans((function(e){return e.filter((function(e){return!r||e.channelId===t}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){i.unreadCount>0&&e.includes(i.conversationType)&&(i.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!r&&!i.channelId||i.channelId===r)||i.conversationType===exports.ConversationType.ULTRA_GROUP&&(""===i.channelId||"RCDefault"===i.channelId))&&(t||i.notificationLevel<=exports.NotificationLevel.NOT_SET)&&(n+=i.unreadCount)})),[2,ok(n)]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return t=this.storage.getOrCreateModel(e,!1),r=t.toIReceivedConversation(),[4,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_addLatestMessageForConversations).call(this,[r])];case 1:return(n=i.sent()).isOk?[2,n.trans((function(e){return e[0]}))]:[2,ok(r)]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var r,i,o,a,s,u,l=this;return __generator(this,(function(c){switch(c.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_batchSetConversationStatus).call(this,e,r,t)];case 1:return(i=c.sent()).isOk?(o=i.data,a=o.version,s=o.updateVersion,u=e.map((function(e){var r=l.storage.getOrCreateModel(e,!0);return r.updateAttrs({isTop:t,hidden:!n&&r.hidden,operationTime:r.hidden&&n?Date.now():r.operationTime}),r})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",a),[2,ok()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u=this;return __generator(this,(function(l){switch(l.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_batchSetConversationStatus).call(this,e,r,void 0,t)];case 1:return(n=l.sent()).isOk?(i=n.data,o=i.version,a=i.updateVersion,s=e.map((function(e){var r=u.storage.getOrCreateModel(e,!0);return r.updateAttrs({notificationLevel:t}),r})),this.storage.updateConversationStorage(s),a&&this.storage.set("conversationStatusVersion",o),[2,ok()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u=this;return __generator(this,(function(l){switch(l.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_batchSetConversationStatus).call(this,e,r,void 0,void 0,t)];case 1:return(n=l.sent()).isOk?(i=n.data,o=i.version,a=i.updateVersion,s=e.map((function(e){var r=u.storage.getOrCreateModel(e,!0);return r.updateAttrs({translateStrategy:t}),r})),this.storage.updateConversationStorage(s),a&&this.storage.set("conversationStatusVersion",o),[2,ok()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){return t=this.storage.getOrCreateModel(e,!1),[2,ok(t.notificationLevel)]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){return t=this.storage.getConversationTypeNotificationLevel(e),[2,ok(t)]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u;return __generator(this,(function(l){switch(l.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=this._ctx.currentUserId,i=codec.encode(IMPB.TypeUnpushInput,{type:e,unpushLevel:t,version:r,ignoreVersion:!0}),[4,this._ctx.query(Topic.setTypeUnpush,n,i,IMPB.TypeUnpushOutput)];case 1:return(o=l.sent()).isOk?(a=o.data,s=a.version,u=a.updateVersion,this.storage.setConversationTypeNotificationLevel(e,t),u&&this.storage.set("conversationStatusVersion",s),[2,ok()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){return e=this.storage.getAllSGModels(),t=this._ctx.serverTime,e.forEach((function(e){return e.clearUnreadCount(t)})),this.storage.updateConversationStorage(e),[2,ok()]}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return r=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),n=codec.encode(IMPB.DeleteMsgInput,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:r}),i=e.conversationType===exports.ConversationType.ULTRA_GROUP?Topic.delUgMsg:Topic.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,n)];case 1:return(o=u.sent()).isOk?this._ctx.includeUg?((a=this.storage.getModel(e))&&(s=a.latestMessage)&&t.some((function(e){return e.messageUId===s.messageUId}))&&a.updateAttrs({latestMessage:null}),[2,ok()]):[2,ok()]:[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return r=codec.encode(IMPB.CleanHisMsgInput,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),n=ConversationTypeToClearMessageTopic[e.conversationType],[4,this._ctx.query(n,this._ctx.currentUserId,r)];case 1:return(i=s.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(a=o.latestMessage)&&(0===t||a.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,ok()]):[2,ok()]:[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=codec.encode(IMPB.CleanMsgBatchReq,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query(Topic.cleanMsgBatch,this._ctx.currentUserId,t)];case 1:return(r=i.sent()).isOk?(e.forEach((function(e){var t=n.storage.getModel(e);if(t){var r=t.latestMessage;r&&(!e.timestamp||r.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),[2,ok()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:return r=codec.encode(IMPB.ReadReceipt,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),n=t[0],[4,this._ctx.query(Topic.readReceipt,n,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return t=new Map,e.forEach((function(e){var r=keyofConversation2(e.identifier),n=t.get(r)||new Set;n.add(e.messageUId),t.set(r,n)})),r=Array.from(t.entries()).map((function(e){var t=__read(e,2),r=t[0],n=t[1],i=parseKeyofConversation(r);return{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgIds:Array.from(n)}})),n=encodeQueryReceiptBatchReq(r),[4,this._ctx.query(Topic.qryReceiptBatch,e[0].messageUId,n)];case 1:return(i=u.sent()).isOk?(o=i.data,a=decodeQueryReceiptBatchResp(o.pbData).item,s=[],a.forEach((function(e){var t,r={conversationType:e.type,targetId:e.targetId,channelId:e.busChannel};null===(t=e.msg)||void 0===t||t.forEach((function(e){var t=e.msgId,n=e.unreadCnt,i=e.readCnt,o=e.totalCnt;s.push({identifier:r,messageUId:t,unreadCount:n,readCount:i,totalCount:o})}))})),[2,ok(s)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s,u,l,c;return __generator(this,(function(_){switch(_.label){case 0:return n=0===r.readStatus?1:2,i=encodeQueryReceiptReq({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:1,pageType:1,pageToken:r.pageToken,pageSize:r.pageCount,readType:n,order:r.order?0:1}),[4,this._ctx.query(Topic.qryReceipt,t,i)];case 1:return(o=_.sent()).isOk?(a=o.data,s=decodeQueryReceiptResp(a.pbData),u=s.resp,l=s.pageToken,c=u[0],[2,ok({pageToken:l||"",totalCount:1===n?c.readCnt:c.unreadCnt,users:(1===n?c.readUser:c.unreadUser).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return n=encodeQueryReceiptReq({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:r}),[4,this._ctx.query(Topic.qryReceipt,t,n)];case 1:return(i=u.sent()).isOk?(o=i.data,a=decodeQueryReceiptResp(o.pbData).resp,s=a[0],[2,ok({pageToken:"",totalCount:0,users:__spreadArray(__spreadArray([],__read(s.readUser),!1),__read(s.unreadUser),!1).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){return(r=Validator.create("requestSpeechToTextForMessage").isObject("option",t,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==t?void 0:t.messageType,(function(e){return e===MessageType.HQ_VOICE||e===MessageType.VOICE}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){if(t.messageType===MessageType.HQ_VOICE)e.validate("numberOfChannels",t.numberOfChannels,(function(e){return 1===e}),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",t.sampleRate,(function(e){return 16e3===e||8e3===e}),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",t.format).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").isHttpUrl("remoteUrl",t.remoteUrl,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid");else{var r=t.content;e.isNotEmptyString("content",r,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid")}})).isLimitedInteger("duration",t.duration,1,60,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid").result()).isOk?__classPrivateFieldGet(this,_WebChatService_requestingSet,"f").has(e)?[2,fail(exports.ErrorCode.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process")]:(__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_requestSpeechToText).call(this,e,t),[2,ok()]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u;return __generator(this,(function(l){switch(l.label){case 0:return t=e.messageUId,r=e.messageContent,n=e.conversation,i=codec.encode(IMPB.MsgChangeReq,{targetId:n.targetId,type:n.conversationType,busChannel:n.channelId,msgUID:t,msgTime:0,content:JSON.stringify(r),fromUserId:""}),[4,this._ctx.query(Topic.modifyMsg,this._ctx.currentUserId,i,IMPB.ModifyMsgResp)];case 1:return(o=l.sent()).isOk?((a=this.storage.getModel(n))&&(s=a.latestMessage,u=a.conversationType,s&&s.messageUId===t&&(s.content=r,s.isModifyMessage=!0,s.modifyInfo=u===exports.ConversationType.ULTRA_GROUP?void 0:{timestamp:o.data.modifyTime,status:MessageModifyStatus.SUCCESS,content:{}},a.updateAttrs({latestMessage:s}))),[2,ok()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,a=this;return __generator(this,(function(s){return(o=Validator.create("refreshReferenceMessageWithParams").validate("messageInfoMap",i,(function(t){return t&&e.every((function(e){return t[e]&¬EmptyString(t[e])}))}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_INFO_MAP).result()).isOk?(setTimeout((function(){n([]),__classPrivateFieldGet(a,_WebChatService_instances,"m",_WebChatService_handleMsgQuery).call(a,e,t,r,i)}),0),[2,ok()]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,l,c,_,d,p,g=this;return __generator(this,(function(f){switch(f.label){case 0:return this._userSettins.hasTag(e)?(r=this.storage.get("conversationStatusVersion"),n=Date.now(),i=this._ctx.currentUserId,o=t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:n,stateItem:[{sessionStateType:PBEnumSessionStateType.Tags,value:"",tags:[{tagId:e}]}]}})),a=encodeSessionStateModifyReq(r,o),[4,this._ctx.query(Topic.addTag,i,a,IMPB.SessionStateModifyResp)]):[2,fail(exports.ErrorCode.TAG_NOT_EXIST)];case 1:return(s=f.sent()).isOk?(u=s.data,l=u.version,c=u.updateVersion,_=new Map,t.forEach((function(t){var r=g.storage.getOrCreateModel(t,!0),n={},i=r.tags;i.some((function(t){return t.tagId===e}))||(n.tags=i.concat({tagId:e}),_.set(r,n))})),d=[],p=[],Array.from(_.entries()).forEach((function(e){var t=__read(e,2),r=t[0],n=t[1];p.push(r);var i=r.updateAttrs(n,l);i&&d.push({conversation:r.toIReceivedConversation(),updatedItems:i})})),this.storage.updateConversationStorage(p),c&&this.storage.set("conversationStatusVersion",l),d.length>0&&this._ctx.emit("conversationStatusChanged",d),[2,ok()]):[2,s.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){return t=this.storage.getOrCreateModel(e,!1),r=this._userSettins.getTags(),n=t.tags.map((function(e){var t;return{tagId:e.tagId,tagName:null===(t=r[e.tagId])||void 0===t?void 0:t.tagName}})),[2,ok(n)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s,u,l,c,_,d,p;return __generator(this,(function(g){switch(g.label){case 0:return n=this.storage.get("conversationStatusVersion"),i=r.isTop,o=this.storage.getOrCreateModel(t,!1),a=o.tags,(s=a.find((function(t){return t.tagId===e})))?(u=encodeSessionStateModifyReq(n,[{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:PBEnumSessionStateType.Tags,value:"",tags:[{tagId:e,isTop:i}]}]}]),l=this._ctx.currentUserId,[4,this._ctx.query(Topic.addTag,l,u,IMPB.SessionStateModifyResp)]):[2,fail(exports.ErrorCode.NO_TAG_IN_CONVER)];case 1:return(c=g.sent()).isOk?(_=c.data,d=_.version,p=_.updateVersion,s.isTop=i,o.updateAttrs({tags:a},d),this.storage.updateConversationStorage([o]),p&&this.storage.set("conversationStatusVersion",d),[2,ok()]):[2,c.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,l,c=this;return __generator(this,(function(_){switch(_.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=encodeSessionStateModifyReq(r,[]),i=this._ctx.currentUserId,[4,this._ctx.query(Topic.delTag,i,n,IMPB.SessionStateModifyResp)];case 1:return(o=_.sent()).isOk?(a=o.data,s=a.version,u=a.updateVersion,l=t.map((function(t){var r=c.storage.getOrCreateModel(t,!0),n={tags:r.tags.filter((function(t){return t.tagId!==e}))};return r.updateAttrs(n,s),r})),this.storage.updateConversationStorage(l),u&&this.storage.set("conversationStatusVersion",s),[2,ok()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,l,c,_;return __generator(this,(function(d){switch(d.label){case 0:return r=this._ctx.currentUserId,n=this.storage.get("conversationStatusVersion"),i=encodeSessionStateModifyReq(n,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:PBEnumSessionStateType.Tags,value:"",tags:t.map((function(e){return{tagId:e}}))}]}]),[4,this._ctx.query(Topic.delTag,r,i,IMPB.SessionStateModifyResp)];case 1:return(o=d.sent()).isOk?(a=o.data,s=a.version,u=a.updateVersion,l=this.storage.getOrCreateModel(e,!0),c=l.tags,_={tags:c.filter((function(e){return!t.includes(e.tagId)}))},l.updateAttrs(_,s),this.storage.updateConversationStorage([l]),u&&this.storage.set("conversationStatusVersion",s),[2,ok()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(a){return this._userSettins.hasTag(e)?(n=t||Number.MAX_SAFE_INTEGER,0===(i=this.storage.getAllSGModels().filter((function(t){return t.operationTime<n&&t.tags.some((function(t){return t.tagId===e}))})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r)).length?[2,ok([])]:(o=i.map((function(t){return __assign(__assign({},t.toIReceivedConversation()),{isTopInTag:t.tags.some((function(t){return t.tagId===e&&t.isTop}))})})),[2,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_addLatestMessageForConversations).call(this,o)])):[2,ok([])]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){return r=0,this.storage.getAllSGModels().forEach((function(n){var i;if(n.tags.some((function(t){return t.tagId===e}))){if(n.notificationLevel>exports.NotificationLevel.NOT_SET&&!t)return;r+=null!==(i=n.unreadCount)&&void 0!==i?i:0}})),[2,ok(r)]}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return t=e.identifiers,r=e.deleteMessages,n=codec.encode(IMPB.RelationDelBatchReq,{relation:t.map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),cleanMsg:r}),[4,this._ctx.query(Topic.delRelationBatch,this._ctx.currentUserId,n,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,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=codec.encode(IMPB.GrpReadReceiptMsg,{msgId:t,channelId:r}),[4,this._ctx.query(Topic.rrMsg,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.channelId,n=e.targetId,i=codec.encode(IMPB.OperateStatus,{targetId:n,type:t,busChannel:r||"",opType:0}),(o=new PublishWriter(Topic.operate,i,n)).setHeaderQos(Qos.AT_LEAST_ONCE),[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 __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){return t=e.targetId,r=e.channelType,n=this.storage.getAllUGModels().filter((function(e){return!(void 0!==t&&t!==e.targetId||void 0!==r&&r!==e.channelType)})).sort((function(e,t){var r,n,i=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0;return((null===(n=t.latestMessage)||void 0===n?void 0:n.sentTime)||0)-i})).map((function(e){var t=e.toIReceivedConversation();return t.unreadMentionedCount=correctUnreadCount(t.unreadMentionedCount||0),t.unreadMessageCount=correctUnreadCount(t.unreadMessageCount||0),t.unreadMentionedMeCount=correctUnreadCount(t.unreadMentionedMeCount||0),t})),[2,ok(n)]}))}))}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return r=this._ctx.currentUserId,[4,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_qryMsg).call(this,e,t)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.list,i.notExistMsgId,a=o.map((function(t){return trans2IReceivedMessage(t,r,!1,e.targetId)})),[2,ok(a)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return t=e.targetId,r=e.channelId,n=e.sentTime,i=e.count,o=codec.encode(IMPB.QryRemindListReq,{groupId:t,busChannel:r,msgTime:n,size:i}),[4,this._ctx.query(Topic.qryUgUal,this._ctx.currentUserId,o,IMPB.QryRemindListResp)];case 1:return(a=u.sent()).isOk?(s=a.data.msgInfo,[2,ok(s.map((function(e){return{messageUId:e.msgId,sentTime:e.msgTime,messageType:e.className,mentionedType:e.remindType}})))]):[2,a.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,u,l,c,_;return __generator(this,(function(d){switch(d.label){case 0:return i=this._ctx.currentUserId,o=t.mid,a=t.put,s=t.del,u=t.clear,l=codec.encode(IMPB.MsgChangeReq,{fromUserId:i,targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgUID:o,msgTime:r,content:JSON.stringify(t)}),[4,this._ctx.query(Topic.upMsgEx,e.targetId,l)];case 1:return(c=d.sent()).isOk&&(null==(_=null===(n=this.storage.getModel(e))||void 0===n?void 0:n.latestMessage)?void 0:_.messageUId)===o&&(u?_.expansion={}:a?_.expansion=__assign(__assign({},_.expansion),a):s&&_.expansion&&s.forEach((function(e){delete _.expansion[e]}))),[2,c.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=codec.encode(IMPB.GroupUnpushSet,{unpushLevel:t,busChannel:r}),[4,this._ctx.query(Topic.ugUnpushSet,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return r=codec.encode(IMPB.GroupUnpushQuery,{busChannel:t}),[4,this._ctx.query(Topic.ugUnpushQuery,e,r,IMPB.GroupUnpushResult)];case 1:return(n=o.sent()).isOk?(i=n.data.unpushLevel,[2,ok(i)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){return r=this.storage.getModel(e),[2,ok(null!==(t=null==r?void 0:r.unreadMentionedCount)&&void 0!==t?t:0)]}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){return e=this.storage.getAllSGModels().reduce((function(e,t){return e+t.unreadMentionedCount}),0),[2,ok(e)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){return n=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))&&(n+=r?s:a)}})),[2,ok(n)]}))}))}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){return t=this.storage.getModel(e),[2,ok(t?t.unreadCount:0)]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){return(t=this.storage.getModel(e))?(r=t.firstUnreadMessage,[2,ok(r?{messageUId:r.messageUId||"",sentTime:r.sentTime}:null)]):[2,ok(null)]}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){return n=this.storage.getAllUGModels(),i=n.reduce((function(n,i){var o=r?i.unreadMentionedCount:i.unreadCount;if(!o||i.targetId!==e)return n;var a=i.notificationLevel||exports.NotificationLevel.NOT_SET;return!t.length||t.includes(a)?n+o:n}),0),[2,ok(correctUnreadCount(i))]}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){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:correctUnreadCount(e.unreadCount||0),mentionedCount:correctUnreadCount(e.unreadMentionedCount||0),mentionedMeCount:correctUnreadCount(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||exports.NotificationLevel.NOT_SET}})),[2,ok(t)]}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){return t=this.storage.getModel(e),(r=null==t?void 0:t.firstUnreadMessage)?[2,ok(r)]:[2,fail(exports.ErrorCode.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){return e=this.storage.getAllUGModels().filter((function(e){return e.notificationLevel>exports.NotificationLevel.NOT_SET})).map((function(e){return e.toIReceivedConversation()})),[2,ok(e)]}))}))}}),Object.defineProperty(e.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return t=this._ctx.serverTime,e.conversationType!==exports.ConversationType.ULTRA_GROUP?[3,2]:(r=encodeSessionMsgReadInput(e,t),(n=new PublishWriter(Topic.updUgRTime,r,this._ctx.currentUserId)).setHeaderQos(Qos.AT_LEAST_ONCE),[4,this._ctx.send(n)]);case 1:if(!(i=o.sent()).isOk)return[2,i.wipe()];o.label=2;case 2:return this.storage.clearConversationUnreadCount(e,t),[2,ok()]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return[4,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_qryRelation).call(this,t,r,e,Topic.qrySessions)];case 1:return(n=s.sent()).isOk?(i=this._ctx.currentUserId,o=n.data.info.map((function(e){var t=e.unreadCount,r=e.busChannel,n=e.type,o=e.userId,s=e.versionTime,u=e.msg,l=a.storage.getOrCreateModel({conversationType:n,targetId:o,channelId:r||""},!1);return __assign(__assign({},l.toIReceivedConversation()),{unreadMessageCount:t,operationTime:s,latestMessage:u?trans2IReceivedMessage(u,i,!1,o):null})})).sort((function(e,t){var n,i,o=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0,a=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===r?a-o:o-a})),[2,ok(o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=codec.encode(IMPB.SessionsAttQryInput,{nothing:1}),[4,this._ctx.query(Topic.qrySessionsAtt,this._ctx.currentUserId,e,IMPB.SessionsAttOutput)];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 __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return t=this._ctx.serverTime,this.storage.clearConversationUnreadCount(e,this._ctx.serverTime),r=encodeSessionMsgReadInput(e,t),n=new PublishWriter(Topic.updRRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=codec.encode(IMPB.DeleteSessionsInput,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(Topic.delSessions,this._ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=codec.encode(IMPB.QuerySessionsInput,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(Topic.qrySessionsUnread,this._ctx.currentUserId,t,IMPB.QuerySessionsOutPut)];case 1:return[2,r.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 __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s;return __generator(this,(function(u){return r=e.count,n=e.conversationTypes,i=e.timestamp||Number.MAX_SAFE_INTEGER,t?(o=this.storage.getAllModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&n.includes(e.conversationType)&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),[2,ok(o.map((function(e){return e.toIReceivedConversation()})))]):(a=this.storage.getAllSGModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&n.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),s=a.map((function(e){return e.toIReceivedConversation()})),[2,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_addLatestMessageForConversations).call(this,s)])}))}))}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:return r=encodeSessionMsgReadInput(e,t),n=new PublishWriter(Topic.updRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=codec.encode(IMPB.GrpReadReceiptMsg,{msgId:[t],channelId:r}),[4,this._ctx.query(Topic.rrList,e,n,IMPB.GrpReadReceiptQryResp)];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,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return n=e.conversationType,i=e.targetId,o=e.channelId,a=codec.encode(IMPB.ReadReceiptMsg,{targetId:i,type:n,busChannel:o,startMsgId:t,endMsgId:r}),s=new PublishWriter(Topic.sendMsgRead,a,i),[4,this._ctx.send(s)];case 1:return[2,u.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return r=e.targetId,n=e.channelId,i=void 0===n?"":n,o=codec.encode(IMPB.ReceiptQryReq,{targetId:r,busChannel:i,msgId:t}),[4,this._ctx.query(Topic.qryMsgRead,r,o,IMPB.QueryReceiptResp)];case 1:return[2,a.sent().trans((function(e){var t=e.list,r=e.num,n=e.readCnt;return{list:t.map((function(e){return{userId:e.userId,readTime:e.receiptTime}})),totalCount:r,readCount:n}}))]}}))}))}}),Object.defineProperty(e.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return r=e.targetId,n=e.conversationType,i=e.channelId,o=codec.encode(IMPB.ReceiptCntQryReq,{type:n,busChannel:i,msgId:t}),[4,this._ctx.query(Topic.qryMsgReadCntBatch,r,o,IMPB.ReceiptCntQryResp)];case 1:return[2,a.sent().trans((function(t){return t.result.map((function(t){return __assign({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}))]}}))}))}}),e}();_WebChatService_ugMsgReceiver=new WeakMap,_WebChatService_sgMsgReceiver=new WeakMap,_WebChatService_ugEventReceiver=new WeakMap,_WebChatService_sgModifyMsgReceiver=new WeakMap,_WebChatService_sgRelationsVersion=new WeakMap,_WebChatService_requestingSet=new WeakMap,_WebChatService_instances=new WeakSet,_WebChatService_handleServerEvent=function(e,t,r){if(t===ServerEventType.READ_EVENT){e.stopPropagation();var n=[];r.forEach((function(e){if(0===e.subChangeType){var t=codec.decode(IMPB.MsgReadEvent,new Uint8Array(e.eventData)),r=t.msgId,i=t.unreadCnt,o=t.readCnt,a=t.readList,s=t.totalCnt;n.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:r,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",n)}},_WebChatService_handleSGConnected=function(e){e||(__classPrivateFieldGet(this,_WebChatService_sgMsgReceiver,"f").setInitVersion(0),this._ctx.includeUg&&__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_fetchSGRelations).call(this)),__classPrivateFieldGet(this,_WebChatService_sgMsgReceiver,"f").startInterval(INTERVAL,!0)},_WebChatService_handleSettingConnected=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return e?[3,2]:(this.settings.reset(),[4,this.settings.syncDataFromServer()]);case 1:t=r.sent(),this.settings.setInitVersion(t),r.label=2;case 2:return this._ctx.isConnected&&this.settings.startInterval(INTERVAL,!0),[2]}}))}))},_WebChatService_onConnected=function(e,t){t||this.storage.syncDataFromLocalStorage(this._ctx),__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_handleSettingConnected).call(this,t),__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_handleSGConnected).call(this,t),this._ctx.ugEnabel&&__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_handleUgWhileConnected).call(this,t)},_WebChatService_fetchSGRelations=function e(){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,l=this;return __generator(this,(function(c){switch(c.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,r=t.createTraceId(),n=__classPrivateFieldGet(this,_WebChatService_sgRelationsVersion,"f"),t.info(Log.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:n}),r),[4,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_qryRelation).call(this,n,1,1e3)]):[2];case 1:return(i=c.sent()).isOk?(o=i.data,a=o.info,s=o.isFinished,u=o.pullTime,__classPrivateFieldSet(this,_WebChatService_sgRelationsVersion,u,"f"),t.info(Log.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:n,isFinished:s,pullTime:u}),r),this.storage.addRelations(a,this._ctx.currentUserId),s?(this._ctx.emit("sgRelationsSynced",exports.ErrorCode.SUCCESS),[2]):[2,__classPrivateFieldGet(this,_WebChatService_instances,"m",e).call(this)]):(t.warn(Log.L_PULL_SG_RELATIONS_R,i.errmsg(),r),setTimeout((function(){return __classPrivateFieldGet(l,_WebChatService_instances,"m",e).call(l)}),1e3),[2])}}))}))},_WebChatService_handleUGMessageChanged=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s=this;return __generator(this,(function(u){switch(u.label){case 0:return[4,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_qryMsg).call(this,e,t)];case 1:return(n=u.sent()).isOk?(i=n.data.list.map((function(t){return trans2IReceivedMessage(t,s._ctx.currentUserId,!1,e.targetId)})),(o=this.storage.getModel(e))&&o.latestMessage&&(a=i.find((function(e){return e.messageUId===o.latestMessage.messageUId})))&&o.updateAttrs({latestMessage:a}),2===r?this._ctx.emit("messageModified",i):1===r&&this._ctx.emit("ugMsgExpansionUpdated",i),[2]):[2]}}))}))},_WebChatService_handleUGMsgModify=function(e,t,r){__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_handleUGMessageChanged).call(this,t,r,2)},_WebChatService_handleUGMsgExpansion=function(e,t,r){__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_handleUGMessageChanged).call(this,t,r,1)},_WebChatService_handleUGMsgRecalled=function(e,t){var r=this,n=t.map((function(e){var t=e.targetId,n=e.busChannel,i=e.msgUID,o=e.msgTime,a=e.operatorId,s=e.remindType,u={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:n||""},l=__assign(__assign({},u),{messageUId:i,sentTime:o}),c=__assign(__assign({},u),{sentTime:o,messageUId:i,senderUserId:a,content:l,messageDirection:1,messageType:MessageType.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:trans2IReceivedStatusInfo(exports.ReceivedStatus.UNREAD)}),_=r.storage.getModel(u);return _&&__classPrivateFieldGet(r,_WebChatService_instances,"m",_WebChatService_updateUGModelWhileRecallMsg).call(r,_,c,s),c}));this._ctx.emit("ugMsgRecalled",n)},_WebChatService_updateUGModelWhileRecallMsg=function(e,t,r){var n={},i=t.content,o=i.messageUId,a=i.sentTime,s=e.latestMessage;s&&s.messageUId===o&&(n.latestMessage=transRcCmd2RcNtf(t,!0)),a&&e.lastReadTime<a&&e.unreadCount&&(n.unreadCount=e.unreadCount-1,r!==exports.MentionedType.ALL&&r!==exports.MentionedType.SINGAL||!e.unreadMentionedCount||(n.unreadMentionedCount=e.unreadMentionedCount-1),r===exports.MentionedType.SINGAL&&e.unreadMentionedCount&&(n.unreadMentionedMeCount=e.unreadMentionedMeCount-1));var u=e.updateAttrs(n,a);this.storage.updateConversationStorage([e]),u&&this._ctx.emit("conversation",[{conversation:e.toIReceivedConversation(),updatedItems:u}])},_WebChatService_handleUgWhileConnected=function(e){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,__classPrivateFieldGet(this,_WebChatService_ugMsgReceiver,"f").markOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,r=t.relations,n=t.msgVersion,this.storage.addRelations(r,this._ctx.currentUserId),this._ctx.emit("ultraGroupEnable"),__classPrivateFieldGet(this,_WebChatService_ugMsgReceiver,"f").setInitVersion(n),__classPrivateFieldGet(this,_WebChatService_ugMsgReceiver,"f").startInterval(INTERVAL,!0),__classPrivateFieldGet(this,_WebChatService_ugEventReceiver,"f").setInitVersion(n),__classPrivateFieldGet(this,_WebChatService_ugEventReceiver,"f").startInterval(INTERVAL,!0),[2]):[2]}}))}))},_WebChatService_stopScheduleTask=function(){this.settings.stopInterval(),__classPrivateFieldGet(this,_WebChatService_ugMsgReceiver,"f").reset(),__classPrivateFieldGet(this,_WebChatService_sgMsgReceiver,"f").reset(),__classPrivateFieldGet(this,_WebChatService_ugEventReceiver,"f").reset()},_WebChatService_handleSCmdNotify=function(e,t){return 3===t.type?(e.stopPropagation(),void this.settings.push(t.time)):7===t.type?(e.stopPropagation(),void __classPrivateFieldGet(this,_WebChatService_ugEventReceiver,"f").push(t.time)):void(12===t.type&&(e.stopPropagation(),__classPrivateFieldGet(this,_WebChatService_sgModifyMsgReceiver,"f").push(t.time)))},_WebChatService_handleSignal=function(e,t,r){var n=t.syncMsg,i=string2Topic(t.topic);if(n&&i===Topic.updUgRTime){e.stopPropagation();var o=codec.decode(IMPB.SessionMsgReadInput,t.pbData),a=o.channelId,s=o.busChannel,u=o.msgTime,l=this.storage.clearConversationUnreadCount({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:a,channelId:s||""},u);l&&this._ctx.emit("conversationStatusChanged",[l])}},_WebChatService_getConversationListFromServer=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s,u=this;return __generator(this,(function(l){switch(l.label){case 0:return n=this._ctx.currentUserId,[4,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_qryRelation).call(this,e,r||0,t)];case 1:return(i=l.sent()).isOk?(o=i.data,a=o.info,o.isFinished,o.pullTime,s=a.map((function(e){var t=e.userId,r=e.type,i=e.busChannel,o=u.storage.getOrCreateModel({conversationType:r,targetId:t,channelId:i},!1);return __assign(__assign({},o.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?trans2IReceivedMessage(e.msg,n,!1,t):null})})),[2,ok(s)]):[2,i.wipe()]}}))}))},_WebChatService_addLatestMessageForConversations=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return this._ctx.includeUg?[2,ok(e)]:(t=this._ctx.currentUserId,r=e.filter((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP})).map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),0===r.length?[2,ok(e)]:(n=codec.encode(IMPB.RelationDelBatchReq,{relation:r}),[4,this._ctx.query(Topic.qryRLBatch,this._ctx.currentUserId,n,void 0)]));case 1:return(i=o.sent()).isOk?(__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_decodeRelationsOutput).call(this,i.data.pbData).info.forEach((function(r){r.msg&&(e.find((function(e){return(e.channelId||"")===(r.busChannel||"")&&e.targetId===r.userId&&e.conversationType===r.type})).latestMessage=trans2IReceivedMessage(r.msg,t,!1,r.userId))})),[2,ok(e)]):[2,i.wipe()]}}))}))},_WebChatService_batchSetConversationStatus=function(e,t,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,a;return __generator(this,(function(s){return o=[],void 0!==r&&o.push({sessionStateType:PBEnumSessionStateType.IsTop,value:r?"1":"0"}),void 0!==n&&o.push({sessionStateType:PBEnumSessionStateType.IsSilent,value:n.toString()}),void 0!==i&&o.push({sessionStateType:PBEnumSessionStateType.AutoTrans,value:i.toString()}),a=encodeSessionStateModifyReq(t,e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:o}}))),[2,this._ctx.query(Topic.setSeAtt,this._ctx.currentUserId,a,IMPB.SessionStateModifyResp)]}))}))},_WebChatService_requestSpeechToText=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return __classPrivateFieldGet(this,_WebChatService_requestingSet,"f").add(e),r=t.messageType===MessageType.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},n=codec.encode(IMPB.ConvertMsgInput,{businessType:1,businessInfo:codec.encode(IMPB.SpeechToTextInfo,r)}),[4,this._ctx.query(Topic.upConvertMsg,e,n,IMPB.ConvertMsgOutput)];case 1:return i=u.sent(),__classPrivateFieldGet(this,_WebChatService_requestingSet,"f").delete(e),o=i.code,i.isOk?(s=codec.decode(IMPB.SpeechToTextResult,new Uint8Array(i.data.businessResult)),a={status:SpeechToTextStatus.SUCCESS,text:s.result}):a={status:SpeechToTextStatus.FAILED,text:""},this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:a}),[2]}}))}))},_WebChatService_qryMsg=function(e,t){var r=e.targetId,n=e.conversationType,i=e.channelId,o=codec.encode(IMPB.MsgQuery,{targetId:r,type:n,query:t.map((function(e){return{msgTime:0,msgUID:e,busChannel:i}}))});return this._ctx.query(Topic.qryMsg,this._ctx.currentUserId,o,IMPB.MsgQueryAck)},_WebChatService_handleMsgQuery=function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,u,l,c,_,d,p,g,f=this;return __generator(this,(function(h){switch(h.label){case 0:return i=Object.values(n),o=__spreadArray([],__read(new Set(__spreadArray(__spreadArray([],__read(e),!1),__read(i),!1))),!1),[4,__classPrivateFieldGet(this,_WebChatService_instances,"m",_WebChatService_qryMsg).call(this,t,o)];case 1:return a=h.sent(),s=a.isOk,u=a.code,l=a.data,s?(_=(c=l).list,d=c.notExistMsgId,p=new Map(_.map((function(e){var r=trans2IReceivedMessage(e,f._ctx.currentUserId,!1,t.targetId);return[r.messageUId,r]}))),g=e.map((function(e){var t=p.get(e);if(!t)return d.includes(e)?{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR};if(t.messageType!==MessageType.REFERENCE)return{messageUId:e,code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE};var r=n[e],i=p.get(r),o=t.content;return i?(o.referMsg=i.content,o.referMsgStatus=i.isModifyMessage?ReferenceMessageStatus.MODIFIED:ReferenceMessageStatus.DEFAULT,{messageUId:e,message:t,code:exports.ErrorCode.SUCCESS}):d.includes(r)?(o.referMsgStatus=ReferenceMessageStatus.DELETE,{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND,message:t}):(o.referMsgStatus=ReferenceMessageStatus.DEFAULT,{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR,message:t})})),r(g),[2]):(r(e.map((function(e){return{messageUId:e,code:u}}))),[2])}}))}))},_WebChatService_decodeRelationsOutput=function(e){var t=decodeRelationsOutput(e);return this._ctx.getNaviInfoFromCache().supportRecallRefactor&&t.info.forEach((function(e){var t=e.msg;if(t&&t.classname===MessageType.RECALL){var r=JSON.parse(t.content),n=r.messageUId,i=r.sentTime,o={recallTime:i,recallActionTime:t.dataTime,admin:!!r.isAdmin,delete:!!r.isDelete,isDelete:!!r.isDelete,operatorId:t.fromUserId};t.classname=MessageType.RECALL_NOTIFICATION_MESSAGE,t.content=JSON.stringify(o),t.msgId=n,t.dataTime=i||t.dataTime}})),t},_WebChatService_qryRelation=function(e,t,r,n){return void 0===n&&(n=Topic.qryRelationR),__awaiter(this,void 0,void 0,(function(){var i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return i=this._ctx.currentUserId,o=encodeRelationQryInput(e,t,r),[4,this._ctx.query(n,i,o)];case 1:return[2,s.sent().trans((function(e){return __classPrivateFieldGet(a,_WebChatService_instances,"m",_WebChatService_decodeRelationsOutput).call(a,e.pbData)}))]}}))}))};var ConversationTypeToClearMessageTopic=(_a$1={},_a$1[exports.ConversationType.PRIVATE]=Topic.cleanPMsg,_a$1[exports.ConversationType.GROUP]=Topic.cleanGMsg,_a$1[exports.ConversationType.CUSTOMER_SERVICE]=Topic.cleanCMsg,_a$1[exports.ConversationType.SYSTEM]=Topic.cleanSMsg,_a$1[exports.ConversationType.APP_PUBLIC_SERVICE]=Topic.cleanMCMsg,_a$1[exports.ConversationType.PUBLIC_SERVICE]=Topic.cleanMPMsg,_a$1[exports.ConversationType.ULTRA_GROUP]=Topic.cleanGMsg,_a$1),WebUserStorage=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})},_WebModuleContext_instances,_WebModuleContext_serverEventHandler,_WebModuleContext_onConnected,_WebModuleContext_onSuspend,_WebModuleContext_onDisconnected,_WebModuleContext_onSignal;function includeUg(e){var t=!(1&~(e.ugMsg||0)),r=!(1&~(e.sessionCfg||0));return t&&r}var upstreamTopics=[Topic.chatMsg,Topic.ugMsg,Topic.recallMsg,Topic.ppMsgS,Topic.pgMsgS,Topic.ppMsgP,Topic.pgMsgP,Topic.pcMsgP,Topic.prMsgS,Topic.pbMsgP,Topic.chatMsgS],WebModuleContext=function(e){function t(t,r,n,i){var o=e.call(this)||this;return _WebModuleContext_instances.add(o),Object.defineProperty(o,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_navi",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),_WebModuleContext_serverEventHandler.set(o,void 0),o.userStorage=new WebUserStorage,__classPrivateFieldSet(o,_WebModuleContext_serverEventHandler,new WebServerEventHandler(r,i),"f"),__classPrivateFieldGet(o,_WebModuleContext_serverEventHandler,"f").pipe(o),o.on("onConnected",__classPrivateFieldGet(o,_WebModuleContext_instances,"m",_WebModuleContext_onConnected),o,100),o.on("onDisconnected",__classPrivateFieldGet(o,_WebModuleContext_instances,"m",_WebModuleContext_onDisconnected),o,100),o.on("onSuspend",__classPrivateFieldGet(o,_WebModuleContext_instances,"m",_WebModuleContext_onSuspend),o,100),o.send=o._connMgr.send.bind(o._connMgr),o.query=o._connMgr.query.bind(o._connMgr),o.on("signal",__classPrivateFieldGet(o,_WebModuleContext_instances,"m",_WebModuleContext_onSignal),o),o}return __extends(t,e),Object.defineProperty(t.prototype,"isConnected",{get:function(){return this._connMgr.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentToken",{get:function(){return this._connMgr.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ugEnabel",{get:function(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDisableEmptyUGChannelId",{get:function(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"includeUg",{get:function(){return includeUg(this.getNaviInfoFromCache())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._navi.getNaviInfoFromCache(this.currentToken)}}),t}(EventDispatcher),_WebChatroomKVStore_instances,_WebChatroomKVStore_entries,_WebChatroomKVStore_updateEntry;_WebModuleContext_serverEventHandler=new WeakMap,_WebModuleContext_instances=new WeakSet,_WebModuleContext_onConnected=function(e,t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return[4,__classPrivateFieldGet(this,_WebModuleContext_serverEventHandler,"f").noticeOnline()];case 1:return(e=o.sent()).isOk?(t?__classPrivateFieldGet(this,_WebModuleContext_serverEventHandler,"f").startInterval(18e4,!0):(r=e.data,n=r.syncTime,i=r.hasNext,__classPrivateFieldGet(this,_WebModuleContext_serverEventHandler,"f").setInitVersion(n),__classPrivateFieldGet(this,_WebModuleContext_serverEventHandler,"f").startInterval(18e4,!!i)),[2]):[2]}}))}))},_WebModuleContext_onSuspend=function(e,t){__classPrivateFieldGet(this,_WebModuleContext_serverEventHandler,"f").stopInterval()},_WebModuleContext_onDisconnected=function(e){__classPrivateFieldGet(this,_WebModuleContext_serverEventHandler,"f").reset()},_WebModuleContext_onSignal=function(e,t,r){var n=t.topic,i=t.syncMsg,o=string2Topic(n);if(o||(this.logger.warn(Log.L_RECV_RMTP_E,"unknown topic: ".concat(n)),e.stopPropagation()),this.logger.debug(Log.L_RECV_RMTP_O,n),i&&upstreamTopics.includes(o)){e.stopPropagation();var a=r||{},s=a.timestamp,u=void 0===s?this.serverTime:s,l=a.messageUId,c=void 0===l?"":l,_=parseIPBUpStreamMessage(t,this.currentUserId,u,c),d=trans2IReceivedMessage(_,this.currentUserId,!1,t.targetId);this.emit("syncMsg",d,o)}else{if(o===Topic.s_ntf){e.stopPropagation();var p=(h=codec.decode(IMPB.NotifyMsg,t.pbData)).type,g=h.chrmId,f=h.time;return this.logger.info(Log.L_RECV_S_NTF_O,"type: ".concat(p,", chrmId: ").concat(g,", time: ").concat(f)),void this.emit("sNtf",h)}if(o===Topic.s_cmd){e.stopPropagation();var h;p=(h=codec.decode(IMPB.NotifyMsg,t.pbData)).type,g=h.chrmId,f=h.time;if(this.logger.info(Log.L_RECV_S_CMD_O,"type: ".concat(p,", chrmId: ").concat(g,", time: ").concat(f)),11===p)return void __classPrivateFieldGet(this,_WebModuleContext_serverEventHandler,"f").push(f);this.emit("sCmd",h)}if(o===Topic.s_msg){e.stopPropagation();_=codec.decode(IMPB.DownStreamMessage,t.pbData),d=trans2IReceivedMessage(_,this.currentUserId,!1);this.emit("sMsg",d)}}};var parseKVStatus=function(e){return{isAutoDelete:!!(1&e),isOverwrite:!!(2&e),isDelete:!!(4&e)}},calculateKVStatus=function(e,t,r){var n=0;return e&&(n|=1),t&&(n|=2),r&&(n|=4),n},trans2KVStoreEntry=function(e){var t=e.key,r=e.value;return e.timestamp,{key:t,value:r,userId:e.uid,version:e.version}},trans2IChatroomEntryListenerData=function(e,t,r){return{chatroomId:e,key:t.key,value:t.value,timestamp:t.version,type:r?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE}},WebChatroomKVStore=function(e){function t(t,r){var n=e.call(this,"WebChatroomKVStore")||this;return _WebChatroomKVStore_instances.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),_WebChatroomKVStore_entries.set(n,new Map),Object.defineProperty(n,"_emittedEntriesSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),n}return __extends(t,e),Object.defineProperty(t.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,l,c,_=this;return __generator(this,(function(d){switch(d.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),n=this._chatroomId,i={chatroomId:n,timestamp:e},t.info(Log.L_PULL_CHATROOM_KV_T,JSON.stringify(i),r),[4,this._ctx.query(Topic.pullKV,n,encodeQueryChrmKV(e),void 0)];case 1:return(o=d.sent()).isOk?(a=decodeChrmKVOutput(o.data.pbData),s=a.bFullUpdate,u=a.entries,l=a.syncTime,t.info(Log.L_PULL_CHATROOM_KV_R,JSON.stringify(__assign(__assign({},i),{newVersion:l})),r),c=new Map,s&&(Array.from(__classPrivateFieldGet(this,_WebChatroomKVStore_entries,"f").values()).forEach((function(e){c.set(e.key,trans2IChatroomEntryListenerData(n,e,!0))})),__classPrivateFieldGet(this,_WebChatroomKVStore_entries,"f").clear()),Array.from(u.values()).forEach((function(e){var t=parseKVStatus(e.status).isDelete,r=trans2KVStoreEntry(e);t?__classPrivateFieldGet(_,_WebChatroomKVStore_entries,"f").delete(r.key):__classPrivateFieldGet(_,_WebChatroomKVStore_entries,"f").set(r.key,r),c.set(r.key,trans2IChatroomEntryListenerData(n,r,t))})),this._emittedEntriesSynced||(this._emittedEntriesSynced=!0,this._ctx.emit("chatroom",{entriesSynced:n})),c.size>0&&this._ctx.emit("chatroom",{updatedEntries:Array.from(c.values())}),[2,ok({version:l})]):(t.warn(Log.L_PULL_CHATROOM_KV_R,JSON.stringify(__assign(__assign({},i),{code:o.code})),r),[2,o.wipe()])}}))}))}}),Object.defineProperty(t.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,__classPrivateFieldGet(this,_WebChatroomKVStore_instances,"m",_WebChatroomKVStore_updateEntry).call(this,e,t,!1)];case 1:return(r=n.sent()).isOk&&__classPrivateFieldGet(this,_WebChatroomKVStore_entries,"f").set(e.key,{key:e.key,value:e.value,userId:this._ctx.currentUserId,version:this._ctx.serverTime}),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,__classPrivateFieldGet(this,_WebChatroomKVStore_instances,"m",_WebChatroomKVStore_updateEntry).call(this,{key:e.key,value:"",isAutoDelete:!1,isSendNotification:e.isSendNotification,notificationExtra:e.notificationExtra},t,!0)];case 1:return(r=n.sent()).isOk&&__classPrivateFieldGet(this,_WebChatroomKVStore_entries,"f").delete(e.key),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u=this;return __generator(this,(function(l){switch(l.label){case 0:return t=this._ctx.serverTime,r=e.entries.map((function(r){var n,i=__classPrivateFieldGet(u,_WebChatroomKVStore_entries,"f").get(r.key);return{key:r.key,value:r.value,uid:u._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:t,status:calculateKVStatus(!!e.isAutoDelete,e.isForce||!1,!1)}})),n=codec.encode(IMPB.SetChrmKVS,{entry:r}),[4,this._ctx.query(Topic.setKVS,this._chatroomId,n,IMPB.ChrmKVSOutput)];case 1:return(i=l.sent()).isOk||i.code===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?((o=i.data).errorKeys,a=o.keysVersion,s=new Map,null==a||a.forEach((function(e){s.set(e.key,e.version)})),e.entries.forEach((function(e){var t=e.key,r=s.get(t);r&&__classPrivateFieldGet(u,_WebChatroomKVStore_entries,"f").set(t,{key:t,value:e.value,userId:u._ctx.currentUserId,version:r})})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s=this;return __generator(this,(function(u){switch(u.label){case 0:return t=calculateKVStatus(!1,!1,!0),r=this._ctx.serverTime,n=codec.encode(IMPB.SetChrmKVS,{entry:e.keys.map((function(e){var n,i=__classPrivateFieldGet(s,_WebChatroomKVStore_entries,"f").get(e);return{key:e,status:t,value:"",uid:s._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:r}}))}),[4,this._ctx.query(Topic.delKVS,this._chatroomId,n,IMPB.ChrmKVSOutput)];case 1:return(i=u.sent()).isOk||i.code===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?(o=i.data.errorKeys,a=new Set,null==o||o.forEach((function(e){return a.add(e.key)})),e.keys.forEach((function(e){a.has(e)||__classPrivateFieldGet(s,_WebChatroomKVStore_entries,"f").delete(e)})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __classPrivateFieldGet(this,_WebChatroomKVStore_entries,"f").has(e)?__classPrivateFieldGet(this,_WebChatroomKVStore_entries,"f").get(e).value:null}}),Object.defineProperty(t.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Array.from(__classPrivateFieldGet(this,_WebChatroomKVStore_entries,"f").entries()).map((function(e){var t=__read(e,2);return[t[0],t[1].value]}));return Object.fromEntries(e)}}),t}(LinearQuery),_WebChatroomMessageReceiver_initCount;_WebChatroomKVStore_entries=new WeakMap,_WebChatroomKVStore_instances=new WeakSet,_WebChatroomKVStore_updateEntry=function(e,t,r){var n;return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,u;return __generator(this,(function(l){switch(l.label){case 0:return i=this._ctx.serverTime,o=__classPrivateFieldGet(this,_WebChatroomKVStore_entries,"f").get(e.key),a=calculateKVStatus(!!e.isAutoDelete,t,r),s={entry:{key:e.key,value:e.value,uid:this._ctx.currentUserId,version:null!==(n=null==o?void 0:o.version)&&void 0!==n?n:i,status:a}},e.isSendNotification&&(s.type=exports.ConversationType.CHATROOM,s.bNotify=!0,s.notification={sessionId:encodeUpStreamStreamSessionId(MessageType.CHRM_KV_NOTIFY,!1,!1,!1),classname:MessageType.CHRM_KV_NOTIFY,content:JSON.stringify({key:e.key,value:e.value,extra:e.notificationExtra,type:r?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE})}),u=codec.encode(IMPB.SetChrmKV,s),[4,this._ctx.query(r?Topic.delKV:Topic.setKV,this._chatroomId,u)];case 1:return[2,l.sent().wipe()]}}))}))};var WebChatroomMessageReceiver=function(e){function t(t,r,n,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:r}),Object.defineProperty(o,"_handler",{enumerable:!0,configurable:!0,writable:!0,value:i}),_WebChatroomMessageReceiver_initCount.set(o,0),__classPrivateFieldSet(o,_WebChatroomMessageReceiver_initCount,n,"f"),o}return __extends(t,e),Object.defineProperty(t.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,l,c,_=this;return __generator(this,(function(d){switch(d.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),n={chatroomId:this._chatroomId,version:e},t.info(Log.L_PULL_CHATROOM_MSG_T,JSON.stringify(n),r),i=encodeChrmPullMsg(e,__classPrivateFieldGet(this,_WebChatroomMessageReceiver_initCount,"f")),[4,this._ctx.query(Topic.chrmPull,this._chatroomId,i,void 0)];case 1:return o=d.sent(),t.summary(Log.L_PULL_CHATROOM_MSG_R,o,r,n),o.isOk?(a=this._ctx.currentUserId,s=decodeChrmDownStreamMessages(o.data.pbData),u=s.list,l=s.syncTime,u.length>0&&(c=u.map((function(e){return trans2IReceivedMessage(e,a,!1,_._chatroomId)})),this._handler(c,this._chatroomId)),[2,ok({version:l})]):[2,o.wipe()]}}))}))}}),t}(LinearQuery),_WebChatroom_instances,_WebChatroom_msgReceiver,_WebChatroom_kvStore,_WebChatroom_kvEnabled_get;_WebChatroomMessageReceiver_initCount=new WeakMap;var WebChatroom=function(e){function t(t,r,n,i,o){var a=e.call(this)||this;return _WebChatroom_instances.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:r}),Object.defineProperty(a,"initCount",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"extra",{enumerable:!0,configurable:!0,writable:!0,value:o}),_WebChatroom_msgReceiver.set(a,void 0),_WebChatroom_kvStore.set(a,void 0),__classPrivateFieldSet(a,_WebChatroom_msgReceiver,new WebChatroomMessageReceiver(a._ctx,a.roomId,n,i),"f"),__classPrivateFieldSet(a,_WebChatroom_kvStore,new WebChatroomKVStore(a._ctx,a.roomId),"f"),a}return __extends(t,e),Object.defineProperty(t.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;__classPrivateFieldGet(this,_WebChatroom_msgReceiver,"f").setInitVersion(0),__classPrivateFieldGet(this,_WebChatroom_msgReceiver,"f").startInterval(e,!0),__classPrivateFieldGet(this,_WebChatroom_instances,"a",_WebChatroom_kvEnabled_get)&&(__classPrivateFieldGet(this,_WebChatroom_kvStore,"f").setInitVersion(0),__classPrivateFieldGet(this,_WebChatroom_kvStore,"f").startInterval(e,!0))}}),Object.defineProperty(t.prototype,"restartInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;this.stopInterval(),__classPrivateFieldGet(this,_WebChatroom_kvStore,"f").startInterval(e,!0),__classPrivateFieldGet(this,_WebChatroom_msgReceiver,"f").startInterval(e,!0)}}),Object.defineProperty(t.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){__classPrivateFieldGet(this,_WebChatroom_msgReceiver,"f").stopInterval(),__classPrivateFieldGet(this,_WebChatroom_kvStore,"f").stopInterval()}}),Object.defineProperty(t.prototype,"handleMessageNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){__classPrivateFieldGet(this,_WebChatroom_msgReceiver,"f").push(e)}}),Object.defineProperty(t.prototype,"handleKVNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){__classPrivateFieldGet(this,_WebChatroom_kvStore,"f").push(e)}}),Object.defineProperty(t.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,__classPrivateFieldGet(this,_WebChatroom_kvStore,"f").setEntry(e,t)]}))}))}}),Object.defineProperty(t.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,__classPrivateFieldGet(this,_WebChatroom_kvStore,"f").setEntries(e)]}))}))}}),Object.defineProperty(t.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,__classPrivateFieldGet(this,_WebChatroom_kvStore,"f").removeEntry(e,t)]}))}))}}),Object.defineProperty(t.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,__classPrivateFieldGet(this,_WebChatroom_kvStore,"f").removeEntries(e)]}))}))}}),Object.defineProperty(t.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __classPrivateFieldGet(this,_WebChatroom_kvStore,"f").getEntry(e)}}),Object.defineProperty(t.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __classPrivateFieldGet(this,_WebChatroom_kvStore,"f").getAllEntries()}}),t}(EventDispatcher),_WebChatroomModule_instances,_WebChatroomModule_chatrooms,_WebChatroomModule_onDisconnected,_WebChatroomModule_onSuspend,_WebChatroomModule_onConnected,_WebChatroomModule_onSMsg,_WebChatroomModule_onSyncMsg,_WebChatroomModule_onSNtf,_WebChatroomModule_onSCmd,_WebChatroomModule_msgReceiverHandler,_WebChatroomModule_rejoinChatroom,_WebChatroomModule_joinHandler,_WebChatroomModule_deleteChatroom,_WebChatroomModule_inRoom,_WebChatroomModule_qryChatroomEntries;_WebChatroom_msgReceiver=new WeakMap,_WebChatroom_kvStore=new WeakMap,_WebChatroom_instances=new WeakSet,_WebChatroom_kvEnabled_get=function(){var e;return!!(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.kvStorage)};var trans2IChatroomJoinResponse=function(e){var t=e.joinTime,r=e.createTime,n=e.memberCount,i=e.chatroomBanState;return{createTime:r,joinTime:t,memberCount:n,isAllChatroomBanned:!(1&~(i||0)),isCurrentUserBanned:!(2&~(i||0)),isCurrentChatroomBanned:!(4&~(i||0)),isCurrentChatroomInWhitelist:!(1&~(e.whiteListState||0))}},WebChatroomModule=function(e){function t(t){var r=e.call(this)||this;return _WebChatroomModule_instances.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),_WebChatroomModule_chatrooms.set(r,new Map),Object.defineProperty(r,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),r.logger=t.logger,r._ctx.on("onConnected",__classPrivateFieldGet(r,_WebChatroomModule_instances,"m",_WebChatroomModule_onConnected),r),r._ctx.on("onDisconnected",__classPrivateFieldGet(r,_WebChatroomModule_instances,"m",_WebChatroomModule_onDisconnected),r),r._ctx.on("onSuspend",__classPrivateFieldGet(r,_WebChatroomModule_instances,"m",_WebChatroomModule_onSuspend),r),r._ctx.on("sNtf",__classPrivateFieldGet(r,_WebChatroomModule_instances,"m",_WebChatroomModule_onSNtf),r),r._ctx.on("sCmd",__classPrivateFieldGet(r,_WebChatroomModule_instances,"m",_WebChatroomModule_onSCmd),r),r._ctx.on("syncMsg",__classPrivateFieldGet(r,_WebChatroomModule_instances,"m",_WebChatroomModule_onSyncMsg),r),r._ctx.on("sMsg",__classPrivateFieldGet(r,_WebChatroomModule_instances,"m",_WebChatroomModule_onSMsg),r),r}return __extends(t,e),Object.defineProperty(t.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o;return __generator(this,(function(a){switch(a.label){case 0:return[4,__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_joinHandler).call(this,e,r,n)];case 1:return(i=a.sent()).isOk?((o=__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").get(e))||(o=new WebChatroom(this._ctx,e,t,__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_msgReceiverHandler).bind(this),n),__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").set(e,o),o.startInterval()),[2,i.trans(trans2IChatroomJoinResponse)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return __classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").get(e)?(__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_deleteChatroom).call(this,e),t=codec.encode(IMPB.ChrmInput,{nothing:1}),[4,this._ctx.query(Topic.exitChrm,e,t)]):[2,ok()];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(t.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=codec.encode(IMPB.QueryChatRoomInfoInput,{count:t,order:r}),[4,this._ctx.query(Topic.queryChrmI,e,n,IMPB.QueryChatRoomInfoOutput)];case 1:return[2,i.sent().trans((function(e){return{userCount:e.userTotalNums,userInfos:e.userInfos}}))]}}))}))}}),Object.defineProperty(t.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_inRoom).call(this,e).next((function(e){return e.setEntry(t,r)}))]}))}))}}),Object.defineProperty(t.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_inRoom).call(this,e).next((function(e){return e.setEntries(t)}))]}))}))}}),Object.defineProperty(t.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_inRoom).call(this,e).next((function(e){return e.removeEntry(t,r)}))]}))}))}}),Object.defineProperty(t.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_inRoom).call(this,e).next((function(e){return e.removeEntries(t)}))]}))}))}}),Object.defineProperty(t.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:return(r=__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").get(e))?null===(n=r.getEntry(t))?[2,fail(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST)]:[2,ok(n)]:[4,__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_qryChatroomEntries).call(this,e)];case 1:return[2,i.sent().tryTrans((function(e){var r=e[t];return void 0===r?fail(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST):ok(r)}))]}}))}))}}),Object.defineProperty(t.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){return(t=__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").get(e))?[2,ok(t.getAllEntries())]:[2,__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_qryChatroomEntries).call(this,e)]}))}))}}),Object.defineProperty(t.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return i=encodeHistoryMsgInput({targetId:e,time:t,count:r,order:n}),o=this._ctx.currentUserId,[4,this._ctx.query(Topic.qryCHMsg,e,i)];case 1:return(a=u.sent()).isOk?(s=decodeHistoryMsgOuput(a.data.pbData),[2,ok({hasMore:!!s.hasMsg,list:s.list.map((function(t){return trans2IReceivedMessage(t,o,!1,e)}))})]):[2,a.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=codec.encode(IMPB.SetRtcRoomIdInput,{rtcRoomId:e.rtcRoomId}),[4,this._ctx.query(Topic.setRtcRoomId,e.chatRoomId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),t}(EventDispatcher),_UserSettings_instances,_UserSettings_firstSyncAfterConnected,_UserSettings_emitUserSettingsSynced,_UserSettings_setUserSetting;_WebChatroomModule_chatrooms=new WeakMap,_WebChatroomModule_instances=new WeakSet,_WebChatroomModule_onDisconnected=function(){var e,t;try{for(var r=__values(__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").values()),n=r.next();!n.done;n=r.next()){n.value.stopInterval()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").clear()},_WebChatroomModule_onSuspend=function(){var e,t;try{for(var r=__values(__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").values()),n=r.next();!n.done;n=r.next()){n.value.stopInterval()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},_WebChatroomModule_onConnected=function(e,t){var r,n;if(t)try{for(var i=__values(__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").values()),o=i.next();!o.done;o=i.next()){var a=o.value;__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_rejoinChatroom).call(this,a)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},_WebChatroomModule_onSMsg=function(e,t){var r=t.conversationType,n=t.targetId;(t.messageType,r===exports.ConversationType.CHATROOM)&&(e.stopPropagation(),__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").get(n)&&__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_msgReceiverHandler).call(this,[t],n))},_WebChatroomModule_onSyncMsg=function(e,t){t.conversationType===exports.ConversationType.CHATROOM&&(e.stopPropagation(),this.emit("message",[t],t.targetId))},_WebChatroomModule_onSNtf=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r){e.stopPropagation();var o=__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").get(n);o&&o.handleMessageNotify(i)}},_WebChatroomModule_onSCmd=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r||4===r){e.stopPropagation();var o=__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").get(n);if(o)return 4===r?(__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").delete(n),void this._ctx.emit("chatroom",{chatroomDestroyed:n})):void o.handleKVNotify(i)}},_WebChatroomModule_msgReceiverHandler=function(e,t){var r=this,n=e.filter((function(e){var n,i=e.messageType;if(i===MessageType.CHATROOM_MERGE_CHANGE){var o=parseChrmMemChangeMessage(e);return r._ctx.emit("chatroom",{userChange:o}),!1}if(i===MessageType.CHATROOM_MERGE_BAN){var a=parseChrmBanMsg(e);return r._ctx.emit("chatroom",{chatroomNotifyBan:a}),!1}if(i===MessageType.CHATROOM_SYNC_MSG){var s=parseChrmSyncMsg(e);return r._ctx.emit("chatroom",{chatroomNotifyMultiLoginSync:s}),!1}if(i===MessageType.CHATROOM_MERGE_BLOCK){var u=parseChrmBlockMsg(e);return u.operateType===exports.ChrmMemOperateType.Blocked&&(null===(n=null==u?void 0:u.userIdList)||void 0===n?void 0:n.includes(r._ctx.currentUserId))&&__classPrivateFieldGet(r,_WebChatroomModule_instances,"m",_WebChatroomModule_deleteChatroom).call(r,t),r._ctx.emit("chatroom",{chatroomNotifyBlock:u}),!1}return!0}));this.emit("message",n,t)},_WebChatroomModule_rejoinChatroom=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u;return __generator(this,(function(l){switch(l.label){case 0:return t=e.roomId,r=e.extra,n=this.logger.createTraceId(),this.logger.info(Log.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:t}),n),[4,__classPrivateFieldGet(this,_WebChatroomModule_instances,"m",_WebChatroomModule_joinHandler).call(this,t,!1,r)];case 1:return i=l.sent(),this.logger.summary(Log.L_REJOIN_CHATROOM_R,i,n,{chatroomId:t}),o=i.code,a=i.isOk,s=i.data,a?(e.restartInterval(),u=trans2IChatroomJoinResponse(s),this._ctx.emit("chatroom",{rejoinedRoom:__assign(__assign({chatroomId:t},u),{count:e.initCount})}),[2]):(o!==exports.ErrorCode.RC_CHATROOM_USER_KICKED&&o!==exports.ErrorCode.RC_CHATROOM_NOT_EXIST||__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").delete(t),this._ctx.emit("chatroom",{rejoinedRoom:{chatroomId:t,errorCode:o}}),[2])}}))}))},_WebChatroomModule_joinHandler=function(e,t,r){var n=codec.encode(IMPB.ChrmInput,{extra:r,nothing:1}),i=t?Topic.joinChrm:Topic.joinChrmR;return this._ctx.query(i,e,n,IMPB.ChrmOutput)},_WebChatroomModule_deleteChatroom=function(e){var t=__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").get(e);t&&(t.stopInterval(),__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").delete(e))},_WebChatroomModule_inRoom=function(e){var t=__classPrivateFieldGet(this,_WebChatroomModule_chatrooms,"f").get(e);return t?ok(t):fail(exports.ErrorCode.NOT_IN_CHATROOM)},_WebChatroomModule_qryChatroomEntries=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this._ctx.query(Topic.pullKV,e,encodeQueryChrmKV(0),void 0)];case 1:return(t=n.sent()).isOk?(r=decodeChrmKVOutput(t.data.pbData).entries,[2,ok(r.reduce((function(e,t){return e[t.key]=t.value,e}),{}))]):[2,t.wipe()]}}))}))};var UserSettingsStorage=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=runtime.localStorage,r=e.appkey,n=e.currentUserId,i=LOCAL_STORAGE_KEYS.USER_SETTING_KEY(r,n),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(t.prototype,"version",{get:function(){return this.get("value").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tags",{get:function(){return this.get("value").tags||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forceUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.set("value",e)}}),Object.defineProperty(t.prototype,"addTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("value"),n=r.tags,i=r.autoTrans,o=r.transLan;n[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:n,autoTrans:i,transLan:o})}}),Object.defineProperty(t.prototype,"deleteTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("value"),n=r.tags,i=r.autoTrans,o=r.transLan;delete n[e],this.set("value",{version:t,tags:n,autoTrans:i,transLan:o})}}),t}(ModuleStorage),UserSettings=function(e){function t(t){var r=e.call(this,"UserSettings")||this;return _UserSettings_instances.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:void 0}),_UserSettings_firstSyncAfterConnected.set(r,!1),r.storage=new UserSettingsStorage,r._ctx.on("onConnected",r._handleConnected,r),r._ctx.on("onDisconnected",r._handleDisconnected,r),r._ctx.on("onSuspend",r._handleDisconnected,r),r._ctx.on("signal",r._handleSignal,r),r}return __extends(t,e),Object.defineProperty(t.prototype,"_handleConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.storage.syncDataFromLocalStorage(this._ctx),__classPrivateFieldSet(this,_UserSettings_firstSyncAfterConnected,!0,"f");var e=this.storage.version;this.setInitVersion(e),this.push(e)}}),Object.defineProperty(t.prototype,"_handleDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reset()}}),Object.defineProperty(t.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(string2Topic(t.topic)===Topic.s_us){var r=codec.decode(IMPB.UserSettingNotification,t.pbData).version;this.push(r),e.stopPropagation()}}}),Object.defineProperty(t.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,l,c,_,d,p,g,f,h,E,T,b;return __generator(this,(function(v){switch(v.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=this._ctx.getNaviInfoFromCache(),o=n.createTraceId(),n.info(Log.L_SYNC_USER_SETTINGS_T,"version: ".concat(e),o),a=codec.encode(IMPB.PullUserSettingInput,{version:e,ipType:i.ipType||0}),[4,this._ctx.query(Topic.pullUS,r,a,IMPB.PullUserSettingOutput)];case 1:return s=v.sent(),n.summary(Log.L_SYNC_USER_SETTINGS_R,s,o),s.isOk?(u=s.data,l=u.version,c=u.items,_=!1,d=!1,p=!1,g="",f=this.storage.get("value"),h=f.transLan,E=f.autoTrans,T=f.tags,b={version:l,transLan:h,autoTrans:E,tags:T},null==c||c.forEach((function(e){var t=e.key,r=e.value;switch(t){case"Tag":b.tags={},e.tags.forEach((function(e){b.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),_=!0;break;case"transLan":p=!0,b.transLan=BinaryHelper.readUTF(new Uint8Array(r));break;case"autoTrans":d=!0,b.autoTrans="1"===BinaryHelper.readUTF(new Uint8Array(r));break;case"VoipInfo":g=BinaryHelper.readUTF(new Uint8Array(r))}})),this.storage.set("value",b),_&&this.emit("tagsChanged"),p&&this.emit("userSettingsChanged",{key:UserSettingsChangedKey.TranslationLanguage,value:b.transLan}),d&&this.emit("userSettingsChanged",{key:UserSettingsChangedKey.AutoTranslateEnable,value:b.autoTrans}),g&&this.emit("voipInfoChanged",g),__classPrivateFieldGet(this,_UserSettings_instances,"m",_UserSettings_emitUserSettingsSynced).call(this,s.code),[2,ok({version:l})]):(__classPrivateFieldGet(this,_UserSettings_instances,"m",_UserSettings_emitUserSettingsSynced).call(this,s.code),[2,s.wipe()])}}))}))}}),Object.defineProperty(t.prototype,"hasTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.storage.tags[e]}}),Object.defineProperty(t.prototype,"getTags",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.storage.tags}}),Object.defineProperty(t.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=codec.encode(IMPB.SessionTagAddInput,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),[4,this._ctx.query(Topic.addSeTag,r,n,IMPB.SetUserSettingOutput)];case 1:return(i=u.sent()).isOk&&(o=i.data,a=o.version,s=o.updateVersion,this.storage.addTag(e,s?a:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=codec.encode(IMPB.SessionTagDelInput,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),[4,this._ctx.query(Topic.delSeTag,r,n,IMPB.SetUserSettingOutput)];case 1:return(i=u.sent()).isOk&&(o=i.data,a=o.version,s=o.updateVersion,this.storage.deleteTag(e,s?a:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,__classPrivateFieldGet(this,_UserSettings_instances,"m",_UserSettings_setUserSetting).call(this,Topic.transLan,e)]}))}))}}),Object.defineProperty(t.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,ok(this.storage.get("value").transLan||"zh")]}))}))}}),Object.defineProperty(t.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,__classPrivateFieldGet(this,_UserSettings_instances,"m",_UserSettings_setUserSetting).call(this,Topic.autoTrans,e?"1":"0")]}))}))}}),Object.defineProperty(t.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,ok(this.storage.get("value").autoTrans)]}))}))}}),t}(LinearQuery);_UserSettings_firstSyncAfterConnected=new WeakMap,_UserSettings_instances=new WeakSet,_UserSettings_emitUserSettingsSynced=function(e){__classPrivateFieldGet(this,_UserSettings_firstSyncAfterConnected,"f")&&(__classPrivateFieldSet(this,_UserSettings_firstSyncAfterConnected,!1,"f"),this.emit("userSettingsSynced",e))},_UserSettings_setUserSetting=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,l,c,_,d,p,g;return __generator(this,(function(f){switch(f.label){case 0:return r=this.storage.version,n=this._ctx.currentUserId,i=codec.encode(IMPB.SetUserSettingInput,{version:r,value:t,ignoreVersion:!0}),[4,this._ctx.query(e,n,i,IMPB.SetUserSettingOutput)];case 1:if((o=f.sent()).isOk){switch(a=o.data,s=a.version,u=a.updateVersion,l=this.storage.get("value"),c=l.transLan,_=l.autoTrans,d=l.tags,p=l.version,g={version:u?s:p,transLan:c,autoTrans:_,tags:d},e){case Topic.transLan:g.transLan=t;break;case Topic.autoTrans:g.autoTrans="1"===t}this.storage.set("value",g)}return[2,o.wipe()]}}))}))};var trans2IFriendInfo=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}},trans2IGroupInfo=function(e){var t,r,n=e.targetId,i=e.settingProfile,o=e.extProfile,a=e.baseInfo,s=e.userInfo,u=arrayToKeyValue(i||[]),l=arrayToKeyValue(o||[]);return{groupId:n,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!==(r=null==s?void 0:s.role)&&void 0!==r?r:exports.GroupMemberRole.UNDEF}},WebDataHostingService=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:unsupported}),Object.defineProperty(this,"searchGroupMembers",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(this,"searchJoinedGroups",{enumerable:!0,configurable:!0,writable:!0,value:unsupported})}return Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=codec.encode(IMPB.UserProfilePermission,{permission:e}),[4,this.ctx.query(Topic.updProfilePermiss,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=codec.encode(IMPB.UserProfileInput,{nothing:1}),[4,this.ctx.query(Topic.qProfilePermiss,this.ctx.currentUserId,e,IMPB.UserProfilePermission)];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 __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return t=codec.encode(IMPB.SearchUserProfile,{uniqueId:e}),[4,this.ctx.query(Topic.searchUserProfile,this.ctx.currentUserId,t,IMPB.UserProfile)];case 1:return(r=u.sent()).isOk?(n=r.data,i=n.userId,o=n.userProfile,a=n.userExtProfile,s=transformUserProfiles(i,o,a),[2,ok(s)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return i=encodeChannelsInput(e,t,r,n),[4,this.ctx.query(Topic.channelCreate,e,i,void 0)];case 1:return(o=u.sent()).isOk||!o.data?[2,o.wipe()]:(a=codec.decode(IMPB.ChannelsOutput,o.data.pbData),s={errorKeys:a.censorFailedFields,processCode:a.processCode||0},[2,fail(o.code,o.msg,s)])}}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return n=encodeChannelsInput(e,t,r),[4,this.ctx.query(Topic.upChannelInfo,e,n,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=codec.decode(IMPB.ChannelsOutput,i.data.pbData),[2,fail(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return t=codec.encode(IMPB.MultiChannels,{type:exports.ConversationType.GROUP,list:e.map((function(e){return{targetId:e}}))}),[4,this.ctx.query(Topic.qChannelInfo,e[0],t,IMPB.ChannelsListResult)];case 1:return(r=i.sent()).isOk?(n=decodeChannelsListResult(r.data).list,[2,ok(n.map(trans2IGroupInfo))]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=encodeModifyChannelsInput({targetId:e,users:t,settingInfo:{isQuit:!0,isDelBan:r.removeMuteStatus,isDelAttention:r.removeFollow,isDelWhite:r.removeWhiteList}}),[4,this.ctx.query(Topic.channelMemKick,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=encodeModifyChannelsInput({targetId:e,settingInfo:{isQuit:!0,isDelBan:t.removeMuteStatus,isDelAttention:t.removeFollow,isDelWhite:t.removeWhiteList}}),[4,this.ctx.query(Topic.channelMemQuit,e,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=encodeModifyChannelsInput({targetId:e}),[4,this.ctx.query(Topic.channelDismiss,e,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(o){switch(o.label){case 0:return i=encodeModifyChannelsInput({targetId:e,settingInfo:{isQuit:r,isDelBan:n.removeMuteStatus,isDelAttention:n.removeFollow,isDelWhite:n.removeWhiteList},users:[t]}),[4,this.ctx.query(Topic.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,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=codec.encode(IMPB.ModifyChannelsInput,{targetId:t,type:exports.ConversationType.GROUP,users:r,operateType:e}),[4,this.ctx.query(Topic.upChannelManager,t,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=codec.encode(IMPB.ModifyChannelsInput,{targetId:t,type:exports.ConversationType.GROUP,users:r,operateType:e}),[4,this.ctx.query(Topic.upChannelFollow,t,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return t=encodeChannelsQueryInput({targetId:e}),[4,this.ctx.query(Topic.qChannelFollow,e,t,IMPB.ChannelsListResult)];case 1:return(r=o.sent()).isOk?(n=decodeChannelsListResult(r.data).list,i=n.map((function(e){return{userId:e.userId,time:e.opTime}})),[2,ok(i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=encodeChannelsMemberUpdateInput({targetId:e,operateType:t?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE,channelNickName:t}),[4,this.ctx.query(Topic.upChannelRemark,e,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=codec.encode(IMPB.FriendInput,{targetId:e,type:t,info:r}),[4,this.ctx.query(Topic.friendAdd,this.ctx.currentUserId,n,IMPB.ChannelsOutput)];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 __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=codec.encode(IMPB.FriendsInput,{targetId:e,type:t}),[4,this.ctx.query(Topic.friendDel,this.ctx.currentUserId,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=codec.encode(IMPB.FriendInput,{targetId:e,type:1}),[4,this.ctx.query(Topic.friendHandle,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=codec.encode(IMPB.FriendInput,{targetId:e,type:2,info:t}),[4,this.ctx.query(Topic.friendHandle,this.ctx.currentUserId,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return n=codec.encode(IMPB.FriendProfileInput,{targetId:e,remarkName:t,extProfile:Object.entries(r).map((function(e){var t=__read(e,2);return{key:t[0],value:t[1]}}))}),[4,this.ctx.query(Topic.friendSetPf,this.ctx.currentUserId,n,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=codec.decode(IMPB.FriendProfileOutput,i.data.pbData),[2,fail(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=codec.encode(IMPB.FriendsInput,{targetId:e,type:t}),[4,this.ctx.query(Topic.friendCheck,this.ctx.currentUserId,r,IMPB.FriendsCheckOutput)];case 1:return[2,n.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 __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u;return __generator(this,(function(l){switch(l.label){case 0:return r=codec.encode(IMPB.FriendQueryInput,{queryType:11,friendType:e,page:{size:t.count,order:t.order?0:1,pageToken:t.pageToken}}),[4,this.ctx.query(Topic.friendsQuery,this.ctx.currentUserId,r,IMPB.ChannelsListResult)];case 1:return(n=l.sent()).isOk?(i=n.data.page,o=i.pageToken,a=i.hasNext,s=decodeChannelsListResult(n.data).list,u={pageToken:a&&o?o:"",data:s.map(trans2IFriendInfo)},[2,ok(u)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return t=codec.encode(IMPB.FriendQueryInput,{queryType:12,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(Topic.friendsQuery,this.ctx.currentUserId,t,IMPB.ChannelsListResult)];case 1:return(r=u.sent()).isOk?(n=r.data.page,i=n.pageToken,o=n.hasNext,a=decodeChannelsListResult(r.data).list,s={pageToken:o&&i?i:"",data:a.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,ok(s)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=codec.encode(IMPB.FriendsListInput,{targetId:e}),[4,this.ctx.query(Topic.friendsInfoQry,this.ctx.currentUserId,t,IMPB.FriendUserInfos)];case 1:return[2,r.sent().trans((function(e){return e.list.map(trans2IFriendInfo)}))]}}))}))}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=codec.encode(IMPB.FriendLevelSet,{level:e}),[4,this.ctx.query(Topic.friendAuthSet,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return e=this.ctx.currentUserId,t=codec.encode(IMPB.FriendInput,{targetId:e}),[4,this.ctx.query(Topic.friendAuthGet,e,t,IMPB.FriendLevelSet)];case 1:return[2,r.sent().trans((function(e){return e.level}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return r=encodeChannelsQueryInput({targetId:e,ids:t}),[4,this.ctx.query(Topic.qChannelSpeMem,e,r,IMPB.ChannelsListResult)];case 1:return(n=a.sent()).isOk?(i=decodeChannelsListResult(n.data).list,o=i.map(trans2IGroupMemberInfo),[2,ok(o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return i=encodeChannelsMemberUpdateInput({targetId:e,userId:t,channelNickName:r,additional:n}),[4,this.ctx.query(Topic.upChannelMem,e,i,void 0)];case 1:return(o=s.sent()).isOk||!o.data?[2,o.wipe()]:(a=codec.decode(IMPB.ChannelsOutput,o.data.pbData),[2,fail(o.code,o.msg,{errorKeys:a.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s,u,l;return __generator(this,(function(c){switch(c.label){case 0:return n=encodeChannelsQueryInput({targetId:e,roleType:t,page:{size:r.count,order:r.order?0:1,pageToken:r.pageToken}}),[4,this.ctx.query(Topic.qChannelMem,e,n,IMPB.ChannelsListResult)];case 1:return(i=c.sent()).isOk?(o=i.data.page,a=o.pageToken,s=o.hasNext,u=decodeChannelsListResult(i.data).list,l={pageToken:s&&a?a:"",data:u.map(trans2IGroupMemberInfo)},[2,ok(l)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=codec.encode(IMPB.ChannelsMembersInput,{targetId:e,type:exports.ConversationType.GROUP}),[4,this.ctx.query(Topic.channelMemJoin,e,t,IMPB.ChannelsOutput)];case 1:return[2,r.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 __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=codec.encode(IMPB.ChannelsMembersInput,{targetId:e,type:exports.ConversationType.GROUP,userIds:t}),[4,this.ctx.query(Topic.channelMemInvite,e,r,IMPB.ChannelsOutput)];case 1:return[2,n.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return t=e.groupId,r=e.inviterId,n=e.optType,i=e.optResult,o=e.joinUserId,a=e.reason,s=codec.encode(IMPB.ChannelsMemberResponseInput,{targetId:t,type:exports.ConversationType.GROUP,optType:n,optResult:i,inviterId:r,joinUserId:o,detail:a}),[4,this.ctx.query(Topic.channelApplyResp,t,s,IMPB.ChannelsOutput)];case 1:return[2,u.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return t=encodeChannelsQueryInput({page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(Topic.qChannelApplyList,this.ctx.currentUserId,t,IMPB.ChannelsListResult)];case 1:return(r=u.sent()).isOk?(n=decodeChannelsListResult(r.data),i=n.pageToken,o=n.hasNext,a=n.list,s=a.map(trans2IGroupApplicationInfo),[2,ok({data:s,pageToken:o&&i?i:""})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u;return __generator(this,(function(l){switch(l.label){case 0:return r=encodeChannelsQueryInput({roleType:e,page:{size:t.count,pageToken:t.pageToken,order:t.order?1:0}}),[4,this.ctx.query(Topic.qChannelMemJoin,this.ctx.currentUserId,r,IMPB.ChannelsListResult)];case 1:return(n=l.sent()).isOk?(i=n.data.page,o=i.pageToken,a=i.hasNext,s=decodeChannelsListResult(n.data).list,u=s.map(trans2IGroupInfo),[2,ok({data:u,pageToken:a&&o?o:""})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return t=codec.encode(IMPB.ChannelsQueryInput,{type:exports.ConversationType.GROUP,ids:e}),[4,this.ctx.query(Topic.qChannelMemSpeJoin,this.ctx.currentUserId,t,IMPB.ChannelsListResult)];case 1:return(r=o.sent()).isOk?(n=decodeChannelsListResult(r.data).list,i=n.map(trans2IGroupInfo),[2,ok(i)]):[2,r.wipe()]}}))}))}}),e}(),_a,ConversationTypeToQueryHistoryTopic=(_a={},_a[exports.ConversationType.PRIVATE]=Topic.qryPMsg,_a[exports.ConversationType.GROUP]=Topic.qryGMsg,_a[exports.ConversationType.CHATROOM]=Topic.qryCHMsg,_a[exports.ConversationType.CUSTOMER_SERVICE]=Topic.qryCMsg,_a[exports.ConversationType.SYSTEM]=Topic.qrySMsg,_a[exports.ConversationType.APP_PUBLIC_SERVICE]=Topic.qryMCMsg,_a[exports.ConversationType.PUBLIC_SERVICE]=Topic.qryMPMsg,_a[exports.ConversationType.ULTRA_GROUP]=Topic.qryUgMsg,_a),getPubTopic=function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=Topic.ppMsgP,t[exports.ConversationType.GROUP]=Topic.pgMsgP,t[exports.ConversationType.CHATROOM]=Topic.chatMsg,t[exports.ConversationType.CUSTOMER_SERVICE]=Topic.pcMsgP,t[exports.ConversationType.RTC_ROOM]=Topic.prMsgS,t[exports.ConversationType.SYSTEM]=Topic.pbMsgP,t)[e]},getStatPubTopic=function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=Topic.ppMsgS,t[exports.ConversationType.GROUP]=Topic.pgMsgS,t)[e]},transSentAttrs2IReceivedMessage=function(e,t,r,n,i,o){var a=getMessageTypeDescription(t.messageType),s=a.isCounted,u=a.isPersited,l=a.isStatusMessage;return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:i,messageDirection:exports.MessageDirection.SEND,isCounted:s,isMentioned:!!t.isMentioned,content:t.content,messageType:t.messageType,isOffLineMessage:!1,isPersited:u,messageUId:r,sentTime:n,receivedTime:0,disableNotification:!!t.disableNotification,isStatusMessage:!!l,canIncludeExpansion:!!t.canIncludeExpansion,expansion:t.canIncludeExpansion?t.expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:trans2IReceivedStatusInfo(exports.ReceivedStatus.UNREAD),pushConfig:t.pushConfig,isInterrupt:t.isInterrupt,messageId:o||0,sentStatus:exports.SentStatus.SENT,directedUserIds:t.directionalUserIdList,disableUpdateLastMessage:t.disableUpdateLastMessage,needReceipt:t.needReceipt}},GroupChangeType=[GroupMsgChangeType.GROUP_OPERATION,GroupMsgChangeType.GROUP_PROFILE_CHANGE,GroupMsgChangeType.GROUP_APPLICATION_INVITATION,GroupMsgChangeType.GROUP_FOLLOW_USER_CHANGE],FriendChangeType=[FriendMsgChangeType.FRIEND_APPLICATION];function connected(){return function(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this._isConnected?[2,n.apply(this,e)]:[2,Promise.resolve(fail(exports.ErrorCode.RC_NET_UNAVAILABLE))]}))}))},r}}var WebEngine=function(e){function t(t,_,d){var p=this,g=d.loggerProxy?d.loggerProxy:createEngineWebLogDBProxy();p=e.call(this,t,_,d,new Logger(d.appkey,"IMLib","IM",g))||this,r.add(p),Object.defineProperty(p,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_sendMessageStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_readReceiptManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(p,"_pullOfflineFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(p,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"reporterStatistic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(p,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(p,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_dataHosting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_loggerProxy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(p,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(p,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t){var r,n=t.messageType,i=e.conversationType;if(n===MessageType.SYNC_READ_STATUS&&isSupportDirectMessage(i)&&(t.directionalUserIdList=[p.currentUserId]),n===MessageType.READ_RECEIPT_RESPONSE){if(!t.content.receiptMessageDic||0===Object.keys(t.content.receiptMessageDic).length){var o=null===(r=p._readReceiptManager)||void 0===r?void 0:r.getReceiptMessageDic(e);t.content.receiptMessageDic=o||{}}for(var a in t.directionalUserIdList=[],t.content.receiptMessageDic)t.directionalUserIdList.push(a)}return t}}),Object.defineProperty(p,"_ultraMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(p,"setProxy",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"getProxy",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"testProxy",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"setUserStatusListener",{enumerable:!0,configurable:!0,writable:!0,value:unsupportedReturnCode}),Object.defineProperty(p,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:unsupportedReturnCode}),Object.defineProperty(p,"subscribeUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:unsupportedReturnCode}),Object.defineProperty(p,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"getLocalMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"deleteLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"deleteLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"batchClearLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"clearLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:unsupportedReturnCode}),Object.defineProperty(p,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),Object.defineProperty(p,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:unsupported}),p._loggerProxy=g;var f=d.appkey,h=d.logOutputLevel,E=d.logExpireTime,T=d.navigators,b=d.areaCode,v=d.logServerUrl,R=d.miniCMPProxy,I=d.environment,C=d.useNaviV2,m=void 0!==C&&C,y=d.enableReadReceiptStorage;p._environment=I||"default",p._enableReadReceiptStorage=y,p.logger.setOutputLevel(h),urlCenter.init({areaCode:b,navigators:T,logServerUrl:v,miniCMPProxy:R}),d.loggerProxy||initLogDB(f,p.logger,E),p.reporter=new LoggerReporter(f,p.logger,p._loggerProxy),p.navi=new WebSocketNavi(f,p.logger,new WebSocketStaticConfigManager(f,p.logger),p._environment,m),p.reporterStatistic=new StatisticReporter(f,p.logger,p._loggerProxy),p._sendMessageStore=new SendMessageStore(f);var S=p._connMgr=new WebSocketManager(f,p.navi,p.logger),A=p._ctx=new WebModuleContext(p._appkey,S,p.navi,p.logger);return p._connMgr.pipe(A),"browser"===runtime.tag&&p._initCloudController(),p._userSettings=new UserSettings(A),p._chat=new WebChatService(A,p._userSettings),p._chatroom=new WebChatroomModule(A),p._dataHosting=new WebDataHostingService(A),p._chatroom.on("message",p._handleChatroomMessages,p),A.on("conversationStatusChanged",p._conversationStatusChanged,p),A.on("sCmd",p._handleSCmdNotify,p),A.on("signal",p._handleSignal,p),A.on("onConnected",p.onConnected,p),A.on("onDisconnected",p.onDisconnected,p),A.on("onConnecting",p.onConnecting,p),A.on("onSuspend",p.onSuspend,p),A.on("ultraGroupEnable",p._handleUltraGroupEnable,p),A.on("messagesFromUG",p._handleMessagesFromUltraGroup,p),A.on("messagesFromSG",p._handleMessagesFromSignalGroup,p),A.on("smsgFromSignalGroup",p._handleSmsgFromSignalGroup,p),A.on("syncMsg",p._handleSyncMsg,p),A.on("sgRelationsSynced",p._handleSGRelationsSynced,p),A.on("serverEvent",__classPrivateFieldGet(p,r,"m",c),p),A.on("readReceiptResponseV5",__classPrivateFieldGet(p,r,"m",n),p),A.on("speechToTextResponse",__classPrivateFieldGet(p,r,"m",i),p),A.on("ugUserGroupChanged",p._handleUserGroupStatus,p),A.on("ugChannelChanged",p._handleUltraChannelChange,p),A.on("conversationStatusSynced",(function(e,t){return p._watcher.conversationStatusSynced(t)}),p),A.on("messageModified",__classPrivateFieldGet(p,r,"m",o),p),A.on("messageModifiedSyncCompleted",__classPrivateFieldGet(p,r,"m",a),p),A.on("ugMsgExpansionUpdated",__classPrivateFieldGet(p,r,"m",s),p),A.on("ugMsgRecalled",__classPrivateFieldGet(p,r,"m",u),p),A.on("conversation",__classPrivateFieldGet(p,r,"m",l),p),A.on("chatroom",p._handlerChatroomEvent,p),p._userSettings.on("voipInfoChanged",p._naviChangeHandler,p),p._userSettings.on("tagsChanged",(function(){return p._watcher.tag()}),p),p._userSettings.on("userSettingsSynced",(function(e,t){return p._watcher.userSettingsSynced(t)}),p),p._userSettings.on("userSettingsChanged",(function(e,t){return p._watcher.userSettingsChanged(t)}),p),p}var r,n,i,o,a,s,u,l,c,_,d;return __extends(t,e),Object.defineProperty(t.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userSettings",{get:function(){return this._userSettings},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataHosting",{get:function(){return this._dataHosting},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"usingCppEngine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;e=__read(urlCenter.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new WebCloudController(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,InvokerType.init)}}),Object.defineProperty(t.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.navi.getNaviInfoFromCache(this._connMgr.getToken());this._pullOfflineFinished=!1,this._readReceiptManager||(this._readReceiptManager=new ReadReceiptManager(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(r),this._sendMessageStore.init(this.currentUserId),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(),this.reporter.checkStart(r),this.reporterStatistic.checkStart(r)}}),Object.defineProperty(t.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}}),Object.defineProperty(t.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.onSuspend(t)}}),Object.defineProperty(t.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(t.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.conversation(t);var r=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));r&&this._watcher.conversationTag()}}),Object.defineProperty(t.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new SubscribeManager(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var r,n;null===(n=(r=t._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(r,e)},subscribeUserStatusChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedUserStatusChange)||void 0===n||n.call(r,e)},subscribeRelationChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedRelationChange)||void 0===n||n.call(r,e)},ownUserProfileChanged:function(e){var r,n;null===(n=(r=t._watcher).ownUserProfileChanged)||void 0===n||n.call(r,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(t.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new Logger(this._appkey,e,t,this._loggerProxy)}}),Object.defineProperty(t.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(t.prototype,"naviInfo",{get:function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectionStatus",{get:function(){return this._connMgr.getConnectionStatus()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return this._openCallPlus=r,[2,this._connMgr.connect(e,t,r,n)]}))}))}}),Object.defineProperty(t.prototype,"_handleUltraGroupEnable",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.ultraGroupEnable()}}),Object.defineProperty(t.prototype,"_handleSGRelationsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.sgRelationsSynced(t)}}),Object.defineProperty(t.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=new Map,o=[];t.forEach((function(e){var t,r,a,s=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,_=e.isMentioned,d=e.isCounted,p=e.senderUserId,g=e.messageType,f=e.sentTime,h=e.channelType,E=e.isPersited;if(n._ultraMsgMap[l])delete n._ultraMsgMap[l];else{var T={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:s,channelId:c||""},b=n._chat.storage.getOrCreateModel(T,!0),v=i.get(b)||{params:{channelType:h},time:f};i.set(b,v),v.time=f;var R=v.params;if(E&&(R.hidden=!1,R.latestMessage=e,R.operationTime=f),d&&p!==n.currentUserId&&g!==MessageType.RECALL_NOTIFICATION_MESSAGE){R.unreadCount=(R.unreadCount||b.unreadCount)+1;var I=(null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===exports.MentionedType.ALL;_&&(I||(null===(a=null===(r=null==u?void 0:u.mentionedInfo)||void 0===r?void 0:r.userIdList)||void 0===a?void 0:a.includes(n.currentUserId)))&&(R.unreadMentionedCount=(R.unreadMentionedCount||b.unreadMentionedCount)+1,I||(R.unreadMentionedMeCount=(R.unreadMentionedMeCount||b.unreadMentionedMeCount)+1),R.hasMentioned=!0,R.mentionedInfo=null==u?void 0:u.mentionedInfo),b.firstUnreadMessage||R.firstUnreadMessageUId||(R.firstUnreadMessageType=g,R.firstUnreadMessageUId=l,R.firstUnreadTime=f)}o.push(e)}}));var a=[],s=[];Array.from(i.entries()).forEach((function(e){var t=__read(e,2),r=t[0],n=t[1],i=n.params,o=n.time;a.push(r);var u=r.updateAttrs(i,o);u&&s.push({conversation:r.toIReceivedConversation(),updatedItems:u})})),this._chat.storage.updateConversationStorage(a),s.length>0&&this._watcher.conversation(s),this._batchMessage(o)}}),Object.defineProperty(t.prototype,"_handleChatroomMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=this._connMgr.getConnectedTime(),o=[];if(t.forEach((function(e){e.sentTime>=i&&n._writeMessagesLog(exports.ConversationType.CHATROOM,e.messageUId)&&o.push(e.messageUId)})),o.length>0){var a=Date.now();this.logger.record(StatisticsTag.IM_MSG_RECEIVE,JSON.stringify({client_ts:a,server_deltatime:a-this._connMgr.getCrtServerTime(),msg_ids:o.join(",")}))}this._watcher.batchMessage(t)}}),Object.defineProperty(t.prototype,"_handlerChatroomEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.chatroom(t)}}),Object.defineProperty(t.prototype,"_handleMessagesFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=this._messageProcessor(t),o=i.newOutboxTime;i.messageUIds;var a=i.messages,s=i.messageExpansionList,u=i.RSMsgList,l=i.msgUIds2Statistic;l.length>0&&this.logger.record(StatisticsTag.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){n._receiveMessageExpansion(e)})),u.forEach((function(e){n._processRSMsg(e)})),this._sendMessageStore.removeByTimestamp(o),r&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this.logger.info(Log.L_PULL_OFFLINE_MESSAGE_FINISHED_S),this._watcher.pullFinished(),this._chat.startPullModifyMsg())}}),Object.defineProperty(t.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=t.syncMsg,o=t.topic;if(i)this._receiveSyncMsg(t,r);else switch(string2Topic(o)){case Topic.rtc_ntf:this._receiveRtcKv(t.pbData);break;case Topic.s_opNtf:this._pullOperateStatusNotify(t);break;case Topic.s_pubCall:this._pubCallInfo(t);break;case Topic.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(t)}}}),Object.defineProperty(t.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n,i,o=t.time;switch(t.type){case 8:null===(r=this._subscribeManager)||void 0===r||r.startsyncSubscribeUserStatus(o);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(o);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(t.prototype,"_receiveMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,r=e.channelId,n=void 0===r?"":r,i=e.conversationType,o=e.targetId,a=t.put,s=t.del,u=t.mid;a&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:a,channelId:n,conversationType:i,targetId:o}}),s&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:s,channelId:n,conversationType:i,targetId:o}})}}),Object.defineProperty(t.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this._chat.storage.clearConversationUnreadCount({conversationType:e,targetId:t,channelId:r},i);n&&o&&this._watcher.conversation([o])}}),Object.defineProperty(t.prototype,"_setConversationCacheByMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.isPersited,n=e.targetId,i=e.channelId,o=e.sentTime,a=e.disableUpdateLastMessage,s=e.senderUserId,u=e.messageType,l=e.isCounted,c=e.messageUId,_=e.content,d=e.isMentioned;if(isInConversationTypeList(t,ConversationTypes.BASE)){var p=this.naviInfo,g=this._chat.storage.getOrCreateModel({conversationType:t,targetId:n,channelId:i},!0),f={},h=s===this.currentUserId,E=u===MessageType.RECALL,T=g.lastReadTime>o;if(l&&!isEnableRealtimeSession(p).isOk&&!E&&!h&&!T&&(0===g.unreadCount&&(f.firstUnreadMessageUId=c,f.firstUnreadTime=o,f.firstUnreadMessageType=u),f.unreadCount=g.unreadCount+1,d&&isObject(_)&&_.mentionedInfo)){f.hasMentioned=!0,f.mentionedInfo=_.mentionedInfo;var b=_.mentionedInfo,v=b.type,R=b.userIdList;(v===exports.MentionedType.ALL||(R||[]).includes(this.currentUserId))&&(f.unreadMentionedCount=g.unreadMentionedCount+1)}if(E&&isObject(_)){var I=_,C=I.sentTime,m=I.messageUId;!this._ctx.userStorage.recallMsgMap.has(m)&&g.unreadCount>0&&C>g.lastReadTime&&(this._ctx.userStorage.recallMsgMap.add(m),f.unreadCount=g.unreadCount-1,0===g.unreadCount&&(f.firstUnreadMessageUId="",f.firstUnreadTime=0,f.firstUnreadMessageType=""))}if(r){E&&!g.hidden||(f.operationTime=o),f.hidden=!1;var y=E?_.sentTime:o;a||g.latestMessage&&!(g.latestMessage.sentTime<=y)||(f.latestMessage=p.supportRecallRefactor&&E?transRcCmd2RcNtf(e,!0):e)}if(this._ctx.includeUg&&u===MessageType.EXPANSION_NOTIFY&&g.latestMessage&&g.latestMessage.messageUId===c){var S=_,A=S.put,O=S.del;S.clear?g.latestMessage.expansion={}:A?g.latestMessage.expansion=__assign(__assign({},g.latestMessage.expansion),A):O&&g.latestMessage.expansion&&O.forEach((function(e){delete g.latestMessage.expansion[e]}))}var P=g.updateAttrs(f,e.sentTime);this._chat.storage.updateConversationStorage([g]),P&&r&&!a&&this._watcher.conversation([{conversation:g.toIReceivedConversation(),updatedItems:P}])}}}),Object.defineProperty(t.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;switch(string2Topic(e.topic)){case Topic.updRTime:this._receivesyncReadStatus(e);break;case Topic.updUserSub:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(t.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,r=[],n=[],i=[],o=e.length-1;o>=0;o-=1){var a=e[o];a.messageType===MessageType.LOG_COMMAND&&a.senderUserId===RC_DEFAULT_USER?n.unshift(a):a.messageType===MessageType.CLOUD_CONTROL&&a.senderUserId===RC_DEFAULT_USER?i.push(a):r.unshift(a)}this._watcher.batchMessage(r),n.forEach((function(e){var r=e.content,n=r.startTime,i=r.endTime,o=r.platform,a=r.logId,s=r.uri;t.reporter.report(parseInt(n,10),parseInt(i,10),o,s,a,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)}}),Object.defineProperty(t.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return e.shift()?(r=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,InvokerType.other,r)]):[3,2];case 1:n=o.sent()||0,(i=e.filter((function(e){return e.sentTime>n}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(t.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=codec.decode(IMPB.CallInfoDownStream,e.pbData),r=t.key,n=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:r,value:n}]}))}}),Object.defineProperty(t.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=codec.decode(IMPB.SessionMsgReadInput,e.pbData),r=t.type,n=t.channelId,i=t.msgTime,o=t.busChannel;this._clearConversationUnreadCount(r,n,o||"",!0,i),this._watcher.syncReadStatus({conversationType:r,targetId:n,channelId:o,timestamp:i})}}),Object.defineProperty(t.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=codec.encode(IMPB.KvInput,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._connMgr.query(Topic.pullKvMsg,this.currentUserId,e,IMPB.KvOutput)]):[2];case 1:return t=i.sent(),r=t.isOk,n=t.data,r&&n?(this._latestPullKVMsgTimestamp=n.maxTime,this._watcher.callInfo(JSON.stringify({list:n.info})),[2]):[2]}}))}))}}),Object.defineProperty(t.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_filterMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType;return t===MessageType.DELIVERED||t===MessageType.DELIVERED_MSG||t===MessageType.SYNC_READ_STATUS&&!this._processSRSMsg(e)}}),Object.defineProperty(t.prototype,"_messageProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=0,n=[],i=[],o=[],a=[],s=[];return e.forEach((function(e){var u=e.conversationType,l=e.targetId,c=e.channelId,_=e.messageDirection,d=e.messageUId,p=e.messageType,g=e.sentTime,f=e.senderUserId,h=e.content;if(n.push(d),_===exports.MessageDirection.SEND){r=Math.max(g,r);var E=t._sendMessageStore.getSendMessageMap(),T=p===MessageType.RECALL?"Cmd:".concat(h.messageUId):d;if(E[T])return void t._sendMessageStore.removeByUID(T)}if(!t._filterMessage(e)){switch(g>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,d)&&s.push(d),p){case MessageType.EXPANSION_NOTIFY:return void o.push(e);case MessageType.READ_RECEIPT:f===t.currentUserId&&t._clearConversationUnreadCount(u,l,c,!0,g);break;case MessageType.READ_STATE:return void a.push(e);case MessageType.READ_RECEIPT_REQUEST:t._enableReadReceiptStorage&&t._processRRReqMsg(e);break;case MessageType.READ_RECEIPT_RESPONSE:t._enableReadReceiptStorage&&t._processRRRspMsg(e)}t._setConversationCacheByMessage(e),i.push(e)}})),{newOutboxTime:r,messageUIds:n,messages:i,messageExpansionList:o,RSMsgList:a,msgUIds2Statistic:s}}}),Object.defineProperty(t.prototype,"_processSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=e.content,o=e.senderUserId,a=e.sentTime;if(o!==this.currentUserId)return!1;var s=this.naviInfo;return this._clearConversationUnreadCount(t,r,n,!0,a),1!==s.sesDriven||(a>this.connectedTime||this._watcher.syncReadStatus({conversationType:t,targetId:r,channelId:n,timestamp:i.lastMessageSendTime}),!1)}}),Object.defineProperty(t.prototype,"_processRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=e.content,o={conversationType:t,targetId:r,channelId:n};this._watcher.messageReadReceipt(t===exports.ConversationType.PRIVATE?{privateReadReceipt:__assign(__assign({},o),{endMsgTime:i.endMsgTime})}:{groupReadReceipt:__assign(__assign({},o),{totalCount:i.tmn,readedCount:i.rrn,messageUId:i.msgId})})}}),Object.defineProperty(t.prototype,"_processRRReqMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.conversationType,n=e.channelId,i=e.targetId,o=e.content,a=e.sentTime,s=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:r,channelId:n,targetId:i},o.messageUId,s,a,u)}}),Object.defineProperty(t.prototype,"_processRRRspMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i=this,o=e.conversationType,a=e.channelId,s=e.targetId,u=e.content,l=e.senderUserId,c=u.receiptMessageDic,_=void 0===c?{}:c;if(l===this.currentUserId)for(var d in _){var p=_[d];try{for(var g=(t=void 0,__values(p)),f=g.next();!f.done;f=g.next()){var h=f.value;null===(n=this._readReceiptManager)||void 0===n||n.remove({conversationType:o,channelId:a,targetId:s},h)}}catch(e){t={error:e}}finally{try{f&&!f.done&&(r=g.return)&&r.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:s},e,l)}))}}),Object.defineProperty(t.prototype,"_handleSmsgFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.conversationType,n=t.senderUserId,i=t.messageUId,o=t.sentTime;this._writeMessagesLog(r,i)&&this.logger.record(StatisticsTag.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),n!==this.currentUserId||t.isStatusMessage||this._sendMessageStore.setMessage(i,o),this._handleNotNotifyMsg(t)||(this._handleReadReceiptStorage(t),this._setConversationCacheByMessage(t),this._batchMessage([t]))}}),Object.defineProperty(t.prototype,"_handleReadReceiptStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._enableReadReceiptStorage){var t=e.messageType;t===MessageType.READ_RECEIPT_REQUEST&&this._processRRReqMsg(e),t===MessageType.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(e)}}}),Object.defineProperty(t.prototype,"_handleSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageStore.setMessage(t.messageUId,t.sentTime),this.logger.info(Log.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),t.messageType!==MessageType.EXPANSION_NOTIFY?((t.messageType===MessageType.SYNC_READ_STATUS||t.messageType===MessageType.READ_RECEIPT&&t.senderUserId===this.currentUserId)&&this._clearConversationUnreadCount(t.conversationType,t.targetId,t.channelId,!0,t.sentTime),t.messageType===MessageType.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),t.messageType===MessageType.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._setConversationCacheByMessage(t),this._batchMessage([t])):this._receiveMessageExpansion(t)}}),Object.defineProperty(t.prototype,"_handleNotNotifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType,r=e.senderUserId;return t===MessageType.DELIVERED||(t===MessageType.DELIVERED_MSG||(t===MessageType.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===MessageType.SYNC_READ_STATUS&&r!==this.currentUserId||t===MessageType.READ_STATE&&(this._processRSMsg(e),!0)))}}),Object.defineProperty(t.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,l,c,_,d,p,g,f=this;return __generator(this,(function(h){switch(h.label){case 0:return r=e.conversationType,n=e.targetId,i=e.channelId,o=t.timestamp,a=t.count,s=t.order,u=ConversationTypeToQueryHistoryTopic[r],l=this.currentUserId,c=encodeHistoryMsgInput({targetId:n,busChannel:i,time:o||(1===s?1:this._connMgr.getCrtServerTime()+6e4),count:a,order:s}),_=r===exports.ConversationType.CHATROOM?n:l,[4,this._connMgr.query(u,_,c,void 0)];case 1:return(d=h.sent()).isOk?(p=decodeHistoryMsgOuput(d.data.pbData),g=p.list.map((function(e){var t,r=trans2IReceivedMessage(e,l,!1,n),i=null===(t=f._readReceiptManager)||void 0===t?void 0:t.getReadReceiptInfo(r,r.messageUId);if(i){var o=i.users;r.readReceiptInfo={isReceiptRequestMessage:!0,readerList:o}}return r})),[2,ok({hasMore:!!p.hasMsg,list:0===s?g.reverse():g})]):[2,d.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u;return __generator(this,(function(l){switch(l.label){case 0:return this._isConnected?(r=(t=this).currentUserId,n=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(Log.L_VER_REPORT_T,o,i),a=codec.encode(IMPB.ReportSDKInput,{sdkInfo:o}),s=new QueryWriter(Topic.reportsdk,a,r),[4,n.send(s)]):[2];case 1:return(u=l.sent().code)!==exports.ErrorCode.SUCCESS&&this.logger.warn(Log.L_VER_REPORT_R,u,i),[2]}}))}))}}),Object.defineProperty(t.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this._chat.storage.setDrafts(e,t),[2,ok()]}))}))}}),Object.defineProperty(t.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){return t=this._chat.storage.getDrafts(e),[2,ok(t)]}))}))}}),Object.defineProperty(t.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this._chat.storage.deleteDrafts(e),[2,ok()]}))}))}}),Object.defineProperty(t.prototype,"_writeMessagesLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=null===(r=this.cloudController)||void 0===r?void 0:r.getMRTRConfig();if(!n)return!1;var i=getMessageUIdHash(t),o=0;switch(e){case exports.ConversationType.PRIVATE:o=n.private;break;case exports.ConversationType.GROUP:o=n.group;break;case exports.ConversationType.CHATROOM:o=n.chatroom;break;case exports.ConversationType.ULTRA_GROUP:o=n.ultraGroup}return!!o&&i%(1/o)==0}}),Object.defineProperty(t.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var r,i,o,a,s,u,l,c,_,d,p,g,f,h,E,T;return __generator(this,(function(b){switch(b.label){case 0:return r=e.conversationType,i=e.targetId,t=this._handleInnerMsgOptions(e,t),o=!1,[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP].includes(r)&&(t.isStatusMessage||getMessageTypeDescription(t.messageType).isStatusMessage)&&(o=!0),a=o?getStatPubTopic(r):getPubTopic(r)||Topic.ppMsgP,t.messageId||(t.messageId=getClientMessageId()),s=t.messageId,u=encodeUpStreamMessage(e,t),(l=new PublishWriter(Topic[a],u,r===exports.ConversationType.SYSTEM?this.currentUserId:i)).setHeaderQos(Qos.AT_LEAST_ONCE),o?(this._connMgr.sendOnly(l),[2,ok(transSentAttrs2IReceivedMessage(e,__assign(__assign({},t),{isStatusMessage:o}),"",0,this.currentUserId,s))]):(c=this._connMgr.getCrtServerTime(),_=transSentAttrs2IReceivedMessage(e,__assign(__assign({},t),{isStatusMessage:o}),"",c,this.currentUserId,s),null==n||n(s),d=Date.now(),[4,this._connMgr.send(l)]);case 1:return p=b.sent(),g=p.code,f=p.isOk,h=p.msg,E=p.data,f?(T=E,this._sendMessageSuccessHandle(_,T),this._writeMessagesLog(r,T.messageUId)&&this.logger.record(StatisticsTag.IM_MSG_SEND,JSON.stringify({msg_id:T.messageUId,channel:r,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),[2,ok(_)]):(this._writeMessagesLog(r)&&this.logger.record(StatisticsTag.IM_MSG_SEND,JSON.stringify({channel:r,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),_.sentStatus=exports.SentStatus.FAILED,[2,fail(g,h,_)])}}))}))}}),Object.defineProperty(t.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._setConversationCacheByMessage(e);var i=e.messageType,o=e.conversationType,a=e.targetId,s=e.channelId,u=e.sentTime,l=e.content,c=e.messageDirection;if(this._enableReadReceiptStorage){if(i===MessageType.READ_RECEIPT_REQUEST){var _=l.messageUId;null===(r=this._readReceiptManager)||void 0===r||r.insert({conversationType:o,targetId:a,channelId:s},_,c,u)}if(i===MessageType.READ_RECEIPT_RESPONSE){var d=l.receiptMessageDic;if(!d)return;for(var p in d)d[p].forEach((function(e){var t;null===(t=n._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:a,channelId:s},e)}))}}}}),Object.defineProperty(t.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,l,c,_,d,p,g,f,h,E,T,b,v,R,I;return __generator(this,(function(C){switch(C.label){case 0:return r=e.targetId,n=e.conversationType,i=e.channelId||"",o=t.user,a=t.extra,s=t.isDelete,u=t.directionalUserIdList,l=t.disableUpdateLastMessage,c=t.messageUId,_=t.sentTime,d=t.disableNotification,p=t.pushConfig,g=t.pushContent,f=t.isAdmin,h={conversationType:n,targetId:r,messageUId:c,sentTime:_,channelId:i,isDelete:!!s,isAdmin:!!f},o&&(h.user=o),a&&(h.extra=a),E={content:h,messageType:MessageType.RECALL,disableNotification:d,pushConfig:p,pushContent:(null==p?void 0:p.pushContent)||g,disableUpdateLastMessage:l,directionalUserIdList:[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP].includes(n)?u:void 0},T=encodeUpStreamMessage(e,E),(b=new PublishWriter(Topic.recallMsg,T,this.currentUserId)).setHeaderQos(Qos.AT_LEAST_ONCE),[4,this._connMgr.send(b)];case 1:return(v=C.sent()).isOk?(R=v.data,n!==exports.ConversationType.ULTRA_GROUP&&(R.messageUId="Cmd:".concat(c)),I=transSentAttrs2IReceivedMessage(e,E,R.messageUId,R.timestamp,this.currentUserId),n===exports.ConversationType.ULTRA_GROUP?(this._ultraMsgMap[R.messageUId]=R.timestamp,this._updateUltraGroupWhenRecallMsg(I)):(this._sendMessageStore.setMessage(R.messageUId,R.timestamp),this._setConversationCacheByMessage(I)),[2,ok(I)]):[2,v.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._connMgr.getToken();this.navi.updateVoipCallInfo(r,t);var n=this.navi.getNaviInfoFromCache(r);this._watcher.onNaviDataChange(__assign({},n))}}),Object.defineProperty(t.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return __awaiter(this,void 0,void 0,(function(){var a,s,u,l,c;return __generator(this,(function(_){switch(_.label){case 0:return a=n&&"uploads"!==n?t||"":getUploadFileName(e,t),s=this.naviInfo,u=getMinionURL(s,this.logger),l="",u||(l=JSON.stringify({uploadDomain:u})),c=codec.encode(IMPB.GetQNupTokenInput,{type:e,key:a,httpMethod:r||"",queryString:n||"",url:i||"",ext:l,size:o?Math.ceil(o):0,ipType:s.ipType||0}),[4,this._connMgr.query(Topic.qnTkn,this.currentUserId,c,IMPB.GetQNupTokenOutput)];case 1:return[2,_.sent().trans((function(e){return __assign(__assign({},e),{fileName:a,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(t.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,u;return __generator(this,(function(l){switch(l.label){case 0:return i=this.naviInfo,a="",s="",t===exports.UploadMethod.QINIU?o=Topic.qnUrl:t===exports.UploadMethod.AWS?o=Topic.s3Url:t===exports.UploadMethod.STC?o=Topic.stcUrl:t===exports.UploadMethod.MINIO?(o=Topic.minioUrl,a=getMinionURL(i,this.logger),s=JSON.stringify({url:a})):o=Topic.aliUrl,u=codec.encode(IMPB.GetDownloadUrlInput,{type:e,key:r,fileName:n,ext:s,size:-1,ipType:i.ipType||0}),[4,this._connMgr.query(o,this.currentUserId,u,IMPB.GetDownloadUrlOutput)];case 1:return[2,l.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(t.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect(e,t)];case 1:return r.sent(),this._resetMemoryState(),[2]}}))}))}}),Object.defineProperty(t.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(t.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(t.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,fail(exports.ErrorCode.TAG_EXISTS)]:[2,this._userSettings.createTag(e)]}))}))}}),Object.defineProperty(t.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this._userSettings.hasTag(e)?[2,this._userSettings.removeTag(e)]:[2,fail(exports.ErrorCode.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(t.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,this._userSettings.createTag(e)]:[2,fail(exports.ErrorCode.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(t.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return __awaiter(this,void 0,void 0,(function(){var t,r,n,i;return __generator(this,(function(o){for(i in t=this._userSettings.getTags(),r=this._chat.storage.getTagConversationCountMap(),n=[],t)n.push({tagId:i,tagName:t[i].tagName,createdTime:t[i].createdTime,conversationCount:(null===(e=r.get(i))||void 0===e?void 0:e.length)||0});return[2,ok(n)]}))}))}}),Object.defineProperty(t.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var r,i,o,a,s,u,l,c,_,d,p,g,f;return __generator(this,(function(h){switch(h.label){case 0:return r=e.targetId,t.messageId||(t.messageId=getClientMessageId()),i=t.messageId,o=encodeUpStreamMessage(e,t),(a=new PublishWriter(Topic.ugMsg,o,r)).setHeaderQos(Qos.AT_LEAST_ONCE),s=this._connMgr.getCrtServerTime(),u=transSentAttrs2IReceivedMessage(e,__assign({},t),"",s,this.currentUserId,i),n&&n(i),l=Date.now(),[4,this._connMgr.send(a)];case 1:return c=h.sent(),_=c.code,d=c.data,_!==exports.ErrorCode.SUCCESS?(this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP)&&this.logger.record(StatisticsTag.IM_MSG_SEND,JSON.stringify({channel:exports.ConversationType.ULTRA_GROUP,start_ts:l,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:_})),u.sentStatus=exports.SentStatus.FAILED,[2,fail(_,void 0,u)]):(p=d,this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP,p.messageUId)&&this.logger.record(StatisticsTag.IM_MSG_SEND,JSON.stringify({msg_id:p.messageUId,channel:exports.ConversationType.ULTRA_GROUP,start_ts:l,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:_})),u.sentTime=p.timestamp,u.messageUId=p.messageUId,this._ultraMsgMap[p.messageUId]=p.timestamp,g=this._chat.storage.getOrCreateModel(e,!0),(f=g.updateAttrs({operationTime:p.timestamp,latestMessage:__assign({},u)},p.timestamp))&&this._watcher.conversation([{conversation:g.toIReceivedConversation(),updatedItems:f}]),[2,ok(u)])}}))}))}}),Object.defineProperty(t.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._isConnected){var t=function(e){var t=e,r=t.type,n=t.notifyType,i=t.info,o=t.summary,a=[],s=[],u=!(2&~n),l=!(1&~n);return l&&Array.isArray(i)&&i.forEach((function(e){var t=e,r=t.targetId,n=t.busChannel,i=t.userId,o=t.opType,s=t.optime;a.push({targetId:r,channelId:n,userId:i,operationType:o,operationTime:s})})),u&&Array.isArray(o)&&o.forEach((function(e){var t=e,r=t.targetId,n=t.busChannel,i=t.count,o=t.opType;s.push({targetId:r,channelId:n,count:i,operationType:o})})),{conversationType:r,info:a,summary:s,hasInfo:l,hasSummary:u}}(codec.decode(IMPB.OperateStatusNotify,e.pbData));this._watcher.operateStatus(t)}}}),Object.defineProperty(t.prototype,"_handleConvertEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=[];e.filter((function(e){return 0===e.subChangeType})).forEach((function(e){var t=codec.decode(IMPB.TransResp,new Uint8Array(e.eventData)).results;n.push.apply(n,__spreadArray([],__read(t.map((function(e){return{identifier:e.messageUID,from:e.inputSource,code:e.code,translateInfo:{targetLanguage:e.targetLan,translatedText:e.transResult||"",status:e.code===exports.ErrorCode.SUCCESS?TranslateStatus.SUCCESS:TranslateStatus.FAILED}}}))),!1))})),n.length&&(null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,n))}}),Object.defineProperty(t.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:GroupChangeType},Friend:{map:{},types:FriendChangeType}},r=function(e,t,r){e[t]||(e[t]=[]),e[t].push(r)};e.forEach((function(e){var n=e.changeType;for(var i in t)if(t[i].types.includes(n)){r(t[i].map,n,e);break}}));var n={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&n[i](t[i].map)}}),Object.defineProperty(t.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=GroupMsgChangeType.GROUP_OPERATION,r=GroupMsgChangeType.GROUP_PROFILE_CHANGE,n=GroupMsgChangeType.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[r]&&this._handleGroupProfileChange(e[r]),e[n]&&this._handleFollowUserChange(e[n])}}),Object.defineProperty(t.prototype,"_processChangeMapFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e[FriendMsgChangeType.FRIEND_APPLICATION]||[]).forEach((function(e){var r,n,i,o,a,s,u,l,c,_,d=e.subChangeType,p=e.businessId,g=e.time,f=e.eventData,h=FriendEventType.FRIEND_APPLY,E=FriendEventType.FRIEND_REFUSE,T=FriendEventType.FRIEND_USER_INFO,b=FriendEventType.FRIENDS_INPUT,v=FriendEventType.FRIEND_CLEAR,R=FriendEventType.FRIEND_INFO_CHANGE,I=FriendEventType.FRIEND_INFO_CHANGE_SYNC;switch(d){case h:case E:var C=d===h?exports.FriendApplicationStatus.UNHANDLED:exports.FriendApplicationStatus.REFUSED;null===(n=(r=t._watcher).friendApplicationStatusChanged)||void 0===n||n.call(r,{userId:p,applicationType:f.applyType,applicationStatus:C,directionType:f.friendType,operationTime:g,extra:f.info||""});break;case T:null===(o=(i=t._watcher).friendAdd)||void 0===o||o.call(i,{userId:p,name:f.name,portraitUri:f.portraitUrl,directionType:f.friendType,operationTime:g});break;case b:null===(s=(a=t._watcher).friendDelete)||void 0===s||s.call(a,{userIds:f.targetId,directionType:f.type,operationTime:g});break;case v:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,g);break;case R:break;case I:null===(_=(c=t._watcher).friendInfoChangedSync)||void 0===_||_.call(c,{userId:p,remark:f.remarkname,extProfile:f.extProfile,operationTime:g})}}))}}),Object.defineProperty(t.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,a=e.subChangeType,s=e.businessId,u=e.time,l=e.eventData,c=l.optUserInfo,_=l.channelInfo,d=l.userInfos,p={groupId:s,operation:a,operationTime:u};c&&(r=__read(formatGroupMembers([c]),1),p.operatorInfo=r[0]),a===exports.GroupOperation.CREATE&&(n=__read(formatGetGroupsInfo([_]),1),p.groupInfo=n[0]),[exports.GroupOperation.CREATE,exports.GroupOperation.DISMISS].includes(a)||(p.memberInfos=formatGroupMembers(d)),null===(o=(i=t._watcher).groupOperation)||void 0===o||o.call(i,p)}))}}),Object.defineProperty(t.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,a,s,u=e.businessId,l=e.time,c=e.eventData,_=e.subChangeType,d=e.secondaryId;switch(_){case GroupInfoChangeSubChangeType.GROUP_INFO_CHANGE:var p=__read(formatGroupMembers([c.optUserInfo]),1)[0],g=__read(formatGroupsInfo([c.channelInfo]),1)[0],f=__read(c.channelFullInfo?formatGroupsInfo([c.channelFullInfo]):[void 0],1)[0];null===(n=(r=t._watcher).groupInfoChanged)||void 0===n||n.call(r,{operatorInfo:p,groupInfo:g,changedGroupInfo:g,operationTime:l,fullGroupInfo:f});break;case GroupInfoChangeSubChangeType.MEMBER_PROFILE_CHANGE:p=__read(formatGroupMembers([c.optUserInfo]),1)[0];var h=formatGroupMembers(c.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:u,operatorInfo:p,memberInfo:h,operationTime:l});break;case GroupInfoChangeSubChangeType.GROUP_REMARK_DELETE:case GroupInfoChangeSubChangeType.GROUP_REMARK_SET:var E=_===GroupInfoChangeSubChangeType.GROUP_REMARK_SET?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(s=(a=t._watcher).groupRemarkChangedSync)||void 0===s||s.call(a,{groupId:u,operationType:E,operationTime:l,groupRemark:d})}}))}}),Object.defineProperty(t.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i=e.subChangeType,o=e.businessId,a=e.time,s=e.userGroupIds,u=1===i?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(n=(r=t._watcher).groupFollowsChangedSync)||void 0===n||n.call(r,{groupId:o,operationType:u,operationTime:a,userIds:s})}))}}),Object.defineProperty(t.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],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||"",_={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:a,channelId:c},d=r._chat.storage.getModel(_);switch(t){case UltraMsgSubChangeType.PRIVATE_TO_PUBLIC:null==d||d.updateAttrs({channelType:exports.UltraGroupChannelType.PUBLIC}),n.push({targetId:a,channelId:c,changeType:exports.UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC,channelType:exports.UltraGroupChannelType.PUBLIC});break;case UltraMsgSubChangeType.PUBLIC_TO_PRIVATE:null==d||d.updateAttrs({channelType:exports.UltraGroupChannelType.PRIVATE}),n.push({targetId:a,channelId:c,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE,channelType:exports.UltraGroupChannelType.PRIVATE});break;case UltraMsgSubChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN:d&&r._chat.storage.removeConversation(d),n.push({targetId:a,channelId:c,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:u});break;case UltraMsgSubChangeType.CHANNEL_DELETE:d&&r._chat.storage.removeConversation(d),i.push({targetId:a,channelId:c,channelType:u,deleteTime:l});break;case UltraMsgSubChangeType.CHANNEL_USER_KICKED:o.push({targetId:a,channelId:c,userId:s,channelType:exports.UltraGroupChannelType.PRIVATE}),s===r.currentUserId&&d&&r._chat.storage.removeConversation(d);case UltraMsgSubChangeType.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),i.length>0&&this._watcher.ultraGroupChannelDelete(i),o.length>0&&this._watcher.ultraGroupChannelUserKicked(o)}}),Object.defineProperty(t.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a;return __generator(this,(function(s){return e=[],r=[],n=[],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 UserGroupChangeType.REMOVE_USER_GROUP:e.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case UserGroupChangeType.JOIN_USER_GROUP:r.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case UserGroupChangeType.EXIT_USER_GROUP:n.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case UserGroupChangeType.CHANNEL_BIND_USER_GROUP:i.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c});break;case UserGroupChangeType.CHANNEL_UNBIND_USER_GROUP:o.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c})}})),a={},e.length>0&&(a.userGroupDisband=e),r.length>0&&(a.userAdded=r),n.length>0&&(a.userRemoved=n),i.length>0&&(a.userGroupBindChannel=i),o.length>0&&(a.userGroupUnBindChannel=o),this._watcher.userGroupStatus(a),[2]}))}))}}),Object.defineProperty(t.prototype,"_updateUltraGroupWhenRecallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._chat.storage.getModel(e);if(r){var n={},i=e.content,o=i.messageUId,a=i.sentTime,s=r.latestMessage;s&&s.messageUId===o&&(n.latestMessage=transRcCmd2RcNtf(e,!0)),a&&r.lastReadTime<a&&r.unreadCount&&(n.unreadCount=r.unreadCount-1,t!==UltraMentionedType.ALL&&t!==UltraMentionedType.ME||!r.unreadMentionedCount||(n.unreadMentionedCount=r.unreadMentionedCount-1),t===UltraMentionedType.ME&&r.unreadMentionedCount&&(n.unreadMentionedMeCount=r.unreadMentionedMeCount-1));var u=r.updateAttrs(n,e.sentTime);this._chat.storage.updateConversationStorage([r]),u&&this._watcher.conversation([{conversation:r.toIReceivedConversation(),updatedItems:u}])}}}),Object.defineProperty(t.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.SUBSCRIBE,r)]}))}))}}),Object.defineProperty(t.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.UNSUBSCRIBE)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(t.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(o){return i=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserList(e,t,r),[2,ok(i)]}))}))}}),Object.defineProperty(t.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){return n=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserStatus(e,t),[2,ok(n||[])]}))}))}}),Object.defineProperty(t.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return n=codec.encode(IMPB.UserProfile,__classPrivateFieldGet(this,r,"m",_).call(this,e)),[4,this._connMgr.query(Topic.updUserProfile,this.currentUserId,n,void 0)];case 1:return(i=u.sent()).data?(o=codec.decode(IMPB.SetUserProfileResp,i.data.pbData),i.isOk?(a=o.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,a),[2,i.wipe()]):(s=o.censorFailedFields,[2,fail(i.code,"",s&&0!==s.length?{errorKeys:s,errorKey:s[0]}:void 0)])):[2,i.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subscribeManager.getOwnProfile()}}),Object.defineProperty(t.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this._subscribeManager.getUserProfiles(e)]}))}))}}),Object.defineProperty(t.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:return r?[3,2]:[4,this._connMgr.send(new PublishWriter(t,n,e))];case 1:return[2,i.sent().wipe()];case 2:return[4,this._connMgr.query(t,e,n,void 0)];case 3:return[2,i.sent().trans((function(e){return e.pbData}))]}}))}))}}),Object.defineProperty(t.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return n=encodeRtcInput(this.rtcCodec,t,r),[4,this.rtcSignaling(e,Topic[Topic.rtcPing],!0,n)];case 1:return(i=a.sent()).isOk?(o=this.rtcCodec.decode(RTCPB.RtcOutput,i.data),[2,ok(o)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return getDeviceId()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){setDeviceId(e.deviceId),setPackageName(e.packageName)}}),Object.defineProperty(t.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(t.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(t.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(t.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){deInitLogDB()}}),Object.defineProperty(t.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;if(this._connMgr.setNetwork(e,t),e.status&&isStartCloudController()&&this.cloudControllerUri){var n=this._connMgr.getToken();null===(r=this.cloudController)||void 0===r||r.request(this.cloudControllerUri,InvokerType.newWorkChange,n)}}}),Object.defineProperty(t.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){switch(o.label){case 0:return n=codec.encode(IMPB.CallInfoUpStream,{key:t,dataContent:r}),[4,this._connMgr.query(Topic.reqCall,e,n,IMPB.CallInfoUpStream)];case 1:return(i=o.sent()).isOk?[2,i.trans((function(e){return{key:e.key,value:e.dataContent}}))]:[2,i.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=codec.encode(IMPB.AddUnpushPeriodInput,e),[4,this._connMgr.query(Topic.addUnpush,this.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(t.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=codec.encode(IMPB.DeleteUnpushPeriodInput,{nothing:0}),[4,this._connMgr.query(Topic.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(t.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=codec.encode(IMPB.QueryUnpushPeriodInput,{nothing:0}),[4,this._connMgr.query(Topic.qryUnpush,this.currentUserId,e,IMPB.QueryUnpushPeriodOutput)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,r=e.spanMinutes,n=e.startTime,i=e.level,o=e.timezone;return t?{spanMinutes:r,startTime:n,level:i,timezone:o}:{spanMinutes:0,startTime:"",level:exports.PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(t.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,ok(urlCenter.getStatsUrlList(this.naviInfo))]}))}))}}),Object.defineProperty(t.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,u,l,c,_=this;return __generator(this,(function(d){switch(d.label){case 0:return i=0===n?e[0].identifier:this.currentUserId,o=this.userSettings.storage.get("value").transLan,a=[],s=[],e.forEach((function(e){var t=e.sourceLanguage,r=e.content,i=e.targetLanguage||o;t!==i?r?a.push({messageUID:e.identifier,sourceLan:e.sourceLanguage,targetLan:e.targetLanguage||o,text:e.content,inputSource:n,transType:1}):s.push({identifier:e.identifier,from:n,code:exports.ErrorCode.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:TranslateStatus.NONE}}):s.push({identifier:e.identifier,from:n,code:exports.ErrorCode.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:TranslateStatus.NONE}})})),0!==a.length?[3,1]:(u=ok(),[3,3]);case 1:return l=codec.encode(IMPB.ConvertMsgInput,{businessType:3,businessInfo:codec.encode(IMPB.TransReq,{forceTrans:r,transInfos:a,model:t})}),[4,this._connMgr.query(Topic.upConvertMsg,i,l,IMPB.ConvertMsgOutput)];case 2:c=d.sent(),u=c.wipe(),d.label=3;case 3:return s.length>0&&setTimeout((function(){return _._watcher.translateResponse(s)}),0),[2,u]}}))}))}}),Object.defineProperty(t.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return this._subscribeManager?(t=[],n=new Set,this._subscribeManager.getSubscribeUserStatus(exports.SubscribeType.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===(i=e.filter((function(e){return!n.has(e)}))).length?[2,ok(t)]:[4,__classPrivateFieldGet(this,r,"m",d).call(this,exports.SubscribeType.FRIEND_ONLINE_STATUS,i)]):[2,ok([])];case 1:return(o=a.sent()).isOk?(o.data.list.forEach((function(e){var r=e.subUserId,n=e.data.map((function(e){return{platform:e.platformInfo,isOnline:!!e.value,updateTime:e.versionTime}})),i=n.some((function(e){return e.isOnline}));t.push(addFullPlatfromStatus({userId:r,isOnline:i,details:n}))})),[2,ok(t)]):[2,o.wipe()]}}))}))}}),r=new WeakSet,n=function(e,t){this._watcher.readReceiptResponseV5(t)},i=function(e,t){this._watcher.speechToTextResponse(t)},o=function(e,t){this._watcher.messagesModified(t)},a=function(e){this._watcher.messageModifiedSyncCompleted()},s=function(e,t){this._watcher.ultraGroupMessageExpansionUpdated(t)},u=function(e,t){this._watcher.ultraGroupMessageRecalled(t)},l=function(e,t){this._watcher.conversation(t)},c=function(e,t,r){var n=this;t!==ServerEventType.GROUP_APPLICATION_INVITATION?t!==ServerEventType.CONVERT?this._handleEventChangeList(this._connMgr.codec.formatEventChangeList(r)):this._handleConvertEvent(r):r.forEach((function(e){codec.decode(IMPB.ChannelApplyInfo,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,r,i=trans2IGroupApplicationInfo(e);null===(r=(t=n._watcher).groupApplicationEvent)||void 0===r||r.call(t,i)}))}))},_=function(e){var t={},r=e.extraProfile;return r&&(delete e.extraProfile,t.userExtProfile=trans2IPBProfileInfo(r)),t.userProfile=trans2IPBProfileInfo(e),t},d=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=codec.encode(IMPB.QrySubDataReq,{subType:e,subUsers:t.map((function(e){return{subUserId:e}}))}),[4,this._connMgr.query(Topic.qrySubData,this.currentUserId,r,IMPB.PullSubDataResp)];case 1:return[2,n.sent()]}}))}))},__decorate([connected()],t.prototype,"setNotificationQuietHoursWithSetting",null),__decorate([connected()],t.prototype,"removeNotificationQuietHoursSetting",null),__decorate([connected()],t.prototype,"getNotificationQuietHoursSetting",null),t}(BasicEngine),_AppSettings_naviInfo,AppSettings=function(){function e(e){_AppSettings_naviInfo.set(this,void 0),__classPrivateFieldSet(this,_AppSettings_naviInfo,e,"f")}return Object.defineProperty(e.prototype,"isSpeechToTextEnabled",{get:function(){return!!(1&(__classPrivateFieldGet(this,_AppSettings_naviInfo,"f").AIBusinessSub||0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConversationListIncludeUltraGroup",{get:function(){return includeUg(__classPrivateFieldGet(this,_AppSettings_naviInfo,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageModifiableMinutes",{get:function(){return __classPrivateFieldGet(this,_AppSettings_naviInfo,"f").msgModifyMinute||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readReceiptVersion",{get:function(){return trans2GroupReadReceiptVersion(__classPrivateFieldGet(this,_AppSettings_naviInfo,"f").grpRRVer)},enumerable:!1,configurable:!0}),e}();_AppSettings_naviInfo=new WeakMap;var BaseModule=function(){function e(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),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===exports.RCConnectionStatus.CONNECTED||this.ctx.userId&&e?ok(this.ctx.naviInfo):fail(exports.ErrorCode.RC_NET_UNAVAILABLE)}}),e}(),ChatroomModule=function(e){function t(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return __extends(t,e),Object.defineProperty(t.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(Log.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,extra:n,createIfNotExist:r}),i),[4,Validator.create("joinChatroom").validate("chatroomId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNumber("count",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("extra",n).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){var i=Math.max(Math.min(t,50),-1)||10;return a.svr.joinChatroom(e,i,r,n)}))];case 1:return o=s.sent(),this.logger.summary(Log.A_JOIN_CHATROOM_R,o,i),[2,o]}}))}))}}),Object.defineProperty(t.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_QUIT_CHATROOM_T,JSON.stringify({roomId:e}),t),[4,Validator.create("quitChatroom").validate("roomId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.quitChatroom(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_QUIT_CHATROOM_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_GET_CHATROOM_INFO_T,JSON.stringify({roomId:e,count:t,order:r}),n),[4,Validator.create("getChatroomInfo").validate("roomId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,0,20).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,2).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).next((function(){return o.svr.getChatroomInfo(e,t||0,r||1)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_GET_CHATROOM_INFO_R,i,n),[2,i]}}))}))}}),Object.defineProperty(t.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_SET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,Validator.create("setChatroomEntry").validate("roomId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",null==t?void 0:t.key,isValidChrmEntryKey,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).validate("value",null==t?void 0:t.value,isValidChrmEntryValue,!0).fail(exports.ErrorCode.INVALID_PARAMETER_VALUE).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).isBoolean("isAutoDelete",null==t?void 0:t.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).isBoolean("isSendNotification",null==t?void 0:t.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).result().tryTrans(this.validateConnected).next((function(){return o.svr.setChatroomEntry(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_SET_CHATROOM_ENTRY_R,i,n),[2,i]}}))}))}}),Object.defineProperty(t.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_SET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,Validator.create("setChatroomEntries").validate("roomId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTypedArray("entries",null==t?void 0:t.entries,(function(e){return isValidChrmEntryKey(null==e?void 0:e.key)&&isValidChrmEntryValue(null==e?void 0:e.value)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_ENTRIES).isLimitedArray("entryOptions.entries",null==t?void 0:t.entries,10,!0).fail(exports.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT).isBoolean("entryOptions.isForce",null==t?void 0:t.isForce).fail(exports.ErrorCode.INVALID_PARAMETER_IS_FORCE).isBoolean("entryOptions.isAutoDelete",null==t?void 0:t.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).result().tryTrans(this.validateConnected).next((function(){return i.svr.setChatroomEntries(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_SET_CHATROOM_ENTRIES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_REMOVE_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,Validator.create("removeChatroomEntry").validate("roomId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("entry.key",null==t?void 0:t.key,isValidChrmEntryKey,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).isBoolean("entry.isSendNotification",null==t?void 0:t.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).isLimitedString("entry.notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return o.svr.removeChatroomEntry(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_REMOVE_CHATROOM_ENTRY_R,i,n),[2,i]}}))}))}}),Object.defineProperty(t.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_REMOVE_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,Validator.create("removeChatroomEntries").validate("roomId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("keys",null==t?void 0:t.keys,10,isValidChrmEntryKey,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.removeChatroomEntries(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_REMOVE_CHATROOM_ENTRIES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_GET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,key:t}),r),[4,Validator.create("getChatroomEntry").validate("roomId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",t,isValidChrmEntryKey,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).result().tryTrans(this.validateConnected).next((function(){return i.svr.getChatroomEntry(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_GET_CHATROOM_ENTRY_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e}),t),[4,Validator.create("getAllChatroomEntries").validate("roomId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.getAllChatroomEntries(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_CHATROOM_ENTRIES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(Log.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:t,order:r,timestamp:n}),i),[4,Validator.create("getChatroomHistoryMessages").validate("roomId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTimestamp("timestamp",n).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return a.svr.getChatroomHistoryMessages(e,n||0,t||20,r||0)}))];case 1:return o=s.sent(),this.logger.summary(Log.A_GET_CHATROOM_HISTORY_MESSAGES_R,o,i),[2,o]}}))}))}}),Object.defineProperty(t.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.svr.setCheckChatRoomDuplicateMessage(e)}}),Object.defineProperty(t.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_BIND_RTC_FOR_CHATROOM_T,JSON.stringify({option:e}),t),[4,Validator.create("bindRTCRoomForChatroom").validate("chatRoomId",null==e?void 0:e.chatRoomId,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.bindRTCRoomForChatroom(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_BIND_RTC_FOR_CHATROOM_R,r,t),[2,r]}}))}))}}),t}(BaseModule),trans2IServerGroupBaseInfo=function(e){e.groupId;var t=e.groupName,r=e.portraitUri,n=e.introduction,i=e.notice;return e.extProfile,{name:t,portraitUrl:r,introduction:n,announcement:i,joinPerm:e.joinPermission,removePerm:e.removeMemberPermission,memInvitePerm:e.invitePermission,invitePerm:e.inviteHandlePermission,profilePerm:e.groupInfoEditPermission,memProfilePerm:e.memberInfoEditPermission}},formatQuitGroupConfig=function(e){var t,r,n;return{removeMuteStatus:!(null!==(t=null==e?void 0:e.removeMuteStatus)&&void 0!==t&&!t),removeWhiteList:!(null!==(r=null==e?void 0:e.removeWhiteList)&&void 0!==r&&!r),removeFollow:!(null!==(n=null==e?void 0:e.removeFollow)&&void 0!==n&&!n)}},validateGroupInfoOption=function(e,t){return e.validate("groupId",null==t?void 0:t.groupId,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("groupName",null==t?void 0:t.groupName,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_NAME).isLimitedString("portraitUri",null==t?void 0:t.portraitUri,0,128).isLimitedString("introduction",null==t?void 0:t.introduction,0,512).isLimitedString("notice",null==t?void 0:t.notice,0,1024).validate("extProfile",null==t?void 0:t.extProfile,(function(e){if(!isObject(e))return!1;var t=Object.entries(e);return t.length<=10&&t.every((function(e){var t=__read(e,2);t[0];var r=t[1];return isString(r)}))})).isValueOf("joinPermission",null==t?void 0:t.joinPermission,exports.GroupJoinPermission).isValueOf("removeMemberPermission",null==t?void 0:t.removeMemberPermission,exports.GroupOperationPermission).isValueOf("invitePermission",null==t?void 0:t.invitePermission,exports.GroupOperationPermission).isValueOf("inviteHandlePermission",null==t?void 0:t.inviteHandlePermission,exports.GroupInviteHandlePermission).isValueOf("groupInfoEditPermission",null==t?void 0:t.groupInfoEditPermission,exports.GroupOperationPermission).isValueOf("memberInfoEditPermission",null==t?void 0:t.memberInfoEditPermission,exports.GroupMemberInfoEditPermission).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_INFO)},validatePagingQueryOption=function(e,t,r,n,i){return e.isObject("option",n,i).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("count",null==n?void 0:n.count,1,t,r).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",null==n?void 0:n.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isBoolean("order",null==n?void 0:n.order).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER)},DataHosting=function(e){function t(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"_userProfileEnabled",{enumerable:!0,configurable:!0,writable:!0,value:function(){var e;return 1===(null===(e=n.ctx.naviInfo)||void 0===e?void 0:e.userProfile)?ok():fail(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE)}}),n}return __extends(t,e),Object.defineProperty(t.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_UPDATE_MY_USER_PROFILE_VISIBILITY_T,e,t),[4,Validator.create("updateMyUserProfileVisibility").isValueOf("visibility",e,exports.UserProfileVisibility,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE_VISIBILITY).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.updateMyUserProfileVisibility(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_UPDATE_MY_USER_PROFILE_VISIBILITY_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_MY_USER_PROFILE_VISIBILITY_T,"",e),[4,this.validateConnected().tryTrans(this._userProfileEnabled).next((function(){return r.svr.getMyUserProfileVisibility()}))];case 1:return t=n.sent(),this.logger.summary(Log.A_GET_MY_USER_PROFILE_VISIBILITY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(t.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T,e,t),[4,Validator.create("searchUserProfileByUniqueId").isNotEmptyString("uniqueId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_UNIQUE_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.searchUserProfileByUniqueId(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_ADD_FRIEND_T,JSON.stringify({userId:e,directionType:t,extra:r}),n),[4,Validator.create("addFriend").validate("userId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isValueOf("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).isLimitedString("extra",r,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.addFriend(e,t,r||"")}))];case 1:return i=a.sent(),this.svr.addFriend(e,t,r||""),this.logger.summary(Log.A_ADD_FRIEND_R,i,n),[2,i]}}))}))}}),Object.defineProperty(t.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_DELETE_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,Validator.create("deleteFriends").isLimitedTypedArray("userIds",e,100,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isValueOf("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.deleteFriends(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_DELETE_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_ACCEPT_FRIEND_REQUEST_T,e,t),[4,Validator.create("acceptFriendRequest").validate("userId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.acceptFriendRequest(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_ACCEPT_FRIEND_REQUEST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_REFUSE_FRIEND_REQUEST_T,JSON.stringify({userId:e,reason:t}),r),[4,Validator.create("refuseFriendApplication").validate("userId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isString("reason",t).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.refuseFriendRequest(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_REFUSE_FRIEND_REQUEST_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_SET_FRIEND_INFO_T,JSON.stringify({userId:e,remark:t,extProfile:r}),n),[4,Validator.create("setFriendInfo").validate("userId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("remark",t,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_REMARK).validate("extProfile",r,(function(e){if("object"!=typeof r)return!1;var t=Object.entries(r);return!(t.length>10||t.some((function(e){var t=__read(e,2);t[0];var r=t[1];return!isString(r)})))})).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.setFriendInfo(e,t,r||{})}))];case 1:return i=a.sent(),this.logger.summary(Log.A_SET_FRIEND_INFO_R,i,n),[2,i]}}))}))}}),Object.defineProperty(t.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_CHECK_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,Validator.create("checkFriends").isLimitedTypedArray("userIds",e,20,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isValueOf("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.checkFriends(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_CHECK_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_GET_FRIENDS_T,JSON.stringify({directionType:e,option:t}),r),[4,Validator.create("getFriends").isValueOf("directionType",e,exports.QueryFriendsDirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE).check((function(e){return validatePagingQueryOption(e,100,!1,t)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={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,r)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_GET_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_GET_FRIEND_APPLICATIONS_T,JSON.stringify({option:e,types:t,status:r}),n),[4,Validator.create("getFriendApplications").check((function(t){return validatePagingQueryOption(t,100,!1,e)})).check((function(e){e.isTypedArray("types",t,(function(t){return!e.isValueOf(t,exports.FriendApplicationType,!0).isFailed})).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE).isTypedArray("status",r,(function(t){return!e.isValueOf(t,exports.FriendApplicationStatus,!0).isFailed})).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={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=r&&0!==r.length?r:[0,1,2,3];return o.svr.getFriendApplications(n,i,a)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_GET_FRIEND_APPLICATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(t.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_FRIENDS_INFO_T,JSON.stringify({userIds:e}),t),[4,Validator.create("getFriendsInfo").isLimitedTypedArray("userIds",e,100,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getFriendsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_SEARCH_FRIENDS_INFO_T,JSON.stringify({nickname:e}),t),[4,Validator.create("searchFriendsInfo").isLimitedString("nickname",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.searchFriendsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_SEARCH_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_SET_FRIEND_ADD_PERMISSION_T,JSON.stringify({permission:e}),t),[4,Validator.create("setFriendAddPermission").isValueOf("permission",e,exports.FriendAddPermission,!0).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_ADD_PERMISSION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.setFriendAddPermission(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_SET_FRIEND_ADD_PERMISSION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_FRIEND_ADD_PERMISSION_T,JSON.stringify({}),e),[4,Validator.create("getFriendAddPermission").result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getFriendAddPermission()}))];case 1:return t=n.sent(),this.logger.summary(Log.A_GET_FRIEND_ADD_PERMISSION_R,t,e),[2,t]}}))}))}}),Object.defineProperty(t.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_CREATE_GROUP_T,JSON.stringify({groupInfo:e,inviteeUserIds:t}),r),[4,Validator.create("createGroup").check((function(t){return validateGroupInfoOption(t,e)})).isLimitedTypedArray("inviteeUserIds",t,30,isValidTargetId,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r=trans2IServerGroupBaseInfo(e);return i.svr.createGroup(e.groupId,r,e.extProfile||{},t||[])}))];case 1:return n=o.sent(),this.logger.summary(Log.A_CREATE_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_UPDATE_GROUP_INFO_T,JSON.stringify({groupInfo:e}),t),[4,Validator.create("updateGroupInfo").check((function(t){return validateGroupInfoOption(t,e)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var t=trans2IServerGroupBaseInfo(e);return n.svr.updateGroupInfo(e.groupId,t,e.extProfile)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_UPDATE_GROUP_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_GROUPS_INFO_T,JSON.stringify({groupIds:e}),t),[4,Validator.create("getGroupsInfo").isLimitedTypedArray("groupIds",e,20,isValidGroupId,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getGroupsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_GROUPS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_KICK_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t,config:r}),n),[4,Validator.create("kickGroupMembers").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,isValidTargetId,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.kickGroupMembers(e,t,formatQuitGroupConfig(r))}))];case 1:return i=a.sent(),this.logger.summary(Log.A_KICK_GROUP_MEMBERS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(t.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_QUIT_GROUP_T,JSON.stringify({groupId:e,config:t}),r),[4,Validator.create("quitGroup").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.quitGroup(e,formatQuitGroupConfig(t))}))];case 1:return n=o.sent(),this.logger.summary(Log.A_QUIT_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_DISMISS_GROUP_T,JSON.stringify({groupId:e}),t),[4,Validator.create("dismissGroup").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.dismissGroup(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_DISMISS_GROUP_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(Log.A_TRANSFER_GROUP_OWNER_T,JSON.stringify({groupId:e,newOwnerId:t,quit:r,config:n}),i),[4,Validator.create("transferGroupOwner").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("newOwnerId",t,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return a.svr.transferGroupOwner(e,t,!!r,formatQuitGroupConfig(n))}))];case 1:return o=s.sent(),this.logger.summary(Log.A_TRANSFER_GROUP_OWNER_R,o,i),[2,o]}}))}))}}),Object.defineProperty(t.prototype,"addGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_ADD_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,Validator.create("addGroupManagers").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,isValidTargetId,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(exports.GroupOperationType.ADD,e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_ADD_GROUP_MANAGERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"removeGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_REMOVE_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,Validator.create("removeGroupManagers").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,isValidTargetId,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(exports.GroupOperationType.REMOVE,e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_REMOVE_GROUP_MANAGERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_GET_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,Validator.create("getGroupMembers").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,isValidTargetId,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.getGroupMembers(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_GET_GROUP_MEMBERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(Log.A_SET_GROUP_MEMBER_INFO_T,JSON.stringify({groupId:e,userId:t,nickname:r,extra:n}),i),[4,Validator.create("setGroupMemberInfo").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("userId",t,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("nickname",r,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).isLimitedString("extra",n,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return a.svr.setGroupMemberInfo(e,t,r,n)}))];case 1:return o=s.sent(),this.logger.summary(Log.A_SET_GROUP_MEMBER_INFO_R,o,i),[2,o]}}))}))}}),Object.defineProperty(t.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_SEARCH_GROUP_MEMBERS_T,JSON.stringify({groupId:e,nickName:t,option:r}),n),[4,Validator.create("searchGroupMembers").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("nickName",t,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).check((function(e){return validatePagingQueryOption(e,200,!0,r,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var n={count:r.count,pageToken:r.pageToken||"",order:!!r.order};return o.svr.searchGroupMembers(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_SEARCH_GROUP_MEMBERS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(t.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_GET_GROUP_MEMBERS_BY_ROLE_T,JSON.stringify({groupId:e,role:t,option:r}),n),[4,Validator.create("getGroupMembersByRole").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isValueOf("role",t,exports.GroupMemberRole,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_MEMBER_ROLE).isLimitedInteger("count",r.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",r.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:r.count,pageToken:r.pageToken||"",order:!!r.order};return o.svr.getGroupMembersByRole(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_GET_GROUP_MEMBERS_BY_ROLE_R,i,n),[2,i]}}))}))}}),Object.defineProperty(t.prototype,"addGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_ADD_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,Validator.create("addGroupFollows").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(exports.GroupOperationType.ADD,e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_ADD_GROUP_FOLLOWS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"removeGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_REMOVE_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,Validator.create("removeGroupFollows").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(exports.GroupOperationType.REMOVE,e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_REMOVE_GROUP_FOLLOWS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_GROUP_FOLLOWS_T,JSON.stringify({groupId:e}),t),[4,Validator.create("getGroupFollows").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getGroupFollows(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_GROUP_FOLLOWS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_SET_GROUP_REMARK_T,JSON.stringify({groupId:e,remark:t}),r),[4,Validator.create("setGroupRemark").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("remark",t,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_REMARK).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupRemark(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_SET_GROUP_REMARK_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_JOIN_GROUP_T,JSON.stringify({groupId:e}),t),[4,Validator.create("joinGroup").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.joinGroup(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_JOIN_GROUP_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_INVITE_USERS_TO_GROUP_T,JSON.stringify({groupId:e,userIds:t}),r),[4,Validator.create("inviteUsersToGroup").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,30,isValidTargetId,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.inviteUsersToGroup(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_INVITE_USERS_TO_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"acceptGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_ACCEPT_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t}),r),[4,Validator.create("acceptGroupInvite").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.memberInviteResponse({groupId:e,inviterId:t,optType:exports.GroupOperationRole.APPLICANT,optResult:exports.GroupOperationStatus.ACCEPT})}))];case 1:return n=o.sent(),this.logger.summary(Log.A_ACCEPT_GROUP_INVITE_R,n,r),[2,n.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"refuseGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_REFUSE_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t,reason:r}),n),[4,Validator.create("refuseGroupInvite").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("reason",r,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,inviterId:t,optType:exports.GroupOperationRole.APPLICANT,optResult:exports.GroupOperationStatus.REFUSE,reason:r})}))];case 1:return i=a.sent(),this.logger.summary(Log.A_REFUSE_GROUP_INVITE_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"acceptGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_ACCEPT_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r}),n),[4,Validator.create("acceptGroupApplication").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).validate("inviterId",r,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:exports.GroupOperationRole.MANAGER,optResult:exports.GroupOperationStatus.ACCEPT})}))];case 1:return i=a.sent(),this.logger.summary(Log.A_ACCEPT_GROUP_APPLICATION_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"refuseGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(Log.A_REFUSE_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r,reason:n}),i),[4,Validator.create("refuseGroupApplication").validate("groupId",e,isValidGroupId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).validate("inviterId",r,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("reason",n,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return a.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:exports.GroupOperationRole.MANAGER,optResult:exports.GroupOperationStatus.REFUSE,reason:n})}))];case 1:return o=s.sent(),this.logger.summary(Log.A_REFUSE_GROUP_APPLICATION_R,o,i),[2,o.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_GET_GROUP_APPLICATIONS_T,JSON.stringify({option:e,directions:t,status:r}),n),i=this.ctx.usingCppEngine,[4,Validator.create("getGroupApplications").check((function(t){return validatePagingQueryOption(t,200,!0,e,!0)})).check((function(e){i&&e.isLimitedTypedArray("directions",t,Object.keys(exports.GroupApplicationDirection).length,(function(t){return!e.isValueOf(t,exports.GroupApplicationDirection,!0).isFailed}),i,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION).isLimitedTypedArray("status",r,Object.keys(exports.GroupApplicationStatus).length,(function(t){return!e.isValueOf(t,exports.GroupApplicationStatus,!0).isFailed}),i,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:e.count,pageToken:e.pageToken||"",order:!!e.order};return a.svr.getGroupApplications(n,t||[],r||[])}))];case 1:return o=s.sent(),this.logger.summary(Log.A_GET_GROUP_APPLICATIONS_R,o,n),[2,o]}}))}))}}),Object.defineProperty(t.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_GET_JOINED_GROUPS_BY_ROLES_T,JSON.stringify({role:e,option:t}),r),[4,Validator.create("getJoinedGroupsByRole").isValueOf("role",e,exports.GroupMemberRole,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_MEMBER_ROLE).check((function(e){return validatePagingQueryOption(e,100,!0,t,!0)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.getJoinedGroupsByRole(e,r)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_GET_JOINED_GROUPS_BY_ROLES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_SEARCH_JOINED_GROUPS_T,JSON.stringify({groupName:e,option:t}),r),[4,Validator.create("searchJoinedGroups").isLimitedString("groupName",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_NAME).check((function(e){return validatePagingQueryOption(e,200,!0,t,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var r={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.searchJoinedGroups(e,r)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_SEARCH_JOINED_GROUPS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_JOINED_GROUPS_T,JSON.stringify({groupIds:e}),t),[4,Validator.create("getJoinedGroups").isLimitedTypedArray("groupIds",e,20,isValidGroupId,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getJoinedGroups(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_JOINED_GROUPS_R,r,t),[2,r]}}))}))}}),t}(BaseModule),_ChatModule_instances,_ChatModule_convertUGChannelId,_ChatModule_convertIdentifier,ChatModule=function(e){function t(t,r){var n=e.call(this,t)||this;return _ChatModule_instances.add(n),Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return __extends(t,e),Object.defineProperty(t.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_SAVE_EDITED_MSG_DRAFT_T,JSON.stringify({draft:e,identifier:t}),r),[4,Validator.create("saveEditedMessageDraft").check((function(e){return validateConversation(e,t,ConversationTypes.SG_UG)})).isString("draft",null==e?void 0:e.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateLogin).next((function(){return i.svr.saveEditedMessageDraft(e,__classPrivateFieldGet(i,_ChatModule_instances,"m",_ChatModule_convertIdentifier).call(i,t))}))];case 1:return n=o.sent(),this.logger.summary(Log.A_SAVE_EDITED_MSG_DRAFT_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,Validator.create("getEditedMessageDraft").check((function(t){return validateConversation(t,e,ConversationTypes.SG_UG)})).result().next((function(){return n.svr.getEditedMessageDraft(__classPrivateFieldGet(n,_ChatModule_instances,"m",_ChatModule_convertIdentifier).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_EDITED_MSG_DRAFT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_CLEAR_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,Validator.create("clearEditedMessageDraft").check((function(t){return validateConversation(t,e,ConversationTypes.SG_UG)})).result().next((function(){return n.svr.clearEditedMessageDraft(__classPrivateFieldGet(n,_ChatModule_instances,"m",_ChatModule_convertIdentifier).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(Log.A_CLEAR_EDITED_MSG_DRAFT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(t.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.conversationType,this.logger.info(Log.A_SEND_UG_TYPING_T,JSON.stringify(e),t),[4,Validator.create("sendUltraGroupTypingStatus").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).validate("conversationType",r,(function(){return r===exports.ConversationType.ULTRA_GROUP}),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).result().tryTrans(this.validateConnected).next((function(){var t=__classPrivateFieldGet(i,_ChatModule_instances,"m",_ChatModule_convertIdentifier).call(i,e);return i.svr.sendUltraGroupTypingStatus(t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_SEND_UG_TYPING_R,n,t),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"sendTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_SEND_TYPING_STATUS_T,JSON.stringify({identifier:e,typingContentType:t}),r),[4,Validator.create("sendTypingStatus").check((function(t){return validateConversation(t,e,ConversationTypes.BASE)})).isString("typingContentType",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var n={messageType:"RC:TypSts",content:{typingContentType:t}};return i.ctx.sendMessage(e,n,r)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_SEND_TYPING_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"sendSyncReadStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_SYNC_READ_STATUS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,Validator.create("sendSyncReadStatusMessage").check((function(t){return validateConversation(t,e,ConversationTypes.BASE)})).isNumber("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(n){return __awaiter(i,void 0,void 0,(function(){var i;return __generator(this,(function(o){switch(o.label){case 0:return 1===n.sesDriven?[2,this.svr.updateConversationReadTime(e,t)]:(i={messageType:MessageType.SYNC_READ_STATUS,content:{lastMessageSendTime:t},directionalUserIdList:[this.ctx.userId]},[4,this.ctx.sendMessage(e,i,r)]);case 1:return[2,o.sent().wipe()]}}))}))}))];case 1:return n=o.sent(),this.logger.summary(Log.A_SYNC_READ_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_CLEAR_UNREAD_COUNT_BY_TIME_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,Validator.create("clearUnreadCountByTimestamp").check((function(t){return validateConversation(t,e,ConversationTypes.BASE)})).isTimestamp("timestamp",t).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i.svr.clearUnreadCountByTimestamp(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_CLEAR_UNREAD_COUNT_BY_TIME_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"sendReadReceiptRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_SEND_READ_RECEIPT_REQ_T,JSON.stringify({identifier:e,messageUId:t}),r),[4,Validator.create("sendReadReceiptRequest").check((function(t){return validateConversation(t,e,ConversationTypes.ONLY_GROUP)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(){var n={messageType:MessageType.READ_RECEIPT_REQUEST,content:{messageUId:t}};return i.ctx.sendMessage(e,n,r)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_SEND_READ_RECEIPT_REQ_R,n,r),[2,n.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageUId:t,timestamp:r}),n),[4,Validator.create("sendReadReceiptMessage").check((function(t){return validateConversation(t,e,ConversationTypes.PRIVATE_ONLY)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isNumber("timestamp",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var i={messageType:MessageType.READ_RECEIPT,content:{messageUId:t,lastMessageSendTime:r,type:1}};return o.ctx.sendMessage(e,i,n)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_SEND_READ_RECEIPT_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(t.prototype,"sendReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageList:t}),r),[4,Validator.create("sendReadReceipt").check((function(t){return validateConversation(t,e,ConversationTypes.ONLY_GROUP)})).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((function(e){isObject(t)&&!Object.keys(t).some((function(r){var n=t[r];return e.isLimitedTypedArray("messageList",n,Number.MAX_SAFE_INTEGER,notEmptyString,!0).isFailed}))||e.setFailed(exports.ErrorCode.MSG_LIMIT_ERROR)})).result().tryTrans(this.validateConnected).next((function(n){return __awaiter(i,void 0,void 0,(function(){var i,o;return __generator(this,(function(a){switch(a.label){case 0:return 0!==(i=n.grpRRVer||0)&&1!==i?[2,fail(exports.ErrorCode.READ_RECEIPT_ERROR)]:1===i?(o=[],Object.keys(t).forEach((function(e){o.push.apply(o,__spreadArray([],__read(t[e]),!1))})),[2,this.svr.sendReadReceiptV2(e.targetId,o,e.channelId)]):[4,this.ctx.sendMessage(e,{messageType:MessageType.READ_RECEIPT_RESPONSE,content:{receiptMessageDic:t}},r)];case 1:return[2,a.sent().wipe()]}}))}))}))];case 1:return n=o.sent(),this.logger.summary(Log.A_SEND_READ_RECEIPT_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_GET_MSG_READER_T,JSON.stringify({targetId:e,messageUId:t,channelId:r}),n),[4,Validator.create("getMessageReader").validate("targetId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(i){return 1!==n.grpRRVer?[2,fail(exports.ErrorCode.READ_RECEIPT_ERROR)]:[2,this.svr.getMessageReader(e,t,r||"")]}))}))}))];case 1:return i=a.sent(),this.logger.summary(Log.A_GET_MSG_READER_R,i,n),[2,i]}}))}))}}),Object.defineProperty(t.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_SEND_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,endMsgUid:t,startMsgUid:r}),n),[4,Validator.create("sendReadReceiptMessageV4").check((function(t){return validateConversation(t,e,ConversationTypes.BASE)})).isNotEmptyString("endMsgUid",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_END_MESSAGE_UID).isNotEmptyString("startMsgUid",r).fail(exports.ErrorCode.INVALID_PARAMETER_START_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(n){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(i){return 3!==n.grpRRVer?[2,fail(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.sendReadReceiptMessageV4(e,r||"",t)]}))}))}))];case 1:return i=a.sent(),this.logger.summary(Log.A_SEND_READ_RECEIPT_V4_R,i,n),[2,i]}}))}))}}),Object.defineProperty(t.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_GET_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,messageUId:t}),r),[4,Validator.create("getMessageReadReceiptV4").check((function(t){return validateConversation(t,e,ConversationTypes.ONLY_GROUP)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(n){return 3!==r.grpRRVer?[2,fail(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.getMessageReadReceiptV4(e,t)]}))}))}))];case 1:return n=o.sent(),this.logger.summary(Log.A_GET_READ_RECEIPT_V4_R,n,r),[2,n]}}))}))}}),Object.defineProperty(t.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_BATCH_GET_READ_RECEIPT_INFO_V4_T,JSON.stringify({conversation:e,messageUIds:t}),r),[4,Validator.create("batchGetMessageReadReceiptInfoV4").check((function(t){return validateConversation(t,e,ConversationTypes.ONLY_GROUP)})).isTypedArray("messageUIds",t,notEmptyString,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(n){return 3!==r.grpRRVer?[2,fail(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}))];case 1:return n=o.sent(),this.logger.summary(Log.A_BATCH_GET_READ_RECEIPT_INFO_V4_R,n,r),[2,n]}}))}))}}),t}(BaseModule),_APIContext_instances,_APIContext_connect,_APIContext_disconnect,_APIContext_convertConversationOption,_APIContext_handleSendMessage,_APIContext_sendMessageWithoutValidation,_APIContext_sendExpansionMessage,_APIContext_searchMessagesWithParams,_APIContext_translateWithParams;function cloneMessage(e){return __assign({},e)}_ChatModule_instances=new WeakSet,_ChatModule_convertUGChannelId=function(e){var t;return!!(2&((null===(t=this.ctx.naviInfo)||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e},_ChatModule_convertIdentifier=function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP?e:__assign(__assign({},e),{channelId:__classPrivateFieldGet(this,_ChatModule_instances,"m",_ChatModule_convertUGChannelId).call(this,e.channelId)})};var APIContext=function(){function e(e){var t,r,n=this;_APIContext_instances.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,"rtcCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_ugSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[MessageType.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),t[MessageType.INTERCEPT]=this._processInterceptMessage.bind(this),t)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(r={},r[MessageType.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),r[MessageType.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),r[MessageType.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),r)}),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,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=__assign({},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 i={onConnected:function(){return n._onConnectionStatusChange(exports.RCConnectionStatus.CONNECTED)},onConnecting:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.DISCONNECTED),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),conversationTag:this._conversationTagListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),userSettingsSynced:this._onUserSettingsSynced.bind(this),userSettingsChanged:this._onUserSettingsChanged.bind(this),conversationStatusSynced:this._onConversationStatusSynced.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)};this.rtcCodec=new Codec(RTCProtoDesc);var o=usingCppEngine();this._engine=o?new RCCppEngine(this.rtcCodec,i,this._options):new WebEngine(this.rtcCodec,i,this._options),this.logger=this._engine.logger,this._options.eventLoopBlockingCheck&&EventLoopChecker.start(this.logger),this.sse=new SSEModule(this,o),this.chatroom=new ChatroomModule(this._engine,this._engine.chatroom),this.dataHosting=new DataHosting(this._engine,this._engine.dataHosting),this.chat=new ChatModule(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(Log.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(Log.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(Log.L_IMSDK_VER_O,JSON.stringify({commitId:"c5ab5a0b9ca2539f6f3b50a525b7e5071e92da58",version:"5.32.0-c-rtc-alpha.1"}));var r=this._context._engine;return runtime.setNetworkStatusListener(r.setNetwork.bind(r)),this._context}}),Object.defineProperty(e,"getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"getOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._options}}),Object.defineProperty(e,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(Log.A_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))}}),Object.defineProperty(e.prototype,"install",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId();if(this.logger.info(Log.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),r),this._pluginInstanseMap[e.tag])return this.logger.warn(Log.L_INSTALL_PLUGIN_R,"repeat install",r),this._pluginInstanseMap[e.tag];var n="RCRTC"===e.tag?new RTCPluginContext(this):new PluginContext(this),i=null;try{if(!e.verify(runtime))return null;i=e.setup(n,runtime,t)}catch(e){this.logger.error(Log.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,r)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(n),this._pluginInstanseMap[e.tag]=i),i}}),Object.defineProperty(e.prototype,"getAppSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.validateLogin().trans((function(e){return new AppSettings(e)}))}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;this._ugSynced=!1,this.logger.warn(Log.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(n=(r=this._watcher).connection)||void 0===n||n.call(r,e,t),this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onconnectionstatechange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_processTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._addTypingInfo(cloneMessage(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===exports.ConversationType.ULTRA_GROUP){var r=e.content.sourceType;if(t.sourceType=r,(r===exports.MessageBlockSourceType.MSG_EXPANSION||r===exports.MessageBlockSourceType.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(Log.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,r=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,n=this._engine.userId;r&&Array.isArray(r[n])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,r[n])}}),Object.defineProperty(e.prototype,"_messageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i,o,a,s=this;if(!(null===(i=(n=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(n,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(cloneMessage(e))}catch(e){return s.logger.error(Log.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(a=(o=this._watcher).message)||void 0===a||a.call(o,cloneMessage(e),t,r),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=[],o=[],a=[MessageType.READ_RECEIPT,MessageType.READ_RECEIPT_REQUEST,MessageType.READ_RECEIPT_RESPONSE];e.forEach((function(e){var s=n._messageReceiver(e,t,r);s&&a.includes(s.messageType)?o.push(s):s&&i.push(s)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(Log.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.forEach((function(e){n._messageProccessor[e.messageType]&&n._messageProccessor[e.messageType](e)}))}}),Object.defineProperty(e.prototype,"_chatroomInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).chatroomState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_expansionInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).expansion)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_tagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_onUserSettingsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userSettingsSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onUserSettingsChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userSettingsChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onConversationStatusSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationStatusSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationTagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_typingStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).typingState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_pullFinishedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_MessageBlockedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageBlocked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_callInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._pluginContextQueue.forEach((function(r){try{r.onCallInfo&&r.onCallInfo(e)}catch(e){t.logger.warn(Log.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,r;null===(r=(t=this._watcher).sgRelationsSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_operateStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).operateStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageExpansionUpdatedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageRecalledListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageRecalled)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelChangeTypeListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelChangeType)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelUserKickedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelDeleteListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_userGroupStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userGroupStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageReadReceipt)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).syncReadStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedUserStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedUserStatusChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedRelationChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedRelationChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncSubscribedUserStatusFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(Log.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(r=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ownUserProfileChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(Log.L_OWN_USER_PROFILE_CHANGED_S),null===(r=(t=this._watcher).ownUserProfileChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupOperation)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupMemberInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupApplicationEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupApplicationEvent)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupRemarkChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupRemarkChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupFollowsChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupFollowsChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendAdd)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendApplicationStatusChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendCleared",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendCleared)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendInfoChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_rtcDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onrtcdatachange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_naviDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pluginContextQueue.forEach((function(t){var r;null===(r=t.onnavidatachange)||void 0===r||r.call(t,e)}))}}),Object.defineProperty(e.prototype,"_databaseOpened",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;null===(n=(r=this._watcher).databaseOpened)||void 0===n||n.call(r,e,t)}}),Object.defineProperty(e.prototype,"_databaseUpgradeWillStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.logger.info(Log.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_databaseUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(Log.L_DB_UPGRATING_S,e),null===(r=(t=this._watcher).databaseUpgrading)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_databaseUpgradeDidComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(Log.L_DB_UPGRATE_COMPLETE_S),null===(r=(t=this._watcher).databaseUpgradeDidComplete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_readReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).readReceiptResponseV5)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_speechToTextResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).speechToTextResponse)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_translateResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messagesModified",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messagesModified)||void 0===r||r.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(r){if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];t._watcher[r]=isFunction(n)||isObject(n)?n:void 0}}))}}),Object.defineProperty(e.prototype,"_resetWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))}}),Object.defineProperty(e.prototype,"_addTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.senderUserId,r=e.conversationType,n=e.targetId,i=e.content,o=e.channelId,a=i.typingContentType,s=o||"",u="".concat(r,"#").concat(n,"#").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 r=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===r||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))}}),Object.defineProperty(e.prototype,"_notifyTypingChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(this._typingChangedList.length>0){var t=this._typingChangedList.map((function(t){return{conversationType:Number(t.split("#")[0]),targetId:t.split("#")[1],channelId:t.split("#")[2],list:e._typingInfo[t]||[]}}));this._typingStatusListener(t),this._typingChangedList=[]}0===Object.keys(this._typingInfo).length&&(clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1)}}),Object.defineProperty(e.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.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?fail(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE):ok(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===exports.RCConnectionStatus.CONNECTED||this._engine.userId&&e?ok(this._engine.naviInfo):fail(exports.ErrorCode.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 __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_connect).call(this,e,t,r)];case 1:return n=i.sent(),this.logger.summary(Log.A_CONNECT_R,n,r,void 0,(function(e){return{userId:e}})),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this.logger.info(Log.A_DISCONNECT_O,JSON.stringify({closeDB:e,disablePush:t})),[2,__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_disconnect).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_RECONNECT_T,JSON.stringify({reconnectKickEnable:e}),t),[4,__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_connect).call(this,this.token,!!e,t)];case 1:return r=n.sent(),this.logger.summary(Log.A_RECONNECT_R,r,t,void 0,(function(e){return{userId:e}})),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"_channelIdConvert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e!==exports.ConversationType.ULTRA_GROUP)return t;var r=this.getNaviInfoFromCache();return!!(2&((null==r?void 0:r.ugDriven)||0))&&!t?"RCDefault":t}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.naviInfo}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===n&&(n=[]),void 0===i&&(i=!1);var o={isPersited:t,isCounted:r,searchProps:n,isStatusMessage:i};registerMessageType(e,o),this._engine.registerMessageType(e,o)}}),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,r){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.L_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_handleSendMessage).call(this,e,t,n,r)];case 1:return i=o.sent(),this.logger.summary(Log.L_SEND_MSG_R,i,n,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,r){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_handleSendMessage).call(this,e,t,n,r)];case 1:return i=o.sent(),this.logger.summary(Log.A_SEND_MSG_R,i,n,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 __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_UPDATE_MSG_EXPANSION_T,JSON.stringify({expansion:e,attrs:t}),r),[4,Validator.create("updateMessageExpansion").check((function(r){return validateMessageAttrsForUpdateExpansion(r,t,Object.keys(e||{}))})).check((function(r){return validateMessageExpansion(r,e,t.canIncludeExpansion)})).result().tryTrans(this.validateConnected).next((function(){var n={put:e,mid:t.messageUId},o=__assign(__assign({},t),{channelId:i._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===exports.ConversationType.ULTRA_GROUP?i._engine.chat.updateUGMessageExpansion(o,n,t.sentTime):__classPrivateFieldGet(i,_APIContext_instances,"m",_APIContext_sendExpansionMessage).call(i,o,n,r)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_UPDATE_MSG_EXPANSION_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_REMOVE_MSG_EXPANSION_T,JSON.stringify({keys:e,attrs:t}),r),[4,Validator.create("removeMessageExpansion").isLimitedTypedArray("keys",e,20,(function(e){return"string"==typeof e&&/^[A-Za-z0-9_=+-]+$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).check((function(r){return validateMessageAttrsForUpdateExpansion(r,t,e)})).result().tryTrans(this.validateConnected).next((function(){var n={del:e,mid:t.messageUId},o=__assign(__assign({},t),{channelId:i._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===exports.ConversationType.ULTRA_GROUP?i._engine.chat.updateUGMessageExpansion(o,n,t.sentTime):__classPrivateFieldGet(i,_APIContext_instances,"m",_APIContext_sendExpansionMessage).call(i,o,n,r)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_REMOVE_MSG_EXPANSION_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeAllMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_REMOVE_ALL_MSG_EXPANSION_T,JSON.stringify({attrs:e}),t),[4,Validator.create("removeAllMessageExpansion").check((function(t){return validateMessageAttrsForUpdateExpansion(t,e,[])})).check((function(t){e.conversationType!==exports.ConversationType.ULTRA_GROUP&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){var r={clear:1,mid:e.messageUId},i=__assign(__assign({},e),{channelId:n._channelIdConvert(e.conversationType,e.channelId)});return e.conversationType===exports.ConversationType.ULTRA_GROUP?n._engine.chat.updateUGMessageExpansion(i,r,e.sentTime):__classPrivateFieldGet(n,_APIContext_instances,"m",_APIContext_sendExpansionMessage).call(n,i,r,t)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_REMOVE_ALL_MSG_EXPANSION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=n||this.logger.createTraceId(),this.logger.info(Log.A_SEND_READ_RECEIPT_V2_T,JSON.stringify({targetId:e,messageUIds:t,channelId:r}),n),[4,Validator.create("sendReadReceiptV2").validate("targetId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("messageUIds",t,Number.MAX_SAFE_INTEGER,notEmptyString,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(i){return 1!==n.grpRRVer?[2,fail(exports.ErrorCode.READ_RECEIPT_ERROR,"The read receipt switch is not on, please call the sendMessage method.")]:[2,this._engine.chat.sendReadReceiptV2(e,t,r)]}))}))}))];case 1:return i=a.sent(),this.logger.summary(Log.A_SEND_READ_RECEIPT_V2_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"_destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:return EventLoopChecker.stop(),this._resetWatcher(),this._engine.destroy(),runtime.removeNetworkStatusListener(),[4,__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_disconnect).call(this)];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(Log.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 __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u=this;return __generator(this,(function(l){switch(l.label){case 0:return r=null==t?void 0:t.timestamp,n=null==t?void 0:t.count,i=null==t?void 0:t.order,o=null==t?void 0:t.messageType,a=this.logger.createTraceId(),this.logger.info(Log.A_GET_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),a),[4,Validator.create("getHistoryMessage").check((function(t){return validateConversation(t,e,ConversationTypes.INCLUDE_UG_CHATROOM)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isNotEmptyString("messageType",o).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:o||""},a=__classPrivateFieldGet(u,_APIContext_instances,"m",_APIContext_convertConversationOption).call(u,e);return u._engine.getHistoryMessage(a,t,!0)}))];case 1:return s=l.sent(),this.logger.summary(Log.A_GET_HISTORY_MSG_R,s,a),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_GET_CONTINUOUS_MSGS_T,JSON.stringify({conversation:e,options:t}),r),[4,Validator.create("getContinuousMessages").check((function(t){return validateConversation(t,e,ConversationTypes.SG)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateLogin).next((function(){var r=__classPrivateFieldGet(i,_APIContext_instances,"m",_APIContext_convertConversationOption).call(i,e),n={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageType:""};return i._engine.chat.getContinuousMessages(r,n)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_GET_CONTINUOUS_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_GET_HIS_MSGS_BY_OBJ_NAMES_T,JSON.stringify({conversation:e,option:t}),r),[4,Validator.create("getHistoryMessagesByObjectNames").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTypedArray("messageTypes",null==t?void 0:t.messageTypes,notEmptyString).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateLogin).next((function(){var r=__classPrivateFieldGet(i,_APIContext_instances,"m",_APIContext_convertConversationOption).call(i,e),n={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageTypes:t.messageTypes||[]};return i._engine.chat.getHistoryMessagesByObjectNames(r,n)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_GET_HIS_MSGS_BY_OBJ_NAMES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_GET_TOP_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e,channelId:t}),r),[4,Validator.create("getTopConversationList").isTypedArray("conversationTypes",e,(function(e){return isInConversationTypeList(e,ConversationTypes.INCLUDE_UG)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",t,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(r){return __awaiter(i,void 0,void 0,(function(){var n;return __generator(this,(function(i){return(n=includeUg(r))&&!this._ugSynced?[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTopConversationList(n,e,t)]}))}))}))];case 1:return n=o.sent(),this.logger.summary(Log.A_GET_TOP_CONVERSATION_LIST_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_UNREAD_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e}),t),[4,Validator.create("getUnreadConversationList").isTypedArray("conversationTypes",e,(function(e){return isInConversationTypeList(e,ConversationTypes.INCLUDE_UG)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).next((function(t){return __awaiter(n,void 0,void 0,(function(){var r;return __generator(this,(function(n){return(r=includeUg(t))&&!this._ugSynced?[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getUnreadConversationList(r,e)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_UNREAD_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_BLOCKED_CONVERSATION_LIST_T,"",e),[4,Validator.create("getBlockedConversationList").result().tryTrans(this.validateConnected).next((function(e){return __awaiter(r,void 0,void 0,(function(){var t;return __generator(this,(function(r){return(t=includeUg(e))&&!this._ugSynced?[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getBlockedConversationList(t)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(Log.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 __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,Validator.create("getConversationListByPageIndex").isInteger("index",e,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).result().tryTrans(this.validateLogin).next((function(){return r._engine.chat.getConversationListByPageIndex(e,t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_ALL_CONVERSATION_LIST_T,JSON.stringify({channelId:e}),t),[4,Validator.create("getAllConversationList").validate("channelId",e,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateLogin).next((function(t){return __awaiter(n,void 0,void 0,(function(){var r;return __generator(this,(function(n){return(r=includeUg(t))&&!this._ugSynced?[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getAllConversationList(r,e)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_ALL_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_CONVERSATION_LIST_OLD_T,JSON.stringify(e),t),[4,usingCppEngine()&&"string"!=typeof(null==e?void 0:e.channelId)?this.getAllConversationList(null==e?void 0:e.channelId):this.getConversationListByTimestamp(e)];case 1:return r=n.sent(),this.logger.summary(Log.A_GET_CONVERSATION_LIST_OLD_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_CONVERSATION_LIST_BY_TIME_T,JSON.stringify(e),t),[4,Validator.create("getConversationListByTimestamp").isObject("params",e,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"params must be an object").isInteger("startTime",null==e?void 0:e.startTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).isInteger("count",null==e?void 0:e.count,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==e?void 0:e.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",null==e?void 0:e.channelId,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,(function(e){return isInConversationTypeList(e,ConversationTypes.INCLUDE_UG)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans((function(){return n.checkAuthed(usingCppEngine())})).next((function(t){return __awaiter(n,void 0,void 0,(function(){var r;return __generator(this,(function(n){return(r=includeUg(t))&&!this._ugSynced?[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getConversationListByTimestamp(e,r)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_CONVERSATION_LIST_BY_TIME_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_CONVERSATION_T,JSON.stringify(e),t),[4,Validator.create("getConversation").check((function(t){return validateConversation(t,e,ConversationTypes.INCLUDE_UG_CHATROOM)})).result().tryTrans(this.validateConnected).next((function(){var t=__classPrivateFieldGet(n,_APIContext_instances,"m",_APIContext_convertConversationOption).call(n,e);return n._engine.chat.getConversation(t)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_CONVERSATION_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_REMOVE_CONVERSATION_T,JSON.stringify(e),r),[4,Validator.create("removeConversation").check((function(t){return validateConversation(t,e,ConversationTypes.INCLUDE_UG)})).result().tryTrans(this.validateConnected).next((function(){var r=__classPrivateFieldGet(i,_APIContext_instances,"m",_APIContext_convertConversationOption).call(i,e);return i._engine.chat.batchDeleteConversations({identifiers:[r],deleteRemotely:!!t,deleteMessages:!1})}))];case 1:return n=o.sent(),this.logger.summary(Log.A_REMOVE_CONVERSATION_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return t=null==e?void 0:e.identifiers,r=!!(null==e?void 0:e.deleteRemotely),n=!!(null==e?void 0:e.deleteMessages),i=this.logger.createTraceId(),this.logger.info(Log.A_BATCH_DEL_CONVERS_T,JSON.stringify({identifiers:t,deleteRemotely:r,deleteMessages:n}),i),[4,Validator.create("batchDeleteConversations").isLimitedArray("identifiers",t,100,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected).next((function(){return __awaiter(a,void 0,void 0,(function(){var e,i=this;return __generator(this,(function(o){return 0===(e=t.filter((function(e){return createConversationValidator("",e,ConversationTypes.INCLUDE_UG).result().isOk})).map((function(e){return __classPrivateFieldGet(i,_APIContext_instances,"m",_APIContext_convertConversationOption).call(i,e)}))).length?[2,ok()]:[2,this._engine.chat.batchDeleteConversations({identifiers:e,deleteRemotely:r,deleteMessages:n})]}))}))}))];case 1:return o=s.sent(),this.logger.summary(Log.A_BATCH_DEL_CONVERS_R,o,i),[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelType,n=this.logger.createTraceId(),this.logger.info(Log.A_GET_UG_LIST_T,JSON.stringify({targetId:t,channelType:r}),n),[4,Validator.create("getUltraGroupList").validate("targetId",t,isValidTargetId).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isValueOf("channelType",r,exports.UltraGroupChannelType).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE).result().tryTrans(this.validateLogin).next((function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(t){return this._ugSynced?[2,this._engine.chat.getUltraGroupList(e)]:[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=a.sent(),this.logger.summary(Log.A_GET_UG_LIST_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_BLOCKED_UG_LIST_T,"",e),[4,Validator.create("getBlockedUGList").result().tryTrans(this.validateConnected).next((function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){return this._ugSynced?[2,this._engine.chat.getBlockedUGList()]:[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(Log.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 __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_CLEAR_UNREAD_COUNT_T,JSON.stringify(e),t),[4,Validator.create("clearUnreadCount").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).result().tryTrans((function(){return n.checkAuthed(e.conversationType!==exports.ConversationType.ULTRA_GROUP)})).next((function(){return __awaiter(n,void 0,void 0,(function(){var t;return __generator(this,(function(r){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(t=__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_convertConversationOption).call(this,e),[2,this._engine.chat.clearConversationUnreadCount(t)]):[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(Log.A_CLEAR_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_CLEAR_ALL_UNREAD_COUNT_T,null,e),[4,Validator.create("clearAllUnreadCount").result().tryTrans(this.validateLogin).next((function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this._engine.chat.clearAllSGUnreadCount()]}))}))}))];case 1:return t=n.sent(),this.logger.summary(Log.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 __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_UNREAD_COUNT_T,JSON.stringify(e),t),[4,Validator.create("getUnreadCount").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).result().tryTrans(this.validateLogin).next((function(){return __awaiter(n,void 0,void 0,(function(){var t;return __generator(this,(function(r){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(t=__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_convertConversationOption).call(this,e),[2,this._engine.chat.getConversationUnreadCount(t)]):[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_UNREAD_COUNT_R,r,t,void 0,(function(e){return{unreadCount:e}})),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_GET_TOTAL_UNREAD_COUNT_T,JSON.stringify({conversationTypes:e,includeMuted:t,channelId:r}),n),[4,Validator.create("getTotalUnreadCount").validate("channelId",r,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",e,(function(e){return isInConversationTypeList(e,ConversationTypes.ANY)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin).next((function(n){return __awaiter(o,void 0,void 0,(function(){var i,o;return __generator(this,(function(a){return!(i=includeUg(n))&&e&&e.includes(exports.ConversationType.ULTRA_GROUP)?[2,fail(exports.ErrorCode.METHOD_NOT_SUPPORT)]:(o=e&&e.length>0?e:getConversationTypes(i?ConversationTypes.INCLUDE_UG:ConversationTypes.BASE)).includes(exports.ConversationType.ULTRA_GROUP)&&!this._ugSynced?[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCount(o,!!t,r)]}))}))}))];case 1:return i=a.sent(),this.logger.summary(Log.A_GET_TOTAL_UNREAD_COUNT_R,i,n,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T,JSON.stringify({conversationTypes:e,levels:t,isMentioned:r}),n),[4,Validator.create("getTotalUnreadCountByLevels").isLimitedTypedArray("conversationTypes",e,20,(function(e){return isInConversationTypeList(e,ConversationTypes.INCLUDE_UG)}),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).isTypedArray("levels",t,isValidNotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(n){return e.includes(exports.ConversationType.ULTRA_GROUP)&&!this._ugSynced?[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCountByLevels(e,t,r)]}))}))}))];case 1:return i=a.sent(),this.logger.summary(Log.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R,i,n,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_FIRST_UNREAD_MEG_T,JSON.stringify(e),t),[4,Validator.create("getFirstUnreadMessage").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).result().tryTrans(this.validateLogin).next((function(){var t=__classPrivateFieldGet(n,_APIContext_instances,"m",_APIContext_convertConversationOption).call(n,e);return n._engine.chat.getFirstUnreadMessage(t)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_FIRST_UNREAD_MSG_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,Validator.create("getFirstUnreadMessageDigest").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).result().tryTrans(this.validateLogin).next((function(){var t=__classPrivateFieldGet(n,_APIContext_instances,"m",_APIContext_convertConversationOption).call(n,e);return n._engine.chat.getFirstUnreadMessageDigest(t)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_FIRST_UNREAD_MSG_DIGEST_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:t}),r),[4,Validator.create("batchSetConversationNotificationLevel").isLimitedTypedArray("conversations",e,20,(function(e){return!createConversationValidator("batchSetConversationNotificationLevel",e,ConversationTypes.INCLUDE_UG).isFailed}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isValueOf("notificationLevel",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var r=e.map((function(e){return __classPrivateFieldGet(i,_APIContext_instances,"m",_APIContext_convertConversationOption).call(i,e)}));return i._engine.chat.batchSetConversationNotificationLevel(r,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,u,l=this;return __generator(this,(function(c){switch(c.label){case 0:return i=Validator.create("batchSetConversationToTop"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return createConversationValidator("batchSetConversationToTop",e,ConversationTypes.INCLUDE_UG).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?ok():fail(exports.ErrorCode.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(a=this.logger.createTraceId(),s=e.map((function(e){return __classPrivateFieldGet(l,_APIContext_instances,"m",_APIContext_convertConversationOption).call(l,e)})),this.logger.info(Log.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:s,isTop:t,isUpdateTime:r,isCreateConversation:n}),a),[4,this._engine.chat.batchSetConversationToTop(s,t,r,n)]):[2,o.wipe()];case 1:return u=c.sent(),this.logger.summary(Log.A_BATCH_SET_CONVERSATION_TO_TOP_R,u,a),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s=this;return __generator(this,(function(u){switch(u.label){case 0:return r=Validator.create("batchSetConversationTranslateStrategy"),(n=r.isLimitedTypedArray("conversations",e,20,(function(e){return createConversationValidator("",e,ConversationTypes.INCLUDE_UG).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isValueOf("strategy",t,TranslateStrategy,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),this.logger.info(Log.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:t}),i),o=e.map((function(e){return __classPrivateFieldGet(s,_APIContext_instances,"m",_APIContext_convertConversationOption).call(s,e)})),[4,this._engine.chat.batchSetConversationTranslateStrategy(o,t)]):[2,n.wipe()];case 1:return a=u.sent(),this.logger.summary(Log.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,a,i),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,createConversationValidator("saveTextMessageDraft",e,ConversationTypes.ANY).isString("draft",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).result().tryTrans(this.validateLogin).next((function(){var n=__classPrivateFieldGet(r,_APIContext_instances,"m",_APIContext_convertConversationOption).call(r,e);return r._engine.saveTextMessageDraft(n,t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,createConversationValidator("getTextMessageDraft",e,ConversationTypes.ANY).result().tryTrans(this.validateLogin).next((function(){var r=__classPrivateFieldGet(t,_APIContext_instances,"m",_APIContext_convertConversationOption).call(t,e);return t._engine.getTextMessageDraft(r)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,createConversationValidator("clearTextMessageDraft",e,ConversationTypes.ANY).result().tryTrans(this.validateLogin).next((function(){var r=__classPrivateFieldGet(t,_APIContext_instances,"m",_APIContext_convertConversationOption).call(t,e);return t._engine.clearTextMessageDraft(r)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"recallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),n={conversation:e,messageUId:null==t?void 0:t.messageUId},this.logger.info(Log.A_RECALL_MESSAGE_T,JSON.stringify(n),r),[4,Validator.create("recallMessage").check((function(t){return validateConversation(t,e,ConversationTypes.INCLUDE_UG_CHATROOM)})).isNotEmptyString("messageUId",t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,isValidTargetId,!1,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){var r=__classPrivateFieldGet(o,_APIContext_instances,"m",_APIContext_convertConversationOption).call(o,e);return o._engine.recallMsg(r,t)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_RECALL_MESSAGE_R,i,r,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_DEL_REMOTE_MSGS_T,JSON.stringify({conversation:e,messages:t}),r),[4,Validator.create("deleteRemoteMessage").check((function(t){return validateConversation(t,e,ConversationTypes.INCLUDE_UG)})).isLimitedTypedArray("messages",t,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,r=e.sentTime,n=e.messageDirection;return notEmptyString(t)&&(n===exports.MessageDirection.SEND||n===exports.MessageDirection.RECEIVE)&&isInteger({min:0})(r)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=__classPrivateFieldGet(i,_APIContext_instances,"m",_APIContext_convertConversationOption).call(i,e);return i._engine.chat.deleteRemoteMessage(r,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_DEL_REMOTE_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_DEL_REMOTE_MSGS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,Validator.create("deleteRemoteMessageByTimestamp").check((function(t){return validateConversation(t,e,ConversationTypes.INCLUDE_UG_CHATROOM)})).isInteger("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var r=__classPrivateFieldGet(i,_APIContext_instances,"m",_APIContext_convertConversationOption).call(i,e);return i._engine.chat.deleteRemoteMessageByTimestamp(r,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_DEL_REMOTE_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return __awaiter(this,void 0,void 0,(function(){var a=this;return __generator(this,(function(s){return[2,Validator.create("getFileToken").isValueOf("fileType",e,exports.FileType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).validate("httpMethod",r,(function(e){return"POST"===e||"PUT"===e})).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`httpMethod` is invalid").isString("queryString",n).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`queryString` is invalid").isString("url",i).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`url` is invalid").isInteger("size",o).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`size` is invalid").result().tryTrans(this.validateConnected).next((function(s){return __awaiter(a,void 0,void 0,(function(){var a,u;return __generator(this,(function(l){switch(l.label){case 0:return a=s.uploadServer||"",u=s.ossConfig||"",[4,this._engine.getFileToken(e,t,r,n,i,o)];case 1:return[2,l.sent().trans((function(e){return Object.assign(e,{qiniu:a,ossConfig:e.ossConfig||u})}))]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i=this;return __generator(this,(function(o){switch(o.label){case 0:return[4,Validator.create("getFileUrl").isValueOf("fileType",e,exports.FileType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).isString("saveName",n).fail(exports.ErrorCode.INVALID_PARAMETER_SAVE_NAME).isValueOf("serverType",r,exports.UploadMethod,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SERVER_TYPE).result().tryTrans(this.validateConnected).next((function(){return i._engine.getFileUrl(e,r,t,n||"")}))];case 1:return[2,o.sent()]}}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,Validator.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.createTag(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_ADD_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t),[4,Validator.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeTag(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_REMOVE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,Validator.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.updateTag(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_UPDATE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_TAGS_T,"",e),[4,this.validateLogin().next((function(){return r._engine.getTagList()}))];case 1:return t=n.sent(),this.logger.summary(Log.A_GET_TAGS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return(r=Validator.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",t,(function(e){return createConversationValidator("",e,ConversationTypes.BASE).result().isOk}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==t?void 0:t.length,1,1e3,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return __classPrivateFieldGet(a,_APIContext_instances,"m",_APIContext_convertConversationOption).call(a,e)})),i=this.logger.createTraceId(),this.logger.info(Log.A_ADD_TAG_FOR_CONVERSATIONS_T,JSON.stringify({tagId:e,conversations:n}),i),[4,this._engine.chat.addTagForConversations(e,n)]):[2,r.wipe()];case 1:return o=s.sent(),this.logger.summary(Log.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 __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return(r=Validator.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",t,1e3,(function(e){return createConversationValidator("",e,ConversationTypes.BASE).result().isOk}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return __classPrivateFieldGet(a,_APIContext_instances,"m",_APIContext_convertConversationOption).call(a,e)})),i=this.logger.createTraceId(),this.logger.info(Log.A_REMOVE_TAG_FOR_CONVERS_T,JSON.stringify({tagId:e,conversations:n}),i),[4,this._engine.chat.removeTagForConversations(e,n)]):[2,r.wipe()];case 1:return o=s.sent(),this.logger.summary(Log.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 __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return(r=createConversationValidator("removeTagsForConversation",e,ConversationTypes.BASE).isTypedArray("tagIds",t,(function(e){return isString(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected)).isOk?(n=this.logger.createTraceId(),i=__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_convertConversationOption).call(this,e),this.logger.info(Log.A_REMOVE_TAGS_FOR_CONVER_T,JSON.stringify({tagIds:t,conversation:i}),n),[4,this._engine.chat.removeTagsForConversation(i,t)]):[2,r.wipe()];case 1:return o=a.sent(),this.logger.summary(Log.A_REMOVE_TAGS_FOR_CONVER_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){return(n=Validator.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isInteger("count",r,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",t,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).result().tryTrans((function(){return o.checkAuthed(usingCppEngine())}))).isOk?(i=r<=0?20:Math.min(r,1e3),[2,this._engine.chat.getConversationListByTag(e,t,i)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:t}),r),[4,Validator.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.getUnreadCountByTag(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_GET_UNREAD_COUNT_BY_TAG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return(n=createConversationValidator("setConversationStatusInTag",t,ConversationTypes.BASE).isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==r?void 0:r.isTop,!0).fail(exports.ErrorCode.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),o=__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_convertConversationOption).call(this,t),this.logger.info(Log.A_SET_CONVER_TO_TOP_IN_TAG_T,JSON.stringify({tagId:e,conversation:o,isTop:r.isTop}),i),[4,this._engine.chat.setConversationStatusInTag(e,o,r)]):[2,n.wipe()];case 1:return a=s.sent(),this.logger.summary(Log.A_SET_CONVER_TO_TOP_IN_TAG_R,a,i),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return(t=createConversationValidator("getTagsForConversation",e,ConversationTypes.BASE).result().tryTrans(this.validateLogin)).isOk?(r=this.logger.createTraceId(),n=__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_convertConversationOption).call(this,e),this.logger.info(Log.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(n),r),[4,this._engine.chat.getTagsForConversation(n)]):[2,t.wipe()];case 1:return i=o.sent(),this.logger.summary(Log.A_GET_TAGS_OF_CONVERSATION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_UNREAD_MENTIONED_COUNT_T,JSON.stringify(e),t),[4,Validator.create("getUnreadMentionedCount").check((function(t){return validateConversation(t,e,ConversationTypes.SG_UG)})).result().tryTrans(this.validateLogin).next((function(){return __awaiter(n,void 0,void 0,(function(){var t;return __generator(this,(function(r){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(t=__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_convertConversationOption).call(this,e),[2,this._engine.chat.getUnreadMentionedCount(t)]):[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_UNREAD_MENTIONED_COUNT_R,r,t),[2,r.trans(correctUnreadCount)]}}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_ALL_UNREAD_MENTIONED_COUNT_T,"",e),[4,this.validateLogin().next((function(){return r._engine.chat.getAllUnreadMentionedCount()}))];case 1:return t=n.sent(),this.logger.summary(Log.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 __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,u=this;return __generator(this,(function(l){switch(l.label){case 0:return r=this.logger.createTraceId(),n=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,a=null==e?void 0:e.channelId,this.logger.info(Log.A_GET_UG_MSGS_BY_UID_T,JSON.stringify({conversationType:i,targetId:o,channelId:a,messageUIds:n}),r),[4,Validator.create("getUltraGroupMessageListByMessageUId").check((function(t){return validateConversation(t,e,ConversationTypes.INCLUDE_UG)})).isTypedArray("messages",t,(function(e){return notEmptyString(null==e?void 0:e.messageUId)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messages",null==t?void 0:t.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=__classPrivateFieldGet(u,_APIContext_instances,"m",_APIContext_convertConversationOption).call(u,e);return u._engine.chat.getRemoteMessagesByUIds(r,t.map((function(e){return e.messageUId})))}))];case 1:return s=l.sent(),this.logger.summary(Log.A_GET_UG_MSGS_BY_UID_R,s,r,s.isOk?{list:s.data.map((function(e){return e.messageUId}))}:void 0),[2,s.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,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T,JSON.stringify({targetId:e,levels:r,isGetMentioned:t}),n),[4,Validator.create("getUGUnreadCountForAllChannels").validate("targetId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((function(e){e.isTypedArray("levels",r,(function(t){return!e.isValueOf("",t,exports.NotificationLevel,!0).isFailed}))})).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(n){return this._ugSynced?[2,this._engine.chat.getUGUnreadCountForAllChannels(e,r||[],t)]:[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=a.sent(),this.logger.summary(Log.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a,s=this;return __generator(this,(function(u){switch(u.label){case 0:return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelId,n=null==e?void 0:e.sentTime,i=null==e?void 0:e.count,o=this.logger.createTraceId(),this.logger.info(Log.A_GET_UG_UNREAD_MENTIONED_DIGEST_T,JSON.stringify({targetId:t,channelId:r,sentTime:n,count:i}),o),[4,Validator.create("getUGUnreadMentionedDigest").validate("targetId",t,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedInteger("count",i,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("sentTime",n,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return e.channelId=s._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r),s._engine.chat.getUGUnreadMentionedDigest(e)}))];case 1:return a=u.sent(),this.logger.summary(Log.A_GET_UG_UNREAD_MENTIONED_DIGEST_R,a,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,Validator.create("getUGFirstUnreadMessageDigest").validate("targetId",null==e?void 0:e.targetId,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==e?void 0:e.channelId,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){return __awaiter(n,void 0,void 0,(function(){var t;return __generator(this,(function(r){return this._ugSynced?(t=__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_convertConversationOption).call(this,__assign(__assign({},e),{conversationType:exports.ConversationType.ULTRA_GROUP})),[2,this._engine.chat.getUGFirstUnreadMessageDigest(t)]):[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_UG_UNREAD_INFO_LIST_T,JSON.stringify({targetIds:e}),t),[4,Validator.create("getUGUnreadInfoList").isLimitedTypedArray("targetIds",e,20,(function(e){return isValidTargetId(e)}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateLogin).next((function(){return __awaiter(n,void 0,void 0,(function(){var t;return __generator(this,(function(r){return this._ugSynced?(t=new Set(e),[2,this._engine.chat.getUGUnreadInfoList(Array.from(t))]):[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_UG_UNREAD_INFO_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return this.validateConnected().next((function(){return n._engine.setCallInfo(e,t,r)}))}}),Object.defineProperty(e.prototype,"_validateSubDriven",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.subDriven,n=void 0===r?0:r;switch(t){case exports.SubscribeType.ONLINE_STATUS:return 1&n?ok(e):fail(exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);case exports.SubscribeType.USER_PROFILE:return 2&n?ok(e):fail(exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);default:return fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE)}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_SUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t,expiry:r}),n),[4,Validator.create("subscribeUser").isLimitedTypedArray("userIds",e,200,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isValueOf("subscribeType",t,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("expiry",r,60,2592e3,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_EXPIRY).result().tryTrans(this.validateConnected).tryTrans((function(e){return o._validateSubDriven(e,t)})).next((function(){return o._engine.subscribeUser(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_SUBSCRIBE_USER_STATUS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_UNSUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t}),r),[4,Validator.create("unSubscribeUser").isLimitedTypedArray("userIds",e,200,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isValueOf("subscribeType",t,exports.SubscribeType,!0).fail(exports.ErrorCode.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 n=o.sent(),this.logger.summary(Log.A_UNSUBSCRIBE_USER_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_GET_SUBSCRIBE_USER_STATUS_LIST_T,JSON.stringify({subscribeType:e,count:t,offset:r}),n),[4,Validator.create("getSubscribeUserList").isValueOf("subscribeType",e,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("count",t,1,200,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE).isLimitedInteger("offset",r,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).result().tryTrans(this.validateConnected).tryTrans((function(t){return o._validateSubDriven(t,e)})).next((function(){return o._engine.getSubscribeUserList(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_GET_SUBSCRIBE_USER_STATUS_LIST_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_GET_SUB_USERS_STATUS_T,JSON.stringify({subscribeType:e,userIds:t}),r),[4,Validator.create("getSubscribeUserStatus").isValueOf("subscribeType",e,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedTypedArray("userIds",t,200,isValidTargetId,!0).fail(exports.ErrorCode.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 n=o.sent(),this.logger.summary(Log.A_GET_SUB_USERS_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_SUB_USERS_ONLINE_STATUS_T,JSON.stringify({userIds:e}),t),[4,Validator.create("getSubscribeUsersOnlineStatus").isLimitedTypedArray("userIds",e,200,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){return n._engine.getSubscribeUsersOnlineStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_SUB_USERS_ONLINE_STATUS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_UPDATE_MY_USER_PROFILE_T,JSON.stringify({profile:e}),t),[4,Validator.create("updateMyUserProfile").isObject("profile",e,!0).check((function(t){var r=e.name,n=e.portraitUri,i=e.email,o=e.birthday,a=e.gender,s=e.location,u=e.role,l=e.level,c=e.extraProfile;t.isString("name",r).isString("portraitUri",n).isString("email",i).isString("birthday",o).isNumber("gender",a).isString("location",s).isNumber("role",u).isNumber("level",l).isObject("extraProfile",c),!t.isFailed&&c&&Object.entries(c).forEach((function(e){var r=__read(e,2);r[0];var n=r[1];t.isString("extraProfile",n,!0)}))})).fail(exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE).result().tryTrans(this.validateConnected).tryTrans((function(e){return n._validateUserProfile(e)})).next((function(){var t={};return["name","portraitUri","email","birthday","gender","location","role","level"].forEach((function(r){var n=e[r];void 0!==n&&(t[r]=n)})),e.extraProfile&&(t.extraProfile=__assign({},e.extraProfile)),n._engine.updateMyUserProfile(t)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_UPDATE_MY_USER_PROFILE_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_USER_PROFILES_T,JSON.stringify({userIds:e}),t),[4,Validator.create("getUserProfiles").isLimitedTypedArray("userIds",e,100,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateLogin).tryTrans((function(e){return n._validateUserProfile(e)})).next((function(){return n._engine.getUserProfiles(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_USER_PROFILES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_MY_USER_PROFILE_T,void 0,e),[4,Validator.create("getMyUserProfile").result().tryTrans(this.validateConnected).tryTrans((function(e){return r._validateUserProfile(e)})).next((function(){return r._engine.getMyUserProfile()}))];case 1:return t=n.sent(),this.logger.summary(Log.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 __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,this._engine.chat.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){r.logger.error(Log.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_ADD_TO_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,Validator.create("addToBlacklist").validate("userId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.addToBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_ADD_TO_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_REMOVE_FROM_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,Validator.create("removeFromBlacklist").validate("userId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeFromBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_REMOVE_FROM_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_BLACKLIST_T,void 0,e),[4,Validator.create("getBlacklist").result().tryTrans(this.validateConnected).next((function(){return r._engine.getBlacklist()}))];case 1:return t=n.sent(),this.logger.summary(Log.A_GET_BLACKLIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_BLACKLIST_STATUS_T,JSON.stringify({userId:e}),t),[4,Validator.create("getBlacklistStatus").validate("userId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.getBlacklistStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_BLACKLIST_STATUS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_INSERT_MSG_T,JSON.stringify({conversation:e,params:t}),r),[4,Validator.create("insertMessage").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).validate("senderUserId",t.senderUserId,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isNotEmptyString("messageType",t.messageType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isValueOf("messageDirection",t.messageDirection,exports.MessageDirection,!0).fail(exports.ErrorCode.INVALID_MESSAGE_DIRECTION).check((function(e){t.canIncludeExpansion&&t.expansion&&validateMessageExpansion(e,t.expansion,!0)})).isTimestamp("sentTime",t.sentTime).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isValueOf("sentStatus",t.sentStatus,exports.SentStatus).fail(exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS).isTypedArray("directedUserIds",t.directedUserIds,isValidTargetId).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isString("searchContent",t.searchContent).fail(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR).result().tryTrans((function(){return validateMessageSearchProps(t.messageType,t.content)})).tryTrans(this.validateLogin).next((function(){var r=__classPrivateFieldGet(i,_APIContext_instances,"m",_APIContext_convertConversationOption).call(i,e);return i._engine.insertMessage(r,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_INSERT_MSG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_BATCH_INSERT_MSGS_T,JSON.stringify({count:null==e?void 0:e.length,checkDuplicate:t}),r),n=Validator.create(""),[4,Validator.create("batchInsertMessage").isLimitedTypedArray("messages",e,500,(function(e){return"object"==typeof e&&(validateConversation(n,e,ConversationTypes.ANY),n.validate("senderUserId",e.senderUserId,isValidTargetId,!0).isNotEmptyString("messageType",e.messageType,!0).isObject("content",e.content,!0).isValueOf("messageDirection",e.messageDirection,exports.MessageDirection,!0).check((function(t){e.canIncludeExpansion&&e.expansion&&validateMessageExpansion(t,e.expansion,!0)})).isTimestamp("sentTime",e.sentTime).isValueOf("sentStatus",e.sentStatus,exports.SentStatus).isString("searchContent",e.searchContent).isNumber("receivedStatus",e.receivedStatus).isObject("receivedStatusInfo",e.receivedStatusInfo).isTypedArray("directedUserIds",e.directedUserIds,isValidTargetId),!n.isFailed)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateLogin).next((function(){var r=e.map((function(e){return __assign(__assign({},e),{channelId:o._channelIdConvert(e.conversationType,e.channelId)})}));return o._engine.batchInsertMessage(r,t)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_BATCH_INSERT_MSGS_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_LOCAL_MSG_COUNT_T,JSON.stringify({conversation:e}),t),[4,Validator.create("getMessageCount").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).result().tryTrans(this.validateLogin).next((function(){var t=__classPrivateFieldGet(n,_APIContext_instances,"m",_APIContext_convertConversationOption).call(n,e);return n._engine.getLocalMessageCount(t)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_LOCAL_MSG_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_DELETE_LOCAL_MSGS_T,JSON.stringify({messageIds:e}),t),[4,Validator.create("deleteLocalMessages").isTypedArray("messageIds",e,(function(e){return Number.isInteger(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY).result().tryTrans(this.validateLogin).next((function(){return n._engine.deleteLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_DELETE_LOCAL_MSGS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_DEL_LOCAL_MSGS_BY_TIME_T,JSON.stringify({conversation:e,timestamp:t,cleanSpace:r}),n),[4,Validator.create("deleteLocalMessagesByTimestamp").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).isTimestamp("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){var n=__classPrivateFieldGet(o,_APIContext_instances,"m",_APIContext_convertConversationOption).call(o,e);return o._engine.deleteLocalMessagesByTimestamp(n,t,!!r)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_DEL_LOCAL_MSGS_BY_TIME_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T,JSON.stringify({options:e}),t),[4,Validator.create("batchClearLocalMessagesByTimestamp").check((function(t){t.isLimitedTypedArray("options",e,20,(function(e){return validateConversation(t,e,ConversationTypes.INCLUDE_UG),!t.isFailed&&isInteger({min:0})(e.timestamp)})).fail(exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return __assign(__assign({},e),{channelId:n._channelIdConvert(e.conversationType,e.channelId)})}));return n._engine.batchClearLocalMessagesByTimestamp(t)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),r),[4,Validator.create("batchClearRemoteHistoryMessages").isLimitedArray("options",e,20,!0,1).check((function(t){e.forEach((function(e){validateConversation(t,e,ConversationTypes.INCLUDE_UG).isTimestamp("timestamp",null==e?void 0:e.timestamp)}))})).fail(exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,void 0,!0).check((function(t){e.some((function(e){return e.conversationType===exports.ConversationType.ULTRA_GROUP}))&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.batchClearRemoteHistoryMessages(e,!!t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_BATCH_CLEAR_REMOTE_MSG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_CLEAR_LOCAL_MSG_T,JSON.stringify({conversation:e}),t),[4,Validator.create("clearLocalMessages").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).result().tryTrans(this.validateLogin).next((function(){return n._engine.clearLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_CLEAR_LOCAL_MSG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),t),[4,Validator.create("getLocalMessage").validate("messageId",e,(function(){return notEmptyString(e)||isNumber(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result().next((function(){return n._engine.getMessage(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_LOCAL_MESSAGE_R,r,t,{messageId:e}),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"_innerSetMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this._engine.setMessageContent(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_SET_MSG_CONTENT_T,JSON.stringify({messageId:e,messageType:r}),n),[4,Validator.create("setMessageContent").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isNotEmptyString("messageType",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).result().tryTrans(this.validateLogin).next((function(){var n=JSON.stringify(t);return o._innerSetMessageContent(e,n,r)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_SET_MSG_CONTENT_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this._engine.setMessageSearchField(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_E_SET_MSG_SENT_STATUS_T,JSON.stringify({messageId:e,sentStatus:t}),r),[4,Validator.create("setMessageSentStatus").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isValueOf("sentStatus",t,exports.SentStatus,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageSentStatus(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_E_SET_MSG_SENT_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_E_SET_MSG_RECEIVED_STATUS_T,JSON.stringify({messageId:e,receivedStatus:t}),r),[4,Validator.create("setMessageReceivedStatus").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isInteger("receivedStatus",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageReceivedStatus(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_E_SET_MSG_RECEIVED_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageStatusToRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s;return __generator(this,(function(u){switch(u.label){case 0:return(r=createConversationValidator("setMessageStatusToRead",e,ConversationTypes.BASE).isNumber("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(n=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,a=e.channelId,this.logger.info(Log.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),n),[4,this._engine.updateMessageReceiptStatus(i,o,t,a)]):[2,r.wipe()];case 1:return s=u.sent(),this.logger.summary(Log.A_E_SET_MESSAGE_STATUS_TO_READ_R,s,n),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return(i=Validator.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return notEmptyString(e)})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",r,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",n,(function(e){return isInConversationTypeList(e,ConversationTypes.INCLUDE_UG)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(Log.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:t,channelId:r,conversationTypes:n}),o),[4,this._engine.chat.searchConversationByContent(e,t&&0!==t.length?t:[MessageType.TEXT,MessageType.FILE],r||"",n&&0!==n.length?n:getConversationTypes(ConversationTypes.INCLUDE_UG))]):[2,i.wipe()];case 1:return a=s.sent(),this.logger.summary(Log.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[MessageType.TEXT,MessageType.FILE],r&&0!==r.length?r:getConversationTypes(ConversationTypes.INCLUDE_UG))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;return __awaiter(this,void 0,void 0,(function(){var i,o;return __generator(this,(function(a){switch(a.label){case 0:return(i=createConversationValidator("searchMessages",e,ConversationTypes.ANY).isLimitedString("keyword",null==t?void 0:t.keyword,0,1e3,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==t?void 0:t.limit,1,MAX_U32_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==t?void 0:t.offset,0,MAX_U32_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==t?void 0:t.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",t.timeRange).validate("timeRange",t.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!isNumber(t)||r&&!isNumber(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(r=null==t?void 0:t.messageFilter)||void 0===r?void 0:r.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(n=null==t?void 0:t.messageFilter)||void 0===n?void 0:n.senderIds,isValidTargetId).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(onlyElectron()).tryTrans(this.validateLogin)).isOk?(o=__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_convertConversationOption).call(this,e),[4,__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_searchMessagesWithParams).call(this,__assign(__assign({},t),{conversationFilter:{conversationTypes:[o.conversationType],targetIds:[o.targetId],channelIds:"string"==typeof o.channelId?[o.channelId]:[]}}))]):[2,i.wipe()];case 1:return[2,a.sent().orSync((function(){return ok({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o,a;return __awaiter(this,void 0,void 0,(function(){var s;return __generator(this,(function(u){return(s=Validator.create("searchMessagesWithParams").isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,MAX_U32_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,MAX_U32_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",null==e?void 0:e.timeRange).validate("timeRange",null==e?void 0:e.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!isNumber(t)||r&&!isNumber(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(t=null==e?void 0:e.conversationFilter)||void 0===t?void 0:t.conversationTypes,(function(e){return isInConversationTypeList(e,ConversationTypes.ANY)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.targetIds,20,isValidTargetId,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.channelIds,10,isValidChannelId,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(i=null==e?void 0:e.messageFilter)||void 0===i?void 0:i.senderIds,20,isValidTargetId,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(o=null==e?void 0:e.messageFilter)||void 0===o?void 0:o.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin)).isOk?(e.limit=Math.min(e.limit,100),(null===(a=e.messageFilter)||void 0===a?void 0:a.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),[2,__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_searchMessagesWithParams).call(this,e)]):[2,s.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(Log.A_GET_MSGS_AROUND_TIMESTAMP_T,JSON.stringify({conversation:e,timestamp:t,beforeCount:r,afterCount:n}),i),[4,Validator.create("getMessagesAroundTimestamp").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).isLimitedInteger("timestamp",t,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("beforeCount",r,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_BEFORE).isLimitedInteger("afterCount",n,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_AFTER).result().tryTrans(this.validateLogin).next((function(){var i=__classPrivateFieldGet(a,_APIContext_instances,"m",_APIContext_convertConversationOption).call(a,e);return a._engine.chat.getMessagesAroundTimestamp(i,t,r,n)}))];case 1:return o=s.sent(),this.logger.summary(Log.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 __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_UNREAD_MENTIONED_MSGS_T,JSON.stringify(e),t),[4,Validator.create("getUnreadMentionedMessages").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).result().tryTrans(this.validateLogin).next((function(){var t=__classPrivateFieldGet(n,_APIContext_instances,"m",_APIContext_convertConversationOption).call(n,e);return n._engine.chat.getUnreadMentionedMessages(t)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_UNREAD_MENTIONED_MSGS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_GET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,channelId:t}),r),[4,Validator.create("getUltraGroupDefaultNotificationLevel").validate("targetId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",t,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){var r="string"==typeof t?i._channelIdConvert(exports.ConversationType.ULTRA_GROUP,t):t;return i._engine.chat.getUGDefaultNotificationLevel(e,r)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_GET_UG_DEFAULT_NTF_LEVEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_SET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,notificationLevel:t,channelId:r}),n),[4,Validator.create("setUltraGroupDefaultNotificationLevel").validate("targetId",e,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,isValidChannelId).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isValueOf("notificationLevel",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var n="string"==typeof r?o._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r):r;return o._engine.chat.setUGDefaultNotificationLevel(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_SET_UG_DEFAULT_NTF_LEVEL_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){return(t=createConversationValidator("getConversationNotificationLevel",e,ConversationTypes.INCLUDE_UG).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_convertConversationOption).call(this,e))]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){return(r=Validator.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return isInConversationTypeList(e,ConversationTypes.INCLUDE_UG)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).isValueOf("level",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.setConversationTypeNotificationLevel(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){return(t=Validator.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return isInConversationTypeList(e,ConversationTypes.INCLUDE_UG)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.getConversationTypeNotificationLevel(e)]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s=this;return __generator(this,(function(u){switch(u.label){case 0:return r=null==t?void 0:t.timestamp,n=null==t?void 0:t.count,i=null==t?void 0:t.order,o=this.logger.createTraceId(),this.logger.info(Log.A_GET_REMOTE_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),o),[4,Validator.create("getRemoteHistoryMessages").check((function(t){return validateConversation(t,e,ConversationTypes.INCLUDE_UG_CHATROOM)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:""},o=__classPrivateFieldGet(s,_APIContext_instances,"m",_APIContext_convertConversationOption).call(s,e);return s._engine.getHistoryMessage(o,t,!1)}))];case 1:return a=u.sent(),this.logger.summary(Log.A_GET_REMOTE_HISTORY_MSG_R,a,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(Log.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 __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_CONVERSATIONS_T,JSON.stringify({identifiers:e}),t),[4,Validator.create("getConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,100,(function(e){return!validateConversation(t,e,ConversationTypes.ANY).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return __classPrivateFieldGet(n,_APIContext_instances,"m",_APIContext_convertConversationOption).call(n,e)}));return n._engine.chat.getConversations(t)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_CONVERSATIONS_R,r,t),[2,r]}}))}))}}),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,r,n){return __awaiter(this,void 0,void 0,(function(){var i=this;return __generator(this,(function(o){switch(o.label){case 0:return[4,this.validateConnected().next((function(){return i._engine.rtcSignaling(e,t,r,n)}))];case 1:return[2,o.sent()]}}))}))}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.rtcPing(e,t,r)}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_SET_PROXY_T,JSON.stringify({proxy:e}),t),[4,Validator.create("setProxy").check((function(t){return validateProxy(t,e)})).result().next((function(){return n._engine.setProxy(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_SET_PROXY_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_PROXY_T,JSON.stringify({}),e),[4,this._engine.getProxy()];case 1:return t=r.sent(),this.logger.summary(Log.A_GET_PROXY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_TEST_PROXY_T,JSON.stringify({proxy:e,testHost:t}),r),[4,Validator.create("testProxy").check((function(t){return validateProxy(t,e)})).isString("testHost",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TESTHOST).result().next((function(){return i._engine.testProxy(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_TEST_PROXY_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_GET_REALTIME_CONVERSATIONS_T,JSON.stringify({count:e,startTime:t,order:r}),n),[4,Validator.create("getRealtimeConversations").isLimitedInteger("count",e,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isTimestamp("startTime",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",r,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).tryTrans(isEnableRealtimeSession).next((function(){return o._engine.chat.getRealtimeConversations(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_GET_REALTIME_CONVERSATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T,"",e),[4,this.validateConnected().tryTrans(isEnableRealtimeSession).next((function(){return r._engine.chat.getRealtimeConTotalUnreadCount()}))];case 1:return t=n.sent(),this.logger.summary(Log.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 __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_CLEAR_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,this.validateConnected().tryTrans(isEnableRealtimeSession).next((function(){return n._engine.chat.clearRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_CLEAR_REALTIME_CON_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_REMOVE_REALTIME_CONVERSATIONS_T,JSON.stringify(e),t),[4,Validator.create("removeRealtimeConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,20,(function(e){return!validateConversation(t,e,ConversationTypes.ANY).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(isEnableRealtimeSession).next((function(){return n._engine.chat.removeRealtimeConversations(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_REMOVE_REALTIME_CONVERSATIONS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,Validator.create("batchGetRealtimeConUnreadCount").check((function(t){t.isLimitedTypedArray("identifiers",e,10,(function(e){return!validateConversation(t,e,ConversationTypes.ANY).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(isEnableRealtimeSession).next((function(){return n._engine.chat.batchGetRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return Validator.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SPAN_MINUTES).isValueOf("level",e.level,exports.PushNotificationQuietHoursLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.removeNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getStatsUrlList()}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){return(r=createConversationValidator("sendReadReceiptResponseV5",e,ConversationTypes.SG).isTypedArray("messageUIdArray",t,(function(e){return isValidTargetId(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ok():fail(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.sendReadReceiptResponseV5(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){return(r=createConversationValidator("getMessageReadReceiptInfoV5",e,ConversationTypes.SG).isTypedArray("messageUIdArray",t,(function(e){return isValidTargetId(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ok():fail(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?(n=t.map((function(t){return{identifier:e,messageUId:t}})),[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(n)]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){return t=Validator.create(""),(r=Validator.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(function(e){return validateConversation(t,e.identifier,ConversationTypes.SG).isNotEmptyString("messageUId",e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().isOk}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ok():fail(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(e)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){return(n=createConversationValidator("getMessageReadReceiptInfoV5",e,ConversationTypes.SG).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("option",r,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",r.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",r.pageCount,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ok():fail(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?(r.order=1!==r.order?0:1,r.readStatus=1!==r.readStatus?0:1,[2,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,t,r)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){return(n=createConversationValidator("getMessagesReadReceiptByUsersV5",e,ConversationTypes.SG).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",r,(function(e){return isValidTargetId(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",r.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ok():fail(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessagesReadReceiptByUsersV5(e,t,r)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:t}),r),[4,Validator.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((function(e){return!!(1&(e.AIBusinessSub||0))?ok():fail(exports.ErrorCode.SPEECH_TO_TEXT_DISABLE)})).next((function(){return i._engine.chat.requestSpeechToTextForMessage(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,Validator.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result().tryTrans(this.validateLogin).next((function(){return r._engine.chat.setMessageSpeechToTextVisible(e,!!t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(Log.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:t,topPriority:r}),n),[4,Validator.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isInteger("count",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateLogin).next((function(){var n=t<=0?20:Math.min(t,100);return o._engine.chat.getUntaggedConversationListByPage(e,n,!!r)}))];case 1:return i=a.sent(),this.logger.summary(Log.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"translateMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return r=usingCppEngine(),[4,Validator.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof TranslateMessageParam&&e.isValid(!r)}),!0).fail(exports.ErrorCode.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(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isValueOf("mode",null==e?void 0:e.mode,TranslateMode).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(n=s.sent()).isOk?(i=e.list,o=e.force,a=e.mode,[2,__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_translateWithParams).call(this,i,0,a,o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"translateTextsWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return[4,Validator.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof TranslateTextParam&&e.isValid(!0)}),!0).fail(exports.ErrorCode.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(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isValueOf("mode",null==e?void 0:e.mode,TranslateMode).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(r=o.sent()).isOk?(n=e.list,i=e.mode,[2,__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_translateWithParams).call(this,n,1,i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t),[4,Validator.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((function(){return n._engine.userSettings.setTranslationLanguage(e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_SET_TRANSLATION_LANGUAGE_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_TRANSLATION_LANGUAGE_T,void 0,e),[4,this.validateLogin().next((function(){return r._engine.userSettings.getTranslationLanguage()}))];case 1:return t=n.sent(),this.logger.summary(Log.A_GET_TRANSLATION_LANGUAGE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_SET_AUTO_TRANSLATE_ENABLED_T,JSON.stringify({enabled:!!e}),t),[4,this.validateConnected().next((function(){return n._engine.userSettings.setAutoTranslateEnabled(!!e)}))];case 1:return r=i.sent(),this.logger.summary(Log.A_SET_AUTO_TRANSLATE_ENABLED_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_GET_AUTO_TRANSLATE_ENABLED_T,void 0,e),[4,this.validateLogin().next((function(){return r._engine.userSettings.getAutoTranslateEnabled()}))];case 1:return t=n.sent(),this.logger.summary(Log.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 __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUId,n=null==e?void 0:e.messageContent,this.logger.info(Log.A_MODIFY_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUId:r,conversation:null==e?void 0:e.conversation}),t),[4,Validator.create("modifyMessageWithParams").check((function(t){return validateConversation(t,null==e?void 0:e.conversation,ConversationTypes.SG_UG)})).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("messageContent",n,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isLimitedInteger("messageContent",getByteLength(JSON.stringify(n)),1,MAX_MESSAGE_CONTENT_BYTES,!0).fail(exports.ErrorCode.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(Log.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 __awaiter(this,void 0,void 0,(function(){var t,r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUIds,this.logger.info(Log.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUIds:r}),t),[4,createConversationValidator("refreshReferenceMessageWithParams",null==e?void 0:e.conversationIdentifier,ConversationTypes.SG_UG).isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isTypedArray("messageUIds",r,(function(e){return notEmptyString(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==r?void 0:r.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.refreshReferenceMessageWithParams(r,e.conversationIdentifier,e.remoteMessageBlock,e.localMessageBlock,e.messageInfoMap)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r=this;return __generator(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(Log.A_SYNC_REMOTE_CONVERSATIONS_T,void 0,e),[4,this.validateConnected().next((function(){return r._engine.chat.syncRemoteConversations()}))];case 1:return t=n.sent(),this.logger.summary(Log.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 __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(Log.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T,JSON.stringify({targetId:e,timestamp:t}),r),[4,Validator.create("deleteLocalUGMessagesForAllChannel").isNotEmptyString("targetId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTimestamp("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.deleteLocalUGMessagesForAllChannel(e,t)}))];case 1:return n=o.sent(),this.logger.summary(Log.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(Log.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T,JSON.stringify({params:e}),t),[4,Validator.create("getUnreadMentionMeConversationList").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,Number.MAX_SAFE_INTEGER,(function(e){return isInConversationTypeList(e,ConversationTypes.INCLUDE_UG)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(t){return __awaiter(n,void 0,void 0,(function(){var r;return __generator(this,(function(n){if(r=includeUg(t)){if(!this._ugSynced)return[2,fail(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}else if(e.conversationTypes=e.conversationTypes.filter((function(e){return e!==exports.ConversationType.ULTRA_GROUP})),0===e.conversationTypes.length)return[2,ok([])];return[2,this._engine.chat.getUnreadMentionMeConversationList(e,r)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(Log.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),e}();_APIContext_instances=new WeakSet,_APIContext_connect=function(e,t,r){var n,i;return __awaiter(this,void 0,void 0,(function(){var o,a,s=this;return __generator(this,(function(u){switch(u.label){case 0:return[4,Validator.create("connect").isNotEmptyString("token",e).fail(exports.ErrorCode.RC_CONN_TOKEN_INCORRECT).result().next((function(){return __awaiter(s,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){switch(o.label){case 0:return this._token=e,[4,runtime.getNetworkType()];case 1:return n=o.sent(),this._engine.setNetwork({status:!0,type:n},!0),i=!!this._pluginInstanseMap.RCCallPlus,[2,this._engine.connect(e,t,i,r)]}}))}))}))];case 1:return(o=u.sent()).isOk&&1!==this._engine.naviInfo.type&&(a=VersionManage.getInfo(),null===(i=(n=this._engine).reportSDKInfo)||void 0===i||i.call(n,a)),[2,o]}}))}))},_APIContext_disconnect=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return n.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){r.logger.error(Log.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},_APIContext_convertConversationOption=function(e){return __assign(__assign({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})},_APIContext_handleSendMessage=function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i=this;return __generator(this,(function(o){switch(o.label){case 0:return[4,Validator.create("sendMessage").check((function(t){return validateConversation(t,e,ConversationTypes.ANY)})).isObject("content",t.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isString("messageType",t.messageType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){var r=validateMessageSearchProps(t.messageType,t.content);r.isOk||e.setFailed(r.code)})).isNumber("messageId",t.messageId).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isBoolean("isStatusMessage",t.isStatusMessage).fail(exports.ErrorCode.INVALID_PARAMETER_IS_STATUS_MESSAGE).isBoolean("disableNotification",t.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isString("pushContent",t.pushContent).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONTENT).isString("pushData",t.pushData).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_DATA).isObject("pushConfig",t.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("isVoipPush",t.isVoipPush).fail(exports.ErrorCode.INVALID_PARAMETER_IS_VOIP_PUSH).isBoolean("canIncludeExpansion",t.canIncludeExpansion).fail(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION).check((function(e){t.canIncludeExpansion&&t.expansion&&validateMessageExpansion(e,t.expansion,!0)})).check((function(r){r.isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE),r.isFailed||e.conversationType===exports.ConversationType.ULTRA_GROUP&&t.disableUpdateLastMessage&&r.setFailed(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE)})).check((function(r){if(!r.isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,isValidTargetId,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isFailed&&t.directionalUserIdList&&0!==t.directionalUserIdList.length){var n=e.conversationType;[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE].includes(n)||r.setFailed(exports.ErrorCode.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE)}})).isBoolean("isMentioned",t.isMentioned).fail(exports.ErrorCode.INVALID_PARAMETER_IS_MENTIONED).check((function(r){var n=e.conversationType;if(!t.isMentioned||n!==exports.ConversationType.GROUP&&n!==exports.ConversationType.ULTRA_GROUP)delete t.content.mentionedInfo;else{var i=t.content.mentionedInfo||{type:t.mentionedType,userIdList:t.mentionedUserIdList};!r.isValueOf("mentionedType",null==i?void 0:i.type,exports.MentionedType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MENTIONED_TYPE).isTypedArray("mentionedUserIdList",null==i?void 0:i.userIdList,isValidTargetId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isString("mentionedContent",null==i?void 0:i.mentionedContent).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isFailed&&(t.content.mentionedInfo=i)}})).result().tryTrans(this.validateConnected).tryTrans((function(r){if(!t.needReceipt)return ok(r);if(r.grpRRVer!==GroupReadReceiptVersion.V5)return fail(exports.ErrorCode.READ_RECEIPT_ERROR);var n=e.conversationType,i=getMessageTypeDescription(t.messageType),o=i.isPersited,a=i.isStatusMessage;return(n!==exports.ConversationType.GROUP&&n!==exports.ConversationType.PRIVATE||t.isStatusMessage||a||!o||n===exports.ConversationType.GROUP&&t.directionalUserIdList&&t.directionalUserIdList.length>0)&&(t.needReceipt=!1),ok(r)})).tryTrans((function(r){var n=e.conversationType,i=t.messageType;if(n===exports.ConversationType.SYSTEM&&i!==MessageType.SYNC_READ_STATUS)return fail(exports.ErrorCode.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE);if(i===MessageType.STREAM_MESSAGE)return fail(exports.ErrorCode.MESSAGE_NOT_SUPPORT_SENDING);if(i===MessageType.READ_RECEIPT_RESPONSE&&r.grpRRVer)return fail(exports.ErrorCode.READ_RECEIPT_ERROR);var o=JSON.stringify(t.content);return getByteLength(o)>MAX_MESSAGE_CONTENT_BYTES?fail(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT):ok()})).next((function(){return __classPrivateFieldGet(i,_APIContext_instances,"m",_APIContext_sendMessageWithoutValidation).call(i,e,t,r,n)}))];case 1:return[2,o.sent()]}}))}))},_APIContext_sendMessageWithoutValidation=function(e,t,r,n){var i=__classPrivateFieldGet(this,_APIContext_instances,"m",_APIContext_convertConversationOption).call(this,e);return i.conversationType===exports.ConversationType.ULTRA_GROUP?this._engine.sendUltraMessage(i,t,r,n):this._engine.sendMessage(i,t,r,n)},_APIContext_sendExpansionMessage=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,this._engine.sendMessage(e,{content:t,messageType:MessageType.EXPANSION_NOTIFY},r)];case 1:return[2,n.sent().wipe()]}}))}))},_APIContext_searchMessagesWithParams=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return t=e.timeRange||{},r=t.startTime,n=t.endTime,i={startTime:null!=r?r:0,endTime:null!=n?n:Number.MAX_SAFE_INTEGER},e.timeRange=i,o=this.logger.createTraceId(),this.logger.info(Log.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return a=s.sent(),this.logger.summary(Log.A_SEARCH_MSGS_BY_PARAMS_R,a,o),[2,a]}}))}))},_APIContext_translateWithParams=function(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this._engine.translateWithParams(e.map((function(e){return e.toInnerParam()})),r||TranslateMode.MECHANICAL,!!n,t)]}))}))},exports.APIContext=APIContext,exports.AppStorage=AppStorage,exports.BasicEngine=BasicEngine,exports.BasicLogger=BasicLogger,exports.Codec=Codec,exports.EventEmitter=EventEmitter,exports.GroupReadReceiptVersion=GroupReadReceiptVersion,exports.LogDBProxy=LogDBProxy,exports.LogTagId=Log,exports.MAX_MESSAGE_CONTENT_BYTES=MAX_MESSAGE_CONTENT_BYTES,exports.MAX_U32_INTEGER=MAX_U32_INTEGER,exports.MAX_UPLOAD_FILE_SIZE=MAX_UPLOAD_FILE_SIZE,exports.MessageAuditType=MessageAuditType,exports.MessageType=MessageType,exports.PBCodec=Codec$1,exports.PluginContext=PluginContext,exports.RCResult=RCResult,exports.RTCPluginContext=RTCPluginContext,exports.ReferenceMessageStatus=ReferenceMessageStatus,exports.SpeechToTextStatus=SpeechToTextStatus,exports.SuspendablePromise=SuspendablePromise,exports.TranslateMessageParam=TranslateMessageParam,exports.TranslateMode=TranslateMode,exports.TranslateStatus=TranslateStatus,exports.TranslateStrategy=TranslateStrategy,exports.TranslateTextParam=TranslateTextParam,exports.UPLOAD_FILE_CHUNK_SIZE=UPLOAD_FILE_CHUNK_SIZE,exports.UUId=UUId,exports.UserSettingsChangedKey=UserSettingsChangedKey,exports.UserType=UserType,exports.Validator=Validator,exports.VersionManage=VersionManage,exports.assert=assert,exports.createLogDBProxy=createLogDBProxy,exports.fail=fail,exports.fixUrlProtocol=fixUrlProtocol,exports.forEach=forEach,exports.getMessageTypeDescription=getMessageTypeDescription,exports.getUUID=getUUID,exports.getUUID22=getUUID22,exports.hasMessageTypeDescription=hasMessageTypeDescription,exports.httpRequest=httpRequest,exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isFunction=isFunction,exports.isHttpUrl=isHttpUrl,exports.isInteger=isInteger,exports.isLimitedString=isLimitedString,exports.isNull=isNull,exports.isNumber=isNumber,exports.isObject=isObject,exports.isString=isString,exports.isUndefined=isUndefined,exports.isValidConversationType=isValidConversationType,exports.isValidEnum=isValidEnum,exports.isValidFileType=isValidFileType,exports.isValidGroupId=isValidGroupId,exports.isValidTargetId=isValidTargetId,exports.logger=logger,exports.map=map,exports.notEmptyArray=notEmptyArray,exports.notEmptyObject=notEmptyObject,exports.notEmptyString=notEmptyString,exports.ok=ok,exports.promiseWithResolvers=promiseWithResolvers,exports.runtime=runtime,exports.trans2IReceivedStatusInfo=trans2IReceivedStatusInfo,exports.trans2NotificationLevel=trans2NotificationLevel,exports.trans2NotificationStatus=trans2NotificationStatus,exports.transformReceivedStatusFlag=transformReceivedStatusFlag,exports.usingCppEngine=usingCppEngine,exports.validate=validate;
|