@rongcloud/engine 5.12.1 → 5.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +89 -11
- package/index.esm.js +15 -1
- package/index.js +15 -1
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
var e;!function(e){e[e.READ=1]="READ",e[e.LISTENED=2]="LISTENED",e[e.DOWNLOADED=4]="DOWNLOADED",e[e.RETRIEVED=8]="RETRIEVED",e[e.UNREAD=0]="UNREAD"}(e||(e={}));var t,n=e,r=function(e){return t||(t={set:function(t,n){e.localStorage.setItem(t,JSON.stringify(n))},get:function(t){var n;try{n=JSON.parse(e.localStorage.getItem(t))}catch(e){n=null}return n},remove:function(t){return e.localStorage.removeItem(t)},getKeys:function(){var t=[];for(var n in e.localStorage)t.push(n);return t}}),t},i=function(){function e(e){this._caches={},e&&(this._caches=e)}return e.prototype.set=function(e,t){this._caches[e]=t},e.prototype.remove=function(e){var t=this.get(e);return delete this._caches[e],t},e.prototype.get=function(e){return this._caches[e]},e.prototype.getKeys=function(){var e=[];for(var t in this._caches)e.push(t);return e},e}(),o=function(){function e(e,t){var n;this._rootStorage=r(e);var o=this._rootStorage.get(t)||{};this._cache=new i(((n={})[t]=o,n)),this._storageKey=t}return e.prototype._get=function(){var e=this._storageKey;return this._cache.get(e)||{}},e.prototype._set=function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)},e.prototype.set=function(e,t){var n=this._get();n[e]=t,this._set(n)},e.prototype.remove=function(e){var t=this._get();delete t[e],this._set(t)},e.prototype.clear=function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)},e.prototype.get=function(e){return this._get()[e]},e.prototype.getKeys=function(){var e=this._get(),t=[];for(var n in e)t.push(n);return t},e.prototype.getValues=function(){return this._get()||{}},e.prototype.update=function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)},e}(),s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)};function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},u.apply(this,arguments)};function c(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function l(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,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(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=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],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function h(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var p,_=function(e){function t(t){return e.call(this,"TODO => "+t)||this}return a(t,e),t}(Error),f=function(e){return new _(e)},E=function(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e.charCodeAt(n)<=65535?2:4;return t},I=function(e){for(var t,n=0,r=0,i=e.length;r<i;r++)n+=(t=e.charCodeAt(r))<127?1:t<=2047?2:t<=65535?3:4;return n},T=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var n=Object.keys(t).map((function(e){return e+"="+t[e]})).filter((function(e){return!!e}));return n.length?[e,n.join("&")].join("?"):e},R=72e5,v=6e4,C=1e4,y=5e3,S=3e4,m=15e3,A=15e3,N=2e3,O=131072,M=18e4,U=32,L=4096,P="cd4936151214ce45dc1d12673a59d94c",b="51ad078e5eb17a91",D=2048,w={"RC:TxtMsg":{isCounted:!0,isPersited:!0},"RC:ImgMsg":{isCounted:!0,isPersited:!0},"RC:VcMsg":{isCounted:!0,isPersited:!0},"RC:ImgTextMsg":{isCounted:!0,isPersited:!0,searchProps:["content","title"]},"RC:FileMsg":{isCounted:!0,isPersited:!0,searchProps:["name"]},"RC:HQVCMsg":{isCounted:!0,isPersited:!0},"RC:LBSMsg":{isCounted:!0,isPersited:!0},"RC:PSImgTxtMsg":{isCounted:!0,isPersited:!0},"RC:PSMultiImgTxtMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpOpendMsg":{isCounted:!0,isPersited:!0},"RC:CombineMsg":{isCounted:!0,isPersited:!0},"RC:CombineV2Msg":{isCounted:!0,isPersited:!0},"RC:ReferenceMsg":{isCounted:!0,isPersited:!0,searchProps:["content"]},"RC:SightMsg":{isCounted:!0,isPersited:!0},"RC:GIFMsg":{isCounted:!0,isPersited:!0},"RC:RLStart":{isCounted:!0,isPersited:!0},"RC:RLEnd":{isCounted:!0,isPersited:!0},"RC:InfoNtf":{isCounted:!1,isPersited:!0},"RC:ContactNtf":{isCounted:!1,isPersited:!0},"RC:ProfileNtf":{isCounted:!1,isPersited:!0},"RC:CmdNtf":{isCounted:!1,isPersited:!0},"RC:GrpNtf":{isCounted:!1,isPersited:!0},"RC:RcCmd":{isCounted:!1,isPersited:!0},"RC:RcNtf":{isCounted:!1,isPersited:!0},"RC:CmdMsg":{isCounted:!1,isPersited:!1},"RC:TypSts":{isCounted:!1,isPersited:!1},"RC:PSCmd":{isCounted:!1,isPersited:!1},"RC:SRSMsg":{isCounted:!1,isPersited:!1},"RC:RRReqMsg":{isCounted:!1,isPersited:!1},"RC:RRRspMsg":{isCounted:!1,isPersited:!1},"RC:CsChaR":{isCounted:!1,isPersited:!1},"RC:CSCha":{isCounted:!1,isPersited:!1},"RC:CsEva":{isCounted:!1,isPersited:!1},"RC:CsContact":{isCounted:!1,isPersited:!1},"RC:CsHs":{isCounted:!1,isPersited:!1},"RC:CsHsR":{isCounted:!1,isPersited:!1},"RC:CsSp":{isCounted:!1,isPersited:!1},"RC:CsEnd":{isCounted:!1,isPersited:!1},"RC:CsUpdate":{isCounted:!1,isPersited:!1},"RC:ReadNtf":{isCounted:!1,isPersited:!1},"RC:chrmKVNotiMsg":{isCounted:!1,isPersited:!1},"RC:VCAccept":{isCounted:!1,isPersited:!1},"RC:VCRinging":{isCounted:!1,isPersited:!1},"RC:VCSummary":{isCounted:!1,isPersited:!1},"RC:VCHangup":{isCounted:!1,isPersited:!1},"RC:VCInvite":{isCounted:!1,isPersited:!1},"RC:VCModifyMedia":{isCounted:!1,isPersited:!1},"RC:VCModifyMem":{isCounted:!1,isPersited:!1},"RC:MsgExMsg":{isCounted:!1,isPersited:!1},"RC:Delivered":{isCounted:!1,isPersited:!1},"RC:RRMsg":{isCounted:!1,isPersited:!1},"RC:LogCmdMsg":{isCounted:!1,isPersited:!1},"RC:InterceptMsg":{isCounted:!1,isPersited:!1},"RC:RLJoin":{isCounted:!1,isPersited:!1},"RC:RLQuit":{isCounted:!1,isPersited:!1},"RC:RL":{isCounted:!1,isPersited:!1},"RC:CCConfigChangeRequestMsg":{isCounted:!1,isPersited:!1}},V={"RC:DizNtf":{isCounted:!1,isPersited:!1}},G=["RC:TypSts","RC:InterceptMsg","RC:RL"],B=20971520,F=1e5,k=3e3,x=1e3,H="5.12.1",Y=H.replace(/-.+$/,""),q=5368709120,K=10485760,j=18e5,Q="rongcloudsystem",W=864e5,J=6048e5,X=6e5,Z={NAVI_KEY:function(e){return"navi_"+e},CONVER_STATE_PULL_TIME_KEY:function(e,t){return"RCV4-con-s-"+e+"-"+t},OLD_CONVER_STATE_KEY:function(e,t){return"RCV4-con-"+e+"-"+t},CONVER_STATE_KEY:function(e,t){return"RCV4-CONVER-"+e+"-"+t},ULTRA_GROUP_STATE_KEY:function(e,t){return"RCV4-ultragroupconversation-"+e+"-"+t},OUTBOX_TIME_KEY:function(e,t){return"outbox_"+e+"_"+t},INBOX_TIME_KEY:function(e,t){return"inbox_"+e+"_"+t},BROADCASTBOX_TIME_KEY:function(e,t){return"broadcastbox_"+e+"_"+t},SEND_MSG_KEY:function(e,t){return"send_msg_"+e+"_"+t},USER_SETTING_TIME_KEY:function(e,t){return"us-s-"+e+"-"+t},TAG_STATE_KEY:function(e,t){return"tag-"+e+"-"+t},USER_SETTING_KEY:function(e,t){return"RC-us-"+e+"-"+t},STATIC_CONFIG_KEY:function(e){return"rc-static-config-"+e},CLOUD_CONTROL_KEY:function(e){return"RC-cc-"+e},READ_RECEIPT_KEY:function(e,t){return"RC-RR-"+e+"-"+t},PULL_EVENT_CHANGE_TIME_KEY:function(e,t){return"RC-PEC-"+e+"-"+t}};!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"}(p||(p={}));var z,$=p;!function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(z||(z={}));var ee,te=z;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",e[e.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",e[e.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",e[e.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",e[e.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",e[e.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",e[e.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",e[e.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",e[e.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.NULLCHANNELNAME=24011]="NULLCHANNELNAME",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",e[e.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",e[e.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",e[e.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",e[e.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",e[e.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",e[e.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",e[e.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",e[e.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",e[e.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",e[e.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",e[e.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",e[e.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",e[e.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",e[e.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",e[e.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",e[e.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",e[e.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",e[e.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",e[e.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",e[e.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",e[e.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",e[e.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",e[e.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",e[e.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",e[e.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",e[e.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",e[e.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",e[e.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",e[e.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",e[e.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",e[e.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",e[e.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",e[e.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",e[e.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",e[e.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",e[e.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",e[e.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",e[e.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",e[e.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",e[e.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",e[e.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",e[e.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",e[e.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",e[e.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",e[e.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",e[e.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",e[e.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",e[e.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",e[e.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",e[e.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",e[e.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",e[e.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",e[e.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",e[e.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",e[e.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",e[e.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",e[e.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",e[e.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",e[e.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",e[e.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",e[e.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",e[e.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",e[e.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",e[e.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",e[e.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",e[e.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",e[e.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",e[e.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",e[e.RC_TCP_RESET=32054]="RC_TCP_RESET",e[e.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",e[e.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",e[e.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",e[e.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.UPLOAD_FAIL=34011]="UPLOAD_FAIL",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",e[e.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",e[e.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",e[e.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",e[e.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",e[e.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",e[e.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",e[e.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",e[e.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",e[e.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",e[e.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",e[e.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",e[e.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",e[e.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",e[e.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",e[e.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",e[e.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",e[e.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",e[e.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",e[e.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",e[e.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",e[e.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",e[e.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",e[e.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",e[e.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",e[e.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",e[e.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",e[e.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",e[e.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",e[e.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",e[e.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",e[e.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",e[e.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",e[e.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",e[e.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",e[e.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",e[e.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",e[e.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",e[e.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",e[e.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",e[e.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",e[e.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",e[e.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",e[e.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",e[e.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",e[e.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",e[e.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",e[e.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",e[e.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",e[e.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",e[e.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",e[e.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",e[e.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",e[e.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",e[e.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",e[e.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",e[e.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",e[e.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",e[e.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",e[e.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",e[e.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",e[e.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",e[e.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",e[e.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",e[e.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",e[e.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",e[e.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",e[e.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",e[e.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",e[e.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",e[e.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",e[e.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",e[e.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",e[e.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",e[e.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",e[e.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",e[e.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",e[e.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",e[e.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",e[e.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",e[e.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",e[e.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",e[e.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",e[e.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",e[e.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",e[e.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",e[e.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",e[e.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",e[e.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",e[e.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",e[e.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",e[e.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.NOT_SUPPORT=35004]="NOT_SUPPORT",e[e.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",e[e.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",e[e.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",e[e.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",e[e.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",e[e.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",e[e.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",e[e.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",e[e.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",e[e.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",e[e.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",e[e.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",e[e.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",e[e.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",e[e.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",e[e.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",e[e.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",e[e.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",e[e.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",e[e.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",e[e.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",e[e.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",e[e.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",e[e.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",e[e.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",e[e.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",e[e.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",e[e.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",e[e.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",e[e.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.TIMEOUT=-1]="TIMEOUT"}(ee||(ee={}));var ne,re=ee;!function(e){e[e.NONE=0]="NONE",e[e.PRIVATE=1]="PRIVATE",e[e.DISCUSSION=2]="DISCUSSION",e[e.GROUP=3]="GROUP",e[e.CHATROOM=4]="CHATROOM",e[e.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",e[e.SYSTEM=6]="SYSTEM",e[e.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",e[e.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",e[e.ULTRA_GROUP=10]="ULTRA_GROUP",e[e.RTC_ROOM=12]="RTC_ROOM"}(ne||(ne={}));var ie,oe=ne;!function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",e[e.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",e[e.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",e[e.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",e[e.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",e[e.BLOCKED=9]="BLOCKED",e[e.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",e[e.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",e[e.REDIRECT=14]="REDIRECT",e[e.USER_LOGOUT=19]="USER_LOGOUT",e[e.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",e[e.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",e[e.ULTRALIMIT=1101]="ULTRALIMIT",e[e.REQUEST_NAVI=201]="REQUEST_NAVI",e[e.RESPONSE_NAVI=202]="RESPONSE_NAVI",e[e.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",e[e.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR"}(ie||(ie={}));var se,ae=ie;!function(e){e.TextMessage="RC:TxtMsg",e.VOICE="RC:VcMsg",e.HQ_VOICE="RC:HQVCMsg",e.IMAGE="RC:ImgMsg",e.GIF="RC:GIFMsg",e.RICH_CONTENT="RC:ImgTextMsg",e.LOCATION="RC:LBSMsg",e.FILE="RC:FileMsg",e.SIGHT="RC:SightMsg",e.COMBINE="RC:CombineMsg",e.COMBINE_V2="RC:CombineV2Msg",e.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",e.LOG_COMMAND="RC:LogCmdMsg",e.EXPANSION_NOTIFY="RC:MsgExMsg",e.REFERENCE="RC:ReferenceMsg",e.RECALL="RC:RcCmd",e.RECALL_NOTIFICATION_MESSAGE="RC:RcNtf",e.READ_RECEIPT="RC:ReadNtf",e.READ_RECEIPT_REQUEST="RC:RRReqMsg",e.READ_RECEIPT_RESPONSE="RC:RRRspMsg",e.SYNC_READ_STATUS="RC:SRSMsg",e.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",e.READ_STATE="RC:RSMsg",e.DELIVERED="RC:Delivered",e.DELIVERED_MSG="RC:DRMsg",e.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",e.CHATROOM_SYNC_MSG="RC:ChrmSyncMsg",e.CHATROOM_MERGE_BLOCK="RC:ChrmBlockMsg",e.CHATROOM_MERGE_BAN="RC:ChrmBanMsg",e.TYPING_STATUS="RC:TypSts",e.INTERCEPT="RC:InterceptMsg",e.CLOUD_CONTROL="RC:CCConfigChangeRequestMsg"}(se||(se={}));var ue,ce=se;!function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(ue||(ue={}));var le,de=ue;!function(e){e[e.ALL_MESSAGE=-1]="ALL_MESSAGE",e[e.NOT_SET=0]="NOT_SET",e[e.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",e[e.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",e[e.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",e[e.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION"}(le||(le={}));var he,pe=le;!function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(he||(he={}));var _e,ge=he;!function(e){e[e.QINIU=1]="QINIU",e[e.ALI=2]="ALI",e[e.AWS=3]="AWS",e[e.STC=4]="STC",e[e.MINIO=5]="MINIO"}(_e||(_e={}));var fe,Ee=_e;!function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(fe||(fe={}));var Ie,Te,Re,ve,Ce,ye=fe;!function(e){e[e.LOG=0]="LOG",e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL",e[e.STATISTICS=6]="STATISTICS",e[e.NONE=1e3]="NONE"}(Ie||(Ie={})),function(e){e.IM="IM",e.RTC="RTC"}(Te||(Te={})),function(e){e.L_IMSDK_VER_O="L-imsdk_ver-O",e.A_INIT_O="A-init-O",e.A_INIT_REPEAT_O="A_INIT_REPEAT_O",e.L_INIT_O="L-init-O",e.A_DESTROY_O="A_DESTROY_O",e.L_DESTROY_O="L_DESTROY_O",e.A_CONNECT_T="A-connect-T",e.A_CONNECT_R="A-connect-R",e.A_CONNECT_S="A-connect-S",e.A_DISCONNECT_O="A-disconnect-O",e.A_RECONNECT_T="A-reconnect-T",e.A_RECONNECT_R="A_RECONNECT_R",e.L_CONNECT_T="L-connect-T",e.L_CONNECT_R="L-connect-R",e.L_CONNECT_S="L-connect-S",e.L_DB_UPGRATE_START_S="L-db_upgrate_start-S",e.L_DB_UPGRATING_S="L-db_upgrating-S",e.L_DB_UPGRATE_COMPLETE_S="L-db_upgrate_complete-S",e.L_NOTIFY_ULTRA_ONLINE_S="L-notify-ultra-online-S",e.L_ULTRA_SYNC_DONE_S="L-ultra-sync-done-S",e.L_BATCH_MESSAGE_O="L-BATCH_MESSAGE-O",e.A_MSG_LISTENER_E="A-MSG_LISTENER-E",e.O="L-original-O",e.T="L-TEST-O",e.L_INSTALL_PLUGIN_T="L-INSTALL_PLUGIN-T",e.L_INSTALL_PLUGIN_R="L-INSTALL_PLUGIN-R",e.L_NAVI_CONF_E="L-NAVI_CONF_ERROR-E",e.L_NAVI_CMP_R="L-NAVI_CPM-R",e.A_SEND_MSG_T="A-send_msg-T",e.A_SEND_MSG_R="A-send_msg-R",e.L_SEND_MSG_T="L-send_msg-T",e.L_SEND_MSG_R="L-send_msg-R",e.L_PULL_MSG_T="L-pull_msg-T",e.L_PULL_MSG_R="L-pull_msg-R",e.L_PULL_MSG_E="L-pull_msg-E",e.L_PULL_MSG_O="L-pull_msg-O",e.L_PULL_ULTRA_MSG_T="L-pull_ultra_msg-T",e.L_PULL_ULTRA_MSG_R="L-pull_ultra_msg-R",e.L_PULL_CHATROOM_KV_T="L-pull_chatroom_kv-T",e.L_PULL_CHATROOM_KV_R="L-pull_chatroom_kv-R",e.L_PULL_CHATROOM_MSG_T="L-pull_chatroom_msg-T",e.L_PULL_CHATROOM_MSG_R="L-pull_chatroom_msg-R",e.L_RECV_MULTI_SYNC_MSG_O="L-recv_multi_sync_msg-O",e.L_RECV_S_MSG_O="L-recv_s_msg-O",e.A_DELETE_MESSAGES_S="A-delete_messages-S",e.P_DELETE_MSG_S="P-delete_msg-S",e.L_PULL_CONVERSATION_S="L-pull_conversation-S",e.L_RECALL_ULTRA_MSG_S="L-recall_ultra_msg-S",e.A_REGTYP_O="A-regtyp-O",e.P_REGTYP_E="P-regtype-E",e.L_GET_NAVI_T="L-get_navi-T",e.L_GET_NAVI_R="L-get_navi-R",e.L_REQUEST_T="L-request-T",e.L_REQUEST_R="L-request-R",e.L_PARSE_NAVI_E="L-parse_navi-E",e.L_ENV_S="L-Env-S",e.L_GET_INDEX_NAVI_S="L-get_index_navi-S",e.A_JOIN_CHATROOM_T="A-join_chatroom-T",e.A_JOIN_CHATROOM_R="A-join_chatroom-R",e.L_JOIN_CHATROOM_T="L-join_chatroom-T",e.L_JOIN_CHATROOM_R="L-join_chatroom-R",e.A_QUIT_CHATROOM_T="A-quit_chatroom-T",e.A_QUIT_CHATROOM_R="A-quit_chatroom-R",e.L_REJOIN_CHATROOM_T="L-rejoin_chatroom-T",e.L_REJOIN_CHATROOM_R="L-rejoin_chatroom-R",e.L_REJOIN_CHATROOM_S="L-rejoin_chatroom-S",e.L_MEDIA_S="L-media-S",e.L_MEDIA_UPLOAD_T="L-media_upload-T",e.L_MEDIA_UPLOAD_R="L-media_upload-R",e.G_UPLOAD_LOG_S="G-upload_log-S",e.G_REPORT_LOG_S="G-report_log-S",e.G_UPLOAD_LOG_E="G-upload_log-E",e.G_GET_REAL_TIMELOG_COMMAND_S="G-get_real_timelog_command-S",e.L_CHECK_ALIVE_IM_T="L-check_alive_im-T",e.L_CHECK_ALIVE_IM_R="L-check_alive_im-R",e.L_CHECK_ALIVE_IM_S="L-check_alive_im-S",e.A_GET_HISTORY_MSG_T="A-get_history_msg-T",e.A_GET_HISTORY_MSG_R="A-get_history_msg-R",e.L_GET_HISTORY_MSG_T="L-get_history_msg-T",e.L_GET_HISTORY_MSG_R="L-get_history_msg-R",e.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E="A-get_privage_message_deliver_time-E",e.A_GET_GROUP_MESSAGE_DELIVER_LIST_E="A-get_group_message_deliver_list-E",e.A_CALLBACK_O="A-callback-O",e.A_CALLBACK_E="A-callback-E",e.L_CALLBACK_E="L-callback-E",e.A_SEND_MESSAGE_READ_RECEIPT_V4_T="A-send_message_read_receipt_V4-T",e.A_SEND_MESSAGE_READ_RECEIPT_V4_R="A-send_message_read_receipt_V4-R",e.A_GET_MESSAGE_READ_RECEIPT_V4_T="A-get_message_read_receipt_V4-T",e.A_GET_MESSAGE_READ_RECEIPT_V4_R="A-get_message_read_receipt_V4-R",e.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T="A-batch_get_message_read_receipt_info_V4-T",e.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R="A-batch_get_message_read_receipt_info_V4-R",e.A_SYNC_READ_STATUS_T="A-sync_read_status-T",e.A_SYNC_READ_STATUS_R="A-sync_read_status-R",e.A_GET_TOP_CONVERSATION_LIST_E="A-get_top_conversation_list-E",e.L_PB_ENCODE_E="L-pb-encode-E",e.L_PB_DECODE_E="L-pb-decode-E",e.L_NOTIFY_NAVI_CHANGE_E="L-notify_navi_change-E",e.L_REPORT_FULL_LOG_O="L-report_full_log-O",e.L_REPORT_FULL_LOG_T="L-report_full_log-T",e.L_REPORT_FULL_LOG_R="L-report_full_log-R",e.L_REPORT_LOG_POLICY_E="L-parse_navi_logpolicy-E",e.L_UNSUPPORT_INDEXDB_O="L-unsupport_IndexDB-O",e.L_LOGDB_OPEN_FAILED_E="L-logDB_open_failed-E",e.L_LOGDB_CLOSED_S="L-logDB_closed-S",e.L_LOGDB_ERROR_E="L-logDB_error-S",e.L_LOGDB_ABORT_S="L-logDB_abort-S",e.L_REALTIME_LOG_R="L_REALTIME_LOG_R",e.L_REALTIME_LOG_O="L_REALTIME_LOG_O",e.L_REALTIME_LOG_T="L_REALTIME_LOG_T",e.L_STATISTIC_LOG_R="L_STATISTIC_LOG_R",e.L_STATISTIC_LOG_O="L_STATISTIC_LOG_O",e.L_STATISTIC_LOG_T="L_STATISTIC_LOG_T",e.L_UNKNOWN_TOPIC_E="L_UNKNOWN_TOPIC_E",e.L_RECV_RMTP_O="L_RECV_RMTP_O",e.L_RECV_RMTP_E="L_RECV_RMTP_E",e.L_RECV_S_NTF_O="L-recv_s_ntf_O",e.L_VER_REPORT_T="L-VER_REPORT-T",e.L_VER_REPORT_R="L-VER_REPORT-R",e.L_CALL_MAIN_SYNC_O="L_CALL_MAIN_SYNC_O",e.L_UNSUPPORT_NTF_FROM_MAIN_E="L_UNSUPPORT_NTF_FROM_MAIN_E",e.A_SET_MSG_CONTENT_O="A_SET_MSG_CONTENT_O",e.A_REMOVE_PROXY_O="A-remove_proxy-O",e.A_SET_PROXY_O="A-set_proxy-O",e.A_TEST_PROXY_O="A-test_proxy-O",e.L_WEBSOCKET_DISACCORD_E="L-websocket_disaccord-e",e.A_SEARCH_MESSAGE_BY_USER_T="A-search_messages_by_user-T",e.A_SEARCH_MESSAGE_BY_USER_R="A-search_messages_by_user-R",e.L_GET_STATIC_CONF_T="L-get_static_conf-T",e.L_GET_STATIC_CONF_R="L-get_static_conf-R",e.L_GET_STATIC_CONF_E="L-get_static_conf-E",e.L_CLOUD_DISABLED="L-cloud_disabled",e.L_CLOUD_EXPIRE="L-cloud_expire",e.L_CLOUD_OVERCLOCK="L-cloud_overclock",e.L_CLOUD_APPKEY_REGION_E="L-cloud_appkey_region_error",e.L_CLOUD_CONFIG_DATA_E="L-cloud_config_data_error",e.L_CLOUD_SET_CACHE_O="L-cloud_set_cache-O",e.L_CLOUD_GET_CACHE_O="L-cloud_get_cache-O",e.L_CLOUD_MSG_NTF_O="L-cloud_msg_ntf-O",e.L_CLOUD_SET_AREA_CODE_O="L-cloud_set_area_code-O",e.L_CLOUD_SET_MRTR_O="L-cloud_set_mrtr-O",e.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S="L-sync_subscribed_user_status_finished-S",e.L_PULL_SUBSCRIBED_USER_RELATION_T="L-pull_subscribed_user_relation-T",e.L_PULL_SUBSCRIBED_USER_RELATION_R="L-pull_subscribed_user_relation-R",e.L_PULL_SUBSCRIBED_USER_STATUS_T="L-pull_subscribed_user_status-T",e.L_PULL_SUBSCRIBED_USER_STATUS_R="L-pull_subscribed_user_status-R",e.L_OWN_USER_PROFILE_CHANGED_S="L-own_user_profile_changed-S",e.L_QUERY_SUBSCRIBE_DATA_T="L-query_subscribe_data-T",e.L_QUERY_SUBSCRIBE_DATA_R="L-query_subscribe_data-R",e.L_PULL_USER_PROFILE_T="L-pull_user_profile-T",e.L_PULL_USER_PROFILE_R="L-pull_user_profile-R",e.L_PULL_OWN_PROFILE_T="L-pull_own_profile-T",e.L_PULL_OWN_PROFILE_R="L-pull_own_profile-R",e.L_QUERY_FRIEND_LIST_T="L-query_friend_list-T",e.L_QUERY_FRIEND_LIST_R="L-query_friend_list-R",e.L_PULL_USER_PROFILE_REQ_T="L-pull_user_profile_req-T",e.L_PULL_USER_PROFILE_REQ_R="L-pull_user_profile_req-R",e.L_PULL_EVENT_CHANGE_NOTIFY_ULTRA_ONLINE_S="L-pull_event_change_notify_ultra_online-S",e.L_PULL_EVENT_CHANGE_T="L-pull_event_change-T",e.L_PULL_EVENT_CHANGE_R="L-pull_event_change-R",e.L_PARSE_JSON_E="L-parse_json-E"}(Re||(Re={})),function(e){e.IM_NAVI="IM-stats_navi-S",e.IM_WEBSOCKET="IM-stats_websocket-S",e.IM_CONNECTION_DURATION="IM-stats_con_dur-S",e.IM_CMP="IM-stats_cmp-S",e.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",e.IM_STATS_CS="IM-stats_cs-S",e.IM_NETWORK_CHANGE="IM-stats_network_change-S",e.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",e.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",e.IM_MSG_SEND="IM-msg_send-S",e.IM_MSG_RECEIVE="IM-msg_receive-S"}(ve||(ve={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(Ce||(Ce={}));var Se,me,Ae=Ce;!function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(Se||(Se={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(me||(me={}));var Ne,Oe=Se;!function(e){e[e.typing=0]="typing"}(Ne||(Ne={}));var Me,Ue,Le=Ne;!function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(Me||(Me={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(Ue||(Ue={}));var Pe,be=Ue;!function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(Pe||(Pe={}));var De,we=Pe;!function(e){e[e.UnmuteUsers=0]="UnmuteUsers",e[e.MuteUsers=1]="MuteUsers",e[e.UnmuteAll=2]="UnmuteAll",e[e.MuteAll=3]="MuteAll",e[e.RemoveWhitelist=4]="RemoveWhitelist",e[e.AddWhitelist=5]="AddWhitelist",e[e.UnmuteGloble=6]="UnmuteGloble",e[e.MuteGloble=7]="MuteGloble"}(De||(De={}));var Ve,Ge=De;!function(e){e[e.LeaveOnMyOwn=0]="LeaveOnMyOwn",e[e.OtherDeviceLogin=1]="OtherDeviceLogin"}(Ve||(Ve={}));var Be,Fe,ke,xe,He,Ye,qe,Ke,je,Qe,We,Je,Xe,Ze,ze,$e,et,tt,nt,rt,it,ot,st,at,ut,ct,lt,dt,ht,pt,_t,gt,ft,Et,It,Tt,Rt,vt,Ct,yt,St,mt,At,Nt,Ot,Mt,Ut,Lt,Pt,bt,Dt=Ve;!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"}(Be||(Be={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(Fe||(Fe={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(ke||(ke={})),function(e){e.NAVI="rc-navi",e.REALTIME_LOG_TIMESTAMP="rc-realtime-log-timestamp"}(xe||(xe={})),function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(He||(He={})),function(e){e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(Ye||(Ye={})),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"}(qe||(qe={})),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"}(Ke||(Ke={})),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"}(je||(je={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(Qe||(Qe={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(We||(We={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(Je||(Je={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Xe||(Xe={})),function(e){e[e.CURRENT=2]="CURRENT"}(Ze||(Ze={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(ze||(ze={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}($e||($e={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(et||(et={})),function(e){e[e.Other=0]="Other",e[e.iOS=1]="iOS",e[e.Android=2]="Android",e[e.Web=3]="Web",e[e.PC=4]="PC",e[e.Mini=5]="Mini",e[e.HarmonyOS=6]="HarmonyOS"}(tt||(tt={})),function(e){e[e.ONLINE_STATUS=1]="ONLINE_STATUS",e[e.USER_PROFILE=2]="USER_PROFILE",e[e.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",e[e.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE"}(nt||(nt={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(rt||(rt={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(it||(it={})),function(e){e[e.OWNER_VERIFY=0]="OWNER_VERIFY",e[e.FREE=1]="FREE",e[e.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(ot||(ot={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(st||(st={})),function(e){e[e.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",e[e.OWNER_OR_SELF=1]="OWNER_OR_SELF",e[e.SELF=2]="SELF"}(at||(at={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(ut||(ut={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(ct||(ct={})),function(e){e[e.CREATE=0]="CREATE",e[e.JOIN=1]="JOIN",e[e.KICK=2]="KICK",e[e.QUIT=3]="QUIT",e[e.DISMISS=4]="DISMISS",e[e.ADD_MANAGER=5]="ADD_MANAGER",e[e.REMOVE_MANAGER=6]="REMOVE_MANAGER",e[e.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER"}(lt||(lt={})),function(e){e[e.CREATE=0]="CREATE",e[e.JOIN=1]="JOIN",e[e.KICK_OUT=2]="KICK_OUT",e[e.EXIT=3]="EXIT",e[e.DISSOLVE=4]="DISSOLVE",e[e.ADD_ADMIN=5]="ADD_ADMIN",e[e.REMOVE_ADMIN=6]="REMOVE_ADMIN",e[e.TRANSFER_OWNER=7]="TRANSFER_OWNER"}(dt||(dt={})),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"}(ht||(ht={})),function(e){e[e.USER_APPLY=0]="USER_APPLY",e[e.INVITATION_RECEIVED=1]="INVITATION_RECEIVED",e[e.APPLY_RESULT=2]="APPLY_RESULT",e[e.INVITATION_RESULT=3]="INVITATION_RESULT"}(pt||(pt={})),function(e){e[e.REMOVE_USER=0]="REMOVE_USER",e[e.ADD_USER=1]="ADD_USER"}(_t||(_t={})),function(e){e[e.FRIEND_APPLY=0]="FRIEND_APPLY",e[e.FRIEND_REFUSE=1]="FRIEND_REFUSE",e[e.FRIEND_ACCEPT=2]="FRIEND_ACCEPT",e[e.FRIEND_DELETE=3]="FRIEND_DELETE",e[e.FRIEND_CLEANUP=4]="FRIEND_CLEANUP"}(gt||(gt={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(ft||(ft={})),function(e){e[e.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",e[e.MANAGER_REFUSED=1]="MANAGER_REFUSED",e[e.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",e[e.INVITEE_REFUSED=3]="INVITEE_REFUSED",e[e.JOINED=4]="JOINED",e[e.EXPIRED=5]="EXPIRED"}(Et||(Et={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(It||(It={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(Tt||(Tt={})),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"}(Rt||(Rt={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(vt||(vt={})),function(e){e[e.APPLICATION_SENT=0]="APPLICATION_SENT",e[e.INVITATION_SENT=1]="INVITATION_SENT",e[e.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",e[e.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED"}(Ct||(Ct={})),function(e){e[e.BOTH=2]="BOTH"}(yt||(yt={})),function(e){e[e.BOTH=2]="BOTH"}(St||(St={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(mt||(mt={})),function(e){e[e.NONE=0]="NONE",e[e.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",e[e.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",e[e.BOTH_WAY=3]="BOTH_WAY"}(At||(At={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(Nt||(Nt={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(Ot||(Ot={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(Mt||(Mt={})),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"}(Ut||(Ut={})),function(e){e[e.RTC=0]="RTC",e[e.LIVE=2]="LIVE",e[e.SIP=4]="SIP",e[e.CALL=5]="CALL",e[e.MEETING=6]="MEETING",e[e.CROSS_MUTI=7]="CROSS_MUTI",e[e.CROSS_LIVE=8]="CROSS_LIVE"}(Lt||(Lt={})),function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(Pt||(Pt={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(bt||(bt={}));var wt,Vt,Gt,Bt={"RC:VCAccept":"RC:VCAccept","RC:VCRinging":"RC:VCRinging","RC:VCSummary":"RC:VCSummary","RC:VCHangup":"RC:VCHangup","RC:VCInvite":"RC:VCInvite","RC:VCModifyMedia":"RC:VCModifyMedia","RC:VCModifyMem":"RC:VCModifyMem"};!function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(wt||(wt={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Vt||(Vt={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(Gt||(Gt={}));var Ft=function(e){return"string"==typeof e},kt=function(e){return"boolean"==typeof e},xt=function(e){return"number"==typeof e&&!Number.isNaN(e)},Ht=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},Yt=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},qt=function(e){return function(t){if(!Yt(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 n=!0;return t.every((function(t){var r=e.itemValidator&&e.itemValidator(t);return"object"==typeof r?r.errorKey?(n={errorKey:r.errorKey,valid:r.valid},!1):(n=r.valid,r.valid):(n=!!r,r)})),n}},Kt=function(e){return function(t){return Ft(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))}},jt=function(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)},Qt=function(e){return Ft(e)&&e.length>0},Wt=function(e){return Yt(e)&&e.length>0},Jt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Xt=function(e){return"[object Function]"===Object.prototype.toString.call(e)},Zt=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},zt=function(e){return"[object Null]"===Object.prototype.toString.call(e)},$t=function(e){return Ft(e)&&/https?:\/\//.test(e)},en=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},tn=function(e){return xt(e)&&Object.prototype.hasOwnProperty.call(oe,e)},nn=function(e){return xt(e)&&Object.prototype.hasOwnProperty.call(pe,e)},rn=function(e){var t=!1;return Ft(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},on=function(e){return Object.values(e.type).includes(e.value)},sn=function(e){return Kt({minLength:1,maxLength:64})(e)},an=function(e){return Kt({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},un=function(e){return[oe.PRIVATE,oe.GROUP,oe.SYSTEM,oe.PUBLIC_SERVICE,oe.APP_PUBLIC_SERVICE].includes(e)},cn=function(e){return xt(e)&&Object.prototype.hasOwnProperty.call($,e)},ln=function(e){var t=!1,n=!1,r=!1;if(Jt(e)){var i=Object.keys(e).length;for(var o in t=i>20,e)if(n||(n=Ft(o)&&!/^[A-Za-z0-9_=+-]+$/.test(o)),!r){var s=e[o];r=o.length>32||s.length>4096}}return{isExceedLimit:t,isIllgalEx:n,isExKeyOrValLengthExceedLimit:r}},dn=function(e,t){var n;return Jt(e)?(t&&!t.includes(e.conversationType)&&(n="conversationTypeNotSupport"),sn(e.targetId)||(n="targetId"),tn(e.conversationType)||(n="conversationType"),Zt(e.channelId)||rn(e.channelId)||(n="channelId"),Zt(n)?{valid:!0}:{valid:Zt(n),errorKey:n}):{valid:!1,errorKey:"conversation"}},hn=function(){function e(){this._map={}}return e.prototype.on=function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n})},e.prototype.once=function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n,once:!0})},e.prototype.off=function(e,t,n){var r=this._map[e];r&&((r=r.filter((function(e){return e.listener!==t||e.target!==n}))).length?this._map[e]=r:delete this._map[e])},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map[e];if(r)for(var i=r.length-1;i>=0;i-=1){var o=r[i],s=o.target,a=o.once,u=o.listener;a&&r.splice(i,1);try{u.call.apply(u,h([s],t,!1))}catch(e){null===console||void 0===console||console.error(e)}}},e.prototype.removeAll=function(e){delete this._map[e]},e.prototype.clear=function(){Object.keys(this._map).forEach(this.removeAll,this)},e}(),pn="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};pn.engine="5.12.1";var _n=function(){function e(){}return e.add=function(e,t){pn[e]=t},e.validEngine=function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var n=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return pn.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=n},e.getInfo=function(){return pn},e}();function gn(){return!0}var fn=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},En=function(){var e=fn();if(e=e.replace(/-/g,"")+"a",e=function(e){var t="0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0".split(""),n=t.length+1,r=+e,i=[];do{var o=r%n;r=(r-o)/n,i.unshift(t[o])}while(r);return i.join("")}(e=parseInt(e,16)),e.length>22&&(e=e.slice(0,22)),e.length<22)for(var t=22-e.length,n=0;n<t;n++)e+="0";return e},In=function(e){var t="RCDeviceId",n=r(e),i="",o=n.get(t);return o?i=o:(i=En(),n.set(t,i)),i},Tn=null;function Rn(e,t,n,r){void 0===n&&(n={});var i=["error","warn","info","debug"][3-e];if(Tn&&e<Ie.FATAL)try{var o=JSON.stringify(n);Tn[i](t,o)}catch(e){console.error(e)}}var vn,Cn,yn=Rn.bind(null,Ie.DEBUG),Sn=Rn.bind(null,Ie.INFO),mn=Rn.bind(null,Ie.WARN),An=Rn.bind(null,Ie.ERROR),Nn=Rn.bind(null,Ie.FATAL),On=Object.freeze({__proto__:null,init:function(e){Tn=e},log:Rn,debug:yn,info:Sn,warn:mn,error:An,fatal:Nn}),Mn=function(e){if(!Jt(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{"+t.length+"}$"),t),16)},Un=function(e){return void 0===e&&(e=[]),e.map((function(e){var t,n,r,i,o,s,a,u,c,l=Vn(e.settingProfile)||{},d=e.extProfile||[],h=e.targetId,p=e.baseInfo,_=e.userInfo;return{groupId:h,groupName:null!==(t=l.name)&&void 0!==t?t:"",portraitUri:null!==(n=l.portraitUrl)&&void 0!==n?n:"",introduction:null!==(r=l.introduction)&&void 0!==r?r:"",notice:null!==(i=l.announcement)&&void 0!==i?i:"",extProfile:Vn(d),joinPermission:~~l.joinPerm,removeMemberPermission:~~l.removePerm,invitePermission:~~l.memInvitePerm,inviteHandlePermission:~~l.invitePerm,groupInfoEditPermission:~~l.profilePerm,memberInfoEditPermission:~~l.memProfilePerm,creatorId:null!==(o=null==p?void 0:p.creatorId)&&void 0!==o?o:"",ownerId:null!==(s=null==p?void 0:p.ownerId)&&void 0!==s?s:"",createTime:(null==p?void 0:p.createTime)?Mn(p.createTime):0,membersCount:null!==(a=null==p?void 0:p.memberCount)&&void 0!==a?a:0,remark:null!==(u=null==_?void 0:_.remarkName)&&void 0!==u?u:"",joinedTime:(null==_?void 0:_.joinTime)?Mn(_.joinTime):0,role:null!==(c=null==_?void 0:_.role)&&void 0!==c?c:ct.UNDEF}}))},Ln=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Vn(e.settingProfile),n=e.extProfile||[],r=e.targetId,i=e.baseInfo,o=e.userInfo;return u(u(u(u(u(u(u({groupId:r},Pn(t)),n.length>0&&{extProfile:Vn(n)}),(null==i?void 0:i.creatorId)&&{creatorId:i.creatorId}),(null==i?void 0:i.ownerId)&&{ownerId:i.ownerId}),(null==i?void 0:i.createTime)&&{createTime:Mn(i.createTime)}),(null==i?void 0:i.memberCount)&&{membersCount:i.memberCount}),(null==o?void 0:o.remarkName)&&{remark:o.remarkName})}))},Pn=function(e){return u(u(u(u(u(u(u(u(u(u({},e.name&&{groupName:e.name}),e.portraitUrl&&{portraitUri:e.portraitUrl}),e.introduction&&{introduction:e.introduction}),e.announcement&&{notice:e.announcement}),e.joinPerm&&{joinPermission:~~e.joinPerm}),e.removePerm&&{removeMemberPermission:~~e.removePerm}),e.memInvitePerm&&{invitePermission:~~e.memInvitePerm}),e.invitePerm&&{inviteHandlePermission:~~e.invitePerm}),e.profilePerm&&{groupInfoEditPermission:~~e.profilePerm}),e.memProfilePerm&&{memberInfoEditPermission:~~e.memProfilePerm})},bn=function(e){void 0===e&&(e=[]);var t=e.map((function(e){var t=e||{},n=t.ext,r=t.userId,i=t.name,o=t.portraitUrl,s=n||{},a=s.role,u=s.joinTime,c=s.channelNickName,l=s.additional;return{userId:r,name:i||"",portraitUri:o||"",nickname:c||"",role:a||ct.UNDEF,joinedTime:Mn(u)||0,extra:l||""}}));return t},Dn=function(e,t){var n={},r=Date.now();return e.forEach((function(e){var i=e.userProfile,o=e.userId,s=Vn(i);n[o]={name:s.name||"",portraitUri:s.portraitUri||""},t&&(n[o].expiration=r+t)})),n},wn=function(e){return e.map((function(e){var t=e.userId,n=e.opTime;return{userId:t,time:Mn(n)}}))},Vn=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Gn=function(e){return e.map((function(e){var t=e.targetId,n=e.joinUserInfo,r=e.inviterInfo,i=e.status,o=e.directionType,s=e.detail,a=e.joinType,c=e.processInfo,l=e.processTime;return u(u(u(u({groupId:t},n&&{joinMemberInfo:bn([n])[0]}),r&&{inviterInfo:bn([r])[0]}),c&&{operatorInfo:bn([c])[0]}),{status:i,direction:o,type:a,operationTime:Mn(l),reason:s})}))},Bn=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},Fn=function(){function e(e,t){var n=this;this._promise=new Promise((function(t){n._resolve=t,e(n._onResolve.bind(n))})),this._onCancel=t}return e.prototype._onResolve=function(e){this._resolve(e)},e.prototype.result=function(){return this._promise},e.prototype.abort=function(){this._onCancel(this._onResolve.bind(this))},e}();!function(e){e[e.STRING=0]="STRING",e[e.ONLY_STRING=1]="ONLY_STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.OBJECT=4]="OBJECT",e[e.ARRAY=5]="ARRAY",e[e.CALLBACK=6]="CALLBACK",e[e.CHANNEL_ID=7]="CHANNEL_ID",e[e.CONVERSATION=8]="CONVERSATION",e[e.CONVERSATION_TYPE=9]="CONVERSATION_TYPE"}(Cn||(Cn={}));var kn=((vn={})[Cn.STRING]=Qt,vn[Cn.ONLY_STRING]=Ft,vn[Cn.NUMBER]=xt,vn[Cn.BOOLEAN]=function(e){return"boolean"==typeof e},vn[Cn.OBJECT]=Jt,vn[Cn.ARRAY]=Yt,vn[Cn.CALLBACK]=function(e){var t=!0;return Jt(e)||(t=!1),(e=e||{}).onSuccess&&!Xt(e.onSuccess)&&(t=!1),e.onError&&!Xt(e.onError)&&(t=!1),t},vn[Cn.CHANNEL_ID]=rn,vn[Cn.CONVERSATION]=function(e){var t=!0;return Jt(e)||(t=!1),Ft(e.targetId)||(t=!1),tn(e.conversationType)||(t=!1),Zt(e.channelId)||rn(e.channelId)||(t=!1),t},vn[Cn.CONVERSATION_TYPE]=tn,vn),xn=function(e){function t(t){var n=e.call(this,t)||this;return n.name="RCAssertError",n}return a(t,e),t}(Error),Hn=function(e,t,n,r){if(void 0===r&&(r=!1),!Yn(e,t,n,r))throw new xn("'"+e+"' is invalid: "+JSON.stringify(t))},Yn=function(e,t,n,r){void 0===r&&(r=!1),n=kn[n]||n;var i=r?n(t):Zt(t)||null==t||n(t);return i||null===console||void 0===console||console.error("'"+e+"' is invalid: "+JSON.stringify(t)),i},qn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Kn(e){var t,n,r,i,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=qn.indexOf(e.charAt(u++))<<2|(i=qn.indexOf(e.charAt(u++)))>>4,n=(15&i)<<4|(o=qn.indexOf(e.charAt(u++)))>>2,r=(3&o)<<6|(s=qn.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(r));return a}function jn(e){for(var t=null===window||void 0===window?void 0:window.atob(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n.buffer}var Qn,Wn=function(e,t){var n=Math.floor(1e3*Math.random()%1e4),r=fn(),i=function(e){e=e||"-";var t=new Date;return""+t.getFullYear()+e+(t.getMonth()+1)+e+t.getDate()}(),o=(new Date).getTime(),s="";if(t){var a=t.split(".");s="."+a[a.length-1]}return e+"__RC-"+i+"_"+n+"_"+o+r+s},Jn=function(e){var t="application/octet-stream";switch(e){case $.IMAGE:t="image/jpeg";break;case $.AUDIO:t="audio/amr";break;case $.VIDEO:t="video/3gpp";break;case $.SIGHT:t="video/mpeg4";break;case $.COMBINE_HTML:t="text/html"}return t},Xn=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t={}),void 0===n&&(n={});var r=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,s=t.typeVivo,a=t.importanceHW,u=t.categoryHW,c=t.imageUrlHW,l=t.categoryVivo,d=t.importanceHonor,h=t.imageUrlHonor,p=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.threadId,r=e.apnsCollapseId,i=e.category,o=e.richMediaUri,s=e.interruptionLevel,a=t.googleConfig,u={};u["thread-id"]=n||"",u["apns-collapse-id"]=r||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=s||"active";var c={};c.collapse_key=null==a?void 0:a.collapseKey,c.imageUrl=null==a?void 0:a.imageUrl;var l=null==a?void 0:a.priority;return l&&!["high","normal"].includes(l)&&(l="normal"),c.priority=l,{APNS:u,FCM:c}}(e,t),_=[{HW:{channelId:i||"",importance:a||"NORMAL",image:c||"",category:u||""}},{MI:{channelId:r||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:s||"",category:l||""}},{APNS:p.APNS},{FCM:p.FCM},{HONOR:{importance:d||ke.NORMAL,image:h||""}},{OHOS:{category:n.category||null,image:n.image||""}}];return JSON.stringify(_)},Zn=function(e,t,n){var r={},i={notificationId:n||""},o={};if(!t)return{iOSConfig:r,androidConfig:i,harmonyOSConfig:o};try{var s=JSON.parse(t);null==s||s.forEach((function(e){var t,n,s,a,u,c,l,d,h,p,_,g,f=Object.keys(e);if(0!==f.length){var E=f[0];switch(E){case"HW":return i.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,i.importanceHW=null===(n=e[E])||void 0===n?void 0:n.importance,i.imageUrlHW=null===(s=e[E])||void 0===s?void 0:s.image,void(i.categoryHW=null===(a=e[E])||void 0===a?void 0:a.category);case"MI":return void(i.channelIdMi=null===(u=e[E])||void 0===u?void 0:u.channelId);case"OPPO":return void(i.channelIdOPPO=null===(c=e[E])||void 0===c?void 0:c.channelId);case"VIVO":return i.typeVivo=null===(l=e[E])||void 0===l?void 0:l.classification,void(i.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(i.googleConfig={collapseKey:e[E].collapse_key||"",imageUrl:e[E].imageUrl||"",priority:e[E].priority||""});case"HONOR":return i.importanceHonor=null===(h=e[E])||void 0===h?void 0:h.importance,void(i.imageUrlHonor=null===(p=e[E])||void 0===p?void 0:p.image);case"OHOS":o.category=null===(_=e[E])||void 0===_?void 0:_.category,o.image=null===(g=e[E])||void 0===g?void 0:g.image}}}))}catch(n){e.error(Re.O,"Wrong format for pushConfigs field! content: "+t)}return{iOSConfig:r,androidConfig:i,harmonyOSConfig:o}},zn=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),n=e.length;return t&&(n<=128&&n>=1)},$n=function(e){var t=e.length;return t<=4096&&t>=1},er=(Qn=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,20)-1)),n=e+Qn.toString(2).padStart(11,"0")+t.toString(2).padStart(20,"0");return Qn=2047&++Qn,parseInt(n,2)}),tr=function(){var e=_n.getInfo(),t="electron";for(var n in e)"engine"!==n&&(t=["imlib-v2-adapter","imlib-v4-adapter","imlib-next"].includes(n)?n:"electron");return t},nr=function(e,t,n){return l(void 0,void 0,void 0,(function(){var r,i;return d(this,(function(o){switch(o.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return r=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(n)},r,jn(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function rr(e,t){var n;if(!e)return"";var r="undefined"!=typeof window&&"https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol);return/^https?:\/\//.test(e)?r?e.replace(/^https?:\/\//i,"https://"):e:t!==Be.HTTP||r?"https://"+e:"http://"+e}function ir(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t|=0}return Math.abs(t)}var or,sr,ar,ur=function(e,t){if(!e)return"";var n=e.ossConfig,r=void 0===n?"":n,i="";try{var o=JSON.parse(r);if(o.length>0){var s=o.find((function(e){return e.minio}));s&&(i=s.minio)}}catch(e){t.warn(Re.L_PARSE_JSON_E,JSON.stringify({ossConfig:r,error:e}))}return i};function cr(e,t,n){var r,i,o;return{userIdList:(null===(r=e.mentionedInfo)||void 0===r?void 0:r.userIdList)||t,type:(null===(i=e.mentionedInfo)||void 0===i?void 0:i.type)||n||ge.ALL,mentionedContent:(null===(o=e.mentionedInfo)||void 0===o?void 0:o.mentionedContent)||""}}!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(or||(or={})),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"}(sr||(sr={})),function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(ar||(ar={}));function lr(e){var t,n=e.method||or.GET,r=e.timeout||6e4,i=e.headers,o=e.query,s=e.body,a=e.onProgress,u=T(e.url,o),c=(t="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&t?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),l="[object XDomainRequest]"===Object.prototype.toString.call(c);if(c.open(n,u),i&&c.setRequestHeader)for(var d in i)c.setRequestHeader(d,i[d]);return l?function(e,t,n){return new Fn((function(r){0!==t&&(e.timeout=t),e.onload=function(){r({data:e.responseText,status:e.status||200})},e.onerror=function(){r({status:e.status})},e.ontimeout=function(){r({status:e.status})};var i="object"==typeof n?JSON.stringify(n):n;e.send(i)}),(function(t){e.abort(),t({status:-1})}))}(c,r,s):function(e,t,n,r){return new Fn((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},r&&(e.upload.onprogress=function(e){return r(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(n)}),(function(t){e.abort(),t({status:-1})}))}(c,r,s,a)}var dr,hr,pr=function(e,t,n){var r=null==n?void 0:n.isReverse;Jt(e)&&function(){for(var n in e)t(e[n],n,e)}(),(Yt(e)||Ft(e))&&function(){if(r)for(var n=e.length-1;n>=0;n--)t(e[n],n);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},_r=function(e,t){return pr(e,(function(n,r){e[r]=t(n,r)})),e},gr=function(e,t){if(e.indexOf)return e.indexOf(t);var n=-1;return pr(e,(function(e,r){t===e&&(n=r)})),n},fr=function(e,t){return-1!==gr(e,t)},Er=function(e,t){var n=[];return pr(e,(function(e){n.push(e)})),-1!==gr(n,t)},Ir=function(e){return JSON.parse(JSON.stringify(e))},Tr=function(){return"undefined"!=typeof RCCppEngine},Rr=function(e){if("browser"!==e.tag)return{type:e.tag,version:"UnKonw"};var t,n,r=navigator.userAgent,i={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 o in i)if(i.hasOwnProperty(o)){var s=r.match(i[o]);if(s){n=o,t=s[1]||s[2];break}}return{type:n||"UnKonw",version:t||"UnKonw"}},vr=function(e){var t;if("object"==typeof e&&null!==e)if(Array.isArray(e))for(var n in t=[],e)t.push(vr(e[n]));else for(var n in t={},e)t[n]=vr(e[n]);else t=e;return t},Cr=function(e){var t;try{t=vr(e)}catch(n){t=JSON.parse(JSON.stringify(e))}return t},yr=function(e){return{isRead:(e&n.READ)===n.READ,isListened:(e&n.LISTENED)===n.LISTENED,isDownload:(e&n.DOWNLOADED)===n.DOWNLOADED,isRetrieved:(e&n.RETRIEVED)===n.RETRIEVED}},Sr=function(e){var t=n.UNREAD;return(null==e?void 0:e.isRead)&&(t|=n.READ),(null==e?void 0:e.isListened)&&(t|=n.LISTENED),(null==e?void 0:e.isDownload)&&(t|=n.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=n.RETRIEVED),t},mr=function(e){return[tt.Android,tt.iOS,tt.Web,tt.PC,tt.Mini,tt.HarmonyOS].map((function(t){var n=e.findIndex((function(e){return e.platform===t}));return-1===n?{platform:t,changeTime:0,eventValue:0}:e[n]}))},Ar=function(e,t,n){var r=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return r.userId=e,n.forEach((function(e){r.extraProfile=r.extraProfile||{},r.extraProfile[e.key]=e.value})),r},Nr=function(e){return"undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==Rr(e).type},Or=function(){var e=window.indexedDB;e.databases&&e.databases().then((function(t){t.some((function(e){return"RC_ENGINE_DB"===e.name}))&&e.deleteDatabase("RC_ENGINE_DB")}))},Mr={_delayTime:0,setTime:function(e){var t=(new Date).getTime();Mr._delayTime=t-e},getTime:function(){var e=Mr._delayTime;return(new Date).getTime()-e}},Ur=function(e,t){var n=0;return e.isAutoDelete&&(n|=1),e.isOverwrite&&(n|=2),2===t&&(n|=4),n},Lr=function(){function e(e){this._pullQueue=[],this._isPulling=!1,this._pullTime=0,this._engine=e}return e.prototype._startPull=function(){return l(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,n=e.timestamp,(r=this._pullTime)>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,o===re.SUCCESS?(this._isPulling=!1,this._pullTime=s.syncTime||0,this._startPull()):this._startPull(),[2]}}))}))},e.prototype.pullEntry=function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()},e.prototype.reset=function(){this._pullTime=0,this._isPulling=!1},e}(),Pr="rtcRJoin_data",br="rtcRExit",Dr="rtcRInfo",wr="rtcUData",Vr="rtcUPut",Gr="rtcUDel",Br="rtcSetData",Fr="userSetData",kr="rtcQryData",xr="rtcDelData",Hr="rtcToken",Yr="rtcUserState",qr="rtcUList",Kr="viewerJoinR",jr="viewerExitR",Qr="rtcPullKv",Wr="rtcIdentityChange",Jr="rtcInvite",Xr="rtcCancelInvite",Zr="rtcInviteAnswer",zr="rtcEndInvite",$r="rtcQueryJoined";!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"}(hr||(hr={}));var ei=((dr={})[hr.RtcInput]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType","innerDatas","outerDatas"],dr[hr.RtcUserListOutput]=["users","token","sessionId","roomInfo"],dr[hr.SetUserStatusInput]=["status"],dr[hr.RtcSetDataInput]=["interior","target","key","value","objectName","content"],dr[hr.RtcUserSetDataInput]=["valueInfo","objectName","content"],dr[hr.RtcDataInput]=["interior","target","key","objectName","content"],dr[hr.RtcSetOutDataInput]=["target","valueInfo","objectName","content"],dr[hr.MCFollowInput]=["state"],dr[hr.RtcTokenOutput]=["rtcToken"],dr[hr.RtcQryOutput]=["outInfo"],dr[hr.RtcQryUserOutDataInput]=["userId"],dr[hr.RtcUserOutDataOutput]=["user"],dr[hr.RtcQueryListInput]=["order"],dr[hr.RtcRoomInfoOutput]=["roomId","roomData","userCount","list"],dr[hr.RtcValueInfo]=["key","value"],dr[hr.RtcKeyDeleteInput]=["key"],dr[hr.RtcNotifyMsg]=["type","time","roomId"],dr[hr.RtcPullKV]=["timestamp","roomId"],dr[hr.RtcKVOutput]=["entries","bFullUpdate","syncTime"],dr[hr.RtcQueryUserJoinedInput]=["userId"],dr[hr.RtcQueryUserJoinedOutput]=["info"],dr[hr.RtcInviteInput]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],dr[hr.RtcCancelInviteInput]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],dr[hr.RtcInviteAnswerInput]=["inviteUserId","answerCode","inviteRoomId","inviteSessionId","content","key","value"],dr[hr.RtcEndInviteInput]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"],dr),ti="\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 "+hr.SetUserStatusInput+"\n {\n optional int32 status=1;\n }\n message "+hr.MCFollowInput+"\n {\n required string state = 1;\n }\n message "+hr.RtcQueryListInput+"{\n optional int32 order=1;\n }\n message "+hr.RtcKeyDeleteInput+"{\n repeated string key=1;\n }\n message "+hr.RtcValueInfo+"{\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo{\n required string userId=1;\n repeated "+hr.RtcValueInfo+" userData=2; //用户资源信息\n }\n message "+hr.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 "+hr.RtcValueInfo+" roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message "+hr.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 "+hr.RtcValueInfo+" innerDatas = 7; //用户内部inner数据,角色或者连麦信息等\n repeated "+hr.RtcValueInfo+" outerDatas = 8; //用户内部outer数据,自定义数据结构RtcInput。\n }\n message "+hr.RtcQryOutput+"{\n repeated "+hr.RtcValueInfo+" outInfo=1;\n }\n message "+hr.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 "+hr.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 "+hr.RtcUserSetDataInput+" {\n repeated "+hr.RtcValueInfo+" valueInfo = 1;\n required string objectName = 2;\n repeated "+hr.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 "+hr.RtcTokenOutput+"{\n required string rtcToken=1;\n }\n message "+hr.RtcSetOutDataInput+"{\n required targetType target=1;\n repeated "+hr.RtcValueInfo+" valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message "+hr.RtcQryUserOutDataInput+"{\n repeated string userId = 1;\n }\n message "+hr.RtcUserOutDataOutput+"{\n repeated RtcUserInfo user = 1;\n }\n message "+hr.RtcNotifyMsg+" \n {\n required int32 type= 1; //(通知类型 1:rtc房间状态KV变更通知)\n optional int64 time= 2; //消息产生时间\n optional string roomId=3; //主播房间id\n }\n message "+hr.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 "+hr.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 "+hr.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 "+hr.RtcQueryUserJoinedOutput+"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message "+hr.RtcViewerJoinedOutput+"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV属性对象集合\n optional int64 syncTime = 3;//所有属性的最大时间戳(下次拉取KV时用)。\n }\n message "+hr.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 "+hr.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 "+hr.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 "+hr.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",ni=function(){function e(e,t,n,r,i,o){this.runtime=e,this.rtcCodec=t,this._watcher=n,this._options=r,this.logger=i,this.statisticLog=o,this._appkey=this._options.appkey,this._rtcKVManager=new Lr(this)}return e.prototype.registerRTCSignalingListener=function(e){this._rtcSignalingListener=e},e.prototype.getInnerLogger=function(){return this.logger},e.prototype.getInnerStatisticLog=function(){return this.statisticLog},e.prototype.pullRTCRoomEntry=function(e,t){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return d(this,(function(c){switch(c.label){case 0:return t=this.rtcCodec.encode(hr.RtcPullKV,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,Qr,!0,t)];case 1:return n=c.sent(),r=n.code,i=n.buffer,r!==re.SUCCESS?[2,{code:r}]:(o=this.rtcCodec.decode(hr.RtcKVOutput,i),s=o.entries,a=o.syncTime,s=(s||[]).map((function(e){return u(u({},e),{timestamp:Mn(e.timestamp)})})),this._watcher.onRTCDataChange(s,e),[2,{code:r,data:{kvEntries:s,syncTime:Mn(a)}}])}}))}))},e.prototype._receiveRtcKv=function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=this.rtcCodec.decode(hr.RtcNotifyMsg,e),n=t.time,r=t.type,i=t.roomId;1===r&&this._rtcKVManager.pullEntry(i,Mn(n))}},e.prototype.destroy=function(){},e}();function ri(e){var t=function(){function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,r,o;return t?(o=(e>>>=0)>=0&&e<256)&&(r=u[e])?r:(n=i(e,(0|e)<0?-1:0,!0),o&&(u[e]=n),n):(o=(e|=0)>=-128&&e<128)&&(r=a[e])?r:(n=i(e,e<0?-1:0,!1),o&&(a[e]=n),n)}function r(e,t){if(isNaN(e)||!isFinite(e))return t?g:_;if(t){if(e<0)return g;if(e>=d)return R}else{if(-h>=e)return v;if(e+1>=h)return T}return e<0?r(-e,t).neg():i(0|e%l,0|e/l,t)}function i(t,n,r){return new e(t,n,r)}function o(e,t,n){var i,s,a,u,l,d,h;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return _;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||n>36)throw RangeError("radix");if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(e.substring(1),t,n).neg();for(s=r(c(n,8)),a=_,u=0;u<e.length;u+=8)l=Math.min(8,e.length-u),d=parseInt(e.substring(u,u+l),n),l<8?(h=r(c(n,l)),a=a.mul(h).add(r(d))):a=(a=a.mul(s)).add(r(d));return a.unsigned=t,a}function s(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?o(t):i(t.low,t.high,t.unsigned)}var a,u,c,l,d,h,p,_,g,f,E,I,T,R,v,C;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,a={},u={},e.fromInt=n,e.fromNumber=r,e.fromBits=i,c=Math.pow,e.fromString=o,e.fromValue=s,h=(d=(l=4294967296)*l)/2,p=n(16777216),_=n(0),e.ZERO=_,g=n(0,!0),e.UZERO=g,f=n(1),e.ONE=f,E=n(1,!0),e.UONE=E,I=n(-1),e.NEG_ONE=I,T=i(-1,2147483647,!1),e.MAX_VALUE=T,R=i(-1,-1,!0),e.MAX_UNSIGNED_VALUE=R,v=i(0,-2147483648,!1),e.MIN_VALUE=v,(C=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},C.toString=function(e){var t,n,i,o,s,a,u,l;if((e=e||10)<2||e>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(v)?(t=r(e),i=(n=this.div(t)).mul(t).sub(this),n.toString(e)+i.toInt().toString(e)):"-"+this.neg().toString(e);for(o=r(c(e,6),this.unsigned),s=this,a="";;){if(u=s.div(o),l=(s.sub(u.mul(o)).toInt()>>>0).toString(e),(s=u).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){var e,t;if(this.isNegative())return this.eq(v)?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},C.isZero=function(){return 0===this.high&&0===this.low},C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return!(1&~this.low)},C.isEven=function(){return!(1&this.low)},C.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)},C.eq=C.equals,C.notEquals=function(e){return!this.eq(e)},C.neq=C.notEquals,C.lessThan=function(e){return this.comp(e)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(e){return this.comp(e)<=0},C.lte=C.lessThanOrEqual,C.greaterThan=function(e){return this.comp(e)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(e){return this.comp(e)>=0},C.gte=C.greaterThanOrEqual,C.compare=function(e){if(t(e)||(e=s(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(v)?v:this.not().add(f)},C.neg=C.negate,C.add=function(e){var n,r,o,a,u,c,l,d,h,p,_;return t(e)||(e=s(e)),n=this.high>>>16,r=65535&this.high,o=this.low>>>16,a=65535&this.low,u=e.high>>>16,c=65535&e.high,l=e.low>>>16,d=0,h=0,p=0,_=0,p+=(_+=a+(65535&e.low))>>>16,h+=(p+=o+l)>>>16,d+=(h+=r+c)>>>16,d+=n+u,i((p&=65535)<<16|(_&=65535),(d&=65535)<<16|(h&=65535),this.unsigned)},C.subtract=function(e){return t(e)||(e=s(e)),this.add(e.neg())},C.sub=C.subtract,C.multiply=function(e){var n,o,a,u,c,l,d,h,g,f,E,I;return this.isZero()?_:(t(e)||(e=s(e)),e.isZero()?_:this.eq(v)?e.isOdd()?v:_:e.eq(v)?this.isOdd()?v:_:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(p)&&e.lt(p)?r(this.toNumber()*e.toNumber(),this.unsigned):(n=this.high>>>16,o=65535&this.high,a=this.low>>>16,u=65535&this.low,c=e.high>>>16,l=65535&e.high,d=e.low>>>16,g=0,f=0,E=0,I=0,E+=(I+=u*(h=65535&e.low))>>>16,f+=(E+=a*h)>>>16,E&=65535,f+=(E+=u*d)>>>16,g+=(f+=o*h)>>>16,f&=65535,g+=(f+=a*d)>>>16,f&=65535,g+=(f+=u*l)>>>16,g+=n*h+o*d+a*l+u*c,i((E&=65535)<<16|(I&=65535),(g&=65535)<<16|(f&=65535),this.unsigned)))},C.mul=C.multiply,C.divide=function(e){var n,i,o,a,u,l,d;if(t(e)||(e=s(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:_;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return E;o=g}else{if(this.eq(v))return e.eq(f)||e.eq(I)?v:e.eq(v)?f:(n=this.shr(1).div(e).shl(1)).eq(_)?e.isNegative()?f:I:(i=this.sub(e.mul(n)),o=n.add(i.div(e)));if(e.eq(v))return this.unsigned?g:_;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(n=Math.max(1,Math.floor(i.toNumber()/e.toNumber())),u=(a=Math.ceil(Math.log(n)/Math.LN2))<=48?1:c(2,a-48),d=(l=r(n)).mul(e);d.isNegative()||d.gt(i);)d=(l=r(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=f),o=o.add(l),i=i.sub(d)}return o},C.div=C.divide,C.modulo=function(e){return t(e)||(e=s(e)),this.sub(this.div(e).mul(e))},C.mod=C.modulo,C.not=function(){return i(~this.low,~this.high,this.unsigned)},C.and=function(e){return t(e)||(e=s(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},C.or=function(e){return t(e)||(e=s(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},C.xor=function(e){return t(e)||(e=s(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},C.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)},C.shl=C.shiftLeft,C.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)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(e){var n;return t(e)&&(e=e.toInt()),0===(e&=63)?this:(n=this.high,e<32?i(this.low>>>e|n<<32-e,n>>>e,this.unsigned):i(32===e?n:n>>>e-32,0,this.unsigned))},C.shru=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},C.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},C.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]},C.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}(),n=function(e){function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){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 r(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)}function i(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,d=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,_=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=l?(a=0,s=l):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[n+p]=255&a,p+=_,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+p]=255&s,p+=_,s/=256,c-=8);e[n+p-_]|=128*g}var o,s,a,u,c,l=function(e,t,n){if(void 0===e&&(e=l.DEFAULT_CAPACITY),void 0===t&&(t=l.DEFAULT_ENDIAN),void 0===n&&(n=l.DEFAULT_NOASSERT),!n){if((e|=0)<0)throw RangeError("Illegal capacity");t=!!t,n=!!n}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=n};return l.VERSION="5.0.1",l.LITTLE_ENDIAN=!0,l.BIG_ENDIAN=!1,l.DEFAULT_CAPACITY=16,l.DEFAULT_ENDIAN=l.BIG_ENDIAN,l.DEFAULT_NOASSERT=!1,l.Long=e||null,(o=l.prototype).__isByteBuffer__,Object.defineProperty(o,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1}),s=new ArrayBuffer(0),a=String.fromCharCode,l.accessor=function(){return Uint8Array},l.allocate=function(e,t,n){return new l(e,t,n)},l.concat=function(e,t,n,r){var i,o,s,a,u,c;for(("boolean"==typeof t||"string"!=typeof t)&&(r=n,n=t,t=void 0),i=0,s=0,a=e.length;a>s;++s)l.isByteBuffer(e[s])||(e[s]=l.wrap(e[s],t)),(o=e[s].limit-e[s].offset)>0&&(i+=o);if(0===i)return new l(0,n,r);for(c=new l(i,n,r),s=0;a>s;)(o=(u=e[s++]).limit-u.offset)<=0||(c.view.set(u.view.subarray(u.offset,u.limit),c.offset),c.offset+=o);return c.limit=c.offset,c.offset=0,c},l.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},l.type=function(){return ArrayBuffer},l.wrap=function(e,t,n,r){var i,s;if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return l.fromBase64(e,n);case"hex":return l.fromHex(e,n);case"binary":return l.fromBinary(e,n);case"utf8":return l.fromUTF8(e,n);case"debug":return l.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");if(l.isByteBuffer(e))return(i=o.clone.call(e)).markedOffset=-1,i;if(e instanceof Uint8Array)i=new l(0,n,r),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 l(0,n,r),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 l(e.length,n,r)).limit=e.length,s=0;s<e.length;++s)i.view[s]=e[s]}return i},o.writeBitSet=function(e,t){var n,r,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(r=t,o=(i=e.length)>>3,s=0,t+=this.writeVarint32(i,t);o--;)n=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(n,t++);if(i>s){for(a=0,n=0;i>s;)n|=(1&!!e[s++])<<a++;this.writeByte(n,t++)}return u?(this.offset=t,this):t-r},o.readBitSet=function(e){var t,n,r,i,o,s,a,u=void 0===e;for(u&&(e=this.offset),i=(r=(n=this.readVarint32(e)).value)>>3,o=0,s=[],e+=n.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(r>o)for(a=0,t=this.readByte(e++);r>o;)s[o++]=!!(1&t>>a++);return u&&(this.offset=e),s},o.readBytes=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}return n=this.slice(t,t+e),r&&(this.offset+=e),n},o.writeBytes=o.append,o.writeInt8=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},o.writeByte=o.writeInt8,o.readInt8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return!(128&~(t=this.view[e]))&&(t=-(255-t+1)),n&&(this.offset+=1),t},o.readByte=o.readInt8,o.writeUint8=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},o.writeUInt8=o.writeUint8,o.readUint8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=this.view[e],n&&(this.offset+=1),t},o.readUInt8=o.readUint8,o.writeInt16=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n: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),r&&(this.offset+=2),this},o.writeShort=o.writeInt16,o.readInt16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+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)),n&&(this.offset+=2),t},o.readShort=o.readInt16,o.writeUint16=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n: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),r&&(this.offset+=2),this},o.writeUInt16=o.writeUint16,o.readUint16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+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]),n&&(this.offset+=2),t},o.readUInt16=o.readUint16,o.writeInt32=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n: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),r&&(this.offset+=4),this},o.writeInt=o.writeInt32,o.readInt32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}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,n&&(this.offset+=4),t},o.readInt=o.readInt32,o.writeUint32=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n: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),r&&(this.offset+=4),this},o.writeUInt32=o.writeUint32,o.readUint32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}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),n&&(this.offset+=4),t},o.readUInt32=o.readUint32,e&&(o.writeInt64=function(t,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,o=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o):(this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),s&&(this.offset+=8),this},o.writeLong=o.writeInt64,o.readInt64=function(t){var n,r,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 n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!1),o&&(this.offset+=8),i},o.readLong=o.readInt64,o.writeUint64=function(t,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,o=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o):(this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),s&&(this.offset+=8),this},o.writeUInt64=o.writeUint64,o.readUint64=function(t){var n,r,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 n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!0),o&&(this.offset+=8),i},o.readUInt64=o.readUint64),o.writeFloat32=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},o.writeFloat=o.writeFloat32,o.readFloat32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,23,4),n&&(this.offset+=4),t},o.readFloat=o.readFloat32,o.writeFloat64=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},o.writeDouble=o.writeFloat64,o.readFloat64=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,52,8),n&&(this.offset+=8),t},o.readDouble=o.readFloat64,l.MAX_VARINT32_BYTES=5,l.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:1<<21>e?3:1<<28>e?4:5},l.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},l.zigZagDecode32=function(e){return e>>>1^-(1&e)},o.writeVarint32=function(e,t){var n,r,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+=r=l.calculateVarint32(e))>(i=this.buffer.byteLength)&&this.resize((i*=2)>t?i:t),t-=r,e>>>=0;e>=128;)n=128|127&e,this.view[t++]=n,e>>>=7;return this.view[t++]=e,o?(this.offset=t,this):r},o.writeVarint32ZigZag=function(e,t){return this.writeVarint32(l.zigZagEncode32(e),t)},o.readVarint32=function(e){var t,n,r,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)}n=0,r=0;do{if(!this.noAssert&&e>this.limit)throw(i=Error("Truncated")).truncated=!0,i;t=this.view[e++],n<5&&(r|=(127&t)<<7*n),++n}while(128&t);return r|=0,o?(this.offset=e,r):{value:r,length:n}},o.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=l.zigZagDecode32(t.value):t=l.zigZagDecode32(t),t},e&&(l.MAX_VARINT64_BYTES=10,l.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:1<<21>n?3:4:r<16384?r<128?5:6:1<<21>r?7:8:i<128?9:10},l.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()},l.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,n){var r,i,o,s,a,u=void 0===n;if(u&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}switch("number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),r=l.calculateVarint64(t),i=t.toInt()>>>0,o=t.shiftRightUnsigned(28).toInt()>>>0,s=t.shiftRightUnsigned(56).toInt()>>>0,(n+=r)>(a=this.buffer.byteLength)&&this.resize((a*=2)>n?a:n),n-=r,r){case 10:this.view[n+9]=1&s>>>7;case 9:this.view[n+8]=9!==r?128|s:127&s;case 8:this.view[n+7]=8!==r?128|o>>>21:127&o>>>21;case 7:this.view[n+6]=7!==r?128|o>>>14:127&o>>>14;case 6:this.view[n+5]=6!==r?128|o>>>7:127&o>>>7;case 5:this.view[n+4]=5!==r?128|o:127&o;case 4:this.view[n+3]=4!==r?128|i>>>21:127&i>>>21;case 3:this.view[n+2]=3!==r?128|i>>>14:127&i>>>14;case 2:this.view[n+1]=2!==r?128|i>>>7:127&i>>>7;case 1:this.view[n]=1!==r?128|i:127&i}return u?(this.offset+=r,this):r},o.writeVarint64ZigZag=function(e,t){return this.writeVarint64(l.zigZagEncode64(e),t)},o.readVarint64=function(t){var n,r,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(n=t,r=0,i=0,o=0,s=0,r=127&(s=this.view[t++]),128&s&&(r|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(r|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(r|=(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(r|i<<28,i>>>4|o<<24,!1),u?(this.offset=t,a):{value:a,length:t-n}},o.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=l.zigZagDecode64(n.value):n=l.zigZagDecode64(n),n}),o.writeCString=function(e,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),i=e.length,!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;i>r;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return i=c.calculateUTF16asUTF8(t(e))[1],n+=i+1,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=i+1,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,s?(this.offset=n,this):i},o.readCString=function(e){var t,r,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,c.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),r=n(),!0),o?(this.offset=e,r()):{string:r(),length:e-t}},o.writeIString=function(e,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(i=n,r=c.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+r,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=4+r,this.littleEndian?(this.view[n+3]=255&r>>>24,this.view[n+2]=255&r>>>16,this.view[n+1]=255&r>>>8,this.view[n]=255&r):(this.view[n]=255&r>>>24,this.view[n+1]=255&r>>>16,this.view[n+2]=255&r>>>8,this.view[n+3]=255&r),n+=4,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==i+4+r)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+r));return s?(this.offset=n,this):n-i},o.readIString=function(e){var t,n,r,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,n=this.readUint32(e),r=this.readUTF8String(n,l.METRICS_BYTES,e+=4),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},l.METRICS_CHARS="c",l.METRICS_BYTES="b",o.writeUTF8String=function(e,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return i=n,r=c.calculateUTF16asUTF8(t(e))[1],n+=r,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=r,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),s?(this.offset=n,this):n-i},o.writeString=o.writeUTF8String,l.calculateUTF8Chars=function(e){return c.calculateUTF16asUTF8(t(e))[0]},l.calculateUTF8Bytes=function(e){return c.calculateUTF16asUTF8(t(e))[1]},l.calculateString=l.calculateUTF8Bytes,o.readUTF8String=function(e,t,r){var i,o,s,a,u;if("number"==typeof t&&(r=t,t=void 0),(i=void 0===r)&&(r=this.offset),void 0===t&&(t=l.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(s=0,a=r,t===l.METRICS_CHARS){if(o=n(),c.decodeUTF8(function(){return e>s&&r<this.limit?this.view[r++]:null}.bind(this),(function(e){++s,c.UTF8toUTF16(e,o)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=r,o()):{string:o(),length:r-a}}if(t===l.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}if(u=r+e,c.decodeUTF8toUTF16(function(){return u>r?this.view[r++]:null}.bind(this),o=n(),this.noAssert),r!==u)throw RangeError("Illegal range: Truncated data, "+r+" == "+u);return i?(this.offset=r,o()):{string:o(),length:r-a}}throw TypeError("Unsupported metrics: "+t)},o.readString=o.readUTF8String,o.writeVString=function(e,n){var r,i,o,s,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(o=n,r=c.calculateUTF16asUTF8(t(e),this.noAssert)[1],i=l.calculateVarint32(r),n+=i+r,s=this.buffer.byteLength,n>s&&this.resize((s*=2)>n?s:n),n-=i+r,n+=this.writeVarint32(r,n),c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==o+r+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+r+i));return a?(this.offset=n,this):n-o},o.readVString=function(e){var t,n,r,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,n=this.readVarint32(e),r=this.readUTF8String(n.value,l.METRICS_BYTES,e+=n.length),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},o.append=function(e,t,n){var r,i,o;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof l||(e=l.wrap(e,t)),(i=e.limit-e.offset)<=0||((n+=i)>(o=this.buffer.byteLength)&&this.resize((o*=2)>n?o:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(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 l(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 n,r,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===(n=t-e)?(this.buffer=s,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this):(r=new ArrayBuffer(n),(i=new Uint8Array(r)).set(this.view.subarray(e,t)),this.buffer=r,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,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 l(0,this.littleEndian,this.noAssert);var n=t-e,r=new l(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},o.copyTo=function(e,t,n,r){var i,o,s;if(!this.noAssert&&!l.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o=void 0===t)?e.offset:0|t,n=(i=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);return 0===(s=r-n)?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(n,r),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,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;n>t;)this.view[t++]=e;return r&&(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,n){var r,i,o,s,a;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof l||(e=l.wrap(e,t)),(i=e.limit-e.offset)<=0||((o=i-n)>0?(s=new ArrayBuffer(this.buffer.byteLength+o),(a=new Uint8Array(s)).set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=s,this.view=a,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,n+=o):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(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,n;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),(n=new Uint8Array(t)).set(this.view),this.buffer=t,this.view=n),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 n=this.clone();return n.offset=e,n.limit=t,n},o.toBuffer=function(e){var t,n=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: Not an integer");if(n>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,n<0||n>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+r+" <= "+this.buffer.byteLength)}return e||0!==n||r!==this.buffer.byteLength?n===r?s:(t=new ArrayBuffer(r-n),new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(n,r),0),t):this.buffer},o.toArrayBuffer=o.toBuffer,o.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(n=t=e="utf8"),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}},u=function(){var e,t,n={},r=[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=r.length;t>e;++e)i[r[e]]=e;return n.encode=function(e,t){for(var n,i;null!==(n=e());)t(r[63&n>>2]),i=(3&n)<<4,null!==(n=e())?(t(r[63&((i|=15&n>>4)|15&n>>4)]),i=(15&n)<<2,null!==(n=e())?(t(r[63&(i|3&n>>6)]),t(r[63&n])):(t(r[63&i]),t(61))):(t(r[63&i]),t(61),t(61))},n.decode=function(e,t){function n(e){throw Error("Illegal character code: "+e)}for(var r,o,s;null!==(r=e());)if(void 0===(o=i[r])&&n(r),null!==(r=e())&&(void 0===(s=i[r])&&n(r),t(o<<2>>>0|(48&s)>>4),null!==(r=e()))){if(void 0===(o=i[r])){if(61===r)break;n(r)}if(t((15&s)<<4>>>0|(60&o)>>2),null!==(r=e())){if(void 0===(s=i[r])){if(61===r)break;n(r)}t((3&o)<<6>>>0|s)}}},n.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},n}(),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 r;return u.encode(function(){return t>e?this.view[e++]:null}.bind(this),r=n()),r()},l.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new l(e.length/4*3,n),i=0;return u.decode(t(e),(function(e){r.view[i++]=e})),r.limit=i,r},l.btoa=function(e){return l.fromBinary(e).toBase64()},l.atob=function(e){return l.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 n=[],r=[];t>e;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},l.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,o=new l(i,t);i>r;){if((n=e.charCodeAt(r))>255)throw RangeError("illegal char code: "+n);o.view[r++]=n}return o.limit=i,o},o.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",s="";r>n;){if(-1!==n&&(i+=(t=this.view[n])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";s+=i+o+"\n",i=o=""}i+=n===this.offset&&n===this.limit?n===this.markedOffset?"!":"|":n===this.offset?n===this.markedOffset?"[":"<":n===this.limit?n===this.markedOffset?"]":">":n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";s+=i+o+"\n"}return e?s:i},l.fromDebug=function(e,t,n){for(var r,i,o=e.length,s=new l(0|(o+1)/3,t,n),a=0,u=0,c=!1,d=!1,h=!1,p=!1,_=!1;o>a;){switch(r=e.charAt(a++)){case"!":if(!n){if(d||h||p){_=!0;break}d=h=p=!0}s.offset=s.markedOffset=s.limit=u,c=!1;break;case"|":if(!n){if(d||p){_=!0;break}d=p=!0}s.offset=s.limit=u,c=!1;break;case"[":if(!n){if(d||h){_=!0;break}d=h=!0}s.offset=s.markedOffset=u,c=!1;break;case"<":if(!n){if(d){_=!0;break}d=!0}s.offset=u,c=!1;break;case"]":if(!n){if(p||h){_=!0;break}p=h=!0}s.limit=s.markedOffset=u,c=!1;break;case">":if(!n){if(p){_=!0;break}p=!0}s.limit=u,c=!1;break;case"'":if(!n){if(h){_=!0;break}h=!0}s.markedOffset=u,c=!1;break;case" ":c=!1;break;default:if(!n&&c){_=!0;break}if(i=parseInt(r+e.charAt(a++),16),!n&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[u++]=i,c=!0}if(_)throw TypeError("Illegal str: Invalid symbol at "+a)}if(!n){if(!d||!p)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 n,r=new Array(t-e);t>e;)(n=this.view[e++])<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},l.fromHex=function(e,t,n){var r,i,o,s,a;if(!n){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 l(0|i/2,t),s=0,a=0;i>s;s+=2){if(r=parseInt(e.substring(s,s+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[a++]=r}return o.limit=a,o},c=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(192|31&n>>6),t(128|63&n)):n<65536?(t(224|15&n>>12),t(128|63&n>>6),t(128|63&n)):(t(240|7&n>>18),t(128|63&n>>12),t(128|63&n>>6),t(128|63&n)),n=null},decodeUTF8:function(e,t){for(var n,r,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!==(n=e());)if(128&n)if(192==(224&n))null===(r=e())&&s([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))(null===(r=e())||null===(i=e()))&&s([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(o=e()))&&s([n,r,i,o]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}else t(n)},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(t(55296+((n-=65536)>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,n)}))},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,n)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,(function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4})),[n,r]}};return e}(),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 r;try{c.decodeUTF8toUTF16(function(){return t>e?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},l.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new l(c.calculateUTF16asUTF8(t(e),!0)[1],n,r),o=0;return c.encodeUTF16toUTF8(t(e),(function(e){i.view[o++]=e})),i.limit=o,i},l}(t),r=function(t,n){var r,i,o={};return o.ByteBuffer=t,o.c=t,r=t,o.Long=n||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")}],n=null;for(e=0;e<t.length;e++){try{n=t[e]()}catch(e){continue}break}if(!n)throw Error("XMLHttpRequest is not supported");return n},e.fetch=function(t,n){if(n&&"function"!=typeof n&&(n=null),e.IS_NODE)if(n)g.readFile(t,(function(e,t){n(e?null:""+t)}));else try{return g.readFileSync(t)}catch(e){return null}else{var r=e.XHR();if(r.open("GET",t,!!n),r.setRequestHeader("Accept","text/plain"),"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/plain"),!n)return r.send(null),200==r.status||0==r.status&&"string"==typeof r.responseText?r.responseText:null;if(r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0==r.status&&"string"==typeof r.responseText?n(r.responseText):n(null))},4==r.readyState)return;r.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 n(e,n){var r=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=0|i*r,!n&&r<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return r}function r(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return 1/0*n;if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function i(e,t,n){void 0===e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}var o,s,a={},u=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},c=u.prototype;return c._readString=function(){var e,n='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;if(n.lastIndex=this.index-1,!(e=n.exec(this.source)))throw Error("unterminated string");return this.index=n.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,e[1]},c.next=function(){var e,n,r,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(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;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},c.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},c.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},c.omit=function(e){return this.peek()===e&&(this.next(),!0)},c.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,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},r=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!r||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!r)throw Error("unexpected 'import'");"public"===(e=this.tn.peek())&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n.imports.push(e);break;case"syntax":if(!r)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),r=!1;break;case"enum":this._parseEnum(n),r=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},o.parse=function(e){return new o(e).parse()},s._readString=function(){var e,t,n="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},s._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return r(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},s._parseOption=function(e,n){var r,i=this.tn.next(),o=!1;if("("===i&&(o=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal option name: "+i);r=i,o&&(this.tn.skip(")"),r="("+r+")",i=this.tn.peek(),t.FQTYPEREF.test(i)&&(r+=i,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,r),n||this.tn.skip(";")},s._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)i(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?i(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},s._parseService=function(e){var n,r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);for(n={name:r,rpc:{},options:{}},this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if("rpc"!==r)throw Error("illegal service token: "+r);this._parseServiceRPC(n)}this.tn.omit(";"),e.services.push(n)},s._parseServiceRPC=function(e){var n,r,i="rpc",o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal rpc service method name: "+o);if(n=o,r={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(r.request_stream=!0,o=this.tn.next()),!t.TYPEREF.test(o))throw Error("illegal rpc service request type: "+o);if(r.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()&&(r.response_stream=!0,o=this.tn.next()),r.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(r)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[i]&&(e[i]={}),e[i][n]=r},s._parseMessage=function(e,r){var i=!!r,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("="),r.id=n(this.tn.next()),s.isGroup=!0),"["===(o=this.tn.peek())&&r&&this._parseFieldOptions(r),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,r,i){var o,s,a;if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);if(o={rule:r,type:"",name:"",options:{},id:0},"map"===r){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=n(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=n(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},s._parseMessageOneOf=function(e){var n,r,i,o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal oneof name: "+o);for(r=o,i=[],this.tn.skip("{");"}"!==(o=this.tn.next());)(n=this._parseMessageField(e,"optional",o)).oneof=r,i.push(n.id);this.tn.omit(";"),e.oneofs[r]=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 r,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("="),r={name:o,id:n(this.tn.next(),!0)},"["===(o=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),i.values.push(r)}this.tn.omit(";"),e.enums.push(i)},s._parseExtensionRanges=function(){var t,n,i,o=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=r(t)}if(n.push(i),2===n.length)break;if("to"!==this.tn.peek()){n.push(i);break}this.tn.next()}o.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),o},s._parseExtend=function(e){var n,r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);for(n={ref:r,fields:[]},this.tn.skip("{");"}"!==(r=this.tn.next());)if(t.RULE.test(r))this._parseMessageField(n,r);else{if(!t.TYPEREF.test(r))throw Error("illegal extend token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(n,"optional",r)}return this.tn.omit(";"),e.messages.push(n),n},s.toString=function(){return"Parser at line "+this.tn.line},a.Parser=o,a}(o,o.Lang),o.Reflect=function(e){function n(t,n){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}function i(t,n){var r=n.readVarint32(),o=7&r,s=r>>>3;switch(o){case e.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(!(128&~r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:i(s,n);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:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+o)}return!0}var o,s,a,u,c,l,d,h,p,_,g,f,E,I,T,R,v={},C=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},y=C.prototype;return y.fqn=function(){for(var e=this.name,t=this;null!=(t=t.parent);)e=t.name+"."+e;return e},y.toString=function(e){return(e?this.className+" ":"")+this.fqn()},y.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},v.T=C,o=function(e,t,n,r,i){C.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},(s=o.prototype=Object.create(C.prototype)).getChildren=function(e){var t,n,r;if(null==(e=e||null))return this.children.slice();for(t=[],n=0,r=this.children.length;r>n;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},s.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof c.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof c.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},s.getChild=function(e){var t,n,r="number"==typeof e?"id":"name";for(t=0,n=this.children.length;n>t;++t)if(this.children[t][r]===e)return this.children[t];return null},s.resolve=function(e,t){var n,r="string"==typeof e?e.split("."):e,i=this,o=0;if(""===r[o]){for(;null!==i.parent;)i=i.parent;o++}do{do{if(!(i instanceof v.Namespace)){i=null;break}if(!((n=i.getChild(r[o]))&&n instanceof v.T&&(!t||n instanceof v.Namespace))){i=null;break}i=n,o++}while(o<r.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,n,r=[],i=e;do{r.unshift(i.name),i=i.parent}while(null!==i);for(t=1;t<=r.length;t++)if(n=r.slice(r.length-t),e===this.resolve(n,e instanceof v.Namespace))return n.join(".");return e.fqn()},s.build=function(){var e,t,n,r={},i=this.children;for(t=0,n=i.length;n>t;++t)(e=i[t])instanceof o&&(r[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt()}),r},s.buildOpt=function(){var e,t,n,r,i={},o=Object.keys(this.options);for(e=0,t=o.length;t>e;++e)n=o[e],r=this.options[o[e]],i[n]=r;return i},s.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},v.Namespace=o,a=function(t,n,r,i){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=i,r&&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 r(0):t.defaultValue},u.verifyValue=function(r){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 r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),r>4294967295?0|r:r;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),r<0?r>>>0:r;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return n(r,!1)}catch(e){a(typeof r,e.message)}else a(typeof r,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return n(r,!0)}catch(e){a(typeof r,e.message)}else a(typeof r,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof r&&a(typeof r,"not a boolean"),r;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof r&&a(typeof r,"not a number"),r;case e.TYPES.string:return"string"==typeof r||r&&r instanceof String||a(typeof r,"not a string"),""+r;case e.TYPES.bytes:return t.isByteBuffer(r)?r:t.wrap(r);case e.TYPES.enum:for(i=this.resolvedType.getChildren(e.Reflect.Enum.Value),s=0;s<i.length;s++){if(i[s].name==r)return i[s].id;if(i[s].id==r)return i[s].id}if("proto3"===this.syntax)return("number"!=typeof r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),(r>4294967295||r<0)&&a(typeof r,"not in range for uint32"),r;a(r,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(r&&"object"==typeof r||a(typeof r,"object expected"),r instanceof this.resolvedType.clazz)return r;if(r instanceof e.Builder.Message){for(s in o={},r)r.hasOwnProperty(s)&&(o[s]=r[s]);r=o}return new this.resolvedType.clazz(r)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+r+" (undefined type "+this.type+")")},u.calculateLength=function(t,n){if(null===n)return 0;var i;switch(this.type){case e.TYPES.int32:return n<0?r.calculateVarint64(n):r.calculateVarint32(n);case e.TYPES.uint32:return r.calculateVarint32(n);case e.TYPES.sint32:return r.calculateVarint32(r.zigZagEncode32(n));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return r.calculateVarint64(n);case e.TYPES.sint64:return r.calculateVarint64(r.zigZagEncode64(n));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return r.calculateVarint32(n);case e.TYPES.double:return 8;case e.TYPES.string:return i=r.calculateUTF8Bytes(n),r.calculateVarint32(i)+i;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");return r.calculateVarint32(n.remaining())+n.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(n),r.calculateVarint32(i)+i;case e.TYPES.group:return(i=this.resolvedType.calculate(n))+r.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")},u.encodeValue=function(t,n,i){var o,s;if(null===n)return i;switch(this.type){case e.TYPES.int32:n<0?i.writeVarint64(n):i.writeVarint32(n);break;case e.TYPES.uint32:i.writeVarint32(n);break;case e.TYPES.sint32:i.writeVarint32ZigZag(n);break;case e.TYPES.fixed32:i.writeUint32(n);break;case e.TYPES.sfixed32:i.writeInt32(n);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(n);break;case e.TYPES.sint64:i.writeVarint64ZigZag(n);break;case e.TYPES.fixed64:i.writeUint64(n);break;case e.TYPES.sfixed64:i.writeInt64(n);break;case e.TYPES.bool:"string"==typeof n?i.writeVarint32("false"===n.toLowerCase()?0:!!n):i.writeVarint32(n?1:0);break;case e.TYPES.enum:i.writeVarint32(n);break;case e.TYPES.float:i.writeFloat32(n);break;case e.TYPES.double:i.writeFloat64(n);break;case e.TYPES.string:i.writeVString(n);break;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");o=n.offset,i.writeVarint32(n.remaining()),i.append(n),n.offset=o;break;case e.TYPES.message:s=(new r).LE(),this.resolvedType.encode(n,s),i.writeVarint32(s.offset),i.append(s.flip());break;case e.TYPES.group:this.resolvedType.encode(n,i),i.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")}return i},u.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},u.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return r.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()},v.Element=a,c=function(e,t,n,r,i,s){o.call(this,e,t,n,r,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},(l=c.prototype=Object.create(o.prototype)).build=function(n){var i,o,s,a;if(this.clazz&&!n)return this.clazz;for(i=function(e,n){function i(t,n,o,s){var a,u,c,l,d,h,p;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(r.isByteBuffer(t))return n?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,n,o,s)})),u;if(u={},t instanceof e.Map){for(l=(c=t.entries()).next();!l.done;l=c.next())u[t.keyElem.valueToString(l.value[0])]=i(l.value[1],n,o,t.valueElem.resolvedType);return u}for(p in d=t.$type,h=void 0,t)t.hasOwnProperty(p)&&(u[p]=d&&(h=d.getChild(p))?i(t[p],n,o,h.resolvedType):i(t[p],n,o));return u}var o,s,a=n.getChildren(e.Reflect.Message.Field),u=n.getChildren(e.Reflect.Message.OneOf),c=function(t){var i,o,s,l;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"!==n.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 c)||Array.isArray(t)||t instanceof e.Map||r.isByteBuffer(t)||t instanceof ArrayBuffer||e.Long&&t instanceof e.Long)for(i=0,o=arguments.length;o>i;++i)void 0!==(l=arguments[i])&&this.$set(a[i].name,l);else this.$set(t)},l=c.prototype=Object.create(e.Builder.Message.prototype);for(l.add=function(t,r,i){var o=n._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");r=o.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},l.$add=l.add,l.set=function(t,r,i){var o,s,a;if(t&&"object"==typeof t){for(o in i=r,t)t.hasOwnProperty(o)&&void 0!==(r=t[o])&&this.$set(o,r,i);return this}if(s=n._fieldsByName[t],i)this[t]=r;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]=r=s.verifyValue(r)}return s&&s.oneof&&(a=this[s.oneof.name],null!==r?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===t&&(this[s.oneof.name]=null)),this},l.$set=l.set,l.get=function(t,r){if(r)return this[t];var i=n._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]},l.$get=l.get,o=0;o<a.length;o++)(s=a[o])instanceof e.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(e){var t,r,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})),r=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},i=function(){return this[e.name]},null===n.getChild("set"+o)&&(l["set"+o]=r),null===n.getChild("set_"+t)&&(l["set_"+t]=r),null===n.getChild("get"+o)&&(l["get"+o]=i),null===n.getChild("get_"+t)&&(l["get_"+t]=i)}(s);return l.encode=function(e,r){var i,o;"boolean"==typeof e&&(r=e,e=void 0),i=!1,e||(e=new t,i=!0),o=e.littleEndian;try{return n.encode(this,e.LE(),r),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},c.encode=function(e,t,n){return new c(e).encode(t,n)},l.calculate=function(){return n.calculate(this)},l.encodeDelimited=function(e){var t,i=!1;return e||(e=new r,i=!0),t=(new r).LE(),n.encode(this,t).flip(),e.writeVarint32(t.remaining()),e.append(t),i?e.flip():e},l.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},l.toArrayBuffer=l.encodeAB,l.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},l.toBuffer=l.encodeNB,l.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},l.toBase64=l.encode64,l.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},l.toHex=l.encodeHex,l.toRaw=function(e,t){return i(this,!!e,!!t,this.$type)},l.encodeJSON=function(){return JSON.stringify(i(this,!0,!0,this.$type))},c.decode=function(e,t){var i,o;"string"==typeof e&&(e=r.wrap(e,t||"base64")),i=(e=r.isByteBuffer(e)?e:r.wrap(e)).littleEndian;try{return o=n.decode(e.LE()),e.LE(i),o}catch(t){throw e.LE(i),t}},c.decodeDelimited=function(e,t){var i,o,s;if("string"==typeof e&&(e=r.wrap(e,t||"base64")),(e=r.isByteBuffer(e)?e:r.wrap(e)).remaining()<1)return null;if(i=e.offset,o=e.readVarint32(),e.remaining()<o)return e.offset=i,null;try{return s=n.decode(e.slice(e.offset,e.offset+o).LE()),e.offset+=o,s}catch(t){throw e.offset+=o,t}},c.decode64=function(e){return c.decode(e,"base64")},c.decodeHex=function(e){return c.decode(e,"hex")},c.decodeJSON=function(e){return new c(JSON.parse(e))},l.toString=function(){return n.toString()},Object.defineProperty&&(Object.defineProperty(c,"$options",{value:n.buildOpt()}),Object.defineProperty(l,"$options",{value:c.$options}),Object.defineProperty(c,"$type",{value:n}),Object.defineProperty(l,"$type",{value:n})),c}(e,this),this._fields=[],this._fieldsById={},this._fieldsByName={},s=0,a=this.children.length;a>s;s++)if((o=this.children[s])instanceof g||o instanceof c||o instanceof I){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 c.Field)o.build(),this._fields.push(o),this._fieldsById[o.id]=o,this._fieldsByName[o.name]=o;else if(!(o instanceof c.OneOf||o instanceof E))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[s].toString(!0));return this.clazz=i},l.encode=function(e,t,n){var r,i,o,s,a,u=null;for(o=0,s=this._fields.length;s>o;++o)i=e[(r=this._fields[o]).name],r.required&&null===i?null===u&&(u=r):r.encode(n?i:r.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},l.calculate=function(e){for(var t,n,r=0,i=0,o=this._fields.length;o>i;++i){if(n=e[(t=this._fields[i]).name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},l.decode=function(t,n,r){var o,s,a,u,c,l,d,h,p,_,g,f;for(n="number"==typeof n?n:-1,c=t.offset,l=new this.clazz;t.offset<c+n||-1===n&&t.remaining()>0;){if(a=(o=t.readVarint32())>>>3,(s=7&o)===e.WIRE_TYPES.ENDGROUP){if(a!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[a])u.repeated&&!u.options.packed?l[u.name].push(u.decode(s,t)):u.map?(h=u.decode(s,t),l[u.name].set(h[0],h[1])):(l[u.name]=u.decode(s,t),u.oneof&&(null!==(p=l[u.oneof.name])&&p!==u.name&&(l[p]=null),l[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,g=this._fields.length;g>_;++_)if(null===l[(u=this._fields[_]).name])if("proto3"===this.syntax)l[u.name]=u.defaultValue;else{if(u.required)throw(f=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name)).decoded=l,f;e.populateDefaults&&null!==u.defaultValue&&(l[u.name]=u.defaultValue)}return l},v.Message=c,d=function(t,n,r,i,o,s,a,u,l,d){C.call(this,t,n,s),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=a,this.options=u||{},this.defaultValue=null,this.oneof=l||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof c.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},(h=d.prototype=Object.create(C.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)},h.verifyValue=function(t,n){var r,i,o;if(n=n||!1,r=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&&r(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&r(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!n){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&&!n?t instanceof e.Map?t:(t instanceof Object||r(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&r(typeof t,"no array expected"),this.element.verifyValue(t))},h.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},h.encode=function(t,n,i){var o,s,a,u,c;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 n;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.ensureCapacity(n.offset+=1),s=n.offset,o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],n);a=n.offset-s,(u=r.calculateVarint32(a))>1&&(c=n.slice(s,n.offset),s+=u-1,n.offset=s,n.append(c)),n.writeVarint32(a,s-u)}else for(o=0;o<t.length;o++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[o],n);else this.map?t.forEach((function(t,i){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.writeVarint32(o),n.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,n),n.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,n)}),this):this.hasWirePresence(t,i)&&(n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,n))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return n},h.calculate=function(t,n){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+=r.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+=r.calculateVarint32(s),i+=s}else for(o=0;o<t.length;o++)i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[o]);else this.map?t.forEach((function(t,n){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,n)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=r.calculateVarint32(o),i+=o}),this):this.hasWirePresence(t,n)&&(i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},h.decode=function(t,n,r){var i,o,s,u,c,l,d;if(!(!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){for(o=n.readVarint32(),o=n.offset+o,s=[];n.offset<o;)s.push(this.decode(this.type.wireType,n,!0));return s}if(this.map){if(u=a.defaultFieldValue(this.keyType),i=a.defaultFieldValue(this.type),o=n.readVarint32(),n.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+n.remaining());for((c=n.clone()).limit=c.offset+o,n.offset+=o;c.remaining()>0;)if(t=7&(l=c.readVarint32()),1===(d=l>>>3))u=this.keyElement.decode(c,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(c,t,d)}return[u,i]}return this.element.decode(n,t,this.id)},v.Message.Field=d,p=function(e,t,n,r,i,o,s){d.call(this,e,t,n,null,r,i,o,s),this.extension},p.prototype=Object.create(d.prototype),v.Message.ExtensionField=p,_=function(e,t,n){C.call(this,e,t,n),this.fields=[]},v.Message.OneOf=_,g=function(e,t,n,r,i){o.call(this,e,t,n,r,i),this.className="Enum",this.object=null},g.getName=function(e,t){var n,r,i=Object.keys(e);for(r=0;r<i.length;++r)if(e[n=i[r]]===t)return n;return null},(g.prototype=Object.create(o.prototype)).build=function(t){var n,r,i,o;if(this.object&&!t)return this.object;for(n=new e.Builder.Enum,i=0,o=(r=this.getChildren(g.Value)).length;o>i;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},v.Enum=g,f=function(e,t,n,r){C.call(this,e,t,n),this.className="Enum.Value",this.id=r},f.prototype=Object.create(C.prototype),v.Enum.Value=f,E=function(e,t,n,r){C.call(this,e,t,n),this.field=r},E.prototype=Object.create(C.prototype),v.Extension=E,I=function(e,t,n,r){o.call(this,e,t,n,r),this.className="Service",this.clazz=null},(I.prototype=Object.create(o.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){var n,i=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},o=i.prototype=Object.create(e.Builder.Service.prototype),s=t.getChildren(e.Reflect.Service.RPCMethod);for(n=0;n<s.length;n++)!function(e){o[e.name]=function(n,i){try{try{n=e.resolvedRequestType.clazz.decode(r.wrap(n))}catch(e){if(!(e instanceof TypeError))throw e}if(null===n||"object"!=typeof n)throw Error("Illegal arguments");n instanceof e.resolvedRequestType.clazz||(n=new e.resolvedRequestType.clazz(n)),this.rpcImpl(e.fqn(),n,(function(n,r){if(!n){try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}return r&&r instanceof e.resolvedResponseType.clazz?void i(null,r):void i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}i(n)}))}catch(e){setTimeout(i.bind(this,e),0)}},i[e.name]=function(t,n,r){new i(t)[e.name](n,r)},Object.defineProperty&&(Object.defineProperty(i[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(o[e.name],"$options",{value:i[e.name].$options}))}(s[n]);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)},v.Service=I,T=function(e,t,n,r){C.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},(T.prototype=Object.create(C.prototype)).buildOpt=s.buildOpt,v.Service.Method=T,R=function(e,t,n,r,i,o,s,a){T.call(this,e,t,n,a),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null},R.prototype=Object.create(T.prototype),v.Service.RPCMethod=R,v}(o),o.Builder=function(e,t,n){function r(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,r(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}var i=function(e){this.ns=new n.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},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 n.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},o.create=function(t){var r,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(r=[t];r.length>0;){if(t=r.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 n.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 n.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 n.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){r.push(t),t=u,u=null,this.ptr=s,s=null;continue}u=null}else if(i.isEnum(o))s=new n.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){s.addChild(new n.Enum.Value(this,s,e.name,e.id))}),this),this.ptr.addChild(s);else if(i.isService(o))s=new n.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];s.addChild(new n.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 r,i,o,a;if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions&&(r=!1,s.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(r=!0)})),!r))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 n.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new n.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,n){var i,o,s,a,u,c,l,d,h="/";if("string"==typeof n){if(e.Util.IS_NODE,!0===this.files[n])return this.reset();this.files[n]=!0}else if("object"==typeof n){if(i=n.root,e.Util.IS_NODE,(i.indexOf("\\")>=0||n.file.indexOf("\\")>=0)&&(h="\\"),o=i+h+n.file,!0===this.files[o])return this.reset();this.files[o]=!0}if(t.imports&&t.imports.length>0){for(a=!1,"object"==typeof n?(this.importRoot=n.root,a=!0,s=this.importRoot,n=n.file,(s.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(h="\\")):"string"==typeof n?this.importRoot?s=this.importRoot:n.indexOf("/")>=0?""===(s=n.replace(/\/[^\/]*$/,""))&&(s="/"):n.indexOf("\\")>=0?(s=n.replace(/\\[^\\]*$/,""),h="\\"):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"===(c=t.imports[u]))continue;if(c=s+h+c,!0===this.files[c])continue;if(/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json")),null===(l=e.Util.fetch(c)))throw Error("failed to import '"+c+"' in '"+n+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(l+""),c):this.import(e.DotProto.Parser.parse(l),c)}else n?/\.(\w+)$/.test(n)?this.import(t.imports[u],n.replace(/^(.+)\.(\w+)$/,(function(e,t,n){return t+"_import"+u+"."+n}))):this.import(t.imports[u],n+"_import"+u):this.import(t.imports[u]);a&&(this.importRoot=null)}return t.package&&this.define(t.package),t.syntax&&r(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 r;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof n.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof n.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(r=(this.ptr instanceof n.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=r,r instanceof n.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==r.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(r instanceof n.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=r.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((r=this.ptr.parent.resolve(this.ptr.requestName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=r,!((r=this.ptr.parent.resolve(this.ptr.responseName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=r}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},o.build=function(e){var t,n,r;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,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},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 n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){var r,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}}),n)for(r=Object.keys(n),i=0;i<r.length;i++)o=this.keyElem.valueFromString(r[i]),s=this.valueElem.verifyValue(n[r[i]]),this.map[this.keyElem.valueToString(o)]={key:o,value:s}},i=r.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},i.entries=function(){var e,t,r=[],i=Object.keys(this.map);for(t=0;t<i.length;t++)r.push([(e=this.map[i[t]]).key,e.value]);return n(r)},i.keys=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].key);return n(t)},i.values=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].value);return n(t)},i.forEach=function(e,t){var n,r,i=Object.keys(this.map);for(r=0;r<i.length;r++)e.call(t,(n=this.map[i[r]]).value,n.key,this)},i.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},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},r}(0,o.Reflect),o.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),o.loadJson(o.DotProto.Parser.parse(e),t,n)},o.protoFromString=o.loadProto,o.loadProtoFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,o.loadProto(r,n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:o.loadProto(r,n,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,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"==typeof t||(t=o.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},o.loadJsonFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,o.loadJson(JSON.parse(r),n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:o.loadJson(JSON.parse(r),n,e)},i=e,o.loadProto(i,void 0,"").build("Modules").probuf}(n,t);return r}var ii,oi,si=function(){function e(e,t,n){this.pbmaps=e,this.logger=n,this.pbModules=ri(t)}return e.prototype.getModule=function(e){return new this.pbModules[e]},e.prototype.encode=function(e,t,n){var r=new this.pbModules[e];if(t)try{this.pbmaps[e].forEach((function(e){var n=t[e];void 0!==n&&r["set"+function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e.replace(r,(function(e){return e.toUpperCase()}))}(e,0,1)](n)}))}catch(t){var i="pbname: "+e+", stack: "+t.stack;this.logger?this.logger.error(Re.L_PB_ENCODE_E,i):null===console||void 0===console||console.error(Re.L_PB_ENCODE_E,i)}return n?r:r.toArrayBuffer()},e.prototype.decode=function(e,t){var n=this.pbModules[e].decode(t);return this.fixInt64Values(n)},e.prototype.fixInt64Values=function(e){var t=this;if(e instanceof Array)return e.map((function(e){return t.fixInt64Values(e)}));if(!Jt(e))return e;if(void 0!==e.low&&void 0!==e.high&&Object.prototype.hasOwnProperty.call(e,"unsigned")){var n=e.low;return n<0&&(n+=4294967296),n=n.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{"+n.length+"}$"),n),16)}for(var r in e)e[r]=this.fixInt64Values(e[r]);return e},e}();!function(e){e[e.BJ=1]="BJ",e[e.SG=2]="SG",e[e.NA=3]="NA",e[e.SG_A=4]="SG_A",e[e.SG_B=4]="SG_B",e[e.SA=5]="SA"}(oi||(oi={}));var ai=((ii={})[oi.BJ]={naviUrlBase64:["bmF2LnJvbmctZWRnZS5jb20=","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5yb25nLWVkZ2UuY29t",protocol:Be.HTTPS,weight:-1}],miniCmpBase64:["d3Mucm9uZy1lZGdlLmNvbQ==","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnJvbmctZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="]},ii[oi.SG]={naviUrlBase64:["bmF2LnNnLWxpZ2h0LWVkZ2UuY29t","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1saWdodC1lZGdlLmNvbQ==",protocol:Be.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2ctbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNnLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="]},ii[oi.NA]={naviUrlBase64:["bmF2LnVzLWxpZ2h0LWVkZ2UuY29t","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi51cy1saWdodC1lZGdlLmNvbQ==",protocol:Be.HTTPS,weight:-1}],miniCmpBase64:["d3MudXMtbGlnaHQtZWRnZS5jb20=","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnVzLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="]},ii[oi.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:Be.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2ctYi1saWdodC1lZGdlLmNvbQ==","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNnLWItbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="]},ii[oi.SA]={naviUrlBase64:["bmF2LnNhdS1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zYXUtbGlnaHQtZWRnZS5jb20=",protocol:Be.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2F1LWxpZ2h0LWVkZ2UuY29t","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNhdS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"]},ii);function ui(e){return oi[e]?e:oi.BJ}var ci,li,di,hi,pi,_i,gi,fi=function(){function e(){this.initOption={}}return e.prototype.init=function(e){this.initOption=e},e.prototype.getNaviUrlList=function(e,t){var n,r=this.initOption||{},i=r.areaCode,o=r.navigators,s=(n=i,void 0===n&&(n=oi.BJ),ai[ui(n)].naviUrlBase64).map((function(e){return Kn(e)})),a=[],u=e.split("@")[1];t&&(a=u?u.split(";"):[]);var c=o&&o.length>0?h(h([],a,!0),o,!0):h(h([],a,!0),s,!0);return c.filter((function(e,t){return c.indexOf(e)===t})).map((function(e){return rr(e)}))},e.prototype.getLogUrlPolicyList=function(e,t){var n,r=e||{},i=r.log,o=r.logPolicy,s=this.initOption||{},a=s.areaCode,c=s.logServerUrl,l=(n=a,void 0===n&&(n=oi.BJ),ai[ui(n)].logUrlBase64).map((function(e){return u(u({},e),{addr:Kn(e.addr)})})),d=[],p={level:1,itv:6,times:5};if(i)d.push.apply(d,i.addrs),Object.assign(p,i.policy);else if(o)try{var _=JSON.parse(o);d.push({addr:_.url,protocol:Be.HTTPS,weight:1}),p.level=_.level,p.itv=_.itv,p.times=_.times}catch(n){t.warn(Re.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var g=c?h([{addr:c,protocol:Be.HTTPS,weight:101}],d,!0):h(h([],d,!0),l,!0);return{policy:p,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 u(u({},e),{addr:rr(e.addr,e.protocol)})})).sort((function(e,t){return t.weight-e.weight}))}},e.prototype.getMiniCmpUrlList=function(){var e,t,n=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=oi.BJ),ai[ui(t)].miniCmpBase64).map((function(e){return Kn(e)})),r=(this.initOption||{}).miniCMPProxy;return r&&r.length>0?r:n},e.prototype.getStaticConfigUrl=function(){var e,t;return(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=oi.BJ),ai[ui(t)].staticConfigUrlBase64).map((function(e){return Kn(e)}))},e.prototype.getCloudControllerUrl=function(e){var t,n,r=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(n=r,void 0===n&&(n=oi.BJ),ai[ui(n)].cloudControllerUrlBase64).map((function(e){return Kn(e)}))},e.prototype.getAreaCode=function(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:oi.BJ},e.prototype.setAreaCode=function(e){return!(!e||!oi[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)},e}(),Ei=new fi,Ii=function(){function e(e,t){this.appkey=e,this.logger=t,this.staticUrls=[]}return e.prototype.getStaticConfig=function(){var e;return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:if(!(t=this.getCache()))return[3,6];c.label=1;case 1:return c.trys.push([1,4,,5]),n=JSON.parse(t),Date.now()-(null==n?void 0:n.time)<j?[4,this.decryptData(n.val)]:[3,3];case 2:return r=c.sent(),(i=r.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return rr(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=c.sent(),this.logger.error(Re.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),c.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=c.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(a=c.sent())?void 0:a.areaCode)!==Ei.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==a?void 0:a.bootstrap)||[],(u=null===(e=null==a?void 0:a.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 rr(e.addr,e.protocol)}))||[]}])}}))}))},e.prototype._requestHandle=function(){return l(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:e=(e=h(h([],this.staticUrls,!0),Ei.getStaticConfigUrl(),!0).map((function(e){return rr(e)}))).filter((function(t,n){return e.indexOf(t)===n})),t=0,n=e,u.label=1;case 1:return t<n.length?(r=n[t],this.logger.info(Re.L_GET_STATIC_CONF_T,JSON.stringify({url:r})),i=Date.now(),[4,this.sendRequest(r+"/"+this.appkey)]):[3,4];case 2:if(o=u.sent(),s=o.code,a=o.data,200===s)return this.logger.info(Re.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:s,duration:Date.now()-i})),[2,a];this.logger.warn(Re.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:s,duration:Date.now()-i})),u.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},e}(),Ti={"set.proxy":re.INVALID_PARAMETER_PROXY,"test.proxy":re.INVALID_PARAMETER_TESTHOST,"test.proxy.socksHost":re.INVALID_PARAMETER_TESTHOST,"test.proxy.socksPort":re.INVALID_PARAMETER_TESTHOST,channelId:re.INVALID_PARAMETER_CHANNEL_ID,count:re.INVALID_PARAMETER_COUNT,startTime:re.INVALID_PARAMETER_START_TIME,endTime:re.INVALID_PARAMETER_END_TIME,offset:re.INVALID_PARAMETER_OFFSET,limit:re.INVALID_PARAMETER_LIMIT,keyword:re.INVALID_PARAMETER_KEYWORD,messageTypes:re.INVALID_PARAMETER_MESSAGE_TYPE,messageType:re.INVALID_PARAMETER_MESSAGE_TYPE,typingContentType:re.INVALID_PARAMETER_MESSAGE_TYPE,conversation:re.INVALID_PARAMETER_CONVERSATION,conversationType:re.INVALID_PARAMETER_CONVERSATION_TYPE,targetId:re.INVALID_PARAMETER_TARGET_ID,targetIds:re.INVALID_PARAMETER_TARGET_ID,userId:re.INVALID_PARAMETER_USER_ID,senderUserId:re.INVALID_PARAMETER_USER_ID,timestamp:re.INVALID_PARAMETER_TIMESTAMP,order:re.INVALID_PARAMETER_ORDER,messageId:re.INVALID_PARAMETER_MESSAGE_ID,receivedStatus:re.INVALID_PARAMETER_RECEIVED_STATUS,receivedStatusInfo:re.INVALID_PARAMETER_RECEIVED_STATUS,sentStatus:re.INVALID_PARAMETER_SENT_STATUS,content:re.INVALID_PARAMETER_MESSAGE_CONTENT,messageIds:re.INVALID_PARAMETER_MESSAGE_ARRAY,cleanSpace:re.INVALID_PARAMETER_CLEAN_SPACE,messageDirection:re.INVALID_MESSAGE_DIRECTION,canIncludeExpansion:re.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION,expansion:re.INVALID_PARAMETER_MESSAGE_EXPANSION,disableNotification:re.INVALID_PARAMETER_DISABLE_NOTIFICATION,messages:re.MSG_LIMIT_ERROR,checkDuplicate:re.INVALID_PARAMETER_CHECK_DUPLICATE,messageUId:re.INVALID_PARAMETER_MESSAGE_UID,key:re.INVALID_PARAMETER_KEY,keys:re.INVALID_PARAMETER_KEYS,value:re.INVALID_PARAMETER_VALUE,isAutoDelete:re.INVALID_PARAMETER_IS_AUTO_DELETE,isSendNotification:re.INVALID_PARAMETER_IS_SEND_NOTIFICATION,notificationExtra:re.INVALID_PARAMETER_NOTIFICATION_EXTRA,entries:re.INVALID_PARAMETER_ENTRIES,isForce:re.INVALID_PARAMETER_IS_FORCE,rtcRoomId:re.INVALID_PARAMETER_RTCROOMID,token:re.RC_CONN_TOKEN_INCORRECT,conversations:re.INVALID_PARAMETER_CONVERSATIONS,draft:re.INVALID_PARAMETER_DRAFT,conversationTypes:re.INVALID_PARAMETER_CONVERSATION_TYPE_LIST,levels:re.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevel:re.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevels:re.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationStatus:re.INVALID_PARAMETER_NOTIFICATION_LEVEL,isTop:re.INVALID_PARAMETER_IS_TOP,isUpdateTime:re.INVALID_PARAMETER_IS_UPDATE_TIME,message:re.INVALID_PARAMETER_MESSAGE,mentionedUserIdList:re.INVALID_PARAMETER_USERIDLIST,directionalUserIdList:re.INVALID_PARAMETER_USERIDLIST,directedUserIds:re.INVALID_PARAMETER_USERIDLIST,isStatusMessage:re.INVALID_PARAMETER_IS_STATUS_MESSAGE,pushContent:re.INVALID_PARAMETER_PUSH_CONTENT,pushData:re.INVALID_PARAMETER_PUSH_DATA,isMentioned:re.INVALID_PARAMETER_IS_MENTIONED,mentionedType:re.INVALID_PARAMETER_MENTIONED_TYPE,isVoipPush:re.INVALID_PARAMETER_IS_VOIP_PUSH,pushConfig:re.INVALID_PARAMETER_PUSH_CONFIG,startMsgUId:re.INVALID_PARAMETER_START_MESSAGE_UID,endMsgUId:re.INVALID_PARAMETER_END_MESSAGE_UID,sentTime:re.INVALID_PARAMETER_TIMESTAMP,clearMessageOption:re.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,searchContent:re.SEARCH_PROPS_LIMIT_ERROR,tagId:re.INVALID_PARAMETER_TAG_ID,tagIds:re.INVALID_PARAMETER_TAG_ID,tagName:re.INVALID_PARAMETER_TAG_NAME,containMuted:re.INVALID_PARAMETER_CONTAIN_MUTED,channelType:re.INVALID_PARAMETER_CHANNEL_TYPE,file:re.MEDIA_EXCEPTION,fileType:re.INVALID_PARAMETER_MEDIA_TYPE,contentDisposition:re.INVALID_PARAMETER_CONTENT_DISPOSITION,mediaUrl:re.INVALID_PARAMETER_MEDIA_URL,filename:re.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME,saveName:re.INVALID_PARAMETER_SAVE_NAME,serverType:re.INVALID_PARAMETER_SERVER_TYPE,subscribeType:re.INVALID_PARAMETER_SUBSCRIBE_TYPE,expiry:re.INVALID_PARAMETER_SUBSCRIBE_EXPIRY,subscribeUserIds:re.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS,subscribePageSize:re.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE,beforeCount:re.INVALID_PARAMETER_BEFORE,afterCount:re.INVALID_PARAMETER_AFTER,conversationList:re.INVALID_PARAMETER_CONVERSATION_LIST,conversationTypeNotSupport:re.CONVERSATION_TYPE_NOT_SUPPORT,profile:re.INVALID_PARAMETER_USER_PROFILE,userProfileVisibility:re.INVALID_PARAMETER_USER_PROFILE_VISIBILITY,uniqueId:re.INVALID_PARAMETER_UNIQUE_ID,extra:re.INVALID_PARAMETER_EXTRA},Ri=function(){function e(e){this._context=e}return e.prototype.__getContext=function(){return this._context},e.prototype.createCodec=function(e,t){return this._context.createCodec(e,t)},e.prototype.refetchNaviInfo=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))},e.prototype.getNaviInfo=function(){return this._context.getNaviInfoFromCache()},e.prototype.getCoreVersion=function(){return"5.12.1"},e.prototype.getAPIVersion=function(){return"5.12.1"},e.prototype.getAppkey=function(){return this._context.appkey},e.prototype.getCurrentId=function(){return this._context.getCurrentUserId()},e.prototype.getConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.sendMessage=function(e,t,n){return this._context.sendMessage(e,t,n)},e.prototype.registerMessageType=function(e,t,n,r){void 0===r&&(r=[]),this._context.registerMessageType(e,t,n,r)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getOSInfo=function(){return this._context.getOSInfo()},e.prototype.getProcessInfo=function(){return this._context.getProcessInfo()},e.prototype.getMainProcessInfo=function(){return this._context.getMainProcessInfo()},e.prototype.setCallInfo=function(e,t,n){return this._context.setCallInfo(e,t,n)},e.prototype.createLogger=function(e,t){return this._context.createLogger(e,t)},e.prototype.createStatisticLogger=function(e,t){return this._context.createStatisticLogger(e,t)},e}(),vi="pgMsgP",Ci="chatMsg",yi="pcMsgP",Si="pbMsgP",mi={PRIVATE:"ppMsgS",GROUP:"pgMsgS",CHATROOM:"chatMsgS"},Ai="delMsg",Ni="delUgMsg",Oi="joinChrm",Mi="joinChrmR",Ui="exitChrm",Li="setKV",Pi="delKV",bi="setKVS",Di="delKVS",wi="qryRelationR",Vi="delRelation",Gi="delRelationBatch",Bi="setSeAtt",Fi={PRIVATE:"cleanPMsg",GROUP:"cleanGMsg",ULTRA_GROUP:"cleanGMsg",CUSTOMER_SERVICE:"cleanCMsg",SYSTEM:"cleanSMsg",APP_PUBLIC_SERVICE:"cleanMCMsg",PUBLIC_SERVICE:"cleanMPMsg"},ki="cleanMsgBatch",xi="reqCall",Hi="pullKvMsg",Yi="qryPMsg",qi="qryGMsg",Ki="qryCHMsg",ji="qryCMsg",Qi="qrySMsg",Wi="qryMCMsg",Ji="qryMPMsg",Xi=((ci={})["ppMsgP"]=oe.PRIVATE,ci[vi]=oe.GROUP,ci[Ci]=oe.CHATROOM,ci[yi]=oe.CUSTOMER_SERVICE,ci[Si]=oe.SYSTEM,ci),Zi=((li={})[oe.PRIVATE]=Yi,li[oe.GROUP]=qi,li[oe.CHATROOM]=Ki,li[oe.CUSTOMER_SERVICE]=ji,li[oe.SYSTEM]=Qi,li[oe.APP_PUBLIC_SERVICE]=Wi,li[oe.PUBLIC_SERVICE]=Ji,li),zi=((di={})[oe.PRIVATE]=Fi.PRIVATE,di[oe.GROUP]=Fi.GROUP,di[oe.ULTRA_GROUP]=Fi.ULTRA_GROUP,di[oe.CUSTOMER_SERVICE]=Fi.CUSTOMER_SERVICE,di[oe.SYSTEM]=Fi.SYSTEM,di[oe.APP_PUBLIC_SERVICE]=Fi.APP_PUBLIC_SERVICE,di[oe.PUBLIC_SERVICE]=Fi.PUBLIC_SERVICE,di),$i="1",eo="0",to=1,no=2,ro=3;!function(e){e[e.AT_MOST_ONCE=0]="AT_MOST_ONCE",e[e.AT_LEAST_ONCE=1]="AT_LEAST_ONCE",e[e.EXACTLY_ONCE=2]="EXACTLY_ONCE",e[e.DEFAULT=3]="DEFAULT"}(hi||(hi={})),function(e){e[e.SYMMETRIC=0]="SYMMETRIC",e[e.CONNECT=1]="CONNECT",e[e.CONN_ACK=2]="CONN_ACK",e[e.PUBLISH=3]="PUBLISH",e[e.PUB_ACK=4]="PUB_ACK",e[e.QUERY=5]="QUERY",e[e.QUERY_ACK=6]="QUERY_ACK",e[e.QUERY_CONFIRM=7]="QUERY_CONFIRM",e[e.SUBSCRIBE=8]="SUBSCRIBE",e[e.SUB_ACK=9]="SUB_ACK",e[e.UNSUBSCRIBE=10]="UNSUBSCRIBE",e[e.UNSUB_ACK=11]="UNSUB_ACK",e[e.PING_REQ=12]="PING_REQ",e[e.PING_RESP=13]="PING_RESP",e[e.DISCONNECT=14]="DISCONNECT",e[e.RESERVER2=15]="RESERVER2"}(pi||(pi={})),function(e){e.PUB="pub",e.QUERY="qry"}(_i||(_i={})),function(e){e[e.V4=4]="V4",e[e.V3=3]="V3"}(gi||(gi={}));var io,oo=function(){function e(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=hi.AT_LEAST_ONCE),void 0===r&&(r=!1),this._retain=!1,this.qos=hi.AT_LEAST_ONCE,this._dup=!1,this.syncMsg=!1,e&&e>0&&1===arguments.length?(this._retain=(1&e)>0,this.qos=(6&e)>>1,this._dup=(8&e)>0,this.type=e>>4&15,this.syncMsg=!(8&~e)):(this.type=e,this._retain=t,this.qos=n,this._dup=r)}return e.prototype.encode=function(){var e=this.type<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this._dup?8:0},e}(),so=function(){function e(){}return e.writeUTF=function(e,t){for(var n=this._getBackAndByteSize(e),r=n.back,i=n.byteSize,o=0,s=r.length;o<s;o++)r[o]>255&&(r[o]&=255);return t?r:i<=255?[0,i].concat(r):[i>>8,255&i].concat(r)},e._getBackAndByteSize=function(e){var t=[],n=0;if(Ft(e))for(var r=0,i=e.length;r<i;r++){var o=e.charCodeAt(r);o>=0&&o<=127?(n+=1,t.push(o)):o>=128&&o<=2047?(n+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(n+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:n,back:t}},e.readUTF=function(e){for(var t,n,r=[],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: "+a);a<=65535?r.push(a):(t=(a-=65536)>>10|55296,n=a%1024|56320,r.push(t,n)),(i+1===o.length||r.length>16384)&&(s+=String.fromCharCode.apply(null,r),r.length=0)}return s},e}(),ao=function(){function e(e){this._position=0,this._poolLen=0,this._pool=e,this._poolLen=e.length}return e.prototype.check=function(){return this._position>=this._pool.length},e.prototype.read2Byte=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<2;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0"+r),t+=r.toString()}return parseInt(t,16)},e.prototype.readInt=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<4;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0"+r),t+=r.toString()}return parseInt(t,16)},e.prototype.readLong=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<8;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0"+r),t+=r}return parseInt(t,16)},e.prototype.readByte=function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e},e.prototype.readUTF=function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var n=this._pool.subarray(t,this._position);return so.readUTF(n)},e.prototype.readAll=function(){return this._pool.subarray(this._position,this._poolLen)},e}(),uo=function(){function e(){this._pool=[],this._position=0,this._writen=0}return e.prototype.write=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")?this._pool=this._pool.concat(e):e>=0&&(e>255&&(e&=255),this._pool.push(e),this._writen++),e},e.prototype.writeArr=function(e){return this._pool=this._pool.concat(e),e},e.prototype.writeUTF=function(e){var t=so.writeUTF(e);this._pool=this._pool.concat(t),this._writen+=t.length},e.prototype.getBytesArray=function(){return this._pool},e}(),co=function(e,t){return e&&t?t+"_"+e:e||Date.now()},lo=function(){function e(e){this.header=e,this.messageId=0,this.timestamp=0,this.syncMsg=!1,this.identifier=""}return e.prototype.getIdentifier=function(){var e=this.messageId,t=this.identifier;return co(e,t)},e.prototype.read=function(e,t,n,r){this.readMessage(e,t,n,r)},e.prototype.readMessage=function(e,t,n,r){return{stream:t,length:n}},e}(),ho=function(){function e(e){this.lengthSize=0,this.messageId=0,this.topic="",this.targetId="",this.identifier="",this._header=new oo(e,!1,hi.AT_MOST_ONCE,!1)}return e.prototype.getIdentifier=function(){var e=this.messageId,t=this.identifier;return co(e,t)},e.prototype.write=function(e){var t=this.getHeaderFlag();e.write(t),this.writeMessage(e)},e.prototype.setHeaderQos=function(e){this._header.qos=e},e.prototype.getHeaderFlag=function(){return this._header.encode()},e.prototype.getLengthSize=function(){return this.lengthSize},e.prototype.getBufferData=function(){var e=new uo;this.write(e);var t=e.getBytesArray();return new Int8Array(t)},e}(),po=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=null,t.userId=null,t.timestamp=0,t}return a(t,e),t.prototype.readMessage=function(e,n,r,i){if(n.readByte(),this.status=+n.readByte(),r<=t.MESSAGE_LENGTH)return{stream:n,length:r};if(i===gi.V4){var o=n.readByte();1&o&&(this.userId=n.readUTF()),2&o&&n.readUTF(),4&o&&(this.timestamp=n.readLong()),8&o&&(this.messageId=n.read2Byte())}else{this.userId=n.readUTF();var s=n.readUTF();e.debug(Re.O,"server sessionId -> "+s),this.timestamp=n.readLong()}return{stream:n,length:r}},t.MESSAGE_LENGTH=2,t}(lo),_o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t}return a(t,e),t.prototype.readMessage=function(e,t,n){return t.readByte(),this.status=+t.readByte(),{stream:t,length:n}},t.MESSAGE_LENGTH=2,t}(lo),go=function(e){function t(){return e.call(this,pi.PING_REQ)||this}return a(t,e),t.prototype.writeMessage=function(e){},t}(ho),fo=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t}(lo),Eo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.messageId=0,t}return a(t,e),t.prototype.readMessage=function(e,t,n){var r=256*t.readByte()+t.readByte();return this.messageId=parseInt(r.toString(),10),{stream:t,length:n}},t}(lo),Io=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.writeMessage=function(e){var t=this.messageId,n=255&t,r=(65280&t)>>8;e.write(r),e.write(n)},t}(ho),To=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.topic="",t.targetId="",t.syncMsg=!1,t.identifier=_i.PUB,t}return a(t,e),t.prototype.readMessage=function(t,n,r){return this.date=n.readInt(),this.topic=n.readUTF(),this.targetId=n.readUTF(),e.prototype.readMessage.call(this,t,n,r),this.data=n.readAll(),{stream:n,length:r}},t}(Eo),Ro=function(e){function t(t,n,r){var i=e.call(this,pi.PUBLISH)||this;return i.syncMsg=!1,i.identifier=_i.PUB,i.topic=t,i.data=Ft(n)?so.writeUTF(n):n,i.targetId=r,i}return a(t,e),t.prototype.writeMessage=function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.write(this.data)},t}(Io),vo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t.date=0,t.millisecond=0,t.messageUId="",t.timestamp=0,t.identifier=_i.PUB,t.topic="",t.targetId="",t}return a(t,e),t.prototype.readMessage=function(t,n,r){return e.prototype.readMessage.call(this,t,n,r),this.date=n.readInt(),this.status=256*n.readByte()+n.readByte(),this.millisecond=256*n.readByte()+n.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=n.readUTF(),{stream:n,length:r}},t}(Eo),Co=function(e){function t(t){var n=e.call(this,pi.PUB_ACK)||this;return n.status=0,n.date=0,n.millisecond=0,n.messageUId="",n.timestamp=0,n.messageId=t,n}return a(t,e),t.prototype.writeMessage=function(t){e.prototype.writeMessage.call(this,t)},t}(Io),yo=function(e){function t(t,n,r){var i=e.call(this,pi.QUERY)||this;return i.identifier=_i.QUERY,i.topic=t,i.data=Ft(n)?so.writeUTF(n):n,i.targetId=r,i}return a(t,e),t.prototype.writeMessage=function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.write(this.data)},t}(Io),So=function(e){function t(t){var n=e.call(this,pi.QUERY_CONFIRM)||this;return n.messageId=t,n}return a(t,e),t}(Io),mo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t.identifier=_i.QUERY,t.topic="",t.targetId="",t}return a(t,e),t.prototype.readMessage=function(t,n,r){return e.prototype.readMessage.call(this,t,n,r),this.date=n.readInt(),this.status=256*n.readByte()+n.readByte(),this.data=n.readAll(),{stream:n,length:r}},t}(Eo),Ao=function(e,t,n){var r=new Uint8Array(t),i=new ao(r),o=i.readByte(),s=function(e,t){var n,r=e.type;switch(r){case pi.CONN_ACK:n=new po(e);break;case pi.PUBLISH:(n=new To(e)).syncMsg=e.syncMsg;break;case pi.PUB_ACK:n=new vo(e);break;case pi.QUERY_ACK:n=new mo(e);break;case pi.SUB_ACK:case pi.UNSUB_ACK:case pi.PING_RESP:n=new fo(e);break;case pi.DISCONNECT:n=new _o(e);break;default:n=new lo(e),t.error(Re.O,"No support for deserializing "+r+" messages")}return n}(new oo(o),e);return s.read(e,i,r.length-1,n),s};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgN=2]="ppMsgN",e[e.ppMsgS=3]="ppMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.qryPMsg=7]="qryPMsg",e[e.qryGMsg=8]="qryGMsg",e[e.qryCHMsg=9]="qryCHMsg",e[e.qryCMsg=10]="qryCMsg",e[e.qrySMsg=11]="qrySMsg",e[e.recallMsg=12]="recallMsg",e[e.prMsgS=13]="prMsgS",e[e.pbMsgP=14]="pbMsgP",e[e.rrMsg=15]="rrMsg",e[e.rrList=16]="rrList",e[e.s_ntf=17]="s_ntf",e[e.s_msg=18]="s_msg",e[e.s_stat=19]="s_stat",e[e.s_cmd=20]="s_cmd",e[e.s_us=21]="s_us",e[e.pullUS=22]="pullUS",e[e.sendMsgRead=23]="sendMsgRead",e[e.qryMsgRead=24]="qryMsgRead",e[e.qryMsgReadCntBatch=25]="qryMsgReadCntBatch",e[e.updRTime=26]="updRTime",e[e.pgMsgS=27]="pgMsgS",e[e.chatMsgS=28]="chatMsgS",e[e.qrySessionsAtt=29]="qrySessionsAtt",e[e.pullMsg=30]="pullMsg",e[e.qrySessions=31]="qrySessions",e[e.delSessions=32]="delSessions",e[e.delMsg=33]="delMsg",e[e.updRRTime=34]="updRRTime",e[e.setTypeUnpush=35]="setTypeUnpush",e[e.chrmPull=36]="chrmPull",e[e.joinChrm=37]="joinChrm",e[e.joinChrmR=38]="joinChrmR",e[e.exitChrm=39]="exitChrm",e[e.queryChrmI=40]="queryChrmI",e[e.setKV=41]="setKV",e[e.delKV=42]="delKV",e[e.pullKV=43]="pullKV",e[e.qryRelation=44]="qryRelation",e[e.delRelation=45]="delRelation",e[e.pullSeAtts=46]="pullSeAtts",e[e.setSeAtt=47]="setSeAtt",e[e.qnTkn=48]="qnTkn",e[e.qnUrl=49]="qnUrl",e[e.aliUrl=50]="aliUrl",e[e.s3Url=51]="s3Url",e[e.stcUrl=52]="stcUrl",e[e.minioUrl=53]="minioUrl",e[e.cleanPMsg=54]="cleanPMsg",e[e.cleanGMsg=55]="cleanGMsg",e[e.cleanCMsg=56]="cleanCMsg",e[e.cleanSMsg=57]="cleanSMsg",e[e.rtcPing=58]="rtcPing",e[e.rtc_ntf=59]="rtc_ntf",e[e.rtcSetOutData=60]="rtcSetOutData",e[e.rtcQryUserOutData=61]="rtcQryUserOutData",e[e.addSeTag=62]="addSeTag",e[e.delSeTag=63]="delSeTag",e[e.addTag=64]="addTag",e[e.delTag=65]="delTag",e[e.disTag=66]="disTag",e[e.reportsdk=67]="reportsdk",e[e.pullUgSes=68]="pullUgSes",e[e.pullUgMsg=69]="pullUgMsg",e[e.ugMsg=70]="ugMsg",e[e.qryUgMsg=71]="qryUgMsg",e[e.updUgRTime=72]="updUgRTime",e[e.upMsgEx=73]="upMsgEx",e[e.modifyMsg=74]="modifyMsg",e[e.qryMsgChange=75]="qryMsgChange",e[e.qryMsg=76]="qryMsg",e[e.operate=77]="operate",e[e.s_opNtf=78]="s_opNtf",e[e.ugUnpushQuery=79]="ugUnpushQuery",e[e.ugUnpushSet=80]="ugUnpushSet",e[e.setRtcRoomId=81]="setRtcRoomId",e[e.qryUgUal=82]="qryUgUal",e[e.s_pubCall=83]="s_pubCall",e[e.updUserSub=84]="updUserSub",e[e.pullUserSub=85]="pullUserSub",e[e.pullSubData=86]="pullSubData",e[e.qrySubData=87]="qrySubData",e[e.pullUserProfile=88]="pullUserProfile",e[e.pullOwnProfile=89]="pullOwnProfile",e[e.updProfilePermiss=90]="updProfilePermiss",e[e.qProfilePermiss=91]="qProfilePermiss",e[e.searchUserProfile=92]="searchUserProfile",e[e.updUserProfile=93]="updUserProfile",e[e.pullEventChange=94]="pullEventChange",e[e.channelCreate=95]="channelCreate",e[e.upChannelInfo=96]="upChannelInfo",e[e.qChannelInfo=97]="qChannelInfo",e[e.channelMemKick=98]="channelMemKick",e[e.channelMemQuit=99]="channelMemQuit",e[e.channelDismiss=100]="channelDismiss",e[e.channelTransfer=101]="channelTransfer",e[e.upChannelManager=102]="upChannelManager",e[e.qChannelMem=103]="qChannelMem",e[e.qChannelSpeMem=104]="qChannelSpeMem",e[e.upChannelMem=105]="upChannelMem",e[e.channelMemJoin=106]="channelMemJoin",e[e.channelMemInvite=107]="channelMemInvite",e[e.channelApplyResp=108]="channelApplyResp",e[e.qChannelApplyList=109]="qChannelApplyList",e[e.qChannelMemJoin=110]="qChannelMemJoin",e[e.qChannelMemSpeJoin=111]="qChannelMemSpeJoin",e[e.upChannelRemark=112]="upChannelRemark",e[e.qChannelRemark=113]="qChannelRemark",e[e.upChannelFollow=114]="upChannelFollow",e[e.qChannelFollow=115]="qChannelFollow",e[e.qSimpleUserProfile=116]="qSimpleUserProfile",e[e.friendAdd=117]="friendAdd",e[e.friendDel=118]="friendDel",e[e.friendHandle=119]="friendHandle",e[e.friendSetPf=120]="friendSetPf",e[e.friendCheck=121]="friendCheck",e[e.friendsQuery=122]="friendsQuery",e[e.friendApplyDel=123]="friendApplyDel",e[e.friendsInfoQry=124]="friendsInfoQry",e[e.friendAuthSet=125]="friendAuthSet",e[e.friendAuthGet=126]="friendAuthGet"}(io||(io={}));var No=io,Oo=function(){function e(e,t){this._runtime=e,this._appkey=t,this._users={}}return e.prototype._getMemData=function(e){return this._users[e]=this._users[e]||{inboxTime:0,outboxTime:0,broadcastSyncTime:0},this._users[e]},e.prototype.setInboxTime=function(e,t){var n=this._getMemData(t);if(!(n.inboxTime>e)){n.inboxTime=e;var r=Z.INBOX_TIME_KEY(this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}},e.prototype.getInboxTime=function(e){var t=this._getMemData(e);if(0===t.inboxTime){var n=Z.INBOX_TIME_KEY(this._appkey,e);t.inboxTime=parseInt(this._runtime.localStorage.getItem(n),10)||0}return t.inboxTime},e.prototype.setBroadcastSyncTime=function(e,t){var n=this._getMemData(t);if(!(n.broadcastSyncTime>=e||Zt(e))){n.broadcastSyncTime=e;var r=Z.BROADCASTBOX_TIME_KEY(this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}},e.prototype.getBroadcastSyncTime=function(e){var t=this._getMemData(e);if(!t||0===t.broadcastSyncTime){var n=Z.BROADCASTBOX_TIME_KEY(this._appkey,e);t.broadcastSyncTime=parseInt(this._runtime.localStorage.getItem(n),10)||1}return t.broadcastSyncTime},e.prototype.setOutboxTime=function(e,t){var n=this._getMemData(t);if(!(n.outboxTime>=e)){n.outboxTime=e;var r=Z.OUTBOX_TIME_KEY(this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}},e.prototype.getOutboxTime=function(e){var t=this._getMemData(e);if(0===t.outboxTime){var n=Z.OUTBOX_TIME_KEY(this._appkey,e);t.outboxTime=parseInt(this._runtime.localStorage.getItem(n),10)||0}return t.outboxTime},e}(),Mo={_caches:{},set:function(e,t){this._caches[e]=t},get:function(e){return this._caches[e]||0},clear:function(e){this._caches[e]=0}},Uo=function(){function e(e,t,n){this.logger=e,this._kvCaches={},this._chatroomId=t,this._currentUserId=n}return e.prototype._add=function(e){var t=e.key;e.isDeleted=!1,this._kvCaches[t]=e},e.prototype._remove=function(e){var t=e.key,n=this._kvCaches[t];n&&(n.isDeleted=!0,this._kvCaches[t]=n)},e.prototype._setEntry=function(e,t){var n=e.key,r=e.type,i=e.isOverwrite,o=e.userId,s=this._getSetUserId(n),a=r===ye.DELETE,u=s===o,c=!this._isExisted(n),l=a?this._remove:this._add;(t||i||u||c)&&l.call(this,e)},e.prototype.getValue=function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.value},e.prototype.getVersion=function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.version},e.prototype.getAllValue=function(){var e={};for(var t in this._kvCaches)this._kvCaches[t].isDeleted||(e[t]=this._kvCaches[t].value);return e},e.prototype._getSetUserId=function(e){return(this._kvCaches[e]||{}).userId},e.prototype._isExisted=function(e){var t=this._kvCaches[e]||{},n=t.value,r=t.isDeleted;return n&&!r},e.prototype.setEntries=function(e){var t=this,n=e.kvEntries,r=e.isFullUpdate;n=n||[],(r=r||!1)&&this.clear(),n.forEach((function(e){t._setEntry(e,r)}))},e.prototype.clear=function(){this._kvCaches={}},e}(),Lo=function(){function e(e){this._pullQueue=[],this._isPulling=!1,this._storeCaches={},this._engine=e}return e.prototype._startPull=function(){return l(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.chrmId,n=e.timestamp,(r=Mo.get(t))>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullChatroomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,this._isPulling=!1,o===re.SUCCESS?(Mo.set(t,s.syncTime||0),this._startPull()):this._startPull(),[2]}}))}))},e.prototype.reset=function(e){Mo.clear(e);var t=this._storeCaches[e];null==t||t.clear()},e.prototype.pullEntry=function(e,t){this._pullQueue.push({chrmId:e,timestamp:t}),this._startPull()},e.prototype.setLocal=function(e,t,n){var r=this._storeCaches[e];en(r)||(r=new Uo(this._engine.getInnerLogger(),e,n)),r.setEntries(t),this._storeCaches[e]=r},e.prototype.getValue=function(e,t){var n=this._storeCaches[e];return n?n.getValue(t):null},e.prototype.getVersion=function(e,t){var n=this._storeCaches[e];return n?n.getVersion(t):null},e.prototype.getAll=function(e){var t=this._storeCaches[e],n={};return t&&(n=t.getAllValue()),n},e}(),Po=function(){function e(e){this._canJoinMulipleChrm=e,this._joinedChrmsInfo={}}return e.prototype.set=function(e,t,n){void 0===t&&(t=10),void 0===n&&(n=""),this._canJoinMulipleChrm||(this._joinedChrmsInfo={}),this._joinedChrmsInfo[e]={count:t,extra:n}},e.prototype.get=function(){return JSON.parse(JSON.stringify(this._joinedChrmsInfo))},e.prototype.remove=function(e){delete this._joinedChrmsInfo[e]},e.prototype.clear=function(){this._joinedChrmsInfo={}},e}(),bo=function(){function e(){this._callerQueue=[],this._isCalling=!1,this._retryCount=0}return e.prototype.pushTask=function(e){var t=this;return new Promise((function(n){t._callerQueue.push({task:e,resolve:n}),t._startCall()}))},e.prototype._startCall=function(){return l(this,void 0,void 0,(function(){var e,t;return d(this,(function(n){switch(n.label){case 0:return this._isCalling||0===this._callerQueue.length?[2]:(this._isCalling=!0,e=this._callerQueue.shift(),[4,this._callHandler(e)]);case 1:return t=n.sent(),e.resolve(t),this._isCalling=!1,this._startCall(),[2]}}))}))},e.prototype._callHandler=function(e){return l(this,void 0,void 0,(function(){var t,n,r;return d(this,(function(i){switch(i.label){case 0:return t=e.task,n=this.getVersion(),[4,t(n)];case 1:return(r=i.sent()).code===re.USER_SETTING_SYNCED_ERROR&&this._retryCount<5?(this._retryCount++,[4,this._triggerPull(n)]):[3,3];case 2:return i.sent(),[2,this._callHandler(e)];case 3:return this._retryCount=0,[2,r]}}))}))},e.prototype.stopAllTask=function(){this._callerQueue.forEach((function(e){e.resolve({code:re.RC_NET_UNAVAILABLE})})),this._callerQueue=[]},e}(),Do="converStatusChanged",wo=function(e){function t(t,n,i){var s=e.call(this)||this;return s._eventEmitter=new hn,s._pullQueue=[],s._isPulling=!1,s._pullPromise=null,s._storagePullTimeKey="con-s-"+n+"-"+i,s._oldStorage=r(t.runtime),s._storage=new o(t.runtime,Z.CONVER_STATE_PULL_TIME_KEY(n,i)),s._appkey=n,s._currentUserId=i,s._engine=t,s.adaptOldStatus(),s}return a(t,e),t.prototype.adaptOldStatus=function(){try{if(this._storage.get(this._storagePullTimeKey)||0)return;var e=this._oldStorage.get(this._storagePullTimeKey)||0;if(!e)return;this._storage.set(this._storagePullTimeKey,e),this._oldStorage.remove(this._storagePullTimeKey)}catch(e){this._engine.getInnerLogger().error(Re.A_CALLBACK_E,"adaptOldStatus error: "+e.message)}},t.prototype._set=function(e){var t=this;if(!Zt(e)&&Array.isArray(e)){var n=this._storage.get(this._storagePullTimeKey)||0,r=e.length;e.forEach((function(e,i){var o=e.updatedTime||0;n=o>n?o:n,e.conversationType=e.type,t._eventEmitter.emit(Do,{statusItem:e,isLastPull:i===r-1})})),this._storage.set(this._storagePullTimeKey,n),this._pullQueue=this._pullQueue.filter((function(e){return e>n}))}},t.prototype._startPull=function(){return l(this,void 0,void 0,(function(){var e,t,n,r;return d(this,(function(i){switch(i.label){case 0:return this._isPulling||0===this._pullQueue.length?[2,this._pullPromise]:(this._isPulling=!0,this._pullQueue.shift(),e=this.getVersion(),this._pullPromise=this._engine.pullConversationStatus(e),[4,this._pullPromise]);case 1:return t=i.sent(),n=t.code,r=t.data,this._isPulling=!1,this._pullPromise=null,n===re.SUCCESS&&this._set(r),0===this._pullQueue.length?this._startCall():this._startPull(),[2]}}))}))},t.prototype._startCall=function(){return l(this,void 0,void 0,(function(){return d(this,(function(t){return this._isPulling||e.prototype._startCall.call(this),[2]}))}))},t.prototype.pull=function(e){var t=this.getVersion();(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())},t.prototype._triggerPull=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this._startPull()];case 1:return t.sent(),[2]}}))}))},t.prototype.watch=function(e){this._eventEmitter.on(Do,(function(t){e(t)}))},t.prototype.setConversationUpdatedTime=function(e){var t=this._storage.get(this._storagePullTimeKey)||0;return e&&e>t?(this._storage.set(this._storagePullTimeKey,e),e):t},t.prototype.getVersion=function(){return this._storage.get(this._storagePullTimeKey)||0},t}(bo),Vo={c:{keyName:"unreadMessageCount",defaultVal:0},hm:{keyName:"hasMentioned",defaultVal:!1},m:{keyName:"mentionedInfo",defaultVal:null},t:{keyName:"lastUnreadTime",defaultVal:0},lt:{keyName:"lastReadTime",defaultVal:0},fut:{keyName:"firstUnreadTime",defaultVal:0},fuid:{keyName:"firstUnreadMessageUid",defaultVal:""},nc:{keyName:"notificationStatus",defaultVal:2},nl:{keyName:"notificationLevel",defaultVal:0},to:{keyName:"isTop",defaultVal:!1},tg:{keyName:"tags",defaultVal:{}},mc:{keyName:"unreadMentionedCount",defaultVal:0},st:{keyName:"lastMessageSentTime",defaultVal:0}},Go={};for(var Bo in Vo){var Fo=Vo[Bo].keyName;Go[Fo]=Bo}var ko=function(){function e(e,t,n,r){this._appkey=t,this._currentUserId=n,this.logger=r,this.storage=new o(e,Z.OLD_CONVER_STATE_KEY(t,n)),this._localStore=new o(e,Z.CONVER_STATE_KEY(t,n))}return e.prototype._getStoreKey=function(e,t,n){return n+"_"+e+"_"+t},e.prototype._getConOptionByKey=function(e){var t=(e=e||"").split("_");if(t.length>=2){var n=t.shift(),r=t.shift(),i=t.join("_");return{conversationType:Number(r),targetId:i,channelId:n}}return{conversationType:oe.PRIVATE,targetId:"",channelId:""}},e.prototype._updateMentionedUserList=function(e,t,n){var r=this,i=e.conversationType,o=e.messageType,s=e.isMentioned,a=e.senderUserId;s&&i===oe.GROUP&&((n.userIdList||[]).forEach((function(e){e===r._currentUserId&&t.indexOf(a)<0&&t.push(a)})),n.type===ge.ALL&&t.indexOf(a)<0&&t.push(a));if(o===ce.RECALL&&i===oe.GROUP){var u=t.indexOf(a);u>=0&&t.splice(u,1)}return t},e.prototype.updateMentionedData=function(e){var t=e.conversationType,n=e.targetId,r=e.content,i=e.channelId,o=e.senderUserId,s=r.mentionedInfo;if(s&&o!==this._currentUserId){var a=this._getStoreKey(t,n,i),u=this._localStore.get(a)||{},c=Go.mentionedInfo,l=Go.hasMentioned,d=u[c]||{},h=d.userIdList||[];s={userIdList:h=this._updateMentionedUserList(e,h,s),type:(null==s?void 0:s.type)||d.type},0!==h.length?(u[c]=s,u[l]=!0):(delete u[c],delete u[l]),en(u)?this._localStore.set(a,u):this._localStore.remove(a)}},e.prototype._setLocal=function(e,t){if("tags"===e)for(var n in t)t[n].isTop||delete t[n].isTop;return t},e.prototype.set=function(e,t,n,r){var i=this._getStoreKey(e,t,r),o=this._localStore.get(i)||{};for(var s in n){var a=Go[s],u=n[s];if(!Zt(a)&&!Zt(u)&&"hasMentioned"!==s&&"MentionedInfo"!==s)u===Vo[a].defaultVal||"tags"===s&&!en(u)?delete o[a]:o[a]=this._setLocal(s,u),o.c||(delete o.t,delete o.fut,delete o.fuid,delete o.hm,delete o.m,delete o.mc)}var c=Object.keys(o);1===c.length&&c.includes("st")&&delete o.st,en(o)?this._localStore.set(i,o):this._localStore.remove(i)},e.prototype.get=function(e,t,n){void 0===n&&(n="");var r=this._getStoreKey(e,t,n),i=this._localStore.get(r)||{},o={};for(var s in Vo){var a=Vo[s],u=a.keyName,c=a.defaultVal;o[u]=i[s]||Ir(c)}return o},e.prototype.getValue=function(e){var t=this._localStore.getValues()||{},n=[];for(var r in t){var i=this._getConOptionByKey(r),o={conversationType:i.conversationType,targetId:i.targetId,channelId:i.channelId},s=t[r];for(var a in s)if(Vo[a]){var u=Vo[a],c=u.keyName,l=u.defaultVal;o[c]=s[a]||Ir(l)}o=e?e(o):o,n.push(o)}return n},e.prototype.getValueForTag=function(){var e=this._localStore.getValues()||{},t={};for(var n in e){var r=this._getConOptionByKey(n),i=r.conversationType,o=r.targetId,s={},a=e[n];for(var c in a){var l=Vo[c],d=l.keyName,h=l.defaultVal;s[d]=a[c]||Ir(h)}for(var p in s.tags){Zt(t[p])&&(t[p]=[]);var _=u(u({},s),{conversationType:i,targetId:o});delete _.tags,t[p].push(_)}}return t},e.prototype.adaptOldStore=function(){try{var e=this.storage.getValues();if(0===Object.keys(e).length)return;for(var t in e){var n="_"+t;this._localStore.set(n,e[t])}this.storage.clear()}catch(e){this.logger.error(Re.O,"adaptOldStore error: "+e.message)}},e.prototype.remove=function(e,t,n){var r=this._getStoreKey(e,t,n);this._localStore.remove(r)},e}(),xo=[oe.PRIVATE,oe.GROUP,oe.SYSTEM,oe.PUBLIC_SERVICE,oe.APP_PUBLIC_SERVICE],Ho="conversationChanged",Yo="conTagStatusChanged",qo=function(){function e(e,t,n,r,i){var o=this;this._updatedConversations={},this._conTagStatusChanged=!1,this._eventEmitter=new hn,this._draftMap={},this._recallMsgTimeMap={},this._appkey=t,this._loginUserId=n,this._store=new ko(e.runtime,t,n,e.getInnerLogger()),this._statusManager=new wo(e,t,n),this._statusManager.watch((function(e){var t=e.statusItem,n=e.isLastPull;o.addStatus(t,n)})),this._eventEmitter.on(Ho,(function(e){r(e)})),this._eventEmitter.on(Yo,(function(){i()}));var s=this._store.getValue();s.length>1e3&&(s=s.sort((function(e,t){var n=e.lastMessageSentTime,r=void 0===n?0:n,i=t.lastMessageSentTime;return(void 0===i?0:i)-r})),s.splice(1e3,s.length).forEach((function(e){o._store.remove(e.conversationType,e.targetId,e.channelId)})))}return e.prototype._calcMsg=function(e,t,n,r){var i=!this._recallMsgTimeMap[e]||this._recallMsgTimeMap[e]&&!this._recallMsgTimeMap[e].find((function(e){return e===r.sentTime})),o=t>=r.sentTime;return n&&(o=n<r.sentTime),{isNotRead:o,isNotRepeadRecallSendTime:i}},e.prototype._calcUnreadCount=function(e,t){var n=e.content,r=e.messageType,i=e.sentTime,o=e.isCounted,s=e.messageDirection,a=e.senderUserId,u=e.messageUId,c=s===te.SEND&&a===this._loginUserId,l=r===ce.RECALL,d=Jt(n),h=!1,p={},_=t.lastUnreadTime,g=t.lastReadTime,f=t.unreadMessageCount;if(_>i||c)return{hasChanged:h,localConversation:t,updateItems:p};if(o&&(0===t.unreadMessageCount&&(t.firstUnreadMessageUid=u,t.firstUnreadTime=i),t.unreadMessageCount=f+1,t.lastUnreadTime=i,h=!0),l&&d){var E=this._handleRecall2UnreadCount(e,_,g,f,h),I=E.unreadMessageCount,T=E.hasChanged;t.unreadMessageCount=I,h=T,0===t.unreadMessageCount&&(t.firstUnreadMessageUid="",t.firstUnreadTime=0)}return h&&(p.unreadMessageCount={val:t.unreadMessageCount||0,time:i}),{hasChanged:h,localConversation:t,updateItems:p}},e.prototype._handleRecall2UnreadCount=function(e,t,n,r,i){var o=e.conversationType+"_"+e.channelId+"_"+e.targetId,s=this._calcMsg(o,t,n,e.content),a=s.isNotRead,u=s.isNotRepeadRecallSendTime;return a&&r&&u?(this._recallMsgTimeMap[o]||(this._recallMsgTimeMap[o]=[]),this._recallMsgTimeMap[o].push(e.content.sentTime),{unreadMessageCount:r-1,hasChanged:!0}):{unreadMessageCount:r,hasChanged:i}},e.prototype._calcMentionedInfo=function(e,t){var n=e.content,r=e.messageDirection,i=e.isMentioned,o=e.sentTime,s=r===te.SEND,a=Jt(n),u=!1,c={};return!s&&i&&a&&n.mentionedInfo&&(t.hasMentioned=!0,u=!0,c.hasMentioned={val:!0,time:o},c.mentionedInfo={val:n.mentionedInfo,time:o}),{hasChanged:u,localConversation:t,updateItems:c}},e.prototype._calcMentionedCount=function(e,t){var n=e.content,r=e.messageDirection,i=!1;if(e.isMentioned&&r===te.RECEIVE&&(null==n?void 0:n.mentionedInfo)){var o=n.mentionedInfo,s=o.type,a=o.userIdList;if(s===ge.ALL||(a||[]).includes(this._loginUserId)){i=!0;var u=t.unreadMentionedCount||0;t.unreadMentionedCount=u+1}}return{hasChanged:i,localConversation:t}},e.prototype._setUpdatedConversation=function(e){if(Jt(e)){var t=e.conversationType,n=e.targetId,r=e.channelId,i=t+"_"+n,o=this._store.get(t,n,r)||{};this._updatedConversations[i]=Object.assign(o,e)}},e.prototype._setConTagStatusChanged=function(e,t,n,r){var i=(this._store.get(e,t,r)||{}).tags||{};if(Object.keys(i).length===Object.keys(n).length){for(var o in i)if(!n[o]||!!i[o].isTop!=!!n[o].isTop)return void(this._conTagStatusChanged=!0)}else this._conTagStatusChanged=!0},e.prototype.addStatus=function(e,t){var n=e.conversationType,r=e.targetId,i=e.updatedTime,o=e.notificationStatus,s=e.notificationLevel,a=e.isTop,u=e.tags,c=e.channelId,l={},d={};if(n!==oe.ULTRA_GROUP){Zt(o)||(d.notificationStatus={time:i,val:o}),Zt(s)||(d.notificationLevel={time:i,val:s}),Zt(a)||(d.isTop={time:i,val:a}),Zt(u)||(d.tags={time:i,val:u},null==u||u.forEach((function(e){l[e.tagId]={isTop:e.isTop}}))),this._setConTagStatusChanged(n,r,l,c);var h=this._store.get(n,r,c).lastMessageSentTime||(new Date).getTime();this._store.set(n,r,{notificationStatus:o,notificationLevel:s,isTop:a,tags:l,lastMessageSentTime:h},c),r&&(this._setUpdatedConversation({conversationType:n,targetId:r,updatedItems:d,channelId:c}),t&&this._notifyConversationChanged())}},e.prototype._notifyConversationChanged=function(){var e=[];for(var t in this._updatedConversations)e.push(this._updatedConversations[t]);0!==e.length&&(this._eventEmitter.emit(Ho,e),this._updatedConversations={},this._conTagStatusChanged&&(this._eventEmitter.emit(Yo),this._conTagStatusChanged=!1))},e.prototype.setConversationCacheByMessage=function(e,t){var n=this,r=e.conversationType,i=e.isPersited,o=e.targetId,s=e.channelId,a=e.sentTime;if(xo.indexOf(r)>=0){var c=!1,l=this._store.get(r,o,s),d={};if(l.lastMessageSentTime=a,[this._calcUnreadCount,this._calcMentionedInfo,this._calcMentionedCount].forEach((function(t){var r=t.call(n,e,l),i=r.hasChanged,o=r.localConversation,s=r.updateItems;c=c||i,d=u(u({},d),s),l=Ir(o)})),this._store.set(r,o,l,s),this._store.updateMentionedData(e),i){var h=this._store.get(r,o,s);h.updatedItems=u({latestMessage:{time:e.sentTime,val:e}},d),h.latestMessage=e;var p=Object.assign(h,{conversationType:r,targetId:o,channelId:s});this._setUpdatedConversation(p)}(c||i)&&this._notifyConversationChanged()}},e.prototype.get=function(e,t,n){return void 0===n&&(n=""),this._store.get(e,t,n)},e.prototype.getAllUnreadCount=function(e,t,n){var r=this._store.getValue(),i=0;return r.forEach((function(e){var r=e.unreadMessageCount,o=e.notificationStatus,s=e.notificationLevel,a=e.conversationType;r=r||0,(n||void 0!==s&&s<=0||void 0===s&&o!==de.OPEN)&&(t.length>0?t.includes(Number(a))&&(i+=Number(r)):i+=Number(r))})),i},e.prototype.getTotalUnreadCountByLevels=function(e,t,n){var r=this._store.getValue(),i=0;return r.forEach((function(r){var o=r.unreadMessageCount,s=r.notificationLevel,a=void 0===s?0:s,u=r.conversationType,c=r.unreadMentionedCount;e.includes(u)&&(0===t.length||t.includes(a))&&(i+=(n?c:o)||0)})),i},e.prototype.getUnreadCountByTag=function(e,t){var n=this._store.getValueForTag()[e]||[],r=0;return n.forEach((function(e){var n=e.unreadMessageCount,i=e.notificationStatus,o=e.notificationLevel;(t||1!==i||-1===o||0===o)&&(n=n||0,r+=Number(n))})),r},e.prototype.getUnreadCount=function(e,t,n){return this._store.get(e,t,n).unreadMessageCount||0},e.prototype.clearUnreadCount=function(e,t,n,r,i){void 0===i&&(i=!0);var o=this._store.get(e,t,n);o.lastReadTime=o.lastUnreadTime,this._recallMsgTimeMap[e+"_"+n+"_"+t]=[];var s=o.unreadMessageCount,a=o.hasMentioned,u={};if(s&&(o.unreadMessageCount=0,u.unreadMessageCount={val:0,time:r}),a&&(o.hasMentioned=!1,o.unreadMentionedCount=0,o.mentionedInfo=void 0,u.hasMentioned={val:!1,time:r},u.mentionedInfo={val:void 0,time:r}),this._store.set(e,t,o,n),i&&0!==Object.keys(u).length){var c=Object.assign(o,{conversationType:e,targetId:t,channelId:n,updatedItems:u});this._setUpdatedConversation(c),this._notifyConversationChanged()}},e.prototype.clearAllUnreadCount=function(){var e=this;this._store.getValue().forEach((function(t){t.unreadMessageCount&&(t.unreadMessageCount=0,t.lastReadTime=t.lastUnreadTime,e._recallMsgTimeMap={},e._store.set(t.conversationType,t.targetId,t,t.channelId))}))},e.prototype.startPullConversationStatus=function(e){this._statusManager.pull(e)},e.prototype.setDraft=function(e,t,n,r){var i=e+"_"+t+"_"+r;this._draftMap[i]=n},e.prototype.getDraft=function(e,t,n){var r=e+"_"+t+"_"+n;return this._draftMap[r]},e.prototype.clearDraft=function(e,t,n){var r=e+"_"+t+"_"+n;delete this._draftMap[r]},e.prototype.addTagStatus=function(e,t,n,r){void 0===r&&(r="");var i=this._store.get(e,t,r),o=i.tags;o=Object.assign(o,n);var s=i.lastMessageSentTime||(new Date).getTime();this._store.set(e,t,{tags:o,lastMessageSentTime:s},r)},e.prototype.deleteTagStatus=function(e,t,n,r){void 0===r&&(r="");var i=this._store.get(e,t,r).tags;n.forEach((function(e){delete i[e]})),this._store.set(e,t,{tags:i},r)},e.prototype.getConversationListForTag=function(){return this._store.getValueForTag()},e.prototype.getBlockConversationList=function(){return this._store.getValue().filter((function(e){return e.notificationStatus===de.OPEN||e.notificationLevel&&e.notificationLevel>0})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,notificationLevel:e.notificationLevel||0,notificationStatus:e.notificationStatus||2}}))},e.prototype.getTopConversationList=function(e,t){var n=this;return(this._store.getValue()||{}).filter((function(n){return e.includes(n.conversationType)&&(Zt(t)||t===n.channelId)&&n.isTop})).map((function(e){return n._buildConversation(e)}))},e.prototype.adaptOldStore=function(){this._store.adaptOldStore()},e.prototype.getUnreadMentionedCount=function(e,t,n){return void 0===n&&(n=""),this.get(e,t,n).unreadMentionedCount||0},e.prototype.getAllUnreadMentionedCount=function(){var e=this._store.getValue(),t=0;return e.forEach((function(e){var n=e.unreadMentionedCount;n=n||0,t+=Number(n)})),t},e.prototype.getAllConversationState=function(){return this._store.getValue().filter((function(e){return e.unreadMessageCount||e.unreadMentionedCount})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,unreadCount:e.unreadMessageCount||0,unreadMentionedCount:e.unreadMentionedCount||0}}))},e.prototype.getUnreadConversationList=function(e){var t=this;return(this._store.getValue()||{}).filter((function(t){return e.includes(t.conversationType)&&t.unreadMessageCount&&t.unreadMessageCount>0})).map((function(e){return t._buildConversation(e)}))},e.prototype._buildConversation=function(e){var t=this.getDraft(e.conversationType,e.targetId,e.channelId);return{channelId:e.channelId,conversationType:e.conversationType,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount||0,latestMessage:null,hasMentioned:e.hasMentioned||!1,mentionedInfo:e.mentionedInfo,notificationStatus:e.notificationStatus||0,notificationLevel:e.notificationLevel||0,isTop:e.isTop||!1,lastUnreadTime:e.lastUnreadTime||0,unreadMentionedCount:e.unreadMentionedCount||0,draft:t}},e.prototype.setConversationUpdatedTime=function(e){return this._statusManager.setConversationUpdatedTime(e)},e.prototype.getConversationUpdatedTime=function(){return this._statusManager.getVersion()},e.prototype.pushTask=function(e){return this._statusManager.pushTask(e)},e.prototype.stopAllTask=function(){this._statusManager.stopAllTask()},e}(),Ko=function(e){function t(t,n,r,i){var s=e.call(this)||this;return s._tagKey="tags",s._versionKey="version",s._pullQueue=[],s._isPulling=!1,s._pullPromise=null,s._storageKey=Z.USER_SETTING_KEY(n,r),s._storage=new o(t.runtime,s._storageKey),s._engine=t,s._tagWatcherFunc=i,s}return a(t,e),t.prototype._updateTag=function(e){var t=e.tags,n={};t.forEach((function(e){n[e.tagId]={tagName:e.tagName,createdTime:e.createdTime}})),this._storage.set(this._tagKey,n),this._tagWatcherFunc()},t.prototype.addTag=function(e,t){var n,r=this._storage.get(this._tagKey)||{};e.forEach((function(e){var t,n=(null===(t=r[e.tagId])||void 0===t?void 0:t.createdTime)||e.createdTime||0;r[e.tagId]={tagName:e.tagName,createdTime:n}})),this._storage.update(((n={})[this._tagKey]=r,n[this._versionKey]=t,n))},t.prototype.deleteTag=function(e,t){var n,r=this._storage.get(this._tagKey)||{};e.forEach((function(e){delete r[e]})),this._storage.update(((n={})[this._tagKey]=r,n[this._versionKey]=t,n))},t.prototype.getTagsInfo=function(){return this._storage.get(this._tagKey)||{}},t.prototype.getTags=function(){var e=this._storage.get(this._tagKey)||{},t=[];for(var n in e)t.push({tagId:n,tagName:e[n].tagName,createdTime:e[n].createdTime,conversationCount:0});return t.sort((function(e,t){return(e.createdTime||0)-(t.createdTime||0)}))},t.prototype.getTagById=function(e){var t=this._storage.get(this._tagKey)||{};return t[e]?{tagId:e,tagName:t[e].tagName,createdTime:t[e].createdTime,conversationCount:0}:null},t.prototype._startPull=function(){return l(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return this._isPulling||0===this._pullQueue.length?[2,this._pullPromise]:(this._isPulling=!0,this._pullQueue.shift(),e=this.getVersion(),this._pullPromise=this._engine.pullUserSettings(e),[4,this._pullPromise]);case 1:return t=u.sent(),n=t.code,r=t.data,this._isPulling=!1,this._pullPromise=null,n!==re.SUCCESS||Zt(r)||(o=(i=r).settings,s=i.version,a=o.Tag,Zt(a)||this._updateTag(a),this._storage.set(this._versionKey,s),this._pullQueue=this._pullQueue.filter((function(e){return e>s}))),0===this._pullQueue.length?this._startCall():this._startPull(),[2]}}))}))},t.prototype._startCall=function(){return l(this,void 0,void 0,(function(){return d(this,(function(t){return this._isPulling||e.prototype._startCall.call(this),[2]}))}))},t.prototype.pullUserSettings=function(e){var t=this.getVersion();(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())},t.prototype._triggerPull=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this._startPull()];case 1:return t.sent(),[2]}}))}))},t.prototype.getVersion=function(){return this._storage.get(this._versionKey)||0},t.prototype.updateVersion=function(e){this._storage.set(this._versionKey,e)},t}(bo),jo=function(e){return e.replace(/@.+$/,"@")},Qo=function(){function e(e,t,n,r,i,o){void 0===i&&(i=!0),void 0===o&&(o=!0),this.appkey=e,this.logger=t,this.statisticLog=n,this.staticConfigManager=r,this.isRequestProfile=i,this.isUseDynamicNaviUrl=o,this.crtRequest=null,this._environment="default"}return e.prototype.getCatchKey=function(e){return e+(this._environment?"-"+this._environment:"")},e.prototype.request=function(e,t,n,r,i){return l(this,void 0,void 0,(function(){var o,s,a;return d(this,(function(u){switch(u.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,n,r,i),[4,this.crtRequest]);case 1:return o=u.sent(),s=o.code,a=o.data,this.crtRequest=null,[2,{code:s,data:a}]}}))}))},e.prototype.sendRequest=function(e,t,n,r,i){var o;return l(this,void 0,void 0,(function(){var s,a,u,c,l,h,p,_,g,f,E,I,T;return d(this,(function(d){switch(d.label){case 0:return s=jo(e),a=this.getNaviCache(s),!t&&a&&(u=a.timestamp,c=a.naviInfo,n||Date.now()-u<R)?(this.logger.info(Re.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),r),l={bid:tr(),ptc:Je.NAVI,cod:re.SUCCESS,net:null==i?void 0:i.type,dur:0,spr:0,pr:null!==(o=c.type)&&void 0!==o?o:0,hos:"",cache:Xe.LOCAL,v:Ze.CURRENT,rsn:null==i?void 0:i.reason,cid:(null==i?void 0:i.uuid)+"_"+(null==i?void 0:i.retryCount),count:null==i?void 0:i.retryCount},this.statisticLog.record(ve.IM_NAVI,JSON.stringify(l),r),[2,{code:re.SUCCESS,data:c}]):(h=Ei.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(Re.L_GET_NAVI_T,JSON.stringify({token:e,uris:h}),r),[4,this.requestHandler(h,e,r,i)]);case 1:return p=d.sent(),_=p.code,g=p.data,_===re.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(f=d.sent())?void 0:f.navi)&&(null==f?void 0:f.navi.length)>0?(E=f.navi,[4,this.requestHandler(E,e,r,i)]):[3,4];case 3:I=d.sent(),_=I.code,g=I.data,d.label=4;case 4:return _!==re.SUCCESS?(this.logger.warn(Re.L_GET_NAVI_R,_,r),[2,{code:_}]):(T=g).code&&200!==T.code?(this.logger.warn(Re.L_GET_NAVI_R,T.code,r),[2,{code:this.transHttpCode(T.code)}]):(this.logger.info(Re.L_GET_NAVI_R,JSON.stringify({naviInfo:T}),r),this.setNaviCache(s,T),[2,{code:_,data:T}])}}))}))},e.prototype.requestHandler=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,h,p;return d(this,(function(d){switch(d.label){case 0:i=0,o=e.length,d.label=1;case 1:return i<o?(s=i===e.length-1,a=this.useV2Navi()?this.httpRequestV2:this.httpRequest,u=Date.now(),[4,a.call(this,e[i],this.appkey,t,n,s)]):[3,4];case 2:if(c=d.sent(),l=c.code,h=c.data,p={bid:tr(),ptc:Je.NAVI,cod:l,net:null==r?void 0:r.type,dur:Date.now()-u,spr:0,pr:(null==h?void 0:h.type)||0,hos:e[i],cache:Xe.REQUEST,v:Ze.CURRENT,rsn:null==r?void 0:r.reason,cid:(null==r?void 0:r.uuid)+"_"+(null==r?void 0:r.retryCount),count:null==r?void 0:r.retryCount},this.statisticLog.record(ve.IM_NAVI,JSON.stringify(p),n),[re.SUCCESS,re.RC_CONN_TOKEN_INCORRECT,re.RC_LICENSE_EXPIRED].includes(l))return[2,{code:l,data:h}];d.label=3;case 3:return i+=1,[3,1];case 4:return[2,{code:re.RC_NAVI_REQ_FAILED}]}}))}))},e.prototype.transHttpCode=function(e){switch(e){case 401:case 403:return re.RC_CONN_TOKEN_INCORRECT;case 416:return re.RC_LICENSE_EXPIRED;default:return re.RC_NAVI_REQ_FAILED}},e.prototype.getNaviInfoFromCache=function(e){var t=this.getNaviCache(jo(e));return t?t.naviInfo:null},e.prototype.updateVoipCallInfo=function(e,t){var n=this.getNaviInfoFromCache(e);n&&this.setNaviCache(jo(e),u(u({},n),{voipCallInfo:t}))},e.prototype.getNaviV2RequestOption=function(e){var t,n=e.uri,r=e.token,i=e.platform,o=e.protocol,s=e.mac;t=n+"/v2/navi.json?cloud=0";var a="token="+encodeURIComponent(r)+"&version=5.12.1&platfrom="+i;return s&&(a+="&m="+s),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn="+o+";rtc=4;log=2"},body:a,url:t,timeout:C}},e.prototype.useV2Navi=function(){return!0},e}(),Wo={};function Jo(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:0,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:Ei.getMiniCmpUrlList().join(",")}}var Xo,Zo=function(e){function t(t,n,r,i,o,s){void 0===s&&(s="default");var a=e.call(this,t,n,r,o,i.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),i.useNavi)||this;return a.runtime=i,a._environment=s,a}return a(t,e),t.prototype.httpRequest=function(e,t,n,r,i){return l(this,void 0,void 0,(function(){var o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return o=e+"/navi.js?appId="+t+"&token="+encodeURIComponent(n)+"&callBack=x&v="+Y+"&r="+Date.now()+"&env="+this._environment,this.logger.debug(Re.L_REQUEST_T,"req navi => "+o,r),[4,this.runtime.httpReq({url:o,timeout:C,dataType:"text"})];case 1:if(200!==(s=c.sent()).status)return this.logger.debug(Re.L_REQUEST_R,"request navi failed: "+s.status,r),!this.runtime.useNavi&&i?[2,{code:re.SUCCESS,data:Jo()}]:[2,{code:this.transHttpCode(s.status)}];try{return 0===(a=s.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(a=JSON.parse('"'+a+'"')),(u=JSON.parse(a)).protocol=/^https/.test(o)?"https":"http",u.code&&200!==u.code?[2,{code:this.transHttpCode(u.code)}]:(this.runtime.useNavi||(u.server="",u.backupServer=Ei.getMiniCmpUrlList().join(","),u.logSwitch=0),[2,{code:re.SUCCESS,data:u}])}catch(e){this.logger.error(Re.L_PARSE_NAVI_E,s.data,r)}return[2,{code:re.RC_NAVI_REQ_FAILED}]}}))}))},t.prototype.httpRequestV2=function(e,t,n,r,i){return l(this,void 0,void 0,(function(){var o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:n,uri:e,platform:this.runtime.tag,protocol:(/^https/.test(e)?Be.WSS:Be.WS).toString()}),this.logger.debug(Re.L_REQUEST_T,"req navi => "+o.url,r),[4,this.runtime.httpReq(o)];case 1:if(200!==(s=l.sent()).status)return this.logger.debug(Re.L_REQUEST_R,"request navi failed: "+s.status,r),!this.runtime.useNavi&&i?[2,{code:re.SUCCESS,data:Jo()}]:[2,{code:this.transHttpCode(s.status)}];try{return a=s.data,(u="object"!=typeof a?JSON.parse(a):a).protocol=/^https/.test(o.url)?"https":"http",this.runtime.useNavi||(u.logSwitch=0,c=Ei.getMiniCmpUrlList(),u.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?Be.WSS:Be.WS,weight:c.length-t}}))),[2,{code:re.SUCCESS,data:u}]}catch(e){this.logger.error(Re.L_PARSE_NAVI_E,s.data,r)}return[2,{code:re.RC_NAVI_REQ_FAILED}]}}))}))},t.prototype.getNaviCache=function(e){var t=this,n=this.getCatchKey(e);if(Wo[n])return Wo[n];var r,i=Z.NAVI_KEY(this.appkey),o=this.runtime.localStorage;try{var s=o.getItem(i);r=s?JSON.parse(s):[]}catch(e){r=[]}if(0===r.length)return null;var a=r.find((function(n){return n.token===e&&n.environment===t._environment}))||null;return Wo[n]=a,a},t.prototype.setNaviCache=function(e,t){var n,r=this,i=Z.NAVI_KEY(this.appkey),o=this.runtime.localStorage;try{var s=o.getItem(i);n=s?JSON.parse(s):[]}catch(e){n=[]}var a=Date.now();n.length>0&&(n=n.filter((function(t){return a-t.timestamp<R&&(e!==t.token||r._environment!==t.environment)})));var u={timestamp:a,naviInfo:t,token:e,environment:this._environment};n.push(u),o.setItem(i,JSON.stringify(n)),Wo[this.getCatchKey(e)]=u},t}(Qo),zo=function(){function e(e,t){this._runtime=e,this._appkey=t,this._sendMessageMap={},this._userId=""}return e.prototype.init=function(e){this._userId=e;var t=Z.SEND_MSG_KEY(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)},e.prototype._getLocalInfo=function(e){var t=this._runtime.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}},e.prototype.setMessage=function(e,t){this._sendMessageMap[e]=t;var n=Z.SEND_MSG_KEY(this._appkey,this._userId),r=this._getLocalInfo(n);r[e]=t,this._runtime.localStorage.setItem(n,JSON.stringify(r))},e.prototype.getSendMessageMap=function(){return this._sendMessageMap},e.prototype.removeByUID=function(e){delete this._sendMessageMap[e]},e.prototype.removeByTimestamp=function(e){var t=Z.SEND_MSG_KEY(this._appkey,this._userId),n=this._getLocalInfo(t);Object.keys(n).forEach((function(t){n[t]<e&&delete n[t]})),this._runtime.localStorage.setItem(t,JSON.stringify(n))},e}();(Xo={})[oe.PRIVATE]=No.qryPMsg,Xo[oe.GROUP]=No.qryGMsg,Xo[oe.CHATROOM]=No.qryCHMsg,Xo[oe.CUSTOMER_SERVICE]=No.qryCMsg,Xo[oe.SYSTEM]=No.qrySMsg;var $o=[No[No.recallMsg],No[No.ppMsgS],No[No.pgMsgS],No[No.ppMsgP],No[No.pgMsgP],No[No.chatMsg],No[No.pcMsgP],No[No.prMsgS],No[No.pbMsgP]],es=function(){function e(e,t,n){this._localStore=new o(e,Z.ULTRA_GROUP_STATE_KEY(t,n))}return e.prototype.set=function(e,t,n,r){var i=this._getStoreKey(e,t,r),o=this._localStore.get(i)||{};for(var s in n){var a=ns[s],u=n[s];if(!Zt(a)&&!Zt(u))u===ts[a].defaultVal?delete o[a]:o[a]=u}en(o)?this._localStore.set(i,o):this._localStore.remove(i)},e.prototype.get=function(e,t,n){void 0===n&&(n="");var r=this._getStoreKey(e,t,n),i=this._localStore.get(r)||{},o={};for(var s in ts){var a=ts[s],u=a.keyName,c=a.defaultVal;o[u]=i[s]||Ir(c)}return o},e.prototype._getStoreKey=function(e,t,n){return n+"_"+e+"_"+t},e}(),ts={nc:{keyName:"notificationStatus",defaultVal:2},nl:{keyName:"notificationLevel",defaultVal:0}},ns={};for(var rs in ts){var is=ts[rs].keyName;ns[is]=rs}var os,ss=function(){function e(e,t,n){this._store=new es(e.runtime,t,n)}return e.prototype.addUltraGroupStatus=function(e){var t=e.conversationType,n=e.targetId,r=e.notificationStatus,i=e.notificationLevel,o=e.channelId;t===oe.ULTRA_GROUP&&this._store.set(t,n,{notificationStatus:r,notificationLevel:i},o)},e.prototype.get=function(e,t,n){return void 0===n&&(n=""),this._store.get(e,t,n)},e}(),as="UpStreamMessage",us="PushExtra",cs="DownStreamMessage",ls="DownStreamMessages",ds="SessionsAttQryInput",hs="SessionsAttOutput",ps="SyncRequestMsg",_s="ChrmPullMsg",gs="NotifyMsg",fs="HistoryMsgInput",Es="HistoryMsgOuput",Is="RelationQryInput",Ts="RelationsOutput",Rs="UnreadMsgInfo",vs="DeleteSessionsInput",Cs="SessionInfo",ys="DeleteSessionsOutput",Ss="RelationDelBatchReq",ms="RelationOpInput",As="RelationsInput",Ns="DeleteMsgInput",Os="CleanHisMsgInput",Ms="CleanMsgBatchReq",Us="SessionMsgReadInput",Ls="ChrmInput",Ps="ChrmOutput",bs="QueryChatRoomInfoInput",Ds="QueryChatRoomInfoOutput",ws="GetQNupTokenInput",Vs="GetQNupTokenOutput",Gs="GetQNdownloadUrlInput",Bs="GetDownloadUrlInput",Fs="GetQNdownloadUrlOutput",ks="GetDownloadUrlOutput",xs="ChrmKVEntity",Hs="SetChrmKV",Ys="SetChrmKVS",qs="DeleteChrmKVS",Ks="ChrmKVOutput",js="ChrmKVSOutput",Qs="ChrmKVSVersionEntity",Ws="ChrmKVSOutputEntity",Js="QueryChrmKV",Xs="SetUserSettingInput",Zs="SetUserSettingOutput",zs="PullUserSettingInput",$s="PullUserSettingOutput",ea="UserSettingNotification",ta="SessionReq",na="SessionStates",ra="SessionState",ia="SessionStateItem",oa="SessionStateModifyReq",sa="SessionStateModifyResp",aa="TypeUnpushInput",ua="TypeUnpushOutput",ca="GroupUnpushQuery",la="GroupUnpushSet",da="QryRemindListReq",ha="QryRemindListResp",pa="GroupUnpushResult",_a="GrpReadReceiptMsg",ga="GrpReadReceiptQryReq",fa="GrpReadReceiptQryResp",Ea="GrpMsgReadUser",Ia="SessionTagAddInput",Ta="SessionTagItem",Ra="SessionTagDelInput",va="SessionDisTagReq",Ca="ReportSDKInput",ya="ReportSDKOutput",Sa="UltraGrpPullSes",ma="UltraGrpPullMsg",Aa="MsgChangeReq",Na="QueryMsgChange",Oa="MsgChange",Ma="MsgChangeList",Ua="EventChange",La="EventChangeList",Pa="MsgQuery",ba="MessageQueryInfo",Da="MsgQueryAck",wa="OperateStatus",Va="OperateStatusNotify",Ga="OperateInfo",Ba="OperateSummary",Fa="SetRtcRoomIdInput",ka="SetRtcRoomIdOutput",xa="CallInfoUpStream",Ha="CallInfoDownStream",Ya="KvInput",qa="KvOutput",Ka="ReadReceiptMsg",ja="ReceiptQryReq",Qa="QueryReceiptResp",Wa="ReceiptUser",Ja="ReceiptCntQryReq",Xa="ReceiptCntQryResp",Za="MsgReadCnt",za="UpdateUserSubReq",$a="UserSubDetail",eu="UpdateUserSubResp",tu="PUllUserSubResp",nu="PullUserSubReq",ru="UserSubList",iu="PullSubDataReq",ou="PullSubDataResp",su="SubDataDetail",au="SubData",uu="QrySubDataReq",cu="UserProfile",lu="ProfileInfo",du="SetUserProfileResp",hu="PullUserProfileReq",pu="UserProfiles",_u="UserProfileInput",gu="UserProfilePermission",fu="UserProfileOutput",Eu="SearchUserProfile",Iu="ChannelsInput",Tu="ChannelBaseInfo",Ru="ChannelsOutput",vu="MultiChannels",Cu="ModifyChannelsInput",yu="QuitChannelsSetting",Su="ChannelsQueryInput",mu="ChannelsPageParam",Au="ChannelsListResult",Nu="ChannelsUserInfo",Ou="ChannelsUserExtInfo",Mu="ChannelsMemberUpdateInput",Uu="ChannelsJoinedInfo",Lu="ChannelsInviteStatusInfo",Pu="ChannelsMemberResponseInput",bu="ChannelsMembersInput",Du="ChannelsInviteStatusInfos",wu="ChannelsJoinedInfos",Vu="ChannelsUserInfos",Gu="UpdateChannnelInfo",Bu="UpdateUserInfo",Fu="ChannelApplyInfo",ku="ChannelEventData",xu="FriendInput",Hu="FriendOutput",Yu="FriendsOutput",qu="FriendsInput",Ku="FriendsCheckOutput",ju="FriendCheckOutput",Qu="FriendProfileInput",Wu="FriendQueryInput",Ju="FriendUserInfo",Xu="FriendInviteInfo",Zu="FriendsListInput",zu="FriendLevelSet",$u="FriendPageParam",ec="FriendUserInfos",tc="FriendInviteInfos",nc="FriendApplyEvent",rc="FriendRefuseEventData",ic="FriendUpdateEvent",oc="FriendTypeChangeEvent";(os={})[as]=["sessionId","classname","content","pushText","toUserIds","configFlag","clientUniqueId","appData","extraContent","pushExt","busChannel"],os[ls]=["list","syncTime","finished","broadcastSyncTime"],os[cs]=["fromUserId","type","groupId","classname","content","dataTime","status","msgId","extraContent","pushContent","configFlag","pushExt","busChannel","extStatus","toUserIds","groupUnpush"],os[us]=["title","templateIdNoUse","pushId","pushConfigs","templateId"],os[ds]=["nothing"],os[hs]=["inboxTime","sendboxTime","totalUnreadCount"],os[ps]=["syncTime","ispolling","isweb","isPullSend","isKeeping","sendBoxSyncTime","broadcastSyncTime"],os[_s]=["syncTime","count"],os[gs]=["type","time","chrmId"],os[fs]=["targetId","time","count","order","busChannel"],os[Es]=["list","syncTime","hasMsg"],os[Is]=["type","count","startTime","order"],os[Ts]=["info","isFinished"],os[Rs]=["msgId","msgTime","remindType","className"],os[vs]=["sessions"],os[Ss]=["RelationOpInput"],os[ms]=["conversationId","conversationType","busChannel"],os[Cs]=["type","channelId","busChannel"],os[ys]=["nothing"],os[As]=["type","msg","count","busChannel","startTime","endTime"],os[Ns]=["type","conversationId","msgs","busChannel"],os[Os]=["targetId","dataTime","conversationType","busChannel"],os[Ms]=["CleanHisMsgInput"],os[Us]=["type","msgTime","channelId","busChannel"],os[Ls]=["nothing","extra"],os[Ps]=["nothing","sessionId","joinTime"],os[bs]=["count","order"],os[Ds]=["userTotalNums","userInfos"],os[ws]=["type","key","httpMethod","queryString","url","ext","size"],os[Gs]=["type","key","fileName"],os[Bs]=["type","key","fileName","ext"],os[Vs]=["deadline","token","bosToken","bosDate","path","osskeyId","ossPolicy","ossSign","ossBucketName"],os[Fs]=["downloadUrl"],os[ks]=["downloadUrl"],os[xs]=["key","value","status","timestamp","uid","version"],os[Hs]=["entry","bNotify","notification","type"],os[Ys]=["entry","bNotify","notification","type"],os[qs]=["entry","bNotify","notification","type"],os[Ks]=["entries","bFullUpdate","syncTime"],os[js]=["timestamp","errorKeys","keysVersion"],os[Qs]=["version","key"],os[Ws]=["key","errorCode"],os[Js]=["timestamp"],os[Xs]=["version","value"],os[Zs]=["version","reserve"],os[zs]=["version","reserve"],os[$s]=["items","version"],os.UserSettingItem=["targetId","type","key","value","version","status","tags"],os[ta]=["time"],os[na]=["version","state"],os[ra]=["type","channelId","time","stateItem","busChannel"],os[ia]=["sessionStateType","value","tags"],os[oa]=["version","state"],os[sa]=["version"],os[aa]=["type","version","unpushLevel"],os[ua]=["version"],os[la]=["busChannel","unpushLevel"],os[da]=["groupId","busChannel","msgTime","size"],os[ca]=["busChannel"],os[pa]=["groupId","busChannel","unpushLevel"],os[_a]=["msgId","busChannel"],os[ga]=["msgId","busChannel"],os[fa]=["totalMemberNum","list"],os[Ea]=["readTime","userId"],os[Ia]=["version","tags"],os[Ta]=["tagId","name","createdTime","isTop"],os[Ra]=["version","tags"],os[va]=["tagId"],os[ea]=["version","reserve"],os[Ca]=["sdkInfo"],os[ya]=["nothing"],os[Sa]=["syncTime","isEraseMsgContent"],os[ma]=["syncTime"],os[Aa]=["fromUserId","targetId","type","busChannel","msgUID","msgTime","content"],os[Na]=["syncTime","needCompress","onlineTime","targetId"],os[Ma]=["list","syncTime","hasNext"],os[Oa]=["targetId","type","time","changeType","msgUID","msgTime","busChannel","isAdmin","isDel","operatorId","subChangeType","busChannelType","isRemindMe","userGroupIds","remindType"],os[La]=["list","syncTime","hasNext"],os[Ua]=["targetId","type","time","changeType","msgUID","msgTime","busChannel","isAdmin","isDel","operatorId","subChangeType","busChannelType","isRemindMe","userGroupIds","remindType"],os[Pa]=["targetId","type","query"],os[ba]=["msgTime","msgUID","busChannel"],os[Da]=["list"],os[wa]=["targetId","type","opType","busChannel"],os[Va]=["type","notifyType","info","summary"],os[Ga]=["targetId","busChannel","userId","opType","optime"],os[Ba]=["targetId","busChannel","count","opType"],os[Fa]=["rtcRoomId"],os[ka]=["nothing"],os[Ka]=["targetId","type","busChannel","startMsgId","endMsgId"],os[ja]=["msgId","busChannel","targetId"],os[Qa]=["num","list"],os[Wa]=["receiptTime","userId"],os[Ja]=["type","channelId","busChannel","msgId"],os[Xa]=["result"],os[Za]=["msgId","cnt","tmn"],os[za]=["subType","subUsers","opType","expiry"],os[$a]=["subUserId"],os[eu]=["subUsers","subTime"],os[nu]=["version","pageToken"],os[tu]=["list","version","hasNext","pageToken","isFull"],os[ru]=["subUsers","subType","subTime","expiry","opType"],os[iu]=["versionTime","needAllData","pageToken"],os[ou]=["list","versionTime","hasNext","pageToken","isFull"],os[su]=["statusStr","subUserId","data","subType"],os[au]=["platformInfo","value","versionTime"],os[uu]=["subType","subUsers"],os[cu]=["version","userId","userProfile","userExtProfile"],os[lu]=["key","value"],os[du]=["version","key"],os[hu]=["userId"],os[pu]=["UserProfile"],os[_u]=["nothing"],os[gu]=["permission"],os[fu]=["nothing"],os[Eu]=["uniqueId"],os[Iu]=["targetId","type","baseInfo","extProfile","settingInfo","users","bindMsgInfo"],os[Tu]=["creatorId","ownerId","createTime","memberCount"],os[Ru]=["operateTime","flag","msg"],os[vu]=["list"],os[Cu]=["targetId","type","baseInfo","users","operateType"],os[yu]=["isQuit","isDelBan","isDelWhite","isDelAttention"],os[Su]=["targetId","type","page","ids","roleType"],os[mu]=["size","pageToken","hasNext","total","order"],os[Au]=["listType","result","page"],os[Nu]=["userId","ext","opTime"],os[Ou]=["role","joinTime","channelNickName","additional"],os[Mu]=["targetId","type","userId","channelNickName","additional","operateType"],os[Uu]=["targetId","settingProfile","extProfile","baseInfo","userInfo"],os[Lu]=["targetId","joinUserInfo","inviterInfo","status","directionType","joinType","detail","applyTime","processInfo","processTime"],os[Pu]=["targetId","type","optType","optResult","invitedId","detail"],os[bu]=["targetId","type","userId"],os[xu]=["targetId","type","info"],os[Hu]=["userId","operateTime","flag"],os[Yu]=["list"],os[qu]=["targetId","type"],os[Ku]=["list"],os[ju]=["targetId","status"],os[Qu]=["targetId","remarkName","extProfile"],os[Wu]=["queryType","friendType","page"],os[Ju]=["userId","relationTime","friendType","flag","remarkName","name","portraitUrl","extProfile"],os[Xu]=["userId","name","portraitUrl","type","status","operateTime","info","friendType"],os[Zu]=["targetId","type"],os[zu]=["level"],os[Du]=["list"],os[wu]=["list"],os[Vu]=["list"],os[$u]=["size","pageToken"],os[ec]=["list"],os[tc]=["list"],os[nc]=["applyType","friendType","info","name","portraitUrl"],os[rc]=["info"],os[Gu]=["channelInfo","userInfo"],os[Bu]=["updatedUserInfo","optUserInfo"],os[Fu]=["statusInfo"],os[ku]=["optUserInfo","channelInfo","userInfos"],os[oc]=["friendId","friendType"],os[ic]=["remarkname","extProfile"];var sc,ac="\npackage Modules;\nmessage probuf {\n message SetUserStatusOutput\n {\n optional int32 nothing=1;\n }\n\n message GetUserStatusInput\n {\n optional int32 nothing=1;\n }\n\n message GetUserStatusOutput\n {\n optional string status=1;\n optional string subUserId=2;\n }\n\n message SubUserStatusInput\n {\n repeated string userid =1;\n }\n\n message SubUserStatusOutput\n {\n optional int32 nothing=1;\n }\n message VoipDynamicInput\n {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n\n message VoipDynamicOutput\n {\n required string dynamicKey=1;\n }\n message "+gs+" {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message "+ps+" {\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 }\n message "+as+" {\n required int32 sessionId = 1;\n required string classname = 2;\n required bytes 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; // 系统会话消息时需填该字段为 targetId, 其他类型无需传\n }\n message "+us+" {\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 "+ls+" {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n }\n message "+cs+" {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required bytes 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; // 该消息所属会话的业务标识,限制20字符以内\n // 消息的扩展标记\n // 第0位,表示送达状态: 0x01 表示已送达;\n // 断档: 0x02 表示是否需要执行断档策略;\n // 消息修改: 0x04 拉取历史消息时表示该消息是否修改过\n // 0x08 每条消息携带的频道类型\n optional int64 extStatus = 20;\n repeated string toUserIds = 21; //指定接收者(限定群, 讨论组, 超级群)//增加聊天室定向成员\n optional int32 groupUnpush = 22; //群聊默认免打扰级别\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 = "+$.IMAGE+";\n audio = "+$.AUDIO+";\n video = "+$.VIDEO+";\n file = "+$.FILE+";\n sight = "+$.SIGHT+";\n html = "+$.COMBINE_HTML+";\n }\n message "+ws+" {\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; // url, sdk 设置下载地址\n optional string ext = 6; // 扩展字段,SDK 与 服务自定义字段,格式 json\n optional int64 size = 7; // 文件大小, 单位 KB\n }\n message "+Gs+" {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message "+Bs+" {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4; // 扩展字段,SDK 与 服务自定义字段,格式 json\n optional int64 size = 5; // 文件大小, 单位 KB\n }\n message "+Vs+" {\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 optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\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 optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n // 兼容 minio 协议\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; // 下载鉴权信息,格式为 Json 格式\n }\n message "+Fs+" {\n required string downloadUrl = 1;\n }\n message "+ks+" {\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 "+Ls+" {\n required int32 nothing = 1;\n optional string extra = 2; //自定义扩展内容\n }\n message "+Ps+" {\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 "+_s+" {\n required int64 syncTime = 1;\n required int32 count = 2;\n }\n\n message ChrmPullMsgNew\n {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message "+Is+"\n {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n }\n message "+As+"\n {\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 "+Ts+"\n {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;//是否结束\n }\n message RelationInfo\n {\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; // 0: 公有频道; 1: 私有频道;\n optional "+Rs+" msgInfo = 10; // 新增 首条未读消息信息,可为空\n optional int32 remindMeCount = 11; //@ 我的未读数\n }\n message "+Rs+" //未读消息摘要信息\n {\n required string msgId = 1; //消息唯一标示\n required int64 msgTime= 2;//消息时间\n optional int32 remindType= 3;//@类型。查询会话时无此字段。查询未读@列表时返回\n optional string className = 4; //消息类型\n }\n message "+da+" // 新增 查询未读@列表入参\n {\n required string groupId = 1; // 群 ID\n optional string busChannel = 2; // 频道(channelId,可以为空)\n optional int64 msgTime = 3; // 消息时间戳\n optional int32 size = 4; // 单页长度,默认20,最大20\n }\n message "+ha+" //查询未读@列表出参\n {\n repeated "+Rs+" msgInfo = 1; //未读@消息摘要列表\n }\n message RelationInfoReadTime\n {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message "+Os+"\n {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4; //该消息所属会话的业务标识,限制20字符以内\n }\n message "+Ms+"\n {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput\n {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput\n {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n }\n message "+bs+"\n {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message "+Ds+"\n {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember\n {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput\n {\n required string id = 1;\n }\n\n message MPFollowOutput\n {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput\n {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo\n {\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 {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput\n {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput\n {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput\n {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message "+fs+"\n {\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; //该消息所属会话的业务标识,限制20字符以内\n }\n\n message "+Es+"\n {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n }\n message "+ds+"{\n required int32 nothing = 1;\n }\n message "+hs+"{\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message "+Us+"\n {\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 {\n optional int32 nothing=1;\n }\n message "+vs+"\n {\n repeated SessionInfo sessions = 1;\n }\n message "+Cs+"\n {\n required ChannelType type = 1;\n required string channelId = 2;\n optional string busChannel = 3;//所属会话业务标识\n }\n message "+ys+"\n {\n optional int32 nothing=1;\n }\n message "+Ss+" \n {\n repeated RelationOpInput relation = 1;\n }\n message "+ms+"\n {\n required string conversationId = 1;//会话ID\n required ChannelType conversationType = 2;//会话类型,比如单聊、群等\n optional string busChannel = 3;//该消息所属会话的业务标识,限制20字符以内\n }\n message "+Ns+"\n {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4; //该消息所属会话的业务标识,限制20字符以内\n }\n message DeleteMsg\n {\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 "+Hs+" {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message "+Ys+" {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message "+qs+" {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message "+Ks+" {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message "+js+" {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message "+Ws+"\n {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message "+Js+" {\n required int64 timestamp = 1;\n }\n message "+Xs+" {\n required int64 version=1;\n required string value=2;\n }\n message "+Zs+" {\n required int64 version=1;\n required bool reserve=2;\n }\n message "+zs+" {\n required int64 version=1;\n optional bool reserve=2;\n }\n message "+$s+" {\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 "+ta+" {\n required int64 time = 1;\n }\n message "+na+" {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message "+ra+" {\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 "+ia+" {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n }\n message "+oa+" {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message "+ca+" {\n optional string busChannel = 1;\n }\n message "+la+"{\n optional string busChannel = 1;\n required int32 unpushLevel = 2;\n }\n message "+pa+" {\n required string groupId = 1;\n optional string busChannel = 2;\n required int32 unpushLevel = 3;\n }\n message "+sa+" {\n required int64 version=1;\n }\n message "+aa+" {\n required ChannelType type = 1; // 会话类型\n required int64 version = 2;\n required int32 unpushLevel = 3; // 免打扰级别\n }\n message "+ua+" {\n required int64 version = 1;\n }\n message "+_a+" {\n repeated string msgId=1; //已读消息ID\n optional string channelId = 2; // 该消息所属会话的业务标识\n }\n message "+ga+" {\n repeated string msgId=1; //已读消息ID\n optional string channelId = 2; // 该消息所属会话的业务标识\n }\n message "+fa+" {\n required int32 totalMemberNum = 1;//群内总人数\n repeated GrpMsgReadUser list = 2;//已读用户列表(list复类型)\n }\n message "+Ea+" {\n required int64 readTime = 1;//已读时间\n required string userId = 2;//已读用户id\n }\n message "+Ia+" {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message "+Ta+" {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message "+Ra+" {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message "+va+" {\n repeated string tagId=1;\n }\n message "+ea+" {\n required int64 version=1;\n required bool reserve=2;\n }\n message "+Ca+' {\n required string sdkInfo=1; // 用户集成的 sdk 信息,json 格式 {"web-rtc": "4.0.3.7"}\n }\n message '+ya+"\n {\n optional int32 nothing=1; //占位\n }\n message "+Sa+"\n {\n required int64 syncTime = 1;//同步时间戳\n optional bool isEraseMsgContent = 2;//拉取会话时,是否屏蔽掉消息内容\n }\n message "+ma+"\n {\n required int64 syncTime = 1;//同步时间戳\n }\n message "+Aa+"\n {\n required string fromUserId = 1;//(谁发的)\n required string targetId = 2;// 目标Id(超级群Id)\n required ChannelType type = 3;//发送类型如:(P2P,GROUP,ULTRAGROUP)\n required string msgUID = 4; // 扩展消息的内容体\n required int64 msgTime = 5; //原始消息时间\n optional string busChannel = 6; // 该消息所属会话的业务标识,限制20字符以内\n optional string content = 7; // 即extraContent消息扩展内容,下表格说明\n }\n message "+Na+" //查询入参\n {\n required int64 syncTime = 1;//同步时间戳\n optional int32 needCompress = 2;//是否压缩(暂时无效字段)\n optional int64 onlineTime = 3;//传递本次连接上线时间\n optional string targetId = 4;//资源ID(群ID),为空默认拉取全量数据。本期需求为空\n }\n message "+La+" //应答结果\n {\n repeated EventChange list = 1; //变更列表(包含超级群相关数据、及本期数据,PB定义不变,仅字段名调整)\n required int64 syncTime = 2; //同步时间(用于下次同步入参)\n optional bool hasNext = 3 ;\n optional string targetId = 4;//群ID,为空默认拉取全量数据(值为入参字段)\n optional bool isCompress = 5 ; //数据是否压缩\n }\n message "+Ua+" //变更详情\n {\n optional string businessId = 1; // 业务主ID(群Id/对方用户Id)\n optional ChannelType channelType = 2; // 会话类型\n optional int64 time = 3; // 变更时间\n optional int32 changeType = 4; // 变更类型(1:扩展,2:修改,3:撤回,4:频道变更,11:群组操作,12:群资料表更...)\n optional string originalId = 5; // 原始数据ID(例如:消息Id)(新版可为空,待测试旧SDK是否崩溃)\n optional int64 originalTime = 6; // 原始数据时间(例如:消息时间)\n optional string secondaryId = 7; // 业务子ID(例如:频道Id,新群主ID...)\n optional bool isAdmin = 8; //是否为管理员操作\n //额外标记(例如:是否删除消息,changeType==31是否双向好友,changeType==13 subChangeType=2 申请是否通过,changeType==32 申请是否同意)\n optional bool additionalMark = 9; \n optional string operatorId = 10; // 操作人Id\n // subChangeType 的意义由 changeType 的值来决定\n // 当 changeType 为 4 时;\n // 1: 删除频道;\n // 2: 公有频道变为私有频道;\n // 3: 私有频道变为公有频道;\n // 4: 私有频道成员变更-加入, SDK 不通知业务层;\n // 5: 私有频道成员变更-退出;\n // 6: 公有频道变为私有频道,当前用户不在白名单中;\n // 当 changeType 为 5 时;\n // 1: 删除用户组 (通知到 用户组下所有用户)\n // 2: 用户组增加用户 (仅通知到该用户)\n // 3: 用户组删除用户 (仅通知到该用户)\n // 4: 频道绑定用户组 (通知到 用户组下所有用户)\n // 5: 频道解绑用户组 (通知到 用户组下所有用户)\n optional int32 subChangeType = 11;\n optional int32 secondaryType = 12; //业务子ID类型标记(例如:频道公私有标记,申请回调类型(0申请 1拒绝))\n optional bool isRemindMe = 13;//是否仅自己相关(例如:是否为@我的消息)\n repeated string extIds = 14; //扩展ID列表(例如:用户组id列表, 当changeType==11 用户ID列表、管理员列表等等)\n optional int32 remindType = 15; //提醒范围(例如@类型:0非@消息,1@所有人消息,2@单人消息)\n optional bytes eventData = 16; //事件依赖的业务数据,包括群资料、群成员资料等,以byte[]形式返回 根据具体业务类型转为实际PB\n }\n message "+Ma+" //应答结果\n {\n repeated MsgChange list = 1; //变更\n required int64 syncTime = 2; //同步时间(用于下次同步入参)\n optional bool hasNext = 3 ;\n }\n message "+Oa+" //变更详情\n {\n required string targetId = 1; // 目标Id(超级群Id)\n required ChannelType type = 2; // 会话类型\n required int64 time = 3; // 变更时间\n required int32 changeType = 4; // 消息变更类型(1:扩展,2:修改,3:撤回,4:频道变更,5:用户组变更)\n required string msgUID = 5; // 消息ID\n required int64 msgTime = 6; // 消息时间\n optional string busChannel = 7; // 频道ID\n optional bool isAdmin = 8; //是否为管理员,默认为 0, 设为 1 时, IMKit 收到此条消息后,小灰条默认显示为“管理员 撤回了一条消息”。\n optional bool isDel = 9; //默认为 0 撤回该条消息同时,用户端将该条消息删除并替换为一条小灰条撤回提示消息;为 1 时,该条消息删除后,不替换为小灰条提示消息。\n optional string operatorId = 10; // 消息变更的操作人 Id; subChangeType 为 5 时,operatorId 表示被踢出超级群私有频道白名单的用户\n // subChangeType 的意义由 changeType 的值来决定\n // 当 changeType 为 4 时;\n // 1: 删除频道;\n // 2: 公有频道变为私有频道;\n // 3: 私有频道变为公有频道;\n // 4: 私有频道成员变更-加入, SDK 不通知业务层;\n // 5: 私有频道成员变更-退出;\n // 6: 公有频道变为私有频道,当前用户不在白名单中;\n // 当 changeType 为 5 时;\n // 1: 删除用户组 (通知到 用户组下所有用户)\n // 2: 用户组增加用户 (仅通知到该用户)\n // 3: 用户组删除用户 (仅通知到该用户)\n // 4: 频道绑定用户组 (通知到 用户组下所有用户)\n // 5: 频道解绑用户组 (通知到 用户组下所有用户)\n optional int32 subChangeType = 11;\n optional int32 busChannelType = 12; // 0:公有频道; 1:私有频道\n optional bool isRemindMe = 13;// 是否为@我的消息, 消息撤回时, 该字段有意义, 用于客户端计算是否未读数总数-1,未读@消息数-1 -- server 暂未支持\n repeated string userGroupIds = 14; //用户组id列表,用于用户组增删成员或频道绑定解绑用户组的通知中\n optional int32 remindType = 15; // @类型:0非@我消息,1@所有人消息,2@我单人的消息\n }\n message "+Pa+" //请求\n {\n required string targetId = 1; // 目标Id(超级群Id)\n required ChannelType type = 2; // 会话类型\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo\n {\n required int64 msgTime = 1; // 消息时间\n required string msgUID = 2; // 消息ID\n optional string busChannel = 3; // 频道ID\n }\n message "+Da+" //应答\n {\n repeated DownStreamMessage list = 1;//消息\n }\n message "+wa+" //客户端发送\n {\n optional string targetId = 1;// targetId\n optional ChannelType type = 2;//发送会话类型如:(P2P,GROUP) \n optional int32 opType = 3; //0 , 正在输入, 1 正在XXX \n optional string busChannel = 4; // 频道(channelId,可以为空)\n }\n message "+Va+" //服务端发送\n {\n optional ChannelType type = 1;//发送会话类型如(P2P,GROUP) \n optional int64 notifyType = 2; //0x1 表示明细, 0x2 表示汇总 0x3 表示明细+汇总\n repeated OperateInfo info = 3 ; //明细列表 当notifyType 为 1和3时,有效\n repeated OperateSummary summary = 4 ; //汇总列表, 当notifyType 为2和3 时,有效\n }\n message "+Ga+" {\n // XX 正在做什么\n optional string targetId = 1; // 超级群Id 会话id\n optional string busChannel = 2; // 频道(channelId,可以为空)\n optional string userId = 3; // userId\n optional int32 opType = 4; //0 , 正在输入, 1 正在XX \n optional int64 optime = 5; //服务端收到用户操作的上行时间. \n }\n \n message "+Ba+" {\n // 几个人 正在干什么\n optional string targetId = 1; // 超级群Id 会话id\n optional string busChannel = 2; // 频道(channelId,可以为空)\n optional int32 count = 3; // 操作人数\n optional int32 opType = 4; //0, 正在输入, 1 正在XX \n }\n\n message "+Fa+"\n {\n required string rtcRoomId= 1; //rtc房间ID;\n }\n message "+ka+"\n {\n required int32 nothing = 1; //用于占位\n }\n message "+xa+"\n {\n required string key= 1; //业务方法关健字(如:ringCall)\n required string dataContent=2; //业务数据json字符串\n }\n message "+Ha+"\n {\n required string key= 1; //业务方法关健字(如:ringCall)\n required string dataContent=2; //业务数据json字符串\n required int64 maxTime=3;//时间戳,这个下行直发的时候带上\n }\n message "+Ya+"\n {\n required int64 syncTime = 1; //同步时间戳\n }\n message "+qa+"\n {\n required int64 maxTime = 1; //最大时间戳\n repeated KvInfo info = 2; //kv对象\n }\n \n message KvInfo{\n required string key =1; //健名\n required string value =2; //健值\n }\n message "+Ka+"\n {\n required string targetId = 1;\n required ChannelType type = 2; //会话类型:单聊1、群聊3\n optional string busChannel = 3; //该消息所属会话的业务标识\n optional string startMsgId = 4; //已读消息ID区间开始(单聊极端场景下,无此属性或为空字符串)\n optional string endMsgId = 5; //已读消息ID区间结束(对应RC:RRMsg 中 endMsgId)\n }\n message "+ja+"\n {\n required string msgId = 1;//已读 消息ID \n optional string busChannel = 2; //该消息所属会话的业务标识\n required string targetId = 3; //群聊:群id\n }\n message "+Qa+"\n {\n optional int32 num = 1;// 群总人数\n repeated ReceiptUser list = 2;//已读用户列表(list复类型)\n optional int32 readCnt = 3; //已读人数\n }\n message "+Wa+"\n {\n required int64 receiptTime = 1;//已读 时间。已做归并,SDK 向上层返回应最多只精确到分钟 \n required string userId = 2;//已读 用户id\n }\n message "+Ja+"\n {\n optional ChannelType type = 1; //发送类型如:(GROUP)\n optional string channelId = 2; //会话id\n optional string busChannel = 3; //该消息所属会话的业务标识\n repeated string msgId = 4; //消息id列表\n }\n message "+Xa+"\n {\n repeated MsgReadCnt result= 1; //已读状态列表\n }\n\n message "+Za+"\n {\n optional string msgId = 1; //消息id\n optional int32 cnt = 2; //已读人数\n optional int32 tmn = 3; //群人数\n }\n message "+za+"\n {\n optional int32 subType = 1;//订阅类型(1:在线状态订阅,2:用户信息托管订阅)\n repeated UserSubDetail subUsers = 2;//订阅用户列表(单次请求最大 200)\n optional int32 opType = 3; //操作类型(0订阅(且自动过期,需携带订阅有效期),1 取消订阅)\n optional int32 expiry = 4; //订阅有效期(秒),默认 xx秒待产品定义\n }\n message "+$a+" {\n optional string subUserId = 1;//被订阅用户ID\n }\n message "+eu+" {\n repeated UserSubDetail subUsers = 1; //被订阅达到上限用户ID列表\n optional int64 subTime = 2;//订阅时间\n }\n message "+nu+" {\n optional int64 version = 1;//用于增量拉取,卸载重装后使用0,后续使用 Resp.subTime\n optional string pageToken = 2;//用于分页,首页请求为空字符串,第二页及后续请求时 使用 Resp.pageToken\n }\n message "+tu+" {\n repeated UserSubList list = 1;//订阅用户列表(单次请求最大 200)\n optional int64 version = 2;//数据版本时间(用于分页,返回后 用于SDK 请求下一页携带)\n optional bool hasNext = 3;//是否还有下一页\n optional string pageToken = 4; //分页Token(返回后 用于SDK 请求下一页携带)\n optional bool isFull = 5; // true->全量的数据; false 增量的数据\n }\n message "+ru+" {\n repeated UserSubDetail subUsers = 1;//被订阅用户ID列表\n optional int32 subType = 2;//订阅类型(1:在线状态订阅,2:用户信息托管订阅)\n optional int64 subTime = 3;//订阅时间\n optional int32 expiry = 4;// 订阅有效期(秒),默认 xx秒待产品定义\n optional int32 opType = 5;// 增量拉取时返回 操作类型(0主动订阅(且自动过期,需携带订阅有效期),1主动取消订阅)\n } \n message "+iu+" {\n optional int64 versionTime = 1; // 用于增量拉取,卸载重装后使用0,后续使用 Resp.versionTime\n optional bool needAllData = 2; // 是否查询全量订阅数据(初始化时 为 true,s_cmd触发增量拉取 为false)\n optional string pageToken = 3; // 用于分页,首页请求为空字符串,第二页及后续请求时 使用 Resp.pageToken\n }\n message "+ou+" {\n repeated SubDataDetail list = 1; //数据列表\n optional int64 versionTime = 2; //数据版本时间(用于分页)\n optional bool hasNext = 3; //是否还有下一页\n optional string pageToken = 4; //分页Token(返回后 用于SDK 请求下一页携带)\n optional bool isFull = 5; // true->全量的数据; false 增量的数据\n }\n message "+su+" {\n optional string statusStr = 1;//兼容旧版s_stat,字段废弃\n optional string subUserId = 2;//被订阅用户ID\n repeated SubData data = 3;// 订阅数据\n optional int32 subType = 4; //类型(1:在线状态订阅, 2:用户信息托管订阅)\n }\n\n message "+au+" {\n optional int32 platformInfo = 1;//设备类型枚举值\n optional int32 value = 2;//具体数据(在线状态订阅表示:0离线,1上线)\n optional int64 versionTime = 3;//数据生成时间\n }\n message "+uu+" {\n optional int32 subType = 1;//订阅类型(1:在线状态订阅,2:用户信息托管订阅)\n repeated UserSubDetail subUsers = 2;//订阅用户列表(单次请求最大 200)\n }\n message "+cu+" {\n optional int64 version = 1;//用户版本号,设置时可以不传\n optional string userId = 2;//用户ID,设置时可不传\n repeated ProfileInfo userProfile = 3;//基本用户属性\n repeated ProfileInfo userExtProfile = 4;//扩展用户属性\n }\n message "+lu+" {\n optional string key = 1;//用户资料属性key\n optional string value = 2;//用户资料属性value\n }\n message "+du+" {\n optional int64 version = 1;//生成的最新版本号\n optional string key = 2;//如果应答码失败的话,返回具体失败的key\n }\n message "+hu+" {\n repeated string userId = 1;//用户Id\n }\n message "+pu+" {\n repeated UserProfile UserProfile = 1;\n }\n message "+_u+" {\n required int32 nothing = 1; //用于占位\n }\n message "+gu+" {\n optional int32 permission = 1;//1:全部不可见,2:全部可见,3仅好友(暂不支持)\n }\n message "+fu+" {\n required int32 nothing = 1; //用于占位\n }\n message "+Eu+" {\n optional string uniqueId = 1;//用户应用号\n }\n\n // 用户信息托管-群组\n message "+Iu+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n repeated ProfileInfo settingProfile = 3;//群设置属性(内置KV,Key见:ChannelSettingProfileKey)\n repeated ProfileInfo extProfile = 4;//扩展属性信息(自定义KV,最多可携带 10 个)\n optional ChannelBaseInfo baseInfo = 5;//群基础信息\n repeated string users = 6;//用户ID列表\n }\n\n message "+Tu+" {\n optional string creatorId = 1;//创建者 ID\n optional string ownerId = 2;//群主 ID\n optional int64 createTime = 3;//群组创建时间\n optional int32 memberCount = 4;//当前群成员数\n }\n\n message "+Ru+" {//托管 SDK 操作应答\n optional int64 operateTime = 1; //操作时间\n optional int32 flag = 2; //标记\n optional string msg = 3; //信息(name/portraitUrl/introduction...)\n optional int32 processCode = 4; //业务审批码(如果需要被邀请人同意,此码为25427)\n }\n\n message "+vu+" {\n optional ChannelType type = 1; // 会话类型\n repeated ChannelsInput list = 2; //群数组\n }\n\n message "+Cu+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n optional QuitChannelsSetting settingInfo = 3;//退出数据移除配置\n repeated string users = 4;//用户ID列表\n optional int32 operateType = 5; //操作类型\n }\n\n message "+yu+" {\n optional bool isQuit = 1; //是否退出(踢出、退出接口,固定 true)\n optional bool isDelBan = 2; //是否同时移除群成员禁言状态\n optional bool isDelWhite = 3; //是否同时移除群禁言白名单\n optional bool isDelAttention = 4;//退出绑定数据移除配置\n }\n\n message "+Su+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n optional ChannelsPageParam page = 3; //分页信息\n repeated string ids = 4; //id列表\n optional int32 roleType = 5; // 根据角色类型查成员信息(1:普通群成员,2:群管理员,3:群主,0全部)\n }\n\n message "+mu+" {\n optional int32 size = 1; //本次请求条数\n optional string pageToken = 2; //分页标记(由服务端返回,请求第一页SDK传空)\n optional bool hasNext = 3 ;//是否还有下一页(由服务端返回)\n optional int32 total = 4 ;//总数据条数(群成员总数,由服务端返回)\n optional int32 order = 5 ;//查询顺序(0,正序,1,倒序)\n }\n\n message "+Au+" {\n // listType=1,result=ChannelsUserInfos\n // listType=2,result=ChannelsInviteStatusInfos\n // listType=3,result=ChannelsJoinedInfos\n optional int32 listType = 1; // list数据类型\n optional bytes result = 2; //结果数组\n optional ChannelsPageParam page = 3; //分页信息\n }\n \n message "+Du+" {\n repeated ChannelsInviteStatusInfo list = 1; //结果数组\n }\n \n message "+Vu+" {\n repeated ChannelsUserInfo list = 1; //结果数组\n }\n \n message "+wu+" {\n repeated ChannelsJoinedInfo list = 1; //结果数组\n }\n\n message "+Nu+" {\n optional string userId = 1;//用户 ID\n optional ChannelsUserExtInfo ext = 2;//用户群信息\n optional int64 opTime = 3;//用户操作时间\n optional string name = 4;//昵称\n optional string portraitUrl = 5;//头像\n }\n\n message "+Ou+" {\n optional int32 role = 1;//群身份(0:普通群成员,1:群管理员,2:群主)\n optional int64 joinTime = 2;//入群建时间\n optional string channelNickName = 3;//群昵称\n optional string additional = 4;//用户附加信息\n optional string remarkName = 5;//群备注名字\n }\n\n message "+Mu+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n optional string userId = 3; //用户ID\n optional string channelNickName = 4;//群备注(hasValue==false 则移除)\n optional string additional = 5;//用户群附加信息\n optional int32 operateType = 6; //操作类型(1:添加,2:移除)\n }\n message "+Uu+" {\n optional string targetId = 1; // 目标Id(群Id)\n repeated ProfileInfo settingProfile = 2;//群设置属性(内置KV)\n repeated ProfileInfo extProfile = 3;//扩展属性信息(自定义KV,最多可携带 10 个)\n optional ChannelBaseInfo baseInfo = 4;//群基础信息\n optional ChannelsUserExtInfo userInfo = 5;//用户群信息\n }\n message "+Lu+" {\n optional string targetId = 1;//群 ID\n optional ChannelsUserInfo joinUserInfo = 2;//用户 ID(被邀请进群ID或者自己主动申请加群的ID)\n optional ChannelsUserInfo inviterInfo = 3;//邀请人用户ID(申请加群模式此字段为空)\n optional int32 status = 4;//状态(0:待管理员处理 1:管理员拒绝 2:待用户处理 3:用户拒绝 4:已入群 5:已过期(客户端占位,服务器没有这个枚举))\n optional int32 directionType = 5;//类型(0: 发出的申请 1: 发出的邀请 2: 收到的邀请 3: 收到的申请 )\n optional int32 joinType = 6; // (0:自己申请进群, 1 被邀请进群)\n optional string detail = 7; //备注(拒绝原因)\n optional int64 applyTime = 8;//发起时间\n optional ChannelsUserInfo processInfo = 9;//审批操作Id\n optional int64 processTime = 10;//审批操作时间\n }\n message "+Pu+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n optional int32 optType = 3; //处理人操作类型(0:被邀请人操作,1:管理员操作)\n optional int32 optResult = 4; //处理人操作结果((0:拒绝,1:同意)\n optional string joinUserId = 5; //被邀请进群的用户id(type=0时可不填,即当前用户ID,也是入群ID))\n optional string inviterId = 6;//主动邀请人ID\n optional string detail = 7; //备注(拒绝原因)\n }\n message "+bu+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n repeated string userIds = 3; //用户ID列表(被邀请加入的用户列表)\n }\n message "+xu+" {\n optional string targetId = 1; // 目标Id(对方用户Id)\n optional int32 type = 2; // 操作类型(0:单向好友,1:双向好友)\n optional string info = 3;//附加信息\n }\n message "+Yu+" {//托管SDK操作应答\n repeated FriendOutput list = 1;\n }\n message "+Hu+" {//托管SDK操作应答\n optional string userId = 1; //好友id\n optional int64 operateTime = 2; //操作时间\n optional string flag = 3; //标记(服务端返回,好友状态标记)\n }\n message "+qu+" {\n repeated string targetId = 1; // 目标Id列表(删除好友的用户Id列表)\n optional int32 type = 2; // 操作类型(1:删除单向好友,2:删除双向好友)\n }\n message "+Ku+" {\n repeated FriendCheckOutput list = 1;\n }\n\n message "+ju+"{\n optional string targetId = 1;\n optional int32 status = 2;\n }\n message "+Qu+" {\n optional string targetId = 1; // 目标Id(对方用户Id)\n optional string remarkName = 2;//好友备注名\n repeated ProfileInfo extProfile = 3;//扩展属性信息(最多可携带 10 个)\n }\n message "+Wu+" {\n optional int32 queryType = 1; // 操作类型(1:好友请求列表,2:好友列表)\n optional ChannelsPageParam page = 2; //分页信息\n optional int32 friendType= 3; // 0:全部 1:单向好友 2:双向好友 (查询请求列表) \n }\n message "+Ju+" {\n optional string userId = 1;//用户 ID\n optional int64 relationTime = 2;//成为好友时间\n optional int32 friendType = 3; // 类型(0:单向好友,1:双向好友)\n optional int32 flag = 4; //好友其他属性标记(位标记,第1位:是否在黑名单中,0不在,1在黑名单)\n optional string remarkName = 5;//好友备注名\n optional string name = 6;//昵称\n optional string portraitUrl = 7;//头像\n repeated ProfileInfo extProfile = 8;//扩展属性信息(最多可携带 10 个)\n \n }\n message "+Xu+" {\n optional string userId = 1;//用户 ID\n optional string name = 2;//昵称\n optional string portraitUrl = 3;//头像\n optional int32 type = 4; // 类型(0:发送的好友申请,1:接收的好友申请)\n optional int32 status = 5; // 请求状态(0:发起,1:已同意,2:已拒绝)\n optional int64 operateTime = 6;//操作时间\n optional string info = 7;//附加信息\n optional int32 friendType = 8; // 好友类型(0:单向好友,1:双向好友)\n }\n message "+Zu+" {\n repeated string targetId = 1; // 目标Id列表(删除好友的用户Id列表)\n optional int32 type = 2; // 操作类型(0:删除单向好友,1:删除双向好友)\n }\n message "+zu+" {\n optional int32 level = 1; // 1: 任何人可以加 2:需要认证 3: 不允许任何人添加\n }\n\n message "+$u+" {\n optional int32 size = 1; //本次请求条数\n optional string pageToken = 2; //分页标记(由服务端返回,请求第一页SDK传空) \n }\n message "+ec+" {\n repeated FriendUserInfo list = 1;\n }\n\n message "+tc+" {\n repeated FriendInviteInfo list = 1;\n }\n \n message "+nc+" {\n optional int32 applyType = 1;//申请类型(1:自己发起的请求,2:收到的好友请求)\n optional int32 friendType = 2;//好友类型(1:单向好友,2:双向好友)\n optional string info = 3;//申请信息\n optional string name = 4;//名称\n optional string portraitUrl = 5;//头像\n }\n message "+Gu+" {\n optional ChannelsJoinedInfo channelInfo = 1; //增量\n optional ChannelsUserInfo userInfo = 2;\n }\n message "+Bu+" {\n optional ChannelsUserInfo updatedUserInfo = 1; //被修改用户信息\n optional ChannelsUserInfo optUserInfo = 2;//操作用户信息\n }\n message "+Fu+" {\n repeated ChannelsInviteStatusInfo statusInfo = 1;//申请加群信息\n }\n message "+ku+" {\n optional ChannelsUserInfo optUserInfo = 1;//操作者ID\n optional ChannelsJoinedInfo channelInfo = 2;//群信息\n repeated ChannelsUserInfo userInfos = 3;//被操作用户(管理员,加群,退群成员等)\n }\n message "+oc+" {\n optional string friendId = 1;\n optional int32 friendType = 2; //类型(1:单向好友,2:双向好友)\n }\n message "+ic+" {\n optional string remarkname = 1;// \n repeated ProfileInfo extProfile = 2;//扩展属性信息(最多可携带 10 个)\n }\n}\n",uc=function(e,t,n,r,i,o){var s=i?Object.keys(i).map((function(t){return e.encode(hr.RtcValueInfo,{key:t,value:i[t]},!0)})):void 0,a=o?Object.keys(o).map((function(t){return e.encode(hr.RtcValueInfo,{key:t,value:o[t]},!0)})):void 0;return e.encode(hr.RtcInput,{roomType:t,broadcastType:n,joinType:r,innerDatas:s,outerDatas:a})},cc=function(e,t){var n=e.decode(hr.RtcUserListOutput,t),r=n.users,i=n.token,o=n.sessionId,s=n.roomInfo,a=n.entries,u=n.offlineKickTime,c={};return pr(r,(function(e){var t=e.userId,n=e.userData,r={};pr(n,(function(e){var t=e.key,n=e.value;r[t]=n})),c[t]=r})),{users:c,token:i,sessionId:o,roomInfo:s,kvEntries:a,offlineKickTime:u}};!function(e){e[e.STATISTICS=-2]="STATISTICS",e[e.RECORD=-1]="RECORD",e[e.FATAL=0]="FATAL",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG"}(sc||(sc={}));var lc=function(e){return[sc.DEBUG,sc.INFO,sc.WARN,sc.ERROR].some((function(t){return t===e}))},dc=En(),hc=Date.now(),pc=0,_c=function(){function e(e,t,n){this._appkey=e,this._id=t,this._type=n,this.outputLevel=sc.WARN,this.debug=this._log.bind(this,sc.DEBUG),this.info=this._log.bind(this,sc.INFO),this.warn=this._log.bind(this,sc.WARN),this.error=this._log.bind(this,sc.ERROR),this.__statistics=this._log.bind(this,sc.STATISTICS)}return e.prototype._stdout=function(e,t,n,r,i){var o;if(!(e<=sc.FATAL)&&console&&!(e>this.outputLevel)){var s=["error","warn","info","debug"][e-1];null===(o=console)||void 0===o||o[s](n+"["+this._id+"]["+s.toUpperCase()+"]: "+t+" | "+r+" | "+i)}},e.prototype.setOutputLevel=function(e){lc(e)&&(this.outputLevel=e)},e.prototype._log=function(e,t,n,r){var i=new Date;/^[\w-]+$/.test(t)?(this._stdout(e,t,i.toISOString(),n,r),e!==sc.DEBUG&&this.flush({time:+i,sessionId:dc,type:this._type,loggerId:this._id,tag:t,level:e,content:n,traceId:r})):this._stdout(sc.ERROR,"L_LOG_TAG_INVALID_E",i.toISOString(),t,r)},e.prototype.createTraceId=function(){return""+ ++pc},e.prototype.getSessionId=function(){return dc},e}(),gc=null,fc="RC_LOGS",Ec="RC_CONF",Ic=null,Tc=function(e){return l(void 0,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,gc];case 1:return(t=n.sent())?[4,new Promise((function(n){var r=t.db.transaction(fc,"readwrite").objectStore(fc).index("time"),i=IDBKeyRange.upperBound(Date.now()-e),o=r.openCursor(i);o.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},o.onerror=function(){n()}}))]:[2];case 2:return n.sent(),Ic=setTimeout((function(){return Tc(e)}),6e5),[2]}}))}))},Rc=function(e,t,n,r){void 0===r&&(r=168),gc||(Nr(n)?gc=new Promise((function(n){var i=window.indexedDB;Or();var o="RC_LOGS_"+e,s=i.open(o,1);s.onerror=function(e){t.error(Re.L_LOGDB_OPEN_FAILED_E,e.target.error),n(null)},s.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){gc=null,t.warn(Re.L_LOGDB_CLOSED_S)},o.onerror=function(e){gc=null,t.error(Re.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(Re.L_LOGDB_ABORT_S,e.target.error)},Tc(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;t.objectStoreNames.contains(fc)&&t.deleteObjectStore(fc);var n=t.createObjectStore(fc,{autoIncrement:!0});n.createIndex("level","level",{unique:!1}),n.createIndex("time","time",{unique:!1}),t.objectStoreNames.contains(Ec)&&t.deleteObjectStore(Ec),(n=t.createObjectStore(Ec,{keyPath:"key"})).createIndex("key","key",{unique:!0})}})):t.warn(Re.L_UNSUPPORT_INDEXDB_O))},vc=[],Cc=function(){return l(void 0,void 0,void 0,(function(){var e,t;return d(this,(function(n){switch(n.label){case 0:return gc?(Ic&&(clearTimeout(Ic),Ic=null),[4,gc]):[2];case 1:return(e=n.sent())&&(t=e.db,vc.push(t)),gc=null,[2]}}))}))},yc=[],Sc=!1,mc=function(e){return l(void 0,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return Sc||0===yc.length?[2]:(Sc=!0,t=yc.splice(0),[4,new Promise((function(n){var r=e.transaction(fc,"readwrite");r.oncomplete=n,r.onabort=n;var i=r.objectStore(fc);t.forEach((function(e){try{i.add(e)}catch(t){null===console||void 0===console||console.error("write log failed ->",e)}}))}))]);case 1:return n.sent(),Sc=!1,0===yc.length&&vc.length>0&&(vc.forEach((function(e){return e.close()})),vc.length=0),setTimeout((function(){return mc(e)})),[2]}}))}))};function Ac(e){return l(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,gc];case 1:return(t=n.sent())?[2,new Promise((function(n){var r=t.db.transaction(Ec,"readonly").objectStore(Ec).get(e);r.onsuccess=function(e){var t;n({value:null===(t=r.result)||void 0===t?void 0:t.value,success:!0})},r.onerror=function(e){n({success:!1})}}))]:[2,{success:!1}]}}))}))}var Nc,Oc,Mc,Uc,Lc=0,Pc=function(){return{setTimestamp4RealtimeLog:function(e){Lc=e},getTimestamp4RealtimeLog:function(){return Lc},getLogs:function(e,t,n,r){return l(this,void 0,void 0,(function(){var i;return d(this,(function(o){switch(o.label){case 0:return[4,gc];case 1:return(i=o.sent())?[2,new Promise((function(o){var s=i.db.transaction(fc,"readonly").objectStore(fc),a=[],u=IDBKeyRange.bound(e,t),c=s.index("time").openCursor(u);c.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=n&&(r?i.sessionId===dc:i.level>=0)&&a.push(i),t.continue()}else o({dbReady:!0,logs:a})},c.onerror=function(e){o({dbReady:!1,logs:[]})}}))]:[2,{dbReady:!1,logs:[]}]}}))}))}}},bc="REPORT_SESSION",Dc=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return n=bc+"_"+e,[4,Ac(bc+"_"+e)];case 1:return r=s.sent(),i=r.success,o=r.value,i?(t===(null==o?void 0:o.sessionId)||function(e,t){l(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return[4,gc];case 1:return(n=i.sent())?(r=n.db,r.transaction(Ec,"readwrite").objectStore(Ec).put({key:e,value:t}),[2,!0]):[2,!1]}}))}))}(n,{sessionId:t}),[2]):[2]}}))}))},wc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.flush=function(e){!function(e){l(void 0,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,gc];case 1:return(t=n.sent())?(yc.push(e),mc(t.db),[2]):[2]}}))}))}(e)},t}(_c),Vc=function(){function e(e,t,n,r,i){this.appkey=e,this.deviceId=t,this.deviceInfo=n,this.logDB=r,this.logger=i,this.userId="",this.timer=null,this.started=!1,this.reportFailedNumber=0,this.itvByNavi=6,this.timesByNavi=5}return e.prototype.checkStart=function(e){return l(this,void 0,void 0,(function(){var t,n,r;return d(this,(function(i){return this.started?[2]:(this.userId=e.userId,e.logSwitch?(t=Ei.getLogUrlPolicyList(e,this.logger),n=t.policy,r=t.addrs,this.started=!0,this.itvByNavi=n.itv,this.timesByNavi=n.times,r.length>0&&this.realtimeReport(r[0].addr,n.level,n.itv),[2]):[2])}))}))},e.prototype._sendLogs2Realtime=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,h,p,_,g;return d(this,(function(d){switch(d.label){case 0:return this.logger.debug(Re.L_REALTIME_LOG_O,JSON.stringify({count:e.length}),t),i=r,[4,this.compressLogs(e)];case 1:return a=d.sent(),u=a.success,c=a.data,u||this.logger.warn(Re.L_REALTIME_LOG_O,"compress failed",t),this.logger.debug(Re.L_REALTIME_LOG_O,"compress done",t),l=$t(n)?n:"https://"+n,l+="?version=5.12.1&appkey="+this.appkey+"&userId="+encodeURIComponent(this.userId)+"&deviceId="+this.deviceId+"&deviceInfo="+this.deviceInfo+"&platform=Web",[4,this.send({url:l,body:c,method:"POST"})];case 2:if(h=d.sent(),p=h.status,_=h.data,this.logger.debug(Re.L_REALTIME_LOG_R,JSON.stringify({status:p,data:_}),t),200===p){if(this.reportFailedNumber=0,_)try{(g=JSON.parse(_)).nextTime&&(i=g.nextTime),o=g.level,s=g.logSwitch}catch(e){this.logger.warn(Re.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}this.logDB.setTimestamp4RealtimeLog(e[e.length-1].time+1)}else this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(i+=i),this.reportFailedNumber++;return[2,{itv:i,level:o,logSwitch:s}]}}))}))},e.prototype.realtimeReport=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a,u,c,l,h,p,_,g=this;return d(this,(function(d){switch(d.label){case 0:return r=Date.now(),i=this.logDB.getTimestamp4RealtimeLog()||hc,o=Math.max(r-5e3,i),s=this.logger.createTraceId(),this.logger.debug(Re.L_REALTIME_LOG_T,JSON.stringify({startTime:i,endTime:o,level:t,itv:n}),s),[4,this.logDB.getLogs(i,o,t,!0)];case 1:return a=d.sent(),u=a.dbReady,c=a.logs,u?[3,2]:(this.logger.warn(Re.L_REALTIME_LOG_R,"db error",s),[3,4]);case 2:return c.length>0?[4,this._sendLogs2Realtime(c,s,e,n)]:[3,4];case 3:if(l=d.sent(),h=l.itv,p=l.level,_=l.logSwitch,n=h,void 0!==p&&(t=p),0===_)return[2];d.label=4;case 4:return this.started&&(this.timer&&clearTimeout(this.timer),n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return g.realtimeReport(e,t,n)}),1e3*n)),[2]}}))}))},e.prototype.report=function(e,t,n,r,i,o,s){return void 0===s&&(s=!1),l(this,void 0,void 0,(function(){var a,u,c,l,h,p,_,g,f,E;return d(this,(function(d){switch(d.label){case 0:return"web"!==n.toLowerCase()?[2]:(a=this.logger.createTraceId(),this.logger.info(Re.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:o,isCloudControl:s}),a),[4,this.logDB.getLogs(e,t,sc.DEBUG,!1)]);case 1:return u=d.sent(),c=u.dbReady,l=u.logs,this.logger.info(Re.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),a),h=$t(r)?r:"https://"+r,h+="?version=5.12.1&appkey="+this.appkey+"&userId="+encodeURIComponent(this.userId)+"&deviceId="+this.deviceId+"&deviceInfo="+this.deviceInfo+"&platform=Web&logId="+i,c?l.length>0?[4,this.compressLogs(l)]:[3,3]:[3,5];case 2:return _=d.sent(),g=_.success,f=_.data,p=g?f:"compress failed",[3,4];case 3:p="no data",d.label=4;case 4:return[3,6];case 5:p="no database",d.label=6;case 6:return this.logger.debug(Re.L_REPORT_FULL_LOG_O,"compress done",a),s&&(h+="&source=cloud"),[4,this.send({url:h,body:p,method:"POST"})];case 7:return E=d.sent().status,this.logger.info(Re.L_REPORT_FULL_LOG_R,JSON.stringify({status:E}),a),[2]}}))}))},e.prototype.stop=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1},e}(),Gc=48,Bc=64,Fc=80,kc=96,xc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Hc=function(e){for(var t={},n=0;n<e.length-1;n++){var r=e.charAt(n)+e.charAt(n+1);t.hasOwnProperty(r)?t[r].push(n):t[r]=[n]}for(var i=[],o=[],s=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=qc(e.length),n=String.fromCharCode(Fc|t.length);i.push(n+t)}else{var r=String.fromCharCode(kc|e.length);i.push(r)}i.push(e)}},a=0;a<e.length;){var u=Yc(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 c=qc(a-u.offset),l=qc(u.length);if(c.length+l.length>=u.length)o.push(e.substr(a,u.length)),a+=u.length;else{s();var d=String.fromCharCode(Bc|c.length<<2|l.length);i.push(d+c+l),a+=u.length}}}s();var h=qc(e.length),p=String.fromCharCode(Gc|h.length);return i.push(p+h),i.join("")},Yc=function(e,t,n){var r={length:0,offset:-1};if(t.length,n>=t.length-1)return r;var i=e[t.charAt(n)+t.charAt(n+1)];if(i[0]===n)return r;for(var o=t.length-n,s=0,a=i.length;s<a;s++){var u=i[s],c=n-u;if(!(c>238327)){var l=Math.min(o,c);if(l<=r.length)break;if(!(r.length>2&&t.charAt(u+r.length-1)!==t.charAt(n+r.length-1))){for(var d=2,h=d;h<l&&t.charAt(u+h)===t.charAt(n+h);h++)d++;d>=r.length&&(r.length=d,r.offset=u)}}}return r},qc=function(e){var t=[],n=0;do{n=e%62,t.push(xc.charAt(n)),e=(e-n)/62}while(e>0);return t.join("")},Kc=function(e){if("browser"!==e.tag)return{type:e.tag,version:"UnKonw"};var t,n,r=navigator.userAgent,i={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 o in i)if(i.hasOwnProperty(o)){var s=r.match(i[o]);if(s){n=o,t=s[1]||s[2];break}}return{type:n||"UnKonw",version:t||"UnKonw"}},jc=function(e){var t=e.sessionId,n=e.level,r=e.loggerId,i=e.traceId,o=e.time,s=e.tag,a=e.type,u=e.content,c=n<0?u||"":JSON.stringify({content:u,traceId:i,from:r});return t+","+o+","+a+","+n+","+s+","+(c='"'+c.replace(/"/g,'""')+'"')+"\n"},Qc=function(e){function t(t,n,r,i){var o=this,s=In(n),a=Kc(n),u=a.type+"|"+a.version+"|"+r.getSessionId();return(o=e.call(this,t,s,u,Pc(),r)||this).runtime=n,o.clientReportLevel=i,lc(o.clientReportLevel)||(o.clientReportLevel=void 0),o}return a(t,e),t.prototype.send=function(e){return this.runtime.httpReq(e)},t.prototype.checkStart=function(t){return l(this,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,Dc(t.userId,this.logger.getSessionId())];case 1:return n.sent(),[2,e.prototype.checkStart.call(this,t)]}}))}))},t.prototype.compressLogs=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,{success:!0,data:Hc(e.map(jc).join(""))}]}))}))},t.prototype.isReporter=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,(t=this.userId,n=this.logger.getSessionId(),l(void 0,void 0,void 0,(function(){var e,r,i;return d(this,(function(o){switch(o.label){case 0:return[4,Ac(bc+"_"+t)];case 1:return e=o.sent(),r=e.success,i=e.value,[2,r&&(null==i?void 0:i.sessionId)===n]}}))})))];case 1:return[2,e.sent()]}var t,n}))}))},t.prototype.report=function(t,n,r,i,o,s,a){return void 0===a&&(a=!1),l(this,void 0,void 0,(function(){var u;return d(this,(function(c){switch(c.label){case 0:return[4,this.isReporter()];case 1:return u=c.sent(),this.userId&&!u?[2]:[2,e.prototype.report.call(this,t,n,r,i,o,s,a)]}}))}))},t.prototype.realtimeReport=function(t,n,r){return l(this,void 0,void 0,(function(){return d(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,n,r)]}))}))},t}(Vc);!function(e){e[e.ACCEPTED=0]="ACCEPTED",e[e.UNACCEPTABLE_PROTOCOL_VERSION=1]="UNACCEPTABLE_PROTOCOL_VERSION",e[e.IDENTIFIER_REJECTED=2]="IDENTIFIER_REJECTED",e[e.SERVER_UNAVAILABLE=3]="SERVER_UNAVAILABLE",e[e.TOKEN_INCORRECT=4]="TOKEN_INCORRECT",e[e.NOT_AUTHORIZED=5]="NOT_AUTHORIZED",e[e.REDIRECT=6]="REDIRECT",e[e.PACKAGE_ERROR=7]="PACKAGE_ERROR",e[e.APP_BLOCK_OR_DELETE=8]="APP_BLOCK_OR_DELETE",e[e.BLOCK=9]="BLOCK",e[e.TOKEN_EXPIRE=10]="TOKEN_EXPIRE",e[e.DEVICE_ERROR=11]="DEVICE_ERROR",e[e.HOSTNAME_ERROR=12]="HOSTNAME_ERROR",e[e.HASOHTERSAMECLIENTONLINE=13]="HASOHTERSAMECLIENTONLINE",e[e.OUT_OF_LIMIT=14]="OUT_OF_LIMIT",e[e.IN_OTHER_CLUSTER=15]="IN_OTHER_CLUSTER",e[e.APP_AUTH_NOT_PASS=16]="APP_AUTH_NOT_PASS",e[e.OTP_USED=17]="OTP_USED",e[e.PLATFORM_ERROR=18]="PLATFORM_ERROR",e[e.ACCOUNT_CANCELLATION=19]="ACCOUNT_CANCELLATION",e[e.LICENSE_EXPIRED=20]="LICENSE_EXPIRED"}(Nc||(Nc={})),function(e){e[e.OTHER_DEVICE_LOGIN=1]="OTHER_DEVICE_LOGIN",e[e.BLOCK=2]="BLOCK",e[e.BLOCK_NEW=5]="BLOCK_NEW",e[e.REDIRECT_NEW=6]="REDIRECT_NEW",e[e.TOKEN_EXPIRED=7]="TOKEN_EXPIRED",e[e.ILLEGAL_PROTOCOL_VERSION=8]="ILLEGAL_PROTOCOL_VERSION",e[e.ACCOUNT_CANCELLATION=9]="ACCOUNT_CANCELLATION"}(Oc||(Oc={}));var Wc,Jc=((Mc={})[Oc.OTHER_DEVICE_LOGIN]=re.RC_DISCONN_KICK,Mc[Oc.BLOCK]=re.RC_DISCONN_EXCEPTION,Mc[Oc.BLOCK_NEW]=re.RC_DISCONN_EXCEPTION,Mc[Oc.REDIRECT_NEW]=re.RC_CONN_REDIRECTED,Mc[Oc.TOKEN_EXPIRED]=re.RC_CONN_TOKEN_EXPIRED,Mc[Oc.ILLEGAL_PROTOCOL_VERSION]=re.RC_CONN_PROTO_VERSION_ERROR,Mc[Oc.ACCOUNT_CANCELLATION]=re.RC_ACCOUNT_CANCELLATION,Mc),Xc=((Uc={})[Nc.ACCEPTED]=re.SUCCESS,Uc[Nc.UNACCEPTABLE_PROTOCOL_VERSION]=re.RC_CONN_PROTO_VERSION_ERROR,Uc[Nc.IDENTIFIER_REJECTED]=re.RC_CONN_IDENTIFIER_REJECTED,Uc[Nc.SERVER_UNAVAILABLE]=re.RC_CONN_SERVER_UNAVAILABLE,Uc[Nc.TOKEN_INCORRECT]=re.RC_CONN_TOKEN_INCORRECT,Uc[Nc.NOT_AUTHORIZED]=re.RC_CONN_NOT_AUTHRORIZED,Uc[Nc.REDIRECT]=re.RC_CONN_REDIRECTED,Uc[Nc.PACKAGE_ERROR]=re.RC_CONN_PACKAGE_NAME_INVALID,Uc[Nc.APP_BLOCK_OR_DELETE]=re.RC_CONN_APP_BLOCKED_OR_DELETED,Uc[Nc.BLOCK]=re.RC_CONN_USER_BLOCKED,Uc[Nc.TOKEN_EXPIRE]=re.RC_CONN_TOKEN_EXPIRED,Uc[Nc.DEVICE_ERROR]=re.RC_CONN_DEVICE_ERROR,Uc[Nc.HOSTNAME_ERROR]=re.RC_CONN_HOSTNAME_ERROR,Uc[Nc.HASOHTERSAMECLIENTONLINE]=re.RC_DISCONN_SAME_CLIENT_ON_LINE,Uc[Nc.OUT_OF_LIMIT]=re.RC_LISCENSE_COUNT_OUT_OF_LIMIT,Uc[Nc.IN_OTHER_CLUSTER]=re.RC_CONN_WRONG_CLUSTER,Uc[Nc.APP_AUTH_NOT_PASS]=re.RC_APP_AUTH_NOT_PASS,Uc[Nc.OTP_USED]=re.RC_OTP_USED,Uc[Nc.PLATFORM_ERROR]=re.RC_PLATFORM_ERROR,Uc[Nc.ACCOUNT_CANCELLATION]=re.RC_ACCOUNT_CANCELLATION,Uc[Nc.LICENSE_EXPIRED]=re.RC_LICENSE_EXPIRED,Uc),Zc=function(e){return e===re.RC_CONN_REDIRECTED},zc=function(e){return Object.keys(Jc).some((function(t){return Jc[t]===e}))},$c=function(e){return Object.keys(Xc).some((function(t){return Xc[t]===e}))};!function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(Wc||(Wc={}));var el,tl,nl=function(){function e(e,t,n,r,i){this.appkey=e,this.navi=t,this.logger=n,this.statisticLog=r,this.listener=i,this.token="",this.curCmpUrl="",this.reconnectKick=!1,this._connectDurSwitch=!1,this.retryCount=0,this.uuid="",this.reason=0,this.connectedTime=0,this._network={status:!0,type:sr.UNKONWN},this._checkAliveTimer=null,this._crtConnectionStatus=Wc.DISCONNECTED,this._crtUserId="",this._openCallPlus=!1,this._crtConnectionTask=null,this.reconnectTimer=null,this._failedCount=0,this.ALLOW_FAILED_TIMES=2}return e.prototype.getToken=function(){return this.token},e.prototype.getCurrentUserId=function(){return this._crtUserId},e.prototype.setConnectionStatus=function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus=e,this._connectDurSwitch&&e!==Wc.CONNECTED&&e!==Wc.CONNECTING){var n={bid:tr(),cod:t,net:this.getNetwork().type,dur:Date.now()-this.connectedTime,cid:this.uuid+"_"+this.retryCount};this.statisticLog.record(ve.IM_CONNECTION_DURATION,JSON.stringify(n)),this._connectDurSwitch=!1}switch(e){case Wc.CONNECTED:this.logger.info(Re.L_CONNECT_S,e),this.checkAlive(),this.listener.onConnected();break;case Wc.CONNECTING:this.logger.warn(Re.L_CONNECT_S,"status: "+e+", code: "+t),this.listener.onConnecting();break;case Wc.SUSPENDED:this.logger.warn(Re.L_CONNECT_S,"status: "+e+", code: "+t),Zc(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),this.listener.onSuspend(t);break;default:this.logger.warn(Re.L_CONNECT_S,"status: "+e+", code: "+t),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),this.listener.onDisconnected(t)}}},e.prototype.getConnectionStatus=function(){return this._crtConnectionStatus},e.prototype.setNetwork=function(e,t){if(!t){var n={cid:this.uuid+"_"+this.retryCount,cn:e.type,on:this._network.type};this.statisticLog.record(ve.IM_NETWORK_CHANGE,JSON.stringify(n))}this._network=e},e.prototype.getNetwork=function(){return this._network},e.prototype.connect=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return this._crtConnectionStatus===Wc.CONNECTED?[2,{code:re.SUCCESS,data:this._crtUserId}]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=n,this.retryCount=0,this.uuid=fn(),this.token=e,this.reconnectKick=t,this.setConnectionStatus(Wc.CONNECTING),i={cid:this.uuid+"_"+this.retryCount,reason:$e.CONNECT,net:this.getNetwork().type,spr:0},this.statisticLog.record(ve.IM_STATS_CS,JSON.stringify(i),r),[4,this.try2Connect(e,t,!1,r)]);case 1:return o=u.sent(),s=o.code,a=o.data,s!==re.SUCCESS?(this.setConnectionStatus(Wc.DISCONNECTED,s),[2,{code:s}]):(this.setConnectionStatus(Wc.CONNECTED),[2,{code:s,data:a}])}}))}))},e.prototype.try2Connect=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s;return d(this,(function(a){switch(a.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,n,r),[4,this._crtConnectionTask]);case 1:return i=a.sent(),o=i.code,s=i.data,this._crtConnectionTask=null,[2,{code:o,data:s}]}}))}))},e.prototype.createConnectionTask=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,h;return d(this,(function(d){switch(d.label){case 0:return i={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this.reason},[4,this.navi.request(e,n,!1,r,i)];case 1:return o=d.sent(),s=o.code,a=o.data,s!==re.SUCCESS?[2,{code:s}]:1===(u=a).type?[2,{code:re.PACKAGE_ENVIRONMENT_ERROR}]:(this.logger.info(Re.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,this.connectWithToken(e.replace(/@.+$/,"@"),u,t,r)]);case 2:return c=d.sent(),l=c.code,h=c.data,Zc(l)?(this.logger.warn(Re.L_CONNECT_R,"redirect code: "+l,r),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,r)]):[re.RC_TCP_RESET,re.RC_CONN_ACK_TIMEOUT,re.RC_TCP_DISCONNECTED_NO_RMTP].includes(l)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),this.logger.warn(Re.L_CONNECT_R,"cmp ack timeout, code: "+l,r),this.setConnectionStatus(Wc.SUSPENDED,l),this.setConnectionStatus(Wc.CONNECTING),[2,this.createConnectionTask(e,t,!1,r)]):l!==re.SUCCESS?(this.logger.warn(Re.L_CONNECT_R,"code: "+l,r),[2,{code:l}]):(this.logger.info(Re.L_CONNECT_R,"userId: "+h,r),this._connectDurSwitch=!0,this._crtUserId=h,[2,{code:l,data:h}])}}))}))},e.prototype.setReconnectReason=function(e){switch(e){case re.TIMEOUT:return void(this.reason=$e.TIMEOUT);case re.RC_CONN_REDIRECTED:return void(this.reason=$e.REDIRECTED);default:this.reason=$e.RECONNECT}},e.prototype.try2Reconnect=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i=this;return d(this,(function(o){return n=this.logger.createTraceId(),this.logger.debug(Re.T,"try2Reconnect -> ignoreNaviCache: "+e+", reason: "+t,n),this.stopReconnectTimer(),r=function(){return l(i,void 0,void 0,(function(){var i,o;return d(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==Wc.SUSPENDED?[2]:(this.setConnectionStatus(Wc.CONNECTING,t),this.setReconnectReason(t),this.retryCount+=1,i={cid:this.uuid+"_"+this.retryCount,reason:this.reason,net:this.getNetwork().type,spr:0},this.statisticLog.record(ve.IM_STATS_CS,JSON.stringify(i)),[4,this.try2Connect(this.token,!0,e,n)]);case 1:return o=s.sent().code,this.reconnectTimer=null,o===re.SUCCESS?(this.setConnectionStatus(Wc.CONNECTED),[2]):[re.SERVER_UNAVAILABLE,re.TIMEOUT,re.RC_SOCKET_DISCONNECTED,re.RC_SOCKET_NOT_CREATED,re.RC_CONN_ACK_TIMEOUT,re.RC_TCP_RESET,re.RC_NAVI_REQ_FAILED,re.RC_NETWORK_DOWN,re.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==Wc.CONNECTING||(this.setConnectionStatus(Wc.SUSPENDED,o),this.reconnectTimer=setTimeout(r,5e3)),[2]):(this.setConnectionStatus(Wc.DISCONNECTED,o),[2])}}))}))},r(),[2]}))}))},e.prototype.onDisconnectByServer=function(e,t){var n=this;return Zc(e)?(this.setConnectionStatus(Wc.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===re.RC_UDP_DISCONNECTED?(this.setConnectionStatus(Wc.SUSPENDED,e),void setTimeout((function(){n.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(Wc.DISCONNECTED,e)},e.prototype.onDisconenctUnusual=function(e){this.setConnectionStatus(Wc.SUSPENDED,e),this.try2Reconnect(!1,e)},e.prototype.checkAlive=function(){return l(this,void 0,void 0,(function(){var e,t,n=this;return d(this,(function(r){switch(r.label){case 0:return this._crtConnectionStatus!==Wc.CONNECTED?(this._failedCount=0,this.logger.debug(Re.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.info(Re.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=r.sent())===re.SUCCESS?(this.logger.info(Re.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return n.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==Wc.CONNECTED?[2]:(this._failedCount+=1,this.logger.info(Re.L_CHECK_ALIVE_IM_R,"code: "+t+", count: "+this._failedCount,e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(Re.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),this.close(!0,!1),this.setConnectionStatus(Wc.SUSPENDED,re.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,re.RC_PING_EXCEED_LIMIT),[2]))}}))}))},e.prototype.disconnect=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.setConnectionStatus(Wc.DISCONNECTED,re.ACTIVE_DISCONNECT),this.close(!1,e),[2]}}))}))},e.prototype.stopReconnectTimer=function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},e.prototype._getProtocol=function(e,t,n){return t?1===n?Be.TLS:Be.RMTP:"http"===e?Be.WS:Be.WSS},e.prototype.getCmpList=function(e,t){var n=this;if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return h([],this.cmpWeightCache,!0);var r=e.server,i=e.backupServer,o=e.serverAddr,s=e.protocol,a=e.openTLS;if(o){var u=o.filter((function(e){return e.addr}));return this.cmpWeightCache=h([],u,!0),h([],u,!0)}var c=[],l=[];return r&&l.push(r),null==i||i.split(",").forEach((function(e){l.indexOf(e)<0&&l.push(e)})),l.forEach((function(e,i){e&&c.push({addr:e,protocol:n._getProtocol(s,t,a),weight:r.length-i,race:!1})})),this.cmpWeightCache=c,h([],c,!0)},e.prototype.updateCmpWeight=function(e,t,n){if(this.cmpWeightCache){var r=this.cmpWeightCache.find((function(t){return n?t.addr===e&&t.protocol===Be.QUIC:t.addr===e}));if(r)if(t){var i=Math.max.apply(Math,this.cmpWeightCache.map((function(e){return e.weight})));r.weight!==i&&(r.weight=i+1)}else{var o=Math.min.apply(Math,this.cmpWeightCache.map((function(e){return e.weight})));r.weight!==o&&(r.weight=o-1)}}},e.prototype.clearCmpWeightCache=function(){this.cmpWeightCache=void 0},e}(),rl={1:"ChannelsUserInfos",2:"ChannelsInviteStatusInfos",3:"ChannelsJoinedInfos",11:"FriendUserInfos",12:"FriendInviteInfos"},il=((el={})[Rt.GROUP_OPERATION]=function(e){return"ChannelEventData"},el[Rt.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},el[Rt.GROUP_APPLICATION_INVITATION]=function(e){return"ChannelApplyInfo"},el[Mt.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},el),ol=function(){function e(t){this.logger=t,this._codec=e.createPBCodec()}return e.createPBCodec=function(){var e=ri(ac);return e.getModule=function(t){var n=new e[t];return n.getArrayData=function(){var e=n.toArrayBuffer();return e=jt(e)?[].slice.call(new Int8Array(e)):e},n},e},e.prototype.decodeByPBName=function(e,t,n){var r,i=this,o=e,s=((r={})[ls]=i._formatSyncMessages,r[cs]=i._formatReceivedMessage,r[as]=i._formatSentMessage,r[Es]=i._formatHistoryMessages,r[Ts]=i._formatConversationList,r[Ds]=i._formatChatRoomInfos,r[Ks]=i._formatChatRoomKVList,r[$s]=i._formatUserSetting,r[na]=i._formatConversationStatus,r[fa]=i._formatGrpReadReceiptQryResp,r[Qa]=i._formatQueryReceiptResp,r[Zs]=i._formatSetUserSettingOutput,r[ea]=i._formatUserSettingNotification,r[La]=i._formatEventChangeList,r[Ma]=i._formatUltraMsgChangeList,r[Va]=i._formatUltraOperateStatusNotifyList,r[Da]=i._formatUltraMsgList,r[ha]=i._formatUltraGroupUnreadMentionedList,r[Ps]=i._formatChrmKVVersion,r[qa]=i._formatCallKVInfo,r[Ha]=i._fromatCallInfoDownStream,r[Us]=i._formateSessionMsgReadInput,r[Au]=i._formateChannelsListResult,r)[t];try{o=e.length>0&&i._codec[t].decode(e),Jt(o)&&(o=function(e){for(var t in e)Jt(e[t])&&(e[t]=Mn(e[t]));return e}(o)),Xt(s)&&(o=s.call(this,o,n))}catch(e){this.logger.error(Re.L_PB_DECODE_E,t)}return o},e.prototype._readBytes=function(e){var t=e.offset,n=e.buffer,r=e.limit;if(t)try{var i=jt(n)?new Uint8Array(n):n;return so.readUTF(i.subarray(t,r))}catch(e){this.logger.error(Re.O,null==e?void 0:e.stack)}return e},e.prototype._formatBytes=function(e){if(!e)return e;var t=this._readBytes(e);try{t=t?JSON.parse(t):t}catch(e){this.logger.error(Re.O,null==e?void 0:e.stack)}return t||e},e.prototype._formatSyncMessages=function(e,t){t=t||{};var n=this,r=e.list,i=e.syncTime,o=e.finished;return(Zt(o)||null===o)&&(e.finished=!0),e.syncTime=Mn(i),e.list=_r(r,(function(e){return n._formatReceivedMessage(e,t)})),e},e.prototype._getUtfContent=function(e){if(e.user){var t=e.user,n=t.portrait,r=t.portraitUri,i=n||r;i&&(e.user.portrait=e.user.portraitUri=i)}return e},e.prototype._setExpansion=function(e){var t;return e&&(t=function(e){var t={},n=JSON.parse(e);return pr(n,(function(e,n){t[n]=e.v})),t}(e)),t},e.prototype._setPushConfig=function(e,t){var n=e.pushContent,r=e.pushExt,i=e.configFlag,o={};return r&&(o=Zn(t,r.pushConfigs,r.pushId)),u(u({},o),{pushTitle:null==r?void 0:r.title,pushContent:n,pushData:"",disablePushTitle:!!i&&Boolean(4&i),forceShowDetailContent:!!i&&Boolean(8&i),templateId:null==r?void 0:r.templateId})},e.prototype._formatReceivedMessage=function(e,t){var r;if(!e)return e;var i=this,o=t||{},s=o.currentUserId,a=o.connectedTime,u=o.afterDecode,c=o.customMessageTypes,l=void 0===c?{}:c,d=e.content,h=e.fromUserId,p=e.type,_=e.groupId,g=e.status,f=e.dataTime,E=e.extraContent,I=e.extStatus,T=e.clientUniqueId,R=e.busChannel,v=e.msgId,C=e.classname,y=e.toUserIds,S=e.direction||te.RECEIVE,m=function(e){var t=n.READ;return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:t=2&e?n.RETRIEVED:t,canIncludeExpansion:!!(1024&e)}}(g),A=m.isPersited,N=m.isCounted,O=m.isMentioned,M=m.disableNotification,U=m.receivedStatus,L=m.canIncludeExpansion,P=!!(2&(I||0)),b=!!(4&(I||0)),D=!!(8&(I||0))?He.PRIVATE:He.PUBLIC,w=[oe.GROUP,oe.CHATROOM,oe.RTC_ROOM,oe.ULTRA_GROUP].indexOf(p)>-1?_:h,V=h,G=te.RECEIVE;S===te.SEND&&(V=s,G=te.SEND);var B=Mn(f),F=B<a,k=p===oe.CHATROOM,x=i._setExpansion(E),H=i._formatBytes(d);H=i._getUtfContent(H);var Y=i._setPushConfig(e,this.logger);k&&h===s&&(G=te.SEND);var q={conversationType:p,targetId:w,senderUserId:V,messageType:C,messageUId:v,isPersited:A,isCounted:N,isMentioned:O,sentTime:B,messageDirection:G,receivedTime:Mr.getTime(),disableNotification:M,receivedStatus:U,receivedStatusInfo:yr(U),canIncludeExpansion:L,content:H,expansion:x,pushConfig:Y,channelId:R||"",isInterrupt:P,isModifyMessage:b,messageId:Mn(T)||0,sentStatus:Me.SENT,isOffLineMessage:F,channelType:D,isStatusMessage:(null===(r=l[C])||void 0===r?void 0:r.isStatusMessage)||!1,readReceiptInfo:void 0,directedUserIds:y};return(null==u?void 0:u(q))||q},e.prototype._formatSentMessage=function(e,t){var r=this,i=e.content,o=e.classname,s=e.sessionId,a=e.msgId,c=e.extraContent,l=e.pushExt,d=e.pushContent,h=e.configFlag,p=e.extStatus,_=e.clientUniqueId,g=e.systemId,f=e.toUserIds,E=t.signal,I=t.currentUserId,T=E.date,R=E.topic,v=E.targetId,C=!!(2&(p||0)),y=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}}(s),S=y.isPersited,m=y.isCounted,A=y.disableNotification,N=y.canIncludeExpansion,O=y.isMentioned,M=Xi[R]||oe.PRIVATE,U=Er(mi,R),L=r._formatBytes(i),P=g||v;o===ce.RECALL&&(M=L.conversationType||M,P=L.targetId||v);var b=r._setExpansion(c),D=r._setPushConfig(e,this.logger),w=u(u({},D),{pushTitle:null==l?void 0:l.title,pushContent:d,pushData:d,disablePushTitle:!!h&&Boolean(4&h),forceShowDetailContent:!!h&&Boolean(8&h),templateId:null==l?void 0:l.templateId});return{conversationType:M,targetId:P,messageType:o,messageUId:a,isPersited:S,isCounted:m,isStatusMessage:U,senderUserId:I,content:r._formatBytes(i),sentTime:1e3*T,receivedTime:Mr.getTime(),messageDirection:te.SEND,isOffLineMessage:!1,disableNotification:A,canIncludeExpansion:N,expansion:b,pushConfig:w,channelId:e.busChannel||"",isInterrupt:C,messageId:Mn(_)||0,receivedStatus:n.UNREAD,receivedStatusInfo:yr(n.UNREAD),isMentioned:O,directedUserIds:f}},e.prototype._formatHistoryMessages=function(e,t){var n=this,r=t.conversation||{},i=e.list,o=e.hasMsg,s=r.targetId,a=Mn(e.syncTime),u=[];return pr(i,(function(e){var i=n._formatReceivedMessage(e,t);r.conversationType===oe.ULTRA_GROUP?i.targetId=e.groupId||r.targetId:i.targetId=s,u.push(i)}),{isReverse:!0}),{syncTime:a,list:u,hasMore:!!o}},e.prototype._formatUltraMsgChangeList=function(e){var t=e.list,n=e.syncTime,r=e.hasNext;return{syncTime:n,list:t&&t.map((function(e){var t=e.targetId,n=e.type,r=e.time,i=e.changeType,o=e.msgUID,s=e.msgTime,a=e.busChannel,u=e.isAdmin,c=e.isDel,l=e.operatorId,d=e.subChangeType,h=e.userGroupIds,p=e.busChannelType,_=e.remindType;return{targetId:t,conversationType:n,changeType:i,messageUId:o,changeTime:Mn(r),sendTime:Mn(s),channelId:a||"",isAdmin:u,isDel:c,operatorId:l,subChangeType:d,userGroupIds:h,busChannelType:p,mentionedType:_}})),hasNext:r}},e.prototype._formatEventChangeList=function(e){var t=this,n=e.list,r=e.syncTime,i=e.hasNext;return{syncTime:r,list:n&&n.map((function(e){var n,r=e.businessId,i=e.type,o=e.time,s=e.changeType,a=e.originalId,u=e.originalTime,c=e.secondaryId,l=e.isAdmin,d=e.additionalMark,h=e.operatorId,p=e.subChangeType,_=e.secondaryType,g=e.remindType,f=e.isRemindMe,E=e.extIds,I=e.eventData;return I&&(n=t._formatEventData(I,s,p)),{businessId:r,conversationType:i,changeType:s,originalId:a,time:Mn(o),originalTime:Mn(u),secondaryId:c||"",isAdmin:l,additionalMark:d,operatorId:h,subChangeType:p,userGroupIds:E,secondaryType:_,remindType:g,isRemindMe:f,eventData:n}})),hasNext:i}},e.prototype._formatEventData=function(t,n,r){var i={};t&&il[n]&&il[n](r)&&(i=e.createPBCodec()[il[n](r)].decode(t)||{});return i},e.prototype._formatUltraOperateStatusNotifyList=function(e){var t=e.type,n=e.notifyType,r=e.info,i=e.summary,o=[],s=[],a=!(2&~n),u=!(1&~n);return u&&Array.isArray(r)&&r.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.userId,i=e.opType,s=e.optime,a=Mn(s);o.push({targetId:t,channelId:n,userId:r,operationType:i,operationTime:a})})),a&&Array.isArray(i)&&i.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.count,i=e.opType;s.push({targetId:t,channelId:n,count:r,operationType:i})})),{conversationType:t,info:o,summary:s,hasInfo:u,hasSummary:a}},e.prototype._formatUltraMsgList=function(e,t){var n=this,r=e.list;return{list:r&&r.map((function(e){return n._formatReceivedMessage(e,t)}))}},e.prototype._formatUltraGroupUnreadMentionedList=function(e){var t=e.msgInfo;return(void 0===t?[]:t).map((function(e){return{messageUId:e.msgId,sentTime:Mn(e.msgTime),mentionedType:e.remindType,messageType:e.className||""}}))},e.prototype._getUltraGroupConversationInfo=function(e,t){var n=t.versionTime,r=t.unreadCount,i=t.remindCount,o=t.busChannelType,s=t.msgInfo,a=t.remindMeCount;return e.versionTime=Mn(n)||0,e.unreadMessageCount=this._getUnreadCount(Mn(r)||0),e.unreadMentionedCount=this._getUnreadCount(Mn(i)||0),e.unreadMentionedMeCount=this._getUnreadCount(Mn(a)||0),e.channelType=o||He.PUBLIC,e.lastReadTime=0,s&&(e.firstUnreadMessage={sentTime:Mn(s.msgTime)},e.lastReadTime=Mn(s.msgTime)-1),e},e.prototype._getUnreadCount=function(e){return e>999?999:e},e.prototype._formatConversationList=function(e,t){var n=this,r=this,i=e.info,o=t.afterDecode,s={list:(i=_r(i,(function(e){var i=e.msg,s=e.userId,a=e.type,u=e.unreadCount,c=e.busChannel,l=null;i&&((l=r._formatReceivedMessage(i,t)).targetId=s);var d={targetId:s,conversationType:a,unreadMessageCount:Mn(u)||0,latestMessage:l,channelId:c||""};return a===oe.ULTRA_GROUP&&(d=n._getUltraGroupConversationInfo(d,e)),(null==o?void 0:o(d))||d})))||[]};return((null==t?void 0:t.conversationType)||oe.NONE)===oe.ULTRA_GROUP&&(s.isFinished=e.isFinished),s},e.prototype._formatSetUserSettingOutput=function(e){return e},e.prototype._formatChatRoomInfos=function(e){var t=e.userTotalNums,n=e.userInfos;return{userCount:t,userInfos:_r(n,(function(e){var t=e.id,n=e.time;return{id:t,time:Mn(n)}}))}},e.prototype._formatChatRoomKVList=function(e){var t=e.entries,n=e.bFullUpdate,r=e.syncTime;return t=_r(t=t||[],(function(e){var t=e.key,n=e.value,r=e.status,i=e.timestamp,o=e.uid,s=e.version,a=function(e){return{isAutoDelete:!!(1&e),isOverwrite:!!(2&e),type:4&e?ye.DELETE:ye.UPDATE}}(r);return{key:t,value:n,isAutoDelete:a.isAutoDelete,isOverwrite:a.isOverwrite,type:a.type,userId:o,timestamp:Mn(i),version:Mn(s)}})),{kvEntries:t,isFullUpdate:n,syncTime:r}},e.prototype._formatUserSetting=function(e){var t=this,n=e.items,r=e.version,i={};return pr(n||[],(function(e){var n=e.key,r=e.version,o=e.value;e.version=Mn(r),e.value=t._readBytes(o),"Tag"===n&&e.tags.forEach((function(e){e.createdTime=Mn(e.createdTime),e.tagName=e.name})),i[n]=e})),{settings:i,version:r}},e.prototype._formatConversationStatus=function(e){var t=e.state,n=[];return pr(t,(function(e){var t=e.type,r=e.channelId,i=e.time,o=e.stateItem,s=e.busChannel,a=de.CLOSE,u=pe.NOT_SET,c=!1,l=[];pr(o,(function(e){var t=e.sessionStateType,n=e.value,r=e.tags;switch(t){case to:a=n===$i?de.OPEN:de.CLOSE,u=Number(n)||pe.NOT_SET;break;case no:c=n===$i;break;case ro:l=r}})),n.push({conversationType:t,type:t,targetId:r,notificationStatus:a,notificationLevel:u,isTop:c,updatedTime:Mn(i),tags:l,channelId:s||""})})),n},e.prototype._formatGrpReadReceiptQryResp=function(e){var t=e.totalMemberNum,n=e.list;return n.forEach((function(e){e.readTime=Mn(e.readTime)})),{totalMemberCount:t,list:n}},e.prototype._formatQueryReceiptResp=function(e){var t=e.list,n=void 0===t?[]:t,r=e.num,i=e.readCnt;return{list:n.map((function(e){return{readTime:Mn(e.receiptTime),userId:e.userId}})),totalCount:r,readCount:i}},e.prototype._formatUserSettingNotification=function(e){return e},e.prototype._formatChrmKVVersion=function(e){var t=e.joinTime,n=e.createTime,r=e.memberCount,i=e.chatroomBanState;return{joinTime:t,createTime:n||0,memberCount:r||0,isAllChatroomBanned:!!(1&i),isCurrentUserBanned:!!(2&i),isCurrentChatroomBanned:!!(4&i),isCurrentChatroomInWhitelist:!!(1&e.whiteListState)}},e.prototype._formatRTCJoinedUserInfo=function(e){return(e.info||[]).map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:Mn(e.joinTime)}}))},e.prototype._formatCallKVInfo=function(e){return e},e.prototype._fromatCallInfoDownStream=function(e){return e},e.prototype._formateSessionMsgReadInput=function(e){var t=e.busChannel,n=e.channelId,r=e.msgTime;return{conversationType:e.type,targetId:n,channelId:t||"",timestamp:r}},e.prototype._formateChannelsListResult=function(t){if(!t)return{result:{list:[]}};var n=t.listType,r=t.result,i=t.page;return r?{listType:n,result:e.createPBCodec()[rl[n]].decode(r)||[],page:i}:{listType:n,result:{list:[]},page:i}},e.prototype.encodeServerConfParams=function(){var e=this._codec.getModule(ds);return e.setNothing(1),e.getArrayData()},e.prototype._calculateFlag=function(e){var t=e.isFilerWhiteBlacklist,n=e.isVoipPush,r=e.pushConfig||{},i=0;return i|=n?1:0,i|=t?2:0,i|=r.disablePushTitle?4:0,i|=r.forceShowDetailContent?8:0},e.prototype._getPushExtraModule=function(e){var t=e.pushTitle,n=e.iOSConfig,r=e.androidConfig,i=e.templateId,o=void 0===i?"":i,s=e.harmonyOSConfig,a=this._codec.getModule(us);if(t&&a.setTitle(t),n||r||s){var u=Xn(n,r,s);a.setPushConfigs(u)}return(null==r?void 0:r.notificationId)&&a.setPushId(null==r?void 0:r.notificationId),a.setTemplateId(o),a},e.prototype._getUpMsgModule=function(e,t){var n=t.messageType,r=t.content,i=t.directionalUserIdList,o=t.canIncludeExpansion,s=t.expansion,a=t.pushConfig,u=t.channelId,c=t.pushData,l=void 0===c?"":c,d=t.pushContent,h=void 0===d?"":d,p=t.messageId,_=void 0===p?0:p,g=e.conversationType,f=e.targetId,E=this._codec.getModule(as),I=function(e){var t=e.isStatusMessage,n=e.isPersited,r=e.isCounted;t&&(n=r=!1);var i=0;return n&&(i|=1),r&&(i|=2),e.isMentioned&&(i|=4),e.disableNotification&&(i|=32),e.canIncludeExpansion&&(i|=64),i}(t),T=a||{},R=T.pushContent,v=void 0===R?h:R,C=T.pushData,y=void 0===C?l:C;E.setSessionId(I),v&&E.setPushText(v),y&&E.setAppData(y),i&&E.setToUserIds(i);var S=this._calculateFlag(t);if(E.setConfigFlag(S),E.setClassname(n),r.user&&r.user.portraitUri&&(r.user.portrait=r.user.portraitUri),E.setContent(JSON.stringify(r)),o&&s){var m={};pr(s,(function(e,t){m[t]={v:e}})),E.setExtraContent(JSON.stringify(m))}if(a){var A=this._getPushExtraModule(a);E.setPushExt(A)}return E.setClientUniqueId(_),Zt(u)||E.setBusChannel(u),g===oe.SYSTEM&&E.setSystemId(f),E},e.prototype.encodeUpMsg=function(e,t){return this._getUpMsgModule(e,t).getArrayData()},e.prototype.encodeSyncMsg=function(e){var t=e.sendboxTime,n=e.inboxTime,r=e.broadcastSyncTime,i=this._codec.getModule(ps);return i.setIspolling(!1),i.setIsPullSend(!0),i.setSendBoxSyncTime(t),i.setSyncTime(n),i.setBroadcastSyncTime(r),i.getArrayData()},e.prototype.encodeChrmSyncMsg=function(e,t){e=e||0,t=t||0;var n=this._codec.getModule(_s);return n.setCount(t),n.setSyncTime(e),n.getArrayData()},e.prototype.encodeGetHistoryMsg=function(e,t){var n=t.count,r=t.order,i=t.timestamp,o=t.channelId,s=this._codec.getModule(fs);return s.setTargetId(e),s.setTime(i),s.setCount(n),s.setOrder(r),s.setBusChannel(o||""),s.getArrayData()},e.prototype.encodeSuperSyncMsg=function(e){var t=this._codec.getModule(ma);return t.setSyncTime(e),t.getArrayData()},e.prototype.encodeOldConversationList=function(e){var t=(e=e||{}).count,n=e.type,r=e.startTime,i=e.order;t=t||0,r=r||0,i=i||0;var o=this._codec.getModule(Is);return o.setType(n),o.setCount(t),o.setStartTime(r),o.setOrder(i),o.getArrayData()},e.prototype.encodeRemoveOldConversationList=function(e){var t=(e=e||{}).conversationType,n=e.channelId,r=this._codec.getModule(As);return r.setType(t),n&&r.setBusChannel([n]),r.getArrayData()},e.prototype.encodeBatchDeleteConversation=function(e){var t=this,n=this._codec.getModule(Ss),r=[];return e.forEach((function(e){var n=e.conversationType,i=e.targetId,o=e.channelId,s=t._codec.getModule(ms);s.setConversationType(n),s.setConversationId(i),s.setBusChannel(o||""),r.push(s)})),n.setRelation(r),n.getArrayData()},e.prototype.encodeDeleteMessages=function(e,t,n,r){var i=this._codec.getModule(Ns),o=[];return pr(n,(function(e){o.push({msgId:e.messageUId,msgDataTime:e.sentTime,direct:e.messageDirection})})),i.setType(e),i.setConversationId(t),i.setMsgs(o),i.setBusChannel(r),i.getArrayData()},e.prototype.encodeClearMessages=function(e,t,n,r){var i=this._codec.getModule(Os);return t=t||(new Date).getTime(),i.setDataTime(t),i.setTargetId(e),i.setBusChannel(n),i.setConversationType(r),i.getArrayData()},e.prototype.encodeBatchClearRemoteMessages=function(e){var t=this,n=this._codec.getModule(Ms),r=e.map((function(e){var n=t._codec.getModule(Os);return n.setTargetId(e.targetId),n.setConversationType(e.conversationType),n.setBusChannel(e.channelId),n.setDataTime(e.timestamp),n}));return n.setInput(r),n.getArrayData()},e.prototype.encodeClearUnreadCount=function(e,t){var n=e.conversationType,r=e.targetId,i=e.channelId,o=t.timestamp,s=this._codec.getModule(Us);return o=o||+new Date,s.setType(n),s.setChannelId(r),s.setMsgTime(o),s.setBusChannel(i),s.getArrayData()},e.prototype.encodeExpandUltraMessage=function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,o=e.messageUId,s=e.sendTime,a=e.keys,u={mid:o,put:e.expansion,del:a,clear:e.removeAll?1:0},c=this._codec.getModule(Aa);return c.setFromUserId(t),c.setTargetId(n),c.setType(r),c.setBusChannel(i||""),c.setMsgUID(o),c.setMsgTime(s),c.setContent(JSON.stringify(u)),c.getArrayData()},e.prototype.encodemodifyMessage=function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,o=e.messageUId,s=e.sendTime,a=e.content,u=this._codec.getModule(Aa);return u.setFromUserId(t),u.setTargetId(n),u.setType(r),u.setBusChannel(i||""),u.setMsgUID(o),u.setMsgTime(s),u.setContent(JSON.stringify(a)),u.getArrayData()},e.prototype.encodeQueryMsgChange=function(e){var t=this._codec.getModule(Na);return t.setSyncTime(e),t.getArrayData()},e.prototype.encodeMsgQuery=function(e){var t=e.targetId,n=e.conversationType,r=e.messages,i=this._codec.getModule(Pa),o=r.map((function(e){return{msgTime:e.sendTime,msgUID:e.messageUId,busChannel:e.channelId}}));return i.setTargetId(t),i.setType(n),i.setQuery(o),i.getArrayData()},e.prototype.encodeUnreadMentionedMsgQuery=function(e){var t=e.targetId,n=e.channelId,r=e.sentTime,i=e.count,o=this._codec.getModule(da);return o.setGroupId(t),o.setBusChannel(n),o.setMsgTime(r),o.setSize(i),o.getArrayData()},e.prototype.encodeOperateStatus=function(e,t,n,r){var i=this._codec.getModule(wa);return i.setTargetId(e),i.setType(t),i.setBusChannel(n),i.setOpType(r),i.getArrayData()},e.prototype.encodeJoinOrQuitChatRoom=function(e){var t=this._codec.getModule(Ls);return t.setNothing(1),t.setExtra(e||""),t.getArrayData()},e.prototype.encodeGetChatRoomInfo=function(e,t){var n=this._codec.getModule(bs);return n.setCount(e),n.setOrder(t),n.getArrayData()},e.prototype.encodeSetUltraGroupDefaultNotificationLevel=function(e,t){var n=this._codec.getModule(la);return n.setUnpushLevel(e),n.setBusChannel(t),n.getArrayData()},e.prototype.encodeGetUltraGroupDefaultNotificationLevel=function(e){var t=this._codec.getModule(ca);return t.setBusChannel(e),t.getArrayData()},e.prototype.encodeGetFileToken=function(e,t,n,r,i,o,s){var a=this._codec.getModule(ws);return a.setType(e),a.setKey(t),a.setHttpMethod(n),a.setQueryString(r),a.setUrl(i),a.setExt(o),a.setSize(s),a.getArrayData()},e.prototype.encodeGetFileUrl=function(e,t,n,r,i,o){var s=this._codec.getModule(e);return s.setType(t),s.setKey(n),r&&s.setFileName(r),s.setExt(i),s.setSize(o),s.getArrayData()},e.prototype.encodeModifyChatRoomKV=function(e,t,n){var r=this._codec.getModule(Hs),i=t.key,o=t.value,s=t.notificationExtra,a=t.isSendNotification,u=t.type,c=t.timestamp,l=u||ye.UPDATE,d=Ur(t,l),h={key:i,value:o||"",uid:n,version:c};if(Zt(d)||(h.status=d),r.setEntry(h),a){var p={conversationType:oe.CHATROOM,targetId:e},_={key:i,value:o,extra:s,type:l},g=this._getUpMsgModule(p,{messageType:ce.CHRM_KV_NOTIFY,content:_,isPersited:!1,isCounted:!1});r.setNotification(g),r.setBNotify(!0),r.setType(oe.CHATROOM)}return r.getArrayData()},e.prototype.encodeModifyChatRoomKVS=function(e,t,n){var r=this._codec.getModule(Ys),i=t.entries,o=t.type||ye.UPDATE,s=Ur(t,o),a=[];return i.forEach((function(e){var t={key:e.key,value:e.value||"",uid:n,version:e.timestamp};Zt(s)||(t.status=s),a.push(t)})),r.setEntry(a),r.getArrayData()},e.prototype.encodePullChatRoomKV=function(e){var t=this._codec.getModule(Js);return t.setTimestamp(e),t.getArrayData()},e.prototype.encodePullUserSetting=function(e){var t=this._codec.getModule(zs);return t.setVersion(e),t.getArrayData()},e.prototype.encodeGetConversationStatus=function(e){var t=this._codec.getModule(ta);return t.setTime(e),t.getArrayData()},e.prototype.encodeSetConversationStatus=function(e,t){var n=this,r=this._codec.getModule(oa),i=Mr.getTime(),o=[];return pr(e,(function(e){var t=n._codec.getModule(ra),r=e.conversationType,s=e.targetId,a=e.notificationStatus,u=e.isTop,c=e.channelId,l=e.notificationLevel,d=[];t.setType(r),t.setChannelId(s),t.setTime(i),t.setBusChannel(c);var h=a===de.OPEN,p={};Zt(a)||(p[to]=h),Zt(l)||(p[to]=l),Zt(u)||(p[no]=u),pr(p,(function(e,t){if(!Zt(e)){var r=n._codec.getModule(ia);e=e?$i:eo,Zt(l)||Number(t)!==to||(e=String(l)),r.setSessionStateType(Number(t)),r.setValue(e),d.push(r)}})),t.setStateItem(d),o.push(t)})),r.setVersion(t||i),r.setState(o),r.getArrayData()},e.prototype.encodeSetConversationTypeLevel=function(e,t,n){var r=this._codec.getModule(aa);return r.setType(e),r.setVersion(t),r.setUnpushLevel(n),r.getArrayData()},e.prototype.encodeReadReceipt=function(e,t){var n=this._codec.getModule(_a);return n.setMsgId(e),t&&n.setChannelId(t),n.getArrayData()},e.prototype.encodeCreateTag=function(e,t){var n=this,r=this._codec.getModule(Ia),i=[];return e.forEach((function(e){var t=n._codec.getModule(Ta);t.setTagId(e.tagId),t.setName(e.tagName),i.push(t)})),r.setTags(i),r.setVersion(t),r.getArrayData()},e.prototype.encodeMessageReader=function(e,t){var n=this._codec.getModule(_a);return n.setMsgId(e),t&&n.setChannelId(t),n.getArrayData()},e.prototype.encodeReadReceiptMsg=function(e,t,n){var r=this._codec.getModule(Ka),i=e.conversationType,o=e.targetId,s=e.channelId,a=void 0===s?"":s;return r.setType(i),r.setTargetId(o),r.setBusChannel(a),r.setStartMsgId(t),r.setEndMsgId(n),r.getArrayData()},e.prototype.encodeReceiptQryReq=function(e,t){var n=this._codec.getModule(ja),r=e.targetId,i=e.channelId,o=void 0===i?"":i;return n.setTargetId(r),n.setBusChannel(o),n.setMsgId(t),n.getArrayData()},e.prototype.encodeReceiptCntQryReq=function(e,t){var n=this._codec.getModule(Ja),r=e.targetId,i=e.conversationType,o=e.channelId,s=void 0===o?"":o;return n.setChannelId(r),n.setBusChannel(s),n.setType(i),n.setMsgId(t),n.getArrayData()},e.prototype.encodeSessionMsgReadInput=function(e,t){var n=this._codec.getModule(Us),r=e.conversationType,i=e.targetId,o=e.channelId,s=void 0===o?"":o;return n.setType(r),n.setChannelId(i),n.setBusChannel(s),n.setMsgTime(t),n.getArrayData()},e.prototype.encodeRemoveTag=function(e,t){var n=this,r=this._codec.getModule(Ra),i=[];return e.forEach((function(e){var t=n._codec.getModule(Ta);t.setTagId(e),i.push(t)})),r.setTags(i),r.setVersion(t),r.getArrayData()},e.prototype.encodeDisConversationTag=function(e){var t=this._codec.getModule(va);return t.setTagId(e),t.getArrayData()},e.prototype.encodeUpdateConversationTag=function(e,t,n){var r=this,i=this._codec.getModule(oa),o=[];return t.forEach((function(t){var n=r._codec.getModule(ra),i=r._codec.getModule(ia),s=[];e.forEach((function(e){var t=r._codec.getModule(Ta);t.setTagId(e.tagId),Zt(e.isTop)||t.setIsTop(e.isTop),s.push(t)})),i.setSessionStateType(ro),i.setValue(JSON.stringify(s)),i.setTags(s),n.setType(t.conversationType),n.setChannelId(t.targetId),n.setTime(Date.now()),n.setStateItem([i]),o.push(n)})),i.setState(o),i.setVersion(n),i.getArrayData()},e.prototype.encodeReportSDKInfo=function(e){var t=this._codec.getModule(Ca);return t.setSdkInfo(e),t.getArrayData()},e.prototype.encodeUltraGroup=function(e,t){var n=this._codec.getModule(Sa);return n.setSyncTime(e),n.setIsEraseMsgContent(t),n.getArrayData()},e.prototype.encodebindRTCRoomForChatroom=function(e){var t=this._codec.getModule(Fa);return t.setRtcRoomId(e.rtcRoomId),t.getArrayData()},e.prototype.encodeSetCallInfo=function(e,t){var n=this._codec.getModule(xa);return n.setKey(e),n.setDataContent(t),n.getArrayData()},e.prototype.encodePullKVMsg=function(e){var t=this._codec.getModule(Ya);return t.setSyncTime(e),t.getArrayData()},e.prototype.encodeUpdateUserSubReq=function(e,t,n,r){var i=this,o=this._codec.getModule(za);o.setSubType(e),o.setOpType(n),o.setExpiry(r);var s=[];return t.forEach((function(e){var t=i._codec.getModule($a);t.setSubUserId(e),s.push(t)})),o.setSubUsers(s),o.getArrayData()},e.prototype.encodePullUserSubReq=function(e){var t=e.version,n=e.pageToken,r=this._codec.getModule(nu);return r.setVersion(t),r.setPageToken(n),r.getArrayData()},e.prototype.encodePullSubDataReq=function(e){var t=e.version,n=e.needAllData,r=e.pageToken,i=this._codec.getModule(iu);return i.setVersionTime(t),i.setNeedAllData(n),i.setPageToken(r),i.getArrayData()},e.prototype.encodeQrySubDataReq=function(e,t){var n=this,r=this._codec.getModule(uu);r.setSubType(e);var i=[];return t.forEach((function(e){var t=n._codec.getModule($a);t.setSubUserId(e),i.push(t)})),r.setSubUsers(i),r.getArrayData()},e.prototype.encodePullUserProfileReq=function(e){var t=this._codec.getModule(hu);return t.setUserId(e),t.getArrayData()},e.prototype.encodeUserProfileInput=function(){var e=this._codec.getModule(_u);return e.setNothing(1),e.getArrayData()},e.prototype.encodeUserProfilePermission=function(e){var t=this._codec.getModule(gu);return t.setPermission(e),t.getArrayData()},e.prototype.encodeSearchUserProfile=function(e){var t=this._codec.getModule(Eu);return t.setUniqueId(e),t.getArrayData()},e.prototype.encodeUserProfile=function(e){var t=this,n=this._codec.getModule(cu),r=[],i=[];return Object.keys(e).forEach((function(n){if("extraProfile"!==n){var o=e[n],s=t._codec.getModule(lu);s.setKey(n),s.setValue((null==o?void 0:o.toString())||""),r.push(s)}else if(e.extraProfile){var a=e.extraProfile;Object.keys(a).forEach((function(e){var n=a[e],r=t._codec.getModule(lu);r.setKey(e),r.setValue(n.toString()||""),i.push(r)}))}})),n.setUserProfile(r),n.setUserExtProfile(i),n.getArrayData()},e.prototype.encodeGroupInfo=function(e,t,n,r,i){var o=this;void 0===i&&(i=[]);var s=this._codec.getModule(Iu),a=[],u=[];return r&&(Object.keys(r).forEach((function(e){var t=r[e],n=o._codec.getModule(lu);n.setKey(e),n.setValue(t.toString()||""),u.push(n)})),s.setExtProfile(u)),Object.keys(n).forEach((function(e){var t,r=o._codec.getModule(lu);r.setKey(e),r.setValue(null===(t=n[e])||void 0===t?void 0:t.toString()),a.push(r)})),s.setTargetId(t),s.setType(oe.GROUP),s.setSettingProfile(a),"create"===e&&s.setUsers(i),s.getArrayData()},e.prototype.encodeMultiChannels=function(e){var t=this,n=this._codec.getModule(vu),r=[];return e.forEach((function(e){var n=t._codec.getModule(Iu);n.setTargetId(e),r.push(n)})),n.setType(oe.GROUP),n.setList(r),n.getArrayData()},e.prototype.encodeQuitGroup=function(e,t,n,r,i){void 0===n&&(n=[]),void 0===r&&(r=!0);var o=this._codec.getModule(Cu);if(o.setTargetId(t),o.setType(oe.GROUP),"dismiss"!==e&&i){var s=this.encodeQuitChannelsSetting(i,r);o.setSettingInfo(s)}return"quit"!==e&&"dismiss"!==e&&o.setUsers(n),o.getArrayData()},e.prototype.encodeQuitChannelsSetting=function(e,t){var n=this._codec.getModule(yu);return n.setIsQuit(t),n.setIsDelBan(!!(null==e?void 0:e.removeMuteStatus)),n.setIsDelWhite(!!(null==e?void 0:e.removeWhiteList)),n.setIsDelAttention(!!(null==e?void 0:e.removeFollow)),n},e.prototype.encodeModifyChannelsInput=function(e,t,n){var r=this._codec.getModule(Cu);return r.setTargetId(t),r.setType(oe.GROUP),r.setUsers(n),r.setOperateType(e),r.getArrayData()},e.prototype.encodeChannelsQueryInput=function(e){var t=e.type,n=e.groupId,r=e.option,i=e.ids,o=this._codec.getModule(Su);if(n&&o.setTargetId(n),o.setType(oe.GROUP),["getGroupMembersByRole","getGroupApplications","getJoinedGroupsByRole"].includes(t)&&r){var s=this.encodePagingQuery(r);o.setPage(s)}return["getGroupMembers","getJoinedGroups"].includes(t)&&o.setIds(null!=i?i:[]),e.roleType&&o.setRoleType(e.roleType),o.getArrayData()},e.prototype.encodePagingQuery=function(e){var t=this._codec.getModule(mu),n=e.count,r=e.order,i=e.pageToken;return t.setSize(n),t.setOrder(r?0:1),t.setPageToken(i),t},e.prototype.encodeSetGroupMemberInfo=function(e,t,n,r){var i=this._codec.getModule(Mu);return i.setTargetId(e),i.setType(oe.GROUP),i.setUserId(t),i.setChannelNickName(n),r&&i.setAdditional(r),i.getArrayData()},e.prototype.encodeJoinGroup=function(e,t,n){void 0===n&&(n=[]);var r=this._codec.getModule(bu);return r.setTargetId(t),r.setType(oe.GROUP),"invite"===e&&r.setUserIds(n),r.getArrayData()},e.prototype.encodeMemberResponseInput=function(e){var t=e.groupId,n=e.inviterId,r=e.optType,i=e.optResult,o=e.joinUserId,s=e.reason,a=this._codec.getModule(Pu);return a.setTargetId(t),a.setType(oe.GROUP),a.setOptType(r),a.setOptResult(i),a.setInviterId(n),r===Tt.MANAGER&&a.setJoinUserId(o),i||a.setDetail(null!=s?s:""),a.getArrayData()},e.prototype.encodeSetGroupRemark=function(e,t){var n=this._codec.getModule(Mu),r=ft.ADD;return n.setTargetId(e),n.setType(oe.GROUP),t||(r=ft.REMOVE),n.setOperateType(r),n.setChannelNickName(t),n.getArrayData()},e.prototype.encodeSetGroupFollows=function(e,t,n){var r=this._codec.getModule(Cu);return r.setTargetId(t),r.setType(oe.GROUP),r.setUsers(n),r.setOperateType(e),r.getArrayData()},e.prototype.encodeFriendInput=function(e){var t=this._codec.getModule(xu);return t.setTargetId(e.targetId),e.type&&t.setType(e.type),e.info&&t.setInfo(e.info),t.getArrayData()},e.prototype.encodeFriendsInput=function(e,t){var n=this._codec.getModule(qu);return n.setTargetId(e),t&&n.setType(t),n.getArrayData()},e.prototype.encodeFriendProfileInput=function(e){var t=this,n=this._codec.getModule(Qu);n.setTargetId(e.targetId),n.setRemarkName(e.remark);var r=[];return Object.keys(e.extProfile).forEach((function(n){var i=t._codec.getModule(lu);i.setKey(n),i.setValue(e.extProfile[n]),r.push(i)})),n.setExtProfile(r),n.getArrayData()},e.prototype.encodeFriendQueryInput=function(e,t,n){var r=null!=t?t:{},i=r.count,o=void 0===i?200:i,s=r.pageToken,a=void 0===s?"":s,u=r.order,c=void 0!==u&&u,l=this._codec.getModule(Wu);l.setQueryType(e),11===e&&l.setFriendType(n);var d=this._codec.getModule(mu);return d.setSize(o),d.setOrder(c?0:1),d.setPageToken(a),l.setPage(d),l.getArrayData()},e.prototype.encodeFriendsListInput=function(e,t){var n=this._codec.getModule(Zu);return n.setTargetId(e),t&&n.setType(t),n.getArrayData()},e.prototype.encodeFriendLevelSet=function(e){var t=this._codec.getModule(zu);return t.setLevel(e),t.getArrayData()},e}(),sl=function(e){function t(t,n,r,i,o,s){var a=e.call(this,t,n,r,i,s)||this;return a.runtime=o,a.wsListener=s,a._socket=null,a._connectedTime=0,a._socketIndex=0,a._localConnectedTime=0,a._idCount=0,a._generateMessageId=function(){return a._idCount>=65535&&(a._idCount=0),++a._idCount},a._messageIds={},a._syncMessageIds={},a.codec=new ol(a.logger),a}return a(t,e),t.prototype.getConnectedTime=function(){return this._connectedTime},t.prototype.getLocalConnectedTime=function(){return this._localConnectedTime},t.prototype.getCrtServerTime=function(){return Date.now()-this._localConnectedTime+this._connectedTime},t.prototype.getDelayTime=function(){return this._localConnectedTime-this._connectedTime},t.prototype.connectWithToken=function(e,t,n,r){return l(this,void 0,void 0,(function(){var n,i,o,s,a,u,c,l,h;return d(this,(function(p){switch(p.label){case 0:if(n=t.openAnti,i=t.type,o=this.getCmpList(t),this.logger.debug(Re.L_NAVI_CMP_R,JSON.stringify(o),r),0===(s=o.filter((function(e,t){return o.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(Re.L_NAVI_CONF_E,"no service available",r),[2,{code:re.SERVER_UNAVAILABLE}];a=1===n?gi.V4:gi.V3,u=function(t){var n,o,u,l,h,p,_,g,f,E,I;return d(this,(function(d){switch(d.label){case 0:return n=s[t],o=n.protocol,u=n.addr,l=n.weight,h=function(e,t,n,r,i,o,s){var a=Kc(i),u=a.type,c=a.version,l="browser"===i.tag?"|"+u+"|"+c:"||",d=s?"&protocolVer="+s:"";return e+"://"+t+"/websocket?appId="+n+"&token="+encodeURIComponent(r)+"&sdkVer="+Y+"&pid="+o+"&apiVer="+(i.isFromUniapp?"uniapp":i.tag+encodeURIComponent(l))+(i.connectPlatform?"&platform="+i.connectPlatform:"")+d}(o===Be.WS?"ws":"wss",u,c.appkey,e,c.runtime,"",a),p=Date.now(),[4,c.connectWebSocket(h,a,r)];case 1:return _=d.sent(),g=_.code,f=_.data,E=c.cmpWeightCache.findIndex((function(e){return e.addr===u})),I={bid:tr(),ptc:Je.WS,cod:g,net:c.getNetwork().type,dur:Date.now()-p,spr:0,pr:i||0,hos:u,idx:E,rct:c.retryCount?ze.RECONNECT:ze.CONNECT,cid:c.uuid+"_"+c.retryCount,v:Ze.CURRENT,rsn:c.reason,count:c.retryCount,weight:l},c.statisticLog.record(ve.IM_WEBSOCKET,JSON.stringify(I),r),g===re.RC_SOCKET_DISCONNECTED||g===re.TIMEOUT?[2,"continue"]:g!==re.SUCCESS?[2,{value:{code:g}}]:(c._localConnectedTime=Math.floor((Date.now()+p)/2),c._socket=f.socket,c.updateCmpWeight(s[t].addr,!0),c.curCmpUrl=s[t].addr,[2,{value:{code:g,data:f.userId}}])}}))},c=this,l=0,p.label=1;case 1:return l<s.length?[5,u(l)]:[3,4];case 2:if("object"==typeof(h=p.sent()))return[2,h.value];p.label=3;case 3:return l+=1,[3,1];case 4:return[2,{code:re.SERVER_UNAVAILABLE}]}}))}))},t.prototype.connectWebSocket=function(e,t,n){return l(this,void 0,void 0,(function(){var r=this;return d(this,(function(i){return this.logger.info(Re.T,"connect start: "+e,n),[2,new Promise((function(i){var o=r.runtime.createWebSocket(e);r._socketIndex=o.id;var s=setTimeout((function(){r.logger.info(Re.T,"connect timeout: "+e,n),i({code:re.TIMEOUT}),o&&o.close()}),5e3);o.onOpen((function(){clearTimeout(s),r.logger.info(Re.T,"socket open",n)})),o.onMessage((function(e){if(r._socketIndex===o.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var s,a=Ao(r.logger,e,t);if(a instanceof po){var u=a.status;if(u!==Nc.ACCEPTED)return r.logger.info(Re.T,"connect failed: "+u,n),void i({code:(s=u,Xc[s])});r.logger.info(Re.T,"connect success",n);var c=a.timestamp,l=a.userId,d=a.messageId;return r._connectedTime=c,r._idCount=d,void i({code:re.SUCCESS,data:{userId:l,socket:o}})}if(a instanceof _o){var h=a.status;return r.logger.info(Re.T,"recv disconnect signal -> status: "+h),void r.onRecvDisconnect(h,o)}r._onReceiveSignal(a)}}else r.logger.warn(Re.L_WEBSOCKET_DISACCORD_E,JSON.stringify({msg:"WebSocket id disaccord",_socketIndex:r._socketIndex,curSocketId:o.id}))})),o.onClose((function(){r.logger.info(Re.T,"socket close",n);var e=re.RC_SOCKET_DISCONNECTED;i({code:e}),r.onSocketEnd(o,e)})),o.onError((function(e){r.logger.info(Re.T,"socket error",n);var t=re.RC_SOCKET_DISCONNECTED;i({code:t}),r.onSocketEnd(o,t)}))}))]}))}))},t.prototype._qosNeedAck=function(e,t){e.header&&e.header.qos!==hi.AT_MOST_ONCE&&(e instanceof To&&!e.syncMsg&&(this.logger.debug(Re.O,"send pubAck -> "+t+" "+e.topic),this.sendOnly(new Co(t))),e instanceof mo&&(this.logger.debug(Re.O,"send queryCon -> "+t+" "+e.topic),this.sendOnly(new So(t))))},t.prototype._publishReader=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o=this;return d(this,(function(s){switch(s.label){case 0:return n=e.syncMsg,r=e.topic,this.logger.debug(Re.O,"recv PublishReader -> messageId: "+t+" "+r),r===Fr?[2]:!n||function(e){return[No.ppMsgS,No.pgMsgS,No.chatMsgS].map((function(e){return No[e]})).indexOf(e)>=0}(r)?(this.wsListener.signal(e),[2]):[4,new Promise((function(e){o._syncMessageIds[t]=e}))];case 1:return i=s.sent(),delete this._syncMessageIds[t],this.wsListener.signal(e,i),[2]}}))}))},t.prototype._onReceiveSignal=function(e){return l(this,void 0,void 0,(function(){var t,n,r;return d(this,(function(i){switch(i.label){case 0:return t=e.messageId,e instanceof fo&&this._pingResolve?(this._pingResolve(re.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e,t),t>0&&(e instanceof vo||e instanceof mo)&&(this.logger.debug(Re.O,"recv ack -> messageId: "+t+" "+e.topic),(n=this._messageIds[t])&&(n(e),delete this._messageIds[t]),(r=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],r(e))),e instanceof To?[4,this._publishReader(e,t)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))},t.prototype.onRecvDisconnect=function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return Jc[e]}(e)))},t.prototype.onSocketEnd=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))},t.prototype.clearResolves=function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(re.RC_SOCKET_DISCONNECTED)}},t.prototype.sendPing=function(e){var t=this;return new Promise((function(n){t._pingResolve=n,setTimeout((function(){return n(re.TIMEOUT)}),e),t.sendOnly(new go)}))},t.prototype.sendOnly=function(e){this._socket&&((e instanceof Ro||e instanceof yo)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getBufferData().buffer))},t.prototype.send=function(e,t,n,r){return void 0===r&&(r=3e4),l(this,void 0,void 0,(function(){var i,o,s,a,u=this;return d(this,(function(c){switch(c.label){case 0:return this._socket?(i=this._generateMessageId(),e.messageId=i,this._socket.send(e.getBufferData().buffer),[4,new Promise((function(e){u._messageIds[i]=e,setTimeout((function(){u._messageIds[i]&&delete u._messageIds[i],e()}),r)}))]):[2,{code:re.RC_NET_CHANNEL_INVALID}];case 1:return(o=c.sent())?o instanceof mo||o instanceof vo?(s=t&&o.data&&[re.SUCCESS,re.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,re.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,re.RC_USER_PROFILE_KEY_NOT_EXIST,re.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,re.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,re.RC_USER_PROFILE_VALUE_EXCEED_RANGE,re.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(o.status)>=0,a=s?this.codec.decodeByPBName(o.data,t,n):o,0!==o.status?(this.logger.warn(Re.O,"send failed -> message: "+i+", respPBName: "+t+", status: "+o.status),[2,{code:o.status,data:t&&o.data?a:null}]):[2,{code:re.SUCCESS,data:a}]):[2,{code:o}]:(this.logger.warn(Re.O,"send timeout -> message: "+i+", respPBName: "+t+", timeout: "+r),[2,{code:re.TIMEOUT}])}}))}))},t.prototype.close=function(e){this._socket&&(this._socket.close(),this._socket=null),this.clearResolves()},t}(nl);!function(e){e[e.STATISTICS=-2]="STATISTICS",e[e.RECORD=-1]="RECORD"}(tl||(tl={}));var al=null,ul="RC_CONF",cl="RC_STATISTICS",ll=null,dl=function(e){return l(void 0,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,al];case 1:return(t=n.sent())?[4,new Promise((function(n){var r=t.db.transaction(cl,"readwrite").objectStore(cl).index("time"),i=IDBKeyRange.upperBound(Date.now()-e),o=r.openCursor(i);o.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},o.onerror=function(){n()}}))]:[2];case 2:return n.sent(),ll=setTimeout((function(){return dl(e)}),6e5),[2]}}))}))},hl=function(e,t,n){void 0===n&&(n=168),al||("undefined"!=typeof window&&window&&window.indexedDB?al=new Promise((function(r){var i=window.indexedDB;Or();var o="RC_STATISTIC_"+e,s=i.open(o,2);s.onerror=function(e){t.error(Re.L_LOGDB_OPEN_FAILED_E,e.target.error),r(null)},s.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){al=null,t.warn(Re.L_LOGDB_CLOSED_S)},o.onerror=function(e){al=null,t.error(Re.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(Re.L_LOGDB_ABORT_S,e.target.error)},dl(3600*Math.max(24,Math.min(168,n))*1e3),r({appkey:e,db:o})):r(null)},s.onupgradeneeded=function(e){var t=e.target.result;t.objectStoreNames.contains(cl)&&t.deleteObjectStore(cl);var n=t.createObjectStore(cl,{autoIncrement:!0});n.createIndex("level","level",{unique:!1}),n.createIndex("time","time",{unique:!1}),t.objectStoreNames.contains(ul)&&t.deleteObjectStore(ul),(n=t.createObjectStore(ul,{keyPath:"key"})).createIndex("key","key",{unique:!0})}})):t.warn(Re.L_UNSUPPORT_INDEXDB_O))},pl=[],_l=function(){return l(void 0,void 0,void 0,(function(){var e,t;return d(this,(function(n){switch(n.label){case 0:return al?(ll&&(clearTimeout(ll),ll=null),[4,al]):[2];case 1:return(e=n.sent())&&(t=e.db,pl.push(t)),al=null,[2]}}))}))};function gl(e){return l(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,al];case 1:return(t=n.sent())?[2,new Promise((function(n){var r=t.db.transaction(ul,"readonly").objectStore(ul).get(e);r.onsuccess=function(e){var t;n({value:null===(t=r.result)||void 0===t?void 0:t.value,success:!0})},r.onerror=function(e){n({success:!1})}}))]:[2,{success:!1}]}}))}))}var fl,El="REPORT_SESSION",Il=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return n=El+"_"+e,[4,gl(El+"_"+e)];case 1:return r=s.sent(),i=r.success,o=r.value,i?(t===(null==o?void 0:o.sessionId)||function(e,t){l(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return[4,al];case 1:return(n=i.sent())?(r=n.db,r.transaction(ul,"readwrite").objectStore(ul).put({key:e,value:t}),[2,!0]):[2,!1]}}))}))}(n,{sessionId:t}),[2]):[2]}}))}))},Tl=function(){return al},Rl=function(e){var t=e.sessionId,n=e.level,r=e.loggerId,i=e.traceId,o=e.time,s=e.tag,a=e.type,u=e.content,c=n<0?u||"":JSON.stringify({content:u,traceId:i,from:r});return t+","+o+","+a+","+n+","+s+","+(c='"'+c.replace(/"/g,'""')+'"')+"\n"},vl=En(),Cl=Date.now(),yl=0,Sl=function(){function e(e,t,n){this._appkey=e,this._id=t,this._type=n,this.record=this._writer.bind(this,tl.STATISTICS)}return e.prototype._writer=function(e,t,n,r){var i=new Date;/^[\w-]+$/.test(t)&&this.flush({time:+i,sessionId:vl,type:this._type,loggerId:this._id,tag:t,level:e,content:n,traceId:r})},e.prototype.createTraceId=function(){return vl+"-"+ ++yl},e.prototype.getSessionId=function(){return vl},e}(),ml=function(){function e(e,t,n,r,i,o){void 0===o&&(o=i),this.appkey=e,this.deviceId=t,this.deviceInfo=n,this.statisticDB=r,this.logger=i,this.reportClass=o,this.userId="",this.timer=null,this.started=!1,this.reportFailedNumber=0,this.itvByNavi=6,this.timesByNavi=5}return e.prototype.checkStart=function(e){return l(this,void 0,void 0,(function(){var t,n,r;return d(this,(function(i){return this.started?[2]:(this.userId=e.userId,e.logSwitch?(t=Ei.getLogUrlPolicyList(e,this.logger),n=t.policy,r=t.addrs,this.started=!0,this.itvByNavi=n.itv,this.timesByNavi=n.times,r.length>0&&this.realtimeReport(r[0].addr,n.level,n.itv),[2]):[2])}))}))},e.prototype._sendLogs2Realtime=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,h,p,_,g;return d(this,(function(d){switch(d.label){case 0:return this.logger.debug(Re.L_STATISTIC_LOG_O,JSON.stringify({count:e.length}),t),i=r,[4,this.compressStatistics(e)];case 1:return a=d.sent(),u=a.success,c=a.data,u||this.logger.warn(Re.L_STATISTIC_LOG_O,"compress failed",t),this.logger.debug(Re.L_STATISTIC_LOG_O,"compress done",t),l=$t(n)?n:"https://"+n,l+="?version=5.12.1&appkey="+this.appkey+"&userId="+encodeURIComponent(this.userId)+"&deviceId="+this.deviceId+"&deviceInfo="+this.deviceInfo+"&platform=Web",[4,this.send({url:l,body:c,method:"POST"})];case 2:if(h=d.sent(),p=h.status,_=h.data,this.logger.debug(Re.L_STATISTIC_LOG_R,JSON.stringify({status:p,data:_}),t),200===p){if(this.reportFailedNumber=0,_)try{(g=JSON.parse(_)).nextTime&&(i=g.nextTime),o=g.level,s=g.logSwitch}catch(e){this.logger.warn(Re.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}this.statisticDB.setTimestamp4RealtimeLog(e[e.length-1].time+1)}else this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(i+=i),this.reportFailedNumber++;return[2,{itv:i,level:o,logSwitch:s}]}}))}))},e.prototype.realtimeReport=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a,u,c,l,h,p,_,g=this;return d(this,(function(d){switch(d.label){case 0:return r=Date.now(),i=this.statisticDB.getTimestamp4RealtimeLog()||Cl,o=Math.max(r-5e3,i),s=this.reportClass.createTraceId(),this.logger.debug(Re.L_STATISTIC_LOG_T,JSON.stringify({startTime:i,endTime:o,level:t}),s),[4,this.statisticDB.getStatistics(i,o,t,!0)];case 1:return a=d.sent(),u=a.dbReady,c=a.logs,u?[3,2]:(this.logger.warn(Re.L_STATISTIC_LOG_R,"db error",s),[3,4]);case 2:return c.length>0?[4,this._sendLogs2Realtime(c,s,e,n)]:[3,4];case 3:if(l=d.sent(),h=l.itv,p=l.level,_=l.logSwitch,n=h,void 0!==p&&(t=p),0===_)return[2];d.label=4;case 4:return this.started&&(this.timer&&clearTimeout(this.timer),n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return g.realtimeReport(e,t,n)}),1e3*n)),[2]}}))}))},e.prototype.report=function(e,t,n,r,i,o){return l(this,void 0,void 0,(function(){var s,a,u,c,l,h,p,_,g,f;return d(this,(function(d){switch(d.label){case 0:return"web"!==n.toLowerCase()?[2]:(s=this.reportClass.createTraceId(),this.logger.info(Re.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:o}),s),[4,this.statisticDB.getStatistics(e,t,tl.STATISTICS,!1)]);case 1:return a=d.sent(),u=a.dbReady,c=a.logs,this.logger.info(Re.L_REPORT_FULL_LOG_O,JSON.stringify({count:c.length}),s),l=$t(r)?r:"https://"+r,l+="?version=5.12.1&appkey="+this.appkey+"&userId="+encodeURIComponent(this.userId)+"&deviceId="+this.deviceId+"&deviceInfo="+this.deviceInfo+"&platform=Web&logId="+i,u?c.length>0?[4,this.compressStatistics(c)]:[3,3]:[3,5];case 2:return p=d.sent(),_=p.success,g=p.data,h=_?g:"compress failed",[3,4];case 3:h="no data",d.label=4;case 4:return[3,6];case 5:h="no database",d.label=6;case 6:return this.logger.debug(Re.L_REPORT_FULL_LOG_O,"compress done",s),[4,this.send({url:l,body:h,method:"POST"})];case 7:return f=d.sent().status,this.logger.info(Re.L_REPORT_FULL_LOG_R,JSON.stringify({status:f}),s),[2]}}))}))},e.prototype.stop=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1},e}(),Al="RC_STATISTICS",Nl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.flush=function(e){Ll(e)},t}(Sl),Ol=!1,Ml=[],Ul=function(e){return l(void 0,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return Ol||0===Ml.length?[2]:(Ol=!0,t=Ml.splice(0),[4,new Promise((function(n){var r=e.transaction(Al,"readwrite");r.oncomplete=n,r.onabort=n;var i=r.objectStore(Al);t.forEach((function(e){try{i.add(e)}catch(t){null===console||void 0===console||console.error("write log failed ->",e)}}))}))]);case 1:return n.sent(),Ol=!1,0===Ml.length&&pl.length>0&&(pl.forEach((function(e){return e.close()})),pl.length=0),setTimeout((function(){return Ul(e)})),[2]}}))}))},Ll=function(e){return l(void 0,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,Tl()];case 1:return(t=n.sent())?(Ml.push(e),Ul(t.db),[2]):[2]}}))}))},Pl=0,bl=function(e){function t(t,n,r,i){var o=this,s=In(n),a=Kc(n),u=a.type+"|"+a.version+"|"+i.getSessionId();return o=e.call(this,t,s,u,{setTimestamp4RealtimeLog:function(e){Pl=e},getTimestamp4RealtimeLog:function(){return Pl},getStatistics:function(e,t){return l(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return[4,Tl()];case 1:return(n=r.sent())?[2,new Promise((function(r){var i=n.db.transaction(Al,"readonly").objectStore(Al),o=[],s=IDBKeyRange.bound(e,t),a=i.index("time").openCursor(s);a.onsuccess=function(e){var t=e.target.result;if(t){var n=t.value;o.push(n),t.continue()}else r({dbReady:!0,logs:o})},a.onerror=function(e){r({dbReady:!1,logs:[]})}}))]:[2,{dbReady:!1,logs:[]}]}}))}))}},r,i)||this,o.runtime=n,o}return a(t,e),t.prototype.send=function(e){return this.runtime.httpReq(e)},t.prototype.checkStart=function(t){return l(this,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,Il(t.userId,this.reportClass.getSessionId())];case 1:return n.sent(),[2,e.prototype.checkStart.call(this,t)]}}))}))},t.prototype.compressStatistics=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,{success:!0,data:Hc(e.map(Rl).join(""))}]}))}))},t.prototype.isReporter=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,(t=this.userId,n=this.reportClass.getSessionId(),l(void 0,void 0,void 0,(function(){var e,r,i;return d(this,(function(o){switch(o.label){case 0:return[4,gl(El+"_"+t)];case 1:return e=o.sent(),r=e.success,i=e.value,[2,r&&(null==i?void 0:i.sessionId)===n]}}))})))];case 1:return[2,e.sent()]}var t,n}))}))},t.prototype.report=function(t,n,r,i,o,s){return l(this,void 0,void 0,(function(){return d(this,(function(a){switch(a.label){case 0:return[4,this.isReporter()];case 1:return a.sent()?[2,e.prototype.report.call(this,t,n,r,i,o,s)]:[2]}}))}))},t.prototype.realtimeReport=function(t,n,r){return l(this,void 0,void 0,(function(){return d(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,n,r)]}))}))},t}(ml),Dl=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.appkey=t,i.logger=n,i.runtime=r,i._storageKey="",i._storageKey=Z.STATIC_CONFIG_KEY(t),i}return a(t,e),t.prototype.getCache=function(){return this.runtime.localStorage.getItem(this._storageKey)},t.prototype.setCache=function(e){this.runtime.localStorage.setItem(this._storageKey,e)},t.prototype.clearCache=function(){this.runtime.localStorage.removeItem(this._storageKey)},t.prototype.sendRequest=function(e){return l(this,void 0,void 0,(function(){var t,n,r;return d(this,(function(i){switch(i.label){case 0:return[4,this.runtime.httpReq({url:e})];case 1:return t=i.sent(),n=t.status,r=t.data,[2,{code:n,data:r}]}}))}))},t.prototype.decryptData=function(e){return l(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,nr(e,P,b)];case 1:return t=r.sent(),[2,JSON.parse(t)];case 2:return n=r.sent(),this.logger.error(Re.L_GET_STATIC_CONF_E,JSON.stringify({error:null==n?void 0:n.stack})),[3,3];case 3:return[2]}}))}))},t}(Ii),wl=function(){function e(e){this.reporter=e,this.logId="",this.uploadTask=[],this.taskLock=!0}return e.prototype.uploadLogCmdTask=function(e){this.uploadTask.push(e),this.enqueueTask()},e.prototype.reportLogCmdTask=function(e){var t,n,r,i,o=this;this.taskLock=!1;var s=null!==(t=e.startTime)&&void 0!==t?t:0,a=null!==(n=e.endTime)&&void 0!==n?n:0,u=null!==(r=e.platform)&&void 0!==r?r:"",c=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==c&&(this.logId=e.logId,this.reporter.report(s,a,u,c,e.logId,"",!0).finally((function(){o.taskLock=!0,o.uploadTask.length>0&&o.enqueueTask()})))},e.prototype.enqueueTask=function(){if(this.taskLock){var e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}},e}();!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(fl||(fl={}));var Vl={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}};function Gl(){return Vl}var Bl=function(){function e(e,t,n,r){this.logger=e,this.appkey=t,this.reporter=n,this.statisticLog=r,this.isEable=!0,this.expire=0,this.interval=0,this.timestamp=0,this.lastRequestTime=0,this.changeAreaCode=0,this._cache=null,this.uploadTaskManage=new wl(n)}return e.prototype.init=function(){try{var e=this.getLocalCloudControllerCache();this._cache=e?JSON.parse(e):Gl()}catch(e){this._cache=Gl()}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)))},e.prototype.isExire=function(){return(new Date).getTime()-this.timestamp<this.expire},e.prototype.isOverclock=function(){return(new Date).getTime()-this.lastRequestTime<this.interval},e.prototype.logCmdMsgTasks=function(e){var t=this;e.uploadLog&&e.uploadLog.tasks.forEach((function(e){e.objectName===ce.LOG_COMMAND&&t.uploadTaskManage.uploadLogCmdTask(e)}))},e.prototype.dataHandle=function(e){var t=this._cache;t.lastRequestTime=this.lastRequestTime,en(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)},e.prototype.request=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a,u,c,l,h,p;return d(this,(function(d){switch(d.label){case 0:return!this.isEable&&t===fl.init&&this.isExire()?(this.logger.info(Re.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===fl.newWorkChange&&this.isOverclock()?(this.logger.info(Re.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(r=rr(e),this.lastRequestTime=(new Date).getTime(),i=r+"/v1/config",o={"Content-Type":"application/json","RC-App-Key":this.appkey},n&&(o["RC-Token"]=n),s={platform:"web",version:"5.12.1",timestamp:this.timestamp},this.statisticLog.record(ve.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!n,uri:i})),[4,this.httpRequest(i,or.POST,o,s)]);case 1:return a=d.sent(),u=a.code,c=a.data,this.statisticLog.record(ve.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),u===re.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(l=c.targetRegion,this.changeAreaCode===l?[2,this.timestamp]:(h=Ei.setAreaCode(l),this.logger.info(Re.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:h,originAreaCode:Ei.getAreaCode(),newAreaCode:l})),this.changeAreaCode=l,(p=Ei.getCloudControllerUrl(l))[0]?[2,this.request(p[0],fl.other)]:(this.logger.info(Re.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])}}))}))},e.prototype._handleMrtrData=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}(),Fl=function(e){function t(t,n,r,i,o){var s=e.call(this,r,t,i,o)||this;s.runtime=n,s._mrtr={chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1};var a=Rr(n);return s.deviceId=In(n),s.model="Web|"+a.type+"|"+a.version,s.init(),s}return a(t,e),t.prototype.httpRequest=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,h;return d(this,(function(d){switch(d.label){case 0:return(i=r).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:n,body:JSON.stringify(i)},this.logger.info(Re.L_REQUEST_T,JSON.stringify(o)),[4,this.runtime.httpReq(o)];case 1:s=d.sent(),a=s.status,u=s.data,c=void 0===u?"":u,this.logger.info(Re.L_REQUEST_R,JSON.stringify({status:a,data:c}));try{return l=JSON.parse(c),h=l.data,[2,{code:parseInt(l.code,10),data:h}]}catch(e){return this.logger.warn(Re.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:a,data:c,error:e})),[2,{code:a,msg:e}]}return[2]}}))}))},t.prototype.setCloudControllerCache=function(e){var t=Z.CLOUD_CONTROL_KEY(this.appkey);this.runtime.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(Re.L_CLOUD_SET_CACHE_O,JSON.stringify(e))},t.prototype.getLocalCloudControllerCache=function(){var e=Z.CLOUD_CONTROL_KEY(this.appkey),t=this.runtime.localStorage.getItem(e);return this.logger.info(Re.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t},t.prototype.setMRTRConfig=function(e){this.logger.info(Re.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e},t.prototype.getMRTRConfig=function(){return this._mrtr},t}(Bl),kl=function(){function e(e,t,n,r){this._storage=new o(e,Z.READ_RECEIPT_KEY(t,n)),this._delayTime=r,this.clear()}return e.prototype._getConversationKey=function(e){return e.targetId+"_"+e.channelId},e.prototype._removeExcessData=function(e){for(var t=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),n={},r=0,i=t;r<i.length;r++){var o=i[r];n[o.key]=o.value}return n},e.prototype.insert=function(e,t,n,r,i){var o;if(!(r<Date.now()-this._delayTime-W)){var s=this._getConversationKey(e),a=this._storage.get(s)||{};if(!a[t]){var c={t:r,d:n};i&&(c.sId=i);var l=u(u({},a),((o={})[t]=c,o));Object.keys(l).length>30&&(l=this._removeExcessData(l)),this._storage.set(s,l)}}},e.prototype.addReadedUser=function(e,t,n){var r,i=this._getConversationKey(e),o=this._storage.get(i)||{},s=o[t];if(s){if(s.us){if(s.us.includes(n))return}else s.us=[];s.us.push(n),this._storage.set(i,u(u({},o),((r={})[t]=s,r)))}},e.prototype.getReadReceiptInfo=function(e,t){var n=this._getConversationKey(e),r=(this._storage.get(n)||{})[t];return r?{time:r.t,direction:r.d,users:r.us||[],senderId:r.sId}:null},e.prototype.getReceiptMessageDic=function(e){var t=this._getConversationKey(e),n=this._storage.get(t)||{},r={};for(var i in n){var o=n[i];o.d===te.RECEIVE&&(r[o.sId]||(r[o.sId]=[]),r[o.sId].push(i))}return r},e.prototype.remove=function(e,t){var n=this._getConversationKey(e),r=this._storage.get(n)||{};r[t]&&(delete r[t],0===Object.keys(r).length?this._storage.remove(n):this._storage.set(n,r))},e.prototype.clear=function(){var e=this._storage.getValues(),t={};for(var n in e){var r=e[n],i={};for(var o in r){var s=r[o];Date.now()-this._delayTime-s.t<W&&(i[o]=s)}Object.keys(i).length&&(t[n]=i)}this._storage.update(t)},e}(),xl=function(){function e(e){var t;this._delayTime=e,this.subscribeData=((t={})[nt.ONLINE_STATUS]={},t[nt.USER_PROFILE]={},t),this._ownProfile=null}return e.prototype.clearSubscribeRelation=function(){var e;this.subscribeData=((e={})[nt.ONLINE_STATUS]={},e[nt.USER_PROFILE]={},e)},e.prototype.clearSubscribeStatusData=function(e){var t=this;e===nt.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].statusMap={}})):e===nt.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].profile=void 0}))},e.prototype.getSubscribeUserData=function(e,t){var n=this.subscribeData[e][t];return n?u({},n):void 0},e.prototype.removeSubscribeUserData=function(e,t){delete this.subscribeData[e][t]},e.prototype.updateSubscribeUserData=function(e,t,n){this.subscribeData[e][t]=n},e.prototype.clearExpiredData=function(e){for(var t in this.subscribeData[e]){var n=this.subscribeData[e][t];n.expiry<(Date.now()+this._delayTime-n.subscribeTime)/1e3&&delete this.subscribeData[e][t]}},e.prototype.getSubscribeUserList=function(e,t,n){return h([],Object.values(this.subscribeData[e]),!0).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(n,n+t)},e.prototype.updateOwnProfile=function(e){this._ownProfile=u(u({},e),{extraProfile:u({},e.extraProfile)})},e.prototype.getOwnProfile=function(){return this._ownProfile?u(u({},this._ownProfile),{extraProfile:u({},this._ownProfile.extraProfile)}):null},e}(),Hl=function(){function e(e){this._delayTime=e,this._relationshipStatusVersion=0,this._subUserStatusVersion=0,this._ownProfileVersion=0,this._subStore=new xl(e)}return e.prototype.updateRelationshipStatusVersion=function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)},e.prototype.getRelationshipStatusVersion=function(){return this._relationshipStatusVersion},e.prototype.updateSubscribeUserStatusVersion=function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)},e.prototype.getSubscribeUserStatusVersion=function(){return this._subUserStatusVersion},e.prototype._filterSubscribeRelationData=function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(n){var r=e.find((function(e){return e.subscribeType===t.subType&&e.userId===n.subUserId}));r?r.subscribeTime<t.subTime&&(r.expiry=t.expiry,r.operationType=t.opType,r.subscribeTime=t.subTime):e.push({userId:n.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])},e.prototype.updateSubscribeRelation=function(e,t){var n=this;void 0===t&&(t=!1);var r=[],i=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,s,a=e.userId,u=e.subscribeTime,c=e.subscribeType,l=e.expiry;if(e.operationType===rt.UNSUBSCRIBE)return n._subStore.removeSubscribeUserData(c,a),void o.push(e);var d=n._subStore.getSubscribeUserData(c,a);if(!(d&&d.subscribeTime>=u)){if(c===nt.ONLINE_STATUS){r.push(a);var h=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};n._subStore.updateSubscribeUserData(c,a,{subscribeTime:u,expiry:l,userId:a,subscribeType:c,statusMap:h})}else{i.push(a);var p=null===(s=d)||void 0===s?void 0:s.profile;n._subStore.updateSubscribeUserData(c,a,{subscribeTime:u,expiry:l,userId:a,subscribeType:c,profile:p,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:r,newSubscribeUserProfileList:i,subscribeUserChangeList:o}},e.prototype.clearSubscribeStatus=function(){this._subStore.clearSubscribeStatusData(nt.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(nt.USER_PROFILE)},e.prototype.updateSubscribeUserOnlineStatus=function(e){var t=this,n=[];return e.forEach((function(e){var r=e.subUserId,i=e.data,o=t._subStore.getSubscribeUserData(nt.ONLINE_STATUS,r);if(o){var s=[],a=u({},o.statusMap);i.forEach((function(e){var t=a[e.platformInfo];if(!(t&&t.changeTime>e.versionTime)){var n={eventValue:e.value,changeTime:e.versionTime};a[e.platformInfo]=n,s.push(u(u({},n),{platform:e.platformInfo}))}})),t._subStore.updateSubscribeUserData(nt.ONLINE_STATUS,r,{subscribeTime:o.subscribeTime,expiry:o.expiry,userId:r,subscribeType:nt.ONLINE_STATUS,statusMap:a}),n.push({userId:r,subscribeType:nt.ONLINE_STATUS,subscribeTime:o.subscribeTime,expiry:o.expiry,details:s})}})),n},e.prototype.updateSubscribeUserProfile=function(e){var t=this,n=[];return e.forEach((function(e){var r=e.userId,i=e.version,o=e.userProfile,s=e.userExtProfile,a=t._subStore.getSubscribeUserData(nt.USER_PROFILE,r),c=Ar(r,o,s);a?a.profile&&a.profile.version>=i||(t._subStore.updateSubscribeUserData(nt.USER_PROFILE,r,{subscribeTime:a.subscribeTime,expiry:a.expiry,userId:r,subscribeType:nt.USER_PROFILE,profile:{info:c,version:i},isSubscribed:a.isSubscribed}),a.isSubscribed&&n.push({userId:r,subscribeType:nt.USER_PROFILE,subscribeTime:a.subscribeTime,expiry:a.expiry,userProfile:u({},c)})):t._subStore.updateSubscribeUserData(nt.USER_PROFILE,r,{subscribeTime:0,expiry:0,userId:r,subscribeType:nt.USER_PROFILE,profile:{info:c,version:i},isSubscribed:!1})})),n},e.prototype.getSubscribeUserStatus=function(e,t){var n=this,r=[];return t.forEach((function(t){var i=n._subStore.getSubscribeUserData(e,t);if(!i||i.expiry<(Date.now()+n._delayTime-i.subscribeTime)/1e3)n._subStore.removeSubscribeUserData(e,t);else{var o={subscribeTime:i.subscribeTime,expiry:i.expiry,userId:i.userId,subscribeType:i.subscribeType};if(e===nt.ONLINE_STATUS){var s=i.statusMap,a=Object.keys(s).map((function(e){return u({platform:~~e},s[~~e])}));o.details=mr(a)}else if(e===nt.USER_PROFILE&&!i.isSubscribed)return;r.push(o)}})),r},e.prototype.getUserProfiles=function(e){var t=this,n=[],r=[];return e.forEach((function(e){var i=t._subStore.getSubscribeUserData(nt.USER_PROFILE,e);if(i&&i.profile){var o=i.profile,s=o.version,a=o.info;if(i.isSubscribed)return t._delayTime+Date.now()-s>J?void r.push(e):void n.push(u(u({},a),{extraProfile:u({},a.extraProfile)}));t._delayTime+Date.now()-s>X?r.push(e):n.push(u(u({},a),{extraProfile:u({},a.extraProfile)}))}else r.push(e)})),{list:n,needQueryUserIds:r}},e.prototype.getSubscribeUserList=function(e,t,n){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,n).map((function(t){var n={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===nt.ONLINE_STATUS){var r=Object.keys(t.statusMap).map((function(e){return u({platform:~~e},t.statusMap[~~e])}));n.details=mr(r)}return n}))},e.prototype.updateOwnProfile=function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)},e.prototype.getOwnProfile=function(){return this._subStore.getOwnProfile()},e}(),Yl=function(){function e(e,t,n,r,i,o,s){this._connectManager=e,this._event=t,this._currentUserId=n,this._delayTime=r,this._logger=i,this._isOpenUserProfile=o,this._subDriven=s,this._isPullingRelationship=!1,this._pullRelationshipQueue=[],this._pullRelationshipFailTime=0,this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue=[],this._pullSubUserStatusFailTime=0,this._subscribeService=new Hl(r)}return e.prototype.syncData=function(){return l(this,void 0,void 0,(function(){return d(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(nt.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(nt.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(nt.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(nt.FRIEND_USER_PROFILE),[2]}}))}))},e.prototype.startSyncSubscribeRelationship=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship(),[2]}))}))},e.prototype._syncSubscribeRelationship=function(e){return void 0===e&&(e=!0),l(this,void 0,void 0,(function(){return d(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]}}))}))},e.prototype._pullSubscribeRelationship=function(e,t){return void 0===t&&(t=""),l(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l,h,p,_,g,f,E;return d(this,(function(d){switch(d.label){case 0:return n=this._subscribeService.getRelationshipStatusVersion(),r=this._logger.createTraceId(),this._logger.info(Re.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:n,_pageToken:t}),r),i=this._connectManager.codec.encodePullUserSubReq({version:n,pageToken:t}),o=new yo(No[No.pullUserSub],i,this._currentUserId),[4,this._connectManager.send(o,tu)];case 1:return s=d.sent(),a=s.code,u=s.data,a===re.SUCCESS&&u?(this._pullRelationshipFailTime=0,c=u.list,l=u.version,h=u.hasNext,p=u.pageToken,l=Mn(l),c.forEach((function(e){e.subTime=Mn(e.subTime)})),this._logger.info(Re.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:a,data:u}),r),e?(_=this._subscribeService.updateSubscribeRelation(c),g=_.newSubscribeOnlineStatusList,f=_.newSubscribeUserProfileList,E=_.subscribeUserChangeList,this._event.subscribeRelationChanged(E),g.length>0&&this._queryAndUpdateUserOnlineStatus(g),f.length>0&&this._queryAndUpdateUserProfile(f)):this._subscribeService.updateSubscribeRelation(c,!t),this._subscribeService.updateRelationshipStatusVersion(l),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>l})),h?[4,this._pullSubscribeRelationship(e,p)]:[3,3]):(this._logger.error(Re.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:a,failTime:this._pullRelationshipFailTime}),r),this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:d.sent(),d.label=3;case 3:return[2]}}))}))},e.prototype.startsyncSubscribeUserStatus=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus(),[2]}))}))},e.prototype._syncSubscribeUserStatus=function(e){return void 0===e&&(e=!1),l(this,void 0,void 0,(function(){return d(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]}}))}))},e.prototype._pullSubscribeUserStatus=function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=""),l(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l,h,p,_,g,f;return d(this,(function(d){switch(d.label){case 0:return n=this._subscribeService.getSubscribeUserStatusVersion(),r=this._logger.createTraceId(),this._logger.info(Re.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:n,_pageToken:t,needAllData:e}),r),i=this._connectManager.codec.encodePullSubDataReq({version:n,needAllData:e,pageToken:t}),o=new yo(No[No.pullSubData],i,this._currentUserId),[4,this._connectManager.send(o,ou)];case 1:return s=d.sent(),a=s.code,u=s.data,a===re.SUCCESS&&u?(this._pullSubUserStatusFailTime=0,c=u.list,l=u.versionTime,h=u.hasNext,p=u.pageToken,_=u.isFull,l=Mn(l),this._logger.info(Re.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:a,data:u}),r),c.forEach((function(e){e.data.forEach((function(e){e.versionTime=Mn(e.versionTime)}))})),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>l})),this._subscribeService.updateSubscribeUserStatusVersion(l),g=[],f=[],c.forEach((function(e){e.subType===nt.ONLINE_STATUS?g.push(e):e.subType===nt.USER_PROFILE&&f.push(e.subUserId)})),_&&""===t&&this._subscribeService.clearSubscribeStatus(),g.length>0&&this._updateUserOnlineStatus(g,!_),f.length>0?[4,this._queryAndUpdateUserProfile(f,!_)]:[3,3]):(this._logger.warn(Re.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:a,failTime:this._pullSubUserStatusFailTime}),r),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:d.sent(),d.label=3;case 3:return h?[4,this._pullSubscribeUserStatus(e,p)]:[3,5];case 4:d.sent(),d.label=5;case 5:return[2]}}))}))},e.prototype._queryAndUpdateUserOnlineStatus=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(Re.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),n=this._connectManager.codec.encodeQrySubDataReq(nt.ONLINE_STATUS,e),r=new yo(No[No.qrySubData],n,this._currentUserId),[4,this._connectManager.send(r,ou)];case 1:return i=a.sent(),o=i.code,s=i.data,this._logger.info(Re.L_QUERY_SUBSCRIBE_DATA_R,JSON.stringify({code:o,data:s}),t),o===re.SUCCESS&&s?(this._updateUserOnlineStatus(s.list),[2]):[2]}}))}))},e.prototype._updateUserOnlineStatus=function(e,t){void 0===t&&(t=!0),e.forEach((function(e){e.data.forEach((function(e){e.versionTime=Mn(e.versionTime)}))}));var n=this._subscribeService.updateSubscribeUserOnlineStatus(e);n=n.filter((function(e){return e.details&&e.details.length>0})),t&&n.length>0&&this._event.subscribeUserStatusChanged(n)},e.prototype._queryAndUpdateUserProfile=function(e,t){return void 0===t&&(t=!0),l(this,void 0,void 0,(function(){var n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return n=this._logger.createTraceId(),this._logger.info(Re.L_PULL_USER_PROFILE_T,JSON.stringify(e),n),r=this._connectManager.codec.encodePullUserProfileReq(e),i=new yo(No[No.pullUserProfile],r,this._currentUserId),[4,this._connectManager.send(i,pu)];case 1:return o=c.sent(),s=o.code,a=o.data,this._logger.info(Re.L_PULL_USER_PROFILE_R,JSON.stringify({code:s,data:a}),n),s===re.SUCCESS&&a?(a.UserProfile.forEach((function(e){e.version=Mn(e.version)})),u=this._subscribeService.updateSubscribeUserProfile(a.UserProfile),t&&u.length>0&&this._event.subscribeUserStatusChanged(u),[2,{code:s,data:a.UserProfile}]):[2,{code:s}]}}))}))},e.prototype.updateUserStatus=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i;return d(this,(function(o){switch(o.label){case 0:return(t=this._connectManager.codec.decodeByPBName(e.data,su)).subType!==nt.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==nt.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==nt.FRIEND_ONLINE_STATUS?[3,3]:(n=t.data.map((function(e){return{changeTime:Mn(e.versionTime),eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:n}]),[3,5]);case 3:return t.subType!==nt.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:r=o.sent(),(i=r.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Ar(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),o.label=5;case 5:return[2]}}))}))},e.prototype.getSubscribeUserStatus=function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)},e.prototype.getSubscribeUserList=function(e,t,n){return this._subscribeService.getSubscribeUserList(e,t,n)},e.prototype.updateSubscribeRelation=function(e,t,n,r){return void 0===r&&(r=0),l(this,void 0,void 0,(function(){var i,o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return i=this._connectManager.codec.encodeUpdateUserSubReq(t,e,n,r),o=new yo(No[No.updUserSub],i,this._currentUserId),[4,this._connectManager.send(o,eu)];case 1:return s=l.sent(),a=s.code,u=s.data,a===re.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT&&u?[2,{code:a,data:u.subUsers.map((function(e){return e.subUserId}))}]:a===re.SUCCESS&&u?(c=u.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:r,opType:n,subUsers:e.map((function(e){return{subUserId:e}}))}]),n===rt.SUBSCRIBE&&(t===nt.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===nt.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,{code:a}]):[2,{code:a}]}}))}))},e.prototype.getUserProfiles=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return t=this._subscribeService.getUserProfiles(e),n=t.needQueryUserIds,r=t.list,0===n.length?[2,Promise.resolve({code:re.SUCCESS,data:r})]:[4,this._queryAndUpdateUserProfile(n,!1)];case 1:return i=u.sent(),o=i.code,s=i.data,o===re.SUCCESS&&s?(a=s.map((function(e){return Ar(e.userId,e.userProfile,e.userExtProfile)})),[2,{code:o,data:h(h([],r,!0),a,!0)}]):[2,{code:o,data:h([],r,!0)}]}}))}))},e.prototype.syncOwnProfile=function(e){return void 0===e&&(e=!1),l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,l,h,p;return d(this,(function(d){switch(d.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(Re.L_PULL_OWN_PROFILE_T,"",t),n=this._connectManager.codec.encodeUserProfileInput(),r=new yo(No[No.pullOwnProfile],n,this._currentUserId),[4,this._connectManager.send(r,cu)]):[2,Promise.resolve({code:re.RC_USER_PROFILE_SERVICE_UNAVAILABLE})];case 1:return i=d.sent(),o=i.code,s=i.data,this._logger.info(Re.L_PULL_OWN_PROFILE_R,JSON.stringify({code:o,data:s}),t),o===re.SUCCESS&&s?(a=s.userExtProfile,u=s.userProfile,c=s.version,l=s.userId,h=Mn(c),p=Ar(l,u,a),this._subscribeService.updateOwnProfile(p,h),e&&this._event.ownUserProfileChanged(p),[2,{code:o,data:p}]):[2,{code:o}]}}))}))},e.prototype.getOwnProfile=function(){return l(this,void 0,void 0,(function(){var e;return d(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,{code:re.SUCCESS,data:e}]:[2,this.syncOwnProfile()]}))}))},e.prototype.updateOwnProfile=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))},e}();function ql(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:Mn(e.relationTime),inBlackList:!!e.flag}})):[]}function Kl(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:Mn(e.operateTime),extra:e.info||"",friendType:e.friendType}})):[]}var jl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._pullQueue=[],t._isPulling=!1,t}return a(t,e),t.prototype.startPull=function(){return l(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return this._isPulling?[2]:(this._isPulling=!0,[4,this.pullQueueConsumption()]);case 1:return e=a.sent(),t=e.code,n=e.data,this._isPulling=!1,r=n&&n.hasNext||!1,t!==re.SUCCESS||Zt(n)||(this.pullDataHandler(n),i=this.getVersion(),o=this._pullQueue.filter((function(e){return e>i})),this._pullQueue.length=0,(s=this._pullQueue).push.apply(s,o)),r?(this.startPull(),[2]):(this._pullQueue.length>0&&(this._pullQueue.length=0,this.startPull()),[2])}}))}))},t.prototype._triggerPull=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this.startPull()];case 1:return t.sent(),[2]}}))}))},t}(bo),Ql=function(e){function t(t,n,r,i,s,a){var u=e.call(this)||this;return u.runtime=t,u._connectManager=n,u._currentUserId=r,u._logger=i,u._appkey=s,u._callBack=a,u._lastPullingChangeMessageTime=0,u._lastPullingChangeMessageTimeLocal=(new Date).getTime(),u._duration=18e4,u._pullEventChangeIntervalTimer=-1,u._localStorageKey=Z.PULL_EVENT_CHANGE_TIME_KEY(s,r),u._storage=new o(t,u._localStorageKey),u._lastPullingChangeMessageTime=u._storage.get(r)||0,u}return a(t,e),Object.defineProperty(t.prototype,"_isConnected",{get:function(){return this._connectManager.getConnectionStatus()===Wc.CONNECTED},enumerable:!1,configurable:!0}),t.prototype._setLastPullingChangeMessageTime=function(e){this._lastPullingChangeMessageTime=e,this._storage.set(this._currentUserId,e)},t.prototype._startPullEventChangeInterval=function(){var e=this,t=function(){e._pullEventChangeIntervalTimer=setTimeout((function(){var n=Date.now();n-e._lastPullingChangeMessageTimeLocal>=e._duration&&(e.startPullEventChange(e._lastPullingChangeMessageTime,!0),e._lastPullingChangeMessageTimeLocal=n),e._stopUltraSyncInterval(),t()}),3e4)};t()},t.prototype._stopUltraSyncInterval=function(){-1!==this._pullEventChangeIntervalTimer&&(clearTimeout(this._pullEventChangeIntervalTimer),this._pullEventChangeIntervalTimer=-1)},t.prototype.startPullEventChange=function(e,t){void 0===t&&(t=!1);var n=this.getVersion();(e>n||0===e||t)&&this._triggerPull(n)},t.prototype.pullQueueConsumption=function(){if(!this._isConnected)return Promise.resolve({code:re.CONNECTION_TIMEOUT});this._logger.info(Re.L_PULL_EVENT_CHANGE_T,"PullEventChange time: "+this._lastPullingChangeMessageTime);var e=this._connectManager.codec.encodeQueryMsgChange(this._lastPullingChangeMessageTime),t=new yo(No[No.pullEventChange],e,this._currentUserId);return t.setHeaderQos(hi.AT_LEAST_ONCE),this._connectManager.send(t,La)},t.prototype.pullDataHandler=function(e){this._logger.info(Re.L_PULL_EVENT_CHANGE_R,"PullEventChange data: "+JSON.stringify(e));var t=e.list,n=(null==e?void 0:e.syncTime)||0;this._callBack(t),this._setLastPullingChangeMessageTime(n)},t.prototype.getVersion=function(){return this._lastPullingChangeMessageTime||0},t.prototype.notificationOnline=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){return this._isConnected?(this.startPullEventChange(this._lastPullingChangeMessageTime,!0),this._startPullEventChangeInterval(),this._logger.info(Re.L_PULL_EVENT_CHANGE_NOTIFY_ULTRA_ONLINE_S,"PullEventChange notify online"),[2]):[2]}))}))},t}(jl),Wl=function(e,t,r,i,o,s,a){return{conversationType:e,targetId:t,senderUserId:s,messageDirection:te.SEND,isCounted:!!r.isCounted,isMentioned:!!r.isMentioned,content:r.content,messageType:r.messageType,isOffLineMessage:!1,isPersited:!!r.isPersited,messageUId:i,sentTime:o,receivedTime:0,disableNotification:!!r.disableNotification,isStatusMessage:!!r.isStatusMessage,canIncludeExpansion:!!r.canIncludeExpansion,expansion:r.canIncludeExpansion?r.expansion:null,receivedStatus:n.UNREAD,receivedStatusInfo:yr(n.UNREAD),pushConfig:r.pushConfig,channelId:r.channelId,isInterrupt:r.isInterrupt,messageId:a||0,sentStatus:Me.SENT,directedUserIds:r.directionalUserIdList}},Jl=function(e){return e.sort((function(e,t){var n,r,i=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-i})),e};qe.CHANNEL_CHANGE,qe.MSG_RECALL,qe.MSG_EXPANSION,qe.MSG_MODIFY,qe.USER_GROUP_CHANGE;var Xl=[Rt.GROUP_OPERATION,Rt.GROUP_PROFILE_CHANGE,Rt.GROUP_APPLICATION_INVITATION,Rt.GROUP_FOLLOW_USER_CHANGE],Zl=[Mt.FRIEND_APPLICATION];function zl(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l(this,void 0,void 0,(function(){return d(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve({code:re.RC_NET_UNAVAILABLE})]}))}))},n}}var $l=function(e){function t(t,n,r,i){var o=e.call(this,t,n,r,i,new wc(i.appkey,"RC-E","IM"),new Nl(i.appkey,"RC-E","IM"))||this;o._customMessageType={},o._reconnectTimer=-1,o._pullOfflineFinished=!1,o.currentUserId="",o._openCallPlus=!1,o.cloudControllerUri="",o._pullingMsg=!1,o._pullQueue=[],o._chrmsQueue={},o._latestSyncTimestamp=0,o._intervalTimer=-1,o._latestPullKVMsgTimestamp=0,o._intervalTimerForChrmPull=-1,o._handleInnerMsgOptions=function(e,t,n){var r,i=n.messageType;if("RC:SRSMsg"===i&&Object.assign(n,{directionalUserIdList:[o.currentUserId]}),i===ce.READ_RECEIPT_RESPONSE){if(!n.content.receiptMessageDic||0===Object.keys(n.content.receiptMessageDic).length){var s=null===(r=o._readReceiptManager)||void 0===r?void 0:r.getReceiptMessageDic({conversationType:e,targetId:t,channelId:n.channelId});n.content.receiptMessageDic=s||{}}for(var a in n.directionalUserIdList=[],n.content.receiptMessageDic)n.directionalUserIdList.push(a)}return n},o._lastSyncUltraMsgTimeStamp=0,o._lastSyncUltraMsgLocalTimeStamp=0,o._ultraGroupTimer=-1,o._isUltraPulling=!1,o._ultraGroupTimeQue=[],o._isUltraGroupListExist=!1,o._ultraGroupMap={},o._ultraMsgMap={},o._pullUltraChangeMessageQue=[],o._isPullingUltraChangeMessage=!1,o._lastPullingUltraChangeMessageTime=0;var s=i.appkey,a=i.logOutputLevel,u=i.logExpireTime,c=i.navigators,l=i.areaCode,d=i.logServerUrl,h=i.miniCMPProxy,p=i.environment;return o._environment=p||"default",o.logger.setOutputLevel(a),Ei.init({areaCode:l,navigators:c,logServerUrl:d,miniCMPProxy:h}),Rc(s,o.logger,t,u),o.reporter=new Qc(s,o.runtime,o.logger,o._options.__reportLogLevel),o.navi=new Zo(s,o.logger,o.statisticLog,t,new Dl(s,o.logger,t),o._environment),hl(s,o.logger,u),o.reporterStatistic=new bl(s,o.runtime,o.logger,o.statisticLog),o._letterbox=new Oo(t,s),o._sendMessageStore=new zo(t,s),o._chrmEntryHandler=new Lo(o),o._connMgr=new sl(s,o.navi,o.logger,o.statisticLog,o.runtime,{signal:o._signalHandler.bind(o),onConnected:o.onConnected.bind(o),onDisconnected:o.onDisconnected.bind(o),onConnecting:o._watcher.onConnecting,onSuspend:o.onSuspend.bind(o)}),"browser"===o.runtime.tag&&o._initCloudController(),o}return a(t,e),t.prototype._initCloudController=function(){var e=Ei.getCloudControllerUrl();this.cloudControllerUri=e[0],this.cloudController=new Fl(this._appkey,this.runtime,this.logger,this.reporter,this.statisticLog),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,fl.init)},t.prototype.onConnected=function(){var e,t=this.navi.getNaviInfoFromCache(this._connMgr.getToken()),n=this._connMgr.getCurrentUserId();this.currentUserId=n,this._pullOfflineFinished=!1,this._EventChangeManager=new Ql(this.runtime,this._connMgr,this.currentUserId,this.logger,this._appkey,this._handleEventChangeList.bind(this)),this._joinedChrmManager||(this._joinedChrmManager=new Po(t.joinMChrm)),this._conversationManager||(this._conversationManager=new qo(this,this._appkey,this.currentUserId,this._watcher.conversation,this._watcher.conversationTag)),this._ultraGroupManager||(this._ultraGroupManager=new ss(this,this._appkey,this.currentUserId)),this._userSettingManager||(this._userSettingManager=new Ko(this,this._appkey,this.currentUserId,this._watcher.tag)),this._readReceiptManager||(this._readReceiptManager=new kl(this.runtime,this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(t),this._conversationManager.startPullConversationStatus(0),this._conversationManager.adaptOldStore(),this._userSettingManager.pullUserSettings(0),this._sendMessageStore.init(this.currentUserId),this._rejoinChrm(),this._startSyncInterval(),this._openCallPlus&&this._syncCallPullKVMsg(),1===t.ugMsg&&this._notificationOnline(),1===t.eventDriven&&(null===(e=this._EventChangeManager)||void 0===e||e.notificationOnline()),this._watcher.onConnected(),this.reporter.checkStart(t),this.reporterStatistic.checkStart(t)},t.prototype.onDisconnected=function(e){var t,n,r;this._resetMemoryState(),null===(t=this._userSettingManager)||void 0===t||t.stopAllTask(),null===(n=this._conversationManager)||void 0===n||n.stopAllTask(),null===(r=this._EventChangeManager)||void 0===r||r.stopAllTask(),this._watcher.onDisconnected(e)},t.prototype.onSuspend=function(e){var t,n,r;null===(t=this._userSettingManager)||void 0===t||t.stopAllTask(),null===(n=this._conversationManager)||void 0===n||n.stopAllTask(),null===(r=this._EventChangeManager)||void 0===r||r.stopAllTask(),this._watcher.onSuspend(e)},t.prototype._initSubscribeManager=function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new Yl(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var n,r;null===(r=(n=t._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(n,e)},subscribeUserStatusChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedUserStatusChange)||void 0===r||r.call(n,e)},subscribeRelationChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedRelationChange)||void 0===r||r.call(n,e)},ownUserProfileChanged:function(e){var n,r;null===(r=(n=t._watcher).ownUserProfileChanged)||void 0===r||r.call(n,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())},t.prototype.createLogger=function(e,t){return new wc(this._appkey,e,t)},t.prototype.createStatisticLogger=function(e,t){return new Nl(this._appkey,e,t)},t.prototype.refetchNaviInfo=function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())},t.prototype.getNaviInfoFromCache=function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())},t.prototype.getConnectedTime=function(){return this._connMgr.getConnectedTime()},t.prototype.getConnectionStatus=function(){return this._connMgr.getConnectionStatus()},t.prototype.connect=function(e,t,n,r){return l(this,void 0,void 0,(function(){return d(this,(function(i){return this._openCallPlus=n,[2,this._connMgr.connect(e,t,n,r)]}))}))},t.prototype._signalHandler=function(e,t){var n,r=e.syncMsg,i=e.topic;if(r)this._receiveSyncMsg(e,t);else{var o=this.logger.createTraceId();this.logger.debug(Re.L_RECV_RMTP_O,i,o);var s=No[i];if(s)switch(s){case No.s_ntf:this._pullMsg(e);break;case No.s_msg:this._receiveMsg(e);break;case No.s_cmd:this._receiveStateNotify(e);break;case No.s_us:this._receiveSettingNotify(e);break;case No.rtc_ntf:this._receiveRtcKv(e.data);break;case No.s_opNtf:this._pullOperateStatusNotify(e);break;case No.s_pubCall:this._pubCallInfo(e);break;case No.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(e)}else this.logger.error(Re.L_RECV_RMTP_E,i,o)}},t.prototype._receiveStateNotify=function(e){var t,n,r,i=this._connMgr.codec.decodeByPBName(e.data,gs),o=i.time,s=i.type,a=i.chrmId;switch(s){case 2:this._chrmEntryHandler.pullEntry(a,o);break;case 3:this._conversationManager.startPullConversationStatus(o);break;case 4:this._chrmEntryHandler.reset(a),this._watcher.chatroom({chatroomDestroyed:e.targetId});break;case 6:this._ultraGroupTimeQue.push(o),this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp);break;case 7:this._pullUltraChangeMessageQue.push(o),this._pullUltraChangeMessageList(this._lastPullingUltraChangeMessageTime);break;case 8:null===(t=this._subscribeManager)||void 0===t||t.startsyncSubscribeUserStatus(o);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(o);break;case 10:null===(r=this._subscribeManager)||void 0===r||r.syncOwnProfile(!0);break;case 11:this._EventChangeManager.startPullEventChange(o)}},t.prototype._receiveSettingNotify=function(e){var t=this._connMgr.codec.decodeByPBName(e.data,ea).version;this._userSettingManager.pullUserSettings(t)},t.prototype._receiveMessageExpansion=function(e){var t=e.content,n=e.channelId,r=void 0===n?"":n,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:r,conversationType:i,targetId:o}}),a&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:a,channelId:r,conversationType:i,targetId:o}})},t.prototype._clearUltraGroupUnreadCount=function(e,t){var n=this._connMgr.codec.decodeByPBName(e.data,Us),r=n.targetId,i=n.channelId,o=n.timestamp,s=this._ultraGroupMap[i+"_"+r];s&&(s.unreadMessageCount=0,s.unreadMentionedCount=0,s.unreadMentionedMeCount=0,s.firstUnreadMessage&&(s.firstUnreadMessage=null),s.lastReadTime=o,this._watcher.conversation(Cr([s]))),t&&(this._ultraMsgMap[t.messageUId]=t.timestamp)},t.prototype._receiveSyncMsg=function(e,t){var n,r=this,i=((n={})[No[No.ugMsg]]=function(){r._ultraGroupTimeQue.push(t.timestamp),r._syncUltraMsg(r._lastSyncUltraMsgTimeStamp)},n[No[No.updRTime]]=function(){r._receivesyncReadStatus(e)},n[No[No.updUgRTime]]=function(){r._clearUltraGroupUnreadCount(e,t)},n[No[No.updUserSub]]=function(){var e;null===(e=r._subscribeManager)||void 0===e||e.startSyncSubscribeRelationship(t.timestamp)},n);if(i[e.topic])i[e.topic]();else if($o.includes(e.topic)){var o=this._connMgr.codec.decodeByPBName(e.data,as,{currentUserId:this.currentUserId,signal:e});((o=this._handleMsgProperties(o)).conversationType!==oe.CHATROOM||this._chrmsQueue[o.targetId])&&(this._pullingMsg?this._pullQueue.push((null==t?void 0:t.timestamp)||o.sentTime):(t&&(o.sentTime=t.timestamp,o.messageUId=t.messageUId,this._sendMessageStore.setMessage(t.messageUId,t.timestamp)),this.logger.info(Re.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:o.messageUId,messgeId:o.messageId,sentTime:o.sentTime})),o.messageType!==ce.EXPANSION_NOTIFY?((o.messageType===ce.SYNC_READ_STATUS||o.messageType===ce.READ_RECEIPT&&o.senderUserId===this.currentUserId)&&this._conversationManager.clearUnreadCount(o.conversationType,o.targetId,o.channelId,o.sentTime),o.messageType===ce.READ_RECEIPT_REQUEST&&this._processRRReqMsg(o),o.messageType===ce.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(o),this._conversationManager.setConversationCacheByMessage(o,!0),this._batchMessage([o])):this._receiveMessageExpansion(o)))}},t.prototype._batchMessage=function(e){for(var t=this,n=[],r=[],i=[],o=e.length-1;o>=0;o-=1){var s=e[o];s.messageType===ce.LOG_COMMAND&&s.senderUserId===Q?r.unshift(s):s.messageType===ce.CLOUD_CONTROL&&s.senderUserId===Q?i.push(s):n.unshift(s)}this._watcher.batchMessage(n),r.forEach((function(e){var n=e.content,r=n.startTime,i=n.endTime,o=n.platform,s=n.logId,a=n.uri;t.reporter.report(parseInt(r,10),parseInt(i,10),o,a,s,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)},t.prototype._ccMsgHandler=function(e){var t;return l(this,void 0,void 0,(function(){var n,r,i;return d(this,(function(o){switch(o.label){case 0:return e.shift()?(n=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,fl.other,n)]):[3,2];case 1:r=o.sent()||0,(i=e.filter((function(e){return e.sentTime>r}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))},t.prototype._pubCallInfo=function(e){var t=this._connMgr.codec.decodeByPBName(e.data,Ha),n=t.key,r=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:n,value:r}]}))},t.prototype._pullMsg=function(e){var t=this._connMgr.codec.decodeByPBName(e.data,gs),n=t.type,r=t.chrmId,i=t.time;if(this.logger.info(Re.L_RECV_S_NTF_O,"type: "+n+", chrmId: "+n+", time: "+i),2===n){var o=this._chrmsQueue[r];if(!o)return;o.queue.push(i),this._pullChrmMsg(r)}else this._pullQueue.push(i),this._syncMsg()},t.prototype._receivesyncReadStatus=function(e){var t=this._connMgr.codec.decodeByPBName(e.data,Us),n=t.conversationType,r=t.targetId,i=t.channelId,o=t.timestamp,s=t.sentTime;this._conversationManager.clearUnreadCount(n,r,i,s),this._watcher.syncReadStatus({conversationType:n,targetId:r,channelId:i,timestamp:o})},t.prototype._startSyncInterval=function(){var e=this;this._stopSyncInterval();this._intervalTimer=setInterval((function(){Date.now()-e._latestSyncTimestamp>=18e4&&e._syncMsg()}),3e4),this._latestSyncTimestamp=Date.now(),this._syncMsg()},t.prototype._stopSyncInterval=function(){-1!==this._intervalTimer&&(clearInterval(this._intervalTimer),this._intervalTimer=-1)},t.prototype._syncCallPullKVMsg=function(){return l(this,void 0,void 0,(function(){var e,t,n,r,i;return d(this,(function(o){switch(o.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodePullKVMsg(this._latestPullKVMsgTimestamp),t=new yo(Hi,e,this.currentUserId),[4,this._connMgr.send(t,qa)]):[2];case 1:return n=o.sent(),r=n.code,i=n.data,r===re.SUCCESS&&i?(this._latestPullKVMsgTimestamp=i.maxTime,this._watcher.callInfo(JSON.stringify({list:i.info})),[2]):[2]}}))}))},Object.defineProperty(t.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===Wc.CONNECTED},enumerable:!1,configurable:!0}),t.prototype._filterMessage=function(e){var t=e.messageType;return t===ce.DELIVERED||t===ce.DELIVERED_MSG||t===ce.SYNC_READ_STATUS&&!this._processSRSMsg(e)},t.prototype._messageProcessor=function(e){var t=this,n=0,r=[],i=[],o=[],s=[],a=[];return e.forEach((function(e){var u=e.conversationType,c=e.targetId,l=e.channelId,d=e.messageDirection,h=e.messageUId,p=e.messageType,_=e.sentTime,g=e.senderUserId,f=e.content;if(r.push(h),d===te.SEND){n=Math.max(_,n);var E=t._sendMessageStore.getSendMessageMap(),I=p===ce.RECALL?"Cmd:"+f.messageUId:h;if(E[I])return void t._sendMessageStore.removeByUID(I)}if(!t._filterMessage(e))if(p!==ce.EXPANSION_NOTIFY)if(_>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,h)&&a.push(h),p===ce.READ_RECEIPT&&g===t.currentUserId&&t._conversationManager.clearUnreadCount(u,c,l,_),p!==ce.READ_STATE){p===ce.READ_RECEIPT_REQUEST&&t._processRRReqMsg(e),p===ce.READ_RECEIPT_RESPONSE&&t._processRRRspMsg(e);var T=t._handleMsgProperties(e);t._conversationManager.setConversationCacheByMessage(T,!0),i.push(T)}else s.push(e);else o.push(e)})),{newOutboxTime:n,messageUIds:r,messages:i,messageExpansionList:o,RSMsgList:s,msgUIds2Statistic:a}},t.prototype._processSRSMsg=function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=e.content,o=e.senderUserId,s=e.sentTime;if(o!==this.currentUserId)return!1;var a=this.getNaviInfoFromCache();return this._conversationManager.clearUnreadCount(t,n,r,s),1!==a.sesDriven||(s>this.getConnectedTime()||this._watcher.syncReadStatus({conversationType:t,targetId:n,channelId:r,timestamp:i.lastMessageSendTime}),!1)},t.prototype._processRSMsg=function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=e.content,o={conversationType:t,targetId:n,channelId:r};this._watcher.messageReadReceipt(t===oe.PRIVATE?{privateReadReceipt:u(u({},o),{endMsgTime:i.endMsgTime})}:{groupReadReceipt:u(u({},o),{totalCount:i.tmn,readedCount:i.rrn,messageUId:i.msgId})})},t.prototype._processRRReqMsg=function(e){var t,n=e.conversationType,r=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:n,channelId:r,targetId:i},o.messageUId,a,s,u)},t.prototype._processRRRspMsg=function(e){var t,n=this,r=e.conversationType,i=e.channelId,o=e.targetId,s=e.content,a=e.senderUserId,u=s.receiptMessageDic,c=void 0===u?{}:u;if(a===this.currentUserId)for(var l in c)for(var d=0,h=c[l];d<h.length;d++){var p=h[d];null===(t=this._readReceiptManager)||void 0===t||t.remove({conversationType:r,channelId:i,targetId:o},p)}else(c[this.currentUserId]||[]).forEach((function(e){var t;null===(t=n._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:r,channelId:i,targetId:o},e,a)}))},t.prototype._syncMsg=function(){return l(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a,u,c,l,h,p,_,g,f,E,I,T,R,v,C,y,S=this;return d(this,(function(d){switch(d.label){case 0:return this._pullingMsg?[2]:this._isConnected?(this._pullingMsg=!0,e=this._letterbox.getOutboxTime(this.currentUserId),t=this._letterbox.getInboxTime(this.currentUserId),n=this._letterbox.getBroadcastSyncTime(this.currentUserId),r=this._connMgr.codec.encodeSyncMsg({sendboxTime:e,inboxTime:t,broadcastSyncTime:n}),i=new yo(No[No.pullMsg],r,this.currentUserId),o=this.logger.createTraceId(),this.logger.info(Re.L_PULL_MSG_T,JSON.stringify({outboxTime:e,inboxTime:t,broadcastSyncTime:n}),o),[4,this._connMgr.send(i,ls,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId,customMessageTypes:this._customMessageType})]):(this._pullingMsg=!1,[2]);case 1:if(s=d.sent(),a=s.code,u=s.data,this._latestSyncTimestamp=Date.now(),this._pullingMsg=!1,a!==re.SUCCESS||!u||Zt(u.finished)||Zt(u.list)||Zt(u.syncTime))return this.logger.warn(Re.L_PULL_MSG_R,JSON.stringify({code:a,timestamp:this._latestSyncTimestamp}),o),[2];c=u.list,l=u.finished,h=u.syncTime,p=u.broadcastSyncTime,_=void 0===p?1:p,this.logger.info(Re.L_PULL_MSG_R,JSON.stringify({syncTime:h,finished:l,messages:c.map((function(e){return{messageUId:e.messageUId,messageId:e.messageId,sentTime:e.sentTime}}))}),o);try{if(g=this._messageProcessor(c),f=g.newOutboxTime,E=g.messageUIds,I=g.messages,T=g.messageExpansionList,R=g.RSMsgList,(v=g.msgUIds2Statistic).length>0&&this.statisticLog.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:v.join(",")})),this._batchMessage(I),T.forEach((function(e){S._receiveMessageExpansion(e)})),R.forEach((function(e){S._processRSMsg(e)})),this._letterbox.setInboxTime(h,this.currentUserId),this._letterbox.setOutboxTime(f,this.currentUserId),this._letterbox.setBroadcastSyncTime(_,this.currentUserId),this._sendMessageStore.removeByTimestamp(f),C=this._pullQueue.filter((function(e){return e>h})),this._pullQueue.length=0,(y=this._pullQueue).push.apply(y,C),l&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this._watcher.pullFinished()),this.logger.info(Re.L_PULL_MSG_R,JSON.stringify({code:a,messageUIds:E.join(","),timestamp:this._latestSyncTimestamp,hasmore:!l,tmpPullQueue:C}),o),!l)return this._syncMsg(),[2];this._pullQueue.length>0&&(this._pullQueue.length=0,this._syncMsg())}catch(e){this.logger.error(Re.L_PULL_MSG_E,null==e?void 0:e.stack,o)}return[2]}}))}))},t.prototype._receiveMsg=function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.data,cs,{currentUserId:this.currentUserId,connectedTime:this._connMgr.getConnectedTime()}),n=(t=this._handleMsgProperties(t)).conversationType,r=t.messageType,i=t.senderUserId,o=t.messageUId,s=t.sentTime,a=t.isStatusMessage;if(this.logger.info(Re.L_RECV_S_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),this._writeMessagesLog(n,o)&&this.statisticLog.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:o})),n!==oe.RTC_ROOM&&r!==ce.INTERCEPT){if(this._pullingMsg)return;if(this._pullQueue.length>0)return void this._syncMsg()}i===this.currentUserId&&this._sendMessageStore.setMessage(o,s),a||i===this.currentUserId||this._letterbox.setInboxTime(s,this.currentUserId),this._handleNotNotifyMsg(t)||(r===ce.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),r===ce.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._conversationManager.setConversationCacheByMessage(t,!0),this._batchMessage([t]))}},t.prototype._handleNotNotifyMsg=function(e){var t=e.messageType,n=e.senderUserId;return t===ce.DELIVERED||(t===ce.DELIVERED_MSG||(t===ce.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===ce.SYNC_READ_STATUS&&n!==this.currentUserId||t===ce.READ_STATE&&(this._processRSMsg(e),!0)))},t.prototype._handleMsgProperties=function(e,t){void 0===t&&(t=!1);var n,r=e.messageType,i=e.isStatusMessage,o=e.isCounted,s=void 0!==o&&o,a=e.isPersited,c=void 0!==a&&a,l=r in w,d=r in this._customMessageType;if(n=l?u(u({},w[r]),{isStatusMessage:G.includes(r)}):d?this._customMessageType[r]:{isCounted:s,isPersited:c,isStatusMessage:!1},Object.assign(e,n),t&&!Zt(i)&&(e.isStatusMessage=i),!t){var h=e.content.user;if(h){var p=h.portrait,_=h.portraitUri,g=p||_;g&&(h.portrait=h.portraitUri=g)}}return e},t.prototype._fixDownstreamData=function(e,t,n){return e&&2===t.list.length&&(t.hasMore=!0,0===n?t.list.shift():t.list.pop()),t},t.prototype.getHistoryMessage=function(e,t,n,r,i,o,s,a){var u;return void 0===o&&(o=""),l(this,void 0,void 0,(function(){var s,c,l,h,p,_,g,f,E,I,T,R=this;return d(this,(function(d){switch(d.label){case 0:return c=(s=this).currentUserId,l=s._connMgr,h=Zi[e]||Yi,p=1===r&&0===n,l?(_=l.codec.encodeGetHistoryMsg(t,{timestamp:n,count:p?2:r,order:i,channelId:o}),this.logger.info(Re.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:o,timestamp:n,count:r,order:i}),a),[4,l.send(new yo(h,_,c),Es,{currentUserId:c,connectedTime:l.getConnectedTime(),conversation:{targetId:t},afterDecode:function(n){var r,i=null===(r=R._readReceiptManager)||void 0===r?void 0:r.getReadReceiptInfo({conversationType:e,channelId:o,targetId:t},n.messageUId);if(i){var s=i.users;n.readReceiptInfo={isReceiptRequestMessage:!0,readerList:s}}return n}})]):[3,2];case 1:return g=d.sent(),f=g.code,E=g.data,f===re.SUCCESS&&E?(I=this._fixDownstreamData(p,E,i),T=[],null===(u=I.list)||void 0===u||u.forEach((function(e){e&&T.push(e.messageUId)})),this.logger.info(Re.L_GET_HISTORY_MSG_R,JSON.stringify({code:f,messageUIds:T.join(",")}),a),[2,{code:f,data:{list:I.list,hasMore:I.hasMore}}]):(this.logger.warn(Re.L_GET_HISTORY_MSG_R,JSON.stringify({code:f,messageUIds:""}),a),[2,{code:f}]);case 2:return[2,{code:re.RC_NET_CHANNEL_INVALID}]}}))}))},t.prototype.getMessages=function(e,t,n,r,i,o,s){return this.getHistoryMessage(e,t,n,r,i,o,s)},t.prototype.reportSDKInfo=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(Re.L_VER_REPORT_T,o,i),s=r.codec.encodeReportSDKInfo(o),a=new yo(No[No.reportsdk],s,n),[4,r.send(a)]):[2];case 1:return(u=c.sent().code)!==re.SUCCESS&&this.logger.warn(Re.L_VER_REPORT_R,u,i),[2]}}))}))},t.prototype.deleteRemoteMessage=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(o=(i=this).currentUserId,s=i._connMgr,a=s.codec.encodeDeleteMessages(e,t,n,r),u=Ai,e===oe.ULTRA_GROUP&&(u=Ni),c=new yo(u,a,o),[4,s.send(c)]):[2,re.RC_NET_UNAVAILABLE];case 1:return l=d.sent(),[2,l.code]}}))}))},t.prototype.deleteRemoteMessageByTimestamp=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(o=(i=this).currentUserId,s=i._connMgr,a=s.codec.encodeClearMessages(t,n,r,e),u=zi[e],c=new yo(u,a,o),[4,s.send(c)]):[2,re.RC_NET_UNAVAILABLE];case 1:return l=d.sent(),[2,l.code]}}))}))},t.prototype.batchClearRemoteHistoryMessages=function(e,t){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,i=r.codec.encodeBatchClearRemoteMessages(e),o=new yo(ki,i,n),[4,r.send(o)]):[2,re.RC_NET_UNAVAILABLE];case 1:return s=a.sent(),[2,s.code]}}))}))},t.prototype.getConversationList=function(e,t,n,r,i){return void 0===e&&(e=300),l(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,h,p=this;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(o=(i=this).currentUserId,s=i._connMgr,t=t||oe.PRIVATE,a=s.codec.encodeOldConversationList({count:e,type:t,startTime:n,order:r}),u=new yo(wi,a,o),[4,s.send(u,Ts,{currentUserId:o,connectedTime:s.getConnectedTime(),afterDecode:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=p._conversationManager.get(t,n,r);Object.assign(e,i);var o=p._conversationManager.getDraft(t,n,r);return e.draft=o,e}})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return c=d.sent(),l=c.code,h=c.data,l!==re.SUCCESS?[2,{code:l}]:[2,{code:l,data:null==h?void 0:h.list}]}}))}))},t.prototype.removeConversation=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=this._connMgr,i=r.codec.encodeRemoveOldConversationList({conversationType:e,channelId:n,targetId:t}),o=new yo(Vi,i,t),[4,r.send(o)]):[2,re.RC_NET_UNAVAILABLE];case 1:return s=a.sent(),[2,s.code]}}))}))},t.prototype.batchRemoveConversation=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i;return d(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=this._connMgr,n=t.codec.encodeBatchDeleteConversation(e),r=new yo(Gi,n,this.getCurrentUserId()),[4,t.send(r)]):[2,re.RC_NET_UNAVAILABLE];case 1:return i=o.sent(),[2,i.code]}}))}))},t.prototype.getConversation=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return e!==oe.ULTRA_GROUP?[3,1]:(r=this._ultraGroupMap[n+"_"+t])?[3,3]:[2,{code:re.CONVER_GET_ERROR}];case 1:return(i=this._conversationManager.get(e,t,n))?[4,this.getHistoryMessage(e,t,0,1,0)]:[2,{code:re.CONVER_GET_ERROR}];case 2:if(o=l.sent(),s=o.code,a=o.data,s!==re.SUCCESS)return[2,{code:re.CONVER_GET_ERROR}];u=this._conversationManager.getDraft(e,t,n),c=(null==a?void 0:a.list[0])||null,r={conversationType:e,targetId:t,channelId:n,unreadMessageCount:i.unreadMessageCount||0,latestMessage:c,notificationStatus:i.notificationStatus||de.CLOSE,notificationLevel:i.notificationLevel||pe.NOT_SET,isTop:i.isTop||!1,lastUnreadTime:i.lastUnreadTime||0,unreadMentionedCount:i.unreadMentionedCount||0,draft:u},l.label=3;case 3:return[2,{code:re.SUCCESS,data:r}]}}))}))},t.prototype.getAllConversationUnreadCount=function(e,t,n){var r=this._conversationManager.getAllUnreadCount(e,t,n);return Promise.resolve({code:re.SUCCESS,data:r})},t.prototype.getTotalUnreadCountByLevels=function(e,t,n){void 0===n&&(n=!1);var r=0;if(e.includes(oe.ULTRA_GROUP)){if(!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});for(var i in this._ultraGroupMap){var o=this._ultraGroupMap[i];(0===t.length||t.includes(o.notificationLevel))&&(r+=n?o.unreadMentionedCount:o.unreadMessageCount)}}return r+=this._conversationManager.getTotalUnreadCountByLevels(e,t,n),Promise.resolve({code:re.SUCCESS,data:r})},t.prototype.getConversationUnreadCount=function(e,t,n){var r,i;return e===oe.ULTRA_GROUP?(i=(null===(r=this._ultraGroupMap[n+"_"+t])||void 0===r?void 0:r.unreadMessageCount)||0,i=this._getUnreadCount(i)):i=this._conversationManager.getUnreadCount(e,t,n),Promise.resolve({code:re.SUCCESS,data:i})},t.prototype.clearConversationUnreadCount=function(e,t,n){return this._conversationManager.clearUnreadCount(e,t,n,this.getServerTime(),!1),Promise.resolve(re.SUCCESS)},t.prototype.clearAllUnreadCount=function(){return this._conversationManager.clearAllUnreadCount(),Promise.resolve(re.SUCCESS)},t.prototype.getFirstUnreadMessage=function(e,t){throw new Error("Method not implemented.")},t.prototype.getFirstUnreadMessageInfo=function(e,t,n){var r=this._conversationManager.get(e,t,n),i=r.firstUnreadMessageUid,o=r.firstUnreadTime;return Promise.resolve({code:re.SUCCESS,data:o&&i?{messageUId:i,sentTime:o}:null})},t.prototype.saveConversationMessageDraft=function(e,t,n,r){return this._conversationManager.setDraft(e,t,n,r),Promise.resolve(re.SUCCESS)},t.prototype.getConversationMessageDraft=function(e,t,n){var r=this._conversationManager.getDraft(e,t,n);return Promise.resolve({code:re.SUCCESS,data:r})},t.prototype.clearConversationMessageDraft=function(e,t,n){return this._conversationManager.clearDraft(e,t,n),Promise.resolve(re.SUCCESS)},t.prototype.pullConversationStatus=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,l=this;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(n=(t=this)._connMgr,r=t.currentUserId,i=n.codec.encodeGetConversationStatus(e),o=new yo(No[No.pullSeAtts],i,r),[4,n.send(o,na)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return s=d.sent(),a=s.code,u=s.data,this.logger.info(Re.L_PULL_CONVERSATION_S,JSON.stringify({timestamp:e,userId:r})),a!==re.SUCCESS?[2,{code:a}]:(c=[],Array.isArray(u)&&u.forEach((function(e){var t=e.conversationType,n=e.updatedTime;n&&l._conversationManager.setConversationUpdatedTime(n),t===oe.ULTRA_GROUP?l._setUltraConversationStatus(e):c.push(e)})),[2,{code:a,data:c}])}}))}))},t.prototype._setUltraConversationStatus=function(e){var t=e.targetId,n=e.notificationStatus,r=e.notificationLevel,i=e.channelId,o=e.isTop,s=e.conversationType;if(""!==t||void 0===r){var a=this._ultraGroupMap[i+"_"+t];return a&&void 0!==r&&(a.notificationLevel=r,this._ultraGroupManager.addUltraGroupStatus(a)),a&&void 0!==n&&(a.notificationStatus=n,this._ultraGroupManager.addUltraGroupStatus(a)),a&&void 0!==o&&(a.isTop=o),a}this._ultraGroupManager.addUltraGroupStatus({conversationType:s,targetId:"",channelId:"",notificationLevel:r})},t.prototype.batchSetConversationStatus=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i=this;return d(this,(function(o){switch(o.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,[4,this._conversationManager.pushTask((function(t){return l(i,void 0,void 0,(function(){var i,o,s,a,c,l,h,p,_=this;return d(this,(function(d){switch(d.label){case 0:return i=r.codec.encodeSetConversationStatus(e,t),o=new yo(Bi,i,n),[4,r.send(o,sa)];case 1:return s=d.sent(),a=s.code,c=s.data,a!==re.SUCCESS?[2,{code:a}]:(l=c,this._conversationManager.setConversationUpdatedTime(l.version),h=[],e.forEach((function(e){if(e.conversationType!==oe.ULTRA_GROUP)_._conversationManager.addStatus(u(u({},e),{updatedTime:l.version}),!0);else{var t=_._setUltraConversationStatus(e);t&&h.push(t)}})),h.length>0&&(p=Cr(h),p=Jl(p),this._watcher.conversation(p)),[2,{code:a}])}}))}))}))]):[2,re.RC_NET_UNAVAILABLE];case 1:return[2,o.sent().code]}}))}))},t.prototype.batchSetConversationToTop=function(e,t,n){return l(this,void 0,void 0,(function(){return d(this,(function(n){return[2,this.batchSetConversationStatus(e.map((function(e){return u(u({},e),{isTop:t})})))]}))}))},t.prototype.setConversationNotificationLevel=function(e,t,n,r){return void 0===r&&(r=""),l(this,void 0,void 0,(function(){return d(this,(function(i){return[2,this.batchSetConversationStatus([{conversationType:e,targetId:t,notificationLevel:n,channelId:r}])]}))}))},t.prototype.batchSetConversationNotificationLevel=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return[2,this.batchSetConversationStatus(e.map((function(e){return u(u({},e),{notificationLevel:t})})))]}))}))},t.prototype._joinChrm=function(e,t,n,r,i){return l(this,void 0,void 0,(function(){var o,s,a,u,c,l,h,p,_,g,f,E,I,T,R,v;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(o=this._connMgr,s=o.codec.encodeJoinOrQuitChatRoom(r),u=new yo(a=n?Mi:Oi,s,e),this.logger.info(Re.L_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,topic:a}),i),[4,o.send(u,Ps)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return c=d.sent(),l=c.code,h=c.data,p=l===re.SUCCESS?"info":"warn",this.logger[p](Re.L_JOIN_CHATROOM_R,JSON.stringify({code:l,timestamp:(new Date).getTime()}),i),l===re.SUCCESS?(g=(_=h).joinTime,f=_.createTime,E=_.memberCount,I=_.isAllChatroomBanned,T=_.isCurrentUserBanned,R=_.isCurrentChatroomBanned,v=_.isCurrentChatroomInWhitelist,this._chrmsQueue[e]||(this._chrmsQueue[e]={pulling:!1,queue:[],timestamp:0}),this._pullChrmMsg(e,t,g),this.getNaviInfoFromCache().kvStorage&&this._chrmEntryHandler.pullEntry(e,0),this._joinedChrmManager.set(e,t,r),this._startSyncIntervalForChrmPull(),[2,{code:l,data:{joinTime:g,createTime:f,memberCount:E,isAllChatroomBanned:I,isCurrentUserBanned:T,isCurrentChatroomBanned:R,isCurrentChatroomInWhitelist:v}}]):[2,{code:l}]}}))}))},t.prototype._rejoinChrm=function(){return l(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a,c,l,h,p,_,g;return d(this,(function(d){switch(d.label){case 0:for(n in e=this._joinedChrmManager.get(),t=[],e)t.push(n);r=0,d.label=1;case 1:return r<t.length?(i=t[r],o=e[i],s=o.count,a=void 0===s?10:s,c=o.extra,this.logger.info(Re.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:i,count:a,extra:c,topic:Mi})),l=this.logger.createTraceId(),[4,this._joinChrm(i,a,!0,c,l)]):[3,4];case 2:if(h=d.sent(),p=h.code,_=h.data,g=p===re.SUCCESS?"info":"warn",this.logger[g](Re.L_REJOIN_CHATROOM_R,JSON.stringify({code:p,timestamp:(new Date).getTime()}),l),p===re.SUCCESS)return this._watcher.chatroom({rejoinedRoom:u({chatroomId:i,count:a},_)}),[2];p===re.RC_CHATROOM_USER_KICKED&&(this._joinedChrmManager.remove(i),delete this._chrmsQueue[i]),this._watcher.chatroom({rejoinedRoom:{chatroomId:i,errorCode:p}}),d.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))},t.prototype._pullChrmMsg=function(e,t,n){return void 0===t&&(t=10),void 0===n&&(n=0),l(this,void 0,void 0,(function(){var r,i,o,s,a,u,c,l,h,p,_,g,f,E,I=this;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(r=this._chrmsQueue[e],i=r.pulling,o=r.timestamp,i?[2]:(r.pulling=!0,s=this._connMgr.codec.encodeChrmSyncMsg(n?0:o,t),a=new yo(No[No.chrmPull],s,e),this.logger.info(Re.L_PULL_CHATROOM_MSG_T,JSON.stringify({chatroomId:e,timestamp:o})),[4,this._connMgr.send(a,ls,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})])):[2];case 1:return u=d.sent(),c=u.code,l=u.data,r.pulling=!1,c===re.SUCCESS&&l?(h=l.list,p=l.syncTime,_=l.finished,r.timestamp=n?Math.max(p,n):p,r.queue=r.queue.filter((function(e){return e>p})),g=[],f=[],E=[],h.forEach((function(e){e.sentTime<o||(e.sentTime>=I._connMgr.getConnectedTime()&&I._writeMessagesLog(oe.CHATROOM,e.messageUId)&&f.push(e.messageUId),g.push(e.messageUId),E.push(e))})),this._batchMessage(E),this.logger.info(Re.L_PULL_CHATROOM_MSG_R,JSON.stringify({code:c,timestamp:o,messageUIds:g.join(",")})),f.length>0&&this.statisticLog.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:f.join(",")})),_?(r.queue.length>0&&(r.queue.length=0,this._pullChrmMsg(e)),[2]):(this._pullChrmMsg(e),[2])):(this.logger.warn(Re.L_PULL_CHATROOM_MSG_R,JSON.stringify({code:c,timestamp:o,messageUIds:""})),[2])}}))}))},t.prototype.joinChatroom=function(e,t,n,r){return l(this,void 0,void 0,(function(){return d(this,(function(i){switch(i.label){case 0:return[4,this._joinChrm(e,t,!1,n,r)];case 1:return[2,i.sent().code]}}))}))},t.prototype.joinExistChatroom=function(e,t,n,r){return l(this,void 0,void 0,(function(){return d(this,(function(i){return[2,this._joinChrm(e,t,!0,n,r)]}))}))},t.prototype.quitChatroom=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._connMgr,n=t.codec.encodeJoinOrQuitChatRoom(),r=new yo(Ui,n,e),[4,t.send(r)]):[2,re.RC_NET_UNAVAILABLE];case 1:return i=s.sent(),(o=i.code)===re.SUCCESS&&(delete this._chrmsQueue[e],this._chrmEntryHandler.reset(e),this._joinedChrmManager.remove(e)),[2,o]}}))}))},t.prototype.getChatroomInfo=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return this._isConnected?(r=this._connMgr,i=r.codec.encodeGetChatRoomInfo(t,n),o=new yo(No[No.queryChrmI],i,e),[4,r.send(o,Ds)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return s=c.sent(),a=s.code,u=s.data,a!==re.SUCCESS?[2,{code:a}]:[2,{code:a,data:u}]}}))}))},t.prototype.getChatroomHistoryMessages=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return this._isConnected?(i=this._connMgr,o=i.codec.encodeGetHistoryMsg(e,{timestamp:t,count:n,order:r}),s=new yo(Ki,o,e),[4,i.send(s,Es,{conversation:{targetId:e}})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return a=l.sent(),u=a.code,c=a.data,u!==re.SUCCESS?[2,{code:u}]:[2,{code:u,data:{list:c.list,hasMore:c.hasMore}}]}}))}))},t.prototype._modifyChatroomKV=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,o=this._chrmEntryHandler.getVersion(e,t.key),t.version=null==o?this.getServerTime():o,s=r.codec.encodeModifyChatRoomKV(e,t,i),a=t.type===ye.UPDATE?Li:Pi,u=new yo(a,s,e),[4,r.send(u,Ps)]):[2,re.RC_NET_UNAVAILABLE];case 1:return c=d.sent(),(l=c.code)===re.SUCCESS?(this._chrmEntryHandler.setLocal(e,{kvEntries:[t],syncTime:this.getServerTime()},i),[2,l]):[2,l]}}))}))},t.prototype._chatroomKVStoreNotAllSuccess=function(e,t){var n=t.data,r=e;return n&&Array.isArray(n.errorKeys)&&n.errorKeys.forEach((function(e){var t=r.findIndex((function(t){return e.key===t.key}));-1!==t&&r.splice(t,1)})),r},t.prototype._modifyChatroomKVS=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,l,h,p,_,g,f=this;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,t.entries.forEach((function(t){var n=f._chrmEntryHandler.getVersion(e,t.key);t.version=null==n?f.getServerTime():n})),o=r.codec.encodeModifyChatRoomKVS(e,t,i),s=t.type===ye.UPDATE?bi:Di,a=new yo(s,o,e),[4,r.send(a,js)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return c=d.sent(),l=c.code,-1!==[re.SUCCESS,re.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(l)&&(p=[],delete(_=u({},t)).entries,t.entries.forEach((function(e){p.push(u(u({},e),_))})),l===re.CHATROOM_KV_STORE_NOT_ALL_SUCCESS&&(g=c.data,h=g.errorKeys,p=this._chatroomKVStoreNotAllSuccess(p,c)),this._chrmEntryHandler.setLocal(e,{kvEntries:p,syncTime:(new Date).getTime()},i)),[2,{code:l,data:h}]}}))}))},t.prototype.setChatroomEntry=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return t.type=ye.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},t.prototype.setChatroomEntries=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return t.type=ye.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))},t.prototype.forceSetChatroomEntry=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return t.type=ye.UPDATE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},t.prototype.removeChatroomEntry=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return t.type=ye.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},t.prototype.removeChatroomEntries=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return t.type=ye.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))},t.prototype.forceRemoveChatroomEntry=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return t.type=ye.DELETE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},t.prototype.getChatroomEntry=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return(n=this._chrmEntryHandler.getValue(e,t))?[2,{code:re.SUCCESS,data:n}]:this._isConnected?(r=this._connMgr,i=r.codec.encodePullChatRoomKV(0),o=new yo(No[No.pullKV],i,e),[4,r.send(o,Ks)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return s=c.sent(),(a=s.data)&&a.kvEntries&&a.kvEntries.length&&(u=a.kvEntries.find((function(e){return e.key===t})),void 0!==u)?[2,{code:re.SUCCESS,data:null==u?void 0:u.value}]:[2,{code:re.CHATROOM_KEY_NOT_EXIST}]}}))}))},t.prototype.getAllChatroomEntry=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return(t=this._chrmEntryHandler.getAll(e))&&Object.keys(t).length?[2,{code:re.SUCCESS,data:t}]:this._isConnected?(n=this._connMgr,t={},r=n.codec.encodePullChatRoomKV(0),i=new yo(No[No.pullKV],r,e),[4,n.send(i,Ks)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return o=a.sent(),(s=o.data)&&s.kvEntries&&s.kvEntries.length&&s.kvEntries.forEach((function(e){e.key&&(t[e.key]=e.value||"")})),[2,{code:re.SUCCESS,data:t}]}}))}))},t.prototype.pullChatroomEntry=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l,h,p,_=this;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,o=r.codec.encodePullChatRoomKV(t),s=new yo(No[No.pullKV],o,e),this.logger.info(Re.L_PULL_CHATROOM_KV_T,JSON.stringify({chatroomId:e,timestamp:t})),[4,r.send(s,Ks)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return a=d.sent(),u=a.code,c=a.data,l=u===re.SUCCESS?"info":"warn",this.logger[l](Re.L_PULL_CHATROOM_KV_R,JSON.stringify({code:u,timestamp:t})),u===re.SUCCESS&&c?(h=c.kvEntries,p=[],h.length>0&&(h.forEach((function(t){var n=t.key,r=t.value,i=t.type,o=t.timestamp,s=t.userId;_._chrmEntryHandler.getValue(e,n)===r&&s===_.getCurrentUserId()||p.push({key:n,value:r,type:i,timestamp:o,chatroomId:e})})),this._chrmEntryHandler.setLocal(e,c,i),p.length>0&&this._watcher.chatroom({updatedEntries:p})),[2,{code:u,data:c}]):[2,{code:u}]}}))}))},t.prototype._startSyncIntervalForChrmPull=function(){var e=this;this._stopSyncIntervalForChrmPull(),this._intervalTimerForChrmPull=setInterval((function(){var t=Object.keys(e._chrmsQueue);0!==t.length&&e._isConnected?t.forEach((function(t){e._pullChrmMsg(t),e.getNaviInfoFromCache().kvStorage&&e._chrmEntryHandler.pullEntry(t,0)})):e._stopSyncIntervalForChrmPull()}),M)},t.prototype._stopSyncIntervalForChrmPull=function(){"number"!=typeof this._intervalTimerForChrmPull&&(clearInterval(this._intervalTimerForChrmPull),this._intervalTimerForChrmPull=-1)},t.prototype._writeMessagesLog=function(e,t){var n,r=null===(n=this.cloudController)||void 0===n?void 0:n.getMRTRConfig();if(!r)return!1;var i=ir(t),o=0;switch(e){case oe.PRIVATE:o=r.private;break;case oe.GROUP:o=r.group;break;case oe.CHATROOM:o=r.chatroom;break;case oe.ULTRA_GROUP:o=r.ultraGroup}return!!o&&i%(1/o)==0},t.prototype.sendMessage=function(e,t,n,r,i){var o;return l(this,void 0,void 0,(function(){var s,a,c,l,h,p,_,g,f,E,I,T;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(n=this._handleInnerMsgOptions(e,t,n),n=this._handleMsgProperties(n,!0),s=!1,[oe.PRIVATE,oe.GROUP].includes(e)&&(n.isStatusMessage||(null===(o=this._customMessageType[n.messageType])||void 0===o?void 0:o.isStatusMessage))&&(s=!0),a=s?function(e){var t;return(t={},t[oe.PRIVATE]=No.ppMsgS,t[oe.GROUP]=No.pgMsgS,t)[e]}(e):function(e){var t;return(t={},t[oe.PRIVATE]=No.ppMsgP,t[oe.GROUP]=No.pgMsgP,t[oe.CHATROOM]=No.chatMsg,t[oe.CUSTOMER_SERVICE]=No.pcMsgP,t[oe.RTC_ROOM]=No.prMsgS,t[oe.SYSTEM]=No.pbMsgP,t)[e]}(e)||No.ppMsgP,s&&(n.isPersited=!1,n.isCounted=!1),c=n.messageId?n.messageId:er(),n.messageId=c,l=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},n),(h=new Ro(No[a],l,e===oe.SYSTEM?this.currentUserId:t)).setHeaderQos(hi.AT_LEAST_ONCE),s?(this._connMgr.sendOnly(h),[2,{code:re.SUCCESS,data:Wl(e,t,u({},n),"",0,this.currentUserId,c)}]):(p=this._connMgr.getCrtServerTime(),_=Wl(e,t,u(u({},n),{isStatusMessage:s}),"",p,this.currentUserId,c),null==r||r(c),this.logger.info(Re.L_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e,targetId:t,channelId:n.channelId}),i),g=Date.now(),[4,this._connMgr.send(h)])):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return f=d.sent(),E=f.code,I=f.data,E!==re.SUCCESS?(this.logger.warn(Re.L_SEND_MSG_R,JSON.stringify({code:E,messageUId:_.messageUId,messageId:_.messageId}),i),this._writeMessagesLog(e)&&this.statisticLog.record(ve.IM_MSG_SEND,JSON.stringify({channel:e,start_ts:g,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:E})),_.sentStatus=Me.FAILED,[2,{code:E,data:_}]):(this.logger.info(Re.L_SEND_MSG_R,JSON.stringify({code:E,messageUId:null==I?void 0:I.messageUId,messageId:null==I?void 0:I.messageId}),i),T=I,this._sendMessageSuccessHandle(_,T),this._writeMessagesLog(e,T.messageUId)&&this.statisticLog.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:T.messageUId,channel:e,start_ts:g,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:E})),[2,{code:re.SUCCESS,data:_}])}}))}))},t.prototype._sendMessageSuccessHandle=function(e,t){var n,r=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._conversationManager.setConversationCacheByMessage(e,!0);var i=e.messageType,o=e.conversationType,s=e.targetId,a=e.channelId,u=e.sentTime,c=e.content,l=e.messageDirection;if(i===ce.READ_RECEIPT_REQUEST){var d=c.messageUId;null===(n=this._readReceiptManager)||void 0===n||n.insert({conversationType:o,targetId:s,channelId:a},d,l,u)}if(i===ce.READ_RECEIPT_RESPONSE){var h=c.receiptMessageDic;if(!h)return;for(var p in h)h[p].forEach((function(e){var t;null===(t=r._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:s,channelId:a},e)}))}},t.prototype.recallMsg=function(e,t,n,r,i){var o;return l(this,void 0,void 0,(function(){var s,a,c,l,h,p,_,g,f,E,I,T,R,v,C;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(s=i.user,a=i.extra,c=i.isDelete,l=i.directionalUserIdList,h={conversationType:e,targetId:t,messageUId:n,sentTime:r,channelId:i.channelId||"",isDelete:c||!1},s&&(h.user=s),a&&(h.extra=a),p={content:h,messageType:"RC:RcCmd",disableNotification:null==i?void 0:i.disableNotification,pushConfig:null==i?void 0:i.pushConfig,pushContent:(null===(o=i.pushConfig)||void 0===o?void 0:o.pushContent)||i.pushContent||"",channelId:i.channelId},[oe.GROUP,oe.ULTRA_GROUP].includes(e)&&l&&(p.directionalUserIdList=l),_=No[No.recallMsg],g=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},p),(f=new Ro(_,g,this.currentUserId)).setHeaderQos(hi.AT_LEAST_ONCE),[4,this._connMgr.send(f)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return E=d.sent(),I=E.code,T=E.data,e===oe.ULTRA_GROUP&&this.logger.debug(Re.L_RECALL_ULTRA_MSG_S,JSON.stringify({code:I,conversationType:e,targetId:t,channelId:i.channelId})),I!==re.SUCCESS?[2,{code:I}]:(R=T,e===oe.ULTRA_GROUP?(this._ultraMsgMap[R.messageUId]=R.timestamp,this._updateUltraGroupWhenRecallMsg(t,i.channelId||"",n),[2,{code:re.SUCCESS}]):(v="Cmd:"+n,this._sendMessageStore.setMessage(v,R.timestamp),C=Wl(e,t,u(u({},p),{isPersited:!0}),R.messageUId,R.timestamp,this.currentUserId),this._conversationManager.setConversationCacheByMessage(C,!0),[2,{code:re.SUCCESS,data:C}]))}}))}))},t.prototype.sendReadReceiptMessage=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){return this._isConnected?(r=this._connMgr.codec.encodeReadReceipt(t,n),i=new yo(No[No.rrMsg],r,e),[2,this._connMgr.send(i)]):[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.getMessageReader=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){return this._isConnected?(r=this._connMgr.codec.encodeMessageReader(t,n),i=new yo(No[No.rrList],r,e),[2,this._connMgr.send(i,fa)]):[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.sendReadReceiptMessageV4=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){return r=this._connMgr.codec.encodeReadReceiptMsg(e,t,n),i=new Ro(No[No.sendMsgRead],r,e.targetId),[2,this._connMgr.send(i)]}))}))},t.prototype.getMessageReadReceiptV4=function(e,t){return l(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){return n=this._connMgr.codec.encodeReceiptQryReq(e,t),r=new yo(No[No.qryMsgRead],n,e.targetId),[2,this._connMgr.send(r,Qa)]}))}))},t.prototype.batchGetMessageReadReceiptInfoV4=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a;return d(this,(function(c){switch(c.label){case 0:return n=this._connMgr.codec.encodeReceiptCntQryReq(e,t),r=new yo(No[No.qryMsgReadCntBatch],n,e.targetId),[4,this._connMgr.send(r,Xa)];case 1:return i=c.sent(),o=i.code,s=i.data,a=(s||{result:[]}).result,o===re.SUCCESS&&a?[2,{code:o,data:a.map((function(t){return u({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}]:[2,{code:o}]}}))}))},t.prototype.updateConversationReadTime=function(e,t){return l(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){return n=this._connMgr.codec.encodeSessionMsgReadInput(e,t),r=new Ro(No[No.updRTime],n,this.currentUserId),[2,this._connMgr.send(r)]}))}))},t.prototype.pullUserSettings=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodePullUserSetting(e),n=new yo(No[No.pullUS],t,this.currentUserId),[4,this._connMgr.send(n,$s)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return r=s.sent(),i=r.code,o=r.data,i===re.SUCCESS&&this._naviChangeHandler(o),[2,{code:i,data:o}]}}))}))},t.prototype._naviChangeHandler=function(e){var t;if(e){var n=e.settings,r=null===(t=null==n?void 0:n.VoipInfo)||void 0===t?void 0:t.value;if(r){var i=this._connMgr.getToken();this.navi.updateVoipCallInfo(i,r);var o=this.navi.getNaviInfoFromCache(i);this._watcher.onNaviDataChange(u({},o))}}else this.logger.warn(Re.L_NOTIFY_NAVI_CHANGE_E,JSON.stringify({data:e}))},t.prototype.getFileToken=function(e,t,n,r,i,o){return l(this,void 0,void 0,(function(){var s,a,c,l,h,p,_,g,f,E;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(s=r&&"uploads"!==r?t||"":Wn(e,t),a=this.getNaviInfoFromCache(),c=ur(a,this.logger),l="",c||(l=JSON.stringify({uploadDomain:c})),o=o?Math.ceil(o):0,h=this._connMgr.codec.encodeGetFileToken(e,s,n||"",r||"",i||"",l,o),p=new yo(No[No.qnTkn],h,this.currentUserId),[4,this._connMgr.send(p,Vs)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return _=d.sent(),g=_.code,f=_.data,g!==re.SUCCESS?[2,{code:g}]:(E=u(u({},f),{fileName:s,downloadAuthInfo:f.downloadAuthInfo?JSON.parse(f.downloadAuthInfo):null}),[2,{code:g,data:E}])}}))}))},t.prototype.getFileUrl=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,h,p,_,g;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(i="","","",a="",u="",o=Bs,s=ks,t===Ee.QINIU?i=No[No.qnUrl]:t===Ee.AWS?i=No[No.s3Url]:t===Ee.STC?i=No[No.stcUrl]:t===Ee.MINIO?(i=No[No.minioUrl],a=ur(this.getNaviInfoFromCache(),this.logger),u=JSON.stringify({url:a})):i=No[No.aliUrl],c=this._connMgr.codec.encodeGetFileUrl(o,e,n,r,u,-1),l=new yo(i,c,this.currentUserId),[4,this._connMgr.send(l,s)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return h=d.sent(),p=h.code,_=h.data,g=_,p===re.SUCCESS?[2,{code:p,data:g}]:[2,{code:p}]}}))}))},t.prototype.disconnect=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect()];case 1:return e.sent(),this._resetMemoryState(),[2]}}))}))},t.prototype._resetMemoryState=function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._pullQueue.length=0,this._stopSyncInterval(),this.resetUltraGroupData(),this._joinedChrmManager&&(this._joinedChrmManager.clear(),delete this._joinedChrmManager),this._conversationManager&&delete this._conversationManager,this._ultraGroupManager&&delete this._ultraGroupManager,this._userSettingManager&&delete this._userSettingManager,this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager,this._chrmsQueue={}},t.prototype.resetUltraGroupData=function(){this._stopUltraSyncInterval(),this._lastSyncUltraMsgTimeStamp=0,this._lastSyncUltraMsgLocalTimeStamp=0,this._isUltraPulling=!1,this._ultraGroupTimeQue=[],this._isUltraGroupListExist=!1,this._ultraGroupMap={}},t.prototype.registerMessageType=function(e,t,n,r,i){this._customMessageType[e]={isPersited:t,isCounted:n,isStatusMessage:i}},t.prototype.getServerTime=function(){return this._connMgr.getCrtServerTime()},t.prototype.getCurrentUserId=function(){return this.currentUserId},t.prototype.createTag=function(e){return l(this,void 0,void 0,(function(){var t=this;return d(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return l(t,void 0,void 0,(function(){var t,r,i,o,s,a;return d(this,(function(c){switch(c.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],n),r=new yo(No[No.addSeTag],t,this.currentUserId),[4,this._connMgr.send(r,Zs)];case 1:return i=c.sent(),o=i.code,s=i.data,o===re.SUCCESS&&s&&(a=s.version,this._userSettingManager.addTag([u(u({},e),{createdTime:a})],a)),[2,{code:o}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.removeTag=function(e){return l(this,void 0,void 0,(function(){var t=this;return d(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return l(t,void 0,void 0,(function(){var t,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeRemoveTag([e],n),r=new yo(No[No.delSeTag],t,this.currentUserId),[4,this._connMgr.send(r,Zs)];case 1:return i=u.sent(),o=i.code,s=i.data,o===re.SUCCESS&&s&&(a=s.version,this._userSettingManager.deleteTag([e],a)),[2,{code:o}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.updateTag=function(e){return l(this,void 0,void 0,(function(){var t=this;return d(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return l(t,void 0,void 0,(function(){var t,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],n),r=new yo(No[No.addSeTag],t,this.currentUserId),[4,this._connMgr.send(r,Zs)];case 1:return i=u.sent(),o=i.code,s=i.data,o===re.SUCCESS&&(a=s.version,this._userSettingManager.addTag([e],a)),[2,{code:o}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.getTagList=function(){return l(this,void 0,void 0,(function(){var e,t;return d(this,(function(n){return e=this._userSettingManager.getTags(),t=this._conversationManager.getConversationListForTag(),e.forEach((function(e){e.conversationCount=t[e.tagId]?t[e.tagId].length:0})),[2,{code:re.SUCCESS,data:e}]}))}))},t.prototype.addTagForConversations=function(e,t){return l(this,void 0,void 0,(function(){var n=this;return d(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return l(n,void 0,void 0,(function(){var n,i,o,s,a,u,c=this;return d(this,(function(l){switch(l.label){case 0:return this._userSettingManager.getTagById(e)?(n=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,r),i=new yo(No[No.addTag],n,this.currentUserId),[4,this._connMgr.send(i,sa)]):[2,{code:re.TAG_NOT_EXIST}];case 1:return o=l.sent(),s=o.code,a=o.data,s===re.SUCCESS&&a&&((u={})[e]={},t.forEach((function(e){c._conversationManager.addTagStatus(e.conversationType,e.targetId,u,e.channelId)})),this._conversationManager.setConversationUpdatedTime(a.version)),[2,{code:s}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.removeTagForConversations=function(e,t){return l(this,void 0,void 0,(function(){var n=this;return d(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return l(n,void 0,void 0,(function(){var n,i,o,s,a,u=this;return d(this,(function(c){switch(c.label){case 0:return n=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,r),i=new yo(No[No.delTag],n,this.currentUserId),[4,this._connMgr.send(i,sa)];case 1:return o=c.sent(),s=o.code,a=o.data,s===re.SUCCESS&&a&&(t.forEach((function(t){u._conversationManager.deleteTagStatus(t.conversationType,t.targetId,[e],t.channelId)})),this._conversationManager.setConversationUpdatedTime(a.version)),[2,{code:s}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.removeTagsForConversation=function(e,t){return l(this,void 0,void 0,(function(){var n=this;return d(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return l(n,void 0,void 0,(function(){var n,i,o,s,a,u,c,l,h;return d(this,(function(d){switch(d.label){case 0:return n=e.conversationType,i=e.targetId,o=e.channelId,s=t.map((function(e){return{tagId:e}})),a=this._connMgr.codec.encodeUpdateConversationTag(s,[e],r),u=new yo(No[No.delTag],a,this.currentUserId),[4,this._connMgr.send(u,sa)];case 1:return c=d.sent(),l=c.code,h=c.data,l===re.SUCCESS&&h&&(this._conversationManager.deleteTagStatus(n,i,t,o),this._conversationManager.setConversationUpdatedTime(h.version)),[2,{code:l}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.getConversationListByTag=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a,u,c,l,h;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(i=(r=this).currentUserId,o=r._connMgr,s=o.codec.encodeOldConversationList({count:n,type:oe.PRIVATE,startTime:t}),a=new yo(wi,s,i),[4,o.send(a,Ts,{currentUserId:i,connectedTime:o.getConnectedTime()})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return u=d.sent(),c=u.code,l=u.data,c!==re.SUCCESS?[2,{code:c}]:(h=this._conversationHasTagFilter(e,null==l?void 0:l.list),[2,{code:c,data:h}])}}))}))},t.prototype._conversationHasTagFilter=function(e,t){var n=this,r=[],i=[];function o(e,t){return e.latestMessage&&t.latestMessage?e.latestMessage.sentTime-t.latestMessage.sentTime:0}return t.forEach((function(t){var o=t.conversationType,s=t.targetId,a=t.channelId,c=n._conversationManager.get(o,s,a),l=c.hasMentioned,d=c.mentionedInfo,h=c.lastUnreadTime,p=c.notificationStatus,_=c.isTop,g=c.tags,f=c.unreadMessageCount,E=g&&g[e];if(E){var I=u(u({},t),{hasMentioned:l,mentionedInfo:d,lastUnreadTime:h,notificationStatus:p,isTop:_,unreadMessageCount:f});E.isTop?r.push(u(u({},I),{isTopInTag:!0})):i.push(u(u({},I),{isTopInTag:!1}))}})),r.sort(o),i.sort(o),h(h([],r,!0),i,!0)},t.prototype.getUnreadCountByTag=function(e,t){return l(this,void 0,void 0,(function(){var n;return d(this,(function(r){return this._isConnected?(n=this._conversationManager.getUnreadCountByTag(e,t),[2,{code:re.SUCCESS,data:n}]):[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.setConversationStatusInTag=function(e,t,n){return l(this,void 0,void 0,(function(){var r=this;return d(this,(function(i){return this._isConnected?[2,this._conversationManager.pushTask((function(i){return l(r,void 0,void 0,(function(){var r,o,s,a,u,c,l,h,p,_,g,f;return d(this,(function(d){switch(d.label){case 0:return r=t.targetId,o=t.conversationType,s=t.channelId,a=n.isTop,u=[{tagId:e,isTop:a}],(c=this._conversationManager.get(o,r,s)).tags&&Object.hasOwnProperty.call(c.tags,e)?(l=this._connMgr.codec.encodeUpdateConversationTag(u,[t],i),h=new yo(No[No.addTag],l,this.currentUserId),[4,this._connMgr.send(h,sa)]):[2,{code:re.NO_TAG_IN_CONVER}];case 1:return p=d.sent(),_=p.code,g=p.data,_===re.SUCCESS&&g&&((f={})[e]={},a&&(f[e].isTop=!0),this._conversationManager.addTagStatus(o,r,f,s),this._conversationManager.setConversationUpdatedTime(g.version)),[2,{code:_}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.getTagsForConversation=function(e){var t;return l(this,void 0,void 0,(function(){var n,r,i,o;return d(this,(function(s){if(!this._isConnected)return[2,{code:re.RC_NET_UNAVAILABLE}];if(n=this._conversationManager.get(e.conversationType,e.targetId,e.channelId),r=this._userSettingManager.getTagsInfo(),i=[],n.tags)for(o in n.tags)i.push({tagId:o,tagName:null===(t=r[o])||void 0===t?void 0:t.tagName});return[2,{code:re.SUCCESS,data:i}]}))}))},t.prototype.getBlockConversationList=function(){var e=this._conversationManager.getBlockConversationList();return Promise.resolve({code:re.SUCCESS,data:e})},t.prototype.getTopConversationList=function(e,t){var n=this._conversationManager.getTopConversationList(e,t);return Promise.resolve({code:re.SUCCESS,data:n})},t.prototype.getUnreadConversationList=function(e){return l(this,void 0,void 0,(function(){var t;return d(this,(function(n){return t=this._conversationManager.getUnreadConversationList(e),[2,Promise.resolve({code:re.SUCCESS,data:t})]}))}))},t.prototype.getUnreadMentionedCount=function(e){var t,n;return n=e.conversationType===oe.ULTRA_GROUP?(null===(t=this._ultraGroupMap[e.channelId+"_"+e.targetId])||void 0===t?void 0:t.unreadMentionedCount)||0:this._conversationManager.getUnreadMentionedCount(e.conversationType,e.targetId,e.channelId),n=this._getUnreadCount(n),Promise.resolve({code:re.SUCCESS,data:n})},t.prototype.getAllUnreadMentionedCount=function(){var e=this._conversationManager.getAllUnreadMentionedCount();return Promise.resolve({code:re.SUCCESS,data:e})},t.prototype.getConversationNotificationLevel=function(e,t,n){if(!this._isUltraGroupListExist&&e===oe.ULTRA_GROUP)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var r;if(!(r=e===oe.ULTRA_GROUP?this._ultraGroupManager.get(oe.ULTRA_GROUP,t,n):this._conversationManager.get(e,t,n)))return Promise.resolve({code:re.SUCCESS,data:pe.NOT_SET});var i=r.notificationLevel;return Zt(r.notificationLevel)&&!Zt(r.notificationStatus)&&(i=de.OPEN===r.notificationStatus?1:0),Promise.resolve({code:re.SUCCESS,data:i})},t.prototype.getConversationNotificationStatus=function(e,t,n){var r;return(r=e===oe.ULTRA_GROUP?this._ultraGroupManager.get(oe.ULTRA_GROUP,t,n):this._conversationManager.get(e,t,n))?Promise.resolve({code:re.SUCCESS,data:r.notificationStatus}):Promise.resolve({code:re.SUCCESS,data:de.CLOSE})},t.prototype.setConversationTypeNotificationLevel=function(e,t){var n;return l(this,void 0,void 0,(function(){var r,i,o,s,a,u,c,l,h,p;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(i=(r=this).currentUserId,o=r._connMgr,s=this._conversationManager.getConversationUpdatedTime(),a=o.codec.encodeSetConversationTypeLevel(e,s,t),u=new yo(No[No.setTypeUnpush],a,i),[4,o.send(u,ua)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return c=d.sent(),l=c.code,h=c.data,l!==re.SUCCESS?[2,{code:l}]:(p=h,this._conversationManager.setConversationUpdatedTime(p.version),e===oe.ULTRA_GROUP?null===(n=this._ultraGroupManager)||void 0===n||n.addUltraGroupStatus({conversationType:e,targetId:"",notificationLevel:t,channelId:""}):this._conversationManager.addStatus({conversationType:e,targetId:"",channelId:"",updatedTime:p.version,notificationLevel:t},!0),[2,{code:re.SUCCESS}])}}))}))},t.prototype.getConversationTypeNotificationLevel=function(e){if(e===oe.ULTRA_GROUP){var t=this._ultraGroupManager.get(e,"","");return Promise.resolve({code:re.SUCCESS,data:t.notificationLevel||0})}var n=this._conversationManager.get(e,"","");return Promise.resolve({code:re.SUCCESS,data:n.notificationLevel||0})},t.prototype.getRemoteHistoryMessages=function(e,t,n,r,i,o){return this.getHistoryMessage(e,t,n,r,i,o)},t.prototype.getUltraGroupList=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o=this;return d(this,(function(s){return t=e.targetId,n=e.channelType,this._isUltraGroupListExist?(r=(r=Object.values(this._ultraGroupMap).filter((function(e){return!(e.targetId!==t&&t||e.channelType!==n&&xt(n))}))).map((function(e){var t=e.unreadMessageCount,n=e.unreadMentionedCount,r=e.unreadMentionedMeCount;return t=o._getUnreadCount(t),n=o._getUnreadCount(n),r=o._getUnreadCount(r),u(u({},e),{unreadMessageCount:t,unreadMentionedCount:n,unreadMentionedMeCount:r})})),r=Jl(r),i=Cr(r),[2,{code:re.SUCCESS,data:i}]):[2,{code:re.METHOD_NOT_AVAILABLE}]}))}))},t.prototype._getUnreadCount=function(e){return e>999?999:e},t.prototype.getBlockUltraGroupList=function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){(e.notificationStatus===de.OPEN||e.notificationLevel>0)&&t.push({conversationType:oe.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:re.SUCCESS,data:t})},t.prototype.getTopUltraGroupList=function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){!0===e.isTop&&t.push({conversationType:oe.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:re.SUCCESS,data:t})},t.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){if(!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var n=0;for(var r in this._ultraGroupMap){r.match(/_.*/g)[0].substring(1)!==e||t&&0!==t.length&&!t.includes(this._ultraGroupMap[r].notificationLevel)||(n+=this._ultraGroupMap[r].unreadMentionedCount)}return n=this._getUnreadCount(n),Promise.resolve({code:re.SUCCESS,data:n})},t.prototype.getUltraGroupUnreadCountByTargetId=function(e,t){var n=0;for(var r in this._ultraGroupMap){var i=this._ultraGroupMap[r];i.targetId!==e||t&&0!==t.length&&!t.includes(this._ultraGroupMap[r].notificationLevel)||(n+=i.unreadMessageCount||0)}return n=this._getUnreadCount(n),Promise.resolve({code:re.SUCCESS,data:n})},t.prototype.getUltraGroupUnreadInfoList=function(e){var t=this;if(!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var n=[];return Object.keys(this._ultraGroupMap).forEach((function(r){var i=t._ultraGroupMap[r];e.includes(i.targetId)&&n.push({type:i.conversationType,targetId:i.targetId,channelId:i.channelId,unreadMessageCount:t._getUnreadCount(i.unreadMessageCount),mentionedCount:t._getUnreadCount(i.unreadMentionedCount),mentionedMeCount:t._getUnreadCount(i.unreadMentionedMeCount),notificationLevel:i.notificationLevel})})),Promise.resolve({code:re.SUCCESS,data:n})},t.prototype.getAllUltraGroupUnreadCount=function(e){if(void 0===e&&(e=!1),!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var t=0;for(var n in this._ultraGroupMap)t+=e?this._ultraGroupMap[n].unreadMentionedCount||0:this._ultraGroupMap[n].unreadMessageCount||0;return t=this._getUnreadCount(t),Promise.resolve({code:re.SUCCESS,data:t})},t.prototype.clearUltraUnreadcount=function(e,t){return void 0===t&&(t=""),l(this,void 0,void 0,(function(){var n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this.getServerTime(),r=this._connMgr.codec.encodeClearUnreadCount({conversationType:oe.ULTRA_GROUP,targetId:e,channelId:t},{timestamp:n}),(i=new Ro(No[No.updUgRTime],r,this.currentUserId)).setHeaderQos(hi.AT_LEAST_ONCE),[4,this._connMgr.send(i)]):[2,re.RC_NET_UNAVAILABLE]:[2,Promise.resolve(re.METHOD_NOT_AVAILABLE)];case 1:return(o=a.sent().code)===re.SUCCESS&&((s=this._ultraGroupMap[t+"_"+e])&&(s.unreadMessageCount=0,s.unreadMentionedCount=0,s.unreadMentionedMeCount=0,s.lastReadTime=n),s&&s.firstUnreadMessage&&(s.firstUnreadMessage=null)),[2,o]}}))}))},t.prototype._getUltraGroupList=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,l,h,p,_,g=this;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUltraGroup(e,false),n=new yo(No[No.pullUgSes],t,this.currentUserId),[4,this._connMgr.send(n,Ts,{currentUserId:this.currentUserId,conversationType:oe.ULTRA_GROUP})]):[2];case 1:return r=d.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(a=o.list,u=o.isFinished,a.forEach((function(e){e.notificationStatus=de.CLOSE,e.notificationLevel=pe.NOT_SET,e.isTop=!1,g._ultraGroupMap[e.channelId+"_"+e.targetId]=e,g._ultraGroupManager.addUltraGroupStatus(e)})),!1!==u?[3,2]:(c=a.length>0&&a[a.length-1].versionTime||0,this._getUltraGroupList(c),[3,4])):(this.logger.warn(Re.L_ULTRA_SYNC_DONE_S,"Pull ultra group conversation failured, code: "+i+", try again"),s=setTimeout((function(){g._getUltraGroupList(e),clearTimeout(s)}),3e3),[2]);case 2:return this.logger.info(Re.L_ULTRA_SYNC_DONE_S,"Pull ultra group conversation success"),[4,this.pullConversationStatus(0)];case 3:l=d.sent(),h=l.code,p=l.data,h!==re.SUCCESS&&this.logger.warn(Re.O,"pullConversationStatus fail code: "+h+", data: "+p),_=Object.values(this._ultraGroupMap),_=Jl(_),this._isUltraGroupListExist=!0,this._watcher.ultraGroupEnable(Cr(_)),this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp),d.label=4;case 4:return[2]}}))}))},t.prototype._startUltraSyncInterval=function(){var e=this,t=function(){e._ultraGroupTimer=setTimeout((function(){Date.now()-e._lastSyncUltraMsgLocalTimeStamp>=18e4&&e._syncUltraMsg(e._lastSyncUltraMsgTimeStamp),e._stopUltraSyncInterval(),t()}),3e4)};this._lastSyncUltraMsgLocalTimeStamp=Date.now(),t()},t.prototype._stopUltraSyncInterval=function(){-1!==this._ultraGroupTimer&&(clearTimeout(this._ultraGroupTimer),this._ultraGroupTimer=-1)},t.prototype._notificationOnline=function(){return l(this,void 0,void 0,(function(){var e,t,n,r=this;return d(this,(function(i){switch(i.label){case 0:return this._isConnected?[4,this._fetchUltraMsg(0)]:[2];case 1:return e=i.sent(),t=e.code,n=e.data,t===re.SUCCESS&&n?(this.logger.info(Re.L_NOTIFY_ULTRA_ONLINE_S,"Notify ultra group online success."),this._getUltraGroupList(0),-1===this._ultraGroupTimer&&this._startUltraSyncInterval(),[2]):(this.logger.warn(Re.L_NOTIFY_ULTRA_ONLINE_S,"Notify ultra group online failured, try again."),setTimeout((function(){r._notificationOnline()}),3e3),[2])}}))}))},t.prototype._fetchUltraMsg=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return t=this._connMgr.codec.encodeSuperSyncMsg(e),n=new yo(No[No.pullUgMsg],t,this.currentUserId),r=this.logger.createTraceId(),this.logger.info(Re.L_PULL_ULTRA_MSG_T,JSON.stringify({timestamp:e}),r),[4,this._connMgr.send(n,ls,{currentUserId:this.currentUserId,conversation:{conversationType:oe.ULTRA_GROUP}})];case 1:return i=l.sent(),o=i.code,s=i.data,o===re.SUCCESS&&s?(a=s.list,u=s.syncTime,c=a.map((function(e){return e.messageUId})).join(","),this.logger.info(Re.L_PULL_ULTRA_MSG_R,JSON.stringify({code:o,messageUIds:c,timestamp:e,syncTime:u}),r)):this.logger.warn(Re.L_PULL_ULTRA_MSG_R,JSON.stringify({code:o,timestamp:e}),r),[2,{code:o,data:s}]}}))}))},t.prototype._getUltraGroup=function(e,t,n){var r,i,o,s=e.targetId,a=e.messageType,u=e.channelId,c=e.isCounted,l=e.channelType,d=e.sentTime,h=e.senderUserId,p=e.content,_=e.isMentioned,g=this._ultraGroupMap[u+"_"+s],f=g||{conversationType:oe.ULTRA_GROUP,targetId:s,channelId:u,unreadMessageCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,notificationStatus:de.CLOSE,notificationLevel:pe.NOT_SET,isTop:!1};return c&&h!==this.currentUserId&&a!==ce.RECALL&&(f.unreadMessageCount+=1,f.unreadMentionedCount+=t,f.firstUnreadMessage||(f.firstUnreadMessage={sentTime:d}),_&&(null===(r=null==p?void 0:p.mentionedInfo)||void 0===r?void 0:r.type)!==ge.ALL&&(null===(o=null===(i=null==p?void 0:p.mentionedInfo)||void 0===i?void 0:i.userIdList)||void 0===o?void 0:o.includes(this.currentUserId))&&(f.unreadMentionedMeCount+=1)),f.versionTime=n,f.latestMessage=e,f.channelType=l,g||(this._ultraGroupMap[u+"_"+s]=f),f},t.prototype._syncUltraMsg=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,l=this;return d(this,(function(d){switch(d.label){case 0:return!this._isConnected||this._isUltraPulling?[2]:(this._isUltraPulling=!0,[4,this._fetchUltraMsg(e)]);case 1:return t=d.sent(),n=t.code,r=t.data,this._lastSyncUltraMsgLocalTimeStamp=Date.now(),this._isUltraPulling=!1,n===re.SUCCESS&&r?(i=r.list,o=r.syncTime,s=r.finished,a={},u=[],i.forEach((function(e){var t,n,r,i=e.targetId,s=e.content,c=e.messageUId,d=e.channelId,h=e.isMentioned;if(l._ultraMsgMap[c])delete l._ultraMsgMap[c];else{var p=0;h&&((null===(t=null==s?void 0:s.mentionedInfo)||void 0===t?void 0:t.type)===ge.ALL||(null===(r=null===(n=null==s?void 0:s.mentionedInfo)||void 0===n?void 0:n.userIdList)||void 0===r?void 0:r.includes(l.currentUserId)))&&(p=1);var _=l._getUltraGroup(e,p,o);a[d+"_"+i]=_,l._ultraGroupManager.addUltraGroupStatus(_),u.push(e)}})),Object.keys(a).length>0&&(this.logger.debug(Re.O,"notice ultragroups"),c=Object.values(a),c=Jl(c),this._watcher.conversation(Cr(c))),this.logger.debug(Re.O,"notice ultragroup message"),this._batchMessage(u),this._ultraGroupTimeQue=this._ultraGroupTimeQue.filter((function(e){return e>o})),this._lastSyncUltraMsgTimeStamp=o,s?(this._ultraGroupTimeQue.length>0&&(this._ultraGroupTimeQue.length=0,this._syncUltraMsg(o)),[2]):(this._syncUltraMsg(o),[2])):[2]}}))}))},t.prototype.sendUltraMessage=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,c,l,h,p,_,g,f,E;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?("RC:SRSMsg"===t.messageType&&this.logger.warn(Re.O,"ultra group -> direction message convert to message"),t=this._handleMsgProperties(t,!0),i=t.messageId?t.messageId:er(),t.messageId=i,o=this._connMgr.codec.encodeUpMsg({conversationType:oe.ULTRA_GROUP,targetId:e},t),(s=new Ro(No[No.ugMsg],o,e)).setHeaderQos(hi.AT_LEAST_ONCE),a=this._connMgr.getCrtServerTime(),c=Wl(oe.ULTRA_GROUP,e,u({},t),"",a,this.currentUserId,i),n&&n(i),this.logger.info(Re.L_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:oe.ULTRA_GROUP,targetId:e,channelId:t.channelId}),r),l=Date.now(),[4,this._connMgr.send(s)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return h=d.sent(),p=h.code,_=h.data,p!==re.SUCCESS?(this.logger.warn(Re.L_SEND_MSG_R,JSON.stringify({code:p,messageUId:c.messageUId,messageId:c.messageId}),r),this._writeMessagesLog(oe.ULTRA_GROUP)&&this.statisticLog.record(ve.IM_MSG_SEND,JSON.stringify({channel:oe.ULTRA_GROUP,start_ts:l,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),c.sentStatus=Me.FAILED,[2,{code:p,data:c}]):(this.logger.info(Re.L_SEND_MSG_R,JSON.stringify({code:p,messageUId:null==_?void 0:_.messageUId,messageId:null==_?void 0:_.messageId}),r),g=_,this._writeMessagesLog(oe.ULTRA_GROUP,g.messageUId)&&this.statisticLog.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:g.messageUId,channel:oe.ULTRA_GROUP,start_ts:l,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),c.sentTime=g.timestamp,c.messageUId=g.messageUId,this._ultraMsgMap[g.messageUId]=g.timestamp,f=t.channelId||"",(E=this._ultraGroupMap[f+"_"+e])?(E.latestMessage=c,xt(E.channelType)&&(c.channelType=E.channelType)):(E={conversationType:oe.ULTRA_GROUP,targetId:e,channelId:f,unreadMessageCount:0,unreadMentionedCount:0,versionTime:c.sentTime,latestMessage:c,notificationStatus:de.CLOSE,notificationLevel:pe.NOT_SET,isTop:!1},this._ultraGroupMap[f+"_"+e]=E,this._ultraGroupManager.addUltraGroupStatus(E)),this._watcher.conversation(Cr([E])),[2,{code:p,data:c}])}}))}))},t.prototype.sendUltraGroupTypingStatus=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=e.conversationType,r=e.channelId,i=e.targetId,o=this._connMgr.codec.encodeOperateStatus(i,n,r||"",t||0),(s=new Ro(No[No.operate],o,i)).setHeaderQos(hi.AT_LEAST_ONCE),[4,this._connMgr.send(s)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return(a=u.sent().code)!==re.SUCCESS?[2,{code:a,msg:re[a]}]:[2,{code:a}]}}))}))},t.prototype.getUltraGroupMessageListByMessageUId=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return this._isConnected?e.messages&&e.messages.length<1||e.messages&&e.messages.length>20?[2,{code:re.MSG_LIMIT_ERROR}]:(t={},e.messages.forEach((function(e){t[e.messageUId]=void 0})),n=this._connMgr.codec.encodeMsgQuery(e),(r=new yo(No[No.qryMsg],n,this.currentUserId)).setHeaderQos(hi.AT_LEAST_ONCE),[4,this._connMgr.send(r,Da,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return i=u.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o,msg:re[o]}]:(a=(s||{}).list,Array.isArray(a)&&a.forEach((function(e){var n=e.messageUId;t[n]=e})),[2,{code:0,data:t}])}}))}))},t.prototype._pullOperateStatusNotify=function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.data,Va),n=t.conversationType,r=t.info,i=t.summary;this.logger.debug(Re.O,"s_opNtf -> type: "+n+", info: "+r+", summary: "+i),this._watcher.operateStatus(t)}},t.prototype.expandUltraMessage=function(e){return l(this,void 0,void 0,(function(){var t,n,r;return d(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeExpandUltraMessage(e,this.currentUserId),(n=new yo(No[No.upMsgEx],t,e.targetId)).setHeaderQos(hi.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return(r=i.sent().code)!==re.SUCCESS?[2,{code:r,msg:re[r]}]:[2,{code:r}]}}))}))},t.prototype.modifyMessage=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodemodifyMessage(e,this.currentUserId),(n=new yo(No[No.modifyMsg],t,e.targetId)).setHeaderQos(hi.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),i=r.code,o=r.data,i!==re.SUCCESS?[2,{code:i,msg:re[i]}]:(s=o,this._ultraMsgMap[s.messageUId]=s.timestamp,[2,{code:i}])}}))}))},t.prototype._handleEventChangeList=function(e){var t={Group:{map:{},types:Xl},Friend:{map:{},types:Zl}},n=function(e,t,n){e[t]||(e[t]=[]),e[t].push(n)};e.forEach((function(e){var r=e.changeType;for(var i in t)if(t[i].types.includes(r)){n(t[i].map,r,e);break}}));var r={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&r[i](t[i].map)},t.prototype._pullUltraChangeMessageList=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:return this._isConnected?this._isPullingUltraChangeMessage?[2]:(this._isPullingUltraChangeMessage=!0,t=this._connMgr.codec.encodeQueryMsgChange(e),(n=new yo(No[No.qryMsgChange],t,this.currentUserId)).setHeaderQos(hi.AT_LEAST_ONCE),[4,this._connMgr.send(n,Ma)]):[2];case 1:return r=d.sent(),i=r.code,o=r.data,this._isPullingUltraChangeMessage=!1,i===re.SUCCESS&&o?(s=o.hasNext,a=o.list,u=(null==o?void 0:o.syncTime)||0,this._handleUltraChangeList(a),c=this._pullUltraChangeMessageQue.filter((function(e){return e>u})),this._pullUltraChangeMessageQue.length=0,(l=this._pullUltraChangeMessageQue).push.apply(l,c),s?this._pullUltraChangeMessageList(u):this._lastPullingUltraChangeMessageTime=u,[2]):[2]}}))}))},t.prototype._handleUltraChangeList=function(e){var t={};e.forEach((function(e){var n=e.changeType;t[n]||(t[n]=[]),t[n].push(e)}));var n=qe.CHANNEL_CHANGE,r=qe.MSG_RECALL,i=qe.MSG_EXPANSION,o=qe.MSG_MODIFY,s=qe.USER_GROUP_CHANGE;t[n]&&this._handleUltraChannelChange(t[n]),t[r]&&this._handleMsgRecall(t[r]),t[i]&&this._handleMsgUpdate(t[i]),t[o]&&this._handleMsgUpdate(t[o]),t[s]&&this._handleUserGroupStatus(t[s])},t.prototype._processChangeMapGroup=function(e){var t=Rt.GROUP_OPERATION,n=Rt.GROUP_PROFILE_CHANGE,r=Rt.GROUP_APPLICATION_INVITATION,i=Rt.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[n]&&this._handleGroupProfileChange(e[n]),e[r]&&this._handleApplication(e[r]),e[i]&&this._handleFollowUserChange(e[i])},t.prototype._processChangeMapFriend=function(e){var t=this;(e[Mt.FRIEND_APPLICATION]||[]).forEach((function(e){var n,r,i,o,s,a,u,c,l,d,h=e.subChangeType,p=e.businessId,_=e.time,g=e.eventData,f=Ut.FRIEND_APPLY,E=Ut.FRIEND_REFUSE,I=Ut.FRIEND_USER_INFO,T=Ut.FRIENDS_INPUT,R=Ut.FRIEND_CLEAR,v=Ut.FRIEND_INFO_CHANGE,C=Ut.FRIEND_INFO_CHANGE_SYNC;switch(h){case f:case E:var y=h===f?Ot.UNHANDLED:Ot.REFUSED;null===(r=(n=t._watcher).friendApplicationStatusChanged)||void 0===r||r.call(n,{userId:p,applicationType:g.applyType,applicationStatus:y,directionType:g.friendType,operationTime:_,extra:g.info||""});break;case I:null===(o=(i=t._watcher).friendAdd)||void 0===o||o.call(i,{userId:p,name:g.name,portraitUri:g.portraitUrl,directionType:g.friendType,operationTime:_});break;case T:null===(a=(s=t._watcher).friendDelete)||void 0===a||a.call(s,{userIds:g.targetId,directionType:g.type,operationTime:_});break;case R:null===(c=(u=t._watcher).friendCleared)||void 0===c||c.call(u,_);break;case v:break;case C:null===(d=(l=t._watcher).friendInfoChangedSync)||void 0===d||d.call(l,{userId:p,remark:g.remarkname,extProfile:g.extProfile,operationTime:_})}}))},t.prototype._handleGroupOperation=function(e){var t=this;e.forEach((function(e){var n,r,i=e.subChangeType,o=e.businessId,s=e.time,a=e.eventData,u=a.optUserInfo,c=a.channelInfo,l=a.userInfos,d={groupId:o,operation:i,operationTime:s};u&&(d.operatorInfo=bn([u])[0]),i===lt.CREATE&&(d.groupInfo=Un([c])[0]),[lt.CREATE,lt.DISMISS].includes(i)||(d.memberInfos=bn(l)),null===(r=(n=t._watcher).groupOperation)||void 0===r||r.call(n,d)}))},t.prototype._handleGroupProfileChange=function(e){var t=this;e.forEach((function(e){var n,r,i,o,s,a,u=e.businessId,c=e.time,l=e.eventData,d=e.subChangeType,h=e.secondaryId;switch(d){case ht.GROUP_INFO_CHANGE:var p=bn([l.optUserInfo])[0],_=Ln([l.channelInfo])[0];null===(r=(n=t._watcher).groupInfoChanged)||void 0===r||r.call(n,{operatorInfo:p,groupInfo:_,operationTime:c});break;case ht.MEMBER_PROFILE_CHANGE:p=bn([l.optUserInfo])[0];var g=bn(l.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:u,operatorInfo:p,memberInfo:g,operationTime:c});break;case ht.GROUP_REMARK_DELETE:case ht.GROUP_REMARK_SET:var f=d===ht.GROUP_REMARK_SET?ft.ADD:ft.REMOVE;null===(a=(s=t._watcher).groupRemarkChangedSync)||void 0===a||a.call(s,{groupId:u,operationType:f,operationTime:c,groupRemark:h})}}))},t.prototype._handleApplication=function(e){var t=this;e.forEach((function(e){var n=e.eventData.statusInfo;Gn(n).forEach((function(e){var n,r;null===(r=(n=t._watcher).groupApplicationEvent)||void 0===r||r.call(n,e)}))}))},t.prototype._handleFollowUserChange=function(e){var t=this;e.forEach((function(e){var n,r,i=e.subChangeType,o=e.businessId,s=e.time,a=e.userGroupIds,u=1===i?ft.ADD:ft.REMOVE;null===(r=(n=t._watcher).groupFollowsChangedSync)||void 0===r||r.call(n,{groupId:o,operationType:u,operationTime:s,userIds:a})}))},t.prototype._handleUltraChannelChange=function(e){var t=this,n=[],r=[],i=[];e.forEach((function(e){var o=e.subChangeType,s=e.targetId,a=e.channelId,u=e.sendTime,c=e.operatorId,l=a+"_"+s,d=t._ultraGroupMap[l];if(d){var h=Ke.PUBLIC_TO_PRIVATE,p=Ke.PRIVATE_TO_PUBLIC,_=Ke.PUBLIC_TO_PRIVATE_USER_NOT_IN,g=Ke.CHANNEL_DELETE,f=Ke.CHANNEL_USER_KICKED;switch(o){case p:d.channelType=He.PUBLIC,n.push({targetId:s,channelId:a,changeType:Ye.PRIVATE_TO_PUBLIC,channelType:d.channelType});break;case h:d.channelType=He.PRIVATE,n.push({targetId:s,channelId:a,changeType:Ye.PUBLIC_TO_PRIVATE,channelType:d.channelType});break;case _:n.push({targetId:s,channelId:a,changeType:Ye.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:d.channelType}),delete t._ultraGroupMap[l];break;case g:r.push({targetId:s,channelId:a,channelType:d.channelType,deleteTime:u}),delete t._ultraGroupMap[l];break;case f:i.push({targetId:s,channelId:a,userId:c,channelType:He.PRIVATE}),c===t.currentUserId&&delete t._ultraGroupMap[l]}}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),r.length>0&&this._watcher.ultraGroupChannelDelete(r),i.length>0&&this._watcher.ultraGroupChannelUserKicked(i)},t.prototype._handleMsgRecall=function(e){var t=this,r=[];e.forEach((function(e){var i=e.targetId,o=e.channelId,s=e.messageUId,a=e.sendTime,u=e.conversationType,c=e.operatorId,l=e.mentionedType;t._updateUltraGroupWhenRecallMsg(i,o,s,a,l),r.push({targetId:i,conversationType:u,sentTime:a,messageUId:s,senderUserId:c,channelId:o,content:{conversationType:u,targetId:i,messageUId:s,channelId:o},messageDirection:1,messageType:ce.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:n.UNREAD,receivedStatusInfo:yr(n.UNREAD)})})),this._watcher.ultraGroupMessageRecalled(r)},t.prototype._handleMsgUpdate=function(e){var t={};for(var n in e.forEach((function(e){var n=e.targetId,r=e.conversationType,i=e.sendTime,o=e.messageUId,s=e.channelId,a=r+"_"+n;t[a]||(t[a]=[]),t[a].push({messageUId:o,channelId:s,sendTime:i})})),t){var r=n.split("_"),i=r.shift(),o=r.join("_");this._pullUltraMessageList(e[0].changeType,{targetId:o,conversationType:Number(i),messages:h([],t[n],!0)})}},t.prototype._pullUltraMessageList=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c=this;return d(this,(function(l){switch(l.label){case 0:return this._isConnected?(n=this._connMgr.codec.encodeMsgQuery(t),(r=new yo(No[No.qryMsg],n,this.currentUserId)).setHeaderQos(hi.AT_LEAST_ONCE),[4,this._connMgr.send(r,Da,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return i=l.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o,msg:re[o]}]:(a=(s||{}).list,u=[],Array.isArray(a)&&a.forEach((function(e){var t=e.targetId,n=e.channelId,r=e.messageUId,i=c._ultraGroupMap[n+"_"+t];i&&i.latestMessage.messageUId===r&&(i.latestMessage=e),u.push(e)})),e===qe.MSG_EXPANSION&&this._watcher.ultraGroupMessageExpansionUpdated(u),e===qe.MSG_MODIFY&&this._watcher.ultraGroupMessageModified(u),[2])}}))}))},t.prototype._handleUserGroupStatus=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,l,h;return d(this,(function(d){return t=je.REMOVE_USER_GROUP,n=je.JOIN_USER_GROUP,r=je.EXIT_USER_GROUP,i=je.CHANNEL_BIND_USER_GROUP,o=je.CHANNEL_UNBIND_USER_GROUP,s=[],a=[],u=[],c=[],l=[],e.forEach((function(e){var d=e.conversationType,h=e.targetId,p=e.userGroupIds,_=e.busChannelType,g=e.channelId;switch(e.subChangeType){case t:s.push({conversation:{conversationType:d,targetId:h},userGroupIds:p});break;case n:a.push({conversation:{conversationType:d,targetId:h},userGroupIds:p});break;case r:u.push({conversation:{conversationType:d,targetId:h},userGroupIds:p});break;case i:c.push({conversation:{conversationType:d,targetId:h,channelId:g},channelType:_,userGroupIds:p});break;case o:l.push({conversation:{conversationType:d,targetId:h,channelId:g},channelType:_,userGroupIds:p})}})),h={},s.length>0&&(h.userGroupDisband=s),a.length>0&&(h.userAdded=a),u.length>0&&(h.userRemoved=u),c.length>0&&(h.userGroupBindChannel=c),l.length>0&&(h.userGroupUnBindChannel=l),this._watcher.userGroupStatus(h),[2]}))}))},t.prototype.getUltraHistoryMsg=function(e,t,n){var r;return l(this,void 0,void 0,(function(){var i,o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return this._isConnected?(i=this._connMgr.codec.encodeGetHistoryMsg(e,t),o=new yo(No[No.qryUgMsg],i,this.currentUserId),this.logger.info(Re.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:e,conversationType:oe.ULTRA_GROUP,channelId:t.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,this._connMgr.send(o,Es,{currentUserId:this.currentUserId,conversation:{conversationType:oe.ULTRA_GROUP,targetId:e}})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return s=l.sent(),a=s.code,u=s.data,a===re.SUCCESS&&u?(c=[],null===(r=u.list)||void 0===r||r.forEach((function(e){e&&c.push(e.messageUId)})),this.logger.info(Re.L_GET_HISTORY_MSG_R,JSON.stringify({code:a,messageUIds:c.join(",")}),n),[2,{code:a,data:u}]):(this.logger.warn(Re.L_GET_HISTORY_MSG_R,JSON.stringify({code:a,messageUIds:""}),n),[2,{code:a}])}}))}))},t.prototype.setUltraGroupDefaultNotificationLevel=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(r=this._connMgr.codec.encodeSetUltraGroupDefaultNotificationLevel(t,n),i=new yo(No[No.ugUnpushSet],r,e),[4,this._connMgr.send(i)]):[2,{code:re.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:re.METHOD_NOT_AVAILABLE})];case 1:return o=a.sent(),s=o.code,re.SUCCESS,[2,{code:s}]}}))}))},t.prototype.getUltraGroupDefaultNotificationLevel=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this._connMgr,r=n.codec.encodeGetUltraGroupDefaultNotificationLevel(t),i=new yo(No[No.ugUnpushQuery],r,e),[4,n.send(i,pa)]):[2,{code:re.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:re.METHOD_NOT_AVAILABLE})];case 1:return o=c.sent(),s=o.code,a=o.data,s===re.SUCCESS&&a?(u=a.unpushLevel,[2,{code:s,data:u}]):[2,{code:s}]}}))}))},t.prototype._updateUltraGroupWhenRecallMsg=function(e,t,n,r,i){var o=t+"_"+e;if(this._ultraGroupMap[o]){var s=this._ultraGroupMap[o],a=s.latestMessage,u=s.lastReadTime;a&&a.messageUId===n&&(s.latestMessage=null),r&&u<r&&s.unreadMessageCount>0&&(--s.unreadMessageCount,(i===Qe.ALL||i===Qe.ME)&&s.unreadMentionedCount>0&&--s.unreadMentionedCount,i===Qe.ME&&s.unreadMentionedCount>0&&--s.unreadMentionedMeCount,this._watcher.conversation(Cr([s])))}},t.prototype.getAllConversationState=function(){return Promise.resolve({code:re.SUCCESS,data:this._conversationManager.getAllConversationState()})},t.prototype.getUltraGroupUnreadMentionedMessages=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return this._isConnected?this._isUltraGroupListExist?(t=this._connMgr.codec.encodeUnreadMentionedMsgQuery(e),n=new yo(No[No.qryUgUal],t,this.currentUserId),[4,this._connMgr.send(n,ha)]):[2,Promise.resolve({code:re.METHOD_NOT_AVAILABLE})]:[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return r=s.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?[2,{code:i,data:o}]:[2,{code:i}]}}))}))},t.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i;return d(this,(function(o){return this._isConnected?this._isUltraGroupListExist?(t=e.targetId,n=e.channelId,r=this._ultraGroupMap[n+"_"+t]||{},i=r.firstUnreadMessage||null,[2,{code:re.SUCCESS,data:i}]):[2,Promise.resolve({code:re.METHOD_NOT_AVAILABLE})]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.subscribeUser=function(e,t,n){return l(this,void 0,void 0,(function(){return d(this,(function(r){return this._isConnected?[2,this._subscribeManager.updateSubscribeRelation(e,t,rt.SUBSCRIBE,n)]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.unSubscribeUser=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return this._isConnected?[4,this._subscribeManager.updateSubscribeRelation(e,t,rt.UNSUBSCRIBE)]:[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return[2,{code:n.sent().code}]}}))}))},t.prototype.getSubscribeUserList=function(e,t,n){var r;return l(this,void 0,void 0,(function(){var i;return d(this,(function(o){return this._isConnected?(i=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserList(e,t,n),[2,Promise.resolve({code:re.SUCCESS,data:i})]):[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.getSubscribeUserStatus=function(e,t){var n;return l(this,void 0,void 0,(function(){var r;return d(this,(function(i){return this._isConnected?(r=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserStatus(e,t),[2,Promise.resolve({code:re.SUCCESS,data:r})]):[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.updateMyUserProfile=function(e){var t;return l(this,void 0,void 0,(function(){var n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=this._connMgr.codec.encodeUserProfile(e),r=new yo(No[No.updUserProfile],n,this.currentUserId),[4,this._connMgr.send(r,du)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return i=u.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o,data:{errorKey:null==s?void 0:s.key}}]:(a=s.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,a),[2,{code:o}])}}))}))},t.prototype.getMyUserProfile=function(){return this._isConnected?this._subscribeManager.getOwnProfile():Promise.resolve({code:re.RC_NET_UNAVAILABLE})},t.prototype.getUserProfiles=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return this._isConnected?[2,this._subscribeManager.getUserProfiles(e)]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},t.prototype.updateMyUserProfileVisibility=function(e){return l(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){switch(r.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUserProfilePermission(e),n=new yo(No[No.updProfilePermiss],t,this.currentUserId),[4,this._connMgr.send(n)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return[2,{code:r.sent().code}]}}))}))},t.prototype.getMyUserProfileVisibility=function(){return l(this,void 0,void 0,(function(){var e,t,n,r,i;return d(this,(function(o){switch(o.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodeUserProfileInput(),t=new yo(No[No.qProfilePermiss],e,this.currentUserId),[4,this._connMgr.send(t,gu)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return n=o.sent(),r=n.code,i=n.data,r!==re.SUCCESS?[2,{code:r}]:[2,{code:r,data:null==i?void 0:i.permission}]}}))}))},t.prototype.searchUserProfileByUniqueId=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeSearchUserProfile(e),n=new yo(No[No.searchUserProfile],t,this.currentUserId),[4,this._connMgr.send(n,cu)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(s=Ar(o.userId,o.userProfile,o.userExtProfile),[2,{code:i,data:s}]):[2,{code:i}]}}))}))},t.prototype.bindRTCRoomForChatroom=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i;return d(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=e.chatRoomId,n=this._connMgr.codec.encodebindRTCRoomForChatroom(e),r=new yo(No[No.setRtcRoomId],n,t),[4,this._connMgr.send(r)]):[2,re.RC_NET_UNAVAILABLE];case 1:return i=o.sent(),[2,i.code]}}))}))},t.prototype.rtcSignaling=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return this._isConnected?(i=r instanceof ArrayBuffer?Array.prototype.slice.call(new Int8Array(r)):r,o=n?new yo(t,i,e):new Ro(t,i,e),[4,this._connMgr.send(o)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return s=c.sent(),a=s.code,u=s.data,[2,{code:a,buffer:null==u?void 0:u.data}]}}))}))},t.prototype.rtcPing=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return r=uc(this.rtcCodec,t,n),[4,this.rtcSignaling(e,No[No.rtcPing],!0,r)];case 1:return i=u.sent(),o=i.code,s=i.buffer,o!==re.SUCCESS?[2,{code:o}]:((a=this.rtcCodec.decode(hr.RtcOutput,s)).version=Mn(a.version),[2,{code:o,data:a}])}}))}))},t.prototype.getDeviceId=function(){return In(this.runtime)},t.prototype.getOSInfo=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){return[2,{code:re.NOT_SUPPORT}]}))}))},t.prototype.getProcessInfo=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){return[2,{code:re.NOT_SUPPORT}]}))}))},t.prototype.getMainProcessInfo=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){return[2,{code:re.NOT_SUPPORT}]}))}))},t.prototype.destroy=function(){Cc(),_l()},t.prototype.callExtra=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Promise.resolve({code:re.NOT_SUPPORT})},t.prototype.setProxy=function(e){return Promise.resolve({code:re.NOT_SUPPORT})},t.prototype.getProxy=function(){return Promise.resolve({code:re.NOT_SUPPORT})},t.prototype.testProxy=function(e,t){return Promise.resolve({status:re.NOT_SUPPORT})},t.prototype.setNetwork=function(e,t){var n;if(this._connMgr.setNetwork(e,t),e.status&&this.cloudControllerUri){var r=this._connMgr.getToken();null===(n=this.cloudController)||void 0===n||n.request(this.cloudControllerUri,fl.newWorkChange,r)}},t.prototype.createGroup=function(e,t,n,r){var i,o;return l(this,void 0,void 0,(function(){var s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:return s=this._connMgr.codec.encodeGroupInfo("create",e,t,n,r),a=new yo(No[No.channelCreate],s,e),[4,this._connMgr.send(a,Ru)];case 1:return u=d.sent(),c=u.code,l=u.data,c!==re.SUCCESS?[2,{code:c,msg:null!==(i=null==l?void 0:l.msg)&&void 0!==i?i:""}]:[2,{code:c,data:{processCode:null!==(o=null==l?void 0:l.processCode)&&void 0!==o?o:0}}]}}))}))},t.prototype.updateGroupInfo=function(e,t,n){var r;return l(this,void 0,void 0,(function(){var i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return i=this._connMgr.codec.encodeGroupInfo("update",e,t,n),o=new yo(No[No.upChannelInfo],i,e),[4,this._connMgr.send(o,Ru)];case 1:return s=c.sent(),a=s.code,u=s.data,a!==re.SUCCESS?[2,{code:a,msg:null!==(r=null==u?void 0:u.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))},t.prototype.getGroupsInfo=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeMultiChannels(e),n=new yo(No[No.qChannelInfo],t,e[0]),[4,this._connMgr.send(n,Au)];case 1:return r=u.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(s=o.result.list,a=Un(void 0===s?[]:s),[2,{code:i,data:a}]):[2,{code:i}]}}))}))},t.prototype.kickGroupMembers=function(e,t,n){var r;return l(this,void 0,void 0,(function(){var i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return i=this._connMgr.codec.encodeQuitGroup("kick",e,t,!0,n),o=new yo(No[No.channelMemKick],i,e),[4,this._connMgr.send(o,Ru)];case 1:return s=c.sent(),a=s.code,u=s.data,a!==re.SUCCESS?[2,{code:a,msg:null!==(r=null==u?void 0:u.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))},t.prototype.quitGroup=function(e,t){var n;return l(this,void 0,void 0,(function(){var r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return r=this._connMgr.codec.encodeQuitGroup("quit",e,[],!0,t),i=new yo(No[No.channelMemQuit],r,e),[4,this._connMgr.send(i,Ru)];case 1:return o=u.sent(),s=o.code,a=o.data,s!==re.SUCCESS?[2,{code:s,msg:null!==(n=null==a?void 0:a.msg)&&void 0!==n?n:""}]:[2,{code:s}]}}))}))},t.prototype.dismissGroup=function(e){var t;return l(this,void 0,void 0,(function(){var n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeQuitGroup("dismiss",e),r=new yo(No[No.channelDismiss],n,e),[4,this._connMgr.send(r,Ru)];case 1:return i=a.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o,msg:null!==(t=null==s?void 0:s.msg)&&void 0!==t?t:""}]:[2,{code:o}]}}))}))},t.prototype.transferGroupOwner=function(e,t,n,r){var i;return l(this,void 0,void 0,(function(){var o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return o=this._connMgr.codec.encodeQuitGroup("transfer",e,[t],n,r),s=new yo(No[No.channelTransfer],o,e),[4,this._connMgr.send(s,Ru)];case 1:return a=l.sent(),u=a.code,c=a.data,u!==re.SUCCESS?[2,{code:u,msg:null!==(i=null==c?void 0:c.msg)&&void 0!==i?i:""}]:[2,{code:u}]}}))}))},t.prototype.setGroupManagers=function(e,t,n){var r;return l(this,void 0,void 0,(function(){var i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return i=this._connMgr.codec.encodeModifyChannelsInput(e,t,n),o=new yo(No[No.upChannelManager],i,t),[4,this._connMgr.send(o,Ru)];case 1:return s=c.sent(),a=s.code,u=s.data,a!==re.SUCCESS?[2,{code:a,msg:null!==(r=null==u?void 0:u.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))},t.prototype.getGroupMembersByRole=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a,u,c,l,h,p,_;return d(this,(function(d){switch(d.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembersByRole",groupId:e,option:n,roleType:t}),i=new yo(No[No.qChannelMem],r,e),[4,this._connMgr.send(i,Au)];case 1:return o=d.sent(),s=o.code,a=o.data,s===re.SUCCESS&&a?(u=a.result,c=a.page,h=(l=c||{}).pageToken,p=l.hasNext,[],_=bn(u.list),[2,{code:s,data:{data:_,pageToken:p&&h?h:""}}]):[2,{code:s}]}}))}))},t.prototype.getGroupMembers=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembers",groupId:e,ids:t}),r=new yo(No[No.qChannelSpeMem],n,e),[4,this._connMgr.send(r,Au)];case 1:return i=c.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o}]:s?(a=s.result,[],u=bn(a.list),[2,{code:o,data:u}]):[2,{code:o,data:[]}]}}))}))},t.prototype.setGroupMemberInfo=function(e,t,n,r){var i;return l(this,void 0,void 0,(function(){var o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return o=this._connMgr.codec.encodeSetGroupMemberInfo(e,t,n,r),s=new yo(No[No.upChannelMem],o,e),[4,this._connMgr.send(s,Ru)];case 1:return a=l.sent(),u=a.code,c=a.data,u!==re.SUCCESS?[2,{code:u,msg:null!==(i=null==c?void 0:c.msg)&&void 0!==i?i:""}]:[2,{code:u}]}}))}))},t.prototype.searchGroupMembers=function(e,t,n){return Promise.resolve({code:re.NOT_SUPPORT})},t.prototype.joinGroup=function(e){var t;return l(this,void 0,void 0,(function(){var n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeJoinGroup("join",e),r=new yo(No[No.channelMemJoin],n,e),[4,this._connMgr.send(r,Ru)];case 1:return i=a.sent(),o=i.code,s=i.data,[2,{code:o,data:{processCode:null!==(t=null==s?void 0:s.processCode)&&void 0!==t?t:0}}]}}))}))},t.prototype.inviteUsersToGroup=function(e,t){var n,r;return l(this,void 0,void 0,(function(){var i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return i=this._connMgr.codec.encodeJoinGroup("invite",e,t),o=new yo(No[No.channelMemInvite],i,e),[4,this._connMgr.send(o,Ru)];case 1:return s=c.sent(),a=s.code,u=s.data,a!==re.SUCCESS?[2,{code:a,msg:null!==(n=null==u?void 0:u.msg)&&void 0!==n?n:""}]:[2,{code:a,data:{processCode:null!==(r=null==u?void 0:u.processCode)&&void 0!==r?r:0}}]}}))}))},t.prototype.memberInviteResponse=function(e){var t,n;return l(this,void 0,void 0,(function(){var r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return r=this._connMgr.codec.encodeMemberResponseInput(e),i=new yo(No[No.channelApplyResp],r,e.groupId),[4,this._connMgr.send(i,Ru)];case 1:return o=u.sent(),s=o.code,a=o.data,s!==re.SUCCESS?[2,{code:s,msg:null!==(t=null==a?void 0:a.msg)&&void 0!==t?t:""}]:[2,{code:s,data:{processCode:null!==(n=null==a?void 0:a.processCode)&&void 0!==n?n:0}}]}}))}))},t.prototype.getGroupApplications=function(e,t,n){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,l,h;return d(this,(function(d){switch(d.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupApplications",option:e}),n=new yo(No[No.qChannelApplyList],t,this.currentUserId),[4,this._connMgr.send(n,Au)];case 1:return r=d.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(s=o.result,a=o.page,c=(u=a||{}).pageToken,l=u.hasNext,h=Gn(null==s?void 0:s.list)||[],[2,{code:i,data:{data:h,pageToken:l&&c?c:""}}]):[2,{code:i}]}}))}))},t.prototype.getJoinedGroupsByRole=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l,h,p;return d(this,(function(d){switch(d.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroupsByRole",option:t,roleType:e}),r=new yo(No[No.qChannelMemJoin],n,this.currentUserId),[4,this._connMgr.send(r,Au)];case 1:return i=d.sent(),o=i.code,s=i.data,o===re.SUCCESS&&s?(a=s.result,u=s.page,l=(c=u||{}).pageToken,h=c.hasNext,p=Un(a.list),[2,{code:o,data:{data:p,pageToken:h&&l?l:""}}]):[2,{code:o}]}}))}))},t.prototype.searchJoinedGroups=function(e,t){return Promise.resolve({code:re.NOT_SUPPORT})},t.prototype.getJoinedGroups=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroups",ids:e}),n=new yo(No[No.qChannelMemSpeJoin],t,this.currentUserId),[4,this._connMgr.send(n,Au)];case 1:return r=u.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(s=o.result.list,a=Un(s),[2,{code:i,data:a}]):[2,{code:i}]}}))}))},t.prototype.setGroupRemark=function(e,t){return l(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeSetGroupRemark(e,t),r=new yo(No[No.upChannelRemark],n,e),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))},t.prototype.setGroupFollows=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){switch(o.label){case 0:return r=this._connMgr.codec.encodeSetGroupFollows(e,t,n),i=new yo(No[No.upChannelFollow],r,t),[4,this._connMgr.send(i)];case 1:return[2,{code:o.sent().code}]}}))}))},t.prototype.getGroupFollows=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupFollows",groupId:e}),n=new yo(No[No.qChannelFollow],t,this.currentUserId),[4,this._connMgr.send(n,Au)];case 1:return r=u.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(s=o.result,a=wn(s.list),[2,{code:i,data:a}]):[2,{code:i}]}}))}))},t.prototype.addFriend=function(e,t,n){var r;return l(this,void 0,void 0,(function(){var i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return i=this._connMgr.codec.encodeFriendInput({targetId:e,type:t,info:n}),o=new yo(No[No.friendAdd],i,this.currentUserId),[4,this._connMgr.send(o,Ru)];case 1:return s=c.sent(),a=s.code,u=s.data,a===re.SUCCESS&&u?[2,{code:a,data:{processCode:null!==(r=null==u?void 0:u.processCode)&&void 0!==r?r:0}}]:[2,{code:a}]}}))}))},t.prototype.deleteFriends=function(e,t){return l(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new yo(No[No.friendDel],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))},t.prototype.acceptFriendApplication=function(e){return l(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){switch(r.label){case 0:return t=this._connMgr.codec.encodeFriendInput({targetId:e,type:1}),n=new yo(No[No.friendHandle],t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))},t.prototype.refuseFriendApplication=function(e,t){return l(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeFriendInput({targetId:e,type:2,info:t}),r=new yo(No[No.friendHandle],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))},t.prototype.setFriendInfo=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){switch(o.label){case 0:return r=this._connMgr.codec.encodeFriendProfileInput({targetId:e,remark:t,extProfile:n}),i=new yo(No[No.friendSetPf],r,this.currentUserId),[4,this._connMgr.send(i)];case 1:return[2,{code:o.sent().code}]}}))}))},t.prototype.checkFriends=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new yo(No[No.friendCheck],n,this.currentUserId),[4,this._connMgr.send(r,Ku)];case 1:return i=u.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o}]:s?(a=s.list.map((function(e){return{userId:e.targetId,relationType:e.status}})),[2,{code:o,data:a}]):[2,{code:o,data:[]}]}}))}))},t.prototype.getFriends=function(e,t){return l(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l,h;return d(this,(function(d){switch(d.label){case 0:return n=this._connMgr.codec.encodeFriendQueryInput(11,t,e),r=new yo(No[No.friendsQuery],n,this.currentUserId),[4,this._connMgr.send(r,Au)];case 1:return i=d.sent(),o=i.code,s=i.data,o===re.SUCCESS&&s?(a=s.result,u=s.page,l=(c=u||{}).pageToken,h=c.hasNext,a&&a.list?[2,{code:o,data:{data:ql(a.list),pageToken:h&&l?l:""}}]:[2,{code:o,data:{data:[],pageToken:h&&l?l:""}}]):[2,{code:o}]}}))}))},t.prototype.getFriendApplications=function(e,t,n){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:return t=this._connMgr.codec.encodeFriendQueryInput(12,e),n=new yo(No[No.friendsQuery],t,this.currentUserId),[4,this._connMgr.send(n,Au)];case 1:return r=d.sent(),i=r.code,o=r.data,i!==re.SUCCESS?[2,{code:i}]:o?(s=o.result,a=o.page,c=(u=a||{}).pageToken,l=u.hasNext,[2,{code:i,data:{data:Kl(s),pageToken:l&&c?c:""}}]):[2,{code:i,data:{data:[],pageToken:""}}]}}))}))},t.prototype.deleteFriendApplication=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(e){return[2,{code:re.NOT_SUPPORT}]}))}))},t.prototype.getFriendsInfo=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeFriendsListInput(e),n=new yo(No[No.friendsInfoQry],t,this.currentUserId),[4,this._connMgr.send(n,ec)];case 1:return r=s.sent(),i=r.code,o=r.data,i!==re.SUCCESS?[2,{code:i}]:o?[2,{code:i,data:ql(o.list)}]:[2,{code:i,data:[]}]}}))}))},t.prototype.searchFriendsInfo=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(e){return[2,Promise.resolve({code:re.NOT_SUPPORT})]}))}))},t.prototype.setFriendAddPermission=function(e){return l(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){switch(r.label){case 0:return t=this._connMgr.codec.encodeFriendLevelSet(e),n=new yo(No[No.friendAuthSet],t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))},t.prototype.getFriendAddPermission=function(){return l(this,void 0,void 0,(function(){var e,t,n,r,i;return d(this,(function(o){switch(o.label){case 0:return e=this._connMgr.codec.encodeFriendInput({targetId:this.currentUserId}),t=new yo(No[No.friendAuthGet],e,this.currentUserId),[4,this._connMgr.send(t,zu)];case 1:return n=o.sent(),r=n.code,i=n.data,r===re.SUCCESS&&i?[2,{code:r,data:i}]:[2,{code:r}]}}))}))},t.prototype.getConversationListWithAllChannel=function(){throw new Error("Method not implemented.")},t.prototype.getConversationListWithAllChannelByPage=function(e,t){throw new Error("Method not implemented.")},t.prototype.getConversationsByPage=function(e,t,n,r,i){throw new Error("Method not implemented.")},t.prototype.getContinuousMessages=function(e,t,n,r,i,o){throw new Error("Method not implemented.")},t.prototype.getHistoryMessagesByObjectNames=function(e,t,n,r,i,o,s){throw new Error("Method not implemented.")},t.prototype.clearConversations=function(){throw new Error("Method not implemented.")},t.prototype.setUserStatusListener=function(e,t){throw new Error("Method not implemented.")},t.prototype.setUserStatus=function(e){throw new Error("Method not implemented.")},t.prototype.subscribeUserStatus=function(e){throw new Error("Method not implemented.")},t.prototype.getUserStatus=function(e){throw new Error("Method not implemented.")},t.prototype.addToBlacklist=function(e){return Promise.resolve(re.NOT_SUPPORT)},t.prototype.removeFromBlacklist=function(e){return Promise.resolve(re.NOT_SUPPORT)},t.prototype.getBlacklist=function(){return Promise.resolve({code:re.NOT_SUPPORT})},t.prototype.getBlacklistStatus=function(e){return Promise.resolve({code:re.NOT_SUPPORT})},t.prototype.insertMessage=function(e,t,n){throw new Error("Method not implemented.")},t.prototype.batchInsertMessage=function(e,t){throw new Error("Method not implemented.")},t.prototype.getMessageCount=function(e,t,n){throw new Error("Method not implemented.")},t.prototype.deleteMessages=function(e){throw new Error("Method not implemented.")},t.prototype.deleteMessagesByTimestamp=function(e,t,n,r,i){throw new Error("Method not implemented.")},t.prototype.batchClearMessagesByTimestamp=function(e){throw new Error("Method not implemented.")},t.prototype.clearMessages=function(e,t,n){throw new Error("Method not implemented.")},t.prototype.getMessage=function(e){throw new Error("Method not implemented.")},t.prototype.setMessageContent=function(e,t,n){throw new Error("Method not implemented.")},t.prototype.setMessageSearchField=function(e,t,n){throw new Error("Method not implemented.")},t.prototype.searchConversationByContent=function(e,t,n,r){throw new Error("Method not implemented.")},t.prototype.searchConversationByContentWithAllChannel=function(e,t,n){throw new Error("Method not implemented.")},t.prototype.searchMessageByContent=function(e,t,n,r,i,o){throw new Error("Method not implemented.")},t.prototype.searchMessageByContentAndMessageType=function(e,t,n,r,i,o,s){throw new Error("Method not implemented.")},t.prototype.searchMessagesByUser=function(e,t,n,r,i,o){throw new Error("Method not implemented.")},t.prototype.getMessagesByTimestamp=function(e,t,n,r){throw new Error("Method not implemented.")},t.prototype.searchMessageByContentWithAllChannel=function(e,t,n,r,i){throw new Error("Method not implemented.")},t.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,r,i,o,s){throw new Error("Method not implemented.")},t.prototype.getUnreadMentionedMessages=function(e,t){throw new Error("Method not implemented.")},t.prototype.setMessageSentStatus=function(e,t){throw new Error("Method not implemented.")},t.prototype.updateMessageReceiptStatus=function(e,t,n,r){throw new Error("Method not implemented.")},t.prototype.setMessageReceivedStatus=function(e,t){throw new Error("Method not implemented.")},t.prototype.clearData=function(){throw new Error("Method not implemented.")},t.prototype.clearUnreadCountByTimestamp=function(e,t,n,r){throw new Error("Method not implemented.")},t.prototype.setCallInfo=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return(r=this._connMgr)?(i=r.codec.encodeSetCallInfo(t,n),[4,r.send(new yo(xi,i,e),xa)]):[3,2];case 1:return o=u.sent(),s=o.code,a=o.data,s===re.SUCCESS&&a?[2,Promise.resolve({code:s,data:{key:a.key,value:a.dataContent}})]:[2,Promise.resolve({code:s})];case 2:return[2,Promise.resolve({code:re.RC_NET_CHANNEL_INVALID})]}}))}))},t.prototype.getGroupMessageDeliverList=function(e,t,n){throw new Error("Method not implemented.")},t.prototype.getPrivateMessageDeliverTime=function(e,t){throw new Error("Method not implemented.")},t.prototype.setCheckDuplicateMessage=function(e){throw new Error("Method not implemented.")},t.prototype.setCheckChatRoomDuplicateMessage=function(e){throw new Error("Method not implemented.")},t.prototype.getConversations=function(e){throw new Error("Method not implemented.")},c([zl()],t.prototype,"createGroup",null),c([zl()],t.prototype,"updateGroupInfo",null),c([zl()],t.prototype,"getGroupsInfo",null),c([zl()],t.prototype,"kickGroupMembers",null),c([zl()],t.prototype,"quitGroup",null),c([zl()],t.prototype,"dismissGroup",null),c([zl()],t.prototype,"transferGroupOwner",null),c([zl()],t.prototype,"setGroupManagers",null),c([zl()],t.prototype,"getGroupMembersByRole",null),c([zl()],t.prototype,"getGroupMembers",null),c([zl()],t.prototype,"setGroupMemberInfo",null),c([zl()],t.prototype,"joinGroup",null),c([zl()],t.prototype,"inviteUsersToGroup",null),c([zl()],t.prototype,"memberInviteResponse",null),c([zl()],t.prototype,"getGroupApplications",null),c([zl()],t.prototype,"getJoinedGroupsByRole",null),c([zl()],t.prototype,"getJoinedGroups",null),c([zl()],t.prototype,"setGroupRemark",null),c([zl()],t.prototype,"setGroupFollows",null),c([zl()],t.prototype,"getGroupFollows",null),c([zl()],t.prototype,"addFriend",null),c([zl()],t.prototype,"deleteFriends",null),c([zl()],t.prototype,"acceptFriendApplication",null),c([zl()],t.prototype,"refuseFriendApplication",null),c([zl()],t.prototype,"setFriendInfo",null),c([zl()],t.prototype,"checkFriends",null),c([zl()],t.prototype,"getFriends",null),c([zl()],t.prototype,"getFriendApplications",null),c([zl()],t.prototype,"deleteFriendApplication",null),c([zl()],t.prototype,"getFriendsInfo",null),c([zl()],t.prototype,"searchFriendsInfo",null),c([zl()],t.prototype,"setFriendAddPermission",null),c([zl()],t.prototype,"getFriendAddPermission",null),t}(ni),ed=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.joinRTCRoom=function(e,t,n,r,i,o){return l(this,void 0,void 0,(function(){var s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:return s=uc(this._context.rtcCodec,t,n,r,i,o),[4,this.rtcSignaling(e,Pr,!0,s)];case 1:return a=d.sent(),u=a.code,c=a.buffer,u===re.SUCCESS&&c&&(l=cc(this._context.rtcCodec,c)),[2,{code:u,data:l}]}}))}))},t.prototype.quitRTCRoom=function(e){return l(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return t=this._context.rtcCodec.encode(hr.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,br,!0,t)];case 1:return[2,n.sent().code]}}))}))},t.prototype.rtcPing=function(e,t,n){return l(this,void 0,void 0,(function(){return d(this,(function(r){switch(r.label){case 0:return[4,this._context.rtcPing(e,t,n)];case 1:return[2,r.sent().code]}}))}))},t.prototype.rtcPingResVersion=function(e,t,n){return this._context.rtcPing(e,t,n)},t.prototype.getRTCRoomInfo=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(hr.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Dr,!0,t)];case 1:return n=s.sent(),r=n.code,i=n.buffer,r===re.SUCCESS&&i&&(o=this._context.rtcCodec.decode(hr.RtcRoomInfoOutput,i)),[2,{code:r,data:o}]}}))}))},t.prototype.getRTCUserInfoList=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(hr.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,wr,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===re.SUCCESS&&i&&(s=cc(this._context.rtcCodec,i),o={users:s.users}),[2,{code:r,data:o}]}}))}))},t.prototype.getRTCUserInfo=function(e){throw new Error("Method not implemented.")},t.prototype.setRTCUserInfo=function(e,t,n){return l(this,void 0,void 0,(function(){var r;return d(this,(function(i){switch(i.label){case 0:return r=this._context.rtcCodec.encode(hr.RtcValueInfo,{key:t,value:n}),[4,this.rtcSignaling(e,Vr,!0,r)];case 1:return[2,i.sent().code]}}))}))},t.prototype.removeRTCUserInfo=function(e,t){return l(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(hr.RtcKeyDeleteInput,{key:t}),[4,this.rtcSignaling(e,Gr,!1,n)];case 1:return[2,r.sent().code]}}))}))},t.prototype.setRTCData=function(e,t,n,r,i,o){return l(this,void 0,void 0,(function(){var s;return d(this,(function(a){switch(a.label){case 0:return s=this._context.rtcCodec.encode(hr.RtcSetDataInput,{interior:r,target:i,key:t,value:n,objectName:null==o?void 0:o.name,content:null==o?void 0:o.content}),[4,this.rtcSignaling(e,Br,!1,s)];case 1:return[2,a.sent().code]}}))}))},t.prototype.setRTCTotalRes=function(e,t,n,r,i){return void 0===i&&(i=""),l(this,void 0,void 0,(function(){var o,s;return d(this,(function(a){switch(a.label){case 0:return o={objectName:r,content:this._context.rtcCodec.encode(hr.RtcValueInfo,{key:t.name,value:t.content},!0),valueInfo:[this._context.rtcCodec.encode(hr.RtcValueInfo,{key:"uris",value:n},!0),this._context.rtcCodec.encode(hr.RtcValueInfo,{key:"mcu_uris",value:i},!0)]},s=this._context.rtcCodec.encode(hr.RtcUserSetDataInput,o),[4,this.rtcSignaling(e,Fr,!0,s)];case 1:return[2,a.sent().code]}}))}))},t.prototype.setRTCCDNUris=function(e,t,n){return l(this,void 0,void 0,(function(){var r;return d(this,(function(i){switch(i.label){case 0:return r=this._context.rtcCodec.encode(hr.RtcUserSetDataInput,{objectName:t,valueInfo:this._context.rtcCodec.encode(hr.RtcValueInfo,{key:"cdn_uris",value:n},!0)}),[4,this.rtcSignaling(e,Fr,!0,r)];case 1:return[2,i.sent().code]}}))}))},t.prototype.getRTCData=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return i=this._context.rtcCodec.encode(hr.RtcDataInput,{interior:n,target:r,key:t}),[4,this.rtcSignaling(e,kr,!0,i)];case 1:return o=l.sent(),s=o.code,a=o.buffer,s===re.SUCCESS&&a?(u=this._context.rtcCodec.decode(hr.RtcQryOutput,a).outInfo,c={},u.forEach((function(e){c[e.key]=e.value})),[2,{code:s,data:c}]):[2,{code:s}]}}))}))},t.prototype.removeRTCData=function(e,t,n,r,i){return l(this,void 0,void 0,(function(){var o;return d(this,(function(s){switch(s.label){case 0:return o=this._context.rtcCodec.encode(hr.RtcDataInput,{interior:n,target:r,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,xr,!1,o)];case 1:return[2,s.sent().code]}}))}))},t.prototype.setRTCOutData=function(e,t,n,r){return l(this,void 0,void 0,(function(){return d(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))},t.prototype.getRTCOutData=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))},t.prototype.getRTCToken=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return r=uc(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,Hr,!0,r)];case 1:return i=u.sent(),o=i.code,s=i.buffer,o===re.SUCCESS&&s?(a=this._context.rtcCodec.decode(hr.RtcTokenOutput,s).rtcToken,[2,{code:o,data:{rtcToken:a}}]):[2,{code:o}]}}))}))},t.prototype.setRTCState=function(e,t){return l(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(hr.MCFollowInput,{state:t}),[4,this.rtcSignaling(e,Yr,!0,n)];case 1:return[2,r.sent().code]}}))}))},t.prototype.getRTCUserList=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(hr.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,qr,!0,t)];case 1:return n=s.sent(),r=n.code,i=n.buffer,r===re.SUCCESS&&i?(o=cc(this._context.rtcCodec,i),[2,{code:r,data:o}]):[2,{code:r}]}}))}))},t.prototype.joinLivingRoomAsAudience=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return r=uc(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,Kr,!0,r)];case 1:return i=l.sent(),o=i.code,s=i.buffer,o===re.SUCCESS&&s?(a=this._context.rtcCodec.decode(hr.RtcViewerJoinedOutput,s),u=a.rtcToken,c=a.entries,[2,{code:o,data:{token:u,kvEntries:c}}]):[2,{code:o}]}}))}))},t.prototype.quitLivingRoomAsAudience=function(e){return l(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){switch(r.label){case 0:return t=this._context.rtcCodec.encode(hr.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,jr,!0,t)];case 1:return n=r.sent().code,this._context.rtcKVManager.reset(),[2,n]}}))}))},t.prototype.rtcIdentityChange=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return r=this._context.rtcCodec.encode(hr.RtcInput,{roomType:Lt.LIVE,broadcastType:n,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,Wr,!0,r)];case 1:return i=u.sent(),o=i.code,s=i.buffer,o===re.SUCCESS&&s?(a=cc(this._context.rtcCodec,s),[2,{code:o,data:a}]):[2,{code:o}]}}))}))},t.prototype.requestRoomPK=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,s=e.roomId,a=this._context.rtcCodec.encode(hr.RtcInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(s,Jr,!0,a)];case 1:return u=c.sent().code,this._context.rtcKVManager.reset(),[2,u]}}))}))},t.prototype.cancelRoomPK=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,s=this._context.rtcCodec.encode(hr.RtcCancelInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,inviteInfo:i}),[4,this.rtcSignaling(o,Xr,!0,s)];case 1:return a=u.sent().code,this._context.rtcKVManager.reset(),[2,a]}}))}))},t.prototype.responseRoomPK=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:return t=e.inviteUserId,n=e.inviteRoomId,r=e.inviteSessionId,i=e.content,o=e.key,s=e.value,a=e.agree,u=e.roomId,c=this._context.rtcCodec.encode(hr.RtcInviteAnswerInput,{inviteUserId:t,inviteRoomId:n,inviteSessionId:r,content:i,key:o,value:s,answerCode:a?1:0}),[4,this.rtcSignaling(u,Zr,!0,c)];case 1:return l=d.sent().code,this._context.rtcKVManager.reset(),[2,l]}}))}))},t.prototype.endRoomPK=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return t=e.endRoomId,n=e.sessionId,r=e.content,i=e.keys,o=e.roomId,s=this._context.rtcCodec.encode(hr.RtcEndInviteInput,{inviteRoomId:t,inviteSessionId:n,inviteContent:r,inviteRoomKeys:i}),[4,this.rtcSignaling(o,zr,!0,s)];case 1:return a=u.sent().code,this._context.rtcKVManager.reset(),[2,a]}}))}))},t.prototype.registerRTCSignalListener=function(e){this._context.registerRTCSignalingListener(e)},t.prototype.rtcSignaling=function(e,t,n,r){return this._context.rtcSignaling(e,t,n,r)},t.prototype.getRTCJoinedUserInfo=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(hr.RtcQueryUserJoinedInput,{userId:e}),[4,this.rtcSignaling("",$r,!0,t)];case 1:return n=s.sent(),r=n.code,i=n.buffer,r===re.SUCCESS&&i?(o=this._context.rtcCodec.decode(hr.RtcQueryUserJoinedOutput,i).info||[],[2,{code:r,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:Mn(e.joinTime)}}))}]):[2,{code:r}]}}))}))},t}(Ri);function td(e){return u({},e)}function nd(e,t,n){var r=n.value;n.value=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1!==(null===(e=this.getNaviInfoFromCache())||void 0===e?void 0:e.userProfile)?Promise.resolve({code:re.RC_USER_PROFILE_SERVICE_UNAVAILABLE}):r.call.apply(r,h([this],t,!1))}}var rd=function(){function e(e,t){var n,r;this._runtime=e,this._token="",this._pluginContextQueue=[],this._pluginInstanseMap={},this._versionInfo={},this._typingInfo={},this._compatibleMessageProccessor=((n={})[ce.CHATROOM_MERGE_CHANGE]=this._processChrmMemChangeMessage.bind(this),n[ce.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),n[ce.INTERCEPT]=this._processInterceptMessage.bind(this),n[ce.CHATROOM_SYNC_MSG]=this._processChrmSyncMessage.bind(this),n[ce.CHATROOM_MERGE_BLOCK]=this._processChrmMemBlockMessage.bind(this),n[ce.CHATROOM_MERGE_BAN]=this._processChrmMemBanMessage.bind(this),n),this._messageProccessor=((r={})[ce.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),r[ce.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),r[ce.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),r),this._watcher={message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag:void 0,conversationTagChanged:void 0,pullFinished:void 0,readReceiptReceived:void 0,messageReceiptRequest:void 0,messageReceiptResponse:void 0,typingState:void 0,messageBlocked:void 0,ultraGroupEnable:void 0,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageModified:void 0,ultraGroupMessageRecalled:void 0,messageDelivered:void 0,groupMessageDeliveredStatus:void 0,ultraGroupChannelChangeType:void 0,ultraGroupChannelUserKicked:void 0,ultraGroupChannelDelete:void 0,userGroupStatus:void 0,messageReadReceipt:void 0,syncReadStatus:void 0,subscribedUserStatusChange:void 0,subscribedRelationChange:void 0,syncSubscribedUserStatusFinished:void 0,ownUserProfileChanged:void 0,groupOperation:void 0,groupInfoChanged:void 0,groupMemberInfoChanged:void 0,groupApplicationEvent:void 0,groupRemarkChangedSync:void 0,groupFollowsChangedSync:void 0,friendAdd:void 0,friendDelete:void 0,friendApplicationStatusChanged:void 0,friendCleared:void 0,friendInfoChangedSync:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0},this._typingInternalTimer=-1,this._typingExpireTime=2e3,this._typingChangedList=[],this._registerMessageSearchPropsMapping={},this.getChatRoomHistoryMessages=this.getChatroomHistoryMessages,this._options=u({},t),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:this._onConnectionStatusChange.bind(this,Wc.CONNECTED),onConnecting:this._onConnectionStatusChange.bind(this,Wc.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,Wc.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,Wc.DISCONNECTED),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),conversationTag:this._conversationTagListener.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageModified:this._ultraGroupMessageModifiedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this),messageDelivered:this._messageDeliveredListerer.bind(this),groupMessageDeliveredStatus:this._groupMessageDeliveredStatusListerer.bind(this),callInfo:this._callInfoListener.bind(this),ultraGroupChannelChangeType:this._ultraGroupChannelChangeTypeListener.bind(this),ultraGroupChannelUserKicked:this._ultraGroupChannelUserKickedListener.bind(this),ultraGroupChannelDelete:this._ultraGroupChannelDeleteListener.bind(this),onNaviDataChange:this._naviDataChange.bind(this),userGroupStatus:this._userGroupStatusListener.bind(this),messageReadReceipt:this._messageReadReceipt.bind(this),syncReadStatus:this._syncReadStatus.bind(this),subscribedUserStatusChange:this._subscribedUserStatusChange.bind(this),subscribedRelationChange:this._subscribedRelationChange.bind(this),syncSubscribedUserStatusFinished:this._syncSubscribedUserStatusFinished.bind(this),ownUserProfileChanged:this._ownUserProfileChanged.bind(this),groupOperation:this._groupOperation.bind(this),groupInfoChanged:this._groupInfoChanged.bind(this),groupMemberInfoChanged:this._groupMemberInfoChanged.bind(this),groupApplicationEvent:this._groupApplicationEvent.bind(this),groupRemarkChangedSync:this._groupRemarkChangedSync.bind(this),groupFollowsChangedSync:this._groupFollowsChangedSync.bind(this),friendAdd:this._friendAdd.bind(this),friendDelete:this._friendDelete.bind(this),friendApplicationStatusChanged:this._friendApplicationStatusChanged.bind(this),friendCleared:this._friendCleared.bind(this),friendInfoChangedSync:this._friendInfoChangedSync.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this)};this.rtcCodec=this.createCodec(ei,ti),this._engine=Tr()?new RCCppEngine(e,this.rtcCodec,i,this._options):new $l(e,this.rtcCodec,i,this._options),this.logger=this._engine.getInnerLogger(),this.rtcKVManager=new Lr(this._engine)}return e.init=function(t,n){if(this._context)return this._context.logger.warn(Re.A_INIT_REPEAT_O),this._context;this._context=new e(t,n),this._context.logger.info(Re.L_INIT_O,JSON.stringify({appkey:n.appkey,navigators:n.navigators,typingExpireTime:n.typingExpireTime})),this._context.logger.warn(Re.L_IMSDK_VER_O,JSON.stringify({commitId:"246873adc3e2c3f24ef961cfeb65141b67343a26",version:"5.12.1"}));var r=this._context._engine;return t.setNetworkStatusListener(r.setNetwork.bind(r)),this._context},e.getContext=function(){return this._context},e.prototype.getOptions=function(){return this._options},e.destroy=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(Re.L_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))},e.prototype.createCodec=function(e,t){return new si(e,t)},e.prototype.install=function(e,t){var n=this.logger.createTraceId();if(this.logger.info(Re.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),n),this._pluginInstanseMap[e.tag])return this.logger.warn(Re.L_INSTALL_PLUGIN_R,"repeat install",n),this._pluginInstanseMap[e.tag];var r="RCRTC"===e.tag?new ed(this):new Ri(this),i=null;try{if(!e.verify(this._runtime))return null;i=e.setup(r,this._runtime,t)}catch(e){this.logger.error(Re.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,n)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(r),this._pluginInstanseMap[e.tag]=i),i},e.prototype._onConnectionStatusChange=function(e,t){var n,r;this.logger.warn(Re.A_CONNECT_S,"status: "+e+", code: "+t),null===(r=(n=this._watcher).connection)||void 0===r||r.call(n,e,t),this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onconnectionstatechange)||void 0===r||r.call(n,e,t)}))},e.prototype._processChrmMemChangeMessage=function(e){if("function"==typeof this._watcher.chatroomState){var t={},n=[],r=e.content.memberCount,i=void 0===r?0:r;Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,n.push({userId:e.userId,action:e.status,extra:e.extra})})),this._watcher.chatroomState({userChange:{users:t,chatroomId:e.targetId,memberCount:i,userList:n}})}return!0},e.prototype._processTypingStatusMessage=function(e){if(this._addTypingInfo(td(e)),this._watcher.typingState)return!0},e.prototype._processInterceptMessage=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===oe.ULTRA_GROUP){var n=e.content.sourceType;if(t.sourceType=n,(n===me.MSG_EXPANSION||n===me.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(Re.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0},e.prototype._processChrmSyncMessage=function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyMultiLoginSync:{chatroomId:e.content.chatroomId,status:e.content.status,reason:e.content.reason,time:e.content.time,extra:e.content.extra||null}}),!0},e.prototype._processChrmMemBlockMessage=function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBlock:{chatroomId:e.content.chatroomId,operateType:e.content.operateType,durationTime:e.content.durationTime,operateTime:e.content.operateTime,userIdList:e.content.userList,extra:e.content.extra||null}}),!0},e.prototype._processChrmMemBanMessage=function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBan:{chatroomId:e.content.chatroomId,banType:e.content.operateType,durationTime:e.content.durationTime,operateTime:e.content.operateTime,userIdList:e.content.userList,extra:e.content.extra||null}}),!0},e.prototype._processReadReceiptMessage=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)},e.prototype._processReadReceiptRequestMessage=function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)},e.prototype._processReadReceiptResponseMessage=function(e){var t,n=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,r=this._engine.getCurrentUserId();n&&Array.isArray(n[r])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,n[r])},e.prototype._messageReceiver=function(e,t,n){var r,i,o,s,a=this;if(!(null===(i=(r=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(r,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(td(e))}catch(e){return a.logger.error(Re.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(s=(o=this._watcher).message)||void 0===s||s.call(o,td(e),t,n),e},e.prototype._batchMessageReceiver=function(e,t,n){var r=this,i=[],o=[],s=[ce.READ_RECEIPT,ce.READ_RECEIPT_REQUEST,ce.READ_RECEIPT_RESPONSE];e.forEach((function(e){var a=r._messageReceiver(e,t,n);a&&s.includes(a.messageType)?o.push(a):a&&i.push(a)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(Re.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.forEach((function(e){r._messageProccessor[e.messageType]&&r._messageProccessor[e.messageType](e)}))},e.prototype._chatroomInfoListener=function(e){var t,n;null===(n=(t=this._watcher).chatroomState)||void 0===n||n.call(t,e)},e.prototype._conversationInfoListener=function(e){var t,n;null===(n=(t=this._watcher).conversationState)||void 0===n||n.call(t,e)},e.prototype._expansionInfoListener=function(e){var t,n;null===(n=(t=this._watcher).expansion)||void 0===n||n.call(t,e)},e.prototype._tagListener=function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)},e.prototype._conversationTagListener=function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)},e.prototype._typingStatusListener=function(e){var t,n;null===(n=(t=this._watcher).typingState)||void 0===n||n.call(t,e)},e.prototype._pullFinishedListener=function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)},e.prototype._MessageBlockedListener=function(e){var t,n;null===(n=(t=this._watcher).messageBlocked)||void 0===n||n.call(t,e)},e.prototype._messageDeliveredListerer=function(e){var t,n;null===(n=(t=this._watcher).messageDelivered)||void 0===n||n.call(t,e)},e.prototype._groupMessageDeliveredStatusListerer=function(e){var t,n;null===(n=(t=this._watcher).groupMessageDeliveredStatus)||void 0===n||n.call(t,e)},e.prototype._callInfoListener=function(e){var t=this;this._pluginContextQueue.forEach((function(n){try{n.onCallInfo&&n.onCallInfo(e)}catch(e){t.logger.warn(Re.L_CALLBACK_E,null==e?void 0:e.stack)}}))},e.prototype._ultraGroupEnableListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupEnable)||void 0===n||n.call(t,e)},e.prototype._operateStatusListener=function(e){var t,n;null===(n=(t=this._watcher).operateStatus)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageExpansionUpdatedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageModifiedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageModified)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageRecalledListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageRecalled)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelChangeTypeListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelChangeType)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelUserKickedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelDeleteListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelDelete)||void 0===n||n.call(t,e)},e.prototype._userGroupStatusListener=function(e){var t,n;null===(n=(t=this._watcher).userGroupStatus)||void 0===n||n.call(t,e)},e.prototype._messageReadReceipt=function(e){var t,n;null===(n=(t=this._watcher).messageReadReceipt)||void 0===n||n.call(t,e)},e.prototype._syncReadStatus=function(e){var t,n;null===(n=(t=this._watcher).syncReadStatus)||void 0===n||n.call(t,e)},e.prototype._subscribedUserStatusChange=function(e){var t,n;null===(n=(t=this._watcher).subscribedUserStatusChange)||void 0===n||n.call(t,e)},e.prototype._subscribedRelationChange=function(e){var t,n;null===(n=(t=this._watcher).subscribedRelationChange)||void 0===n||n.call(t,e)},e.prototype._syncSubscribedUserStatusFinished=function(e){var t,n;this.logger.info(Re.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(n=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(t,e)},e.prototype._ownUserProfileChanged=function(e){var t,n;this.logger.info(Re.L_OWN_USER_PROFILE_CHANGED_S),null===(n=(t=this._watcher).ownUserProfileChanged)||void 0===n||n.call(t,e)},e.prototype._groupOperation=function(e){var t,n;null===(n=(t=this._watcher).groupOperation)||void 0===n||n.call(t,e)},e.prototype._groupInfoChanged=function(e){var t,n;null===(n=(t=this._watcher).groupInfoChanged)||void 0===n||n.call(t,e)},e.prototype._groupMemberInfoChanged=function(e){var t,n;null===(n=(t=this._watcher).groupMemberInfoChanged)||void 0===n||n.call(t,e)},e.prototype._groupApplicationEvent=function(e){var t,n;null===(n=(t=this._watcher).groupApplicationEvent)||void 0===n||n.call(t,e)},e.prototype._groupRemarkChangedSync=function(e){var t,n;null===(n=(t=this._watcher).groupRemarkChangedSync)||void 0===n||n.call(t,e)},e.prototype._groupFollowsChangedSync=function(e){var t,n;null===(n=(t=this._watcher).groupFollowsChangedSync)||void 0===n||n.call(t,e)},e.prototype._friendAdd=function(e){var t,n;null===(n=(t=this._watcher).friendAdd)||void 0===n||n.call(t,e)},e.prototype._friendDelete=function(e){var t,n;null===(n=(t=this._watcher).friendDelete)||void 0===n||n.call(t,e)},e.prototype._friendApplicationStatusChanged=function(e){var t,n;null===(n=(t=this._watcher).friendApplicationStatusChanged)||void 0===n||n.call(t,e)},e.prototype._friendCleared=function(e){var t,n;null===(n=(t=this._watcher).friendCleared)||void 0===n||n.call(t,e)},e.prototype._friendInfoChangedSync=function(e){var t,n;null===(n=(t=this._watcher).friendInfoChangedSync)||void 0===n||n.call(t,e)},e.prototype._rtcDataChange=function(e,t){this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onrtcdatachange)||void 0===r||r.call(n,e,t)}))},e.prototype._naviDataChange=function(e){this._pluginContextQueue.forEach((function(t){var n;null===(n=t.onnavidatachange)||void 0===n||n.call(t,e)}))},e.prototype._databaseUpgradeWillStart=function(){var e,t;this.logger.info(Re.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)},e.prototype._databaseUpgrading=function(e){var t,n;this.logger.info(Re.L_DB_UPGRATING_S,e),null===(n=(t=this._watcher).databaseUpgrading)||void 0===n||n.call(t,e)},e.prototype._databaseUpgradeDidComplete=function(e){var t,n;this.logger.info(Re.L_DB_UPGRATE_COMPLETE_S),null===(n=(t=this._watcher).databaseUpgradeDidComplete)||void 0===n||n.call(t,e)},e.prototype.assignWatcher=function(e){var t=this;Object.keys(this._watcher).forEach((function(n){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];t._watcher[n]=Xt(r)||Jt(r)?r:void 0}}))},e.prototype._resetWatcher=function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))},e.prototype._addTypingInfo=function(e){var t=e.senderUserId,n=e.conversationType,r=e.targetId,i=e.content,o=e.channelId,s=i.typingContentType,a=n+"#"+r+"#"+(o||"");this._typingInfo[a]||(this._typingInfo[a]=[]);var u=this._typingInfo[a].findIndex((function(e){return e.userId===t}));u>=0&&this._typingInfo[a][u].messageType===s?this._typingInfo[a][u].timestamp=Date.now():(u>=0&&this._typingInfo[a].splice(u,1),this._typingInfo[a].push({userId:t,messageType:s,timestamp:Date.now()}),this._typingChangedList.includes(a)||this._typingChangedList.push(a),this._startCheckTypingInfo())},e.prototype._startCheckTypingInfo=function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var n=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===n||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))},e.prototype._notifyTypingChanged=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)},e.prototype.getConnectedTime=function(){return this._engine.getConnectedTime()},e.prototype.getServerTime=function(){return this._engine.getServerTime()},e.prototype.getDeviceId=function(){return this._engine.getDeviceId()},e.prototype.getCurrentUserId=function(){return this._engine.getCurrentUserId()},e.prototype.getConnectionStatus=function(){return this._engine.getConnectionStatus()},Object.defineProperty(e.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),e.prototype.refetchNaviInfo=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))},e.prototype.connect=function(e,t,n){var r,i;return l(this,void 0,void 0,(function(){var o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:return this._token=e,[4,this._runtime.getNetworkType()];case 1:return o=d.sent(),this._engine.setNetwork({status:!0,type:o},!0),s=!!this._pluginInstanseMap.RCCallPlus,[4,this._engine.connect(e,t,s,n)];case 2:return a=d.sent(),u=a.code,c=a.data,u!==re.SUCCESS?[2,{code:u}]:(1!==this._engine.getNaviInfoFromCache().type&&(l=_n.getInfo(),null===(i=(r=this._engine).reportSDKInfo)||void 0===i||i.call(r,l)),[2,{code:u,userId:c}])}}))}))},e.prototype.disconnect=function(e){return l(this,void 0,void 0,(function(){var t=this;return d(this,(function(n){switch(n.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e)];case 1:return n.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){t.logger.error(Re.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},e.prototype.reconnect=function(e){return this.connect(this.token,!!e,this.logger.createTraceId())},e.prototype._getTokenWithoutNavi=function(){return this._token.replace(/@.+$/,"@")},e.prototype._channelIdConvert=function(e,t){if(e!==oe.ULTRA_GROUP)return t;var n=this.getNaviInfoFromCache();return!!(2&((null==n?void 0:n.ugDriven)||0))&&!t?"RCDefault":t},e.prototype.getNaviInfoFromCache=function(){return this._engine.getNaviInfoFromCache()},e.prototype.registerMessageType=function(e,t,n,r,i){void 0===r&&(r=[]),void 0===i&&(i=!1),Yt(r)&&r.length>0&&(this._registerMessageSearchPropsMapping[e]=r),this._engine.registerMessageType(e,t,n,r,i)},e.prototype.registerRTCSignalingListener=function(e){this._engine.registerRTCSignalingListener(e)},e.prototype.checkSearchPropsMsg=function(e,t){var n=this._registerMessageSearchPropsMapping[e],r={};return n&&Jt(t)&&Object.keys(t).forEach((function(e){if(n.includes(e)){var i=t[e];xt(i)&&(i>-Math.pow(2,64)&&i<Math.pow(2,64)&&Number.isInteger(i)||(r[e]=i))}})),Object.keys(r).length>0?{msg:JSON.stringify(r),code:re.SEARCH_PROPS_LIMIT_ERROR}:{code:re.SUCCESS}},e.prototype._handleExpansioResult=function(e,t){if(t){var n=ln(e),r=n.isIllgalEx,i=n.isExKeyOrValLengthExceedLimit;return n.isExceedLimit||i?re.EXPANSION_LIMIT_EXCEET:r?re.INVALID_PARAMETER_MESSAGE_EXPANSION:void 0}},e.prototype.sendMessage=function(e,t,n,r,i){var o=this.checkSearchPropsMsg(n.messageType,n.content),s=o.code,a=o.msg;if(s!==re.SUCCESS)return Promise.resolve({code:s,msg:a});if(e===oe.SYSTEM&&n.messageType!==ce.SYNC_READ_STATUS)return Promise.resolve({code:re.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE});var u=n.canIncludeExpansion,c=void 0!==u&&u,l=n.expansion,d=this._handleExpansioResult(l,c);if(d)return Promise.resolve({code:d});var h=n.isMentioned,p=n.mentionedUserIdList,_=n.mentionedType;h&&[oe.GROUP,oe.ULTRA_GROUP].includes(e)?n.content.mentionedInfo=cr(n.content,p,_):delete n.content.mentionedInfo;var g,f,T=JSON.stringify(n.content);if(g=T,void 0===f&&(f="utf-8"),("utf-16"===f?E(g):I(g))>O)return Promise.resolve({code:re.RC_MSG_CONTENT_EXCEED_LIMIT});if(e===oe.ULTRA_GROUP)return n.channelId=this._channelIdConvert(e,n.channelId),this._engine.sendUltraMessage(t,n,r,i);var R=this.getNaviInfoFromCache();return(null==R?void 0:R.grpRRVer)&&n.messageType===ce.READ_RECEIPT_RESPONSE?Promise.resolve({code:re.READ_RECEIPT_ERROR}):this._engine.sendMessage(e,t,n,r,i)},e.prototype.sendExpansionMessage=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,l,h;return d(this,(function(d){switch(d.label){case 0:return t=e.channelId,n=e.conversationType,r=e.targetId,i=e.messageUId,o=e.keys,s=e.expansion,a=e.removeAll,e.canIncludeExpansion?(u=ln(s),c=u.isIllgalEx,l=u.isExKeyOrValLengthExceedLimit,u.isExceedLimit||l?[2,Promise.resolve({code:re.EXPANSION_LIMIT_EXCEET})]:c?[2,Promise.resolve({code:re.INVALID_PARAMETER_MESSAGE_EXPANSION})]:(h={mid:i},s&&(h.put=s),o&&(h.del=o),a&&(h.removeAll=1),[4,this._engine.sendMessage(n,r,{content:h,messageType:ce.EXPANSION_NOTIFY,channelId:t})])):[2,{code:re.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:d.sent().code}]}}))}))},e.prototype.sendReadReceiptMessage=function(e,t,n){return l(this,void 0,void 0,(function(){var r;return d(this,(function(i){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:re.READ_RECEIPT_ERROR,msg:"The read receipt switch is not on, please call the sendMessage method!"}]:[2,this._engine.sendReadReceiptMessage(e,t,n)]}))}))},e.prototype.getMessageReader=function(e,t,n){return l(this,void 0,void 0,(function(){var r;return d(this,(function(i){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:re.READ_RECEIPT_ERROR}]:[2,this._engine.getMessageReader(e,t,n||"")]}))}))},e.prototype.sendReadReceiptMessageV4=function(e,t,n){return l(this,void 0,void 0,(function(){return d(this,(function(r){return[2,this._engine.sendReadReceiptMessageV4(e,t,n)]}))}))},e.prototype.getMessageReadReceiptV4=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return[2,this._engine.getMessageReadReceiptV4(e,t)]}))}))},e.prototype.batchGetMessageReadReceiptInfoV4=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return[2,this._engine.batchGetMessageReadReceiptInfoV4(e,t)]}))}))},e.prototype.updateConversationReadTime=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return[2,this._engine.updateConversationReadTime(e,t)]}))}))},e.prototype._destroy=function(){return l(this,void 0,void 0,(function(){var e=this;return d(this,(function(t){switch(t.label){case 0:return this._resetWatcher(),this._engine.destroy(),this._runtime.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(Re.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))},e.prototype.getHistoryMessage=function(e,t,n,r,i,o,s,a){var u={timestamp:n||0,count:r||20,order:i||0,channelId:o||""};if(e===oe.ULTRA_GROUP){var c=this._channelIdConvert(e,u.channelId);return u.channelId=c,this._engine.getUltraHistoryMsg(t,u,a)}return this._engine.getHistoryMessage(e,t,u.timestamp,u.count,u.order,u.channelId,s||"",a)},e.prototype.getMessages=function(e,t,n,r,i,o,s){var a={timestamp:n||0,count:r||20,order:i||0,channelId:o||""};if(e===oe.ULTRA_GROUP){var u=this._channelIdConvert(e,a.channelId);return a.channelId=u,this._engine.getUltraHistoryMsg(t,a,s)}return this._engine.getMessages(e,t,a.timestamp,a.count,a.order,a.channelId,s)},e.prototype.getContinuousMessages=function(e,t,n,r,i,o){return void 0===n&&(n=0),void 0===r&&(r=20),void 0===i&&(i=0),void 0===o&&(o=""),this._engine.getContinuousMessages(e,t,n,r,i,o)},e.prototype.getHistoryMessagesByObjectNames=function(e,t,n,r,i,o,s){return this._engine.getHistoryMessagesByObjectNames(e,t,n,r,i,o,s)},e.prototype.getConversationList=function(e,t,n,r,i){if(t===oe.ULTRA_GROUP){var o=re.METHOD_NOT_SUPPORT;return Promise.resolve({code:o,msg:re[o]})}return this._engine.getConversationList(e||300,t,n,r,i||"")},e.prototype.getConversationsByPage=function(e,t,n,r,i){return this._engine.getConversationsByPage(e,t,n,r,i)},e.prototype.getConversation=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversation(e,t,r||"")},e.prototype.removeConversation=function(e,t,n){return e===oe.ULTRA_GROUP?Promise.resolve(re.METHOD_NOT_SUPPORT):this._engine.removeConversation(e,t,n||"")},e.prototype.batchRemoveConversation=function(e){return this._engine.batchRemoveConversation(e)},e.prototype.getUltraGroupList=function(e){return this._engine.getUltraGroupList(e)},e.prototype.getBlockUltraGroupList=function(){return this._engine.getBlockUltraGroupList()},e.prototype.getTopUltraGroupList=function(){return this._engine.getTopUltraGroupList()},e.prototype.clearUnreadCount=function(e,t,n){if(e===oe.ULTRA_GROUP){var r=this._channelIdConvert(e,n);return this._engine.clearUltraUnreadcount(t,r||"")}return this._engine.clearConversationUnreadCount(e,t,n||"")},e.prototype.clearAllUnreadCount=function(){return this._engine.clearAllUnreadCount()},e.prototype.getUnreadCount=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationUnreadCount(e,t,r||"")},e.prototype.getTotalUnreadCount=function(e,t,n){if(t&&t.includes(oe.ULTRA_GROUP)){var r=re.METHOD_NOT_SUPPORT;return Promise.resolve({code:r,msg:re[r]})}return this._engine.getAllConversationUnreadCount(e,t&&t.length>0?t:[oe.PRIVATE,oe.GROUP,oe.SYSTEM,oe.PUBLIC_SERVICE],!!n)},e.prototype.getTotalUnreadCountByLevels=function(e,t,n){return this._engine.getTotalUnreadCountByLevels(e,t,n)},e.prototype.getFirstUnreadMessage=function(e,t,n){return this._engine.getFirstUnreadMessage(e,t,n||"")},e.prototype.getFirstUnreadMessageInfo=function(e,t,n){return this._engine.getFirstUnreadMessageInfo(e,t,n)},e.prototype.setConversationNotificationLevel=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i;return d(this,(function(o){return i=this._channelIdConvert(e,r),[2,this._engine.setConversationNotificationLevel(e,t,n,i||"")]}))}))},e.prototype.batchSetConversationNotificationLevel=function(e,t){return this._engine.batchSetConversationNotificationLevel(e,t)},e.prototype.setConversationStatus=function(e,t,n,r,i,o){if(void 0===o&&(o=!0),e===oe.ULTRA_GROUP&&void 0!==n)return Promise.resolve(re.METHOD_NOT_SUPPORT);var s=[{conversationType:e,targetId:t,isTop:n,notificationStatus:r,channelId:this._channelIdConvert(e,i)||"",isUpdateTime:o}];return this._engine.batchSetConversationStatus(s)},e.prototype.batchSetConversationToTop=function(e,t,n){return this._engine.batchSetConversationToTop(e,t,!!n)},e.prototype.saveConversationMessageDraft=function(e,t,n,r){var i=this._channelIdConvert(e,r);return this._engine.saveConversationMessageDraft(e,t,n,i||"")},e.prototype.getConversationMessageDraft=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationMessageDraft(e,t,r||"")},e.prototype.clearConversationMessageDraft=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.clearConversationMessageDraft(e,t,r||"")},e.prototype.recallMessage=function(e,t,n,r,i){var o=this._channelIdConvert(e,i.channelId);return i.channelId=o||"",this._engine.recallMsg(e,t,n,r,i)},e.prototype.deleteRemoteMessage=function(e,t,n,r){if(e===oe.ULTRA_GROUP&&Tr())return Promise.resolve(re.METHOD_NOT_SUPPORT);var i=this._channelIdConvert(e,r);return this._engine.deleteRemoteMessage(e,t,n,i||"")},e.prototype.deleteRemoteMessageByTimestamp=function(e,t,n,r){var i=this._channelIdConvert(e,r);return this._engine.deleteRemoteMessageByTimestamp(e,t,n,i||"")},e.prototype.joinChatroom=function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinChatroom(e,t,r,n)},e.prototype.joinExistChatroom=function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinExistChatroom(e,t,r,n)},e.prototype.quitChatroom=function(e){return this._engine.quitChatroom(e)},e.prototype.getChatroomInfo=function(e,t,n){return this._engine.getChatroomInfo(e,t||0,n||0)},e.prototype.setChatroomEntry=function(e,t){var n=t.key,r=t.value;return zn(n)?$n(r)?this._engine.setChatroomEntry(e,t):Promise.resolve(re.INVALID_PARAMETER_VALUE):Promise.resolve(re.INVALID_PARAMETER_KEY)},e.prototype.setChatroomEntries=function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n],i=r.key,o=r.value;if(!zn(i))return Promise.resolve({code:re.INVALID_PARAMETER_KEY});if(!$n(o))return Promise.resolve({code:re.INVALID_PARAMETER_VALUE})}var s=u(u({},t),{isOverwrite:t.isForce});return this._engine.setChatroomEntries(e,s)},e.prototype.forceSetChatroomEntry=function(e,t){var n=t.key,r=t.value;return zn(n)?$n(r)?this._engine.forceSetChatroomEntry(e,t):Promise.resolve(re.INVALID_PARAMETER_VALUE):Promise.resolve(re.INVALID_PARAMETER_KEY)},e.prototype.removeChatroomEntry=function(e,t){var n=t.key;return zn(n)?this._engine.removeChatroomEntry(e,t):Promise.resolve(re.INVALID_PARAMETER_KEY)},e.prototype.removeChatroomEntries=function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n].key;if(!zn(r))return Promise.resolve({code:re.INVALID_PARAMETER_KEY})}return this._engine.removeChatroomEntries(e,t)},e.prototype.forceRemoveChatroomEntry=function(e,t){var n=t.key;return zn(n)?this._engine.forceRemoveChatroomEntry(e,t):Promise.resolve(re.INVALID_PARAMETER_KEY)},e.prototype.getChatroomEntry=function(e,t){return this._engine.getChatroomEntry(e,t)},e.prototype.getAllChatroomEntries=function(e){return this._engine.getAllChatroomEntry(e)},e.prototype.getChatroomHistoryMessages=function(e,t,n,r){return this._engine.getChatroomHistoryMessages(e,r||0,t||20,n||0)},e.prototype.getFileToken=function(e,t,n,r,i,o){return l(this,void 0,void 0,(function(){var s,a,u,c,l,h,p;return d(this,(function(d){switch(d.label){case 0:return s=this.getNaviInfoFromCache(),a=(null==s?void 0:s.bosAddr)||"",u=(null==s?void 0:s.uploadServer)||"",c=(null==s?void 0:s.ossConfig)||"",[4,this._engine.getFileToken(e,t,n,r,i,o)];case 1:return l=d.sent(),h=l.code,p=l.data,h===re.SUCCESS&&p?[2,Promise.resolve(Object.assign(p,{bos:a,qiniu:u,ossConfig:c}))]:[2,Promise.reject(h)]}}))}))},e.prototype.getFileUrl=function(e,t,n,r,i){return void 0===i&&(i=Ee.QINIU),l(this,void 0,void 0,(function(){var o,s,a;return d(this,(function(u){switch(u.label){case 0:return(null==r?void 0:r.isBosRes)?[2,Promise.resolve(r)]:[4,this._engine.getFileUrl(e,i,t,n)];case 1:return o=u.sent(),s=o.code,a=o.data,s===re.SUCCESS?[2,Promise.resolve(a)]:[2,Promise.reject(s)]}}))}))},e.prototype.createTag=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.createTag(e)]}))}))},e.prototype.removeTag=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.removeTag(e)]}))}))},e.prototype.updateTag=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.updateTag(e)]}))}))},e.prototype.getTagList=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){return[2,this._engine.getTagList()]}))}))},e.prototype.addTagForConversations=function(e,t){return l(this,void 0,void 0,(function(){var n,r=this;return d(this,(function(i){return t.length>1e3?[2,Promise.resolve({code:re.CONVER_OUT_LIMIT_ERROR})]:(n=t.map((function(e){var t=e.conversationType,n=e.targetId,i=e.channelId;return{conversationType:t,targetId:n,channelId:r._channelIdConvert(t,i)}})),[2,this._engine.addTagForConversations(e,n)])}))}))},e.prototype.removeTagForConversations=function(e,t){return l(this,void 0,void 0,(function(){var n,r=this;return d(this,(function(i){return n=t.map((function(e){var t=e.conversationType,n=e.targetId,i=e.channelId;return{conversationType:t,targetId:n,channelId:r._channelIdConvert(t,i)}})),[2,this._engine.removeTagForConversations(e,n)]}))}))},e.prototype.removeTagsForConversation=function(e,t){return l(this,void 0,void 0,(function(){var n;return d(this,(function(r){return n=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=n,[2,this._engine.removeTagsForConversation(e,t)]}))}))},e.prototype.getConversationListByTag=function(e,t,n,r){return l(this,void 0,void 0,(function(){return d(this,(function(i){return[2,this._engine.getConversationListByTag(e,t,n,r)]}))}))},e.prototype.getUnreadCountByTag=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return[2,this._engine.getUnreadCountByTag(e,t)]}))}))},e.prototype.setConversationStatusInTag=function(e,t,n){return l(this,void 0,void 0,(function(){var r;return d(this,(function(i){return r=this._channelIdConvert(t.conversationType,t.channelId),t.channelId=r,[2,this._engine.setConversationStatusInTag(e,t,n)]}))}))},e.prototype.getTagsForConversation=function(e){return l(this,void 0,void 0,(function(){var t;return d(this,(function(n){return t=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=t,[2,this._engine.getTagsForConversation(e)]}))}))},e.prototype.getBlockConversationList=function(){return this._engine.getBlockConversationList()},e.prototype.getTopConversationList=function(e,t){return e&&0!==e.length||(e=[oe.PRIVATE,oe.CHATROOM,oe.GROUP,oe.SYSTEM,oe.APP_PUBLIC_SERVICE,oe.PUBLIC_SERVICE]),this._engine.getTopConversationList(e,t||"")},e.prototype.getUnreadConversationList=function(e){return e&&0!==e.length||(e=[oe.PRIVATE,oe.CHATROOM,oe.GROUP,oe.SYSTEM,oe.APP_PUBLIC_SERVICE,oe.PUBLIC_SERVICE]),this._engine.getUnreadConversationList(e)},e.prototype.getUnreadMentionedCount=function(e){var t=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=t,this._engine.getUnreadMentionedCount(e)},e.prototype.getAllUnreadMentionedCount=function(){return this._engine.getAllUnreadMentionedCount()},e.prototype.sendUltraGroupTypingStatus=function(e){if(e.conversationType!==oe.ULTRA_GROUP){var t=re.CONVERSATION_TYPE_NOT_SUPPORT;return Promise.resolve({code:t,msg:re[t]})}var n=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=n,this._engine.sendUltraGroupTypingStatus(e)},e.prototype.getUltraGroupMessageListByMessageUId=function(e){var t=this,n=e.messages.map((function(n){var r=n.sendTime,i=n.messageUId,o=n.channelId;return{sendTime:r,messageUId:i,channelId:t._channelIdConvert(e.conversationType,o)}}));return e.messages=n,this._engine.getUltraGroupMessageListByMessageUId(e)},e.prototype.expandUltraMessage=function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return t=e.conversationType,n=e.expansion,r=e.canIncludeExpansion,t!==oe.ULTRA_GROUP?[2,{code:i=re.CONVERSATION_TYPE_NOT_SUPPORT,msg:re[i]}]:r?(o=ln(n),s=o.isIllgalEx,a=o.isExKeyOrValLengthExceedLimit,o.isExceedLimit||a?[2,{code:re.EXPANSION_LIMIT_EXCEET}]:s?[2,{code:re.INVALID_PARAMETER_MESSAGE_EXPANSION}]:[4,this._engine.expandUltraMessage(e)]):[2,{code:re.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:u.sent().code}]}}))}))},e.prototype.modifyMessage=function(e){return l(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return e.conversationType!==oe.ULTRA_GROUP?[2,{code:t=re.CONVERSATION_TYPE_NOT_SUPPORT,msg:re[t]}]:[4,this._engine.modifyMessage(e)];case 1:return[2,{code:n.sent().code}]}}))}))},e.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){return this._engine.getUltraGroupUnreadMentionedCountByTargetId(e,t)},e.prototype.getUltraGroupUnreadCountByTargetId=function(e,t){return this._engine.getUltraGroupUnreadCountByTargetId(e,t)},e.prototype.getAllUltraGroupUnreadCount=function(e){return void 0===e&&(e=!1),this._engine.getAllUltraGroupUnreadCount(e)},e.prototype.getAllConversationState=function(){return this._engine.getAllConversationState()},e.prototype.getUltraGroupUnreadMentionedMessages=function(e){var t=this._channelIdConvert(oe.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupUnreadMentionedMessages(e)},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(e){var t=this._channelIdConvert(oe.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupFirstUnreadMessageTimestamp(e)},e.prototype.getUltraGroupUnreadInfoList=function(e){return this._engine.getUltraGroupUnreadInfoList(e)},e.prototype.callExtra=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(t=this._engine).callExtra.apply(t,h([e],n,!1))},e.prototype.getOSInfo=function(){return this._engine.getOSInfo()},e.prototype.getProcessInfo=function(){return this._engine.getProcessInfo()},e.prototype.getMainProcessInfo=function(){return this._engine.getMainProcessInfo()},e.prototype.setCallInfo=function(e,t,n){return this._engine.setCallInfo(e,t,n)},e.prototype.getGroupMessageDeliverList=function(e,t,n){return void 0===n&&(n=""),this._engine.getGroupMessageDeliverList(e,t,n)},e.prototype.getPrivateMessageDeliverTime=function(e,t){return void 0===t&&(t=""),this._engine.getPrivateMessageDeliverTime(e,t)},e.prototype._isEnableSubDriven=function(e){var t=(this.getNaviInfoFromCache()||{}).subDriven,n=void 0===t?0:t;switch(e){case nt.ONLINE_STATUS:return 1&n;case nt.USER_PROFILE:return 2&n;default:return!1}},e.prototype.subscribeUser=function(e,t,n){return this._isEnableSubDriven(t)?this._engine.subscribeUser(e,t,n):Promise.resolve({code:re.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.unSubscribeUser=function(e,t){return this._isEnableSubDriven(t)?this._engine.unSubscribeUser(e,t):Promise.resolve({code:re.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.getSubscribeUserList=function(e,t,n){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserList(e,t,n):Promise.resolve({code:re.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.getSubscribeUserStatus=function(e,t){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserStatus(e,t):Promise.resolve({code:re.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.updateMyUserProfile=function(e){return this._engine.updateMyUserProfile(e)},e.prototype.getUserProfiles=function(e){return this._engine.getUserProfiles(e)},e.prototype.getMyUserProfile=function(){return this._engine.getMyUserProfile()},e.prototype.updateMyUserProfileVisibility=function(e){return this._engine.updateMyUserProfileVisibility(e)},e.prototype.getMyUserProfileVisibility=function(){return this._engine.getMyUserProfileVisibility()},e.prototype.searchUserProfileByUniqueId=function(e){return this._engine.searchUserProfileByUniqueId(e)},e.prototype.clearConversations=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return[2,this._engine.clearConversations(e,t)]}))}))},e.prototype.setUserStatusListener=function(e,t){var n=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){n.logger.error(Re.L_CALLBACK_E,null==e?void 0:e.stack)}}))},e.prototype.addToBlacklist=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.addToBlacklist(e)]}))}))},e.prototype.removeFromBlacklist=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.removeFromBlacklist(e)]}))}))},e.prototype.getBlacklist=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){return[2,this._engine.getBlacklist()]}))}))},e.prototype.getBlacklistStatus=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.getBlacklistStatus(e)]}))}))},e.prototype.insertMessage=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o;return d(this,(function(s){return r=this.checkSearchPropsMsg(n.messageType,n.content),i=r.code,o=r.msg,i!==re.SUCCESS?[2,Promise.resolve({code:i,msg:o})]:[2,this._engine.insertMessage(e,t,n)]}))}))},e.prototype.batchInsertMessage=function(e,t){return this._engine.batchInsertMessage(e,t)},e.prototype.getMessageCount=function(e,t,n){return void 0===n&&(n=""),l(this,void 0,void 0,(function(){return d(this,(function(r){return[2,this._engine.getMessageCount(e,t,n)]}))}))},e.prototype.deleteMessages=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.deleteMessages(e)]}))}))},e.prototype.deleteMessagesByTimestamp=function(e,t,n,r,i){return void 0===i&&(i=""),l(this,void 0,void 0,(function(){return d(this,(function(o){return[2,this._engine.deleteMessagesByTimestamp(e,t,n,!!r,i)]}))}))},e.prototype.batchClearMessagesByTimestamp=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.batchClearMessagesByTimestamp(e)]}))}))},e.prototype.batchClearRemoteHistoryMessages=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return[2,this._engine.batchClearRemoteHistoryMessages(e,t)]}))}))},e.prototype.clearMessages=function(e,t,n){return void 0===n&&(n=""),l(this,void 0,void 0,(function(){return d(this,(function(r){return[2,this._engine.clearMessages(e,t,n)]}))}))},e.prototype.getMessage=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.getMessage(e)]}))}))},e.prototype.setMessageContent=function(e,t,n){return l(this,void 0,void 0,(function(){return d(this,(function(r){return[2,this._engine.setMessageContent(e,t,n)]}))}))},e.prototype.setMessageSearchField=function(e,t,n){return l(this,void 0,void 0,(function(){return d(this,(function(r){return[2,this._engine.setMessageSearchField(e,t,n)]}))}))},e.prototype.setMessageSentStatus=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return[2,this._engine.setMessageSentStatus(e,t)]}))}))},e.prototype.setMessageReceivedStatus=function(e,t){return l(this,void 0,void 0,(function(){return d(this,(function(n){return[2,this._engine.setMessageReceivedStatus(e,t)]}))}))},e.prototype.setMessageStatusToRead=function(e,t,n,r){return l(this,void 0,void 0,(function(){return d(this,(function(i){return[2,this._engine.updateMessageReceiptStatus(e,t,n,r)]}))}))},e.prototype.setUserStatus=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))},e.prototype.subscribeUserStatus=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))},e.prototype.getUserStatus=function(e){return l(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))},e.prototype.searchConversationByContent=function(e,t,n,r){return void 0===t&&(t=[]),l(this,void 0,void 0,(function(){return d(this,(function(i){return[2,this._engine.searchConversationByContent(e,t,n||"",r)]}))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n){return void 0===t&&(t=[]),l(this,void 0,void 0,(function(){return d(this,(function(r){return[2,this._engine.searchConversationByContentWithAllChannel(e,t,n)]}))}))},e.prototype.searchMessageByContent=function(e,t,n,r,i,o,s){return void 0===s&&(s=""),l(this,void 0,void 0,(function(){return d(this,(function(a){return[2,this._engine.searchMessageByContent(e,t,n,r,i,o,s)]}))}))},e.prototype.searchMessageByContentAndMessageType=function(e,t,n,r,i,o,s){return l(this,void 0,void 0,(function(){return d(this,(function(a){return[2,this._engine.searchMessageByContentAndMessageType(e,t,n,r,i,o,s)]}))}))},e.prototype.searchMessagesByUser=function(e,t,n,r,i,o){return void 0===i&&(i=5),void 0===o&&(o=""),l(this,void 0,void 0,(function(){return d(this,(function(s){return[2,this._engine.searchMessagesByUser(e,t,n,r,i,o)]}))}))},e.prototype.getMessagesByTimestamp=function(e,t,n,r){return l(this,void 0,void 0,(function(){return d(this,(function(i){return[2,this._engine.getMessagesByTimestamp(e,t,n,r)]}))}))},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,r,i){return l(this,void 0,void 0,(function(){return d(this,(function(o){return[2,this._engine.searchMessageByContentWithAllChannel(e,t,n,r,i)]}))}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,r,i,o,s){return l(this,void 0,void 0,(function(){return d(this,(function(a){return[2,this._engine.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,r,i,o,s)]}))}))},e.prototype.getUnreadMentionedMessages=function(e,t,n){return void 0===n&&(n=""),this._engine.getUnreadMentionedMessages(e,t,n)},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,r){return void 0===r&&(r=""),this._engine.clearUnreadCountByTimestamp(e,t,n,r)},e.prototype.getUltraGroupDefaultNotificationLevel=function(e,t){var n=this._channelIdConvert(oe.ULTRA_GROUP,t);return this._engine.getUltraGroupDefaultNotificationLevel(e,n||"")},e.prototype.setUltraGroupDefaultNotificationLevel=function(e,t,n){var r=this._channelIdConvert(oe.ULTRA_GROUP,n);return this._engine.setUltraGroupDefaultNotificationLevel(e,t,r||"")},e.prototype.getConversationNotificationLevel=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationNotificationLevel(e,t,r||"")},e.prototype.setConversationTypeNotificationLevel=function(e,t){return this._engine.setConversationTypeNotificationLevel(e,t)},e.prototype.getConversationTypeNotificationLevel=function(e){return this._engine.getConversationTypeNotificationLevel(e)},e.prototype.getConversationNotificationStatus=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationNotificationStatus(e,t,r||"")},e.prototype.getRemoteHistoryMessages=function(e,t,n,r,i,o){return this._engine.getRemoteHistoryMessages(e,t,n,r,i,o)},e.prototype.getConversationListWithAllChannel=function(){return this._engine.getConversationListWithAllChannel()},e.prototype.getConversationListWithAllChannelByPage=function(e,t){return this._engine.getConversationListWithAllChannelByPage(e,t)},e.prototype.clearData=function(){return l(this,void 0,void 0,(function(){return d(this,(function(e){return[2,this._engine.clearData()]}))}))},e.prototype.createLogger=function(e,t){return this._engine.createLogger(e,t)},e.prototype.createStatisticLogger=function(e,t){return this._engine.createStatisticLogger(e,t)},e.prototype.getConversations=function(e){return this._engine.getConversations(e)},e.prototype.setCheckDuplicateMessage=function(e){return this._engine.setCheckDuplicateMessage(e)},e.prototype.setCheckChatRoomDuplicateMessage=function(e){return this._engine.setCheckChatRoomDuplicateMessage(e)},e.prototype.rtcSignaling=function(e,t,n,r){return this._engine.rtcSignaling(e,t,n,r)},e.prototype.rtcPing=function(e,t,n){return this._engine.rtcPing(e,t,n)},e.prototype.bindRTCRoomForChatroom=function(e){return this._engine.bindRTCRoomForChatroom(e)},e.prototype.setProxy=function(e){return this._engine.setProxy(e)},e.prototype.getProxy=function(){return this._engine.getProxy()},e.prototype.testProxy=function(e,t){return this._engine.testProxy(e,t)},e.prototype.createGroup=function(e,t,n,r){return void 0===r&&(r=[]),this._engine.createGroup(e,t,n,r)},e.prototype.updateGroupInfo=function(e,t,n){return this._engine.updateGroupInfo(e,t,n)},e.prototype.getGroupsInfo=function(e){return this._engine.getGroupsInfo(e)},e.prototype.kickGroupMembers=function(e,t,n){return this._engine.kickGroupMembers(e,t,n)},e.prototype.quitGroup=function(e,t){return this._engine.quitGroup(e,t)},e.prototype.dismissGroup=function(e){return this._engine.dismissGroup(e)},e.prototype.transferGroupOwner=function(e,t,n,r){return void 0===r&&(r=!1),this._engine.transferGroupOwner(e,t,r,n)},e.prototype.setGroupManagers=function(e,t,n){return this._engine.setGroupManagers(e,t,n)},e.prototype.getGroupMembersByRole=function(e,t,n){return this._engine.getGroupMembersByRole(e,t,n)},e.prototype.getGroupMembers=function(e,t){return this._engine.getGroupMembers(e,t)},e.prototype.setGroupMemberInfo=function(e,t,n,r){return this._engine.setGroupMemberInfo(e,t,n,r)},e.prototype.searchGroupMembers=function(e,t,n){return this._engine.searchGroupMembers(e,t,n)},e.prototype.joinGroup=function(e){return this._engine.joinGroup(e)},e.prototype.inviteUsersToGroup=function(e,t){return this._engine.inviteUsersToGroup(e,t)},e.prototype.acceptGroupInvite=function(e,t){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:It.ACCEPT})},e.prototype.refuseGroupInvite=function(e,t,n){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:It.REFUSE,reason:n})},e.prototype.acceptGroupApplication=function(e,t,n){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:It.ACCEPT})},e.prototype.refuseGroupApplication=function(e,t,n,r){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:It.REFUSE,reason:r})},e.prototype.getGroupApplications=function(e,t,n){return this._engine.getGroupApplications(e,t,n)},e.prototype.getJoinedGroupsByRole=function(e,t){return this._engine.getJoinedGroupsByRole(e,t)},e.prototype.searchJoinedGroups=function(e,t){return this._engine.searchJoinedGroups(e,t)},e.prototype.getJoinedGroups=function(e){return this._engine.getJoinedGroups(e)},e.prototype.setGroupRemark=function(e,t){return this._engine.setGroupRemark(e,t)},e.prototype.addGroupFollows=function(e,t){return this._engine.setGroupFollows(ft.ADD,e,t)},e.prototype.removeGroupFollows=function(e,t){return this._engine.setGroupFollows(ft.REMOVE,e,t)},e.prototype.getGroupFollows=function(e){return this._engine.getGroupFollows(e)},e.prototype.addFriend=function(e,t,n){return this._engine.addFriend(e,t,n)},e.prototype.deleteFriends=function(e,t){return this._engine.deleteFriends(e,t)},e.prototype.acceptFriendApplication=function(e){return this._engine.acceptFriendApplication(e)},e.prototype.refuseFriendApplication=function(e,t){return this._engine.refuseFriendApplication(e,t)},e.prototype.setFriendInfo=function(e,t,n){return this._engine.setFriendInfo(e,t,n)},e.prototype.checkFriends=function(e,t){return this._engine.checkFriends(e,t)},e.prototype.getFriends=function(e,t){return this._engine.getFriends(e,t)},e.prototype.getFriendApplications=function(e,t,n){return this._engine.getFriendApplications(e,t,n)},e.prototype.getFriendsInfo=function(e){return this._engine.getFriendsInfo(e)},e.prototype.searchFriendsInfo=function(e){return this._engine.searchFriendsInfo(e)},e.prototype.setFriendAddPermission=function(e){return this._engine.setFriendAddPermission(e)},e.prototype.getFriendAddPermission=function(){return this._engine.getFriendAddPermission()},c([nd],e.prototype,"updateMyUserProfile",null),c([nd],e.prototype,"getUserProfiles",null),c([nd],e.prototype,"getMyUserProfile",null),c([nd],e.prototype,"updateMyUserProfileVisibility",null),c([nd],e.prototype,"getMyUserProfileVisibility",null),c([nd],e.prototype,"searchUserProfileByUniqueId",null),c([nd],e.prototype,"createGroup",null),c([nd],e.prototype,"updateGroupInfo",null),c([nd],e.prototype,"getGroupsInfo",null),c([nd],e.prototype,"kickGroupMembers",null),c([nd],e.prototype,"quitGroup",null),c([nd],e.prototype,"dismissGroup",null),c([nd],e.prototype,"transferGroupOwner",null),c([nd],e.prototype,"setGroupManagers",null),c([nd],e.prototype,"getGroupMembersByRole",null),c([nd],e.prototype,"getGroupMembers",null),c([nd],e.prototype,"setGroupMemberInfo",null),c([nd],e.prototype,"searchGroupMembers",null),c([nd],e.prototype,"joinGroup",null),c([nd],e.prototype,"inviteUsersToGroup",null),c([nd],e.prototype,"acceptGroupInvite",null),c([nd],e.prototype,"refuseGroupInvite",null),c([nd],e.prototype,"acceptGroupApplication",null),c([nd],e.prototype,"refuseGroupApplication",null),c([nd],e.prototype,"getGroupApplications",null),c([nd],e.prototype,"getJoinedGroupsByRole",null),c([nd],e.prototype,"searchJoinedGroups",null),c([nd],e.prototype,"getJoinedGroups",null),c([nd],e.prototype,"setGroupRemark",null),c([nd],e.prototype,"addGroupFollows",null),c([nd],e.prototype,"removeGroupFollows",null),c([nd],e.prototype,"getGroupFollows",null),c([nd],e.prototype,"addFriend",null),c([nd],e.prototype,"deleteFriends",null),c([nd],e.prototype,"acceptFriendApplication",null),c([nd],e.prototype,"refuseFriendApplication",null),c([nd],e.prototype,"setFriendInfo",null),c([nd],e.prototype,"checkFriends",null),c([nd],e.prototype,"getFriends",null),c([nd],e.prototype,"getFriendApplications",null),c([nd],e.prototype,"getFriendsInfo",null),c([nd],e.prototype,"searchFriendsInfo",null),c([nd],e.prototype,"setFriendAddPermission",null),c([nd],e.prototype,"getFriendAddPermission",null),e}(),id=function(){function e(e,t){var n,r;this._logTagT=e,this._logTagR=t,this.verificationFaileList=[],this.context=rd.getContext(),this.logger=null===(n=this.context)||void 0===n?void 0:n.logger,this.option=null===(r=this.context)||void 0===r?void 0:r.getOptions()}return e.prototype.validate=function(e,t,n,r,i){if(void 0===r&&(r=!1),this.verificationFaileList.length>0)return this;n=kn[n]||n;var o=r?n(t):Zt(t)||null==t||n(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:Ti[a]}),this}return o||this.verificationFaileList.push({key:e,value:t,isValid:o,message:i,code:Ti[e]}),this},e.prototype.validateParameters=function(e,t,n,r,i,o){if(void 0===i&&(i=!1),this.verificationFaileList.length>0)return this;n=kn[n]||n;var s=i?n(t):Zt(t)||null==t||n(t);if("object"==typeof s){var a=s.valid,u=s.errorKey,c=s.errorCode;return!a&&u&&this.verificationFaileList.push({key:u,value:t,code:c||r,message:o,isValid:!1}),this}return s||this.verificationFaileList.push({key:e,value:t,code:r,message:o,isValid:!1}),this},e.prototype._getValidationResult=function(){if(this.verificationFaileList.length>0)return this.verificationFaileList[0]},e.prototype.ifReady=function(e){var t;if(!this.context)return Promise.resolve({code:re.BIZ_ERROR_CLIENT_NOT_INIT});var n=this._getValidationResult();if(n){var r=n.code,i=n.value,o=n.message,s=n.key;return null===(t=this.logger)||void 0===t||t.error(this._logTagR,JSON.stringify({code:r})),Promise.resolve({code:r,msg:"'"+s+"' is invalid: "+(o||JSON.stringify(i))})}var a=this.logger.createTraceId();return e(this.context,this.logger,this.option,a)},e.prototype.try2do=function(e){if(!this.context)throw new Error("Not initialized yet!");return e(this.context,this.logger,this.option)},e.prototype.ifReadySync=function(e){var t;if(!this.context)return{code:re.BIZ_ERROR_CLIENT_NOT_INIT};var n=this._getValidationResult();if(!n)return e(this.context,this.logger,this.option);var r=n.code,i=n.value,o=n.message,s=n.key;return null===(t=this.logger)||void 0===t||t.warn(this._logTagR,JSON.stringify({code:r})),{code:r,msg:"'"+s+"' is invalid: "+(o||i)}},e}(),od=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,n){return void 0===t&&(t=Date.now()-od),void 0===n&&(n=Date.now()),l(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){switch(o.label){case 0:return t=t<0?Date.now()+t:t,(n=n<=0?Date.now():n)-t>od&&(t=n-od),(r=new wc(e,"RC-IM","IM")).debug(Re.T,"get logs: startTime "+t+" endTime "+n),Rc(e,r,{tag:"browser"}),[4,Pc().getLogs(t,n,sc.DEBUG,!1)];case 1:return i=o.sent().logs,r.debug(Re.T,"get logs "+i.length),function(e,t){var n=t.map((function(e){return e.sessionId+","+e.time+","+e.type+","+e.level+","+e.tag+","+e.traceId+","+e.loggerId+',"'+e.content+'"\n'})),r=new Blob(n,{type:"text/csv"}),i=URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=e+".csv",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}(e+"-"+t+"-"+n,i),[2]}}))}))}}}}var sd=H;export{nl as AConnectionMgr,ni as AEngine,rd as APIContext,o as AppStorage,oi as AreaCode,Cn as AssertRules,Bl as BaseCloudController,_c as BasicLogger,Qo as BasicNavi,Vc as BasicReporter,Ii as BasicStaticConfigManager,Sl as BasicStatistic,ml as BasicStatisticReporter,V as CPP_PROTOCAL_MSGTYPE_OPTION,Bt as CallLibMsgType,ye as ChatroomEntryType,Dt as ChatroomSyncStatusReason,Ae as ChatroomUserChangeType,Ge as ChrmMemBanType,we as ChrmMemOperateType,be as ChrmSyncStatus,si as Codec,$e as ConnectReason,ze as ConnectType,ae as ConnectionStatus,oe as ConversationType,k as DB_LOG_FLUSH_FREQUENCY,F as DB_LOG_MAX_SIZE,Mr as DelayTimer,yt as DirectionType,Be as EConnectProtocol,We as EnterpriseType,re as ErrorCode,Ti as ErrorCodeMap,hn as EventEmitter,Y as FORMATED_VERSION,$ as FileType,mt as FriendAddPermission,Ot as FriendApplicationStatus,Nt as FriendApplicationType,Ut as FriendEventType,Mt as FriendMsgChangeType,At as FriendRelationType,gt as FriendSubChangeType,Ct as GroupApplicationDirection,Et as GroupApplicationStatus,pt as GroupApplicationSubChangeType,vt as GroupApplicationType,_t as GroupFollowUserChangeType,ht as GroupInfoChangeSubChangeType,ut as GroupInviteHandlePermission,ot as GroupJoinPermission,at as GroupMemberInfoEditPermission,ct as GroupMemberRole,Rt as GroupMsgChangeType,lt as GroupOperation,st as GroupOperationPermission,Tt as GroupOperationRole,It as GroupOperationStatus,dt as GroupOperationSubChangeType,ft as GroupOperationType,v as HTTP_TIMEOUT,or as HttpMethod,M as IM_CHATROOM_PULL_INTERVAL_TIME,m as IM_PING_INTERVAL_TIME,N as IM_PING_MIN_TIMEOUT,A as IM_PING_TIMEOUT,S as IM_SIGNAL_TIMEOUT,wc as IndexDBLogger,Qc as IndexDBReporter,Nl as IndexDBStatistic,bl as IndexDBStatisticReporter,Fe as InterruptionLevel,fl as InvokerType,Z as LOCAL_STORAGE_KEYS,bt as LiveRole,Pt as LiveType,sc as LogL,Ie as LogLevel,Te as LogSource,Re as LogTagId,D as MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH,O as MAX_MESSAGE_CONTENT_BYTES,U as MAX_MESSAGE_EXPANSION_KEY_LENGTH,L as MAX_MESSAGE_EXPANSION_VAL_LENGTH,q as MAX_UPLOAD_FILE_SIZE,ge as MentionedType,me as MessageBlockSourceType,Oe as MessageBlockType,te as MessageDirection,ce as MessageType,R as NAVI_CACHE_DURATION,C as NAVI_REQ_TIMEOUT,X as NON_SUBSCRIBE_USER_PROFILE_VALID_TIME,Xe as NaviCacheType,sr as NetworkType,pe as NotificationLevel,de as NotificationStatus,x as ONE_LOG_SIZE_MAX,et as OnlineStatus,Le as OperateStatus,tt as PlatformInfo,Ri as PluginContext,Je as ProtocalType,ke as PushImportanceHonor,St as QueryFriendsDirectionType,xn as RCAssertError,Wc as RCConnectionStatus,Q as RC_DEFAULT_USER,W as READ_RECEIPT_CATCH_TIME,B as REAT_TIME_LOG_SIZE,wt as RTCApiType,Vt as RTCIdentityChangeType,Gt as RTCJoinType,Lt as RTCMode,ed as RTCPluginContext,n as ReceivedStatus,w as SEND_MESSAGE_TYPE_OPTION,j as STATIC_CONFIG_CACHE_TIME,b as STATIC_CONFIG_IV,P as STATIC_CONFIG_KEY,G as STATUS_MESSAGE,J as SUBSCRIBE_USER_PROFILE_VALID_TIME,Me as SentStatus,tl as StatisticL,ve as StatisticsTag,Ze as StatisticsVersion,xe as StoreKeys,rt as SubscribeOperationType,nt as SubscribeType,Fn as SuspendablePromise,ar as TagChangeType,K as UPLOAD_FILE_CHUNK_SIZE,Ye as UltraGroupChannelChangeType,He as UltraGroupChannelType,Qe as UltraMentionedType,qe as UltraMsgChangeType,Ke as UltraMsgSubChangeType,Ee as UploadMethod,je as UserGroupChangeType,it as UserProfileVisibility,H as VERSION,id as ValidatorManage,_n as VersionManage,y as WEB_SOCKET_TIMEOUT,Zo as WebSocketNavi,T as appendUrl,Bn as arrayToKeyValue,Hn as assert,Or as clearOldIndexDB,Cr as clone,Ir as cloneByJSON,mr as completeSubscriptionPlatformStatus,Cc as deInitLogDB,nr as decryptCBC,rr as fixUrlProtocol,pr as forEach,wn as formatFollowsInfo,Un as formatGetGroupsInfo,Gn as formatGroupApplications,Pn as formatGroupBaseInfo,bn as formatGroupMembers,Ln as formatGroupsInfo,Dn as formatUserProfiles,Rr as getBrowser,er as getClientMessageId,In as getDeviceId,ir as getMessageUIdHash,Jn as getMimeKey,ur as getMinionURL,fn as getUUID,En as getUUID22,Wn as getUploadFileName,tr as getbundleId,lr as httpRequest,gr as indexOf,Rc as initLogDB,hl as initStatisticDB,Yt as isArray,jt as isArrayBuffer,kt as isBoolean,$c as isConnnectAck,zc as isDisconnectedByServer,Xt as isFunction,$t as isHttpUrl,Er as isInObject,fr as isInclude,Ht as isInteger,qt as isLimitedArray,Kt as isLimitedString,zt as isNull,xt as isNumber,Jt as isObject,gn as isStartCloudController,Ft as isString,Nr as isSupportIndexDB,un as isTypeInConversationList,Zt as isUndefined,rn as isValidChannelId,zn as isValidChrmEntryKey,$n as isValidChrmEntryValue,dn as isValidConversation,tn as isValidConversationType,on as isValidEnum,ln as isValidExpansion,cn as isValidFileType,an as isValidGroupId,nn as isValidNotificationLevel,sn as isValidTargetId,On as logger,_r as map,Wt as notEmptyArray,en as notEmptyObject,Qt as notEmptyString,Xn as pushConfigsToJSON,Zn as pushJSONToConfigs,Rl as statisticTranscsv,f as todo,jc as transcsv,Vn as transforServerProfileInfo,Sr as transformReceivedStatusFlag,yr as transformReceivedStatusInfo,Ar as transformUserProfiles,_l as unInitStatisticDB,cr as updateMentionedInfo,Ei as urlCenter,Tr as usingCppEngine,Yn as validate,kn as validators,sd as version};
|
|
1
|
+
var e;!function(e){e[e.READ=1]="READ",e[e.LISTENED=2]="LISTENED",e[e.DOWNLOADED=4]="DOWNLOADED",e[e.RETRIEVED=8]="RETRIEVED",e[e.UNREAD=0]="UNREAD"}(e||(e={}));var t=e,n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)};
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */function r(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}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i,o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function s(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function a(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function u(e,t){var n,r,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(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=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],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function c(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var l,d=function(e){return i||(i={set:function(t,n){e.localStorage.setItem(t,JSON.stringify(n))},get:function(t){var n;try{n=JSON.parse(e.localStorage.getItem(t))}catch(e){n=null}return n},remove:function(t){return e.localStorage.removeItem(t)},getKeys:function(){var t=[];for(var n in e.localStorage)t.push(n);return t}}),i},h=function(){function e(e){this._caches={},e&&(this._caches=e)}return e.prototype.set=function(e,t){this._caches[e]=t},e.prototype.remove=function(e){var t=this.get(e);return delete this._caches[e],t},e.prototype.get=function(e){return this._caches[e]},e.prototype.getKeys=function(){var e=[];for(var t in this._caches)e.push(t);return e},e}(),p=function(){function e(e,t){var n;this._rootStorage=d(e);var r=this._rootStorage.get(t)||{};this._cache=new h(((n={})[t]=r,n)),this._storageKey=t}return e.prototype._get=function(){var e=this._storageKey;return this._cache.get(e)||{}},e.prototype._set=function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)},e.prototype.set=function(e,t){var n=this._get();n[e]=t,this._set(n)},e.prototype.remove=function(e){var t=this._get();delete t[e],this._set(t)},e.prototype.clear=function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)},e.prototype.get=function(e){return this._get()[e]},e.prototype.getKeys=function(){var e=this._get(),t=[];for(var n in e)t.push(n);return t},e.prototype.getValues=function(){return this._get()||{}},e.prototype.update=function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)},e}(),_=function(e){function t(t){return e.call(this,"TODO => "+t)||this}return r(t,e),t}(Error),f=function(e){return new _(e)},E=function(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e.charCodeAt(n)<=65535?2:4;return t},I=function(e){for(var t,n=0,r=0,i=e.length;r<i;r++)n+=(t=e.charCodeAt(r))<127?1:t<=2047?2:t<=65535?3:4;return n},T=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var n=Object.keys(t).map((function(e){return e+"="+t[e]})).filter((function(e){return!!e}));return n.length?[e,n.join("&")].join("?"):e},R=72e5,v=6e4,C=1e4,y=5e3,S=3e4,m=15e3,A=15e3,N=2e3,O=131072,M=18e4,U=32,L=4096,P="cd4936151214ce45dc1d12673a59d94c",b="51ad078e5eb17a91",D=2048,w={"RC:TxtMsg":{isCounted:!0,isPersited:!0},"RC:ImgMsg":{isCounted:!0,isPersited:!0},"RC:VcMsg":{isCounted:!0,isPersited:!0},"RC:ImgTextMsg":{isCounted:!0,isPersited:!0,searchProps:["content","title"]},"RC:FileMsg":{isCounted:!0,isPersited:!0,searchProps:["name"]},"RC:HQVCMsg":{isCounted:!0,isPersited:!0},"RC:LBSMsg":{isCounted:!0,isPersited:!0},"RC:PSImgTxtMsg":{isCounted:!0,isPersited:!0},"RC:PSMultiImgTxtMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpOpendMsg":{isCounted:!0,isPersited:!0},"RC:CombineMsg":{isCounted:!0,isPersited:!0},"RC:CombineV2Msg":{isCounted:!0,isPersited:!0},"RC:ReferenceMsg":{isCounted:!0,isPersited:!0,searchProps:["content"]},"RC:SightMsg":{isCounted:!0,isPersited:!0},"RC:GIFMsg":{isCounted:!0,isPersited:!0},"RC:RLStart":{isCounted:!0,isPersited:!0},"RC:RLEnd":{isCounted:!0,isPersited:!0},"RC:InfoNtf":{isCounted:!1,isPersited:!0},"RC:ContactNtf":{isCounted:!1,isPersited:!0},"RC:ProfileNtf":{isCounted:!1,isPersited:!0},"RC:CmdNtf":{isCounted:!1,isPersited:!0},"RC:GrpNtf":{isCounted:!1,isPersited:!0},"RC:RcCmd":{isCounted:!1,isPersited:!0},"RC:RcNtf":{isCounted:!1,isPersited:!0},"RC:CmdMsg":{isCounted:!1,isPersited:!1},"RC:TypSts":{isCounted:!1,isPersited:!1},"RC:PSCmd":{isCounted:!1,isPersited:!1},"RC:SRSMsg":{isCounted:!1,isPersited:!1},"RC:RRReqMsg":{isCounted:!1,isPersited:!1},"RC:RRRspMsg":{isCounted:!1,isPersited:!1},"RC:CsChaR":{isCounted:!1,isPersited:!1},"RC:CSCha":{isCounted:!1,isPersited:!1},"RC:CsEva":{isCounted:!1,isPersited:!1},"RC:CsContact":{isCounted:!1,isPersited:!1},"RC:CsHs":{isCounted:!1,isPersited:!1},"RC:CsHsR":{isCounted:!1,isPersited:!1},"RC:CsSp":{isCounted:!1,isPersited:!1},"RC:CsEnd":{isCounted:!1,isPersited:!1},"RC:CsUpdate":{isCounted:!1,isPersited:!1},"RC:ReadNtf":{isCounted:!1,isPersited:!1},"RC:chrmKVNotiMsg":{isCounted:!1,isPersited:!1},"RC:VCAccept":{isCounted:!1,isPersited:!1},"RC:VCRinging":{isCounted:!1,isPersited:!1},"RC:VCSummary":{isCounted:!1,isPersited:!1},"RC:VCHangup":{isCounted:!1,isPersited:!1},"RC:VCInvite":{isCounted:!1,isPersited:!1},"RC:VCModifyMedia":{isCounted:!1,isPersited:!1},"RC:VCModifyMem":{isCounted:!1,isPersited:!1},"RC:MsgExMsg":{isCounted:!1,isPersited:!1},"RC:Delivered":{isCounted:!1,isPersited:!1},"RC:RRMsg":{isCounted:!1,isPersited:!1},"RC:LogCmdMsg":{isCounted:!1,isPersited:!1},"RC:InterceptMsg":{isCounted:!1,isPersited:!1},"RC:RLJoin":{isCounted:!1,isPersited:!1},"RC:RLQuit":{isCounted:!1,isPersited:!1},"RC:RL":{isCounted:!1,isPersited:!1},"RC:CCConfigChangeRequestMsg":{isCounted:!1,isPersited:!1}},V={"RC:DizNtf":{isCounted:!1,isPersited:!1}},G=["RC:TypSts","RC:InterceptMsg","RC:RL"],B=20971520,F=1e5,k=3e3,x=1e3,H="5.12.2",Y=H.replace(/-.+$/,""),K=5368709120,q=10485760,j=18e5,Q="rongcloudsystem",W=864e5,J=6048e5,X=6e5,Z={NAVI_KEY:function(e){return"navi_"+e},CONVER_STATE_PULL_TIME_KEY:function(e,t){return"RCV4-con-s-"+e+"-"+t},OLD_CONVER_STATE_KEY:function(e,t){return"RCV4-con-"+e+"-"+t},CONVER_STATE_KEY:function(e,t){return"RCV4-CONVER-"+e+"-"+t},ULTRA_GROUP_STATE_KEY:function(e,t){return"RCV4-ultragroupconversation-"+e+"-"+t},OUTBOX_TIME_KEY:function(e,t){return"outbox_"+e+"_"+t},INBOX_TIME_KEY:function(e,t){return"inbox_"+e+"_"+t},BROADCASTBOX_TIME_KEY:function(e,t){return"broadcastbox_"+e+"_"+t},SEND_MSG_KEY:function(e,t){return"send_msg_"+e+"_"+t},USER_SETTING_TIME_KEY:function(e,t){return"us-s-"+e+"-"+t},TAG_STATE_KEY:function(e,t){return"tag-"+e+"-"+t},USER_SETTING_KEY:function(e,t){return"RC-us-"+e+"-"+t},STATIC_CONFIG_KEY:function(e){return"rc-static-config-"+e},CLOUD_CONTROL_KEY:function(e){return"RC-cc-"+e},READ_RECEIPT_KEY:function(e,t){return"RC-RR-"+e+"-"+t},PULL_EVENT_CHANGE_TIME_KEY:function(e,t){return"RC-PEC-"+e+"-"+t}};!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"}(l||(l={}));var z,$=l;!function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(z||(z={}));var ee,te=z;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",e[e.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",e[e.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",e[e.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",e[e.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",e[e.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",e[e.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",e[e.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",e[e.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",e[e.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",e[e.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",e[e.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",e[e.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",e[e.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",e[e.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",e[e.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",e[e.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",e[e.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",e[e.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",e[e.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",e[e.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",e[e.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",e[e.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",e[e.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",e[e.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",e[e.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",e[e.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",e[e.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",e[e.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",e[e.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",e[e.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",e[e.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",e[e.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",e[e.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",e[e.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",e[e.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",e[e.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",e[e.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",e[e.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",e[e.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",e[e.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",e[e.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",e[e.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",e[e.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",e[e.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",e[e.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",e[e.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",e[e.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",e[e.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",e[e.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",e[e.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",e[e.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",e[e.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",e[e.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",e[e.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",e[e.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",e[e.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",e[e.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",e[e.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",e[e.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",e[e.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",e[e.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",e[e.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",e[e.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",e[e.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",e[e.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",e[e.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",e[e.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",e[e.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",e[e.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",e[e.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",e[e.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",e[e.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",e[e.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",e[e.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",e[e.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",e[e.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",e[e.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",e[e.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",e[e.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",e[e.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",e[e.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",e[e.RC_TCP_RESET=32054]="RC_TCP_RESET",e[e.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",e[e.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",e[e.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",e[e.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.UPLOAD_FAIL=34011]="UPLOAD_FAIL",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",e[e.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",e[e.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",e[e.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",e[e.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",e[e.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",e[e.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",e[e.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",e[e.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",e[e.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",e[e.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",e[e.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",e[e.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",e[e.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",e[e.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",e[e.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",e[e.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",e[e.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",e[e.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",e[e.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",e[e.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",e[e.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",e[e.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",e[e.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",e[e.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",e[e.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",e[e.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",e[e.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",e[e.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",e[e.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",e[e.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",e[e.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",e[e.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",e[e.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",e[e.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",e[e.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",e[e.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",e[e.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",e[e.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",e[e.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",e[e.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",e[e.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",e[e.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",e[e.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",e[e.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",e[e.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",e[e.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",e[e.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",e[e.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",e[e.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",e[e.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",e[e.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",e[e.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",e[e.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",e[e.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",e[e.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",e[e.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",e[e.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",e[e.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",e[e.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",e[e.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",e[e.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",e[e.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",e[e.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",e[e.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",e[e.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",e[e.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",e[e.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",e[e.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",e[e.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",e[e.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",e[e.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",e[e.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",e[e.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",e[e.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",e[e.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",e[e.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",e[e.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",e[e.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",e[e.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",e[e.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",e[e.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",e[e.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",e[e.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",e[e.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",e[e.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",e[e.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",e[e.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",e[e.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",e[e.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",e[e.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",e[e.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.NOT_SUPPORT=35004]="NOT_SUPPORT",e[e.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",e[e.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",e[e.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",e[e.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",e[e.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",e[e.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",e[e.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",e[e.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",e[e.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",e[e.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",e[e.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",e[e.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",e[e.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",e[e.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",e[e.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",e[e.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",e[e.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",e[e.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",e[e.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",e[e.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",e[e.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",e[e.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",e[e.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",e[e.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",e[e.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",e[e.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",e[e.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",e[e.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",e[e.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",e[e.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",e[e.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.TIMEOUT=-1]="TIMEOUT"}(ee||(ee={}));var ne,re=ee;!function(e){e[e.NONE=0]="NONE",e[e.PRIVATE=1]="PRIVATE",e[e.DISCUSSION=2]="DISCUSSION",e[e.GROUP=3]="GROUP",e[e.CHATROOM=4]="CHATROOM",e[e.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",e[e.SYSTEM=6]="SYSTEM",e[e.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",e[e.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",e[e.ULTRA_GROUP=10]="ULTRA_GROUP",e[e.RTC_ROOM=12]="RTC_ROOM"}(ne||(ne={}));var ie,oe=ne;!function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",e[e.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",e[e.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",e[e.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",e[e.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",e[e.BLOCKED=9]="BLOCKED",e[e.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",e[e.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",e[e.REDIRECT=14]="REDIRECT",e[e.USER_LOGOUT=19]="USER_LOGOUT",e[e.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",e[e.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",e[e.ULTRALIMIT=1101]="ULTRALIMIT",e[e.REQUEST_NAVI=201]="REQUEST_NAVI",e[e.RESPONSE_NAVI=202]="RESPONSE_NAVI",e[e.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",e[e.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR"}(ie||(ie={}));var se,ae=ie;!function(e){e.TextMessage="RC:TxtMsg",e.VOICE="RC:VcMsg",e.HQ_VOICE="RC:HQVCMsg",e.IMAGE="RC:ImgMsg",e.GIF="RC:GIFMsg",e.RICH_CONTENT="RC:ImgTextMsg",e.LOCATION="RC:LBSMsg",e.FILE="RC:FileMsg",e.SIGHT="RC:SightMsg",e.COMBINE="RC:CombineMsg",e.COMBINE_V2="RC:CombineV2Msg",e.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",e.LOG_COMMAND="RC:LogCmdMsg",e.EXPANSION_NOTIFY="RC:MsgExMsg",e.REFERENCE="RC:ReferenceMsg",e.RECALL="RC:RcCmd",e.RECALL_NOTIFICATION_MESSAGE="RC:RcNtf",e.READ_RECEIPT="RC:ReadNtf",e.READ_RECEIPT_REQUEST="RC:RRReqMsg",e.READ_RECEIPT_RESPONSE="RC:RRRspMsg",e.SYNC_READ_STATUS="RC:SRSMsg",e.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",e.READ_STATE="RC:RSMsg",e.DELIVERED="RC:Delivered",e.DELIVERED_MSG="RC:DRMsg",e.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",e.CHATROOM_SYNC_MSG="RC:ChrmSyncMsg",e.CHATROOM_MERGE_BLOCK="RC:ChrmBlockMsg",e.CHATROOM_MERGE_BAN="RC:ChrmBanMsg",e.TYPING_STATUS="RC:TypSts",e.INTERCEPT="RC:InterceptMsg",e.CLOUD_CONTROL="RC:CCConfigChangeRequestMsg"}(se||(se={}));var ue,ce=se;!function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(ue||(ue={}));var le,de=ue;!function(e){e[e.ALL_MESSAGE=-1]="ALL_MESSAGE",e[e.NOT_SET=0]="NOT_SET",e[e.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",e[e.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",e[e.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",e[e.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION"}(le||(le={}));var he,pe=le;!function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(he||(he={}));var _e,ge=he;!function(e){e[e.QINIU=1]="QINIU",e[e.ALI=2]="ALI",e[e.AWS=3]="AWS",e[e.STC=4]="STC",e[e.MINIO=5]="MINIO"}(_e||(_e={}));var fe,Ee=_e;!function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(fe||(fe={}));var Ie,Te,Re,ve,Ce,ye=fe;!function(e){e[e.LOG=0]="LOG",e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL",e[e.STATISTICS=6]="STATISTICS",e[e.NONE=1e3]="NONE"}(Ie||(Ie={})),function(e){e.IM="IM",e.RTC="RTC"}(Te||(Te={})),function(e){e.L_IMSDK_VER_O="L-imsdk_ver-O",e.A_INIT_O="A-init-O",e.A_INIT_REPEAT_O="A_INIT_REPEAT_O",e.L_INIT_O="L-init-O",e.A_DESTROY_O="A_DESTROY_O",e.L_DESTROY_O="L_DESTROY_O",e.A_CONNECT_T="A-connect-T",e.A_CONNECT_R="A-connect-R",e.A_CONNECT_S="A-connect-S",e.A_DISCONNECT_O="A-disconnect-O",e.A_RECONNECT_T="A-reconnect-T",e.A_RECONNECT_R="A_RECONNECT_R",e.L_CONNECT_T="L-connect-T",e.L_CONNECT_R="L-connect-R",e.L_CONNECT_S="L-connect-S",e.L_DB_UPGRATE_START_S="L-db_upgrate_start-S",e.L_DB_UPGRATING_S="L-db_upgrating-S",e.L_DB_UPGRATE_COMPLETE_S="L-db_upgrate_complete-S",e.L_NOTIFY_ULTRA_ONLINE_S="L-notify-ultra-online-S",e.L_ULTRA_SYNC_DONE_S="L-ultra-sync-done-S",e.L_BATCH_MESSAGE_O="L-BATCH_MESSAGE-O",e.A_MSG_LISTENER_E="A-MSG_LISTENER-E",e.O="L-original-O",e.T="L-TEST-O",e.L_INSTALL_PLUGIN_T="L-INSTALL_PLUGIN-T",e.L_INSTALL_PLUGIN_R="L-INSTALL_PLUGIN-R",e.L_NAVI_CONF_E="L-NAVI_CONF_ERROR-E",e.L_NAVI_CMP_R="L-NAVI_CPM-R",e.A_SEND_MSG_T="A-send_msg-T",e.A_SEND_MSG_R="A-send_msg-R",e.L_SEND_MSG_T="L-send_msg-T",e.L_SEND_MSG_R="L-send_msg-R",e.L_PULL_MSG_T="L-pull_msg-T",e.L_PULL_MSG_R="L-pull_msg-R",e.L_PULL_MSG_E="L-pull_msg-E",e.L_PULL_MSG_O="L-pull_msg-O",e.L_PULL_ULTRA_MSG_T="L-pull_ultra_msg-T",e.L_PULL_ULTRA_MSG_R="L-pull_ultra_msg-R",e.L_PULL_CHATROOM_KV_T="L-pull_chatroom_kv-T",e.L_PULL_CHATROOM_KV_R="L-pull_chatroom_kv-R",e.L_PULL_CHATROOM_MSG_T="L-pull_chatroom_msg-T",e.L_PULL_CHATROOM_MSG_R="L-pull_chatroom_msg-R",e.L_RECV_MULTI_SYNC_MSG_O="L-recv_multi_sync_msg-O",e.L_RECV_S_MSG_O="L-recv_s_msg-O",e.A_DELETE_MESSAGES_S="A-delete_messages-S",e.P_DELETE_MSG_S="P-delete_msg-S",e.L_PULL_CONVERSATION_S="L-pull_conversation-S",e.L_RECALL_ULTRA_MSG_S="L-recall_ultra_msg-S",e.A_REGTYP_O="A-regtyp-O",e.P_REGTYP_E="P-regtype-E",e.L_GET_NAVI_T="L-get_navi-T",e.L_GET_NAVI_R="L-get_navi-R",e.L_REQUEST_T="L-request-T",e.L_REQUEST_R="L-request-R",e.L_PARSE_NAVI_E="L-parse_navi-E",e.L_ENV_S="L-Env-S",e.L_GET_INDEX_NAVI_S="L-get_index_navi-S",e.A_JOIN_CHATROOM_T="A-join_chatroom-T",e.A_JOIN_CHATROOM_R="A-join_chatroom-R",e.L_JOIN_CHATROOM_T="L-join_chatroom-T",e.L_JOIN_CHATROOM_R="L-join_chatroom-R",e.A_QUIT_CHATROOM_T="A-quit_chatroom-T",e.A_QUIT_CHATROOM_R="A-quit_chatroom-R",e.L_REJOIN_CHATROOM_T="L-rejoin_chatroom-T",e.L_REJOIN_CHATROOM_R="L-rejoin_chatroom-R",e.L_REJOIN_CHATROOM_S="L-rejoin_chatroom-S",e.L_MEDIA_S="L-media-S",e.L_MEDIA_UPLOAD_T="L-media_upload-T",e.L_MEDIA_UPLOAD_R="L-media_upload-R",e.G_UPLOAD_LOG_S="G-upload_log-S",e.G_REPORT_LOG_S="G-report_log-S",e.G_UPLOAD_LOG_E="G-upload_log-E",e.G_GET_REAL_TIMELOG_COMMAND_S="G-get_real_timelog_command-S",e.L_CHECK_ALIVE_IM_T="L-check_alive_im-T",e.L_CHECK_ALIVE_IM_R="L-check_alive_im-R",e.L_CHECK_ALIVE_IM_S="L-check_alive_im-S",e.A_GET_HISTORY_MSG_T="A-get_history_msg-T",e.A_GET_HISTORY_MSG_R="A-get_history_msg-R",e.L_GET_HISTORY_MSG_T="L-get_history_msg-T",e.L_GET_HISTORY_MSG_R="L-get_history_msg-R",e.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E="A-get_privage_message_deliver_time-E",e.A_GET_GROUP_MESSAGE_DELIVER_LIST_E="A-get_group_message_deliver_list-E",e.A_CALLBACK_O="A-callback-O",e.A_CALLBACK_E="A-callback-E",e.L_CALLBACK_E="L-callback-E",e.A_SEND_MESSAGE_READ_RECEIPT_V4_T="A-send_message_read_receipt_V4-T",e.A_SEND_MESSAGE_READ_RECEIPT_V4_R="A-send_message_read_receipt_V4-R",e.A_GET_MESSAGE_READ_RECEIPT_V4_T="A-get_message_read_receipt_V4-T",e.A_GET_MESSAGE_READ_RECEIPT_V4_R="A-get_message_read_receipt_V4-R",e.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T="A-batch_get_message_read_receipt_info_V4-T",e.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R="A-batch_get_message_read_receipt_info_V4-R",e.A_SYNC_READ_STATUS_T="A-sync_read_status-T",e.A_SYNC_READ_STATUS_R="A-sync_read_status-R",e.A_GET_TOP_CONVERSATION_LIST_E="A-get_top_conversation_list-E",e.L_PB_ENCODE_E="L-pb-encode-E",e.L_PB_DECODE_E="L-pb-decode-E",e.L_NOTIFY_NAVI_CHANGE_E="L-notify_navi_change-E",e.L_REPORT_FULL_LOG_O="L-report_full_log-O",e.L_REPORT_FULL_LOG_T="L-report_full_log-T",e.L_REPORT_FULL_LOG_R="L-report_full_log-R",e.L_REPORT_LOG_POLICY_E="L-parse_navi_logpolicy-E",e.L_UNSUPPORT_INDEXDB_O="L-unsupport_IndexDB-O",e.L_LOGDB_OPEN_FAILED_E="L-logDB_open_failed-E",e.L_LOGDB_CLOSED_S="L-logDB_closed-S",e.L_LOGDB_ERROR_E="L-logDB_error-S",e.L_LOGDB_ABORT_S="L-logDB_abort-S",e.L_REALTIME_LOG_R="L_REALTIME_LOG_R",e.L_REALTIME_LOG_O="L_REALTIME_LOG_O",e.L_REALTIME_LOG_T="L_REALTIME_LOG_T",e.L_STATISTIC_LOG_R="L_STATISTIC_LOG_R",e.L_STATISTIC_LOG_O="L_STATISTIC_LOG_O",e.L_STATISTIC_LOG_T="L_STATISTIC_LOG_T",e.L_UNKNOWN_TOPIC_E="L_UNKNOWN_TOPIC_E",e.L_RECV_RMTP_O="L_RECV_RMTP_O",e.L_RECV_RMTP_E="L_RECV_RMTP_E",e.L_RECV_S_NTF_O="L-recv_s_ntf_O",e.L_VER_REPORT_T="L-VER_REPORT-T",e.L_VER_REPORT_R="L-VER_REPORT-R",e.L_CALL_MAIN_SYNC_O="L_CALL_MAIN_SYNC_O",e.L_UNSUPPORT_NTF_FROM_MAIN_E="L_UNSUPPORT_NTF_FROM_MAIN_E",e.A_SET_MSG_CONTENT_O="A_SET_MSG_CONTENT_O",e.A_REMOVE_PROXY_O="A-remove_proxy-O",e.A_SET_PROXY_O="A-set_proxy-O",e.A_TEST_PROXY_O="A-test_proxy-O",e.L_WEBSOCKET_DISACCORD_E="L-websocket_disaccord-e",e.A_SEARCH_MESSAGE_BY_USER_T="A-search_messages_by_user-T",e.A_SEARCH_MESSAGE_BY_USER_R="A-search_messages_by_user-R",e.L_GET_STATIC_CONF_T="L-get_static_conf-T",e.L_GET_STATIC_CONF_R="L-get_static_conf-R",e.L_GET_STATIC_CONF_E="L-get_static_conf-E",e.L_CLOUD_DISABLED="L-cloud_disabled",e.L_CLOUD_EXPIRE="L-cloud_expire",e.L_CLOUD_OVERCLOCK="L-cloud_overclock",e.L_CLOUD_APPKEY_REGION_E="L-cloud_appkey_region_error",e.L_CLOUD_CONFIG_DATA_E="L-cloud_config_data_error",e.L_CLOUD_SET_CACHE_O="L-cloud_set_cache-O",e.L_CLOUD_GET_CACHE_O="L-cloud_get_cache-O",e.L_CLOUD_MSG_NTF_O="L-cloud_msg_ntf-O",e.L_CLOUD_SET_AREA_CODE_O="L-cloud_set_area_code-O",e.L_CLOUD_SET_MRTR_O="L-cloud_set_mrtr-O",e.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S="L-sync_subscribed_user_status_finished-S",e.L_PULL_SUBSCRIBED_USER_RELATION_T="L-pull_subscribed_user_relation-T",e.L_PULL_SUBSCRIBED_USER_RELATION_R="L-pull_subscribed_user_relation-R",e.L_PULL_SUBSCRIBED_USER_STATUS_T="L-pull_subscribed_user_status-T",e.L_PULL_SUBSCRIBED_USER_STATUS_R="L-pull_subscribed_user_status-R",e.L_OWN_USER_PROFILE_CHANGED_S="L-own_user_profile_changed-S",e.L_QUERY_SUBSCRIBE_DATA_T="L-query_subscribe_data-T",e.L_QUERY_SUBSCRIBE_DATA_R="L-query_subscribe_data-R",e.L_PULL_USER_PROFILE_T="L-pull_user_profile-T",e.L_PULL_USER_PROFILE_R="L-pull_user_profile-R",e.L_PULL_OWN_PROFILE_T="L-pull_own_profile-T",e.L_PULL_OWN_PROFILE_R="L-pull_own_profile-R",e.L_QUERY_FRIEND_LIST_T="L-query_friend_list-T",e.L_QUERY_FRIEND_LIST_R="L-query_friend_list-R",e.L_PULL_USER_PROFILE_REQ_T="L-pull_user_profile_req-T",e.L_PULL_USER_PROFILE_REQ_R="L-pull_user_profile_req-R",e.L_PULL_EVENT_CHANGE_NOTIFY_ULTRA_ONLINE_S="L-pull_event_change_notify_ultra_online-S",e.L_PULL_EVENT_CHANGE_T="L-pull_event_change-T",e.L_PULL_EVENT_CHANGE_R="L-pull_event_change-R",e.L_PARSE_JSON_E="L-parse_json-E"}(Re||(Re={})),function(e){e.IM_NAVI="IM-stats_navi-S",e.IM_WEBSOCKET="IM-stats_websocket-S",e.IM_CONNECTION_DURATION="IM-stats_con_dur-S",e.IM_CMP="IM-stats_cmp-S",e.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",e.IM_STATS_CS="IM-stats_cs-S",e.IM_NETWORK_CHANGE="IM-stats_network_change-S",e.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",e.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",e.IM_MSG_SEND="IM-msg_send-S",e.IM_MSG_RECEIVE="IM-msg_receive-S"}(ve||(ve={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(Ce||(Ce={}));var Se,me,Ae=Ce;!function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(Se||(Se={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(me||(me={}));var Ne,Oe=Se;!function(e){e[e.typing=0]="typing"}(Ne||(Ne={}));var Me,Ue,Le=Ne;!function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(Me||(Me={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(Ue||(Ue={}));var Pe,be=Ue;!function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(Pe||(Pe={}));var De,we=Pe;!function(e){e[e.UnmuteUsers=0]="UnmuteUsers",e[e.MuteUsers=1]="MuteUsers",e[e.UnmuteAll=2]="UnmuteAll",e[e.MuteAll=3]="MuteAll",e[e.RemoveWhitelist=4]="RemoveWhitelist",e[e.AddWhitelist=5]="AddWhitelist",e[e.UnmuteGloble=6]="UnmuteGloble",e[e.MuteGloble=7]="MuteGloble"}(De||(De={}));var Ve,Ge=De;!function(e){e[e.LeaveOnMyOwn=0]="LeaveOnMyOwn",e[e.OtherDeviceLogin=1]="OtherDeviceLogin"}(Ve||(Ve={}));var Be,Fe,ke,xe,He,Ye,Ke,qe,je,Qe,We,Je,Xe,Ze,ze,$e,et,tt,nt,rt,it,ot,st,at,ut,ct,lt,dt,ht,pt,_t,gt,ft,Et,It,Tt,Rt,vt,Ct,yt,St,mt,At,Nt,Ot,Mt,Ut,Lt,Pt,bt,Dt=Ve;!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"}(Be||(Be={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(Fe||(Fe={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(ke||(ke={})),function(e){e.NAVI="rc-navi",e.REALTIME_LOG_TIMESTAMP="rc-realtime-log-timestamp"}(xe||(xe={})),function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(He||(He={})),function(e){e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(Ye||(Ye={})),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"}(Ke||(Ke={})),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"}(qe||(qe={})),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"}(je||(je={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(Qe||(Qe={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(We||(We={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(Je||(Je={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Xe||(Xe={})),function(e){e[e.CURRENT=2]="CURRENT"}(Ze||(Ze={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(ze||(ze={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}($e||($e={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(et||(et={})),function(e){e[e.Other=0]="Other",e[e.iOS=1]="iOS",e[e.Android=2]="Android",e[e.Web=3]="Web",e[e.PC=4]="PC",e[e.Mini=5]="Mini",e[e.HarmonyOS=6]="HarmonyOS"}(tt||(tt={})),function(e){e[e.ONLINE_STATUS=1]="ONLINE_STATUS",e[e.USER_PROFILE=2]="USER_PROFILE",e[e.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",e[e.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE"}(nt||(nt={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(rt||(rt={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(it||(it={})),function(e){e[e.OWNER_VERIFY=0]="OWNER_VERIFY",e[e.FREE=1]="FREE",e[e.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(ot||(ot={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(st||(st={})),function(e){e[e.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",e[e.OWNER_OR_SELF=1]="OWNER_OR_SELF",e[e.SELF=2]="SELF"}(at||(at={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(ut||(ut={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(ct||(ct={})),function(e){e[e.CREATE=0]="CREATE",e[e.JOIN=1]="JOIN",e[e.KICK=2]="KICK",e[e.QUIT=3]="QUIT",e[e.DISMISS=4]="DISMISS",e[e.ADD_MANAGER=5]="ADD_MANAGER",e[e.REMOVE_MANAGER=6]="REMOVE_MANAGER",e[e.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER"}(lt||(lt={})),function(e){e[e.CREATE=0]="CREATE",e[e.JOIN=1]="JOIN",e[e.KICK_OUT=2]="KICK_OUT",e[e.EXIT=3]="EXIT",e[e.DISSOLVE=4]="DISSOLVE",e[e.ADD_ADMIN=5]="ADD_ADMIN",e[e.REMOVE_ADMIN=6]="REMOVE_ADMIN",e[e.TRANSFER_OWNER=7]="TRANSFER_OWNER"}(dt||(dt={})),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"}(ht||(ht={})),function(e){e[e.USER_APPLY=0]="USER_APPLY",e[e.INVITATION_RECEIVED=1]="INVITATION_RECEIVED",e[e.APPLY_RESULT=2]="APPLY_RESULT",e[e.INVITATION_RESULT=3]="INVITATION_RESULT"}(pt||(pt={})),function(e){e[e.REMOVE_USER=0]="REMOVE_USER",e[e.ADD_USER=1]="ADD_USER"}(_t||(_t={})),function(e){e[e.FRIEND_APPLY=0]="FRIEND_APPLY",e[e.FRIEND_REFUSE=1]="FRIEND_REFUSE",e[e.FRIEND_ACCEPT=2]="FRIEND_ACCEPT",e[e.FRIEND_DELETE=3]="FRIEND_DELETE",e[e.FRIEND_CLEANUP=4]="FRIEND_CLEANUP"}(gt||(gt={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(ft||(ft={})),function(e){e[e.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",e[e.MANAGER_REFUSED=1]="MANAGER_REFUSED",e[e.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",e[e.INVITEE_REFUSED=3]="INVITEE_REFUSED",e[e.JOINED=4]="JOINED",e[e.EXPIRED=5]="EXPIRED"}(Et||(Et={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(It||(It={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(Tt||(Tt={})),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"}(Rt||(Rt={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(vt||(vt={})),function(e){e[e.APPLICATION_SENT=0]="APPLICATION_SENT",e[e.INVITATION_SENT=1]="INVITATION_SENT",e[e.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",e[e.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED"}(Ct||(Ct={})),function(e){e[e.BOTH=2]="BOTH"}(yt||(yt={})),function(e){e[e.BOTH=2]="BOTH"}(St||(St={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(mt||(mt={})),function(e){e[e.NONE=0]="NONE",e[e.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",e[e.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",e[e.BOTH_WAY=3]="BOTH_WAY"}(At||(At={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(Nt||(Nt={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(Ot||(Ot={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(Mt||(Mt={})),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"}(Ut||(Ut={})),function(e){e[e.RTC=0]="RTC",e[e.LIVE=2]="LIVE",e[e.SIP=4]="SIP",e[e.CALL=5]="CALL",e[e.MEETING=6]="MEETING",e[e.CROSS_MUTI=7]="CROSS_MUTI",e[e.CROSS_LIVE=8]="CROSS_LIVE"}(Lt||(Lt={})),function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(Pt||(Pt={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(bt||(bt={}));var wt,Vt,Gt,Bt={"RC:VCAccept":"RC:VCAccept","RC:VCRinging":"RC:VCRinging","RC:VCSummary":"RC:VCSummary","RC:VCHangup":"RC:VCHangup","RC:VCInvite":"RC:VCInvite","RC:VCModifyMedia":"RC:VCModifyMedia","RC:VCModifyMem":"RC:VCModifyMem"};!function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(wt||(wt={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Vt||(Vt={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(Gt||(Gt={}));var Ft=function(e){return"string"==typeof e},kt=function(e){return"boolean"==typeof e},xt=function(e){return"number"==typeof e&&!Number.isNaN(e)},Ht=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},Yt=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},Kt=function(e){return function(t){if(!Yt(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 n=!0;return t.every((function(t){var r=e.itemValidator&&e.itemValidator(t);return"object"==typeof r?r.errorKey?(n={errorKey:r.errorKey,valid:r.valid},!1):(n=r.valid,r.valid):(n=!!r,r)})),n}},qt=function(e){return function(t){return Ft(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))}},jt=function(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)},Qt=function(e){return Ft(e)&&e.length>0},Wt=function(e){return Yt(e)&&e.length>0},Jt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Xt=function(e){return"[object Function]"===Object.prototype.toString.call(e)},Zt=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},zt=function(e){return"[object Null]"===Object.prototype.toString.call(e)},$t=function(e){return Ft(e)&&/https?:\/\//.test(e)},en=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},tn=function(e){return xt(e)&&Object.prototype.hasOwnProperty.call(oe,e)},nn=function(e){return xt(e)&&Object.prototype.hasOwnProperty.call(pe,e)},rn=function(e){var t=!1;return Ft(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},on=function(e){return Object.values(e.type).includes(e.value)},sn=function(e){return qt({minLength:1,maxLength:64})(e)},an=function(e){return qt({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},un=function(e){return[oe.PRIVATE,oe.GROUP,oe.SYSTEM,oe.PUBLIC_SERVICE,oe.APP_PUBLIC_SERVICE].includes(e)},cn=function(e){return xt(e)&&Object.prototype.hasOwnProperty.call($,e)},ln=function(e){var t=!1,n=!1,r=!1;if(Jt(e)){var i=Object.keys(e).length;for(var o in t=i>20,e)if(n||(n=Ft(o)&&!/^[A-Za-z0-9_=+-]+$/.test(o)),!r){var s=e[o];r=o.length>32||s.length>4096}}return{isExceedLimit:t,isIllgalEx:n,isExKeyOrValLengthExceedLimit:r}},dn=function(e,t){var n;return Jt(e)?(t&&!t.includes(e.conversationType)&&(n="conversationTypeNotSupport"),sn(e.targetId)||(n="targetId"),tn(e.conversationType)||(n="conversationType"),Zt(e.channelId)||rn(e.channelId)||(n="channelId"),Zt(n)?{valid:!0}:{valid:Zt(n),errorKey:n}):{valid:!1,errorKey:"conversation"}},hn=function(){function e(){this._map={}}return e.prototype.on=function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n})},e.prototype.once=function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n,once:!0})},e.prototype.off=function(e,t,n){var r=this._map[e];r&&((r=r.filter((function(e){return e.listener!==t||e.target!==n}))).length?this._map[e]=r:delete this._map[e])},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map[e];if(r)for(var i=r.length-1;i>=0;i-=1){var o=r[i],s=o.target,a=o.once,u=o.listener;a&&r.splice(i,1);try{u.call.apply(u,c([s],t,!1))}catch(e){null===console||void 0===console||console.error(e)}}},e.prototype.removeAll=function(e){delete this._map[e]},e.prototype.clear=function(){Object.keys(this._map).forEach(this.removeAll,this)},e}(),pn="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};pn.engine="5.12.2";var _n=function(){function e(){}return e.add=function(e,t){pn[e]=t},e.validEngine=function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var n=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return pn.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=n},e.getInfo=function(){return pn},e}();function gn(){return!0}var fn=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},En=function(){var e=fn();if(e=e.replace(/-/g,"")+"a",e=function(e){var t="0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0".split(""),n=t.length+1,r=+e,i=[];do{var o=r%n;r=(r-o)/n,i.unshift(t[o])}while(r);return i.join("")}(e=parseInt(e,16)),e.length>22&&(e=e.slice(0,22)),e.length<22)for(var t=22-e.length,n=0;n<t;n++)e+="0";return e},In=En(),Tn=Date.now(),Rn=function(e){var t="";if("browser"===e.tag)return In;var n="RCDeviceId",r=d(e),i=r.get(n);return i?t=i:(t=En(),r.set(n,t)),t},vn=null;function Cn(e,t,n,r){void 0===n&&(n={});var i=["error","warn","info","debug"][3-e];if(vn&&e<Ie.FATAL)try{var o=JSON.stringify(n);vn[i](t,o)}catch(e){console.error(e)}}var yn,Sn,mn=Cn.bind(null,Ie.DEBUG),An=Cn.bind(null,Ie.INFO),Nn=Cn.bind(null,Ie.WARN),On=Cn.bind(null,Ie.ERROR),Mn=Cn.bind(null,Ie.FATAL),Un=Object.freeze({__proto__:null,init:function(e){vn=e},log:Cn,debug:mn,info:An,warn:Nn,error:On,fatal:Mn}),Ln=function(e){if(!Jt(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{"+t.length+"}$"),t),16)},Pn=function(e){return void 0===e&&(e=[]),e.map((function(e){var t,n,r,i,o,s,a,u,c,l=Bn(e.settingProfile)||{},d=e.extProfile||[],h=e.targetId,p=e.baseInfo,_=e.userInfo;return{groupId:h,groupName:null!==(t=l.name)&&void 0!==t?t:"",portraitUri:null!==(n=l.portraitUrl)&&void 0!==n?n:"",introduction:null!==(r=l.introduction)&&void 0!==r?r:"",notice:null!==(i=l.announcement)&&void 0!==i?i:"",extProfile:Bn(d),joinPermission:~~l.joinPerm,removeMemberPermission:~~l.removePerm,invitePermission:~~l.memInvitePerm,inviteHandlePermission:~~l.invitePerm,groupInfoEditPermission:~~l.profilePerm,memberInfoEditPermission:~~l.memProfilePerm,creatorId:null!==(o=null==p?void 0:p.creatorId)&&void 0!==o?o:"",ownerId:null!==(s=null==p?void 0:p.ownerId)&&void 0!==s?s:"",createTime:(null==p?void 0:p.createTime)?Ln(p.createTime):0,membersCount:null!==(a=null==p?void 0:p.memberCount)&&void 0!==a?a:0,remark:null!==(u=null==_?void 0:_.remarkName)&&void 0!==u?u:"",joinedTime:(null==_?void 0:_.joinTime)?Ln(_.joinTime):0,role:null!==(c=null==_?void 0:_.role)&&void 0!==c?c:ct.UNDEF}}))},bn=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Bn(e.settingProfile),n=e.extProfile||[],r=e.targetId,i=e.baseInfo,s=e.userInfo;return o(o(o(o(o(o(o({groupId:r},Dn(t)),n.length>0&&{extProfile:Bn(n)}),(null==i?void 0:i.creatorId)&&{creatorId:i.creatorId}),(null==i?void 0:i.ownerId)&&{ownerId:i.ownerId}),(null==i?void 0:i.createTime)&&{createTime:Ln(i.createTime)}),(null==i?void 0:i.memberCount)&&{membersCount:i.memberCount}),(null==s?void 0:s.remarkName)&&{remark:s.remarkName})}))},Dn=function(e){return o(o(o(o(o(o(o(o(o(o({},e.name&&{groupName:e.name}),e.portraitUrl&&{portraitUri:e.portraitUrl}),e.introduction&&{introduction:e.introduction}),e.announcement&&{notice:e.announcement}),e.joinPerm&&{joinPermission:~~e.joinPerm}),e.removePerm&&{removeMemberPermission:~~e.removePerm}),e.memInvitePerm&&{invitePermission:~~e.memInvitePerm}),e.invitePerm&&{inviteHandlePermission:~~e.invitePerm}),e.profilePerm&&{groupInfoEditPermission:~~e.profilePerm}),e.memProfilePerm&&{memberInfoEditPermission:~~e.memProfilePerm})},wn=function(e){void 0===e&&(e=[]);var t=e.map((function(e){var t=e||{},n=t.ext,r=t.userId,i=t.name,o=t.portraitUrl,s=n||{},a=s.role,u=s.joinTime,c=s.channelNickName,l=s.additional;return{userId:r,name:i||"",portraitUri:o||"",nickname:c||"",role:a||ct.UNDEF,joinedTime:Ln(u)||0,extra:l||""}}));return t},Vn=function(e,t){var n={},r=Date.now();return e.forEach((function(e){var i=e.userProfile,o=e.userId,s=Bn(i);n[o]={name:s.name||"",portraitUri:s.portraitUri||""},t&&(n[o].expiration=r+t)})),n},Gn=function(e){return e.map((function(e){var t=e.userId,n=e.opTime;return{userId:t,time:Ln(n)}}))},Bn=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Fn=function(e){return e.map((function(e){var t=e.targetId,n=e.joinUserInfo,r=e.inviterInfo,i=e.status,s=e.directionType,a=e.detail,u=e.joinType,c=e.processInfo,l=e.processTime;return o(o(o(o({groupId:t},n&&{joinMemberInfo:wn([n])[0]}),r&&{inviterInfo:wn([r])[0]}),c&&{operatorInfo:wn([c])[0]}),{status:i,direction:s,type:u,operationTime:Ln(l),reason:a})}))},kn=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},xn=function(){function e(e,t){var n=this;this._promise=new Promise((function(t){n._resolve=t,e(n._onResolve.bind(n))})),this._onCancel=t}return e.prototype._onResolve=function(e){this._resolve(e)},e.prototype.result=function(){return this._promise},e.prototype.abort=function(){this._onCancel(this._onResolve.bind(this))},e}();!function(e){e[e.STRING=0]="STRING",e[e.ONLY_STRING=1]="ONLY_STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.OBJECT=4]="OBJECT",e[e.ARRAY=5]="ARRAY",e[e.CALLBACK=6]="CALLBACK",e[e.CHANNEL_ID=7]="CHANNEL_ID",e[e.CONVERSATION=8]="CONVERSATION",e[e.CONVERSATION_TYPE=9]="CONVERSATION_TYPE"}(Sn||(Sn={}));var Hn=((yn={})[Sn.STRING]=Qt,yn[Sn.ONLY_STRING]=Ft,yn[Sn.NUMBER]=xt,yn[Sn.BOOLEAN]=function(e){return"boolean"==typeof e},yn[Sn.OBJECT]=Jt,yn[Sn.ARRAY]=Yt,yn[Sn.CALLBACK]=function(e){var t=!0;return Jt(e)||(t=!1),(e=e||{}).onSuccess&&!Xt(e.onSuccess)&&(t=!1),e.onError&&!Xt(e.onError)&&(t=!1),t},yn[Sn.CHANNEL_ID]=rn,yn[Sn.CONVERSATION]=function(e){var t=!0;return Jt(e)||(t=!1),Ft(e.targetId)||(t=!1),tn(e.conversationType)||(t=!1),Zt(e.channelId)||rn(e.channelId)||(t=!1),t},yn[Sn.CONVERSATION_TYPE]=tn,yn),Yn=function(e){function t(t){var n=e.call(this,t)||this;return n.name="RCAssertError",n}return r(t,e),t}(Error),Kn=function(e,t,n,r){if(void 0===r&&(r=!1),!qn(e,t,n,r))throw new Yn("'"+e+"' is invalid: "+JSON.stringify(t))},qn=function(e,t,n,r){void 0===r&&(r=!1),n=Hn[n]||n;var i=r?n(t):Zt(t)||null==t||n(t);return i||null===console||void 0===console||console.error("'"+e+"' is invalid: "+JSON.stringify(t)),i},jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Qn(e){var t,n,r,i,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=jn.indexOf(e.charAt(u++))<<2|(i=jn.indexOf(e.charAt(u++)))>>4,n=(15&i)<<4|(o=jn.indexOf(e.charAt(u++)))>>2,r=(3&o)<<6|(s=jn.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(r));return a}function Wn(e){for(var t=null===window||void 0===window?void 0:window.atob(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n.buffer}var Jn,Xn=function(e,t){var n=Math.floor(1e3*Math.random()%1e4),r=fn(),i=function(e){e=e||"-";var t=new Date;return""+t.getFullYear()+e+(t.getMonth()+1)+e+t.getDate()}(),o=(new Date).getTime(),s="";if(t){var a=t.split(".");s="."+a[a.length-1]}return e+"__RC-"+i+"_"+n+"_"+o+r+s},Zn=function(e){var t="application/octet-stream";switch(e){case $.IMAGE:t="image/jpeg";break;case $.AUDIO:t="audio/amr";break;case $.VIDEO:t="video/3gpp";break;case $.SIGHT:t="video/mpeg4";break;case $.COMBINE_HTML:t="text/html"}return t},zn=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t={}),void 0===n&&(n={});var r=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,s=t.typeVivo,a=t.importanceHW,u=t.categoryHW,c=t.imageUrlHW,l=t.categoryVivo,d=t.importanceHonor,h=t.imageUrlHonor,p=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.threadId,r=e.apnsCollapseId,i=e.category,o=e.richMediaUri,s=e.interruptionLevel,a=t.googleConfig,u={};u["thread-id"]=n||"",u["apns-collapse-id"]=r||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=s||"active";var c={};c.collapse_key=null==a?void 0:a.collapseKey,c.imageUrl=null==a?void 0:a.imageUrl;var l=null==a?void 0:a.priority;return l&&!["high","normal"].includes(l)&&(l="normal"),c.priority=l,{APNS:u,FCM:c}}(e,t),_=[{HW:{channelId:i||"",importance:a||"NORMAL",image:c||"",category:u||""}},{MI:{channelId:r||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:s||"",category:l||""}},{APNS:p.APNS},{FCM:p.FCM},{HONOR:{importance:d||ke.NORMAL,image:h||""}},{OHOS:{category:n.category||null,image:n.image||""}}];return JSON.stringify(_)},$n=function(e,t,n){var r={},i={notificationId:n||""},o={};if(!t)return{iOSConfig:r,androidConfig:i,harmonyOSConfig:o};try{var s=JSON.parse(t);null==s||s.forEach((function(e){var t,n,s,a,u,c,l,d,h,p,_,g,f=Object.keys(e);if(0!==f.length){var E=f[0];switch(E){case"HW":return i.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,i.importanceHW=null===(n=e[E])||void 0===n?void 0:n.importance,i.imageUrlHW=null===(s=e[E])||void 0===s?void 0:s.image,void(i.categoryHW=null===(a=e[E])||void 0===a?void 0:a.category);case"MI":return void(i.channelIdMi=null===(u=e[E])||void 0===u?void 0:u.channelId);case"OPPO":return void(i.channelIdOPPO=null===(c=e[E])||void 0===c?void 0:c.channelId);case"VIVO":return i.typeVivo=null===(l=e[E])||void 0===l?void 0:l.classification,void(i.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(i.googleConfig={collapseKey:e[E].collapse_key||"",imageUrl:e[E].imageUrl||"",priority:e[E].priority||""});case"HONOR":return i.importanceHonor=null===(h=e[E])||void 0===h?void 0:h.importance,void(i.imageUrlHonor=null===(p=e[E])||void 0===p?void 0:p.image);case"OHOS":o.category=null===(_=e[E])||void 0===_?void 0:_.category,o.image=null===(g=e[E])||void 0===g?void 0:g.image}}}))}catch(n){e.error(Re.O,"Wrong format for pushConfigs field! content: "+t)}return{iOSConfig:r,androidConfig:i,harmonyOSConfig:o}},er=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),n=e.length;return t&&(n<=128&&n>=1)},tr=function(e){var t=e.length;return t<=4096&&t>=1},nr=(Jn=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,20)-1)),n=e+Jn.toString(2).padStart(11,"0")+t.toString(2).padStart(20,"0");return Jn=2047&++Jn,parseInt(n,2)}),rr=function(){var e=_n.getInfo(),t="electron";for(var n in e)"engine"!==n&&(t=["imlib-v2-adapter","imlib-v4-adapter","imlib-next"].includes(n)?n:"electron");return t},ir=function(e,t,n){return a(void 0,void 0,void 0,(function(){var r,i;return u(this,(function(o){switch(o.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return r=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(n)},r,Wn(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function or(e,t){var n;if(!e)return"";var r="undefined"!=typeof window&&"https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol);return/^https?:\/\//.test(e)?r?e.replace(/^https?:\/\//i,"https://"):e:t!==Be.HTTP||r?"https://"+e:"http://"+e}function sr(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t|=0}return Math.abs(t)}var ar,ur,cr,lr=function(e,t){if(!e)return"";var n=e.ossConfig,r=void 0===n?"":n,i="";try{var o=JSON.parse(r);if(o.length>0){var s=o.find((function(e){return e.minio}));s&&(i=s.minio)}}catch(e){t.warn(Re.L_PARSE_JSON_E,JSON.stringify({ossConfig:r,error:e}))}return i};function dr(e,t,n){var r,i,o;return{userIdList:(null===(r=e.mentionedInfo)||void 0===r?void 0:r.userIdList)||t,type:(null===(i=e.mentionedInfo)||void 0===i?void 0:i.type)||n||ge.ALL,mentionedContent:(null===(o=e.mentionedInfo)||void 0===o?void 0:o.mentionedContent)||""}}!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(ar||(ar={})),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"}(ur||(ur={})),function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(cr||(cr={}));function hr(e){var t,n=e.method||ar.GET,r=e.timeout||6e4,i=e.headers,o=e.query,s=e.body,a=e.onProgress,u=T(e.url,o),c=(t="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&t?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),l="[object XDomainRequest]"===Object.prototype.toString.call(c);if(c.open(n,u),i&&c.setRequestHeader)for(var d in i)c.setRequestHeader(d,i[d]);return l?function(e,t,n){return new xn((function(r){0!==t&&(e.timeout=t),e.onload=function(){r({data:e.responseText,status:e.status||200})},e.onerror=function(){r({status:e.status})},e.ontimeout=function(){r({status:e.status})};var i="object"==typeof n?JSON.stringify(n):n;e.send(i)}),(function(t){e.abort(),t({status:-1})}))}(c,r,s):function(e,t,n,r){return new xn((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},r&&(e.upload.onprogress=function(e){return r(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(n)}),(function(t){e.abort(),t({status:-1})}))}(c,r,s,a)}var pr,_r,gr=function(e,t,n){var r=null==n?void 0:n.isReverse;Jt(e)&&function(){for(var n in e)t(e[n],n,e)}(),(Yt(e)||Ft(e))&&function(){if(r)for(var n=e.length-1;n>=0;n--)t(e[n],n);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},fr=function(e,t){return gr(e,(function(n,r){e[r]=t(n,r)})),e},Er=function(e,t){if(e.indexOf)return e.indexOf(t);var n=-1;return gr(e,(function(e,r){t===e&&(n=r)})),n},Ir=function(e,t){return-1!==Er(e,t)},Tr=function(e,t){var n=[];return gr(e,(function(e){n.push(e)})),-1!==Er(n,t)},Rr=function(e){return JSON.parse(JSON.stringify(e))},vr=function(){return"undefined"!=typeof RCCppEngine},Cr=function(e){if("browser"!==e.tag)return{type:e.tag,version:"UnKonw"};var t,n,r=navigator.userAgent,i={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 o in i)if(i.hasOwnProperty(o)){var s=r.match(i[o]);if(s){n=o,t=s[1]||s[2];break}}return{type:n||"UnKonw",version:t||"UnKonw"}},yr=function(e){var t;if("object"==typeof e&&null!==e)if(Array.isArray(e))for(var n in t=[],e)t.push(yr(e[n]));else for(var n in t={},e)t[n]=yr(e[n]);else t=e;return t},Sr=function(e){var t;try{t=yr(e)}catch(n){t=JSON.parse(JSON.stringify(e))}return t},mr=function(e){return{isRead:(e&t.READ)===t.READ,isListened:(e&t.LISTENED)===t.LISTENED,isDownload:(e&t.DOWNLOADED)===t.DOWNLOADED,isRetrieved:(e&t.RETRIEVED)===t.RETRIEVED}},Ar=function(e){var n=t.UNREAD;return(null==e?void 0:e.isRead)&&(n|=t.READ),(null==e?void 0:e.isListened)&&(n|=t.LISTENED),(null==e?void 0:e.isDownload)&&(n|=t.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(n|=t.RETRIEVED),n},Nr=function(e){return[tt.Android,tt.iOS,tt.Web,tt.PC,tt.Mini,tt.HarmonyOS].map((function(t){var n=e.findIndex((function(e){return e.platform===t}));return-1===n?{platform:t,changeTime:0,eventValue:0}:e[n]}))},Or=function(e,t,n){var r=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return r.userId=e,n.forEach((function(e){r.extraProfile=r.extraProfile||{},r.extraProfile[e.key]=e.value})),r},Mr=function(e){return"undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==Cr(e).type},Ur=function(){var e=window.indexedDB;e.databases&&e.databases().then((function(t){t.some((function(e){return"RC_ENGINE_DB"===e.name}))&&e.deleteDatabase("RC_ENGINE_DB")}))},Lr=function(e,t,n){return t?1===n?Be.TLS:Be.RMTP:"http"===e?Be.WS:Be.WSS},Pr=function(e,t){var n=e.server,r=e.backupServer,i=e.bs,o=e.serverAddr,s=e.protocol,a=e.openTLS;if(o)return c([],o.filter((function(e){return e.addr})),!0);var u=[],l=[];return n&&l.push(n),(r||i||"").split(",").forEach((function(e){l.indexOf(e)<0&&l.push(e)})),l.forEach((function(e,r){e&&u.push({addr:e,protocol:Lr(s,t,a),weight:n.length-r,race:!1})})),c([],u,!0)},br=function(e){return[oe.GROUP,oe.DISCUSSION,oe.ULTRA_GROUP,oe.PUBLIC_SERVICE,oe.APP_PUBLIC_SERVICE].includes(e)},Dr={_delayTime:0,setTime:function(e){var t=(new Date).getTime();Dr._delayTime=t-e},getTime:function(){var e=Dr._delayTime;return(new Date).getTime()-e}},wr=function(e,t){var n=0;return e.isAutoDelete&&(n|=1),e.isOverwrite&&(n|=2),2===t&&(n|=4),n},Vr=function(){function e(e){this._pullQueue=[],this._isPulling=!1,this._pullTime=0,this._engine=e}return e.prototype._startPull=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,n=e.timestamp,(r=this._pullTime)>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,o===re.SUCCESS?(this._isPulling=!1,this._pullTime=s.syncTime||0,this._startPull()):this._startPull(),[2]}}))}))},e.prototype.pullEntry=function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()},e.prototype.reset=function(){this._pullTime=0,this._isPulling=!1},e}(),Gr="rtcRJoin_data",Br="rtcRExit",Fr="rtcRInfo",kr="rtcUData",xr="rtcUPut",Hr="rtcUDel",Yr="rtcSetData",Kr="userSetData",qr="rtcQryData",jr="rtcDelData",Qr="rtcToken",Wr="rtcUserState",Jr="rtcUList",Xr="viewerJoinR",Zr="viewerExitR",zr="rtcPullKv",$r="rtcIdentityChange",ei="rtcInvite",ti="rtcCancelInvite",ni="rtcInviteAnswer",ri="rtcEndInvite",ii="rtcQueryJoined";!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"}(_r||(_r={}));var oi=((pr={})[_r.RtcInput]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType","innerDatas","outerDatas"],pr[_r.RtcUserListOutput]=["users","token","sessionId","roomInfo"],pr[_r.SetUserStatusInput]=["status"],pr[_r.RtcSetDataInput]=["interior","target","key","value","objectName","content"],pr[_r.RtcUserSetDataInput]=["valueInfo","objectName","content"],pr[_r.RtcDataInput]=["interior","target","key","objectName","content"],pr[_r.RtcSetOutDataInput]=["target","valueInfo","objectName","content"],pr[_r.MCFollowInput]=["state"],pr[_r.RtcTokenOutput]=["rtcToken"],pr[_r.RtcQryOutput]=["outInfo"],pr[_r.RtcQryUserOutDataInput]=["userId"],pr[_r.RtcUserOutDataOutput]=["user"],pr[_r.RtcQueryListInput]=["order"],pr[_r.RtcRoomInfoOutput]=["roomId","roomData","userCount","list"],pr[_r.RtcValueInfo]=["key","value"],pr[_r.RtcKeyDeleteInput]=["key"],pr[_r.RtcNotifyMsg]=["type","time","roomId"],pr[_r.RtcPullKV]=["timestamp","roomId"],pr[_r.RtcKVOutput]=["entries","bFullUpdate","syncTime"],pr[_r.RtcQueryUserJoinedInput]=["userId"],pr[_r.RtcQueryUserJoinedOutput]=["info"],pr[_r.RtcInviteInput]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],pr[_r.RtcCancelInviteInput]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],pr[_r.RtcInviteAnswerInput]=["inviteUserId","answerCode","inviteRoomId","inviteSessionId","content","key","value"],pr[_r.RtcEndInviteInput]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"],pr),si="\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 "+_r.SetUserStatusInput+"\n {\n optional int32 status=1;\n }\n message "+_r.MCFollowInput+"\n {\n required string state = 1;\n }\n message "+_r.RtcQueryListInput+"{\n optional int32 order=1;\n }\n message "+_r.RtcKeyDeleteInput+"{\n repeated string key=1;\n }\n message "+_r.RtcValueInfo+"{\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo{\n required string userId=1;\n repeated "+_r.RtcValueInfo+" userData=2; //用户资源信息\n }\n message "+_r.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 "+_r.RtcValueInfo+" roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message "+_r.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 "+_r.RtcValueInfo+" innerDatas = 7; //用户内部inner数据,角色或者连麦信息等\n repeated "+_r.RtcValueInfo+" outerDatas = 8; //用户内部outer数据,自定义数据结构RtcInput。\n }\n message "+_r.RtcQryOutput+"{\n repeated "+_r.RtcValueInfo+" outInfo=1;\n }\n message "+_r.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 "+_r.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 "+_r.RtcUserSetDataInput+" {\n repeated "+_r.RtcValueInfo+" valueInfo = 1;\n required string objectName = 2;\n repeated "+_r.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 "+_r.RtcTokenOutput+"{\n required string rtcToken=1;\n }\n message "+_r.RtcSetOutDataInput+"{\n required targetType target=1;\n repeated "+_r.RtcValueInfo+" valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message "+_r.RtcQryUserOutDataInput+"{\n repeated string userId = 1;\n }\n message "+_r.RtcUserOutDataOutput+"{\n repeated RtcUserInfo user = 1;\n }\n message "+_r.RtcNotifyMsg+" \n {\n required int32 type= 1; //(通知类型 1:rtc房间状态KV变更通知)\n optional int64 time= 2; //消息产生时间\n optional string roomId=3; //主播房间id\n }\n message "+_r.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 "+_r.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 "+_r.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 "+_r.RtcQueryUserJoinedOutput+"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message "+_r.RtcViewerJoinedOutput+"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV属性对象集合\n optional int64 syncTime = 3;//所有属性的最大时间戳(下次拉取KV时用)。\n }\n message "+_r.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 "+_r.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 "+_r.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 "+_r.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",ai=function(){function e(e,t,n,r,i,o){this.runtime=e,this.rtcCodec=t,this._watcher=n,this._options=r,this.logger=i,this.statisticLog=o,this._appkey=this._options.appkey,this._rtcKVManager=new Vr(this)}return e.prototype.registerRTCSignalingListener=function(e){this._rtcSignalingListener=e},e.prototype.getInnerLogger=function(){return this.logger},e.prototype.getInnerStatisticLog=function(){return this.statisticLog},e.prototype.pullRTCRoomEntry=function(e,t){return a(this,void 0,void 0,(function(){var t,n,r,i,s,a,c;return u(this,(function(u){switch(u.label){case 0:return t=this.rtcCodec.encode(_r.RtcPullKV,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,zr,!0,t)];case 1:return n=u.sent(),r=n.code,i=n.buffer,r!==re.SUCCESS?[2,{code:r}]:(s=this.rtcCodec.decode(_r.RtcKVOutput,i),a=s.entries,c=s.syncTime,a=(a||[]).map((function(e){return o(o({},e),{timestamp:Ln(e.timestamp)})})),this._watcher.onRTCDataChange(a,e),[2,{code:r,data:{kvEntries:a,syncTime:Ln(c)}}])}}))}))},e.prototype._receiveRtcKv=function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=this.rtcCodec.decode(_r.RtcNotifyMsg,e),n=t.time,r=t.type,i=t.roomId;1===r&&this._rtcKVManager.pullEntry(i,Ln(n))}},e.prototype.destroy=function(){},e}();function ui(e){var t=function(){function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,r,o;return t?(o=(e>>>=0)>=0&&e<256)&&(r=u[e])?r:(n=i(e,(0|e)<0?-1:0,!0),o&&(u[e]=n),n):(o=(e|=0)>=-128&&e<128)&&(r=a[e])?r:(n=i(e,e<0?-1:0,!1),o&&(a[e]=n),n)}function r(e,t){if(isNaN(e)||!isFinite(e))return t?g:_;if(t){if(e<0)return g;if(e>=d)return R}else{if(-h>=e)return v;if(e+1>=h)return T}return e<0?r(-e,t).neg():i(0|e%l,0|e/l,t)}function i(t,n,r){return new e(t,n,r)}function o(e,t,n){var i,s,a,u,l,d,h;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return _;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||n>36)throw RangeError("radix");if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(e.substring(1),t,n).neg();for(s=r(c(n,8)),a=_,u=0;u<e.length;u+=8)l=Math.min(8,e.length-u),d=parseInt(e.substring(u,u+l),n),l<8?(h=r(c(n,l)),a=a.mul(h).add(r(d))):a=(a=a.mul(s)).add(r(d));return a.unsigned=t,a}function s(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?o(t):i(t.low,t.high,t.unsigned)}var a,u,c,l,d,h,p,_,g,f,E,I,T,R,v,C;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,a={},u={},e.fromInt=n,e.fromNumber=r,e.fromBits=i,c=Math.pow,e.fromString=o,e.fromValue=s,h=(d=(l=4294967296)*l)/2,p=n(16777216),_=n(0),e.ZERO=_,g=n(0,!0),e.UZERO=g,f=n(1),e.ONE=f,E=n(1,!0),e.UONE=E,I=n(-1),e.NEG_ONE=I,T=i(-1,2147483647,!1),e.MAX_VALUE=T,R=i(-1,-1,!0),e.MAX_UNSIGNED_VALUE=R,v=i(0,-2147483648,!1),e.MIN_VALUE=v,(C=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},C.toString=function(e){var t,n,i,o,s,a,u,l;if((e=e||10)<2||e>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(v)?(t=r(e),i=(n=this.div(t)).mul(t).sub(this),n.toString(e)+i.toInt().toString(e)):"-"+this.neg().toString(e);for(o=r(c(e,6),this.unsigned),s=this,a="";;){if(u=s.div(o),l=(s.sub(u.mul(o)).toInt()>>>0).toString(e),(s=u).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){var e,t;if(this.isNegative())return this.eq(v)?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},C.isZero=function(){return 0===this.high&&0===this.low},C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return!(1&~this.low)},C.isEven=function(){return!(1&this.low)},C.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)},C.eq=C.equals,C.notEquals=function(e){return!this.eq(e)},C.neq=C.notEquals,C.lessThan=function(e){return this.comp(e)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(e){return this.comp(e)<=0},C.lte=C.lessThanOrEqual,C.greaterThan=function(e){return this.comp(e)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(e){return this.comp(e)>=0},C.gte=C.greaterThanOrEqual,C.compare=function(e){if(t(e)||(e=s(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(v)?v:this.not().add(f)},C.neg=C.negate,C.add=function(e){var n,r,o,a,u,c,l,d,h,p,_;return t(e)||(e=s(e)),n=this.high>>>16,r=65535&this.high,o=this.low>>>16,a=65535&this.low,u=e.high>>>16,c=65535&e.high,l=e.low>>>16,d=0,h=0,p=0,_=0,p+=(_+=a+(65535&e.low))>>>16,h+=(p+=o+l)>>>16,d+=(h+=r+c)>>>16,d+=n+u,i((p&=65535)<<16|(_&=65535),(d&=65535)<<16|(h&=65535),this.unsigned)},C.subtract=function(e){return t(e)||(e=s(e)),this.add(e.neg())},C.sub=C.subtract,C.multiply=function(e){var n,o,a,u,c,l,d,h,g,f,E,I;return this.isZero()?_:(t(e)||(e=s(e)),e.isZero()?_:this.eq(v)?e.isOdd()?v:_:e.eq(v)?this.isOdd()?v:_:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(p)&&e.lt(p)?r(this.toNumber()*e.toNumber(),this.unsigned):(n=this.high>>>16,o=65535&this.high,a=this.low>>>16,u=65535&this.low,c=e.high>>>16,l=65535&e.high,d=e.low>>>16,g=0,f=0,E=0,I=0,E+=(I+=u*(h=65535&e.low))>>>16,f+=(E+=a*h)>>>16,E&=65535,f+=(E+=u*d)>>>16,g+=(f+=o*h)>>>16,f&=65535,g+=(f+=a*d)>>>16,f&=65535,g+=(f+=u*l)>>>16,g+=n*h+o*d+a*l+u*c,i((E&=65535)<<16|(I&=65535),(g&=65535)<<16|(f&=65535),this.unsigned)))},C.mul=C.multiply,C.divide=function(e){var n,i,o,a,u,l,d;if(t(e)||(e=s(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:_;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return E;o=g}else{if(this.eq(v))return e.eq(f)||e.eq(I)?v:e.eq(v)?f:(n=this.shr(1).div(e).shl(1)).eq(_)?e.isNegative()?f:I:(i=this.sub(e.mul(n)),o=n.add(i.div(e)));if(e.eq(v))return this.unsigned?g:_;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(n=Math.max(1,Math.floor(i.toNumber()/e.toNumber())),u=(a=Math.ceil(Math.log(n)/Math.LN2))<=48?1:c(2,a-48),d=(l=r(n)).mul(e);d.isNegative()||d.gt(i);)d=(l=r(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=f),o=o.add(l),i=i.sub(d)}return o},C.div=C.divide,C.modulo=function(e){return t(e)||(e=s(e)),this.sub(this.div(e).mul(e))},C.mod=C.modulo,C.not=function(){return i(~this.low,~this.high,this.unsigned)},C.and=function(e){return t(e)||(e=s(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},C.or=function(e){return t(e)||(e=s(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},C.xor=function(e){return t(e)||(e=s(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},C.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)},C.shl=C.shiftLeft,C.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)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(e){var n;return t(e)&&(e=e.toInt()),0===(e&=63)?this:(n=this.high,e<32?i(this.low>>>e|n<<32-e,n>>>e,this.unsigned):i(32===e?n:n>>>e-32,0,this.unsigned))},C.shru=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},C.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},C.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]},C.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}(),n=function(e){function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){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 r(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)}function i(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,d=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,_=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=l?(a=0,s=l):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[n+p]=255&a,p+=_,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+p]=255&s,p+=_,s/=256,c-=8);e[n+p-_]|=128*g}var o,s,a,u,c,l=function(e,t,n){if(void 0===e&&(e=l.DEFAULT_CAPACITY),void 0===t&&(t=l.DEFAULT_ENDIAN),void 0===n&&(n=l.DEFAULT_NOASSERT),!n){if((e|=0)<0)throw RangeError("Illegal capacity");t=!!t,n=!!n}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=n};return l.VERSION="5.0.1",l.LITTLE_ENDIAN=!0,l.BIG_ENDIAN=!1,l.DEFAULT_CAPACITY=16,l.DEFAULT_ENDIAN=l.BIG_ENDIAN,l.DEFAULT_NOASSERT=!1,l.Long=e||null,(o=l.prototype).__isByteBuffer__,Object.defineProperty(o,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1}),s=new ArrayBuffer(0),a=String.fromCharCode,l.accessor=function(){return Uint8Array},l.allocate=function(e,t,n){return new l(e,t,n)},l.concat=function(e,t,n,r){var i,o,s,a,u,c;for(("boolean"==typeof t||"string"!=typeof t)&&(r=n,n=t,t=void 0),i=0,s=0,a=e.length;a>s;++s)l.isByteBuffer(e[s])||(e[s]=l.wrap(e[s],t)),(o=e[s].limit-e[s].offset)>0&&(i+=o);if(0===i)return new l(0,n,r);for(c=new l(i,n,r),s=0;a>s;)(o=(u=e[s++]).limit-u.offset)<=0||(c.view.set(u.view.subarray(u.offset,u.limit),c.offset),c.offset+=o);return c.limit=c.offset,c.offset=0,c},l.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},l.type=function(){return ArrayBuffer},l.wrap=function(e,t,n,r){var i,s;if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return l.fromBase64(e,n);case"hex":return l.fromHex(e,n);case"binary":return l.fromBinary(e,n);case"utf8":return l.fromUTF8(e,n);case"debug":return l.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");if(l.isByteBuffer(e))return(i=o.clone.call(e)).markedOffset=-1,i;if(e instanceof Uint8Array)i=new l(0,n,r),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 l(0,n,r),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 l(e.length,n,r)).limit=e.length,s=0;s<e.length;++s)i.view[s]=e[s]}return i},o.writeBitSet=function(e,t){var n,r,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(r=t,o=(i=e.length)>>3,s=0,t+=this.writeVarint32(i,t);o--;)n=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(n,t++);if(i>s){for(a=0,n=0;i>s;)n|=(1&!!e[s++])<<a++;this.writeByte(n,t++)}return u?(this.offset=t,this):t-r},o.readBitSet=function(e){var t,n,r,i,o,s,a,u=void 0===e;for(u&&(e=this.offset),i=(r=(n=this.readVarint32(e)).value)>>3,o=0,s=[],e+=n.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(r>o)for(a=0,t=this.readByte(e++);r>o;)s[o++]=!!(1&t>>a++);return u&&(this.offset=e),s},o.readBytes=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}return n=this.slice(t,t+e),r&&(this.offset+=e),n},o.writeBytes=o.append,o.writeInt8=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},o.writeByte=o.writeInt8,o.readInt8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return!(128&~(t=this.view[e]))&&(t=-(255-t+1)),n&&(this.offset+=1),t},o.readByte=o.readInt8,o.writeUint8=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},o.writeUInt8=o.writeUint8,o.readUint8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=this.view[e],n&&(this.offset+=1),t},o.readUInt8=o.readUint8,o.writeInt16=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n: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),r&&(this.offset+=2),this},o.writeShort=o.writeInt16,o.readInt16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+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)),n&&(this.offset+=2),t},o.readShort=o.readInt16,o.writeUint16=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n: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),r&&(this.offset+=2),this},o.writeUInt16=o.writeUint16,o.readUint16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+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]),n&&(this.offset+=2),t},o.readUInt16=o.readUint16,o.writeInt32=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n: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),r&&(this.offset+=4),this},o.writeInt=o.writeInt32,o.readInt32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}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,n&&(this.offset+=4),t},o.readInt=o.readInt32,o.writeUint32=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n: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),r&&(this.offset+=4),this},o.writeUInt32=o.writeUint32,o.readUint32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}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),n&&(this.offset+=4),t},o.readUInt32=o.readUint32,e&&(o.writeInt64=function(t,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,o=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o):(this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),s&&(this.offset+=8),this},o.writeLong=o.writeInt64,o.readInt64=function(t){var n,r,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 n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!1),o&&(this.offset+=8),i},o.readLong=o.readInt64,o.writeUint64=function(t,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,o=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o):(this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),s&&(this.offset+=8),this},o.writeUInt64=o.writeUint64,o.readUint64=function(t){var n,r,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 n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!0),o&&(this.offset+=8),i},o.readUInt64=o.readUint64),o.writeFloat32=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},o.writeFloat=o.writeFloat32,o.readFloat32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,23,4),n&&(this.offset+=4),t},o.readFloat=o.readFloat32,o.writeFloat64=function(e,t){var n,r=void 0===t;if(r&&(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)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},o.writeDouble=o.writeFloat64,o.readFloat64=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,52,8),n&&(this.offset+=8),t},o.readDouble=o.readFloat64,l.MAX_VARINT32_BYTES=5,l.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:1<<21>e?3:1<<28>e?4:5},l.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},l.zigZagDecode32=function(e){return e>>>1^-(1&e)},o.writeVarint32=function(e,t){var n,r,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+=r=l.calculateVarint32(e))>(i=this.buffer.byteLength)&&this.resize((i*=2)>t?i:t),t-=r,e>>>=0;e>=128;)n=128|127&e,this.view[t++]=n,e>>>=7;return this.view[t++]=e,o?(this.offset=t,this):r},o.writeVarint32ZigZag=function(e,t){return this.writeVarint32(l.zigZagEncode32(e),t)},o.readVarint32=function(e){var t,n,r,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)}n=0,r=0;do{if(!this.noAssert&&e>this.limit)throw(i=Error("Truncated")).truncated=!0,i;t=this.view[e++],n<5&&(r|=(127&t)<<7*n),++n}while(128&t);return r|=0,o?(this.offset=e,r):{value:r,length:n}},o.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=l.zigZagDecode32(t.value):t=l.zigZagDecode32(t),t},e&&(l.MAX_VARINT64_BYTES=10,l.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:1<<21>n?3:4:r<16384?r<128?5:6:1<<21>r?7:8:i<128?9:10},l.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()},l.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,n){var r,i,o,s,a,u=void 0===n;if(u&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}switch("number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),r=l.calculateVarint64(t),i=t.toInt()>>>0,o=t.shiftRightUnsigned(28).toInt()>>>0,s=t.shiftRightUnsigned(56).toInt()>>>0,(n+=r)>(a=this.buffer.byteLength)&&this.resize((a*=2)>n?a:n),n-=r,r){case 10:this.view[n+9]=1&s>>>7;case 9:this.view[n+8]=9!==r?128|s:127&s;case 8:this.view[n+7]=8!==r?128|o>>>21:127&o>>>21;case 7:this.view[n+6]=7!==r?128|o>>>14:127&o>>>14;case 6:this.view[n+5]=6!==r?128|o>>>7:127&o>>>7;case 5:this.view[n+4]=5!==r?128|o:127&o;case 4:this.view[n+3]=4!==r?128|i>>>21:127&i>>>21;case 3:this.view[n+2]=3!==r?128|i>>>14:127&i>>>14;case 2:this.view[n+1]=2!==r?128|i>>>7:127&i>>>7;case 1:this.view[n]=1!==r?128|i:127&i}return u?(this.offset+=r,this):r},o.writeVarint64ZigZag=function(e,t){return this.writeVarint64(l.zigZagEncode64(e),t)},o.readVarint64=function(t){var n,r,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(n=t,r=0,i=0,o=0,s=0,r=127&(s=this.view[t++]),128&s&&(r|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(r|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(r|=(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(r|i<<28,i>>>4|o<<24,!1),u?(this.offset=t,a):{value:a,length:t-n}},o.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=l.zigZagDecode64(n.value):n=l.zigZagDecode64(n),n}),o.writeCString=function(e,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),i=e.length,!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;i>r;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return i=c.calculateUTF16asUTF8(t(e))[1],n+=i+1,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=i+1,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,s?(this.offset=n,this):i},o.readCString=function(e){var t,r,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,c.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),r=n(),!0),o?(this.offset=e,r()):{string:r(),length:e-t}},o.writeIString=function(e,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(i=n,r=c.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+r,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=4+r,this.littleEndian?(this.view[n+3]=255&r>>>24,this.view[n+2]=255&r>>>16,this.view[n+1]=255&r>>>8,this.view[n]=255&r):(this.view[n]=255&r>>>24,this.view[n+1]=255&r>>>16,this.view[n+2]=255&r>>>8,this.view[n+3]=255&r),n+=4,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==i+4+r)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+r));return s?(this.offset=n,this):n-i},o.readIString=function(e){var t,n,r,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,n=this.readUint32(e),r=this.readUTF8String(n,l.METRICS_BYTES,e+=4),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},l.METRICS_CHARS="c",l.METRICS_BYTES="b",o.writeUTF8String=function(e,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return i=n,r=c.calculateUTF16asUTF8(t(e))[1],n+=r,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=r,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),s?(this.offset=n,this):n-i},o.writeString=o.writeUTF8String,l.calculateUTF8Chars=function(e){return c.calculateUTF16asUTF8(t(e))[0]},l.calculateUTF8Bytes=function(e){return c.calculateUTF16asUTF8(t(e))[1]},l.calculateString=l.calculateUTF8Bytes,o.readUTF8String=function(e,t,r){var i,o,s,a,u;if("number"==typeof t&&(r=t,t=void 0),(i=void 0===r)&&(r=this.offset),void 0===t&&(t=l.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(s=0,a=r,t===l.METRICS_CHARS){if(o=n(),c.decodeUTF8(function(){return e>s&&r<this.limit?this.view[r++]:null}.bind(this),(function(e){++s,c.UTF8toUTF16(e,o)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=r,o()):{string:o(),length:r-a}}if(t===l.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}if(u=r+e,c.decodeUTF8toUTF16(function(){return u>r?this.view[r++]:null}.bind(this),o=n(),this.noAssert),r!==u)throw RangeError("Illegal range: Truncated data, "+r+" == "+u);return i?(this.offset=r,o()):{string:o(),length:r-a}}throw TypeError("Unsupported metrics: "+t)},o.readString=o.readUTF8String,o.writeVString=function(e,n){var r,i,o,s,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(o=n,r=c.calculateUTF16asUTF8(t(e),this.noAssert)[1],i=l.calculateVarint32(r),n+=i+r,s=this.buffer.byteLength,n>s&&this.resize((s*=2)>n?s:n),n-=i+r,n+=this.writeVarint32(r,n),c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==o+r+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+r+i));return a?(this.offset=n,this):n-o},o.readVString=function(e){var t,n,r,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,n=this.readVarint32(e),r=this.readUTF8String(n.value,l.METRICS_BYTES,e+=n.length),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},o.append=function(e,t,n){var r,i,o;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof l||(e=l.wrap(e,t)),(i=e.limit-e.offset)<=0||((n+=i)>(o=this.buffer.byteLength)&&this.resize((o*=2)>n?o:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(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 l(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 n,r,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===(n=t-e)?(this.buffer=s,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this):(r=new ArrayBuffer(n),(i=new Uint8Array(r)).set(this.view.subarray(e,t)),this.buffer=r,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,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 l(0,this.littleEndian,this.noAssert);var n=t-e,r=new l(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},o.copyTo=function(e,t,n,r){var i,o,s;if(!this.noAssert&&!l.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o=void 0===t)?e.offset:0|t,n=(i=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);return 0===(s=r-n)?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(n,r),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,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;n>t;)this.view[t++]=e;return r&&(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,n){var r,i,o,s,a;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof l||(e=l.wrap(e,t)),(i=e.limit-e.offset)<=0||((o=i-n)>0?(s=new ArrayBuffer(this.buffer.byteLength+o),(a=new Uint8Array(s)).set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=s,this.view=a,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,n+=o):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(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,n;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),(n=new Uint8Array(t)).set(this.view),this.buffer=t,this.view=n),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 n=this.clone();return n.offset=e,n.limit=t,n},o.toBuffer=function(e){var t,n=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: Not an integer");if(n>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,n<0||n>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+r+" <= "+this.buffer.byteLength)}return e||0!==n||r!==this.buffer.byteLength?n===r?s:(t=new ArrayBuffer(r-n),new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(n,r),0),t):this.buffer},o.toArrayBuffer=o.toBuffer,o.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(n=t=e="utf8"),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}},u=function(){var e,t,n={},r=[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=r.length;t>e;++e)i[r[e]]=e;return n.encode=function(e,t){for(var n,i;null!==(n=e());)t(r[63&n>>2]),i=(3&n)<<4,null!==(n=e())?(t(r[63&((i|=15&n>>4)|15&n>>4)]),i=(15&n)<<2,null!==(n=e())?(t(r[63&(i|3&n>>6)]),t(r[63&n])):(t(r[63&i]),t(61))):(t(r[63&i]),t(61),t(61))},n.decode=function(e,t){function n(e){throw Error("Illegal character code: "+e)}for(var r,o,s;null!==(r=e());)if(void 0===(o=i[r])&&n(r),null!==(r=e())&&(void 0===(s=i[r])&&n(r),t(o<<2>>>0|(48&s)>>4),null!==(r=e()))){if(void 0===(o=i[r])){if(61===r)break;n(r)}if(t((15&s)<<4>>>0|(60&o)>>2),null!==(r=e())){if(void 0===(s=i[r])){if(61===r)break;n(r)}t((3&o)<<6>>>0|s)}}},n.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},n}(),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 r;return u.encode(function(){return t>e?this.view[e++]:null}.bind(this),r=n()),r()},l.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new l(e.length/4*3,n),i=0;return u.decode(t(e),(function(e){r.view[i++]=e})),r.limit=i,r},l.btoa=function(e){return l.fromBinary(e).toBase64()},l.atob=function(e){return l.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 n=[],r=[];t>e;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},l.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,o=new l(i,t);i>r;){if((n=e.charCodeAt(r))>255)throw RangeError("illegal char code: "+n);o.view[r++]=n}return o.limit=i,o},o.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",s="";r>n;){if(-1!==n&&(i+=(t=this.view[n])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";s+=i+o+"\n",i=o=""}i+=n===this.offset&&n===this.limit?n===this.markedOffset?"!":"|":n===this.offset?n===this.markedOffset?"[":"<":n===this.limit?n===this.markedOffset?"]":">":n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";s+=i+o+"\n"}return e?s:i},l.fromDebug=function(e,t,n){for(var r,i,o=e.length,s=new l(0|(o+1)/3,t,n),a=0,u=0,c=!1,d=!1,h=!1,p=!1,_=!1;o>a;){switch(r=e.charAt(a++)){case"!":if(!n){if(d||h||p){_=!0;break}d=h=p=!0}s.offset=s.markedOffset=s.limit=u,c=!1;break;case"|":if(!n){if(d||p){_=!0;break}d=p=!0}s.offset=s.limit=u,c=!1;break;case"[":if(!n){if(d||h){_=!0;break}d=h=!0}s.offset=s.markedOffset=u,c=!1;break;case"<":if(!n){if(d){_=!0;break}d=!0}s.offset=u,c=!1;break;case"]":if(!n){if(p||h){_=!0;break}p=h=!0}s.limit=s.markedOffset=u,c=!1;break;case">":if(!n){if(p){_=!0;break}p=!0}s.limit=u,c=!1;break;case"'":if(!n){if(h){_=!0;break}h=!0}s.markedOffset=u,c=!1;break;case" ":c=!1;break;default:if(!n&&c){_=!0;break}if(i=parseInt(r+e.charAt(a++),16),!n&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[u++]=i,c=!0}if(_)throw TypeError("Illegal str: Invalid symbol at "+a)}if(!n){if(!d||!p)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 n,r=new Array(t-e);t>e;)(n=this.view[e++])<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},l.fromHex=function(e,t,n){var r,i,o,s,a;if(!n){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 l(0|i/2,t),s=0,a=0;i>s;s+=2){if(r=parseInt(e.substring(s,s+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[a++]=r}return o.limit=a,o},c=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(192|31&n>>6),t(128|63&n)):n<65536?(t(224|15&n>>12),t(128|63&n>>6),t(128|63&n)):(t(240|7&n>>18),t(128|63&n>>12),t(128|63&n>>6),t(128|63&n)),n=null},decodeUTF8:function(e,t){for(var n,r,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!==(n=e());)if(128&n)if(192==(224&n))null===(r=e())&&s([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))(null===(r=e())||null===(i=e()))&&s([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(o=e()))&&s([n,r,i,o]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}else t(n)},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(t(55296+((n-=65536)>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,n)}))},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,n)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,(function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4})),[n,r]}};return e}(),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 r;try{c.decodeUTF8toUTF16(function(){return t>e?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},l.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new l(c.calculateUTF16asUTF8(t(e),!0)[1],n,r),o=0;return c.encodeUTF16toUTF8(t(e),(function(e){i.view[o++]=e})),i.limit=o,i},l}(t),r=function(t,n){var r,i,o={};return o.ByteBuffer=t,o.c=t,r=t,o.Long=n||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")}],n=null;for(e=0;e<t.length;e++){try{n=t[e]()}catch(e){continue}break}if(!n)throw Error("XMLHttpRequest is not supported");return n},e.fetch=function(t,n){if(n&&"function"!=typeof n&&(n=null),e.IS_NODE)if(n)g.readFile(t,(function(e,t){n(e?null:""+t)}));else try{return g.readFileSync(t)}catch(e){return null}else{var r=e.XHR();if(r.open("GET",t,!!n),r.setRequestHeader("Accept","text/plain"),"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/plain"),!n)return r.send(null),200==r.status||0==r.status&&"string"==typeof r.responseText?r.responseText:null;if(r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0==r.status&&"string"==typeof r.responseText?n(r.responseText):n(null))},4==r.readyState)return;r.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 n(e,n){var r=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=0|i*r,!n&&r<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return r}function r(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return 1/0*n;if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function i(e,t,n){void 0===e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}var o,s,a={},u=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},c=u.prototype;return c._readString=function(){var e,n='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;if(n.lastIndex=this.index-1,!(e=n.exec(this.source)))throw Error("unterminated string");return this.index=n.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,e[1]},c.next=function(){var e,n,r,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(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;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},c.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},c.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},c.omit=function(e){return this.peek()===e&&(this.next(),!0)},c.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,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},r=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!r||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!r)throw Error("unexpected 'import'");"public"===(e=this.tn.peek())&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n.imports.push(e);break;case"syntax":if(!r)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),r=!1;break;case"enum":this._parseEnum(n),r=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},o.parse=function(e){return new o(e).parse()},s._readString=function(){var e,t,n="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},s._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return r(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},s._parseOption=function(e,n){var r,i=this.tn.next(),o=!1;if("("===i&&(o=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal option name: "+i);r=i,o&&(this.tn.skip(")"),r="("+r+")",i=this.tn.peek(),t.FQTYPEREF.test(i)&&(r+=i,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,r),n||this.tn.skip(";")},s._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)i(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?i(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},s._parseService=function(e){var n,r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);for(n={name:r,rpc:{},options:{}},this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if("rpc"!==r)throw Error("illegal service token: "+r);this._parseServiceRPC(n)}this.tn.omit(";"),e.services.push(n)},s._parseServiceRPC=function(e){var n,r,i="rpc",o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal rpc service method name: "+o);if(n=o,r={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(r.request_stream=!0,o=this.tn.next()),!t.TYPEREF.test(o))throw Error("illegal rpc service request type: "+o);if(r.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()&&(r.response_stream=!0,o=this.tn.next()),r.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(r)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[i]&&(e[i]={}),e[i][n]=r},s._parseMessage=function(e,r){var i=!!r,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("="),r.id=n(this.tn.next()),s.isGroup=!0),"["===(o=this.tn.peek())&&r&&this._parseFieldOptions(r),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,r,i){var o,s,a;if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);if(o={rule:r,type:"",name:"",options:{},id:0},"map"===r){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=n(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=n(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},s._parseMessageOneOf=function(e){var n,r,i,o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal oneof name: "+o);for(r=o,i=[],this.tn.skip("{");"}"!==(o=this.tn.next());)(n=this._parseMessageField(e,"optional",o)).oneof=r,i.push(n.id);this.tn.omit(";"),e.oneofs[r]=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 r,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("="),r={name:o,id:n(this.tn.next(),!0)},"["===(o=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),i.values.push(r)}this.tn.omit(";"),e.enums.push(i)},s._parseExtensionRanges=function(){var t,n,i,o=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=r(t)}if(n.push(i),2===n.length)break;if("to"!==this.tn.peek()){n.push(i);break}this.tn.next()}o.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),o},s._parseExtend=function(e){var n,r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);for(n={ref:r,fields:[]},this.tn.skip("{");"}"!==(r=this.tn.next());)if(t.RULE.test(r))this._parseMessageField(n,r);else{if(!t.TYPEREF.test(r))throw Error("illegal extend token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(n,"optional",r)}return this.tn.omit(";"),e.messages.push(n),n},s.toString=function(){return"Parser at line "+this.tn.line},a.Parser=o,a}(o,o.Lang),o.Reflect=function(e){function n(t,n){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}function i(t,n){var r=n.readVarint32(),o=7&r,s=r>>>3;switch(o){case e.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(!(128&~r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:i(s,n);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:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+o)}return!0}var o,s,a,u,c,l,d,h,p,_,g,f,E,I,T,R,v={},C=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},y=C.prototype;return y.fqn=function(){for(var e=this.name,t=this;null!=(t=t.parent);)e=t.name+"."+e;return e},y.toString=function(e){return(e?this.className+" ":"")+this.fqn()},y.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},v.T=C,o=function(e,t,n,r,i){C.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},(s=o.prototype=Object.create(C.prototype)).getChildren=function(e){var t,n,r;if(null==(e=e||null))return this.children.slice();for(t=[],n=0,r=this.children.length;r>n;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},s.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof c.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof c.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},s.getChild=function(e){var t,n,r="number"==typeof e?"id":"name";for(t=0,n=this.children.length;n>t;++t)if(this.children[t][r]===e)return this.children[t];return null},s.resolve=function(e,t){var n,r="string"==typeof e?e.split("."):e,i=this,o=0;if(""===r[o]){for(;null!==i.parent;)i=i.parent;o++}do{do{if(!(i instanceof v.Namespace)){i=null;break}if(!((n=i.getChild(r[o]))&&n instanceof v.T&&(!t||n instanceof v.Namespace))){i=null;break}i=n,o++}while(o<r.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,n,r=[],i=e;do{r.unshift(i.name),i=i.parent}while(null!==i);for(t=1;t<=r.length;t++)if(n=r.slice(r.length-t),e===this.resolve(n,e instanceof v.Namespace))return n.join(".");return e.fqn()},s.build=function(){var e,t,n,r={},i=this.children;for(t=0,n=i.length;n>t;++t)(e=i[t])instanceof o&&(r[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt()}),r},s.buildOpt=function(){var e,t,n,r,i={},o=Object.keys(this.options);for(e=0,t=o.length;t>e;++e)n=o[e],r=this.options[o[e]],i[n]=r;return i},s.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},v.Namespace=o,a=function(t,n,r,i){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=i,r&&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 r(0):t.defaultValue},u.verifyValue=function(r){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 r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),r>4294967295?0|r:r;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),r<0?r>>>0:r;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return n(r,!1)}catch(e){a(typeof r,e.message)}else a(typeof r,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return n(r,!0)}catch(e){a(typeof r,e.message)}else a(typeof r,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof r&&a(typeof r,"not a boolean"),r;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof r&&a(typeof r,"not a number"),r;case e.TYPES.string:return"string"==typeof r||r&&r instanceof String||a(typeof r,"not a string"),""+r;case e.TYPES.bytes:return t.isByteBuffer(r)?r:t.wrap(r);case e.TYPES.enum:for(i=this.resolvedType.getChildren(e.Reflect.Enum.Value),s=0;s<i.length;s++){if(i[s].name==r)return i[s].id;if(i[s].id==r)return i[s].id}if("proto3"===this.syntax)return("number"!=typeof r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),(r>4294967295||r<0)&&a(typeof r,"not in range for uint32"),r;a(r,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(r&&"object"==typeof r||a(typeof r,"object expected"),r instanceof this.resolvedType.clazz)return r;if(r instanceof e.Builder.Message){for(s in o={},r)r.hasOwnProperty(s)&&(o[s]=r[s]);r=o}return new this.resolvedType.clazz(r)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+r+" (undefined type "+this.type+")")},u.calculateLength=function(t,n){if(null===n)return 0;var i;switch(this.type){case e.TYPES.int32:return n<0?r.calculateVarint64(n):r.calculateVarint32(n);case e.TYPES.uint32:return r.calculateVarint32(n);case e.TYPES.sint32:return r.calculateVarint32(r.zigZagEncode32(n));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return r.calculateVarint64(n);case e.TYPES.sint64:return r.calculateVarint64(r.zigZagEncode64(n));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return r.calculateVarint32(n);case e.TYPES.double:return 8;case e.TYPES.string:return i=r.calculateUTF8Bytes(n),r.calculateVarint32(i)+i;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");return r.calculateVarint32(n.remaining())+n.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(n),r.calculateVarint32(i)+i;case e.TYPES.group:return(i=this.resolvedType.calculate(n))+r.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")},u.encodeValue=function(t,n,i){var o,s;if(null===n)return i;switch(this.type){case e.TYPES.int32:n<0?i.writeVarint64(n):i.writeVarint32(n);break;case e.TYPES.uint32:i.writeVarint32(n);break;case e.TYPES.sint32:i.writeVarint32ZigZag(n);break;case e.TYPES.fixed32:i.writeUint32(n);break;case e.TYPES.sfixed32:i.writeInt32(n);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(n);break;case e.TYPES.sint64:i.writeVarint64ZigZag(n);break;case e.TYPES.fixed64:i.writeUint64(n);break;case e.TYPES.sfixed64:i.writeInt64(n);break;case e.TYPES.bool:"string"==typeof n?i.writeVarint32("false"===n.toLowerCase()?0:!!n):i.writeVarint32(n?1:0);break;case e.TYPES.enum:i.writeVarint32(n);break;case e.TYPES.float:i.writeFloat32(n);break;case e.TYPES.double:i.writeFloat64(n);break;case e.TYPES.string:i.writeVString(n);break;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");o=n.offset,i.writeVarint32(n.remaining()),i.append(n),n.offset=o;break;case e.TYPES.message:s=(new r).LE(),this.resolvedType.encode(n,s),i.writeVarint32(s.offset),i.append(s.flip());break;case e.TYPES.group:this.resolvedType.encode(n,i),i.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")}return i},u.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},u.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return r.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()},v.Element=a,c=function(e,t,n,r,i,s){o.call(this,e,t,n,r,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},(l=c.prototype=Object.create(o.prototype)).build=function(n){var i,o,s,a;if(this.clazz&&!n)return this.clazz;for(i=function(e,n){function i(t,n,o,s){var a,u,c,l,d,h,p;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(r.isByteBuffer(t))return n?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,n,o,s)})),u;if(u={},t instanceof e.Map){for(l=(c=t.entries()).next();!l.done;l=c.next())u[t.keyElem.valueToString(l.value[0])]=i(l.value[1],n,o,t.valueElem.resolvedType);return u}for(p in d=t.$type,h=void 0,t)t.hasOwnProperty(p)&&(u[p]=d&&(h=d.getChild(p))?i(t[p],n,o,h.resolvedType):i(t[p],n,o));return u}var o,s,a=n.getChildren(e.Reflect.Message.Field),u=n.getChildren(e.Reflect.Message.OneOf),c=function(t){var i,o,s,l;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"!==n.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 c)||Array.isArray(t)||t instanceof e.Map||r.isByteBuffer(t)||t instanceof ArrayBuffer||e.Long&&t instanceof e.Long)for(i=0,o=arguments.length;o>i;++i)void 0!==(l=arguments[i])&&this.$set(a[i].name,l);else this.$set(t)},l=c.prototype=Object.create(e.Builder.Message.prototype);for(l.add=function(t,r,i){var o=n._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");r=o.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},l.$add=l.add,l.set=function(t,r,i){var o,s,a;if(t&&"object"==typeof t){for(o in i=r,t)t.hasOwnProperty(o)&&void 0!==(r=t[o])&&this.$set(o,r,i);return this}if(s=n._fieldsByName[t],i)this[t]=r;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]=r=s.verifyValue(r)}return s&&s.oneof&&(a=this[s.oneof.name],null!==r?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===t&&(this[s.oneof.name]=null)),this},l.$set=l.set,l.get=function(t,r){if(r)return this[t];var i=n._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]},l.$get=l.get,o=0;o<a.length;o++)(s=a[o])instanceof e.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(e){var t,r,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})),r=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},i=function(){return this[e.name]},null===n.getChild("set"+o)&&(l["set"+o]=r),null===n.getChild("set_"+t)&&(l["set_"+t]=r),null===n.getChild("get"+o)&&(l["get"+o]=i),null===n.getChild("get_"+t)&&(l["get_"+t]=i)}(s);return l.encode=function(e,r){var i,o;"boolean"==typeof e&&(r=e,e=void 0),i=!1,e||(e=new t,i=!0),o=e.littleEndian;try{return n.encode(this,e.LE(),r),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},c.encode=function(e,t,n){return new c(e).encode(t,n)},l.calculate=function(){return n.calculate(this)},l.encodeDelimited=function(e){var t,i=!1;return e||(e=new r,i=!0),t=(new r).LE(),n.encode(this,t).flip(),e.writeVarint32(t.remaining()),e.append(t),i?e.flip():e},l.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},l.toArrayBuffer=l.encodeAB,l.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},l.toBuffer=l.encodeNB,l.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},l.toBase64=l.encode64,l.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},l.toHex=l.encodeHex,l.toRaw=function(e,t){return i(this,!!e,!!t,this.$type)},l.encodeJSON=function(){return JSON.stringify(i(this,!0,!0,this.$type))},c.decode=function(e,t){var i,o;"string"==typeof e&&(e=r.wrap(e,t||"base64")),i=(e=r.isByteBuffer(e)?e:r.wrap(e)).littleEndian;try{return o=n.decode(e.LE()),e.LE(i),o}catch(t){throw e.LE(i),t}},c.decodeDelimited=function(e,t){var i,o,s;if("string"==typeof e&&(e=r.wrap(e,t||"base64")),(e=r.isByteBuffer(e)?e:r.wrap(e)).remaining()<1)return null;if(i=e.offset,o=e.readVarint32(),e.remaining()<o)return e.offset=i,null;try{return s=n.decode(e.slice(e.offset,e.offset+o).LE()),e.offset+=o,s}catch(t){throw e.offset+=o,t}},c.decode64=function(e){return c.decode(e,"base64")},c.decodeHex=function(e){return c.decode(e,"hex")},c.decodeJSON=function(e){return new c(JSON.parse(e))},l.toString=function(){return n.toString()},Object.defineProperty&&(Object.defineProperty(c,"$options",{value:n.buildOpt()}),Object.defineProperty(l,"$options",{value:c.$options}),Object.defineProperty(c,"$type",{value:n}),Object.defineProperty(l,"$type",{value:n})),c}(e,this),this._fields=[],this._fieldsById={},this._fieldsByName={},s=0,a=this.children.length;a>s;s++)if((o=this.children[s])instanceof g||o instanceof c||o instanceof I){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 c.Field)o.build(),this._fields.push(o),this._fieldsById[o.id]=o,this._fieldsByName[o.name]=o;else if(!(o instanceof c.OneOf||o instanceof E))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[s].toString(!0));return this.clazz=i},l.encode=function(e,t,n){var r,i,o,s,a,u=null;for(o=0,s=this._fields.length;s>o;++o)i=e[(r=this._fields[o]).name],r.required&&null===i?null===u&&(u=r):r.encode(n?i:r.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},l.calculate=function(e){for(var t,n,r=0,i=0,o=this._fields.length;o>i;++i){if(n=e[(t=this._fields[i]).name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},l.decode=function(t,n,r){var o,s,a,u,c,l,d,h,p,_,g,f;for(n="number"==typeof n?n:-1,c=t.offset,l=new this.clazz;t.offset<c+n||-1===n&&t.remaining()>0;){if(a=(o=t.readVarint32())>>>3,(s=7&o)===e.WIRE_TYPES.ENDGROUP){if(a!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[a])u.repeated&&!u.options.packed?l[u.name].push(u.decode(s,t)):u.map?(h=u.decode(s,t),l[u.name].set(h[0],h[1])):(l[u.name]=u.decode(s,t),u.oneof&&(null!==(p=l[u.oneof.name])&&p!==u.name&&(l[p]=null),l[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,g=this._fields.length;g>_;++_)if(null===l[(u=this._fields[_]).name])if("proto3"===this.syntax)l[u.name]=u.defaultValue;else{if(u.required)throw(f=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name)).decoded=l,f;e.populateDefaults&&null!==u.defaultValue&&(l[u.name]=u.defaultValue)}return l},v.Message=c,d=function(t,n,r,i,o,s,a,u,l,d){C.call(this,t,n,s),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=a,this.options=u||{},this.defaultValue=null,this.oneof=l||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof c.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},(h=d.prototype=Object.create(C.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)},h.verifyValue=function(t,n){var r,i,o;if(n=n||!1,r=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&&r(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&r(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!n){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&&!n?t instanceof e.Map?t:(t instanceof Object||r(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&r(typeof t,"no array expected"),this.element.verifyValue(t))},h.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},h.encode=function(t,n,i){var o,s,a,u,c;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 n;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.ensureCapacity(n.offset+=1),s=n.offset,o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],n);a=n.offset-s,(u=r.calculateVarint32(a))>1&&(c=n.slice(s,n.offset),s+=u-1,n.offset=s,n.append(c)),n.writeVarint32(a,s-u)}else for(o=0;o<t.length;o++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[o],n);else this.map?t.forEach((function(t,i){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.writeVarint32(o),n.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,n),n.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,n)}),this):this.hasWirePresence(t,i)&&(n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,n))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return n},h.calculate=function(t,n){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+=r.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+=r.calculateVarint32(s),i+=s}else for(o=0;o<t.length;o++)i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[o]);else this.map?t.forEach((function(t,n){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,n)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=r.calculateVarint32(o),i+=o}),this):this.hasWirePresence(t,n)&&(i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},h.decode=function(t,n,r){var i,o,s,u,c,l,d;if(!(!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){for(o=n.readVarint32(),o=n.offset+o,s=[];n.offset<o;)s.push(this.decode(this.type.wireType,n,!0));return s}if(this.map){if(u=a.defaultFieldValue(this.keyType),i=a.defaultFieldValue(this.type),o=n.readVarint32(),n.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+n.remaining());for((c=n.clone()).limit=c.offset+o,n.offset+=o;c.remaining()>0;)if(t=7&(l=c.readVarint32()),1===(d=l>>>3))u=this.keyElement.decode(c,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(c,t,d)}return[u,i]}return this.element.decode(n,t,this.id)},v.Message.Field=d,p=function(e,t,n,r,i,o,s){d.call(this,e,t,n,null,r,i,o,s),this.extension},p.prototype=Object.create(d.prototype),v.Message.ExtensionField=p,_=function(e,t,n){C.call(this,e,t,n),this.fields=[]},v.Message.OneOf=_,g=function(e,t,n,r,i){o.call(this,e,t,n,r,i),this.className="Enum",this.object=null},g.getName=function(e,t){var n,r,i=Object.keys(e);for(r=0;r<i.length;++r)if(e[n=i[r]]===t)return n;return null},(g.prototype=Object.create(o.prototype)).build=function(t){var n,r,i,o;if(this.object&&!t)return this.object;for(n=new e.Builder.Enum,i=0,o=(r=this.getChildren(g.Value)).length;o>i;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},v.Enum=g,f=function(e,t,n,r){C.call(this,e,t,n),this.className="Enum.Value",this.id=r},f.prototype=Object.create(C.prototype),v.Enum.Value=f,E=function(e,t,n,r){C.call(this,e,t,n),this.field=r},E.prototype=Object.create(C.prototype),v.Extension=E,I=function(e,t,n,r){o.call(this,e,t,n,r),this.className="Service",this.clazz=null},(I.prototype=Object.create(o.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){var n,i=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},o=i.prototype=Object.create(e.Builder.Service.prototype),s=t.getChildren(e.Reflect.Service.RPCMethod);for(n=0;n<s.length;n++)!function(e){o[e.name]=function(n,i){try{try{n=e.resolvedRequestType.clazz.decode(r.wrap(n))}catch(e){if(!(e instanceof TypeError))throw e}if(null===n||"object"!=typeof n)throw Error("Illegal arguments");n instanceof e.resolvedRequestType.clazz||(n=new e.resolvedRequestType.clazz(n)),this.rpcImpl(e.fqn(),n,(function(n,r){if(!n){try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}return r&&r instanceof e.resolvedResponseType.clazz?void i(null,r):void i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}i(n)}))}catch(e){setTimeout(i.bind(this,e),0)}},i[e.name]=function(t,n,r){new i(t)[e.name](n,r)},Object.defineProperty&&(Object.defineProperty(i[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(o[e.name],"$options",{value:i[e.name].$options}))}(s[n]);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)},v.Service=I,T=function(e,t,n,r){C.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},(T.prototype=Object.create(C.prototype)).buildOpt=s.buildOpt,v.Service.Method=T,R=function(e,t,n,r,i,o,s,a){T.call(this,e,t,n,a),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null},R.prototype=Object.create(T.prototype),v.Service.RPCMethod=R,v}(o),o.Builder=function(e,t,n){function r(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,r(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}var i=function(e){this.ns=new n.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},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 n.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},o.create=function(t){var r,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(r=[t];r.length>0;){if(t=r.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 n.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 n.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 n.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){r.push(t),t=u,u=null,this.ptr=s,s=null;continue}u=null}else if(i.isEnum(o))s=new n.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){s.addChild(new n.Enum.Value(this,s,e.name,e.id))}),this),this.ptr.addChild(s);else if(i.isService(o))s=new n.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];s.addChild(new n.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 r,i,o,a;if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions&&(r=!1,s.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(r=!0)})),!r))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 n.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new n.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,n){var i,o,s,a,u,c,l,d,h="/";if("string"==typeof n){if(e.Util.IS_NODE,!0===this.files[n])return this.reset();this.files[n]=!0}else if("object"==typeof n){if(i=n.root,e.Util.IS_NODE,(i.indexOf("\\")>=0||n.file.indexOf("\\")>=0)&&(h="\\"),o=i+h+n.file,!0===this.files[o])return this.reset();this.files[o]=!0}if(t.imports&&t.imports.length>0){for(a=!1,"object"==typeof n?(this.importRoot=n.root,a=!0,s=this.importRoot,n=n.file,(s.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(h="\\")):"string"==typeof n?this.importRoot?s=this.importRoot:n.indexOf("/")>=0?""===(s=n.replace(/\/[^\/]*$/,""))&&(s="/"):n.indexOf("\\")>=0?(s=n.replace(/\\[^\\]*$/,""),h="\\"):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"===(c=t.imports[u]))continue;if(c=s+h+c,!0===this.files[c])continue;if(/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json")),null===(l=e.Util.fetch(c)))throw Error("failed to import '"+c+"' in '"+n+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(l+""),c):this.import(e.DotProto.Parser.parse(l),c)}else n?/\.(\w+)$/.test(n)?this.import(t.imports[u],n.replace(/^(.+)\.(\w+)$/,(function(e,t,n){return t+"_import"+u+"."+n}))):this.import(t.imports[u],n+"_import"+u):this.import(t.imports[u]);a&&(this.importRoot=null)}return t.package&&this.define(t.package),t.syntax&&r(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 r;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof n.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof n.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(r=(this.ptr instanceof n.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=r,r instanceof n.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==r.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(r instanceof n.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=r.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((r=this.ptr.parent.resolve(this.ptr.requestName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=r,!((r=this.ptr.parent.resolve(this.ptr.responseName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=r}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},o.build=function(e){var t,n,r;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,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},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 n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){var r,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}}),n)for(r=Object.keys(n),i=0;i<r.length;i++)o=this.keyElem.valueFromString(r[i]),s=this.valueElem.verifyValue(n[r[i]]),this.map[this.keyElem.valueToString(o)]={key:o,value:s}},i=r.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},i.entries=function(){var e,t,r=[],i=Object.keys(this.map);for(t=0;t<i.length;t++)r.push([(e=this.map[i[t]]).key,e.value]);return n(r)},i.keys=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].key);return n(t)},i.values=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].value);return n(t)},i.forEach=function(e,t){var n,r,i=Object.keys(this.map);for(r=0;r<i.length;r++)e.call(t,(n=this.map[i[r]]).value,n.key,this)},i.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},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},r}(0,o.Reflect),o.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),o.loadJson(o.DotProto.Parser.parse(e),t,n)},o.protoFromString=o.loadProto,o.loadProtoFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,o.loadProto(r,n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:o.loadProto(r,n,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,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"==typeof t||(t=o.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},o.loadJsonFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,o.loadJson(JSON.parse(r),n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:o.loadJson(JSON.parse(r),n,e)},i=e,o.loadProto(i,void 0,"").build("Modules").probuf}(n,t);return r}var ci,li,di=function(){function e(e,t,n){this.pbmaps=e,this.logger=n,this.pbModules=ui(t)}return e.prototype.getModule=function(e){return new this.pbModules[e]},e.prototype.encode=function(e,t,n){var r=new this.pbModules[e];if(t)try{this.pbmaps[e].forEach((function(e){var n=t[e];void 0!==n&&r["set"+function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e.replace(r,(function(e){return e.toUpperCase()}))}(e,0,1)](n)}))}catch(t){var i="pbname: "+e+", stack: "+t.stack;this.logger?this.logger.error(Re.L_PB_ENCODE_E,i):null===console||void 0===console||console.error(Re.L_PB_ENCODE_E,i)}return n?r:r.toArrayBuffer()},e.prototype.decode=function(e,t){var n=this.pbModules[e].decode(t);return this.fixInt64Values(n)},e.prototype.fixInt64Values=function(e){var t=this;if(e instanceof Array)return e.map((function(e){return t.fixInt64Values(e)}));if(!Jt(e))return e;if(void 0!==e.low&&void 0!==e.high&&Object.prototype.hasOwnProperty.call(e,"unsigned")){var n=e.low;return n<0&&(n+=4294967296),n=n.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{"+n.length+"}$"),n),16)}for(var r in e)e[r]=this.fixInt64Values(e[r]);return e},e}();!function(e){e[e.BJ=1]="BJ",e[e.SG=2]="SG",e[e.NA=3]="NA",e[e.SG_A=4]="SG_A",e[e.SG_B=4]="SG_B",e[e.SA=5]="SA"}(li||(li={}));var hi=((ci={})[li.BJ]={naviUrlBase64:["bmF2LnJvbmctZWRnZS5jb20=","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5yb25nLWVkZ2UuY29t",protocol:Be.HTTPS,weight:-1}],miniCmpBase64:["d3Mucm9uZy1lZGdlLmNvbQ==","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnJvbmctZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="]},ci[li.SG]={naviUrlBase64:["bmF2LnNnLWxpZ2h0LWVkZ2UuY29t","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1saWdodC1lZGdlLmNvbQ==",protocol:Be.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2ctbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNnLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="]},ci[li.NA]={naviUrlBase64:["bmF2LnVzLWxpZ2h0LWVkZ2UuY29t","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi51cy1saWdodC1lZGdlLmNvbQ==",protocol:Be.HTTPS,weight:-1}],miniCmpBase64:["d3MudXMtbGlnaHQtZWRnZS5jb20=","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnVzLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="]},ci[li.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:Be.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2ctYi1saWdodC1lZGdlLmNvbQ==","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNnLWItbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="]},ci[li.SA]={naviUrlBase64:["bmF2LnNhdS1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zYXUtbGlnaHQtZWRnZS5jb20=",protocol:Be.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2F1LWxpZ2h0LWVkZ2UuY29t","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNhdS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"]},ci);function pi(e){return li[e]?e:li.BJ}var _i,gi,fi,Ei,Ii,Ti,Ri,vi=function(){function e(){this.initOption={}}return e.prototype.init=function(e){this.initOption=e},e.prototype.getNaviUrlList=function(e,t){var n,r=this.initOption||{},i=r.areaCode,o=r.navigators,s=(n=i,void 0===n&&(n=li.BJ),hi[pi(n)].naviUrlBase64).map((function(e){return Qn(e)})),a=[],u=e.split("@")[1];t&&(a=u?u.split(";"):[]);var l=o&&o.length>0?c(c([],a,!0),o,!0):c(c([],a,!0),s,!0);return l.filter((function(e,t){return l.indexOf(e)===t})).map((function(e){return or(e)}))},e.prototype.getLogUrlPolicyList=function(e,t){var n,r=e||{},i=r.log,s=r.logPolicy,a=this.initOption||{},u=a.areaCode,l=a.logServerUrl,d=(n=u,void 0===n&&(n=li.BJ),hi[pi(n)].logUrlBase64).map((function(e){return o(o({},e),{addr:Qn(e.addr)})})),h=[],p={level:1,itv:6,times:5};if(i)h.push.apply(h,i.addrs),Object.assign(p,i.policy);else if(s)try{var _=JSON.parse(s);h.push({addr:_.url,protocol:Be.HTTPS,weight:1}),p.level=_.level,p.itv=_.itv,p.times=_.times}catch(n){t.warn(Re.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var g=l?c([{addr:l,protocol:Be.HTTPS,weight:101}],h,!0):c(c([],h,!0),d,!0);return{policy:p,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 o(o({},e),{addr:or(e.addr,e.protocol)})})).sort((function(e,t){return t.weight-e.weight}))}},e.prototype.getMiniCmpUrlList=function(){var e,t,n=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=li.BJ),hi[pi(t)].miniCmpBase64).map((function(e){return Qn(e)})),r=(this.initOption||{}).miniCMPProxy;return r&&r.length>0?r:n},e.prototype.getStaticConfigUrl=function(){var e,t;return(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=li.BJ),hi[pi(t)].staticConfigUrlBase64).map((function(e){return Qn(e)}))},e.prototype.getCloudControllerUrl=function(e){var t,n,r=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(n=r,void 0===n&&(n=li.BJ),hi[pi(n)].cloudControllerUrlBase64).map((function(e){return Qn(e)}))},e.prototype.getAreaCode=function(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:li.BJ},e.prototype.setAreaCode=function(e){return!(!e||!li[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)},e}(),Ci=new vi,yi=function(){function e(e,t){this.appkey=e,this.logger=t,this.staticUrls=[]}return e.prototype.getStaticConfig=function(){var e;return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:if(!(t=this.getCache()))return[3,6];u.label=1;case 1:return u.trys.push([1,4,,5]),n=JSON.parse(t),Date.now()-(null==n?void 0:n.time)<j?[4,this.decryptData(n.val)]:[3,3];case 2:return r=u.sent(),(i=r.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return or(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=u.sent(),this.logger.error(Re.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),u.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=u.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(a=u.sent())?void 0:a.areaCode)!==Ci.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==a?void 0:a.bootstrap)||[],(c=null===(e=null==a?void 0:a.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:c.map((function(e){return or(e.addr,e.protocol)}))||[]}])}}))}))},e.prototype._requestHandle=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:e=(e=c(c([],this.staticUrls,!0),Ci.getStaticConfigUrl(),!0).map((function(e){return or(e)}))).filter((function(t,n){return e.indexOf(t)===n})),t=0,n=e,u.label=1;case 1:return t<n.length?(r=n[t],this.logger.info(Re.L_GET_STATIC_CONF_T,JSON.stringify({url:r})),i=Date.now(),[4,this.sendRequest(r+"/"+this.appkey)]):[3,4];case 2:if(o=u.sent(),s=o.code,a=o.data,200===s)return this.logger.info(Re.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:s,duration:Date.now()-i})),[2,a];this.logger.warn(Re.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:s,duration:Date.now()-i})),u.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},e}(),Si={"set.proxy":re.INVALID_PARAMETER_PROXY,"test.proxy":re.INVALID_PARAMETER_TESTHOST,"test.proxy.socksHost":re.INVALID_PARAMETER_TESTHOST,"test.proxy.socksPort":re.INVALID_PARAMETER_TESTHOST,channelId:re.INVALID_PARAMETER_CHANNEL_ID,count:re.INVALID_PARAMETER_COUNT,startTime:re.INVALID_PARAMETER_START_TIME,endTime:re.INVALID_PARAMETER_END_TIME,offset:re.INVALID_PARAMETER_OFFSET,limit:re.INVALID_PARAMETER_LIMIT,keyword:re.INVALID_PARAMETER_KEYWORD,messageTypes:re.INVALID_PARAMETER_MESSAGE_TYPE,messageType:re.INVALID_PARAMETER_MESSAGE_TYPE,typingContentType:re.INVALID_PARAMETER_MESSAGE_TYPE,conversation:re.INVALID_PARAMETER_CONVERSATION,conversationType:re.INVALID_PARAMETER_CONVERSATION_TYPE,targetId:re.INVALID_PARAMETER_TARGET_ID,targetIds:re.INVALID_PARAMETER_TARGET_ID,userId:re.INVALID_PARAMETER_USER_ID,senderUserId:re.INVALID_PARAMETER_USER_ID,timestamp:re.INVALID_PARAMETER_TIMESTAMP,order:re.INVALID_PARAMETER_ORDER,messageId:re.INVALID_PARAMETER_MESSAGE_ID,receivedStatus:re.INVALID_PARAMETER_RECEIVED_STATUS,receivedStatusInfo:re.INVALID_PARAMETER_RECEIVED_STATUS,sentStatus:re.INVALID_PARAMETER_SENT_STATUS,content:re.INVALID_PARAMETER_MESSAGE_CONTENT,messageIds:re.INVALID_PARAMETER_MESSAGE_ARRAY,cleanSpace:re.INVALID_PARAMETER_CLEAN_SPACE,messageDirection:re.INVALID_MESSAGE_DIRECTION,canIncludeExpansion:re.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION,expansion:re.INVALID_PARAMETER_MESSAGE_EXPANSION,disableNotification:re.INVALID_PARAMETER_DISABLE_NOTIFICATION,messages:re.MSG_LIMIT_ERROR,checkDuplicate:re.INVALID_PARAMETER_CHECK_DUPLICATE,messageUId:re.INVALID_PARAMETER_MESSAGE_UID,key:re.INVALID_PARAMETER_KEY,keys:re.INVALID_PARAMETER_KEYS,value:re.INVALID_PARAMETER_VALUE,isAutoDelete:re.INVALID_PARAMETER_IS_AUTO_DELETE,isSendNotification:re.INVALID_PARAMETER_IS_SEND_NOTIFICATION,notificationExtra:re.INVALID_PARAMETER_NOTIFICATION_EXTRA,entries:re.INVALID_PARAMETER_ENTRIES,isForce:re.INVALID_PARAMETER_IS_FORCE,rtcRoomId:re.INVALID_PARAMETER_RTCROOMID,token:re.RC_CONN_TOKEN_INCORRECT,conversations:re.INVALID_PARAMETER_CONVERSATIONS,draft:re.INVALID_PARAMETER_DRAFT,conversationTypes:re.INVALID_PARAMETER_CONVERSATION_TYPE_LIST,levels:re.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevel:re.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevels:re.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationStatus:re.INVALID_PARAMETER_NOTIFICATION_LEVEL,isTop:re.INVALID_PARAMETER_IS_TOP,isUpdateTime:re.INVALID_PARAMETER_IS_UPDATE_TIME,message:re.INVALID_PARAMETER_MESSAGE,mentionedUserIdList:re.INVALID_PARAMETER_USERIDLIST,directionalUserIdList:re.INVALID_PARAMETER_USERIDLIST,directedUserIds:re.INVALID_PARAMETER_USERIDLIST,isStatusMessage:re.INVALID_PARAMETER_IS_STATUS_MESSAGE,pushContent:re.INVALID_PARAMETER_PUSH_CONTENT,pushData:re.INVALID_PARAMETER_PUSH_DATA,isMentioned:re.INVALID_PARAMETER_IS_MENTIONED,mentionedType:re.INVALID_PARAMETER_MENTIONED_TYPE,isVoipPush:re.INVALID_PARAMETER_IS_VOIP_PUSH,pushConfig:re.INVALID_PARAMETER_PUSH_CONFIG,startMsgUId:re.INVALID_PARAMETER_START_MESSAGE_UID,endMsgUId:re.INVALID_PARAMETER_END_MESSAGE_UID,sentTime:re.INVALID_PARAMETER_TIMESTAMP,clearMessageOption:re.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,searchContent:re.SEARCH_PROPS_LIMIT_ERROR,tagId:re.INVALID_PARAMETER_TAG_ID,tagIds:re.INVALID_PARAMETER_TAG_ID,tagName:re.INVALID_PARAMETER_TAG_NAME,containMuted:re.INVALID_PARAMETER_CONTAIN_MUTED,channelType:re.INVALID_PARAMETER_CHANNEL_TYPE,file:re.MEDIA_EXCEPTION,fileType:re.INVALID_PARAMETER_MEDIA_TYPE,contentDisposition:re.INVALID_PARAMETER_CONTENT_DISPOSITION,mediaUrl:re.INVALID_PARAMETER_MEDIA_URL,filename:re.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME,saveName:re.INVALID_PARAMETER_SAVE_NAME,serverType:re.INVALID_PARAMETER_SERVER_TYPE,subscribeType:re.INVALID_PARAMETER_SUBSCRIBE_TYPE,expiry:re.INVALID_PARAMETER_SUBSCRIBE_EXPIRY,subscribeUserIds:re.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS,subscribePageSize:re.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE,beforeCount:re.INVALID_PARAMETER_BEFORE,afterCount:re.INVALID_PARAMETER_AFTER,conversationList:re.INVALID_PARAMETER_CONVERSATION_LIST,conversationTypeNotSupport:re.CONVERSATION_TYPE_NOT_SUPPORT,profile:re.INVALID_PARAMETER_USER_PROFILE,userProfileVisibility:re.INVALID_PARAMETER_USER_PROFILE_VISIBILITY,uniqueId:re.INVALID_PARAMETER_UNIQUE_ID,extra:re.INVALID_PARAMETER_EXTRA,disableUpdateLastMessage:re.INVALID_DISABLE_UPDATE_LAST_MESSAGE},mi=function(){function e(e){this._context=e}return e.prototype.__getContext=function(){return this._context},e.prototype.createCodec=function(e,t){return this._context.createCodec(e,t)},e.prototype.refetchNaviInfo=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))},e.prototype.getNaviInfo=function(){return this._context.getNaviInfoFromCache()},e.prototype.getCoreVersion=function(){return"5.12.2"},e.prototype.getAPIVersion=function(){return"5.12.2"},e.prototype.getAppkey=function(){return this._context.appkey},e.prototype.getCurrentId=function(){return this._context.getCurrentUserId()},e.prototype.getConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.sendMessage=function(e,t,n){return this._context.sendMessage(e,t,n)},e.prototype.registerMessageType=function(e,t,n,r){void 0===r&&(r=[]),this._context.registerMessageType(e,t,n,r)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getOSInfo=function(){return this._context.getOSInfo()},e.prototype.getProcessInfo=function(){return this._context.getProcessInfo()},e.prototype.getMainProcessInfo=function(){return this._context.getMainProcessInfo()},e.prototype.setCallInfo=function(e,t,n){return this._context.setCallInfo(e,t,n)},e.prototype.createLogger=function(e,t){return this._context.createLogger(e,t)},e.prototype.createStatisticLogger=function(e,t){return this._context.createStatisticLogger(e,t)},e}(),Ai="pgMsgP",Ni="chatMsg",Oi="pcMsgP",Mi="pbMsgP",Ui={PRIVATE:"ppMsgS",GROUP:"pgMsgS",CHATROOM:"chatMsgS"},Li="delMsg",Pi="delUgMsg",bi="joinChrm",Di="joinChrmR",wi="exitChrm",Vi="setKV",Gi="delKV",Bi="setKVS",Fi="delKVS",ki="qryRelationR",xi="delRelation",Hi="delRelationBatch",Yi="setSeAtt",Ki={PRIVATE:"cleanPMsg",GROUP:"cleanGMsg",ULTRA_GROUP:"cleanGMsg",CUSTOMER_SERVICE:"cleanCMsg",SYSTEM:"cleanSMsg",APP_PUBLIC_SERVICE:"cleanMCMsg",PUBLIC_SERVICE:"cleanMPMsg"},qi="cleanMsgBatch",ji="reqCall",Qi="pullKvMsg",Wi="qryPMsg",Ji="qryGMsg",Xi="qryCHMsg",Zi="qryCMsg",zi="qrySMsg",$i="qryMCMsg",eo="qryMPMsg",to=((_i={})["ppMsgP"]=oe.PRIVATE,_i[Ai]=oe.GROUP,_i[Ni]=oe.CHATROOM,_i[Oi]=oe.CUSTOMER_SERVICE,_i[Mi]=oe.SYSTEM,_i),no=((gi={})[oe.PRIVATE]=Wi,gi[oe.GROUP]=Ji,gi[oe.CHATROOM]=Xi,gi[oe.CUSTOMER_SERVICE]=Zi,gi[oe.SYSTEM]=zi,gi[oe.APP_PUBLIC_SERVICE]=$i,gi[oe.PUBLIC_SERVICE]=eo,gi),ro=((fi={})[oe.PRIVATE]=Ki.PRIVATE,fi[oe.GROUP]=Ki.GROUP,fi[oe.ULTRA_GROUP]=Ki.ULTRA_GROUP,fi[oe.CUSTOMER_SERVICE]=Ki.CUSTOMER_SERVICE,fi[oe.SYSTEM]=Ki.SYSTEM,fi[oe.APP_PUBLIC_SERVICE]=Ki.APP_PUBLIC_SERVICE,fi[oe.PUBLIC_SERVICE]=Ki.PUBLIC_SERVICE,fi),io="1",oo="0",so=1,ao=2,uo=3;!function(e){e[e.AT_MOST_ONCE=0]="AT_MOST_ONCE",e[e.AT_LEAST_ONCE=1]="AT_LEAST_ONCE",e[e.EXACTLY_ONCE=2]="EXACTLY_ONCE",e[e.DEFAULT=3]="DEFAULT"}(Ei||(Ei={})),function(e){e[e.SYMMETRIC=0]="SYMMETRIC",e[e.CONNECT=1]="CONNECT",e[e.CONN_ACK=2]="CONN_ACK",e[e.PUBLISH=3]="PUBLISH",e[e.PUB_ACK=4]="PUB_ACK",e[e.QUERY=5]="QUERY",e[e.QUERY_ACK=6]="QUERY_ACK",e[e.QUERY_CONFIRM=7]="QUERY_CONFIRM",e[e.SUBSCRIBE=8]="SUBSCRIBE",e[e.SUB_ACK=9]="SUB_ACK",e[e.UNSUBSCRIBE=10]="UNSUBSCRIBE",e[e.UNSUB_ACK=11]="UNSUB_ACK",e[e.PING_REQ=12]="PING_REQ",e[e.PING_RESP=13]="PING_RESP",e[e.DISCONNECT=14]="DISCONNECT",e[e.RESERVER2=15]="RESERVER2"}(Ii||(Ii={})),function(e){e.PUB="pub",e.QUERY="qry"}(Ti||(Ti={})),function(e){e[e.V4=4]="V4",e[e.V3=3]="V3"}(Ri||(Ri={}));var co,lo=function(){function e(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=Ei.AT_LEAST_ONCE),void 0===r&&(r=!1),this._retain=!1,this.qos=Ei.AT_LEAST_ONCE,this._dup=!1,this.syncMsg=!1,e&&e>0&&1===arguments.length?(this._retain=(1&e)>0,this.qos=(6&e)>>1,this._dup=(8&e)>0,this.type=e>>4&15,this.syncMsg=!(8&~e)):(this.type=e,this._retain=t,this.qos=n,this._dup=r)}return e.prototype.encode=function(){var e=this.type<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this._dup?8:0},e}(),ho=function(){function e(){}return e.writeUTF=function(e,t){for(var n=this._getBackAndByteSize(e),r=n.back,i=n.byteSize,o=0,s=r.length;o<s;o++)r[o]>255&&(r[o]&=255);return t?r:i<=255?[0,i].concat(r):[i>>8,255&i].concat(r)},e._getBackAndByteSize=function(e){var t=[],n=0;if(Ft(e))for(var r=0,i=e.length;r<i;r++){var o=e.charCodeAt(r);o>=0&&o<=127?(n+=1,t.push(o)):o>=128&&o<=2047?(n+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(n+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:n,back:t}},e.readUTF=function(e){for(var t,n,r=[],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: "+a);a<=65535?r.push(a):(t=(a-=65536)>>10|55296,n=a%1024|56320,r.push(t,n)),(i+1===o.length||r.length>16384)&&(s+=String.fromCharCode.apply(null,r),r.length=0)}return s},e}(),po=function(){function e(e){this._position=0,this._poolLen=0,this._pool=e,this._poolLen=e.length}return e.prototype.check=function(){return this._position>=this._pool.length},e.prototype.read2Byte=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<2;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0"+r),t+=r.toString()}return parseInt(t,16)},e.prototype.readInt=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<4;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0"+r),t+=r.toString()}return parseInt(t,16)},e.prototype.readLong=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<8;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0"+r),t+=r}return parseInt(t,16)},e.prototype.readByte=function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e},e.prototype.readUTF=function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var n=this._pool.subarray(t,this._position);return ho.readUTF(n)},e.prototype.readAll=function(){return this._pool.subarray(this._position,this._poolLen)},e}(),_o=function(){function e(){this._pool=[],this._position=0,this._writen=0}return e.prototype.write=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")?this._pool=this._pool.concat(e):e>=0&&(e>255&&(e&=255),this._pool.push(e),this._writen++),e},e.prototype.writeArr=function(e){return this._pool=this._pool.concat(e),e},e.prototype.writeUTF=function(e){var t=ho.writeUTF(e);this._pool=this._pool.concat(t),this._writen+=t.length},e.prototype.getBytesArray=function(){return this._pool},e}(),go=function(e,t){return e&&t?t+"_"+e:e||Date.now()},fo=function(){function e(e){this.header=e,this.messageId=0,this.timestamp=0,this.syncMsg=!1,this.identifier=""}return e.prototype.getIdentifier=function(){var e=this.messageId,t=this.identifier;return go(e,t)},e.prototype.read=function(e,t,n,r){this.readMessage(e,t,n,r)},e.prototype.readMessage=function(e,t,n,r){return{stream:t,length:n}},e}(),Eo=function(){function e(e){this.lengthSize=0,this.messageId=0,this.topic="",this.targetId="",this.identifier="",this._header=new lo(e,!1,Ei.AT_MOST_ONCE,!1)}return e.prototype.getIdentifier=function(){var e=this.messageId,t=this.identifier;return go(e,t)},e.prototype.write=function(e){var t=this.getHeaderFlag();e.write(t),this.writeMessage(e)},e.prototype.setHeaderQos=function(e){this._header.qos=e},e.prototype.getHeaderFlag=function(){return this._header.encode()},e.prototype.getLengthSize=function(){return this.lengthSize},e.prototype.getBufferData=function(){var e=new _o;this.write(e);var t=e.getBytesArray();return new Int8Array(t)},e}(),Io=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=null,t.userId=null,t.timestamp=0,t}return r(t,e),t.prototype.readMessage=function(e,n,r,i){if(n.readByte(),this.status=+n.readByte(),r<=t.MESSAGE_LENGTH)return{stream:n,length:r};if(i===Ri.V4){var o=n.readByte();1&o&&(this.userId=n.readUTF()),2&o&&n.readUTF(),4&o&&(this.timestamp=n.readLong()),8&o&&(this.messageId=n.read2Byte())}else{this.userId=n.readUTF();var s=n.readUTF();e.debug(Re.O,"server sessionId -> "+s),this.timestamp=n.readLong()}return{stream:n,length:r}},t.MESSAGE_LENGTH=2,t}(fo),To=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t}return r(t,e),t.prototype.readMessage=function(e,t,n){return t.readByte(),this.status=+t.readByte(),{stream:t,length:n}},t.MESSAGE_LENGTH=2,t}(fo),Ro=function(e){function t(){return e.call(this,Ii.PING_REQ)||this}return r(t,e),t.prototype.writeMessage=function(e){},t}(Eo),vo=function(e){function t(t){return e.call(this,t)||this}return r(t,e),t}(fo),Co=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.messageId=0,t}return r(t,e),t.prototype.readMessage=function(e,t,n){var r=256*t.readByte()+t.readByte();return this.messageId=parseInt(r.toString(),10),{stream:t,length:n}},t}(fo),yo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.writeMessage=function(e){var t=this.messageId,n=255&t,r=(65280&t)>>8;e.write(r),e.write(n)},t}(Eo),So=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.topic="",t.targetId="",t.syncMsg=!1,t.identifier=Ti.PUB,t}return r(t,e),t.prototype.readMessage=function(t,n,r){return this.date=n.readInt(),this.topic=n.readUTF(),this.targetId=n.readUTF(),e.prototype.readMessage.call(this,t,n,r),this.data=n.readAll(),{stream:n,length:r}},t}(Co),mo=function(e){function t(t,n,r){var i=e.call(this,Ii.PUBLISH)||this;return i.syncMsg=!1,i.identifier=Ti.PUB,i.topic=t,i.data=Ft(n)?ho.writeUTF(n):n,i.targetId=r,i}return r(t,e),t.prototype.writeMessage=function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.write(this.data)},t}(yo),Ao=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t.date=0,t.millisecond=0,t.messageUId="",t.timestamp=0,t.identifier=Ti.PUB,t.topic="",t.targetId="",t}return r(t,e),t.prototype.readMessage=function(t,n,r){return e.prototype.readMessage.call(this,t,n,r),this.date=n.readInt(),this.status=256*n.readByte()+n.readByte(),this.millisecond=256*n.readByte()+n.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=n.readUTF(),{stream:n,length:r}},t}(Co),No=function(e){function t(t){var n=e.call(this,Ii.PUB_ACK)||this;return n.status=0,n.date=0,n.millisecond=0,n.messageUId="",n.timestamp=0,n.messageId=t,n}return r(t,e),t.prototype.writeMessage=function(t){e.prototype.writeMessage.call(this,t)},t}(yo),Oo=function(e){function t(t,n,r){var i=e.call(this,Ii.QUERY)||this;return i.identifier=Ti.QUERY,i.topic=t,i.data=Ft(n)?ho.writeUTF(n):n,i.targetId=r,i}return r(t,e),t.prototype.writeMessage=function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.write(this.data)},t}(yo),Mo=function(e){function t(t){var n=e.call(this,Ii.QUERY_CONFIRM)||this;return n.messageId=t,n}return r(t,e),t}(yo),Uo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t.identifier=Ti.QUERY,t.topic="",t.targetId="",t}return r(t,e),t.prototype.readMessage=function(t,n,r){return e.prototype.readMessage.call(this,t,n,r),this.date=n.readInt(),this.status=256*n.readByte()+n.readByte(),this.data=n.readAll(),{stream:n,length:r}},t}(Co),Lo=function(e,t,n){var r=new Uint8Array(t),i=new po(r),o=i.readByte(),s=function(e,t){var n,r=e.type;switch(r){case Ii.CONN_ACK:n=new Io(e);break;case Ii.PUBLISH:(n=new So(e)).syncMsg=e.syncMsg;break;case Ii.PUB_ACK:n=new Ao(e);break;case Ii.QUERY_ACK:n=new Uo(e);break;case Ii.SUB_ACK:case Ii.UNSUB_ACK:case Ii.PING_RESP:n=new vo(e);break;case Ii.DISCONNECT:n=new To(e);break;default:n=new fo(e),t.error(Re.O,"No support for deserializing "+r+" messages")}return n}(new lo(o),e);return s.read(e,i,r.length-1,n),s};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgN=2]="ppMsgN",e[e.ppMsgS=3]="ppMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.qryPMsg=7]="qryPMsg",e[e.qryGMsg=8]="qryGMsg",e[e.qryCHMsg=9]="qryCHMsg",e[e.qryCMsg=10]="qryCMsg",e[e.qrySMsg=11]="qrySMsg",e[e.recallMsg=12]="recallMsg",e[e.prMsgS=13]="prMsgS",e[e.pbMsgP=14]="pbMsgP",e[e.rrMsg=15]="rrMsg",e[e.rrList=16]="rrList",e[e.s_ntf=17]="s_ntf",e[e.s_msg=18]="s_msg",e[e.s_stat=19]="s_stat",e[e.s_cmd=20]="s_cmd",e[e.s_us=21]="s_us",e[e.pullUS=22]="pullUS",e[e.sendMsgRead=23]="sendMsgRead",e[e.qryMsgRead=24]="qryMsgRead",e[e.qryMsgReadCntBatch=25]="qryMsgReadCntBatch",e[e.updRTime=26]="updRTime",e[e.pgMsgS=27]="pgMsgS",e[e.chatMsgS=28]="chatMsgS",e[e.qrySessionsAtt=29]="qrySessionsAtt",e[e.pullMsg=30]="pullMsg",e[e.qrySessions=31]="qrySessions",e[e.delSessions=32]="delSessions",e[e.delMsg=33]="delMsg",e[e.updRRTime=34]="updRRTime",e[e.setTypeUnpush=35]="setTypeUnpush",e[e.chrmPull=36]="chrmPull",e[e.joinChrm=37]="joinChrm",e[e.joinChrmR=38]="joinChrmR",e[e.exitChrm=39]="exitChrm",e[e.queryChrmI=40]="queryChrmI",e[e.setKV=41]="setKV",e[e.delKV=42]="delKV",e[e.pullKV=43]="pullKV",e[e.qryRelation=44]="qryRelation",e[e.delRelation=45]="delRelation",e[e.pullSeAtts=46]="pullSeAtts",e[e.setSeAtt=47]="setSeAtt",e[e.qnTkn=48]="qnTkn",e[e.qnUrl=49]="qnUrl",e[e.aliUrl=50]="aliUrl",e[e.s3Url=51]="s3Url",e[e.stcUrl=52]="stcUrl",e[e.minioUrl=53]="minioUrl",e[e.cleanPMsg=54]="cleanPMsg",e[e.cleanGMsg=55]="cleanGMsg",e[e.cleanCMsg=56]="cleanCMsg",e[e.cleanSMsg=57]="cleanSMsg",e[e.rtcPing=58]="rtcPing",e[e.rtc_ntf=59]="rtc_ntf",e[e.rtcSetOutData=60]="rtcSetOutData",e[e.rtcQryUserOutData=61]="rtcQryUserOutData",e[e.addSeTag=62]="addSeTag",e[e.delSeTag=63]="delSeTag",e[e.addTag=64]="addTag",e[e.delTag=65]="delTag",e[e.disTag=66]="disTag",e[e.reportsdk=67]="reportsdk",e[e.pullUgSes=68]="pullUgSes",e[e.pullUgMsg=69]="pullUgMsg",e[e.ugMsg=70]="ugMsg",e[e.qryUgMsg=71]="qryUgMsg",e[e.updUgRTime=72]="updUgRTime",e[e.upMsgEx=73]="upMsgEx",e[e.modifyMsg=74]="modifyMsg",e[e.qryMsgChange=75]="qryMsgChange",e[e.qryMsg=76]="qryMsg",e[e.operate=77]="operate",e[e.s_opNtf=78]="s_opNtf",e[e.ugUnpushQuery=79]="ugUnpushQuery",e[e.ugUnpushSet=80]="ugUnpushSet",e[e.setRtcRoomId=81]="setRtcRoomId",e[e.qryUgUal=82]="qryUgUal",e[e.s_pubCall=83]="s_pubCall",e[e.updUserSub=84]="updUserSub",e[e.pullUserSub=85]="pullUserSub",e[e.pullSubData=86]="pullSubData",e[e.qrySubData=87]="qrySubData",e[e.pullUserProfile=88]="pullUserProfile",e[e.pullOwnProfile=89]="pullOwnProfile",e[e.updProfilePermiss=90]="updProfilePermiss",e[e.qProfilePermiss=91]="qProfilePermiss",e[e.searchUserProfile=92]="searchUserProfile",e[e.updUserProfile=93]="updUserProfile",e[e.pullEventChange=94]="pullEventChange",e[e.channelCreate=95]="channelCreate",e[e.upChannelInfo=96]="upChannelInfo",e[e.qChannelInfo=97]="qChannelInfo",e[e.channelMemKick=98]="channelMemKick",e[e.channelMemQuit=99]="channelMemQuit",e[e.channelDismiss=100]="channelDismiss",e[e.channelTransfer=101]="channelTransfer",e[e.upChannelManager=102]="upChannelManager",e[e.qChannelMem=103]="qChannelMem",e[e.qChannelSpeMem=104]="qChannelSpeMem",e[e.upChannelMem=105]="upChannelMem",e[e.channelMemJoin=106]="channelMemJoin",e[e.channelMemInvite=107]="channelMemInvite",e[e.channelApplyResp=108]="channelApplyResp",e[e.qChannelApplyList=109]="qChannelApplyList",e[e.qChannelMemJoin=110]="qChannelMemJoin",e[e.qChannelMemSpeJoin=111]="qChannelMemSpeJoin",e[e.upChannelRemark=112]="upChannelRemark",e[e.qChannelRemark=113]="qChannelRemark",e[e.upChannelFollow=114]="upChannelFollow",e[e.qChannelFollow=115]="qChannelFollow",e[e.qSimpleUserProfile=116]="qSimpleUserProfile",e[e.friendAdd=117]="friendAdd",e[e.friendDel=118]="friendDel",e[e.friendHandle=119]="friendHandle",e[e.friendSetPf=120]="friendSetPf",e[e.friendCheck=121]="friendCheck",e[e.friendsQuery=122]="friendsQuery",e[e.friendApplyDel=123]="friendApplyDel",e[e.friendsInfoQry=124]="friendsInfoQry",e[e.friendAuthSet=125]="friendAuthSet",e[e.friendAuthGet=126]="friendAuthGet"}(co||(co={}));var Po=co,bo=function(){function e(e,t){this._runtime=e,this._appkey=t,this._users={}}return e.prototype._getMemData=function(e){return this._users[e]=this._users[e]||{inboxTime:0,outboxTime:0,broadcastSyncTime:0},this._users[e]},e.prototype.setInboxTime=function(e,t){var n=this._getMemData(t);if(!(n.inboxTime>e)){n.inboxTime=e;var r=Z.INBOX_TIME_KEY(this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}},e.prototype.getInboxTime=function(e){var t=this._getMemData(e);if(0===t.inboxTime){var n=Z.INBOX_TIME_KEY(this._appkey,e);t.inboxTime=parseInt(this._runtime.localStorage.getItem(n),10)||0}return t.inboxTime},e.prototype.setBroadcastSyncTime=function(e,t){var n=this._getMemData(t);if(!(n.broadcastSyncTime>=e||Zt(e))){n.broadcastSyncTime=e;var r=Z.BROADCASTBOX_TIME_KEY(this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}},e.prototype.getBroadcastSyncTime=function(e){var t=this._getMemData(e);if(!t||0===t.broadcastSyncTime){var n=Z.BROADCASTBOX_TIME_KEY(this._appkey,e);t.broadcastSyncTime=parseInt(this._runtime.localStorage.getItem(n),10)||1}return t.broadcastSyncTime},e.prototype.setOutboxTime=function(e,t){var n=this._getMemData(t);if(!(n.outboxTime>=e)){n.outboxTime=e;var r=Z.OUTBOX_TIME_KEY(this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}},e.prototype.getOutboxTime=function(e){var t=this._getMemData(e);if(0===t.outboxTime){var n=Z.OUTBOX_TIME_KEY(this._appkey,e);t.outboxTime=parseInt(this._runtime.localStorage.getItem(n),10)||0}return t.outboxTime},e}(),Do={_caches:{},set:function(e,t){this._caches[e]=t},get:function(e){return this._caches[e]||0},clear:function(e){this._caches[e]=0}},wo=function(){function e(e,t,n){this.logger=e,this._kvCaches={},this._chatroomId=t,this._currentUserId=n}return e.prototype._add=function(e){var t=e.key;e.isDeleted=!1,this._kvCaches[t]=e},e.prototype._remove=function(e){var t=e.key,n=this._kvCaches[t];n&&(n.isDeleted=!0,this._kvCaches[t]=n)},e.prototype._setEntry=function(e,t){var n=e.key,r=e.type,i=e.isOverwrite,o=e.userId,s=this._getSetUserId(n),a=r===ye.DELETE,u=s===o,c=!this._isExisted(n),l=a?this._remove:this._add;(t||i||u||c)&&l.call(this,e)},e.prototype.getValue=function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.value},e.prototype.getVersion=function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.version},e.prototype.getAllValue=function(){var e={};for(var t in this._kvCaches)this._kvCaches[t].isDeleted||(e[t]=this._kvCaches[t].value);return e},e.prototype._getSetUserId=function(e){return(this._kvCaches[e]||{}).userId},e.prototype._isExisted=function(e){var t=this._kvCaches[e]||{},n=t.value,r=t.isDeleted;return n&&!r},e.prototype.setEntries=function(e){var t=this,n=e.kvEntries,r=e.isFullUpdate;n=n||[],(r=r||!1)&&this.clear(),n.forEach((function(e){t._setEntry(e,r)}))},e.prototype.clear=function(){this._kvCaches={}},e}(),Vo=function(){function e(e){this._pullQueue=[],this._isPulling=!1,this._storeCaches={},this._engine=e}return e.prototype._startPull=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.chrmId,n=e.timestamp,(r=Do.get(t))>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullChatroomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,this._isPulling=!1,o===re.SUCCESS?(Do.set(t,s.syncTime||0),this._startPull()):this._startPull(),[2]}}))}))},e.prototype.reset=function(e){Do.clear(e);var t=this._storeCaches[e];null==t||t.clear()},e.prototype.pullEntry=function(e,t){this._pullQueue.push({chrmId:e,timestamp:t}),this._startPull()},e.prototype.setLocal=function(e,t,n){var r=this._storeCaches[e];en(r)||(r=new wo(this._engine.getInnerLogger(),e,n)),r.setEntries(t),this._storeCaches[e]=r},e.prototype.getValue=function(e,t){var n=this._storeCaches[e];return n?n.getValue(t):null},e.prototype.getVersion=function(e,t){var n=this._storeCaches[e];return n?n.getVersion(t):null},e.prototype.getAll=function(e){var t=this._storeCaches[e],n={};return t&&(n=t.getAllValue()),n},e}(),Go=function(){function e(e){this._canJoinMulipleChrm=e,this._joinedChrmsInfo={}}return e.prototype.set=function(e,t,n){void 0===t&&(t=10),void 0===n&&(n=""),this._canJoinMulipleChrm||(this._joinedChrmsInfo={}),this._joinedChrmsInfo[e]={count:t,extra:n}},e.prototype.get=function(){return JSON.parse(JSON.stringify(this._joinedChrmsInfo))},e.prototype.remove=function(e){delete this._joinedChrmsInfo[e]},e.prototype.clear=function(){this._joinedChrmsInfo={}},e}(),Bo=function(){function e(){this._callerQueue=[],this._isCalling=!1,this._retryCount=0}return e.prototype.pushTask=function(e){var t=this;return new Promise((function(n){t._callerQueue.push({task:e,resolve:n}),t._startCall()}))},e.prototype._startCall=function(){return a(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return this._isCalling||0===this._callerQueue.length?[2]:(this._isCalling=!0,e=this._callerQueue.shift(),[4,this._callHandler(e)]);case 1:return t=n.sent(),e.resolve(t),this._isCalling=!1,this._startCall(),[2]}}))}))},e.prototype._callHandler=function(e){return a(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(i){switch(i.label){case 0:return t=e.task,n=this.getVersion(),[4,t(n)];case 1:return(r=i.sent()).code===re.USER_SETTING_SYNCED_ERROR&&this._retryCount<5?(this._retryCount++,[4,this._triggerPull(n)]):[3,3];case 2:return i.sent(),[2,this._callHandler(e)];case 3:return this._retryCount=0,[2,r]}}))}))},e.prototype.stopAllTask=function(){this._callerQueue.forEach((function(e){e.resolve({code:re.RC_NET_UNAVAILABLE})})),this._callerQueue=[]},e}(),Fo="converStatusChanged",ko=function(e){function t(t,n,r){var i=e.call(this)||this;return i._eventEmitter=new hn,i._pullQueue=[],i._isPulling=!1,i._pullPromise=null,i._storagePullTimeKey="con-s-"+n+"-"+r,i._oldStorage=d(t.runtime),i._storage=new p(t.runtime,Z.CONVER_STATE_PULL_TIME_KEY(n,r)),i._appkey=n,i._currentUserId=r,i._engine=t,i.adaptOldStatus(),i}return r(t,e),t.prototype.adaptOldStatus=function(){try{if(this._storage.get(this._storagePullTimeKey)||0)return;var e=this._oldStorage.get(this._storagePullTimeKey)||0;if(!e)return;this._storage.set(this._storagePullTimeKey,e),this._oldStorage.remove(this._storagePullTimeKey)}catch(e){this._engine.getInnerLogger().error(Re.A_CALLBACK_E,"adaptOldStatus error: "+e.message)}},t.prototype._set=function(e){var t=this;if(!Zt(e)&&Array.isArray(e)){var n=this._storage.get(this._storagePullTimeKey)||0,r=e.length;e.forEach((function(e,i){var o=e.updatedTime||0;n=o>n?o:n,e.conversationType=e.type,t._eventEmitter.emit(Fo,{statusItem:e,isLastPull:i===r-1})})),this._storage.set(this._storagePullTimeKey,n),this._pullQueue=this._pullQueue.filter((function(e){return e>n}))}},t.prototype._startPull=function(){return a(this,void 0,void 0,(function(){var e,t,n,r;return u(this,(function(i){switch(i.label){case 0:return this._isPulling||0===this._pullQueue.length?[2,this._pullPromise]:(this._isPulling=!0,this._pullQueue.shift(),e=this.getVersion(),this._pullPromise=this._engine.pullConversationStatus(e),[4,this._pullPromise]);case 1:return t=i.sent(),n=t.code,r=t.data,this._isPulling=!1,this._pullPromise=null,n===re.SUCCESS&&this._set(r),0===this._pullQueue.length?this._startCall():this._startPull(),[2]}}))}))},t.prototype._startCall=function(){return a(this,void 0,void 0,(function(){return u(this,(function(t){return this._isPulling||e.prototype._startCall.call(this),[2]}))}))},t.prototype.pull=function(e){var t=this.getVersion();(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())},t.prototype._triggerPull=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this._startPull()];case 1:return t.sent(),[2]}}))}))},t.prototype.watch=function(e){this._eventEmitter.on(Fo,(function(t){e(t)}))},t.prototype.setConversationUpdatedTime=function(e){var t=this._storage.get(this._storagePullTimeKey)||0;return e&&e>t?(this._storage.set(this._storagePullTimeKey,e),e):t},t.prototype.getVersion=function(){return this._storage.get(this._storagePullTimeKey)||0},t}(Bo),xo={c:{keyName:"unreadMessageCount",defaultVal:0},hm:{keyName:"hasMentioned",defaultVal:!1},m:{keyName:"mentionedInfo",defaultVal:null},t:{keyName:"lastUnreadTime",defaultVal:0},lt:{keyName:"lastReadTime",defaultVal:0},fut:{keyName:"firstUnreadTime",defaultVal:0},fuid:{keyName:"firstUnreadMessageUid",defaultVal:""},nc:{keyName:"notificationStatus",defaultVal:2},nl:{keyName:"notificationLevel",defaultVal:0},to:{keyName:"isTop",defaultVal:!1},tg:{keyName:"tags",defaultVal:{}},mc:{keyName:"unreadMentionedCount",defaultVal:0},st:{keyName:"lastMessageSentTime",defaultVal:0}},Ho={};for(var Yo in xo){var Ko=xo[Yo].keyName;Ho[Ko]=Yo}var qo=function(){function e(e,t,n,r){this._appkey=t,this._currentUserId=n,this.logger=r,this.storage=new p(e,Z.OLD_CONVER_STATE_KEY(t,n)),this._localStore=new p(e,Z.CONVER_STATE_KEY(t,n))}return e.prototype._getStoreKey=function(e,t,n){return n+"_"+e+"_"+t},e.prototype._getConOptionByKey=function(e){var t=(e=e||"").split("_");if(t.length>=2){var n=t.shift(),r=t.shift(),i=t.join("_");return{conversationType:Number(r),targetId:i,channelId:n}}return{conversationType:oe.PRIVATE,targetId:"",channelId:""}},e.prototype._updateMentionedUserList=function(e,t,n){var r=this,i=e.conversationType,o=e.messageType,s=e.isMentioned,a=e.senderUserId;s&&i===oe.GROUP&&((n.userIdList||[]).forEach((function(e){e===r._currentUserId&&t.indexOf(a)<0&&t.push(a)})),n.type===ge.ALL&&t.indexOf(a)<0&&t.push(a));if(o===ce.RECALL&&i===oe.GROUP){var u=t.indexOf(a);u>=0&&t.splice(u,1)}return t},e.prototype.updateMentionedData=function(e){var t=e.conversationType,n=e.targetId,r=e.content,i=e.channelId,o=e.senderUserId,s=r.mentionedInfo;if(s&&o!==this._currentUserId){var a=this._getStoreKey(t,n,i),u=this._localStore.get(a)||{},c=Ho.mentionedInfo,l=Ho.hasMentioned,d=u[c]||{},h=d.userIdList||[];s={userIdList:h=this._updateMentionedUserList(e,h,s),type:(null==s?void 0:s.type)||d.type},0!==h.length?(u[c]=s,u[l]=!0):(delete u[c],delete u[l]),en(u)?this._localStore.set(a,u):this._localStore.remove(a)}},e.prototype._setLocal=function(e,t){if("tags"===e)for(var n in t)t[n].isTop||delete t[n].isTop;return t},e.prototype.set=function(e,t,n,r){var i=this._getStoreKey(e,t,r),o=this._localStore.get(i)||{};for(var s in n){var a=Ho[s],u=n[s];if(!Zt(a)&&!Zt(u)&&"hasMentioned"!==s&&"MentionedInfo"!==s)u===xo[a].defaultVal||"tags"===s&&!en(u)?delete o[a]:o[a]=this._setLocal(s,u),o.c||(delete o.t,delete o.fut,delete o.fuid,delete o.hm,delete o.m,delete o.mc)}var c=Object.keys(o);1===c.length&&c.includes("st")&&delete o.st,en(o)?this._localStore.set(i,o):this._localStore.remove(i)},e.prototype.get=function(e,t,n){void 0===n&&(n="");var r=this._getStoreKey(e,t,n),i=this._localStore.get(r)||{},o={};for(var s in xo){var a=xo[s],u=a.keyName,c=a.defaultVal;o[u]=i[s]||Rr(c)}return o},e.prototype.getValue=function(e){var t=this._localStore.getValues()||{},n=[];for(var r in t){var i=this._getConOptionByKey(r),o={conversationType:i.conversationType,targetId:i.targetId,channelId:i.channelId},s=t[r];for(var a in s)if(xo[a]){var u=xo[a],c=u.keyName,l=u.defaultVal;o[c]=s[a]||Rr(l)}o=e?e(o):o,n.push(o)}return n},e.prototype.getValueForTag=function(){var e=this._localStore.getValues()||{},t={};for(var n in e){var r=this._getConOptionByKey(n),i=r.conversationType,s=r.targetId,a={},u=e[n];for(var c in u){var l=xo[c],d=l.keyName,h=l.defaultVal;a[d]=u[c]||Rr(h)}for(var p in a.tags){Zt(t[p])&&(t[p]=[]);var _=o(o({},a),{conversationType:i,targetId:s});delete _.tags,t[p].push(_)}}return t},e.prototype.adaptOldStore=function(){try{var e=this.storage.getValues();if(0===Object.keys(e).length)return;for(var t in e){var n="_"+t;this._localStore.set(n,e[t])}this.storage.clear()}catch(e){this.logger.error(Re.O,"adaptOldStore error: "+e.message)}},e.prototype.remove=function(e,t,n){var r=this._getStoreKey(e,t,n);this._localStore.remove(r)},e}(),jo=[oe.PRIVATE,oe.GROUP,oe.SYSTEM,oe.PUBLIC_SERVICE,oe.APP_PUBLIC_SERVICE],Qo="conversationChanged",Wo="conTagStatusChanged",Jo=function(){function e(e,t,n,r,i){var o=this;this._updatedConversations={},this._conTagStatusChanged=!1,this._eventEmitter=new hn,this._draftMap={},this._recallMsgTimeMap={},this._appkey=t,this._loginUserId=n,this._store=new qo(e.runtime,t,n,e.getInnerLogger()),this._statusManager=new ko(e,t,n),this._statusManager.watch((function(e){var t=e.statusItem,n=e.isLastPull;o.addStatus(t,n)})),this._eventEmitter.on(Qo,(function(e){r(e)})),this._eventEmitter.on(Wo,(function(){i()}));var s=this._store.getValue();s.length>1e3&&(s=s.sort((function(e,t){var n=e.lastMessageSentTime,r=void 0===n?0:n,i=t.lastMessageSentTime;return(void 0===i?0:i)-r})),s.splice(1e3,s.length).forEach((function(e){o._store.remove(e.conversationType,e.targetId,e.channelId)})))}return e.prototype._calcMsg=function(e,t,n,r){var i=!this._recallMsgTimeMap[e]||this._recallMsgTimeMap[e]&&!this._recallMsgTimeMap[e].find((function(e){return e===r.sentTime})),o=t>=r.sentTime;return n&&(o=n<r.sentTime),{isNotRead:o,isNotRepeadRecallSendTime:i}},e.prototype._calcUnreadCount=function(e,t){var n=e.content,r=e.messageType,i=e.sentTime,o=e.isCounted,s=e.messageDirection,a=e.senderUserId,u=e.messageUId,c=s===te.SEND&&a===this._loginUserId,l=r===ce.RECALL,d=Jt(n),h=!1,p={},_=t.lastUnreadTime,g=t.lastReadTime,f=t.unreadMessageCount;if(_>i||c)return{hasChanged:h,localConversation:t,updateItems:p};if(o&&(0===t.unreadMessageCount&&(t.firstUnreadMessageUid=u,t.firstUnreadTime=i),t.unreadMessageCount=f+1,t.lastUnreadTime=i,h=!0),l&&d){var E=this._handleRecall2UnreadCount(e,_,g,f,h),I=E.unreadMessageCount,T=E.hasChanged;t.unreadMessageCount=I,h=T,0===t.unreadMessageCount&&(t.firstUnreadMessageUid="",t.firstUnreadTime=0)}return h&&(p.unreadMessageCount={val:t.unreadMessageCount||0,time:i}),{hasChanged:h,localConversation:t,updateItems:p}},e.prototype._handleRecall2UnreadCount=function(e,t,n,r,i){var o=e.conversationType+"_"+e.channelId+"_"+e.targetId,s=this._calcMsg(o,t,n,e.content),a=s.isNotRead,u=s.isNotRepeadRecallSendTime;return a&&r&&u?(this._recallMsgTimeMap[o]||(this._recallMsgTimeMap[o]=[]),this._recallMsgTimeMap[o].push(e.content.sentTime),{unreadMessageCount:r-1,hasChanged:!0}):{unreadMessageCount:r,hasChanged:i}},e.prototype._calcMentionedInfo=function(e,t){var n=e.content,r=e.messageDirection,i=e.isMentioned,o=e.sentTime,s=r===te.SEND,a=Jt(n),u=!1,c={};return!s&&i&&a&&n.mentionedInfo&&(t.hasMentioned=!0,u=!0,c.hasMentioned={val:!0,time:o},c.mentionedInfo={val:n.mentionedInfo,time:o}),{hasChanged:u,localConversation:t,updateItems:c}},e.prototype._calcMentionedCount=function(e,t){var n=e.content,r=e.messageDirection,i=!1;if(e.isMentioned&&r===te.RECEIVE&&(null==n?void 0:n.mentionedInfo)){var o=n.mentionedInfo,s=o.type,a=o.userIdList;if(s===ge.ALL||(a||[]).includes(this._loginUserId)){i=!0;var u=t.unreadMentionedCount||0;t.unreadMentionedCount=u+1}}return{hasChanged:i,localConversation:t}},e.prototype._setUpdatedConversation=function(e){if(Jt(e)){var t=e.conversationType,n=e.targetId,r=e.channelId,i=t+"_"+n,o=this._store.get(t,n,r)||{};this._updatedConversations[i]=Object.assign(o,e)}},e.prototype._setConTagStatusChanged=function(e,t,n,r){var i=(this._store.get(e,t,r)||{}).tags||{};if(Object.keys(i).length===Object.keys(n).length){for(var o in i)if(!n[o]||!!i[o].isTop!=!!n[o].isTop)return void(this._conTagStatusChanged=!0)}else this._conTagStatusChanged=!0},e.prototype.addStatus=function(e,t){var n=e.conversationType,r=e.targetId,i=e.updatedTime,o=e.notificationStatus,s=e.notificationLevel,a=e.isTop,u=e.tags,c=e.channelId,l={},d={};if(n!==oe.ULTRA_GROUP){Zt(o)||(d.notificationStatus={time:i,val:o}),Zt(s)||(d.notificationLevel={time:i,val:s}),Zt(a)||(d.isTop={time:i,val:a}),Zt(u)||(d.tags={time:i,val:u},null==u||u.forEach((function(e){l[e.tagId]={isTop:e.isTop}}))),this._setConTagStatusChanged(n,r,l,c);var h=this._store.get(n,r,c).lastMessageSentTime||(new Date).getTime();this._store.set(n,r,{notificationStatus:o,notificationLevel:s,isTop:a,tags:l,lastMessageSentTime:h},c),r&&(this._setUpdatedConversation({conversationType:n,targetId:r,updatedItems:d,channelId:c}),t&&this._notifyConversationChanged())}},e.prototype._notifyConversationChanged=function(){var e=[];for(var t in this._updatedConversations)e.push(this._updatedConversations[t]);0!==e.length&&(this._eventEmitter.emit(Qo,e),this._updatedConversations={},this._conTagStatusChanged&&(this._eventEmitter.emit(Wo),this._conTagStatusChanged=!1))},e.prototype.setConversationCacheByMessage=function(e,t){var n=this,r=e.conversationType,i=e.isPersited,s=e.targetId,a=e.channelId,u=e.sentTime,c=e.disableUpdateLastMessage;if(jo.indexOf(r)>=0){var l=!1,d=this._store.get(r,s,a),h={};if(d.lastMessageSentTime=u,[this._calcUnreadCount,this._calcMentionedInfo,this._calcMentionedCount].forEach((function(t){var r=t.call(n,e,d),i=r.hasChanged,s=r.localConversation,a=r.updateItems;l=l||i,h=o(o({},h),a),d=Rr(s)})),this._store.set(r,s,d,a),this._store.updateMentionedData(e),i&&!c){var p=this._store.get(r,s,a);p.updatedItems=o({latestMessage:{time:e.sentTime,val:e}},h),p.latestMessage=e;var _=Object.assign(p,{conversationType:r,targetId:s,channelId:a});this._setUpdatedConversation(_)}(l||i&&!c)&&this._notifyConversationChanged()}},e.prototype.get=function(e,t,n){return void 0===n&&(n=""),this._store.get(e,t,n)},e.prototype.getAllUnreadCount=function(e,t,n){var r=this._store.getValue(),i=0;return r.forEach((function(e){var r=e.unreadMessageCount,o=e.notificationStatus,s=e.notificationLevel,a=e.conversationType;r=r||0,(n||void 0!==s&&s<=0||void 0===s&&o!==de.OPEN)&&(t.length>0?t.includes(Number(a))&&(i+=Number(r)):i+=Number(r))})),i},e.prototype.getTotalUnreadCountByLevels=function(e,t,n){var r=this._store.getValue(),i=0;return r.forEach((function(r){var o=r.unreadMessageCount,s=r.notificationLevel,a=void 0===s?0:s,u=r.conversationType,c=r.unreadMentionedCount;e.includes(u)&&(0===t.length||t.includes(a))&&(i+=(n?c:o)||0)})),i},e.prototype.getUnreadCountByTag=function(e,t){var n=this._store.getValueForTag()[e]||[],r=0;return n.forEach((function(e){var n=e.unreadMessageCount,i=e.notificationStatus,o=e.notificationLevel;(t||1!==i||-1===o||0===o)&&(n=n||0,r+=Number(n))})),r},e.prototype.getUnreadCount=function(e,t,n){return this._store.get(e,t,n).unreadMessageCount||0},e.prototype.clearUnreadCount=function(e,t,n,r,i){void 0===i&&(i=!0);var o=this._store.get(e,t,n);o.lastReadTime=o.lastUnreadTime,this._recallMsgTimeMap[e+"_"+n+"_"+t]=[];var s=o.unreadMessageCount,a=o.hasMentioned,u={};if(s&&(o.unreadMessageCount=0,u.unreadMessageCount={val:0,time:r}),a&&(o.hasMentioned=!1,o.unreadMentionedCount=0,o.mentionedInfo=void 0,u.hasMentioned={val:!1,time:r},u.mentionedInfo={val:void 0,time:r}),this._store.set(e,t,o,n),i&&0!==Object.keys(u).length){var c=Object.assign(o,{conversationType:e,targetId:t,channelId:n,updatedItems:u});this._setUpdatedConversation(c),this._notifyConversationChanged()}},e.prototype.clearAllUnreadCount=function(){var e=this;this._store.getValue().forEach((function(t){t.unreadMessageCount&&(t.unreadMessageCount=0,t.lastReadTime=t.lastUnreadTime,e._recallMsgTimeMap={},e._store.set(t.conversationType,t.targetId,t,t.channelId))}))},e.prototype.startPullConversationStatus=function(e){this._statusManager.pull(e)},e.prototype.setDraft=function(e,t,n,r){var i=e+"_"+t+"_"+r;this._draftMap[i]=n},e.prototype.getDraft=function(e,t,n){var r=e+"_"+t+"_"+n;return this._draftMap[r]},e.prototype.clearDraft=function(e,t,n){var r=e+"_"+t+"_"+n;delete this._draftMap[r]},e.prototype.addTagStatus=function(e,t,n,r){void 0===r&&(r="");var i=this._store.get(e,t,r),o=i.tags;o=Object.assign(o,n);var s=i.lastMessageSentTime||(new Date).getTime();this._store.set(e,t,{tags:o,lastMessageSentTime:s},r)},e.prototype.deleteTagStatus=function(e,t,n,r){void 0===r&&(r="");var i=this._store.get(e,t,r).tags;n.forEach((function(e){delete i[e]})),this._store.set(e,t,{tags:i},r)},e.prototype.getConversationListForTag=function(){return this._store.getValueForTag()},e.prototype.getBlockConversationList=function(){return this._store.getValue().filter((function(e){return e.notificationStatus===de.OPEN||e.notificationLevel&&e.notificationLevel>0})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,notificationLevel:e.notificationLevel||0,notificationStatus:e.notificationStatus||2}}))},e.prototype.getTopConversationList=function(e,t){var n=this;return(this._store.getValue()||{}).filter((function(n){return e.includes(n.conversationType)&&(Zt(t)||t===n.channelId)&&n.isTop})).map((function(e){return n._buildConversation(e)}))},e.prototype.adaptOldStore=function(){this._store.adaptOldStore()},e.prototype.getUnreadMentionedCount=function(e,t,n){return void 0===n&&(n=""),this.get(e,t,n).unreadMentionedCount||0},e.prototype.getAllUnreadMentionedCount=function(){var e=this._store.getValue(),t=0;return e.forEach((function(e){var n=e.unreadMentionedCount;n=n||0,t+=Number(n)})),t},e.prototype.getAllConversationState=function(){return this._store.getValue().filter((function(e){return e.unreadMessageCount||e.unreadMentionedCount})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,unreadCount:e.unreadMessageCount||0,unreadMentionedCount:e.unreadMentionedCount||0}}))},e.prototype.getUnreadConversationList=function(e){var t=this;return(this._store.getValue()||{}).filter((function(t){return e.includes(t.conversationType)&&t.unreadMessageCount&&t.unreadMessageCount>0})).map((function(e){return t._buildConversation(e)}))},e.prototype._buildConversation=function(e){var t=this.getDraft(e.conversationType,e.targetId,e.channelId);return{channelId:e.channelId,conversationType:e.conversationType,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount||0,latestMessage:null,hasMentioned:e.hasMentioned||!1,mentionedInfo:e.mentionedInfo,notificationStatus:e.notificationStatus||0,notificationLevel:e.notificationLevel||0,isTop:e.isTop||!1,lastUnreadTime:e.lastUnreadTime||0,unreadMentionedCount:e.unreadMentionedCount||0,draft:t}},e.prototype.setConversationUpdatedTime=function(e){return this._statusManager.setConversationUpdatedTime(e)},e.prototype.getConversationUpdatedTime=function(){return this._statusManager.getVersion()},e.prototype.pushTask=function(e){return this._statusManager.pushTask(e)},e.prototype.stopAllTask=function(){this._statusManager.stopAllTask()},e}(),Xo=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o._tagKey="tags",o._versionKey="version",o._pullQueue=[],o._isPulling=!1,o._pullPromise=null,o._storageKey=Z.USER_SETTING_KEY(n,r),o._storage=new p(t.runtime,o._storageKey),o._engine=t,o._tagWatcherFunc=i,o}return r(t,e),t.prototype._updateTag=function(e){var t=e.tags,n={};t.forEach((function(e){n[e.tagId]={tagName:e.tagName,createdTime:e.createdTime}})),this._storage.set(this._tagKey,n),this._tagWatcherFunc()},t.prototype.addTag=function(e,t){var n,r=this._storage.get(this._tagKey)||{};e.forEach((function(e){var t,n=(null===(t=r[e.tagId])||void 0===t?void 0:t.createdTime)||e.createdTime||0;r[e.tagId]={tagName:e.tagName,createdTime:n}})),this._storage.update(((n={})[this._tagKey]=r,n[this._versionKey]=t,n))},t.prototype.deleteTag=function(e,t){var n,r=this._storage.get(this._tagKey)||{};e.forEach((function(e){delete r[e]})),this._storage.update(((n={})[this._tagKey]=r,n[this._versionKey]=t,n))},t.prototype.getTagsInfo=function(){return this._storage.get(this._tagKey)||{}},t.prototype.getTags=function(){var e=this._storage.get(this._tagKey)||{},t=[];for(var n in e)t.push({tagId:n,tagName:e[n].tagName,createdTime:e[n].createdTime,conversationCount:0});return t.sort((function(e,t){return(e.createdTime||0)-(t.createdTime||0)}))},t.prototype.getTagById=function(e){var t=this._storage.get(this._tagKey)||{};return t[e]?{tagId:e,tagName:t[e].tagName,createdTime:t[e].createdTime,conversationCount:0}:null},t.prototype._startPull=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return this._isPulling||0===this._pullQueue.length?[2,this._pullPromise]:(this._isPulling=!0,this._pullQueue.shift(),e=this.getVersion(),this._pullPromise=this._engine.pullUserSettings(e),[4,this._pullPromise]);case 1:return t=u.sent(),n=t.code,r=t.data,this._isPulling=!1,this._pullPromise=null,n!==re.SUCCESS||Zt(r)||(o=(i=r).settings,s=i.version,a=o.Tag,Zt(a)||this._updateTag(a),this._storage.set(this._versionKey,s),this._pullQueue=this._pullQueue.filter((function(e){return e>s}))),0===this._pullQueue.length?this._startCall():this._startPull(),[2]}}))}))},t.prototype._startCall=function(){return a(this,void 0,void 0,(function(){return u(this,(function(t){return this._isPulling||e.prototype._startCall.call(this),[2]}))}))},t.prototype.pullUserSettings=function(e){var t=this.getVersion();(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())},t.prototype._triggerPull=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this._startPull()];case 1:return t.sent(),[2]}}))}))},t.prototype.getVersion=function(){return this._storage.get(this._versionKey)||0},t.prototype.updateVersion=function(e){this._storage.set(this._versionKey,e)},t}(Bo),Zo=function(e){return e.replace(/@.+$/,"@")},zo=function(){function e(e,t,n,r,i,o){void 0===i&&(i=!0),void 0===o&&(o=!0),this.appkey=e,this.logger=t,this.statisticLog=n,this.staticConfigManager=r,this.isRequestProfile=i,this.isUseDynamicNaviUrl=o,this.crtRequest=null,this._environment="default"}return e.prototype.getCatchKey=function(e){return e+(this._environment?"-"+this._environment:"")},e.prototype.request=function(e,t,n,r,i){return a(this,void 0,void 0,(function(){var o,s,a;return u(this,(function(u){switch(u.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,n,r,i),[4,this.crtRequest]);case 1:return o=u.sent(),s=o.code,a=o.data,this.crtRequest=null,[2,{code:s,data:a}]}}))}))},e.prototype.sendRequest=function(e,t,n,r,i){var o;return a(this,void 0,void 0,(function(){var s,a,c,l,d,h,p,_,g,f,E,I,T,v;return u(this,(function(u){switch(u.label){case 0:return s=Zo(e),a=this.getNaviCache(s),!t&&a&&(c=a.timestamp,l=a.naviInfo,n||Date.now()-c<R)?(this.logger.info(Re.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:l}),r),d={bid:rr(),ptc:Je.NAVI,cod:re.SUCCESS,net:null==i?void 0:i.type,dur:0,spr:0,pr:null!==(o=l.type)&&void 0!==o?o:0,hos:"",cache:Xe.LOCAL,v:Ze.CURRENT,rsn:null==i?void 0:i.reason,cid:(null==i?void 0:i.uuid)+"_"+(null==i?void 0:i.retryCount),count:null==i?void 0:i.retryCount},this.statisticLog.record(ve.IM_NAVI,JSON.stringify(d),r),[2,{code:re.SUCCESS,data:l}]):(h=Ci.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(Re.L_GET_NAVI_T,JSON.stringify({token:e,uris:h}),r),[4,this.requestHandler(h,e,r,i)]);case 1:return p=u.sent(),_=p.code,g=p.data,_===re.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(f=u.sent())?void 0:f.navi)&&(null==f?void 0:f.navi.length)>0?(E=f.navi,[4,this.requestHandler(E,e,r,i)]):[3,4];case 3:I=u.sent(),_=I.code,g=I.data,u.label=4;case 4:return _!==re.SUCCESS?(this.logger.warn(Re.L_GET_NAVI_R,_,r),[2,{code:_}]):(T=g).code&&200!==T.code?(this.logger.warn(Re.L_GET_NAVI_R,T.code,r),[2,{code:this.transHttpCode(T.code)}]):Pr(T).length>0?(this.logger.info(Re.L_GET_NAVI_R,JSON.stringify({naviInfo:T}),r),this.setNaviCache(s,T),[2,{code:_,data:T}]):(v={server:T.server,backupServer:T.backupServer,serverAddr:T.serverAddr,bs:T.bs},this.logger.warn(Re.L_GET_NAVI_R,"navi server address invalid: "+JSON.stringify(v),r),[2,{code:re.SERVER_UNAVAILABLE}])}}))}))},e.prototype.requestHandler=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,o,s,a,c,l,d,h,p;return u(this,(function(u){switch(u.label){case 0:i=0,o=e.length,u.label=1;case 1:return i<o?(s=i===e.length-1,a=this.useV2Navi()?this.httpRequestV2:this.httpRequest,c=Date.now(),[4,a.call(this,e[i],this.appkey,t,n,s)]):[3,4];case 2:if(l=u.sent(),d=l.code,h=l.data,p={bid:rr(),ptc:Je.NAVI,cod:d,net:null==r?void 0:r.type,dur:Date.now()-c,spr:0,pr:(null==h?void 0:h.type)||0,hos:e[i],cache:Xe.REQUEST,v:Ze.CURRENT,rsn:null==r?void 0:r.reason,cid:(null==r?void 0:r.uuid)+"_"+(null==r?void 0:r.retryCount),count:null==r?void 0:r.retryCount},this.statisticLog.record(ve.IM_NAVI,JSON.stringify(p),n),[re.SUCCESS,re.RC_CONN_TOKEN_INCORRECT,re.RC_LICENSE_EXPIRED].includes(d))return[2,{code:d,data:h}];u.label=3;case 3:return i+=1,[3,1];case 4:return[2,{code:re.RC_NAVI_REQ_FAILED}]}}))}))},e.prototype.transHttpCode=function(e){switch(e){case 401:case 403:return re.RC_CONN_TOKEN_INCORRECT;case 416:return re.RC_LICENSE_EXPIRED;default:return re.RC_NAVI_REQ_FAILED}},e.prototype.getNaviInfoFromCache=function(e){var t=this.getNaviCache(Zo(e));return t?t.naviInfo:null},e.prototype.updateVoipCallInfo=function(e,t){var n=this.getNaviInfoFromCache(e);n&&this.setNaviCache(Zo(e),o(o({},n),{voipCallInfo:t}))},e.prototype.getNaviV2RequestOption=function(e){var t,n=e.uri,r=e.token,i=e.platform,o=e.protocol,s=e.mac;t=n+"/v2/navi.json?cloud=0";var a="token="+encodeURIComponent(r)+"&version=5.12.2&platfrom="+i;return s&&(a+="&m="+s),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn="+o+";rtc=4;log=2"},body:a,url:t,timeout:C}},e.prototype.useV2Navi=function(){return!0},e}(),$o={};function es(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:0,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:Ci.getMiniCmpUrlList().join(",")}}var ts,ns=function(e){function t(t,n,r,i,o,s){void 0===s&&(s="default");var a=e.call(this,t,n,r,o,i.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),i.useNavi)||this;return a.runtime=i,a._environment=s,a}return r(t,e),t.prototype.httpRequest=function(e,t,n,r,i){return a(this,void 0,void 0,(function(){var o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return o=e+"/navi.js?appId="+t+"&token="+encodeURIComponent(n)+"&callBack=x&v="+Y+"&r="+Date.now()+"&env="+this._environment,this.logger.debug(Re.L_REQUEST_T,"req navi => "+o,r),[4,this.runtime.httpReq({url:o,timeout:C,dataType:"text"})];case 1:if(200!==(s=u.sent()).status)return this.logger.debug(Re.L_REQUEST_R,"request navi failed: "+s.status,r),!this.runtime.useNavi&&i?[2,{code:re.SUCCESS,data:es()}]:[2,{code:this.transHttpCode(s.status)}];try{return 0===(a=s.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(a=JSON.parse('"'+a+'"')),(c=JSON.parse(a)).protocol=/^https/.test(o)?"https":"http",c.code&&200!==c.code?[2,{code:this.transHttpCode(c.code)}]:(this.runtime.useNavi||(c.server="",c.backupServer=Ci.getMiniCmpUrlList().join(","),c.logSwitch=0),[2,{code:re.SUCCESS,data:c}])}catch(e){this.logger.error(Re.L_PARSE_NAVI_E,s.data,r)}return[2,{code:re.RC_NAVI_REQ_FAILED}]}}))}))},t.prototype.httpRequestV2=function(e,t,n,r,i){return a(this,void 0,void 0,(function(){var o,s,a,c,l;return u(this,(function(u){switch(u.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:n,uri:e,platform:this.runtime.tag,protocol:(/^https/.test(e)?Be.WSS:Be.WS).toString()}),this.logger.debug(Re.L_REQUEST_T,"req navi => "+o.url,r),[4,this.runtime.httpReq(o)];case 1:if(200!==(s=u.sent()).status)return this.logger.debug(Re.L_REQUEST_R,"request navi failed: "+s.status,r),!this.runtime.useNavi&&i?[2,{code:re.SUCCESS,data:es()}]:[2,{code:this.transHttpCode(s.status)}];try{return a=s.data,(c="object"!=typeof a?JSON.parse(a):a).protocol=/^https/.test(o.url)?"https":"http",this.runtime.useNavi||(c.logSwitch=0,l=Ci.getMiniCmpUrlList(),c.serverAddr=l.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?Be.WSS:Be.WS,weight:l.length-t}}))),[2,{code:re.SUCCESS,data:c}]}catch(e){this.logger.error(Re.L_PARSE_NAVI_E,s.data,r)}return[2,{code:re.RC_NAVI_REQ_FAILED}]}}))}))},t.prototype.getNaviCache=function(e){var t=this,n=this.getCatchKey(e);if($o[n])return $o[n];var r,i=Z.NAVI_KEY(this.appkey),o=this.runtime.localStorage;try{var s=o.getItem(i);r=s?JSON.parse(s):[]}catch(e){r=[]}if(0===r.length)return null;var a=r.find((function(n){return n.token===e&&n.environment===t._environment}))||null;return $o[n]=a,a},t.prototype.setNaviCache=function(e,t){var n,r=this,i=Z.NAVI_KEY(this.appkey),o=this.runtime.localStorage;try{var s=o.getItem(i);n=s?JSON.parse(s):[]}catch(e){n=[]}var a=Date.now();n.length>0&&(n=n.filter((function(t){return a-t.timestamp<R&&(e!==t.token||r._environment!==t.environment)})));var u={timestamp:a,naviInfo:t,token:e,environment:this._environment};n.push(u),o.setItem(i,JSON.stringify(n)),$o[this.getCatchKey(e)]=u},t}(zo),rs=function(){function e(e,t){this._runtime=e,this._appkey=t,this._sendMessageMap={},this._userId=""}return e.prototype.init=function(e){this._userId=e;var t=Z.SEND_MSG_KEY(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)},e.prototype._getLocalInfo=function(e){var t=this._runtime.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}},e.prototype.setMessage=function(e,t){this._sendMessageMap[e]=t;var n=Z.SEND_MSG_KEY(this._appkey,this._userId),r=this._getLocalInfo(n);r[e]=t,this._runtime.localStorage.setItem(n,JSON.stringify(r))},e.prototype.getSendMessageMap=function(){return this._sendMessageMap},e.prototype.removeByUID=function(e){delete this._sendMessageMap[e]},e.prototype.removeByTimestamp=function(e){var t=Z.SEND_MSG_KEY(this._appkey,this._userId),n=this._getLocalInfo(t);Object.keys(n).forEach((function(t){n[t]<e&&delete n[t]})),this._runtime.localStorage.setItem(t,JSON.stringify(n))},e}();(ts={})[oe.PRIVATE]=Po.qryPMsg,ts[oe.GROUP]=Po.qryGMsg,ts[oe.CHATROOM]=Po.qryCHMsg,ts[oe.CUSTOMER_SERVICE]=Po.qryCMsg,ts[oe.SYSTEM]=Po.qrySMsg;var is=[Po[Po.recallMsg],Po[Po.ppMsgS],Po[Po.pgMsgS],Po[Po.ppMsgP],Po[Po.pgMsgP],Po[Po.chatMsg],Po[Po.pcMsgP],Po[Po.prMsgS],Po[Po.pbMsgP]],os=function(){function e(e,t,n){this._localStore=new p(e,Z.ULTRA_GROUP_STATE_KEY(t,n))}return e.prototype.set=function(e,t,n,r){var i=this._getStoreKey(e,t,r),o=this._localStore.get(i)||{};for(var s in n){var a=as[s],u=n[s];if(!Zt(a)&&!Zt(u))u===ss[a].defaultVal?delete o[a]:o[a]=u}en(o)?this._localStore.set(i,o):this._localStore.remove(i)},e.prototype.get=function(e,t,n){void 0===n&&(n="");var r=this._getStoreKey(e,t,n),i=this._localStore.get(r)||{},o={};for(var s in ss){var a=ss[s],u=a.keyName,c=a.defaultVal;o[u]=i[s]||Rr(c)}return o},e.prototype._getStoreKey=function(e,t,n){return n+"_"+e+"_"+t},e}(),ss={nc:{keyName:"notificationStatus",defaultVal:2},nl:{keyName:"notificationLevel",defaultVal:0}},as={};for(var us in ss){var cs=ss[us].keyName;as[cs]=us}var ls,ds=function(){function e(e,t,n){this._store=new os(e.runtime,t,n)}return e.prototype.addUltraGroupStatus=function(e){var t=e.conversationType,n=e.targetId,r=e.notificationStatus,i=e.notificationLevel,o=e.channelId;t===oe.ULTRA_GROUP&&this._store.set(t,n,{notificationStatus:r,notificationLevel:i},o)},e.prototype.get=function(e,t,n){return void 0===n&&(n=""),this._store.get(e,t,n)},e}(),hs="UpStreamMessage",ps="PushExtra",_s="DownStreamMessage",gs="DownStreamMessages",fs="SessionsAttQryInput",Es="SessionsAttOutput",Is="SyncRequestMsg",Ts="ChrmPullMsg",Rs="NotifyMsg",vs="HistoryMsgInput",Cs="HistoryMsgOuput",ys="RelationQryInput",Ss="RelationsOutput",ms="UnreadMsgInfo",As="DeleteSessionsInput",Ns="SessionInfo",Os="DeleteSessionsOutput",Ms="RelationDelBatchReq",Us="RelationOpInput",Ls="RelationsInput",Ps="DeleteMsgInput",bs="CleanHisMsgInput",Ds="CleanMsgBatchReq",ws="SessionMsgReadInput",Vs="ChrmInput",Gs="ChrmOutput",Bs="QueryChatRoomInfoInput",Fs="QueryChatRoomInfoOutput",ks="GetQNupTokenInput",xs="GetQNupTokenOutput",Hs="GetQNdownloadUrlInput",Ys="GetDownloadUrlInput",Ks="GetQNdownloadUrlOutput",qs="GetDownloadUrlOutput",js="ChrmKVEntity",Qs="SetChrmKV",Ws="SetChrmKVS",Js="DeleteChrmKVS",Xs="ChrmKVOutput",Zs="ChrmKVSOutput",zs="ChrmKVSVersionEntity",$s="ChrmKVSOutputEntity",ea="QueryChrmKV",ta="SetUserSettingInput",na="SetUserSettingOutput",ra="PullUserSettingInput",ia="PullUserSettingOutput",oa="UserSettingNotification",sa="SessionReq",aa="SessionStates",ua="SessionState",ca="SessionStateItem",la="SessionStateModifyReq",da="SessionStateModifyResp",ha="TypeUnpushInput",pa="TypeUnpushOutput",_a="GroupUnpushQuery",ga="GroupUnpushSet",fa="QryRemindListReq",Ea="QryRemindListResp",Ia="GroupUnpushResult",Ta="GrpReadReceiptMsg",Ra="GrpReadReceiptQryReq",va="GrpReadReceiptQryResp",Ca="GrpMsgReadUser",ya="SessionTagAddInput",Sa="SessionTagItem",ma="SessionTagDelInput",Aa="SessionDisTagReq",Na="ReportSDKInput",Oa="ReportSDKOutput",Ma="UltraGrpPullSes",Ua="UltraGrpPullMsg",La="MsgChangeReq",Pa="QueryMsgChange",ba="MsgChange",Da="MsgChangeList",wa="EventChange",Va="EventChangeList",Ga="MsgQuery",Ba="MessageQueryInfo",Fa="MsgQueryAck",ka="OperateStatus",xa="OperateStatusNotify",Ha="OperateInfo",Ya="OperateSummary",Ka="SetRtcRoomIdInput",qa="SetRtcRoomIdOutput",ja="CallInfoUpStream",Qa="CallInfoDownStream",Wa="KvInput",Ja="KvOutput",Xa="ReadReceiptMsg",Za="ReceiptQryReq",za="QueryReceiptResp",$a="ReceiptUser",eu="ReceiptCntQryReq",tu="ReceiptCntQryResp",nu="MsgReadCnt",ru="UpdateUserSubReq",iu="UserSubDetail",ou="UpdateUserSubResp",su="PUllUserSubResp",au="PullUserSubReq",uu="UserSubList",cu="PullSubDataReq",lu="PullSubDataResp",du="SubDataDetail",hu="SubData",pu="QrySubDataReq",_u="UserProfile",gu="ProfileInfo",fu="SetUserProfileResp",Eu="PullUserProfileReq",Iu="UserProfiles",Tu="UserProfileInput",Ru="UserProfilePermission",vu="UserProfileOutput",Cu="SearchUserProfile",yu="ChannelsInput",Su="ChannelBaseInfo",mu="ChannelsOutput",Au="MultiChannels",Nu="ModifyChannelsInput",Ou="QuitChannelsSetting",Mu="ChannelsQueryInput",Uu="ChannelsPageParam",Lu="ChannelsListResult",Pu="ChannelsUserInfo",bu="ChannelsUserExtInfo",Du="ChannelsMemberUpdateInput",wu="ChannelsJoinedInfo",Vu="ChannelsInviteStatusInfo",Gu="ChannelsMemberResponseInput",Bu="ChannelsMembersInput",Fu="ChannelsInviteStatusInfos",ku="ChannelsJoinedInfos",xu="ChannelsUserInfos",Hu="UpdateChannnelInfo",Yu="UpdateUserInfo",Ku="ChannelApplyInfo",qu="ChannelEventData",ju="FriendInput",Qu="FriendOutput",Wu="FriendsOutput",Ju="FriendsInput",Xu="FriendsCheckOutput",Zu="FriendCheckOutput",zu="FriendProfileInput",$u="FriendQueryInput",ec="FriendUserInfo",tc="FriendInviteInfo",nc="FriendsListInput",rc="FriendLevelSet",ic="FriendPageParam",oc="FriendUserInfos",sc="FriendInviteInfos",ac="FriendApplyEvent",uc="FriendRefuseEventData",cc="FriendUpdateEvent",lc="FriendTypeChangeEvent";(ls={})[hs]=["sessionId","classname","content","pushText","toUserIds","configFlag","clientUniqueId","appData","extraContent","pushExt","busChannel","systemId","senderPortrait","optionBits"],ls[gs]=["list","syncTime","finished","broadcastSyncTime"],ls[_s]=["fromUserId","type","groupId","classname","content","dataTime","status","msgId","extraContent","pushContent","configFlag","pushExt","busChannel","extStatus","toUserIds","groupUnpush","disableUpdateLastMsg"],ls[ps]=["title","templateIdNoUse","pushId","pushConfigs","templateId"],ls[fs]=["nothing"],ls[Es]=["inboxTime","sendboxTime","totalUnreadCount"],ls[Is]=["syncTime","ispolling","isweb","isPullSend","isKeeping","sendBoxSyncTime","broadcastSyncTime"],ls[Ts]=["syncTime","count"],ls[Rs]=["type","time","chrmId"],ls[vs]=["targetId","time","count","order","busChannel"],ls[Cs]=["list","syncTime","hasMsg"],ls[ys]=["type","count","startTime","order"],ls[Ss]=["info","isFinished"],ls[ms]=["msgId","msgTime","remindType","className"],ls[As]=["sessions"],ls[Ms]=["RelationOpInput"],ls[Us]=["conversationId","conversationType","busChannel"],ls[Ns]=["type","channelId","busChannel"],ls[Os]=["nothing"],ls[Ls]=["type","msg","count","busChannel","startTime","endTime"],ls[Ps]=["type","conversationId","msgs","busChannel"],ls[bs]=["targetId","dataTime","conversationType","busChannel"],ls[Ds]=["CleanHisMsgInput"],ls[ws]=["type","msgTime","channelId","busChannel"],ls[Vs]=["nothing","extra"],ls[Gs]=["nothing","sessionId","joinTime"],ls[Bs]=["count","order"],ls[Fs]=["userTotalNums","userInfos"],ls[ks]=["type","key","httpMethod","queryString","url","ext","size"],ls[Hs]=["type","key","fileName"],ls[Ys]=["type","key","fileName","ext"],ls[xs]=["deadline","token","bosToken","bosDate","path","osskeyId","ossPolicy","ossSign","ossBucketName"],ls[Ks]=["downloadUrl"],ls[qs]=["downloadUrl"],ls[js]=["key","value","status","timestamp","uid","version"],ls[Qs]=["entry","bNotify","notification","type"],ls[Ws]=["entry","bNotify","notification","type"],ls[Js]=["entry","bNotify","notification","type"],ls[Xs]=["entries","bFullUpdate","syncTime"],ls[Zs]=["timestamp","errorKeys","keysVersion"],ls[zs]=["version","key"],ls[$s]=["key","errorCode"],ls[ea]=["timestamp"],ls[ta]=["version","value"],ls[na]=["version","reserve"],ls[ra]=["version","reserve"],ls[ia]=["items","version"],ls.UserSettingItem=["targetId","type","key","value","version","status","tags"],ls[sa]=["time"],ls[aa]=["version","state"],ls[ua]=["type","channelId","time","stateItem","busChannel"],ls[ca]=["sessionStateType","value","tags"],ls[la]=["version","state"],ls[da]=["version"],ls[ha]=["type","version","unpushLevel"],ls[pa]=["version"],ls[ga]=["busChannel","unpushLevel"],ls[fa]=["groupId","busChannel","msgTime","size"],ls[_a]=["busChannel"],ls[Ia]=["groupId","busChannel","unpushLevel"],ls[Ta]=["msgId","busChannel"],ls[Ra]=["msgId","busChannel"],ls[va]=["totalMemberNum","list"],ls[Ca]=["readTime","userId"],ls[ya]=["version","tags"],ls[Sa]=["tagId","name","createdTime","isTop"],ls[ma]=["version","tags"],ls[Aa]=["tagId"],ls[oa]=["version","reserve"],ls[Na]=["sdkInfo"],ls[Oa]=["nothing"],ls[Ma]=["syncTime","isEraseMsgContent"],ls[Ua]=["syncTime"],ls[La]=["fromUserId","targetId","type","busChannel","msgUID","msgTime","content"],ls[Pa]=["syncTime","needCompress","onlineTime","targetId"],ls[Da]=["list","syncTime","hasNext"],ls[ba]=["targetId","type","time","changeType","msgUID","msgTime","busChannel","isAdmin","isDel","operatorId","subChangeType","busChannelType","isRemindMe","userGroupIds","remindType"],ls[Va]=["list","syncTime","hasNext"],ls[wa]=["targetId","type","time","changeType","msgUID","msgTime","busChannel","isAdmin","isDel","operatorId","subChangeType","busChannelType","isRemindMe","userGroupIds","remindType"],ls[Ga]=["targetId","type","query"],ls[Ba]=["msgTime","msgUID","busChannel"],ls[Fa]=["list"],ls[ka]=["targetId","type","opType","busChannel"],ls[xa]=["type","notifyType","info","summary"],ls[Ha]=["targetId","busChannel","userId","opType","optime"],ls[Ya]=["targetId","busChannel","count","opType"],ls[Ka]=["rtcRoomId"],ls[qa]=["nothing"],ls[Xa]=["targetId","type","busChannel","startMsgId","endMsgId"],ls[Za]=["msgId","busChannel","targetId"],ls[za]=["num","list"],ls[$a]=["receiptTime","userId"],ls[eu]=["type","channelId","busChannel","msgId"],ls[tu]=["result"],ls[nu]=["msgId","cnt","tmn"],ls[ru]=["subType","subUsers","opType","expiry"],ls[iu]=["subUserId"],ls[ou]=["subUsers","subTime"],ls[au]=["version","pageToken"],ls[su]=["list","version","hasNext","pageToken","isFull"],ls[uu]=["subUsers","subType","subTime","expiry","opType"],ls[cu]=["versionTime","needAllData","pageToken"],ls[lu]=["list","versionTime","hasNext","pageToken","isFull"],ls[du]=["statusStr","subUserId","data","subType"],ls[hu]=["platformInfo","value","versionTime"],ls[pu]=["subType","subUsers"],ls[_u]=["version","userId","userProfile","userExtProfile"],ls[gu]=["key","value"],ls[fu]=["version","key"],ls[Eu]=["userId"],ls[Iu]=["UserProfile"],ls[Tu]=["nothing"],ls[Ru]=["permission"],ls[vu]=["nothing"],ls[Cu]=["uniqueId"],ls[yu]=["targetId","type","baseInfo","extProfile","settingInfo","users","bindMsgInfo"],ls[Su]=["creatorId","ownerId","createTime","memberCount"],ls[mu]=["operateTime","flag","msg"],ls[Au]=["list"],ls[Nu]=["targetId","type","baseInfo","users","operateType"],ls[Ou]=["isQuit","isDelBan","isDelWhite","isDelAttention"],ls[Mu]=["targetId","type","page","ids","roleType"],ls[Uu]=["size","pageToken","hasNext","total","order"],ls[Lu]=["listType","result","page"],ls[Pu]=["userId","ext","opTime"],ls[bu]=["role","joinTime","channelNickName","additional"],ls[Du]=["targetId","type","userId","channelNickName","additional","operateType"],ls[wu]=["targetId","settingProfile","extProfile","baseInfo","userInfo"],ls[Vu]=["targetId","joinUserInfo","inviterInfo","status","directionType","joinType","detail","applyTime","processInfo","processTime"],ls[Gu]=["targetId","type","optType","optResult","invitedId","detail"],ls[Bu]=["targetId","type","userId"],ls[ju]=["targetId","type","info"],ls[Qu]=["userId","operateTime","flag"],ls[Wu]=["list"],ls[Ju]=["targetId","type"],ls[Xu]=["list"],ls[Zu]=["targetId","status"],ls[zu]=["targetId","remarkName","extProfile"],ls[$u]=["queryType","friendType","page"],ls[ec]=["userId","relationTime","friendType","flag","remarkName","name","portraitUrl","extProfile"],ls[tc]=["userId","name","portraitUrl","type","status","operateTime","info","friendType"],ls[nc]=["targetId","type"],ls[rc]=["level"],ls[Fu]=["list"],ls[ku]=["list"],ls[xu]=["list"],ls[ic]=["size","pageToken"],ls[oc]=["list"],ls[sc]=["list"],ls[ac]=["applyType","friendType","info","name","portraitUrl"],ls[uc]=["info"],ls[Hu]=["channelInfo","userInfo"],ls[Yu]=["updatedUserInfo","optUserInfo"],ls[Ku]=["statusInfo"],ls[qu]=["optUserInfo","channelInfo","userInfos"],ls[lc]=["friendId","friendType"],ls[cc]=["remarkname","extProfile"];var dc,hc="\npackage Modules;\nmessage probuf {\n message SetUserStatusOutput\n {\n optional int32 nothing=1;\n }\n\n message GetUserStatusInput\n {\n optional int32 nothing=1;\n }\n\n message GetUserStatusOutput\n {\n optional string status=1;\n optional string subUserId=2;\n }\n\n message SubUserStatusInput\n {\n repeated string userid =1;\n }\n\n message SubUserStatusOutput\n {\n optional int32 nothing=1;\n }\n message VoipDynamicInput\n {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n\n message VoipDynamicOutput\n {\n required string dynamicKey=1;\n }\n message "+Rs+" {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message "+Is+" {\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 }\n message "+hs+" {\n required int32 sessionId = 1;\n required string classname = 2;\n required bytes 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; // 系统会话消息时需填该字段为 targetId, 其他类型无需传\n optional string senderPortrait = 21; // 发送者的头像,由上行服务进行添加,客户端忽略此字段。\n optional int64 optionBits = 22; // 1、第一位 针对 sessionId 是需要存储的消息,不更新会话中的最后一条消息,默认为0 更新,是1 则不更新\n }\n message "+ps+" {\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 "+gs+" {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n }\n message "+_s+" {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required bytes 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; // 该消息所属会话的业务标识,限制20字符以内\n // 消息的扩展标记\n // 第0位,表示送达状态: 0x01 表示已送达;\n // 断档: 0x02 表示是否需要执行断档策略;\n // 消息修改: 0x04 拉取历史消息时表示该消息是否修改过\n // 0x08 每条消息携带的频道类型\n optional int64 extStatus = 20;\n repeated string toUserIds = 21; //指定接收者(限定群, 讨论组, 超级群)//增加聊天室定向成员\n optional int32 groupUnpush = 22; //群聊默认免打扰级别\n optional int64 optionBits = 23; // 1 第一位,针对 status 是需要存储的消息,不更新会话中的最后一条消息,默认为0更新,是1 则不更\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 = "+$.IMAGE+";\n audio = "+$.AUDIO+";\n video = "+$.VIDEO+";\n file = "+$.FILE+";\n sight = "+$.SIGHT+";\n html = "+$.COMBINE_HTML+";\n }\n message "+ks+" {\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; // url, sdk 设置下载地址\n optional string ext = 6; // 扩展字段,SDK 与 服务自定义字段,格式 json\n optional int64 size = 7; // 文件大小, 单位 KB\n }\n message "+Hs+" {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message "+Ys+" {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4; // 扩展字段,SDK 与 服务自定义字段,格式 json\n optional int64 size = 5; // 文件大小, 单位 KB\n }\n message "+xs+" {\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 optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\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 optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n // 兼容 minio 协议\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; // 下载鉴权信息,格式为 Json 格式\n }\n message "+Ks+" {\n required string downloadUrl = 1;\n }\n message "+qs+" {\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 "+Vs+" {\n required int32 nothing = 1;\n optional string extra = 2; //自定义扩展内容\n }\n message "+Gs+" {\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 "+Ts+" {\n required int64 syncTime = 1;\n required int32 count = 2;\n }\n\n message ChrmPullMsgNew\n {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message "+ys+"\n {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n }\n message "+Ls+"\n {\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 "+Ss+"\n {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;//是否结束\n }\n message RelationInfo\n {\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; // 0: 公有频道; 1: 私有频道;\n optional "+ms+" msgInfo = 10; // 新增 首条未读消息信息,可为空\n optional int32 remindMeCount = 11; //@ 我的未读数\n }\n message "+ms+" //未读消息摘要信息\n {\n required string msgId = 1; //消息唯一标示\n required int64 msgTime= 2;//消息时间\n optional int32 remindType= 3;//@类型。查询会话时无此字段。查询未读@列表时返回\n optional string className = 4; //消息类型\n }\n message "+fa+" // 新增 查询未读@列表入参\n {\n required string groupId = 1; // 群 ID\n optional string busChannel = 2; // 频道(channelId,可以为空)\n optional int64 msgTime = 3; // 消息时间戳\n optional int32 size = 4; // 单页长度,默认20,最大20\n }\n message "+Ea+" //查询未读@列表出参\n {\n repeated "+ms+" msgInfo = 1; //未读@消息摘要列表\n }\n message RelationInfoReadTime\n {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message "+bs+"\n {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4; //该消息所属会话的业务标识,限制20字符以内\n }\n message "+Ds+"\n {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput\n {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput\n {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n }\n message "+Bs+"\n {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message "+Fs+"\n {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember\n {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput\n {\n required string id = 1;\n }\n\n message MPFollowOutput\n {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput\n {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo\n {\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 {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput\n {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput\n {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput\n {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message "+vs+"\n {\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; //该消息所属会话的业务标识,限制20字符以内\n }\n\n message "+Cs+"\n {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n }\n message "+fs+"{\n required int32 nothing = 1;\n }\n message "+Es+"{\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message "+ws+"\n {\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 {\n optional int32 nothing=1;\n }\n message "+As+"\n {\n repeated SessionInfo sessions = 1;\n }\n message "+Ns+"\n {\n required ChannelType type = 1;\n required string channelId = 2;\n optional string busChannel = 3;//所属会话业务标识\n }\n message "+Os+"\n {\n optional int32 nothing=1;\n }\n message "+Ms+" \n {\n repeated RelationOpInput relation = 1;\n }\n message "+Us+"\n {\n required string conversationId = 1;//会话ID\n required ChannelType conversationType = 2;//会话类型,比如单聊、群等\n optional string busChannel = 3;//该消息所属会话的业务标识,限制20字符以内\n }\n message "+Ps+"\n {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4; //该消息所属会话的业务标识,限制20字符以内\n }\n message DeleteMsg\n {\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 "+Qs+" {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message "+Ws+" {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message "+Js+" {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message "+Xs+" {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message "+Zs+" {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message "+$s+"\n {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message "+ea+" {\n required int64 timestamp = 1;\n }\n message "+ta+" {\n required int64 version=1;\n required string value=2;\n }\n message "+na+" {\n required int64 version=1;\n required bool reserve=2;\n }\n message "+ra+" {\n required int64 version=1;\n optional bool reserve=2;\n }\n message "+ia+" {\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 "+sa+" {\n required int64 time = 1;\n }\n message "+aa+" {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message "+ua+" {\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 "+ca+" {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n }\n message "+la+" {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message "+_a+" {\n optional string busChannel = 1;\n }\n message "+ga+"{\n optional string busChannel = 1;\n required int32 unpushLevel = 2;\n }\n message "+Ia+" {\n required string groupId = 1;\n optional string busChannel = 2;\n required int32 unpushLevel = 3;\n }\n message "+da+" {\n required int64 version=1;\n }\n message "+ha+" {\n required ChannelType type = 1; // 会话类型\n required int64 version = 2;\n required int32 unpushLevel = 3; // 免打扰级别\n }\n message "+pa+" {\n required int64 version = 1;\n }\n message "+Ta+" {\n repeated string msgId=1; //已读消息ID\n optional string channelId = 2; // 该消息所属会话的业务标识\n }\n message "+Ra+" {\n repeated string msgId=1; //已读消息ID\n optional string channelId = 2; // 该消息所属会话的业务标识\n }\n message "+va+" {\n required int32 totalMemberNum = 1;//群内总人数\n repeated GrpMsgReadUser list = 2;//已读用户列表(list复类型)\n }\n message "+Ca+" {\n required int64 readTime = 1;//已读时间\n required string userId = 2;//已读用户id\n }\n message "+ya+" {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message "+Sa+" {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message "+ma+" {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message "+Aa+" {\n repeated string tagId=1;\n }\n message "+oa+" {\n required int64 version=1;\n required bool reserve=2;\n }\n message "+Na+' {\n required string sdkInfo=1; // 用户集成的 sdk 信息,json 格式 {"web-rtc": "4.0.3.7"}\n }\n message '+Oa+"\n {\n optional int32 nothing=1; //占位\n }\n message "+Ma+"\n {\n required int64 syncTime = 1;//同步时间戳\n optional bool isEraseMsgContent = 2;//拉取会话时,是否屏蔽掉消息内容\n }\n message "+Ua+"\n {\n required int64 syncTime = 1;//同步时间戳\n }\n message "+La+"\n {\n required string fromUserId = 1;//(谁发的)\n required string targetId = 2;// 目标Id(超级群Id)\n required ChannelType type = 3;//发送类型如:(P2P,GROUP,ULTRAGROUP)\n required string msgUID = 4; // 扩展消息的内容体\n required int64 msgTime = 5; //原始消息时间\n optional string busChannel = 6; // 该消息所属会话的业务标识,限制20字符以内\n optional string content = 7; // 即extraContent消息扩展内容,下表格说明\n }\n message "+Pa+" //查询入参\n {\n required int64 syncTime = 1;//同步时间戳\n optional int32 needCompress = 2;//是否压缩(暂时无效字段)\n optional int64 onlineTime = 3;//传递本次连接上线时间\n optional string targetId = 4;//资源ID(群ID),为空默认拉取全量数据。本期需求为空\n }\n message "+Va+" //应答结果\n {\n repeated EventChange list = 1; //变更列表(包含超级群相关数据、及本期数据,PB定义不变,仅字段名调整)\n required int64 syncTime = 2; //同步时间(用于下次同步入参)\n optional bool hasNext = 3 ;\n optional string targetId = 4;//群ID,为空默认拉取全量数据(值为入参字段)\n optional bool isCompress = 5 ; //数据是否压缩\n }\n message "+wa+" //变更详情\n {\n optional string businessId = 1; // 业务主ID(群Id/对方用户Id)\n optional ChannelType channelType = 2; // 会话类型\n optional int64 time = 3; // 变更时间\n optional int32 changeType = 4; // 变更类型(1:扩展,2:修改,3:撤回,4:频道变更,11:群组操作,12:群资料表更...)\n optional string originalId = 5; // 原始数据ID(例如:消息Id)(新版可为空,待测试旧SDK是否崩溃)\n optional int64 originalTime = 6; // 原始数据时间(例如:消息时间)\n optional string secondaryId = 7; // 业务子ID(例如:频道Id,新群主ID...)\n optional bool isAdmin = 8; //是否为管理员操作\n //额外标记(例如:是否删除消息,changeType==31是否双向好友,changeType==13 subChangeType=2 申请是否通过,changeType==32 申请是否同意)\n optional bool additionalMark = 9; \n optional string operatorId = 10; // 操作人Id\n // subChangeType 的意义由 changeType 的值来决定\n // 当 changeType 为 4 时;\n // 1: 删除频道;\n // 2: 公有频道变为私有频道;\n // 3: 私有频道变为公有频道;\n // 4: 私有频道成员变更-加入, SDK 不通知业务层;\n // 5: 私有频道成员变更-退出;\n // 6: 公有频道变为私有频道,当前用户不在白名单中;\n // 当 changeType 为 5 时;\n // 1: 删除用户组 (通知到 用户组下所有用户)\n // 2: 用户组增加用户 (仅通知到该用户)\n // 3: 用户组删除用户 (仅通知到该用户)\n // 4: 频道绑定用户组 (通知到 用户组下所有用户)\n // 5: 频道解绑用户组 (通知到 用户组下所有用户)\n optional int32 subChangeType = 11;\n optional int32 secondaryType = 12; //业务子ID类型标记(例如:频道公私有标记,申请回调类型(0申请 1拒绝))\n optional bool isRemindMe = 13;//是否仅自己相关(例如:是否为@我的消息)\n repeated string extIds = 14; //扩展ID列表(例如:用户组id列表, 当changeType==11 用户ID列表、管理员列表等等)\n optional int32 remindType = 15; //提醒范围(例如@类型:0非@消息,1@所有人消息,2@单人消息)\n optional bytes eventData = 16; //事件依赖的业务数据,包括群资料、群成员资料等,以byte[]形式返回 根据具体业务类型转为实际PB\n }\n message "+Da+" //应答结果\n {\n repeated MsgChange list = 1; //变更\n required int64 syncTime = 2; //同步时间(用于下次同步入参)\n optional bool hasNext = 3 ;\n }\n message "+ba+" //变更详情\n {\n required string targetId = 1; // 目标Id(超级群Id)\n required ChannelType type = 2; // 会话类型\n required int64 time = 3; // 变更时间\n required int32 changeType = 4; // 消息变更类型(1:扩展,2:修改,3:撤回,4:频道变更,5:用户组变更)\n required string msgUID = 5; // 消息ID\n required int64 msgTime = 6; // 消息时间\n optional string busChannel = 7; // 频道ID\n optional bool isAdmin = 8; //是否为管理员,默认为 0, 设为 1 时, IMKit 收到此条消息后,小灰条默认显示为“管理员 撤回了一条消息”。\n optional bool isDel = 9; //默认为 0 撤回该条消息同时,用户端将该条消息删除并替换为一条小灰条撤回提示消息;为 1 时,该条消息删除后,不替换为小灰条提示消息。\n optional string operatorId = 10; // 消息变更的操作人 Id; subChangeType 为 5 时,operatorId 表示被踢出超级群私有频道白名单的用户\n // subChangeType 的意义由 changeType 的值来决定\n // 当 changeType 为 4 时;\n // 1: 删除频道;\n // 2: 公有频道变为私有频道;\n // 3: 私有频道变为公有频道;\n // 4: 私有频道成员变更-加入, SDK 不通知业务层;\n // 5: 私有频道成员变更-退出;\n // 6: 公有频道变为私有频道,当前用户不在白名单中;\n // 当 changeType 为 5 时;\n // 1: 删除用户组 (通知到 用户组下所有用户)\n // 2: 用户组增加用户 (仅通知到该用户)\n // 3: 用户组删除用户 (仅通知到该用户)\n // 4: 频道绑定用户组 (通知到 用户组下所有用户)\n // 5: 频道解绑用户组 (通知到 用户组下所有用户)\n optional int32 subChangeType = 11;\n optional int32 busChannelType = 12; // 0:公有频道; 1:私有频道\n optional bool isRemindMe = 13;// 是否为@我的消息, 消息撤回时, 该字段有意义, 用于客户端计算是否未读数总数-1,未读@消息数-1 -- server 暂未支持\n repeated string userGroupIds = 14; //用户组id列表,用于用户组增删成员或频道绑定解绑用户组的通知中\n optional int32 remindType = 15; // @类型:0非@我消息,1@所有人消息,2@我单人的消息\n }\n message "+Ga+" //请求\n {\n required string targetId = 1; // 目标Id(超级群Id)\n required ChannelType type = 2; // 会话类型\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo\n {\n required int64 msgTime = 1; // 消息时间\n required string msgUID = 2; // 消息ID\n optional string busChannel = 3; // 频道ID\n }\n message "+Fa+" //应答\n {\n repeated DownStreamMessage list = 1;//消息\n }\n message "+ka+" //客户端发送\n {\n optional string targetId = 1;// targetId\n optional ChannelType type = 2;//发送会话类型如:(P2P,GROUP) \n optional int32 opType = 3; //0 , 正在输入, 1 正在XXX \n optional string busChannel = 4; // 频道(channelId,可以为空)\n }\n message "+xa+" //服务端发送\n {\n optional ChannelType type = 1;//发送会话类型如(P2P,GROUP) \n optional int64 notifyType = 2; //0x1 表示明细, 0x2 表示汇总 0x3 表示明细+汇总\n repeated OperateInfo info = 3 ; //明细列表 当notifyType 为 1和3时,有效\n repeated OperateSummary summary = 4 ; //汇总列表, 当notifyType 为2和3 时,有效\n }\n message "+Ha+" {\n // XX 正在做什么\n optional string targetId = 1; // 超级群Id 会话id\n optional string busChannel = 2; // 频道(channelId,可以为空)\n optional string userId = 3; // userId\n optional int32 opType = 4; //0 , 正在输入, 1 正在XX \n optional int64 optime = 5; //服务端收到用户操作的上行时间. \n }\n \n message "+Ya+" {\n // 几个人 正在干什么\n optional string targetId = 1; // 超级群Id 会话id\n optional string busChannel = 2; // 频道(channelId,可以为空)\n optional int32 count = 3; // 操作人数\n optional int32 opType = 4; //0, 正在输入, 1 正在XX \n }\n\n message "+Ka+"\n {\n required string rtcRoomId= 1; //rtc房间ID;\n }\n message "+qa+"\n {\n required int32 nothing = 1; //用于占位\n }\n message "+ja+"\n {\n required string key= 1; //业务方法关健字(如:ringCall)\n required string dataContent=2; //业务数据json字符串\n }\n message "+Qa+"\n {\n required string key= 1; //业务方法关健字(如:ringCall)\n required string dataContent=2; //业务数据json字符串\n required int64 maxTime=3;//时间戳,这个下行直发的时候带上\n }\n message "+Wa+"\n {\n required int64 syncTime = 1; //同步时间戳\n }\n message "+Ja+"\n {\n required int64 maxTime = 1; //最大时间戳\n repeated KvInfo info = 2; //kv对象\n }\n \n message KvInfo{\n required string key =1; //健名\n required string value =2; //健值\n }\n message "+Xa+"\n {\n required string targetId = 1;\n required ChannelType type = 2; //会话类型:单聊1、群聊3\n optional string busChannel = 3; //该消息所属会话的业务标识\n optional string startMsgId = 4; //已读消息ID区间开始(单聊极端场景下,无此属性或为空字符串)\n optional string endMsgId = 5; //已读消息ID区间结束(对应RC:RRMsg 中 endMsgId)\n }\n message "+Za+"\n {\n required string msgId = 1;//已读 消息ID \n optional string busChannel = 2; //该消息所属会话的业务标识\n required string targetId = 3; //群聊:群id\n }\n message "+za+"\n {\n optional int32 num = 1;// 群总人数\n repeated ReceiptUser list = 2;//已读用户列表(list复类型)\n optional int32 readCnt = 3; //已读人数\n }\n message "+$a+"\n {\n required int64 receiptTime = 1;//已读 时间。已做归并,SDK 向上层返回应最多只精确到分钟 \n required string userId = 2;//已读 用户id\n }\n message "+eu+"\n {\n optional ChannelType type = 1; //发送类型如:(GROUP)\n optional string channelId = 2; //会话id\n optional string busChannel = 3; //该消息所属会话的业务标识\n repeated string msgId = 4; //消息id列表\n }\n message "+tu+"\n {\n repeated MsgReadCnt result= 1; //已读状态列表\n }\n\n message "+nu+"\n {\n optional string msgId = 1; //消息id\n optional int32 cnt = 2; //已读人数\n optional int32 tmn = 3; //群人数\n }\n message "+ru+"\n {\n optional int32 subType = 1;//订阅类型(1:在线状态订阅,2:用户信息托管订阅)\n repeated UserSubDetail subUsers = 2;//订阅用户列表(单次请求最大 200)\n optional int32 opType = 3; //操作类型(0订阅(且自动过期,需携带订阅有效期),1 取消订阅)\n optional int32 expiry = 4; //订阅有效期(秒),默认 xx秒待产品定义\n }\n message "+iu+" {\n optional string subUserId = 1;//被订阅用户ID\n }\n message "+ou+" {\n repeated UserSubDetail subUsers = 1; //被订阅达到上限用户ID列表\n optional int64 subTime = 2;//订阅时间\n }\n message "+au+" {\n optional int64 version = 1;//用于增量拉取,卸载重装后使用0,后续使用 Resp.subTime\n optional string pageToken = 2;//用于分页,首页请求为空字符串,第二页及后续请求时 使用 Resp.pageToken\n }\n message "+su+" {\n repeated UserSubList list = 1;//订阅用户列表(单次请求最大 200)\n optional int64 version = 2;//数据版本时间(用于分页,返回后 用于SDK 请求下一页携带)\n optional bool hasNext = 3;//是否还有下一页\n optional string pageToken = 4; //分页Token(返回后 用于SDK 请求下一页携带)\n optional bool isFull = 5; // true->全量的数据; false 增量的数据\n }\n message "+uu+" {\n repeated UserSubDetail subUsers = 1;//被订阅用户ID列表\n optional int32 subType = 2;//订阅类型(1:在线状态订阅,2:用户信息托管订阅)\n optional int64 subTime = 3;//订阅时间\n optional int32 expiry = 4;// 订阅有效期(秒),默认 xx秒待产品定义\n optional int32 opType = 5;// 增量拉取时返回 操作类型(0主动订阅(且自动过期,需携带订阅有效期),1主动取消订阅)\n } \n message "+cu+" {\n optional int64 versionTime = 1; // 用于增量拉取,卸载重装后使用0,后续使用 Resp.versionTime\n optional bool needAllData = 2; // 是否查询全量订阅数据(初始化时 为 true,s_cmd触发增量拉取 为false)\n optional string pageToken = 3; // 用于分页,首页请求为空字符串,第二页及后续请求时 使用 Resp.pageToken\n }\n message "+lu+" {\n repeated SubDataDetail list = 1; //数据列表\n optional int64 versionTime = 2; //数据版本时间(用于分页)\n optional bool hasNext = 3; //是否还有下一页\n optional string pageToken = 4; //分页Token(返回后 用于SDK 请求下一页携带)\n optional bool isFull = 5; // true->全量的数据; false 增量的数据\n }\n message "+du+" {\n optional string statusStr = 1;//兼容旧版s_stat,字段废弃\n optional string subUserId = 2;//被订阅用户ID\n repeated SubData data = 3;// 订阅数据\n optional int32 subType = 4; //类型(1:在线状态订阅, 2:用户信息托管订阅)\n }\n\n message "+hu+" {\n optional int32 platformInfo = 1;//设备类型枚举值\n optional int32 value = 2;//具体数据(在线状态订阅表示:0离线,1上线)\n optional int64 versionTime = 3;//数据生成时间\n }\n message "+pu+" {\n optional int32 subType = 1;//订阅类型(1:在线状态订阅,2:用户信息托管订阅)\n repeated UserSubDetail subUsers = 2;//订阅用户列表(单次请求最大 200)\n }\n message "+_u+" {\n optional int64 version = 1;//用户版本号,设置时可以不传\n optional string userId = 2;//用户ID,设置时可不传\n repeated ProfileInfo userProfile = 3;//基本用户属性\n repeated ProfileInfo userExtProfile = 4;//扩展用户属性\n }\n message "+gu+" {\n optional string key = 1;//用户资料属性key\n optional string value = 2;//用户资料属性value\n }\n message "+fu+" {\n optional int64 version = 1;//生成的最新版本号\n optional string key = 2;//如果应答码失败的话,返回具体失败的key\n }\n message "+Eu+" {\n repeated string userId = 1;//用户Id\n }\n message "+Iu+" {\n repeated UserProfile UserProfile = 1;\n }\n message "+Tu+" {\n required int32 nothing = 1; //用于占位\n }\n message "+Ru+" {\n optional int32 permission = 1;//1:全部不可见,2:全部可见,3仅好友(暂不支持)\n }\n message "+vu+" {\n required int32 nothing = 1; //用于占位\n }\n message "+Cu+" {\n optional string uniqueId = 1;//用户应用号\n }\n\n // 用户信息托管-群组\n message "+yu+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n repeated ProfileInfo settingProfile = 3;//群设置属性(内置KV,Key见:ChannelSettingProfileKey)\n repeated ProfileInfo extProfile = 4;//扩展属性信息(自定义KV,最多可携带 10 个)\n optional ChannelBaseInfo baseInfo = 5;//群基础信息\n repeated string users = 6;//用户ID列表\n }\n\n message "+Su+" {\n optional string creatorId = 1;//创建者 ID\n optional string ownerId = 2;//群主 ID\n optional int64 createTime = 3;//群组创建时间\n optional int32 memberCount = 4;//当前群成员数\n }\n\n message "+mu+" {//托管 SDK 操作应答\n optional int64 operateTime = 1; //操作时间\n optional int32 flag = 2; //标记\n optional string msg = 3; //信息(name/portraitUrl/introduction...)\n optional int32 processCode = 4; //业务审批码(如果需要被邀请人同意,此码为25427)\n }\n\n message "+Au+" {\n optional ChannelType type = 1; // 会话类型\n repeated ChannelsInput list = 2; //群数组\n }\n\n message "+Nu+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n optional QuitChannelsSetting settingInfo = 3;//退出数据移除配置\n repeated string users = 4;//用户ID列表\n optional int32 operateType = 5; //操作类型\n }\n\n message "+Ou+" {\n optional bool isQuit = 1; //是否退出(踢出、退出接口,固定 true)\n optional bool isDelBan = 2; //是否同时移除群成员禁言状态\n optional bool isDelWhite = 3; //是否同时移除群禁言白名单\n optional bool isDelAttention = 4;//退出绑定数据移除配置\n }\n\n message "+Mu+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n optional ChannelsPageParam page = 3; //分页信息\n repeated string ids = 4; //id列表\n optional int32 roleType = 5; // 根据角色类型查成员信息(1:普通群成员,2:群管理员,3:群主,0全部)\n }\n\n message "+Uu+" {\n optional int32 size = 1; //本次请求条数\n optional string pageToken = 2; //分页标记(由服务端返回,请求第一页SDK传空)\n optional bool hasNext = 3 ;//是否还有下一页(由服务端返回)\n optional int32 total = 4 ;//总数据条数(群成员总数,由服务端返回)\n optional int32 order = 5 ;//查询顺序(0,正序,1,倒序)\n }\n\n message "+Lu+" {\n // listType=1,result=ChannelsUserInfos\n // listType=2,result=ChannelsInviteStatusInfos\n // listType=3,result=ChannelsJoinedInfos\n optional int32 listType = 1; // list数据类型\n optional bytes result = 2; //结果数组\n optional ChannelsPageParam page = 3; //分页信息\n }\n \n message "+Fu+" {\n repeated ChannelsInviteStatusInfo list = 1; //结果数组\n }\n \n message "+xu+" {\n repeated ChannelsUserInfo list = 1; //结果数组\n }\n \n message "+ku+" {\n repeated ChannelsJoinedInfo list = 1; //结果数组\n }\n\n message "+Pu+" {\n optional string userId = 1;//用户 ID\n optional ChannelsUserExtInfo ext = 2;//用户群信息\n optional int64 opTime = 3;//用户操作时间\n optional string name = 4;//昵称\n optional string portraitUrl = 5;//头像\n }\n\n message "+bu+" {\n optional int32 role = 1;//群身份(0:普通群成员,1:群管理员,2:群主)\n optional int64 joinTime = 2;//入群建时间\n optional string channelNickName = 3;//群昵称\n optional string additional = 4;//用户附加信息\n optional string remarkName = 5;//群备注名字\n }\n\n message "+Du+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n optional string userId = 3; //用户ID\n optional string channelNickName = 4;//群备注(hasValue==false 则移除)\n optional string additional = 5;//用户群附加信息\n optional int32 operateType = 6; //操作类型(1:添加,2:移除)\n }\n message "+wu+" {\n optional string targetId = 1; // 目标Id(群Id)\n repeated ProfileInfo settingProfile = 2;//群设置属性(内置KV)\n repeated ProfileInfo extProfile = 3;//扩展属性信息(自定义KV,最多可携带 10 个)\n optional ChannelBaseInfo baseInfo = 4;//群基础信息\n optional ChannelsUserExtInfo userInfo = 5;//用户群信息\n }\n message "+Vu+" {\n optional string targetId = 1;//群 ID\n optional ChannelsUserInfo joinUserInfo = 2;//用户 ID(被邀请进群ID或者自己主动申请加群的ID)\n optional ChannelsUserInfo inviterInfo = 3;//邀请人用户ID(申请加群模式此字段为空)\n optional int32 status = 4;//状态(0:待管理员处理 1:管理员拒绝 2:待用户处理 3:用户拒绝 4:已入群 5:已过期(客户端占位,服务器没有这个枚举))\n optional int32 directionType = 5;//类型(0: 发出的申请 1: 发出的邀请 2: 收到的邀请 3: 收到的申请 )\n optional int32 joinType = 6; // (0:自己申请进群, 1 被邀请进群)\n optional string detail = 7; //备注(拒绝原因)\n optional int64 applyTime = 8;//发起时间\n optional ChannelsUserInfo processInfo = 9;//审批操作Id\n optional int64 processTime = 10;//审批操作时间\n }\n message "+Gu+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n optional int32 optType = 3; //处理人操作类型(0:被邀请人操作,1:管理员操作)\n optional int32 optResult = 4; //处理人操作结果((0:拒绝,1:同意)\n optional string joinUserId = 5; //被邀请进群的用户id(type=0时可不填,即当前用户ID,也是入群ID))\n optional string inviterId = 6;//主动邀请人ID\n optional string detail = 7; //备注(拒绝原因)\n }\n message "+Bu+" {\n optional string targetId = 1; // 目标Id(群Id)\n optional ChannelType type = 2; // 会话类型\n repeated string userIds = 3; //用户ID列表(被邀请加入的用户列表)\n }\n message "+ju+" {\n optional string targetId = 1; // 目标Id(对方用户Id)\n optional int32 type = 2; // 操作类型(0:单向好友,1:双向好友)\n optional string info = 3;//附加信息\n }\n message "+Wu+" {//托管SDK操作应答\n repeated FriendOutput list = 1;\n }\n message "+Qu+" {//托管SDK操作应答\n optional string userId = 1; //好友id\n optional int64 operateTime = 2; //操作时间\n optional string flag = 3; //标记(服务端返回,好友状态标记)\n }\n message "+Ju+" {\n repeated string targetId = 1; // 目标Id列表(删除好友的用户Id列表)\n optional int32 type = 2; // 操作类型(1:删除单向好友,2:删除双向好友)\n }\n message "+Xu+" {\n repeated FriendCheckOutput list = 1;\n }\n\n message "+Zu+"{\n optional string targetId = 1;\n optional int32 status = 2;\n }\n message "+zu+" {\n optional string targetId = 1; // 目标Id(对方用户Id)\n optional string remarkName = 2;//好友备注名\n repeated ProfileInfo extProfile = 3;//扩展属性信息(最多可携带 10 个)\n }\n message "+$u+" {\n optional int32 queryType = 1; // 操作类型(1:好友请求列表,2:好友列表)\n optional ChannelsPageParam page = 2; //分页信息\n optional int32 friendType= 3; // 0:全部 1:单向好友 2:双向好友 (查询请求列表) \n }\n message "+ec+" {\n optional string userId = 1;//用户 ID\n optional int64 relationTime = 2;//成为好友时间\n optional int32 friendType = 3; // 类型(0:单向好友,1:双向好友)\n optional int32 flag = 4; //好友其他属性标记(位标记,第1位:是否在黑名单中,0不在,1在黑名单)\n optional string remarkName = 5;//好友备注名\n optional string name = 6;//昵称\n optional string portraitUrl = 7;//头像\n repeated ProfileInfo extProfile = 8;//扩展属性信息(最多可携带 10 个)\n \n }\n message "+tc+" {\n optional string userId = 1;//用户 ID\n optional string name = 2;//昵称\n optional string portraitUrl = 3;//头像\n optional int32 type = 4; // 类型(0:发送的好友申请,1:接收的好友申请)\n optional int32 status = 5; // 请求状态(0:发起,1:已同意,2:已拒绝)\n optional int64 operateTime = 6;//操作时间\n optional string info = 7;//附加信息\n optional int32 friendType = 8; // 好友类型(0:单向好友,1:双向好友)\n }\n message "+nc+" {\n repeated string targetId = 1; // 目标Id列表(删除好友的用户Id列表)\n optional int32 type = 2; // 操作类型(0:删除单向好友,1:删除双向好友)\n }\n message "+rc+" {\n optional int32 level = 1; // 1: 任何人可以加 2:需要认证 3: 不允许任何人添加\n }\n\n message "+ic+" {\n optional int32 size = 1; //本次请求条数\n optional string pageToken = 2; //分页标记(由服务端返回,请求第一页SDK传空) \n }\n message "+oc+" {\n repeated FriendUserInfo list = 1;\n }\n\n message "+sc+" {\n repeated FriendInviteInfo list = 1;\n }\n \n message "+ac+" {\n optional int32 applyType = 1;//申请类型(1:自己发起的请求,2:收到的好友请求)\n optional int32 friendType = 2;//好友类型(1:单向好友,2:双向好友)\n optional string info = 3;//申请信息\n optional string name = 4;//名称\n optional string portraitUrl = 5;//头像\n }\n message "+Hu+" {\n optional ChannelsJoinedInfo channelInfo = 1; //增量\n optional ChannelsUserInfo userInfo = 2;\n }\n message "+Yu+" {\n optional ChannelsUserInfo updatedUserInfo = 1; //被修改用户信息\n optional ChannelsUserInfo optUserInfo = 2;//操作用户信息\n }\n message "+Ku+" {\n repeated ChannelsInviteStatusInfo statusInfo = 1;//申请加群信息\n }\n message "+qu+" {\n optional ChannelsUserInfo optUserInfo = 1;//操作者ID\n optional ChannelsJoinedInfo channelInfo = 2;//群信息\n repeated ChannelsUserInfo userInfos = 3;//被操作用户(管理员,加群,退群成员等)\n }\n message "+lc+" {\n optional string friendId = 1;\n optional int32 friendType = 2; //类型(1:单向好友,2:双向好友)\n }\n message "+cc+" {\n optional string remarkname = 1;// \n repeated ProfileInfo extProfile = 2;//扩展属性信息(最多可携带 10 个)\n }\n}\n",pc=function(e,t,n,r,i,o){var s=i?Object.keys(i).map((function(t){return e.encode(_r.RtcValueInfo,{key:t,value:i[t]},!0)})):void 0,a=o?Object.keys(o).map((function(t){return e.encode(_r.RtcValueInfo,{key:t,value:o[t]},!0)})):void 0;return e.encode(_r.RtcInput,{roomType:t,broadcastType:n,joinType:r,innerDatas:s,outerDatas:a})},_c=function(e,t){var n=e.decode(_r.RtcUserListOutput,t),r=n.users,i=n.token,o=n.sessionId,s=n.roomInfo,a=n.entries,u=n.offlineKickTime,c={};return gr(r,(function(e){var t=e.userId,n=e.userData,r={};gr(n,(function(e){var t=e.key,n=e.value;r[t]=n})),c[t]=r})),{users:c,token:i,sessionId:o,roomInfo:s,kvEntries:a,offlineKickTime:u}};!function(e){e[e.STATISTICS=-2]="STATISTICS",e[e.RECORD=-1]="RECORD",e[e.FATAL=0]="FATAL",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG"}(dc||(dc={}));var gc=function(e){return[dc.DEBUG,dc.INFO,dc.WARN,dc.ERROR].some((function(t){return t===e}))},fc=0,Ec=function(){function e(e,t,n){this._appkey=e,this._id=t,this._type=n,this.outputLevel=dc.WARN,this.debug=this._log.bind(this,dc.DEBUG),this.info=this._log.bind(this,dc.INFO),this.warn=this._log.bind(this,dc.WARN),this.error=this._log.bind(this,dc.ERROR),this.__statistics=this._log.bind(this,dc.STATISTICS)}return e.prototype._stdout=function(e,t,n,r,i){var o;if(!(e<=dc.FATAL)&&console&&!(e>this.outputLevel)){var s=["error","warn","info","debug"][e-1];null===(o=console)||void 0===o||o[s](n+"["+this._id+"]["+s.toUpperCase()+"]: "+t+" | "+r+" | "+i)}},e.prototype.setOutputLevel=function(e){gc(e)&&(this.outputLevel=e)},e.prototype._log=function(e,t,n,r){var i=new Date;/^[\w-]+$/.test(t)?(this._stdout(e,t,i.toISOString(),n,r),e!==dc.DEBUG&&this.flush({time:+i,sessionId:In,type:this._type,loggerId:this._id,tag:t,level:e,content:n,traceId:r})):this._stdout(dc.ERROR,"L_LOG_TAG_INVALID_E",i.toISOString(),t,r)},e.prototype.createTraceId=function(){return""+ ++fc},e.prototype.getSessionId=function(){return In},e}(),Ic=null,Tc="RC_LOGS",Rc="RC_CONF",vc=null,Cc=function(e){return a(void 0,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,Ic];case 1:return(t=n.sent())?[4,new Promise((function(n){var r=t.db.transaction(Tc,"readwrite").objectStore(Tc).index("time"),i=IDBKeyRange.upperBound(Date.now()-e),o=r.openCursor(i);o.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},o.onerror=function(){n()}}))]:[2];case 2:return n.sent(),vc=setTimeout((function(){return Cc(e)}),6e5),[2]}}))}))},yc=function(e,t,n,r){void 0===r&&(r=168),Ic||(Mr(n)?Ic=new Promise((function(n){var i=window.indexedDB;Ur();var o="RC_LOGS_"+e,s=i.open(o,1);s.onerror=function(e){t.error(Re.L_LOGDB_OPEN_FAILED_E,e.target.error),n(null)},s.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){Ic=null,t.warn(Re.L_LOGDB_CLOSED_S)},o.onerror=function(e){Ic=null,t.error(Re.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(Re.L_LOGDB_ABORT_S,e.target.error)},Cc(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;t.objectStoreNames.contains(Tc)&&t.deleteObjectStore(Tc);var n=t.createObjectStore(Tc,{autoIncrement:!0});n.createIndex("level","level",{unique:!1}),n.createIndex("time","time",{unique:!1}),t.objectStoreNames.contains(Rc)&&t.deleteObjectStore(Rc),(n=t.createObjectStore(Rc,{keyPath:"key"})).createIndex("key","key",{unique:!0})}})):t.warn(Re.L_UNSUPPORT_INDEXDB_O))},Sc=[],mc=function(){return a(void 0,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return Ic?(vc&&(clearTimeout(vc),vc=null),[4,Ic]):[2];case 1:return(e=n.sent())&&(t=e.db,Sc.push(t)),Ic=null,[2]}}))}))},Ac=[],Nc=!1,Oc=function(e){return a(void 0,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return Nc||0===Ac.length?[2]:(Nc=!0,t=Ac.splice(0),[4,new Promise((function(n){var r=e.transaction(Tc,"readwrite");r.oncomplete=n,r.onabort=n;var i=r.objectStore(Tc);t.forEach((function(e){try{i.add(e)}catch(t){null===console||void 0===console||console.error("write log failed ->",e)}}))}))]);case 1:return n.sent(),Nc=!1,0===Ac.length&&Sc.length>0&&(Sc.forEach((function(e){return e.close()})),Sc.length=0),setTimeout((function(){return Oc(e)})),[2]}}))}))};function Mc(e){return a(this,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,Ic];case 1:return(t=n.sent())?[2,new Promise((function(n){var r=t.db.transaction(Rc,"readonly").objectStore(Rc).get(e);r.onsuccess=function(e){var t;n({value:null===(t=r.result)||void 0===t?void 0:t.value,success:!0})},r.onerror=function(e){n({success:!1})}}))]:[2,{success:!1}]}}))}))}var Uc,Lc,Pc,bc,Dc=0,wc=function(){return{setTimestamp4RealtimeLog:function(e){Dc=e},getTimestamp4RealtimeLog:function(){return Dc},getLogs:function(e,t,n,r){return a(this,void 0,void 0,(function(){var i;return u(this,(function(o){switch(o.label){case 0:return[4,Ic];case 1:return(i=o.sent())?[2,new Promise((function(o){var s=i.db.transaction(Tc,"readonly").objectStore(Tc),a=[],u=IDBKeyRange.bound(e,t),c=s.index("time").openCursor(u);c.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=n&&(r?i.sessionId===In:i.level>=0)&&a.push(i),t.continue()}else o({dbReady:!0,logs:a})},c.onerror=function(e){o({dbReady:!1,logs:[]})}}))]:[2,{dbReady:!1,logs:[]}]}}))}))}}},Vc="REPORT_SESSION",Gc=function(e,t){return a(void 0,void 0,void 0,(function(){var n,r,i,o;return u(this,(function(s){switch(s.label){case 0:return n=Vc+"_"+e,[4,Mc(Vc+"_"+e)];case 1:return r=s.sent(),i=r.success,o=r.value,i?(t===(null==o?void 0:o.sessionId)||function(e,t){a(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return[4,Ic];case 1:return(n=i.sent())?(r=n.db,r.transaction(Rc,"readwrite").objectStore(Rc).put({key:e,value:t}),[2,!0]):[2,!1]}}))}))}(n,{sessionId:t}),[2]):[2]}}))}))},Bc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.flush=function(e){!function(e){a(void 0,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,Ic];case 1:if(!(t=n.sent()))return[2];if(e.content&&Ft(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return Ac.push(e),Oc(t.db),[2]}}))}))}(e)},t}(Ec),Fc=function(){function e(e,t,n,r,i,o){void 0===o&&(o=!1),this.appkey=e,this.deviceId=t,this.deviceInfo=n,this.logDB=r,this.logger=i,this.disableLogReport=o,this.userId="",this.timer=null,this.started=!1,this.reportFailedNumber=0,this.itvByNavi=6,this.timesByNavi=5}return e.prototype.checkStart=function(e){return a(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(i){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(t=Ci.getLogUrlPolicyList(e,this.logger),n=t.policy,r=t.addrs,this.started=!0,this.itvByNavi=n.itv,this.timesByNavi=n.times,r.length>0&&this.realtimeReport(r[0].addr,n.level,n.itv)),[2])}))}))},e.prototype._sendLogs2Realtime=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,o,s,a,c,l,d,h,p,_,g;return u(this,(function(u){switch(u.label){case 0:return this.logger.debug(Re.L_REALTIME_LOG_O,JSON.stringify({count:e.length}),t),i=r,[4,this.compressLogs(e)];case 1:return a=u.sent(),c=a.success,l=a.data,c||this.logger.warn(Re.L_REALTIME_LOG_O,"compress failed",t),this.logger.debug(Re.L_REALTIME_LOG_O,"compress done",t),d=$t(n)?n:"https://"+n,d+="?version=5.12.2&appkey="+this.appkey+"&userId="+encodeURIComponent(this.userId)+"&deviceId="+this.deviceId+"&deviceInfo="+this.deviceInfo+"&platform=Web",[4,this.send({url:d,body:l,method:"POST"})];case 2:if(h=u.sent(),p=h.status,_=h.data,this.logger.debug(Re.L_REALTIME_LOG_R,JSON.stringify({status:p,data:_}),t),200===p){if(this.reportFailedNumber=0,_)try{(g=JSON.parse(_)).nextTime&&(i=g.nextTime),o=g.level,s=g.logSwitch}catch(e){this.logger.warn(Re.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}this.logDB.setTimestamp4RealtimeLog(e[e.length-1].time+1)}else this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(i+=i),this.reportFailedNumber++;return[2,{itv:i,level:o,logSwitch:s}]}}))}))},e.prototype.realtimeReport=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a,c,l,d,h,p,_,g=this;return u(this,(function(u){switch(u.label){case 0:return r=Date.now(),i=this.logDB.getTimestamp4RealtimeLog()||Tn,o=Math.max(r-5e3,i),s=this.logger.createTraceId(),this.logger.debug(Re.L_REALTIME_LOG_T,JSON.stringify({startTime:i,endTime:o,level:t,itv:n}),s),[4,this.logDB.getLogs(i,o,t,!0)];case 1:return a=u.sent(),c=a.dbReady,l=a.logs,c?[3,2]:(this.logger.warn(Re.L_REALTIME_LOG_R,"db error",s),[3,4]);case 2:return l.length>0?[4,this._sendLogs2Realtime(l,s,e,n)]:[3,4];case 3:if(d=u.sent(),h=d.itv,p=d.level,_=d.logSwitch,n=h,void 0!==p&&(t=p),0===_)return[2];u.label=4;case 4:return this.started&&(this.timer&&clearTimeout(this.timer),n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return g.realtimeReport(e,t,n)}),1e3*n)),[2]}}))}))},e.prototype.report=function(e,t,n,r,i,o,s){return void 0===s&&(s=!1),a(this,void 0,void 0,(function(){var a,c,l,d,h,p,_,g,f,E;return u(this,(function(u){switch(u.label){case 0:return"web"!==n.toLowerCase()||this.disableLogReport?[2]:(a=this.logger.createTraceId(),this.logger.info(Re.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:o,isCloudControl:s}),a),[4,this.logDB.getLogs(e,t,dc.DEBUG,!1)]);case 1:return c=u.sent(),l=c.dbReady,d=c.logs,this.logger.info(Re.L_REPORT_FULL_LOG_O,JSON.stringify({count:d.length}),a),h=$t(r)?r:"https://"+r,h+="?version=5.12.2&appkey="+this.appkey+"&userId="+encodeURIComponent(this.userId)+"&deviceId="+this.deviceId+"&deviceInfo="+this.deviceInfo+"&platform=Web&logId="+i,l?d.length>0?[4,this.compressLogs(d)]:[3,3]:[3,5];case 2:return _=u.sent(),g=_.success,f=_.data,p=g?f:"compress failed",[3,4];case 3:p="no data",u.label=4;case 4:return[3,6];case 5:p="no database",u.label=6;case 6:return this.logger.debug(Re.L_REPORT_FULL_LOG_O,"compress done",a),s&&(h+="&source=cloud"),[4,this.send({url:h,body:p,method:"POST"})];case 7:return E=u.sent().status,this.logger.info(Re.L_REPORT_FULL_LOG_R,JSON.stringify({status:E}),a),[2]}}))}))},e.prototype.stop=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1},e}(),kc=48,xc=64,Hc=80,Yc=96,Kc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",qc=function(e){for(var t={},n=0;n<e.length-1;n++){var r=e.charAt(n)+e.charAt(n+1);t.hasOwnProperty(r)?t[r].push(n):t[r]=[n]}for(var i=[],o=[],s=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=Qc(e.length),n=String.fromCharCode(Hc|t.length);i.push(n+t)}else{var r=String.fromCharCode(Yc|e.length);i.push(r)}i.push(e)}},a=0;a<e.length;){var u=jc(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 c=Qc(a-u.offset),l=Qc(u.length);if(c.length+l.length>=u.length)o.push(e.substr(a,u.length)),a+=u.length;else{s();var d=String.fromCharCode(xc|c.length<<2|l.length);i.push(d+c+l),a+=u.length}}}s();var h=Qc(e.length),p=String.fromCharCode(kc|h.length);return i.push(p+h),i.join("")},jc=function(e,t,n){var r={length:0,offset:-1};if(t.length,n>=t.length-1)return r;var i=e[t.charAt(n)+t.charAt(n+1)];if(i[0]===n)return r;for(var o=t.length-n,s=0,a=i.length;s<a;s++){var u=i[s],c=n-u;if(!(c>238327)){var l=Math.min(o,c);if(l<=r.length)break;if(!(r.length>2&&t.charAt(u+r.length-1)!==t.charAt(n+r.length-1))){for(var d=2,h=d;h<l&&t.charAt(u+h)===t.charAt(n+h);h++)d++;d>=r.length&&(r.length=d,r.offset=u)}}}return r},Qc=function(e){var t=[],n=0;do{n=e%62,t.push(Kc.charAt(n)),e=(e-n)/62}while(e>0);return t.join("")},Wc=function(e){if("browser"!==e.tag)return{type:e.tag,version:"UnKonw"};var t,n,r=navigator.userAgent,i={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 o in i)if(i.hasOwnProperty(o)){var s=r.match(i[o]);if(s){n=o,t=s[1]||s[2];break}}return{type:n||"UnKonw",version:t||"UnKonw"}},Jc=function(e){var t=e.sessionId,n=e.level,r=e.loggerId,i=e.traceId,o=e.time,s=e.tag,a=e.type,u=e.content;Ft(u)||(u=JSON.stringify(u));var c=n<0?u||"":JSON.stringify({content:u,traceId:i,from:r});return t+","+o+","+a+","+n+","+s+","+(c='"'+c.replace(/"/g,'""')+'"')+"\n"},Xc=function(e){function t(t,n,r,i){var o=this,s=Rn(n),a=Wc(n),u=a.type+"|"+a.version+"|"+r.getSessionId();return(o=e.call(this,t,s,u,wc(),r)||this).runtime=n,o.clientReportLevel=i,gc(o.clientReportLevel)||(o.clientReportLevel=void 0),o}return r(t,e),t.prototype.send=function(e){return this.runtime.httpReq(e)},t.prototype.checkStart=function(t){return a(this,void 0,void 0,(function(){return u(this,(function(n){switch(n.label){case 0:return[4,Gc(t.userId,this.logger.getSessionId())];case 1:return n.sent(),[2,e.prototype.checkStart.call(this,t)]}}))}))},t.prototype.compressLogs=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,{success:!0,data:qc(e.map(Jc).join(""))}]}))}))},t.prototype.isReporter=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,(t=this.userId,n=this.logger.getSessionId(),a(void 0,void 0,void 0,(function(){var e,r,i;return u(this,(function(o){switch(o.label){case 0:return[4,Mc(Vc+"_"+t)];case 1:return e=o.sent(),r=e.success,i=e.value,[2,r&&(null==i?void 0:i.sessionId)===n]}}))})))];case 1:return[2,e.sent()]}var t,n}))}))},t.prototype.report=function(t,n,r,i,o,s,c){return void 0===c&&(c=!1),a(this,void 0,void 0,(function(){var a;return u(this,(function(u){switch(u.label){case 0:return[4,this.isReporter()];case 1:return a=u.sent(),this.userId&&!a?[2]:[2,e.prototype.report.call(this,t,n,r,i,o,s,c)]}}))}))},t.prototype.realtimeReport=function(t,n,r){return a(this,void 0,void 0,(function(){return u(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,n,r)]}))}))},t}(Fc);!function(e){e[e.ACCEPTED=0]="ACCEPTED",e[e.UNACCEPTABLE_PROTOCOL_VERSION=1]="UNACCEPTABLE_PROTOCOL_VERSION",e[e.IDENTIFIER_REJECTED=2]="IDENTIFIER_REJECTED",e[e.SERVER_UNAVAILABLE=3]="SERVER_UNAVAILABLE",e[e.TOKEN_INCORRECT=4]="TOKEN_INCORRECT",e[e.NOT_AUTHORIZED=5]="NOT_AUTHORIZED",e[e.REDIRECT=6]="REDIRECT",e[e.PACKAGE_ERROR=7]="PACKAGE_ERROR",e[e.APP_BLOCK_OR_DELETE=8]="APP_BLOCK_OR_DELETE",e[e.BLOCK=9]="BLOCK",e[e.TOKEN_EXPIRE=10]="TOKEN_EXPIRE",e[e.DEVICE_ERROR=11]="DEVICE_ERROR",e[e.HOSTNAME_ERROR=12]="HOSTNAME_ERROR",e[e.HASOHTERSAMECLIENTONLINE=13]="HASOHTERSAMECLIENTONLINE",e[e.OUT_OF_LIMIT=14]="OUT_OF_LIMIT",e[e.IN_OTHER_CLUSTER=15]="IN_OTHER_CLUSTER",e[e.APP_AUTH_NOT_PASS=16]="APP_AUTH_NOT_PASS",e[e.OTP_USED=17]="OTP_USED",e[e.PLATFORM_ERROR=18]="PLATFORM_ERROR",e[e.ACCOUNT_CANCELLATION=19]="ACCOUNT_CANCELLATION",e[e.LICENSE_EXPIRED=20]="LICENSE_EXPIRED"}(Uc||(Uc={})),function(e){e[e.OTHER_DEVICE_LOGIN=1]="OTHER_DEVICE_LOGIN",e[e.BLOCK=2]="BLOCK",e[e.BLOCK_NEW=5]="BLOCK_NEW",e[e.REDIRECT_NEW=6]="REDIRECT_NEW",e[e.TOKEN_EXPIRED=7]="TOKEN_EXPIRED",e[e.ILLEGAL_PROTOCOL_VERSION=8]="ILLEGAL_PROTOCOL_VERSION",e[e.ACCOUNT_CANCELLATION=9]="ACCOUNT_CANCELLATION"}(Lc||(Lc={}));var Zc,zc=((Pc={})[Lc.OTHER_DEVICE_LOGIN]=re.RC_DISCONN_KICK,Pc[Lc.BLOCK]=re.RC_DISCONN_EXCEPTION,Pc[Lc.BLOCK_NEW]=re.RC_DISCONN_EXCEPTION,Pc[Lc.REDIRECT_NEW]=re.RC_CONN_REDIRECTED,Pc[Lc.TOKEN_EXPIRED]=re.RC_CONN_TOKEN_EXPIRED,Pc[Lc.ILLEGAL_PROTOCOL_VERSION]=re.RC_CONN_PROTO_VERSION_ERROR,Pc[Lc.ACCOUNT_CANCELLATION]=re.RC_ACCOUNT_CANCELLATION,Pc),$c=((bc={})[Uc.ACCEPTED]=re.SUCCESS,bc[Uc.UNACCEPTABLE_PROTOCOL_VERSION]=re.RC_CONN_PROTO_VERSION_ERROR,bc[Uc.IDENTIFIER_REJECTED]=re.RC_CONN_IDENTIFIER_REJECTED,bc[Uc.SERVER_UNAVAILABLE]=re.RC_CONN_SERVER_UNAVAILABLE,bc[Uc.TOKEN_INCORRECT]=re.RC_CONN_TOKEN_INCORRECT,bc[Uc.NOT_AUTHORIZED]=re.RC_CONN_NOT_AUTHRORIZED,bc[Uc.REDIRECT]=re.RC_CONN_REDIRECTED,bc[Uc.PACKAGE_ERROR]=re.RC_CONN_PACKAGE_NAME_INVALID,bc[Uc.APP_BLOCK_OR_DELETE]=re.RC_CONN_APP_BLOCKED_OR_DELETED,bc[Uc.BLOCK]=re.RC_CONN_USER_BLOCKED,bc[Uc.TOKEN_EXPIRE]=re.RC_CONN_TOKEN_EXPIRED,bc[Uc.DEVICE_ERROR]=re.RC_CONN_DEVICE_ERROR,bc[Uc.HOSTNAME_ERROR]=re.RC_CONN_HOSTNAME_ERROR,bc[Uc.HASOHTERSAMECLIENTONLINE]=re.RC_DISCONN_SAME_CLIENT_ON_LINE,bc[Uc.OUT_OF_LIMIT]=re.RC_LISCENSE_COUNT_OUT_OF_LIMIT,bc[Uc.IN_OTHER_CLUSTER]=re.RC_CONN_WRONG_CLUSTER,bc[Uc.APP_AUTH_NOT_PASS]=re.RC_APP_AUTH_NOT_PASS,bc[Uc.OTP_USED]=re.RC_OTP_USED,bc[Uc.PLATFORM_ERROR]=re.RC_PLATFORM_ERROR,bc[Uc.ACCOUNT_CANCELLATION]=re.RC_ACCOUNT_CANCELLATION,bc[Uc.LICENSE_EXPIRED]=re.RC_LICENSE_EXPIRED,bc),el=function(e){return e===re.RC_CONN_REDIRECTED},tl=function(e){return Object.keys(zc).some((function(t){return zc[t]===e}))},nl=function(e){return Object.keys($c).some((function(t){return $c[t]===e}))};!function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(Zc||(Zc={}));var rl,il,ol=function(){function e(e,t,n,r,i){this.appkey=e,this.navi=t,this.logger=n,this.statisticLog=r,this.listener=i,this.token="",this.curCmpUrl="",this.reconnectKick=!1,this._connectDurSwitch=!1,this.retryCount=0,this.uuid="",this.reason=0,this.connectedTime=0,this._network={status:!0,type:ur.UNKONWN},this._checkAliveTimer=null,this._crtConnectionStatus=Zc.DISCONNECTED,this._crtUserId="",this._openCallPlus=!1,this._crtConnectionTask=null,this.reconnectTimer=null,this._failedCount=0,this.ALLOW_FAILED_TIMES=2}return e.prototype.getToken=function(){return this.token},e.prototype.getCurrentUserId=function(){return this._crtUserId},e.prototype.setConnectionStatus=function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus=e,this._connectDurSwitch&&e!==Zc.CONNECTED&&e!==Zc.CONNECTING){var n={bid:rr(),cod:t,net:this.getNetwork().type,dur:Date.now()-this.connectedTime,cid:this.uuid+"_"+this.retryCount};this.statisticLog.record(ve.IM_CONNECTION_DURATION,JSON.stringify(n)),this._connectDurSwitch=!1}switch(e){case Zc.CONNECTED:this.logger.info(Re.L_CONNECT_S,e),this.checkAlive(),this.listener.onConnected();break;case Zc.CONNECTING:this.logger.warn(Re.L_CONNECT_S,"status: "+e+", code: "+t),this.listener.onConnecting();break;case Zc.SUSPENDED:this.logger.warn(Re.L_CONNECT_S,"status: "+e+", code: "+t),el(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),this.listener.onSuspend(t);break;default:this.logger.warn(Re.L_CONNECT_S,"status: "+e+", code: "+t),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),this.listener.onDisconnected(t)}}},e.prototype.getConnectionStatus=function(){return this._crtConnectionStatus},e.prototype.setNetwork=function(e,t){if(!t){var n={cid:this.uuid+"_"+this.retryCount,cn:e.type,on:this._network.type};this.statisticLog.record(ve.IM_NETWORK_CHANGE,JSON.stringify(n))}this._network=e},e.prototype.getNetwork=function(){return this._network},e.prototype.connect=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return this._crtConnectionStatus===Zc.CONNECTED?[2,{code:re.SUCCESS,data:this._crtUserId}]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=n,this.retryCount=0,this.uuid=fn(),this.token=e,this.reconnectKick=t,this.setConnectionStatus(Zc.CONNECTING),i={cid:this.uuid+"_"+this.retryCount,reason:$e.CONNECT,net:this.getNetwork().type,spr:0},this.statisticLog.record(ve.IM_STATS_CS,JSON.stringify(i),r),[4,this.try2Connect(e,t,!1,r,!0)]);case 1:return o=u.sent(),s=o.code,a=o.data,s!==re.SUCCESS?(this.setConnectionStatus(Zc.DISCONNECTED,s),[2,{code:s}]):(this.setConnectionStatus(Zc.CONNECTED),[2,{code:s,data:a}])}}))}))},e.prototype.try2Connect=function(e,t,n,r,i){return a(this,void 0,void 0,(function(){var o,s,a;return u(this,(function(u){switch(u.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,n,r,i),[4,this._crtConnectionTask]);case 1:return o=u.sent(),s=o.code,a=o.data,this._crtConnectionTask=null,[2,{code:s,data:a}]}}))}))},e.prototype.createConnectionTask=function(e,t,n,r,i){return a(this,void 0,void 0,(function(){var o,s,a,c,l,d,h,p,_;return u(this,(function(u){switch(u.label){case 0:return o={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this.reason},[4,this.navi.request(e,n,!1,r,o)];case 1:return s=u.sent(),a=s.code,c=s.data,a!==re.SUCCESS?[2,{code:a}]:1===(l=c).type?[2,{code:re.PACKAGE_ENVIRONMENT_ERROR}]:(this.logger.info(Re.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,this.connectWithToken(e.replace(/@.+$/,"@"),l,t,r)]);case 2:return d=u.sent(),h=d.code,p=d.data,el(h)?(this.logger.warn(Re.L_CONNECT_R,"redirect code: "+h,r),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,r,i)]):[re.RC_TCP_RESET,re.RC_CONN_ACK_TIMEOUT,re.RC_TCP_DISCONNECTED_NO_RMTP].includes(h)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),_=this.cmpWeightCache.every((function(e){return e.failed})),i&&_?(this.logger.warn(Re.L_CONNECT_R,"cpp code:"+h+",reture code:"+re.SERVER_UNAVAILABLE,r),[2,{code:re.SERVER_UNAVAILABLE}]):(this.logger.warn(Re.L_CONNECT_R,"cmp ack timeout, code: "+h,r),this.setConnectionStatus(Zc.SUSPENDED,h),this.setConnectionStatus(Zc.CONNECTING),[2,this.createConnectionTask(e,t,!1,r,i)])):h!==re.SUCCESS?(this.logger.warn(Re.L_CONNECT_R,"code: "+h,r),[2,{code:h}]):(this.logger.info(Re.L_CONNECT_R,"userId: "+p,r),this._connectDurSwitch=!0,this._crtUserId=p,[2,{code:h,data:p}])}}))}))},e.prototype.setReconnectReason=function(e){switch(e){case re.TIMEOUT:return void(this.reason=$e.TIMEOUT);case re.RC_CONN_REDIRECTED:return void(this.reason=$e.REDIRECTED);default:this.reason=$e.RECONNECT}},e.prototype.try2Reconnect=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i=this;return u(this,(function(o){return n=this.logger.createTraceId(),this.logger.debug(Re.T,"try2Reconnect -> ignoreNaviCache: "+e+", reason: "+t,n),this.stopReconnectTimer(),r=function(){return a(i,void 0,void 0,(function(){var i,o;return u(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==Zc.SUSPENDED?[2]:(this.setConnectionStatus(Zc.CONNECTING,t),this.setReconnectReason(t),this.retryCount+=1,i={cid:this.uuid+"_"+this.retryCount,reason:this.reason,net:this.getNetwork().type,spr:0},this.statisticLog.record(ve.IM_STATS_CS,JSON.stringify(i)),[4,this.try2Connect(this.token,!0,e,n,!1)]);case 1:return o=s.sent().code,this.reconnectTimer=null,o===re.SUCCESS?(this.setConnectionStatus(Zc.CONNECTED),[2]):[re.SERVER_UNAVAILABLE,re.TIMEOUT,re.RC_SOCKET_DISCONNECTED,re.RC_SOCKET_NOT_CREATED,re.RC_CONN_ACK_TIMEOUT,re.RC_TCP_RESET,re.RC_NAVI_REQ_FAILED,re.RC_NETWORK_DOWN,re.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==Zc.CONNECTING||(this.setConnectionStatus(Zc.SUSPENDED,o),this.reconnectTimer=setTimeout(r,5e3)),[2]):(this.setConnectionStatus(Zc.DISCONNECTED,o),[2])}}))}))},r(),[2]}))}))},e.prototype.onDisconnectByServer=function(e,t){var n=this;return el(e)?(this.setConnectionStatus(Zc.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===re.RC_UDP_DISCONNECTED?(this.setConnectionStatus(Zc.SUSPENDED,e),void setTimeout((function(){n.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(Zc.DISCONNECTED,e)},e.prototype.onDisconenctUnusual=function(e){this.setConnectionStatus(Zc.SUSPENDED,e),this.try2Reconnect(!1,e)},e.prototype.checkAlive=function(){return a(this,void 0,void 0,(function(){var e,t,n=this;return u(this,(function(r){switch(r.label){case 0:return this._crtConnectionStatus!==Zc.CONNECTED?(this._failedCount=0,this.logger.debug(Re.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.info(Re.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=r.sent())===re.SUCCESS?(this.logger.info(Re.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return n.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==Zc.CONNECTED?[2]:(this._failedCount+=1,this.logger.info(Re.L_CHECK_ALIVE_IM_R,"code: "+t+", count: "+this._failedCount,e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(Re.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),this.close(!0,!1),this.setConnectionStatus(Zc.SUSPENDED,re.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,re.RC_PING_EXCEED_LIMIT),[2]))}}))}))},e.prototype.disconnect=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.setConnectionStatus(Zc.DISCONNECTED,re.ACTIVE_DISCONNECT),this.close(!1,e),[2]}}))}))},e.prototype.stopReconnectTimer=function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},e.prototype.getCmpList=function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return c([],this.cmpWeightCache,!0);var n=Pr(e,t);return this.cmpWeightCache=c([],n,!0),c([],n,!0)},e.prototype.updateCmpWeight=function(e,t,n){if(this.cmpWeightCache){var r=this.cmpWeightCache.find((function(t){return n?t.addr===e&&t.protocol===Be.QUIC:t.addr===e}));if(r)if(t){var i=Math.max.apply(Math,this.cmpWeightCache.map((function(e){return e.weight})));r.weight!==i&&(r.weight=i+1)}else{var o=Math.min.apply(Math,this.cmpWeightCache.map((function(e){return e.weight})));r.weight!==o&&(r.weight=o-1),r.failed=!0}}},e.prototype.clearCmpWeightCache=function(){this.cmpWeightCache=void 0},e.prototype.reconnect=function(e,t,n,r){this.token=e,this.reconnectKick=t,this._openCallPlus=n,this.onDisconenctUnusual(r)},e}(),sl={1:"ChannelsUserInfos",2:"ChannelsInviteStatusInfos",3:"ChannelsJoinedInfos",11:"FriendUserInfos",12:"FriendInviteInfos"},al=((rl={})[Rt.GROUP_OPERATION]=function(e){return"ChannelEventData"},rl[Rt.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},rl[Rt.GROUP_APPLICATION_INVITATION]=function(e){return"ChannelApplyInfo"},rl[Mt.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},rl),ul=function(){function e(t){this.logger=t,this._codec=e.createPBCodec()}return e.createPBCodec=function(){var e=ui(hc);return e.getModule=function(t){var n=new e[t];return n.getArrayData=function(){var e=n.toArrayBuffer();return e=jt(e)?[].slice.call(new Int8Array(e)):e},n},e},e.prototype.decodeByPBName=function(e,t,n){var r,i=this,o=e,s=((r={})[gs]=i._formatSyncMessages,r[_s]=i._formatReceivedMessage,r[hs]=i._formatSentMessage,r[Cs]=i._formatHistoryMessages,r[Ss]=i._formatConversationList,r[Fs]=i._formatChatRoomInfos,r[Xs]=i._formatChatRoomKVList,r[ia]=i._formatUserSetting,r[aa]=i._formatConversationStatus,r[va]=i._formatGrpReadReceiptQryResp,r[za]=i._formatQueryReceiptResp,r[na]=i._formatSetUserSettingOutput,r[oa]=i._formatUserSettingNotification,r[Va]=i._formatEventChangeList,r[Da]=i._formatUltraMsgChangeList,r[xa]=i._formatUltraOperateStatusNotifyList,r[Fa]=i._formatUltraMsgList,r[Ea]=i._formatUltraGroupUnreadMentionedList,r[Gs]=i._formatChrmKVVersion,r[Ja]=i._formatCallKVInfo,r[Qa]=i._fromatCallInfoDownStream,r[ws]=i._formateSessionMsgReadInput,r[Lu]=i._formateChannelsListResult,r)[t];try{o=e.length>0&&i._codec[t].decode(e),Jt(o)&&(o=function(e){for(var t in e)Jt(e[t])&&(e[t]=Ln(e[t]));return e}(o)),Xt(s)&&(o=s.call(this,o,n))}catch(e){this.logger.error(Re.L_PB_DECODE_E,t)}return o},e.prototype._readBytes=function(e){var t=e.offset,n=e.buffer,r=e.limit;if(t)try{var i=jt(n)?new Uint8Array(n):n;return ho.readUTF(i.subarray(t,r))}catch(e){this.logger.error(Re.O,null==e?void 0:e.stack)}return e},e.prototype._formatBytes=function(e){if(!e)return e;var t=this._readBytes(e);try{t=t?JSON.parse(t):t}catch(e){this.logger.error(Re.O,null==e?void 0:e.stack)}return t||e},e.prototype._formatSyncMessages=function(e,t){t=t||{};var n=this,r=e.list,i=e.syncTime,o=e.finished;return(Zt(o)||null===o)&&(e.finished=!0),e.syncTime=Ln(i),e.list=fr(r,(function(e){return n._formatReceivedMessage(e,t)})),e},e.prototype._getUtfContent=function(e){if(e.user){var t=e.user,n=t.portrait,r=t.portraitUri,i=n||r;i&&(e.user.portrait=e.user.portraitUri=i)}return e},e.prototype._setExpansion=function(e){var t;return e&&(t=function(e){var t={},n=JSON.parse(e);return gr(n,(function(e,n){t[n]=e.v})),t}(e)),t},e.prototype._setPushConfig=function(e,t){var n=e.pushContent,r=e.pushExt,i=e.configFlag,s={};return r&&(s=$n(t,r.pushConfigs,r.pushId)),o(o({},s),{pushTitle:null==r?void 0:r.title,pushContent:n,pushData:"",disablePushTitle:!!i&&Boolean(4&i),forceShowDetailContent:!!i&&Boolean(8&i),templateId:null==r?void 0:r.templateId})},e.prototype._formatReceivedMessage=function(e,n){var r;if(!e)return e;var i=this,o=n||{},s=o.currentUserId,a=o.connectedTime,u=o.afterDecode,c=o.customMessageTypes,l=void 0===c?{}:c,d=e.content,h=e.fromUserId,p=e.type,_=e.groupId,g=e.status,f=e.dataTime,E=e.extraContent,I=e.extStatus,T=e.clientUniqueId,R=e.busChannel,v=e.msgId,C=e.classname,y=e.toUserIds,S=e.optionBits,m=e.direction||te.RECEIVE,A=function(e){var n=t.READ;return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:n=2&e?t.RETRIEVED:n,canIncludeExpansion:!!(1024&e)}}(g),N=A.isPersited,O=A.isCounted,M=A.isMentioned,U=A.disableNotification,L=A.receivedStatus,P=A.canIncludeExpansion,b=!!(2&(I||0)),D=!!(4&(I||0)),w=!!(8&(I||0))?He.PRIVATE:He.PUBLIC,V=[oe.GROUP,oe.CHATROOM,oe.RTC_ROOM,oe.ULTRA_GROUP].indexOf(p)>-1?_:h,G=h,B=te.RECEIVE;m===te.SEND&&(G=s,B=te.SEND);var F=Ln(f),k=F<a,x=p===oe.CHATROOM,H=i._setExpansion(E),Y=i._formatBytes(d);Y=i._getUtfContent(Y);var K=i._setPushConfig(e,this.logger);x&&h===s&&(B=te.SEND);var q={conversationType:p,targetId:V,senderUserId:G,messageType:C,messageUId:v,isPersited:N,isCounted:O,isMentioned:M,sentTime:F,messageDirection:B,receivedTime:Dr.getTime(),disableNotification:U,receivedStatus:L,receivedStatusInfo:mr(L),canIncludeExpansion:P,content:Y,expansion:H,pushConfig:K,channelId:R||"",isInterrupt:b,isModifyMessage:D,messageId:Ln(T)||0,sentStatus:Me.SENT,isOffLineMessage:k,channelType:w,isStatusMessage:(null===(r=l[C])||void 0===r?void 0:r.isStatusMessage)||!1,readReceiptInfo:void 0,directedUserIds:y,disableUpdateLastMessage:!!(1&(S||0))};return(null==u?void 0:u(q))||q},e.prototype._formatSentMessage=function(e,n){var r=this,i=e.content,s=e.classname,a=e.sessionId,u=e.msgId,c=e.extraContent,l=e.pushExt,d=e.pushContent,h=e.configFlag,p=e.extStatus,_=e.clientUniqueId,g=e.systemId,f=e.toUserIds,E=e.optionBits,I=n.signal,T=n.currentUserId,R=I.date,v=I.topic,C=I.targetId,y=!!(2&(p||0)),S=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}}(a),m=S.isPersited,A=S.isCounted,N=S.disableNotification,O=S.canIncludeExpansion,M=S.isMentioned,U=to[v]||oe.PRIVATE,L=Tr(Ui,v),P=r._formatBytes(i),b=g||C;s===ce.RECALL&&(U=P.conversationType||U,b=P.targetId||C);var D=r._setExpansion(c),w=r._setPushConfig(e,this.logger),V=o(o({},w),{pushTitle:null==l?void 0:l.title,pushContent:d,pushData:d,disablePushTitle:!!h&&Boolean(4&h),forceShowDetailContent:!!h&&Boolean(8&h),templateId:null==l?void 0:l.templateId});return{conversationType:U,targetId:b,messageType:s,messageUId:u,isPersited:m,isCounted:A,isStatusMessage:L,senderUserId:T,content:r._formatBytes(i),sentTime:1e3*R,receivedTime:Dr.getTime(),messageDirection:te.SEND,isOffLineMessage:!1,disableNotification:N,canIncludeExpansion:O,expansion:D,pushConfig:V,channelId:e.busChannel||"",isInterrupt:y,messageId:Ln(_)||0,receivedStatus:t.UNREAD,receivedStatusInfo:mr(t.UNREAD),isMentioned:M,directedUserIds:f,disableUpdateLastMessage:!!(1&(E||0))}},e.prototype._formatHistoryMessages=function(e,t){var n=this,r=t.conversation||{},i=e.list,o=e.hasMsg,s=r.targetId,a=Ln(e.syncTime),u=[];return gr(i,(function(e){var i=n._formatReceivedMessage(e,t);r.conversationType===oe.ULTRA_GROUP?i.targetId=e.groupId||r.targetId:i.targetId=s,u.push(i)}),{isReverse:!0}),{syncTime:a,list:u,hasMore:!!o}},e.prototype._formatUltraMsgChangeList=function(e){var t=e.list,n=e.syncTime,r=e.hasNext;return{syncTime:n,list:t&&t.map((function(e){var t=e.targetId,n=e.type,r=e.time,i=e.changeType,o=e.msgUID,s=e.msgTime,a=e.busChannel,u=e.isAdmin,c=e.isDel,l=e.operatorId,d=e.subChangeType,h=e.userGroupIds,p=e.busChannelType,_=e.remindType;return{targetId:t,conversationType:n,changeType:i,messageUId:o,changeTime:Ln(r),sendTime:Ln(s),channelId:a||"",isAdmin:u,isDel:c,operatorId:l,subChangeType:d,userGroupIds:h,busChannelType:p,mentionedType:_}})),hasNext:r}},e.prototype._formatEventChangeList=function(e){var t=this,n=e.list,r=e.syncTime,i=e.hasNext;return{syncTime:r,list:n&&n.map((function(e){var n,r=e.businessId,i=e.type,o=e.time,s=e.changeType,a=e.originalId,u=e.originalTime,c=e.secondaryId,l=e.isAdmin,d=e.additionalMark,h=e.operatorId,p=e.subChangeType,_=e.secondaryType,g=e.remindType,f=e.isRemindMe,E=e.extIds,I=e.eventData;return I&&(n=t._formatEventData(I,s,p)),{businessId:r,conversationType:i,changeType:s,originalId:a,time:Ln(o),originalTime:Ln(u),secondaryId:c||"",isAdmin:l,additionalMark:d,operatorId:h,subChangeType:p,userGroupIds:E,secondaryType:_,remindType:g,isRemindMe:f,eventData:n}})),hasNext:i}},e.prototype._formatEventData=function(t,n,r){var i={};t&&al[n]&&al[n](r)&&(i=e.createPBCodec()[al[n](r)].decode(t)||{});return i},e.prototype._formatUltraOperateStatusNotifyList=function(e){var t=e.type,n=e.notifyType,r=e.info,i=e.summary,o=[],s=[],a=!(2&~n),u=!(1&~n);return u&&Array.isArray(r)&&r.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.userId,i=e.opType,s=e.optime,a=Ln(s);o.push({targetId:t,channelId:n,userId:r,operationType:i,operationTime:a})})),a&&Array.isArray(i)&&i.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.count,i=e.opType;s.push({targetId:t,channelId:n,count:r,operationType:i})})),{conversationType:t,info:o,summary:s,hasInfo:u,hasSummary:a}},e.prototype._formatUltraMsgList=function(e,t){var n=this,r=e.list;return{list:r&&r.map((function(e){return n._formatReceivedMessage(e,t)}))}},e.prototype._formatUltraGroupUnreadMentionedList=function(e){var t=e.msgInfo;return(void 0===t?[]:t).map((function(e){return{messageUId:e.msgId,sentTime:Ln(e.msgTime),mentionedType:e.remindType,messageType:e.className||""}}))},e.prototype._getUltraGroupConversationInfo=function(e,t){var n=t.versionTime,r=t.unreadCount,i=t.remindCount,o=t.busChannelType,s=t.msgInfo,a=t.remindMeCount;return e.versionTime=Ln(n)||0,e.unreadMessageCount=this._getUnreadCount(Ln(r)||0),e.unreadMentionedCount=this._getUnreadCount(Ln(i)||0),e.unreadMentionedMeCount=this._getUnreadCount(Ln(a)||0),e.channelType=o||He.PUBLIC,e.lastReadTime=0,s&&(e.firstUnreadMessage={sentTime:Ln(s.msgTime)},e.lastReadTime=Ln(s.msgTime)-1),e},e.prototype._getUnreadCount=function(e){return e>999?999:e},e.prototype._formatConversationList=function(e,t){var n=this,r=this,i=e.info,o=t.afterDecode,s={list:(i=fr(i,(function(e){var i=e.msg,s=e.userId,a=e.type,u=e.unreadCount,c=e.busChannel,l=null;i&&((l=r._formatReceivedMessage(i,t)).targetId=s);var d={targetId:s,conversationType:a,unreadMessageCount:Ln(u)||0,latestMessage:l,channelId:c||""};return a===oe.ULTRA_GROUP&&(d=n._getUltraGroupConversationInfo(d,e)),(null==o?void 0:o(d))||d})))||[]};return((null==t?void 0:t.conversationType)||oe.NONE)===oe.ULTRA_GROUP&&(s.isFinished=e.isFinished),s},e.prototype._formatSetUserSettingOutput=function(e){return e},e.prototype._formatChatRoomInfos=function(e){var t=e.userTotalNums,n=e.userInfos;return{userCount:t,userInfos:fr(n,(function(e){var t=e.id,n=e.time;return{id:t,time:Ln(n)}}))}},e.prototype._formatChatRoomKVList=function(e){var t=e.entries,n=e.bFullUpdate,r=e.syncTime;return t=fr(t=t||[],(function(e){var t=e.key,n=e.value,r=e.status,i=e.timestamp,o=e.uid,s=e.version,a=function(e){return{isAutoDelete:!!(1&e),isOverwrite:!!(2&e),type:4&e?ye.DELETE:ye.UPDATE}}(r);return{key:t,value:n,isAutoDelete:a.isAutoDelete,isOverwrite:a.isOverwrite,type:a.type,userId:o,timestamp:Ln(i),version:Ln(s)}})),{kvEntries:t,isFullUpdate:n,syncTime:r}},e.prototype._formatUserSetting=function(e){var t=this,n=e.items,r=e.version,i={};return gr(n||[],(function(e){var n=e.key,r=e.version,o=e.value;e.version=Ln(r),e.value=t._readBytes(o),"Tag"===n&&e.tags.forEach((function(e){e.createdTime=Ln(e.createdTime),e.tagName=e.name})),i[n]=e})),{settings:i,version:r}},e.prototype._formatConversationStatus=function(e){var t=e.state,n=[];return gr(t,(function(e){var t=e.type,r=e.channelId,i=e.time,o=e.stateItem,s=e.busChannel,a=de.CLOSE,u=pe.NOT_SET,c=!1,l=[];gr(o,(function(e){var t=e.sessionStateType,n=e.value,r=e.tags;switch(t){case so:a=n===io?de.OPEN:de.CLOSE,u=Number(n)||pe.NOT_SET;break;case ao:c=n===io;break;case uo:l=r}})),n.push({conversationType:t,type:t,targetId:r,notificationStatus:a,notificationLevel:u,isTop:c,updatedTime:Ln(i),tags:l,channelId:s||""})})),n},e.prototype._formatGrpReadReceiptQryResp=function(e){var t=e.totalMemberNum,n=e.list;return n.forEach((function(e){e.readTime=Ln(e.readTime)})),{totalMemberCount:t,list:n}},e.prototype._formatQueryReceiptResp=function(e){var t=e.list,n=void 0===t?[]:t,r=e.num,i=e.readCnt;return{list:n.map((function(e){return{readTime:Ln(e.receiptTime),userId:e.userId}})),totalCount:r,readCount:i}},e.prototype._formatUserSettingNotification=function(e){return e},e.prototype._formatChrmKVVersion=function(e){var t=e.joinTime,n=e.createTime,r=e.memberCount,i=e.chatroomBanState;return{joinTime:t,createTime:n||0,memberCount:r||0,isAllChatroomBanned:!!(1&i),isCurrentUserBanned:!!(2&i),isCurrentChatroomBanned:!!(4&i),isCurrentChatroomInWhitelist:!!(1&e.whiteListState)}},e.prototype._formatRTCJoinedUserInfo=function(e){return(e.info||[]).map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:Ln(e.joinTime)}}))},e.prototype._formatCallKVInfo=function(e){return e},e.prototype._fromatCallInfoDownStream=function(e){return e},e.prototype._formateSessionMsgReadInput=function(e){var t=e.busChannel,n=e.channelId,r=e.msgTime;return{conversationType:e.type,targetId:n,channelId:t||"",timestamp:r}},e.prototype._formateChannelsListResult=function(t){if(!t)return{result:{list:[]}};var n=t.listType,r=t.result,i=t.page;return r?{listType:n,result:e.createPBCodec()[sl[n]].decode(r)||[],page:i}:{listType:n,result:{list:[]},page:i}},e.prototype.encodeServerConfParams=function(){var e=this._codec.getModule(fs);return e.setNothing(1),e.getArrayData()},e.prototype._calculateFlag=function(e){var t=e.isFilerWhiteBlacklist,n=e.isVoipPush,r=e.pushConfig||{},i=0;return i|=n?1:0,i|=t?2:0,i|=r.disablePushTitle?4:0,i|=r.forceShowDetailContent?8:0},e.prototype._getPushExtraModule=function(e){var t=e.pushTitle,n=e.iOSConfig,r=e.androidConfig,i=e.templateId,o=void 0===i?"":i,s=e.harmonyOSConfig,a=this._codec.getModule(ps);if(t&&a.setTitle(t),n||r||s){var u=zn(n,r,s);a.setPushConfigs(u)}return(null==r?void 0:r.notificationId)&&a.setPushId(null==r?void 0:r.notificationId),a.setTemplateId(o),a},e.prototype._getUpMsgModule=function(e,t){var n=t.messageType,r=t.content,i=t.directionalUserIdList,o=t.canIncludeExpansion,s=t.expansion,a=t.pushConfig,u=t.channelId,c=t.pushData,l=void 0===c?"":c,d=t.pushContent,h=void 0===d?"":d,p=t.messageId,_=void 0===p?0:p,g=t.disableUpdateLastMessage,f=void 0!==g&&g,E=t.isPersited,I=e.conversationType,T=e.targetId,R=this._codec.getModule(hs),v=function(e){var t=e.isStatusMessage,n=e.isPersited,r=e.isCounted;t&&(n=r=!1);var i=0;return n&&(i|=1),r&&(i|=2),e.isMentioned&&(i|=4),e.disableNotification&&(i|=32),e.canIncludeExpansion&&(i|=64),i}(t),C=a||{},y=C.pushContent,S=void 0===y?h:y,m=C.pushData,A=void 0===m?l:m;R.setSessionId(v),S&&R.setPushText(S),A&&R.setAppData(A),i&&R.setToUserIds(i);var N=this._calculateFlag(t);if(R.setConfigFlag(N),R.setClassname(n),r.user&&r.user.portraitUri&&(r.user.portrait=r.user.portraitUri),R.setContent(JSON.stringify(r)),o&&s){var O={};gr(s,(function(e,t){O[t]={v:e}})),R.setExtraContent(JSON.stringify(O))}if(a){var M=this._getPushExtraModule(a);R.setPushExt(M)}R.setClientUniqueId(_),Zt(u)||R.setBusChannel(u),I===oe.SYSTEM&&R.setSystemId(T);var U=0;return E&&f&&(U|=1),R.setOptionBits(U),R},e.prototype.encodeUpMsg=function(e,t){return this._getUpMsgModule(e,t).getArrayData()},e.prototype.encodeSyncMsg=function(e){var t=e.sendboxTime,n=e.inboxTime,r=e.broadcastSyncTime,i=this._codec.getModule(Is);return i.setIspolling(!1),i.setIsPullSend(!0),i.setSendBoxSyncTime(t),i.setSyncTime(n),i.setBroadcastSyncTime(r),i.getArrayData()},e.prototype.encodeChrmSyncMsg=function(e,t){e=e||0,t=t||0;var n=this._codec.getModule(Ts);return n.setCount(t),n.setSyncTime(e),n.getArrayData()},e.prototype.encodeGetHistoryMsg=function(e,t){var n=t.count,r=t.order,i=t.timestamp,o=t.channelId,s=this._codec.getModule(vs);return s.setTargetId(e),s.setTime(i),s.setCount(n),s.setOrder(r),s.setBusChannel(o||""),s.getArrayData()},e.prototype.encodeSuperSyncMsg=function(e){var t=this._codec.getModule(Ua);return t.setSyncTime(e),t.getArrayData()},e.prototype.encodeOldConversationList=function(e){var t=(e=e||{}).count,n=e.type,r=e.startTime,i=e.order;t=t||0,r=r||0,i=i||0;var o=this._codec.getModule(ys);return o.setType(n),o.setCount(t),o.setStartTime(r),o.setOrder(i),o.getArrayData()},e.prototype.encodeRemoveOldConversationList=function(e){var t=(e=e||{}).conversationType,n=e.channelId,r=this._codec.getModule(Ls);return r.setType(t),n&&r.setBusChannel([n]),r.getArrayData()},e.prototype.encodeBatchDeleteConversation=function(e){var t=this,n=this._codec.getModule(Ms),r=[];return e.forEach((function(e){var n=e.conversationType,i=e.targetId,o=e.channelId,s=t._codec.getModule(Us);s.setConversationType(n),s.setConversationId(i),s.setBusChannel(o||""),r.push(s)})),n.setRelation(r),n.getArrayData()},e.prototype.encodeDeleteMessages=function(e,t,n,r){var i=this._codec.getModule(Ps),o=[];return gr(n,(function(e){o.push({msgId:e.messageUId,msgDataTime:e.sentTime,direct:e.messageDirection})})),i.setType(e),i.setConversationId(t),i.setMsgs(o),i.setBusChannel(r),i.getArrayData()},e.prototype.encodeClearMessages=function(e,t,n,r){var i=this._codec.getModule(bs);return t=t||(new Date).getTime(),i.setDataTime(t),i.setTargetId(e),i.setBusChannel(n),i.setConversationType(r),i.getArrayData()},e.prototype.encodeBatchClearRemoteMessages=function(e){var t=this,n=this._codec.getModule(Ds),r=e.map((function(e){var n=t._codec.getModule(bs);return n.setTargetId(e.targetId),n.setConversationType(e.conversationType),n.setBusChannel(e.channelId),n.setDataTime(e.timestamp),n}));return n.setInput(r),n.getArrayData()},e.prototype.encodeClearUnreadCount=function(e,t){var n=e.conversationType,r=e.targetId,i=e.channelId,o=t.timestamp,s=this._codec.getModule(ws);return o=o||+new Date,s.setType(n),s.setChannelId(r),s.setMsgTime(o),s.setBusChannel(i),s.getArrayData()},e.prototype.encodeExpandUltraMessage=function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,o=e.messageUId,s=e.sendTime,a=e.keys,u={mid:o,put:e.expansion,del:a,clear:e.removeAll?1:0},c=this._codec.getModule(La);return c.setFromUserId(t),c.setTargetId(n),c.setType(r),c.setBusChannel(i||""),c.setMsgUID(o),c.setMsgTime(s),c.setContent(JSON.stringify(u)),c.getArrayData()},e.prototype.encodemodifyMessage=function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,o=e.messageUId,s=e.sendTime,a=e.content,u=this._codec.getModule(La);return u.setFromUserId(t),u.setTargetId(n),u.setType(r),u.setBusChannel(i||""),u.setMsgUID(o),u.setMsgTime(s),u.setContent(JSON.stringify(a)),u.getArrayData()},e.prototype.encodeQueryMsgChange=function(e){var t=this._codec.getModule(Pa);return t.setSyncTime(e),t.getArrayData()},e.prototype.encodeMsgQuery=function(e){var t=e.targetId,n=e.conversationType,r=e.messages,i=this._codec.getModule(Ga),o=r.map((function(e){return{msgTime:e.sendTime,msgUID:e.messageUId,busChannel:e.channelId}}));return i.setTargetId(t),i.setType(n),i.setQuery(o),i.getArrayData()},e.prototype.encodeUnreadMentionedMsgQuery=function(e){var t=e.targetId,n=e.channelId,r=e.sentTime,i=e.count,o=this._codec.getModule(fa);return o.setGroupId(t),o.setBusChannel(n),o.setMsgTime(r),o.setSize(i),o.getArrayData()},e.prototype.encodeOperateStatus=function(e,t,n,r){var i=this._codec.getModule(ka);return i.setTargetId(e),i.setType(t),i.setBusChannel(n),i.setOpType(r),i.getArrayData()},e.prototype.encodeJoinOrQuitChatRoom=function(e){var t=this._codec.getModule(Vs);return t.setNothing(1),t.setExtra(e||""),t.getArrayData()},e.prototype.encodeGetChatRoomInfo=function(e,t){var n=this._codec.getModule(Bs);return n.setCount(e),n.setOrder(t),n.getArrayData()},e.prototype.encodeSetUltraGroupDefaultNotificationLevel=function(e,t){var n=this._codec.getModule(ga);return n.setUnpushLevel(e),n.setBusChannel(t),n.getArrayData()},e.prototype.encodeGetUltraGroupDefaultNotificationLevel=function(e){var t=this._codec.getModule(_a);return t.setBusChannel(e),t.getArrayData()},e.prototype.encodeGetFileToken=function(e,t,n,r,i,o,s){var a=this._codec.getModule(ks);return a.setType(e),a.setKey(t),a.setHttpMethod(n),a.setQueryString(r),a.setUrl(i),a.setExt(o),a.setSize(s),a.getArrayData()},e.prototype.encodeGetFileUrl=function(e,t,n,r,i,o){var s=this._codec.getModule(e);return s.setType(t),s.setKey(n),r&&s.setFileName(r),s.setExt(i),s.setSize(o),s.getArrayData()},e.prototype.encodeModifyChatRoomKV=function(e,t,n){var r=this._codec.getModule(Qs),i=t.key,o=t.value,s=t.notificationExtra,a=t.isSendNotification,u=t.type,c=t.timestamp,l=u||ye.UPDATE,d=wr(t,l),h={key:i,value:o||"",uid:n,version:c};if(Zt(d)||(h.status=d),r.setEntry(h),a){var p={conversationType:oe.CHATROOM,targetId:e},_={key:i,value:o,extra:s,type:l},g=this._getUpMsgModule(p,{messageType:ce.CHRM_KV_NOTIFY,content:_,isPersited:!1,isCounted:!1});r.setNotification(g),r.setBNotify(!0),r.setType(oe.CHATROOM)}return r.getArrayData()},e.prototype.encodeModifyChatRoomKVS=function(e,t,n){var r=this._codec.getModule(Ws),i=t.entries,o=t.type||ye.UPDATE,s=wr(t,o),a=[];return i.forEach((function(e){var t={key:e.key,value:e.value||"",uid:n,version:e.timestamp};Zt(s)||(t.status=s),a.push(t)})),r.setEntry(a),r.getArrayData()},e.prototype.encodePullChatRoomKV=function(e){var t=this._codec.getModule(ea);return t.setTimestamp(e),t.getArrayData()},e.prototype.encodePullUserSetting=function(e){var t=this._codec.getModule(ra);return t.setVersion(e),t.getArrayData()},e.prototype.encodeGetConversationStatus=function(e){var t=this._codec.getModule(sa);return t.setTime(e),t.getArrayData()},e.prototype.encodeSetConversationStatus=function(e,t){var n=this,r=this._codec.getModule(la),i=Dr.getTime(),o=[];return gr(e,(function(e){var t=n._codec.getModule(ua),r=e.conversationType,s=e.targetId,a=e.notificationStatus,u=e.isTop,c=e.channelId,l=e.notificationLevel,d=[];t.setType(r),t.setChannelId(s),t.setTime(i),t.setBusChannel(c);var h=a===de.OPEN,p={};Zt(a)||(p[so]=h),Zt(l)||(p[so]=l),Zt(u)||(p[ao]=u),gr(p,(function(e,t){if(!Zt(e)){var r=n._codec.getModule(ca);e=e?io:oo,Zt(l)||Number(t)!==so||(e=String(l)),r.setSessionStateType(Number(t)),r.setValue(e),d.push(r)}})),t.setStateItem(d),o.push(t)})),r.setVersion(t||i),r.setState(o),r.getArrayData()},e.prototype.encodeSetConversationTypeLevel=function(e,t,n){var r=this._codec.getModule(ha);return r.setType(e),r.setVersion(t),r.setUnpushLevel(n),r.getArrayData()},e.prototype.encodeReadReceipt=function(e,t){var n=this._codec.getModule(Ta);return n.setMsgId(e),t&&n.setChannelId(t),n.getArrayData()},e.prototype.encodeCreateTag=function(e,t){var n=this,r=this._codec.getModule(ya),i=[];return e.forEach((function(e){var t=n._codec.getModule(Sa);t.setTagId(e.tagId),t.setName(e.tagName),i.push(t)})),r.setTags(i),r.setVersion(t),r.getArrayData()},e.prototype.encodeMessageReader=function(e,t){var n=this._codec.getModule(Ta);return n.setMsgId(e),t&&n.setChannelId(t),n.getArrayData()},e.prototype.encodeReadReceiptMsg=function(e,t,n){var r=this._codec.getModule(Xa),i=e.conversationType,o=e.targetId,s=e.channelId,a=void 0===s?"":s;return r.setType(i),r.setTargetId(o),r.setBusChannel(a),r.setStartMsgId(t),r.setEndMsgId(n),r.getArrayData()},e.prototype.encodeReceiptQryReq=function(e,t){var n=this._codec.getModule(Za),r=e.targetId,i=e.channelId,o=void 0===i?"":i;return n.setTargetId(r),n.setBusChannel(o),n.setMsgId(t),n.getArrayData()},e.prototype.encodeReceiptCntQryReq=function(e,t){var n=this._codec.getModule(eu),r=e.targetId,i=e.conversationType,o=e.channelId,s=void 0===o?"":o;return n.setChannelId(r),n.setBusChannel(s),n.setType(i),n.setMsgId(t),n.getArrayData()},e.prototype.encodeSessionMsgReadInput=function(e,t){var n=this._codec.getModule(ws),r=e.conversationType,i=e.targetId,o=e.channelId,s=void 0===o?"":o;return n.setType(r),n.setChannelId(i),n.setBusChannel(s),n.setMsgTime(t),n.getArrayData()},e.prototype.encodeRemoveTag=function(e,t){var n=this,r=this._codec.getModule(ma),i=[];return e.forEach((function(e){var t=n._codec.getModule(Sa);t.setTagId(e),i.push(t)})),r.setTags(i),r.setVersion(t),r.getArrayData()},e.prototype.encodeDisConversationTag=function(e){var t=this._codec.getModule(Aa);return t.setTagId(e),t.getArrayData()},e.prototype.encodeUpdateConversationTag=function(e,t,n){var r=this,i=this._codec.getModule(la),o=[];return t.forEach((function(t){var n=r._codec.getModule(ua),i=r._codec.getModule(ca),s=[];e.forEach((function(e){var t=r._codec.getModule(Sa);t.setTagId(e.tagId),Zt(e.isTop)||t.setIsTop(e.isTop),s.push(t)})),i.setSessionStateType(uo),i.setValue(JSON.stringify(s)),i.setTags(s),n.setType(t.conversationType),n.setChannelId(t.targetId),n.setTime(Date.now()),n.setStateItem([i]),o.push(n)})),i.setState(o),i.setVersion(n),i.getArrayData()},e.prototype.encodeReportSDKInfo=function(e){var t=this._codec.getModule(Na);return t.setSdkInfo(e),t.getArrayData()},e.prototype.encodeUltraGroup=function(e,t){var n=this._codec.getModule(Ma);return n.setSyncTime(e),n.setIsEraseMsgContent(t),n.getArrayData()},e.prototype.encodebindRTCRoomForChatroom=function(e){var t=this._codec.getModule(Ka);return t.setRtcRoomId(e.rtcRoomId),t.getArrayData()},e.prototype.encodeSetCallInfo=function(e,t){var n=this._codec.getModule(ja);return n.setKey(e),n.setDataContent(t),n.getArrayData()},e.prototype.encodePullKVMsg=function(e){var t=this._codec.getModule(Wa);return t.setSyncTime(e),t.getArrayData()},e.prototype.encodeUpdateUserSubReq=function(e,t,n,r){var i=this,o=this._codec.getModule(ru);o.setSubType(e),o.setOpType(n),o.setExpiry(r);var s=[];return t.forEach((function(e){var t=i._codec.getModule(iu);t.setSubUserId(e),s.push(t)})),o.setSubUsers(s),o.getArrayData()},e.prototype.encodePullUserSubReq=function(e){var t=e.version,n=e.pageToken,r=this._codec.getModule(au);return r.setVersion(t),r.setPageToken(n),r.getArrayData()},e.prototype.encodePullSubDataReq=function(e){var t=e.version,n=e.needAllData,r=e.pageToken,i=this._codec.getModule(cu);return i.setVersionTime(t),i.setNeedAllData(n),i.setPageToken(r),i.getArrayData()},e.prototype.encodeQrySubDataReq=function(e,t){var n=this,r=this._codec.getModule(pu);r.setSubType(e);var i=[];return t.forEach((function(e){var t=n._codec.getModule(iu);t.setSubUserId(e),i.push(t)})),r.setSubUsers(i),r.getArrayData()},e.prototype.encodePullUserProfileReq=function(e){var t=this._codec.getModule(Eu);return t.setUserId(e),t.getArrayData()},e.prototype.encodeUserProfileInput=function(){var e=this._codec.getModule(Tu);return e.setNothing(1),e.getArrayData()},e.prototype.encodeUserProfilePermission=function(e){var t=this._codec.getModule(Ru);return t.setPermission(e),t.getArrayData()},e.prototype.encodeSearchUserProfile=function(e){var t=this._codec.getModule(Cu);return t.setUniqueId(e),t.getArrayData()},e.prototype.encodeUserProfile=function(e){var t=this,n=this._codec.getModule(_u),r=[],i=[];return Object.keys(e).forEach((function(n){if("extraProfile"!==n){var o=e[n],s=t._codec.getModule(gu);s.setKey(n),s.setValue((null==o?void 0:o.toString())||""),r.push(s)}else if(e.extraProfile){var a=e.extraProfile;Object.keys(a).forEach((function(e){var n=a[e],r=t._codec.getModule(gu);r.setKey(e),r.setValue(n.toString()||""),i.push(r)}))}})),n.setUserProfile(r),n.setUserExtProfile(i),n.getArrayData()},e.prototype.encodeGroupInfo=function(e,t,n,r,i){var o=this;void 0===i&&(i=[]);var s=this._codec.getModule(yu),a=[],u=[];return r&&(Object.keys(r).forEach((function(e){var t=r[e],n=o._codec.getModule(gu);n.setKey(e),n.setValue(t.toString()||""),u.push(n)})),s.setExtProfile(u)),Object.keys(n).forEach((function(e){var t,r=o._codec.getModule(gu);r.setKey(e),r.setValue(null===(t=n[e])||void 0===t?void 0:t.toString()),a.push(r)})),s.setTargetId(t),s.setType(oe.GROUP),s.setSettingProfile(a),"create"===e&&s.setUsers(i),s.getArrayData()},e.prototype.encodeMultiChannels=function(e){var t=this,n=this._codec.getModule(Au),r=[];return e.forEach((function(e){var n=t._codec.getModule(yu);n.setTargetId(e),r.push(n)})),n.setType(oe.GROUP),n.setList(r),n.getArrayData()},e.prototype.encodeQuitGroup=function(e,t,n,r,i){void 0===n&&(n=[]),void 0===r&&(r=!0);var o=this._codec.getModule(Nu);if(o.setTargetId(t),o.setType(oe.GROUP),"dismiss"!==e&&i){var s=this.encodeQuitChannelsSetting(i,r);o.setSettingInfo(s)}return"quit"!==e&&"dismiss"!==e&&o.setUsers(n),o.getArrayData()},e.prototype.encodeQuitChannelsSetting=function(e,t){var n=this._codec.getModule(Ou);return n.setIsQuit(t),n.setIsDelBan(!!(null==e?void 0:e.removeMuteStatus)),n.setIsDelWhite(!!(null==e?void 0:e.removeWhiteList)),n.setIsDelAttention(!!(null==e?void 0:e.removeFollow)),n},e.prototype.encodeModifyChannelsInput=function(e,t,n){var r=this._codec.getModule(Nu);return r.setTargetId(t),r.setType(oe.GROUP),r.setUsers(n),r.setOperateType(e),r.getArrayData()},e.prototype.encodeChannelsQueryInput=function(e){var t=e.type,n=e.groupId,r=e.option,i=e.ids,o=this._codec.getModule(Mu);if(n&&o.setTargetId(n),o.setType(oe.GROUP),["getGroupMembersByRole","getGroupApplications","getJoinedGroupsByRole"].includes(t)&&r){var s=this.encodePagingQuery(r);o.setPage(s)}return["getGroupMembers","getJoinedGroups"].includes(t)&&o.setIds(null!=i?i:[]),e.roleType&&o.setRoleType(e.roleType),o.getArrayData()},e.prototype.encodePagingQuery=function(e){var t=this._codec.getModule(Uu),n=e.count,r=e.order,i=e.pageToken;return t.setSize(n),t.setOrder(r?0:1),t.setPageToken(i),t},e.prototype.encodeSetGroupMemberInfo=function(e,t,n,r){var i=this._codec.getModule(Du);return i.setTargetId(e),i.setType(oe.GROUP),i.setUserId(t),i.setChannelNickName(n),r&&i.setAdditional(r),i.getArrayData()},e.prototype.encodeJoinGroup=function(e,t,n){void 0===n&&(n=[]);var r=this._codec.getModule(Bu);return r.setTargetId(t),r.setType(oe.GROUP),"invite"===e&&r.setUserIds(n),r.getArrayData()},e.prototype.encodeMemberResponseInput=function(e){var t=e.groupId,n=e.inviterId,r=e.optType,i=e.optResult,o=e.joinUserId,s=e.reason,a=this._codec.getModule(Gu);return a.setTargetId(t),a.setType(oe.GROUP),a.setOptType(r),a.setOptResult(i),a.setInviterId(n),r===Tt.MANAGER&&a.setJoinUserId(o),i||a.setDetail(null!=s?s:""),a.getArrayData()},e.prototype.encodeSetGroupRemark=function(e,t){var n=this._codec.getModule(Du),r=ft.ADD;return n.setTargetId(e),n.setType(oe.GROUP),t||(r=ft.REMOVE),n.setOperateType(r),n.setChannelNickName(t),n.getArrayData()},e.prototype.encodeSetGroupFollows=function(e,t,n){var r=this._codec.getModule(Nu);return r.setTargetId(t),r.setType(oe.GROUP),r.setUsers(n),r.setOperateType(e),r.getArrayData()},e.prototype.encodeFriendInput=function(e){var t=this._codec.getModule(ju);return t.setTargetId(e.targetId),e.type&&t.setType(e.type),e.info&&t.setInfo(e.info),t.getArrayData()},e.prototype.encodeFriendsInput=function(e,t){var n=this._codec.getModule(Ju);return n.setTargetId(e),t&&n.setType(t),n.getArrayData()},e.prototype.encodeFriendProfileInput=function(e){var t=this,n=this._codec.getModule(zu);n.setTargetId(e.targetId),n.setRemarkName(e.remark);var r=[];return Object.keys(e.extProfile).forEach((function(n){var i=t._codec.getModule(gu);i.setKey(n),i.setValue(e.extProfile[n]),r.push(i)})),n.setExtProfile(r),n.getArrayData()},e.prototype.encodeFriendQueryInput=function(e,t,n){var r=null!=t?t:{},i=r.count,o=void 0===i?200:i,s=r.pageToken,a=void 0===s?"":s,u=r.order,c=void 0!==u&&u,l=this._codec.getModule($u);l.setQueryType(e),11===e&&l.setFriendType(n);var d=this._codec.getModule(Uu);return d.setSize(o),d.setOrder(c?0:1),d.setPageToken(a),l.setPage(d),l.getArrayData()},e.prototype.encodeFriendsListInput=function(e,t){var n=this._codec.getModule(nc);return n.setTargetId(e),t&&n.setType(t),n.getArrayData()},e.prototype.encodeFriendLevelSet=function(e){var t=this._codec.getModule(rc);return t.setLevel(e),t.getArrayData()},e}(),cl=function(e){function t(t,n,r,i,o,s){var a=e.call(this,t,n,r,i,s)||this;return a.runtime=o,a.wsListener=s,a._socket=null,a._connectedTime=0,a._socketIndex=0,a._localConnectedTime=0,a._idCount=0,a._generateMessageId=function(){return a._idCount>=65535&&(a._idCount=0),++a._idCount},a._messageIds={},a._syncMessageIds={},a.codec=new ul(a.logger),a}return r(t,e),t.prototype.getConnectedTime=function(){return this._connectedTime},t.prototype.getLocalConnectedTime=function(){return this._localConnectedTime},t.prototype.getCrtServerTime=function(){return Date.now()-this._localConnectedTime+this._connectedTime},t.prototype.getDelayTime=function(){return this._localConnectedTime-this._connectedTime},t.prototype.connectWithToken=function(e,t,n,r){return a(this,void 0,void 0,(function(){var n,i,o,s,a,c,l,d,h;return u(this,(function(p){switch(p.label){case 0:if(n=t.openAnti,i=t.type,o=this.getCmpList(t),this.logger.debug(Re.L_NAVI_CMP_R,JSON.stringify(o),r),0===(s=o.filter((function(e,t){return o.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(Re.L_NAVI_CONF_E,"no service available",r),[2,{code:re.SERVER_UNAVAILABLE}];a=1===n?Ri.V4:Ri.V3,c=function(t){var n,o,c,d,h,p,_,g,f,E,I;return u(this,(function(u){switch(u.label){case 0:return n=s[t],o=n.protocol,c=n.addr,d=n.weight,h=function(e,t,n,r,i,o,s){var a=Wc(i),u=a.type,c=a.version,l="browser"===i.tag?"|"+u+"|"+c:"||",d=s?"&protocolVer="+s:"",h=Rn(i);return e+"://"+t+"/websocket?appId="+n+"&token="+encodeURIComponent(r)+"&sdkVer="+Y+"&pid="+o+"&deviceId="+h+"&apiVer="+(i.isFromUniapp?"uniapp":i.tag+encodeURIComponent(l))+(i.connectPlatform?"&platform="+i.connectPlatform:"")+d}(o===Be.WS?"ws":"wss",c,l.appkey,e,l.runtime,"",a),p=Date.now(),[4,l.connectWebSocket(h,a,r)];case 1:return _=u.sent(),g=_.code,f=_.data,E=l.cmpWeightCache.findIndex((function(e){return e.addr===c})),I={bid:rr(),ptc:Je.WS,cod:g,net:l.getNetwork().type,dur:Date.now()-p,spr:0,pr:i||0,hos:c,idx:E,rct:l.retryCount?ze.RECONNECT:ze.CONNECT,cid:l.uuid+"_"+l.retryCount,v:Ze.CURRENT,rsn:l.reason,count:l.retryCount,weight:d},l.statisticLog.record(ve.IM_WEBSOCKET,JSON.stringify(I),r),g===re.RC_SOCKET_DISCONNECTED||g===re.TIMEOUT?[2,"continue"]:g!==re.SUCCESS?[2,{value:{code:g}}]:(l._localConnectedTime=Math.floor((Date.now()+p)/2),l._socket=f.socket,l.updateCmpWeight(s[t].addr,!0),l.curCmpUrl=s[t].addr,[2,{value:{code:g,data:f.userId}}])}}))},l=this,d=0,p.label=1;case 1:return d<s.length?[5,c(d)]:[3,4];case 2:if("object"==typeof(h=p.sent()))return[2,h.value];p.label=3;case 3:return d+=1,[3,1];case 4:return[2,{code:re.SERVER_UNAVAILABLE}]}}))}))},t.prototype.connectWebSocket=function(e,t,n){return a(this,void 0,void 0,(function(){var r=this;return u(this,(function(i){return this.logger.info(Re.T,"connect start: "+e,n),[2,new Promise((function(i){var o=r.runtime.createWebSocket(e);r._socketIndex=o.id;var s=setTimeout((function(){r.logger.info(Re.T,"connect timeout: "+e,n),i({code:re.TIMEOUT}),o&&o.close()}),5e3);o.onOpen((function(){clearTimeout(s),r.logger.info(Re.T,"socket open",n)})),o.onMessage((function(e){if(r._socketIndex===o.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var s,a=Lo(r.logger,e,t);if(a instanceof Io){var u=a.status;if(u!==Uc.ACCEPTED)return r.logger.info(Re.T,"connect failed: "+u,n),void i({code:(s=u,$c[s])});r.logger.info(Re.T,"connect success",n);var c=a.timestamp,l=a.userId,d=a.messageId;return r._connectedTime=c,r._idCount=d,void i({code:re.SUCCESS,data:{userId:l,socket:o}})}if(a instanceof To){var h=a.status;return r.logger.info(Re.T,"recv disconnect signal -> status: "+h),void r.onRecvDisconnect(h,o)}r._onReceiveSignal(a)}}else r.logger.warn(Re.L_WEBSOCKET_DISACCORD_E,JSON.stringify({msg:"WebSocket id disaccord",_socketIndex:r._socketIndex,curSocketId:o.id}))})),o.onClose((function(){r.logger.info(Re.T,"socket close",n);var e=re.RC_SOCKET_DISCONNECTED;i({code:e}),r.onSocketEnd(o,e)})),o.onError((function(e){r.logger.info(Re.T,"socket error",n);var t=re.RC_SOCKET_DISCONNECTED;i({code:t}),r.onSocketEnd(o,t)}))}))]}))}))},t.prototype._qosNeedAck=function(e,t){e.header&&e.header.qos!==Ei.AT_MOST_ONCE&&(e instanceof So&&!e.syncMsg&&(this.logger.debug(Re.O,"send pubAck -> "+t+" "+e.topic),this.sendOnly(new No(t))),e instanceof Uo&&(this.logger.debug(Re.O,"send queryCon -> "+t+" "+e.topic),this.sendOnly(new Mo(t))))},t.prototype._publishReader=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o=this;return u(this,(function(s){switch(s.label){case 0:return n=e.syncMsg,r=e.topic,this.logger.debug(Re.O,"recv PublishReader -> messageId: "+t+" "+r),r===Kr?[2]:!n||function(e){return[Po.ppMsgS,Po.pgMsgS,Po.chatMsgS].map((function(e){return Po[e]})).indexOf(e)>=0}(r)?(this.wsListener.signal(e),[2]):[4,new Promise((function(e){o._syncMessageIds[t]=e}))];case 1:return i=s.sent(),delete this._syncMessageIds[t],this.wsListener.signal(e,i),[2]}}))}))},t.prototype._onReceiveSignal=function(e){return a(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(i){switch(i.label){case 0:return t=e.messageId,e instanceof vo&&this._pingResolve?(this._pingResolve(re.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e,t),t>0&&(e instanceof Ao||e instanceof Uo)&&(this.logger.debug(Re.O,"recv ack -> messageId: "+t+" "+e.topic),(n=this._messageIds[t])&&(n(e),delete this._messageIds[t]),(r=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],r(e))),e instanceof So?[4,this._publishReader(e,t)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))},t.prototype.onRecvDisconnect=function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return zc[e]}(e)))},t.prototype.onSocketEnd=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))},t.prototype.clearResolves=function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(re.RC_SOCKET_DISCONNECTED)}},t.prototype.sendPing=function(e){var t=this;return new Promise((function(n){t._pingResolve=n,setTimeout((function(){return n(re.TIMEOUT)}),e),t.sendOnly(new Ro)}))},t.prototype.sendOnly=function(e){this._socket&&((e instanceof mo||e instanceof Oo)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getBufferData().buffer))},t.prototype.send=function(e,t,n,r){return void 0===r&&(r=3e4),a(this,void 0,void 0,(function(){var i,o,s,a,c=this;return u(this,(function(u){switch(u.label){case 0:return this._socket?(i=this._generateMessageId(),e.messageId=i,this._socket.send(e.getBufferData().buffer),[4,new Promise((function(e){c._messageIds[i]=e,setTimeout((function(){c._messageIds[i]&&delete c._messageIds[i],e()}),r)}))]):[2,{code:re.RC_NET_CHANNEL_INVALID}];case 1:return(o=u.sent())?o instanceof Uo||o instanceof Ao?(s=t&&o.data&&[re.SUCCESS,re.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,re.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,re.RC_USER_PROFILE_KEY_NOT_EXIST,re.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,re.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,re.RC_USER_PROFILE_VALUE_EXCEED_RANGE,re.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(o.status)>=0,a=s?this.codec.decodeByPBName(o.data,t,n):o,0!==o.status?(this.logger.warn(Re.O,"send failed -> message: "+i+", respPBName: "+t+", status: "+o.status),[2,{code:o.status,data:t&&o.data?a:null}]):[2,{code:re.SUCCESS,data:a}]):[2,{code:o}]:(this.logger.warn(Re.O,"send timeout -> message: "+i+", respPBName: "+t+", timeout: "+r),[2,{code:re.TIMEOUT}])}}))}))},t.prototype.close=function(e){this._socket&&(this._socket.close(),this._socket=null),this.clearResolves()},t}(ol);!function(e){e[e.STATISTICS=-2]="STATISTICS",e[e.RECORD=-1]="RECORD"}(il||(il={}));var ll=null,dl="RC_CONF",hl="RC_STATISTICS",pl=null,_l=function(e){return a(void 0,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,ll];case 1:return(t=n.sent())?[4,new Promise((function(n){var r=t.db.transaction(hl,"readwrite").objectStore(hl).index("time"),i=IDBKeyRange.upperBound(Date.now()-e),o=r.openCursor(i);o.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},o.onerror=function(){n()}}))]:[2];case 2:return n.sent(),pl=setTimeout((function(){return _l(e)}),6e5),[2]}}))}))},gl=function(e,t,n){void 0===n&&(n=168),ll||("undefined"!=typeof window&&window&&window.indexedDB?ll=new Promise((function(r){var i=window.indexedDB;Ur();var o="RC_STATISTIC_"+e,s=i.open(o,2);s.onerror=function(e){t.error(Re.L_LOGDB_OPEN_FAILED_E,e.target.error),r(null)},s.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){ll=null,t.warn(Re.L_LOGDB_CLOSED_S)},o.onerror=function(e){ll=null,t.error(Re.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(Re.L_LOGDB_ABORT_S,e.target.error)},_l(3600*Math.max(24,Math.min(168,n))*1e3),r({appkey:e,db:o})):r(null)},s.onupgradeneeded=function(e){var t=e.target.result;t.objectStoreNames.contains(hl)&&t.deleteObjectStore(hl);var n=t.createObjectStore(hl,{autoIncrement:!0});n.createIndex("level","level",{unique:!1}),n.createIndex("time","time",{unique:!1}),t.objectStoreNames.contains(dl)&&t.deleteObjectStore(dl),(n=t.createObjectStore(dl,{keyPath:"key"})).createIndex("key","key",{unique:!0})}})):t.warn(Re.L_UNSUPPORT_INDEXDB_O))},fl=[],El=function(){return a(void 0,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return ll?(pl&&(clearTimeout(pl),pl=null),[4,ll]):[2];case 1:return(e=n.sent())&&(t=e.db,fl.push(t)),ll=null,[2]}}))}))};function Il(e){return a(this,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,ll];case 1:return(t=n.sent())?[2,new Promise((function(n){var r=t.db.transaction(dl,"readonly").objectStore(dl).get(e);r.onsuccess=function(e){var t;n({value:null===(t=r.result)||void 0===t?void 0:t.value,success:!0})},r.onerror=function(e){n({success:!1})}}))]:[2,{success:!1}]}}))}))}var Tl,Rl="REPORT_SESSION",vl=function(e,t){return a(void 0,void 0,void 0,(function(){var n,r,i,o;return u(this,(function(s){switch(s.label){case 0:return n=Rl+"_"+e,[4,Il(Rl+"_"+e)];case 1:return r=s.sent(),i=r.success,o=r.value,i?(t===(null==o?void 0:o.sessionId)||function(e,t){a(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return[4,ll];case 1:return(n=i.sent())?(r=n.db,r.transaction(dl,"readwrite").objectStore(dl).put({key:e,value:t}),[2,!0]):[2,!1]}}))}))}(n,{sessionId:t}),[2]):[2]}}))}))},Cl=function(){return ll},yl=function(e){var t=e.sessionId,n=e.level,r=e.loggerId,i=e.traceId,o=e.time,s=e.tag,a=e.type,u=e.content;Ft(u)||(u=JSON.stringify(u));var c=n<0?u||"":JSON.stringify({content:u,traceId:i,from:r});return t+","+o+","+a+","+n+","+s+","+(c='"'+c.replace(/"/g,'""')+'"')+"\n"},Sl=0,ml=function(){function e(e,t,n){this._appkey=e,this._id=t,this._type=n,this.record=this._writer.bind(this,il.STATISTICS)}return e.prototype._writer=function(e,t,n,r){var i=new Date;/^[\w-]+$/.test(t)&&this.flush({time:+i,sessionId:In,type:this._type,loggerId:this._id,tag:t,level:e,content:n,traceId:r})},e.prototype.createTraceId=function(){return In+"-"+ ++Sl},e.prototype.getSessionId=function(){return In},e}(),Al=function(){function e(e,t,n,r,i,o){void 0===o&&(o=i),this.appkey=e,this.deviceId=t,this.deviceInfo=n,this.statisticDB=r,this.logger=i,this.reportClass=o,this.userId="",this.timer=null,this.started=!1,this.reportFailedNumber=0,this.itvByNavi=6,this.timesByNavi=5}return e.prototype.checkStart=function(e){return a(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(i){return this.started?[2]:(this.userId=e.userId,e.logSwitch?(t=Ci.getLogUrlPolicyList(e,this.logger),n=t.policy,r=t.addrs,this.started=!0,this.itvByNavi=n.itv,this.timesByNavi=n.times,r.length>0&&this.realtimeReport(r[0].addr,n.level,n.itv),[2]):[2])}))}))},e.prototype._sendLogs2Realtime=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,o,s,a,c,l,d,h,p,_,g;return u(this,(function(u){switch(u.label){case 0:return this.logger.debug(Re.L_STATISTIC_LOG_O,JSON.stringify({count:e.length}),t),i=r,[4,this.compressStatistics(e)];case 1:return a=u.sent(),c=a.success,l=a.data,c||this.logger.warn(Re.L_STATISTIC_LOG_O,"compress failed",t),this.logger.debug(Re.L_STATISTIC_LOG_O,"compress done",t),d=$t(n)?n:"https://"+n,d+="?version=5.12.2&appkey="+this.appkey+"&userId="+encodeURIComponent(this.userId)+"&deviceId="+this.deviceId+"&deviceInfo="+this.deviceInfo+"&platform=Web",[4,this.send({url:d,body:l,method:"POST"})];case 2:if(h=u.sent(),p=h.status,_=h.data,this.logger.debug(Re.L_STATISTIC_LOG_R,JSON.stringify({status:p,data:_}),t),200===p){if(this.reportFailedNumber=0,_)try{(g=JSON.parse(_)).nextTime&&(i=g.nextTime),o=g.level,s=g.logSwitch}catch(e){this.logger.warn(Re.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}this.statisticDB.setTimestamp4RealtimeLog(e[e.length-1].time+1)}else this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(i+=i),this.reportFailedNumber++;return[2,{itv:i,level:o,logSwitch:s}]}}))}))},e.prototype.realtimeReport=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a,c,l,d,h,p,_,g=this;return u(this,(function(u){switch(u.label){case 0:return r=Date.now(),i=this.statisticDB.getTimestamp4RealtimeLog()||Tn,o=Math.max(r-5e3,i),s=this.reportClass.createTraceId(),this.logger.debug(Re.L_STATISTIC_LOG_T,JSON.stringify({startTime:i,endTime:o,level:t}),s),[4,this.statisticDB.getStatistics(i,o,t,!0)];case 1:return a=u.sent(),c=a.dbReady,l=a.logs,c?[3,2]:(this.logger.warn(Re.L_STATISTIC_LOG_R,"db error",s),[3,4]);case 2:return l.length>0?[4,this._sendLogs2Realtime(l,s,e,n)]:[3,4];case 3:if(d=u.sent(),h=d.itv,p=d.level,_=d.logSwitch,n=h,void 0!==p&&(t=p),0===_)return[2];u.label=4;case 4:return this.started&&(this.timer&&clearTimeout(this.timer),n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return g.realtimeReport(e,t,n)}),1e3*n)),[2]}}))}))},e.prototype.report=function(e,t,n,r,i,o){return a(this,void 0,void 0,(function(){var s,a,c,l,d,h,p,_,g,f;return u(this,(function(u){switch(u.label){case 0:return"web"!==n.toLowerCase()?[2]:(s=this.reportClass.createTraceId(),this.logger.info(Re.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:o}),s),[4,this.statisticDB.getStatistics(e,t,il.STATISTICS,!1)]);case 1:return a=u.sent(),c=a.dbReady,l=a.logs,this.logger.info(Re.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),s),d=$t(r)?r:"https://"+r,d+="?version=5.12.2&appkey="+this.appkey+"&userId="+encodeURIComponent(this.userId)+"&deviceId="+this.deviceId+"&deviceInfo="+this.deviceInfo+"&platform=Web&logId="+i,c?l.length>0?[4,this.compressStatistics(l)]:[3,3]:[3,5];case 2:return p=u.sent(),_=p.success,g=p.data,h=_?g:"compress failed",[3,4];case 3:h="no data",u.label=4;case 4:return[3,6];case 5:h="no database",u.label=6;case 6:return this.logger.debug(Re.L_REPORT_FULL_LOG_O,"compress done",s),[4,this.send({url:d,body:h,method:"POST"})];case 7:return f=u.sent().status,this.logger.info(Re.L_REPORT_FULL_LOG_R,JSON.stringify({status:f}),s),[2]}}))}))},e.prototype.stop=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1},e}(),Nl="RC_STATISTICS",Ol=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.flush=function(e){Pl(e)},t}(ml),Ml=!1,Ul=[],Ll=function(e){return a(void 0,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return Ml||0===Ul.length?[2]:(Ml=!0,t=Ul.splice(0),[4,new Promise((function(n){var r=e.transaction(Nl,"readwrite");r.oncomplete=n,r.onabort=n;var i=r.objectStore(Nl);t.forEach((function(e){try{i.add(e)}catch(t){null===console||void 0===console||console.error("write log failed ->",e)}}))}))]);case 1:return n.sent(),Ml=!1,0===Ul.length&&fl.length>0&&(fl.forEach((function(e){return e.close()})),fl.length=0),setTimeout((function(){return Ll(e)})),[2]}}))}))},Pl=function(e){return a(void 0,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return[4,Cl()];case 1:if(!(t=n.sent()))return[2];if(e.content&&Ft(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return Ul.push(e),Ll(t.db),[2]}}))}))},bl=0,Dl=function(e){function t(t,n,r,i){var o=this,s=Rn(n),c=Wc(n),l=c.type+"|"+c.version+"|"+i.getSessionId();return o=e.call(this,t,s,l,{setTimestamp4RealtimeLog:function(e){bl=e},getTimestamp4RealtimeLog:function(){return bl},getStatistics:function(e,t){return a(this,void 0,void 0,(function(){var n;return u(this,(function(r){switch(r.label){case 0:return[4,Cl()];case 1:return(n=r.sent())?[2,new Promise((function(r){var i=n.db.transaction(Nl,"readonly").objectStore(Nl),o=[],s=IDBKeyRange.bound(e,t),a=i.index("time").openCursor(s);a.onsuccess=function(e){var t=e.target.result;if(t){var n=t.value;o.push(n),t.continue()}else r({dbReady:!0,logs:o})},a.onerror=function(e){r({dbReady:!1,logs:[]})}}))]:[2,{dbReady:!1,logs:[]}]}}))}))}},r,i)||this,o.runtime=n,o}return r(t,e),t.prototype.send=function(e){return this.runtime.httpReq(e)},t.prototype.checkStart=function(t){return a(this,void 0,void 0,(function(){return u(this,(function(n){switch(n.label){case 0:return[4,vl(t.userId,this.reportClass.getSessionId())];case 1:return n.sent(),[2,e.prototype.checkStart.call(this,t)]}}))}))},t.prototype.compressStatistics=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,{success:!0,data:qc(e.map(yl).join(""))}]}))}))},t.prototype.isReporter=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,(t=this.userId,n=this.reportClass.getSessionId(),a(void 0,void 0,void 0,(function(){var e,r,i;return u(this,(function(o){switch(o.label){case 0:return[4,Il(Rl+"_"+t)];case 1:return e=o.sent(),r=e.success,i=e.value,[2,r&&(null==i?void 0:i.sessionId)===n]}}))})))];case 1:return[2,e.sent()]}var t,n}))}))},t.prototype.report=function(t,n,r,i,o,s){return a(this,void 0,void 0,(function(){return u(this,(function(a){switch(a.label){case 0:return[4,this.isReporter()];case 1:return a.sent()?[2,e.prototype.report.call(this,t,n,r,i,o,s)]:[2]}}))}))},t.prototype.realtimeReport=function(t,n,r){return a(this,void 0,void 0,(function(){return u(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,n,r)]}))}))},t}(Al),wl=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.appkey=t,i.logger=n,i.runtime=r,i._storageKey="",i._storageKey=Z.STATIC_CONFIG_KEY(t),i}return r(t,e),t.prototype.getCache=function(){return this.runtime.localStorage.getItem(this._storageKey)},t.prototype.setCache=function(e){this.runtime.localStorage.setItem(this._storageKey,e)},t.prototype.clearCache=function(){this.runtime.localStorage.removeItem(this._storageKey)},t.prototype.sendRequest=function(e){return a(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(i){switch(i.label){case 0:return[4,this.runtime.httpReq({url:e})];case 1:return t=i.sent(),n=t.status,r=t.data,[2,{code:n,data:r}]}}))}))},t.prototype.decryptData=function(e){return a(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,ir(e,P,b)];case 1:return t=r.sent(),[2,JSON.parse(t)];case 2:return n=r.sent(),this.logger.error(Re.L_GET_STATIC_CONF_E,JSON.stringify({error:null==n?void 0:n.stack})),[3,3];case 3:return[2]}}))}))},t}(yi),Vl=function(){function e(e){this.reporter=e,this.logId="",this.uploadTask=[],this.taskLock=!0}return e.prototype.uploadLogCmdTask=function(e){this.uploadTask.push(e),this.enqueueTask()},e.prototype.reportLogCmdTask=function(e){var t,n,r,i,o=this;this.taskLock=!1;var s=null!==(t=e.startTime)&&void 0!==t?t:0,a=null!==(n=e.endTime)&&void 0!==n?n:0,u=null!==(r=e.platform)&&void 0!==r?r:"",c=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==c&&(this.logId=e.logId,this.reporter.report(s,a,u,c,e.logId,"",!0).finally((function(){o.taskLock=!0,o.uploadTask.length>0&&o.enqueueTask()})))},e.prototype.enqueueTask=function(){if(this.taskLock){var e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}},e}();!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(Tl||(Tl={}));var Gl={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}};function Bl(){return Gl}var Fl=function(){function e(e,t,n,r){this.logger=e,this.appkey=t,this.reporter=n,this.statisticLog=r,this.isEable=!0,this.expire=0,this.interval=0,this.timestamp=0,this.lastRequestTime=0,this.changeAreaCode=0,this._cache=null,this.uploadTaskManage=new Vl(n)}return e.prototype.init=function(){try{var e=this.getLocalCloudControllerCache();this._cache=e?JSON.parse(e):Bl()}catch(e){this._cache=Bl()}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)))},e.prototype.isExire=function(){return(new Date).getTime()-this.timestamp<this.expire},e.prototype.isOverclock=function(){return(new Date).getTime()-this.lastRequestTime<this.interval},e.prototype.logCmdMsgTasks=function(e){var t=this;e.uploadLog&&e.uploadLog.tasks.forEach((function(e){e.objectName===ce.LOG_COMMAND&&t.uploadTaskManage.uploadLogCmdTask(e)}))},e.prototype.dataHandle=function(e){var t=this._cache;t.lastRequestTime=this.lastRequestTime,en(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)},e.prototype.request=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a,c,l,d,h,p;return u(this,(function(u){switch(u.label){case 0:return!this.isEable&&t===Tl.init&&this.isExire()?(this.logger.info(Re.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===Tl.newWorkChange&&this.isOverclock()?(this.logger.info(Re.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(r=or(e),this.lastRequestTime=(new Date).getTime(),i=r+"/v1/config",o={"Content-Type":"application/json","RC-App-Key":this.appkey},n&&(o["RC-Token"]=n),s={platform:"web",version:"5.12.2",timestamp:this.timestamp},this.statisticLog.record(ve.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!n,uri:i})),[4,this.httpRequest(i,ar.POST,o,s)]);case 1:return a=u.sent(),c=a.code,l=a.data,this.statisticLog.record(ve.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:l})),c===re.CLOUD_DATA_CENTER_INVALID&&l&&l.targetRegion?(d=l.targetRegion,this.changeAreaCode===d?[2,this.timestamp]:(h=Ci.setAreaCode(d),this.logger.info(Re.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:h,originAreaCode:Ci.getAreaCode(),newAreaCode:d})),this.changeAreaCode=d,(p=Ci.getCloudControllerUrl(d))[0]?[2,this.request(p[0],Tl.other)]:(this.logger.info(Re.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])}}))}))},e.prototype._handleMrtrData=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}(),kl=function(e){function t(t,n,r,i,o){var s=e.call(this,r,t,i,o)||this;s.runtime=n,s._mrtr={chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1};var a=Cr(n);return s.deviceId=Rn(n),s.model="Web|"+a.type+"|"+a.version,s.init(),s}return r(t,e),t.prototype.httpRequest=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,o,s,a,c,l,d,h;return u(this,(function(u){switch(u.label){case 0:return(i=r).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:n,body:JSON.stringify(i)},this.logger.info(Re.L_REQUEST_T,JSON.stringify(o)),[4,this.runtime.httpReq(o)];case 1:s=u.sent(),a=s.status,c=s.data,l=void 0===c?"":c,this.logger.info(Re.L_REQUEST_R,JSON.stringify({status:a,data:l}));try{return d=JSON.parse(l),h=d.data,[2,{code:parseInt(d.code,10),data:h}]}catch(e){return this.logger.warn(Re.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:a,data:l,error:e})),[2,{code:a,msg:e}]}return[2]}}))}))},t.prototype.setCloudControllerCache=function(e){var t=Z.CLOUD_CONTROL_KEY(this.appkey);this.runtime.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(Re.L_CLOUD_SET_CACHE_O,JSON.stringify(e))},t.prototype.getLocalCloudControllerCache=function(){var e=Z.CLOUD_CONTROL_KEY(this.appkey),t=this.runtime.localStorage.getItem(e);return this.logger.info(Re.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t},t.prototype.setMRTRConfig=function(e){this.logger.info(Re.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e},t.prototype.getMRTRConfig=function(){return this._mrtr},t}(Fl),xl=function(){function e(e,t,n,r){this._storage=new p(e,Z.READ_RECEIPT_KEY(t,n)),this._delayTime=r,this.clear()}return e.prototype._getConversationKey=function(e){return e.targetId+"_"+e.channelId},e.prototype._removeExcessData=function(e){for(var t=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),n={},r=0,i=t;r<i.length;r++){var o=i[r];n[o.key]=o.value}return n},e.prototype.insert=function(e,t,n,r,i){var s;if(!(r<Date.now()-this._delayTime-W)){var a=this._getConversationKey(e),u=this._storage.get(a)||{};if(!u[t]){var c={t:r,d:n};i&&(c.sId=i);var l=o(o({},u),((s={})[t]=c,s));Object.keys(l).length>30&&(l=this._removeExcessData(l)),this._storage.set(a,l)}}},e.prototype.addReadedUser=function(e,t,n){var r,i=this._getConversationKey(e),s=this._storage.get(i)||{},a=s[t];if(a){if(a.us){if(a.us.includes(n))return}else a.us=[];a.us.push(n),this._storage.set(i,o(o({},s),((r={})[t]=a,r)))}},e.prototype.getReadReceiptInfo=function(e,t){var n=this._getConversationKey(e),r=(this._storage.get(n)||{})[t];return r?{time:r.t,direction:r.d,users:r.us||[],senderId:r.sId}:null},e.prototype.getReceiptMessageDic=function(e){var t=this._getConversationKey(e),n=this._storage.get(t)||{},r={};for(var i in n){var o=n[i];o.d===te.RECEIVE&&(r[o.sId]||(r[o.sId]=[]),r[o.sId].push(i))}return r},e.prototype.remove=function(e,t){var n=this._getConversationKey(e),r=this._storage.get(n)||{};r[t]&&(delete r[t],0===Object.keys(r).length?this._storage.remove(n):this._storage.set(n,r))},e.prototype.clear=function(){var e=this._storage.getValues(),t={};for(var n in e){var r=e[n],i={};for(var o in r){var s=r[o];Date.now()-this._delayTime-s.t<W&&(i[o]=s)}Object.keys(i).length&&(t[n]=i)}this._storage.update(t)},e}(),Hl=function(){function e(e){var t;this._delayTime=e,this.subscribeData=((t={})[nt.ONLINE_STATUS]={},t[nt.USER_PROFILE]={},t),this._ownProfile=null}return e.prototype.clearSubscribeRelation=function(){var e;this.subscribeData=((e={})[nt.ONLINE_STATUS]={},e[nt.USER_PROFILE]={},e)},e.prototype.clearSubscribeStatusData=function(e){var t=this;e===nt.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].statusMap={}})):e===nt.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].profile=void 0}))},e.prototype.getSubscribeUserData=function(e,t){var n=this.subscribeData[e][t];return n?o({},n):void 0},e.prototype.removeSubscribeUserData=function(e,t){delete this.subscribeData[e][t]},e.prototype.updateSubscribeUserData=function(e,t,n){this.subscribeData[e][t]=n},e.prototype.clearExpiredData=function(e){for(var t in this.subscribeData[e]){var n=this.subscribeData[e][t];n.expiry<(Date.now()+this._delayTime-n.subscribeTime)/1e3&&delete this.subscribeData[e][t]}},e.prototype.getSubscribeUserList=function(e,t,n){return c([],Object.values(this.subscribeData[e]),!0).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(n,n+t)},e.prototype.updateOwnProfile=function(e){this._ownProfile=o(o({},e),{extraProfile:o({},e.extraProfile)})},e.prototype.getOwnProfile=function(){return this._ownProfile?o(o({},this._ownProfile),{extraProfile:o({},this._ownProfile.extraProfile)}):null},e}(),Yl=function(){function e(e){this._delayTime=e,this._relationshipStatusVersion=0,this._subUserStatusVersion=0,this._ownProfileVersion=0,this._subStore=new Hl(e)}return e.prototype.updateRelationshipStatusVersion=function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)},e.prototype.getRelationshipStatusVersion=function(){return this._relationshipStatusVersion},e.prototype.updateSubscribeUserStatusVersion=function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)},e.prototype.getSubscribeUserStatusVersion=function(){return this._subUserStatusVersion},e.prototype._filterSubscribeRelationData=function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(n){var r=e.find((function(e){return e.subscribeType===t.subType&&e.userId===n.subUserId}));r?r.subscribeTime<t.subTime&&(r.expiry=t.expiry,r.operationType=t.opType,r.subscribeTime=t.subTime):e.push({userId:n.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])},e.prototype.updateSubscribeRelation=function(e,t){var n=this;void 0===t&&(t=!1);var r=[],i=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,s,a=e.userId,u=e.subscribeTime,c=e.subscribeType,l=e.expiry;if(e.operationType===rt.UNSUBSCRIBE)return n._subStore.removeSubscribeUserData(c,a),void o.push(e);var d=n._subStore.getSubscribeUserData(c,a);if(!(d&&d.subscribeTime>=u)){if(c===nt.ONLINE_STATUS){r.push(a);var h=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};n._subStore.updateSubscribeUserData(c,a,{subscribeTime:u,expiry:l,userId:a,subscribeType:c,statusMap:h})}else{i.push(a);var p=null===(s=d)||void 0===s?void 0:s.profile;n._subStore.updateSubscribeUserData(c,a,{subscribeTime:u,expiry:l,userId:a,subscribeType:c,profile:p,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:r,newSubscribeUserProfileList:i,subscribeUserChangeList:o}},e.prototype.clearSubscribeStatus=function(){this._subStore.clearSubscribeStatusData(nt.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(nt.USER_PROFILE)},e.prototype.updateSubscribeUserOnlineStatus=function(e){var t=this,n=[];return e.forEach((function(e){var r=e.subUserId,i=e.data,s=t._subStore.getSubscribeUserData(nt.ONLINE_STATUS,r);if(s){var a=[],u=o({},s.statusMap);i.forEach((function(e){var t=u[e.platformInfo];if(!(t&&t.changeTime>e.versionTime)){var n={eventValue:e.value,changeTime:e.versionTime};u[e.platformInfo]=n,a.push(o(o({},n),{platform:e.platformInfo}))}})),t._subStore.updateSubscribeUserData(nt.ONLINE_STATUS,r,{subscribeTime:s.subscribeTime,expiry:s.expiry,userId:r,subscribeType:nt.ONLINE_STATUS,statusMap:u}),n.push({userId:r,subscribeType:nt.ONLINE_STATUS,subscribeTime:s.subscribeTime,expiry:s.expiry,details:a})}})),n},e.prototype.updateSubscribeUserProfile=function(e){var t=this,n=[];return e.forEach((function(e){var r=e.userId,i=e.version,s=e.userProfile,a=e.userExtProfile,u=t._subStore.getSubscribeUserData(nt.USER_PROFILE,r),c=Or(r,s,a);u?u.profile&&u.profile.version>=i||(t._subStore.updateSubscribeUserData(nt.USER_PROFILE,r,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:r,subscribeType:nt.USER_PROFILE,profile:{info:c,version:i},isSubscribed:u.isSubscribed}),u.isSubscribed&&n.push({userId:r,subscribeType:nt.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:o({},c)})):t._subStore.updateSubscribeUserData(nt.USER_PROFILE,r,{subscribeTime:0,expiry:0,userId:r,subscribeType:nt.USER_PROFILE,profile:{info:c,version:i},isSubscribed:!1})})),n},e.prototype.getSubscribeUserStatus=function(e,t){var n=this,r=[];return t.forEach((function(t){var i=n._subStore.getSubscribeUserData(e,t);if(!i||i.expiry<(Date.now()+n._delayTime-i.subscribeTime)/1e3)n._subStore.removeSubscribeUserData(e,t);else{var s={subscribeTime:i.subscribeTime,expiry:i.expiry,userId:i.userId,subscribeType:i.subscribeType};if(e===nt.ONLINE_STATUS){var a=i.statusMap,u=Object.keys(a).map((function(e){return o({platform:~~e},a[~~e])}));s.details=Nr(u)}else if(e===nt.USER_PROFILE&&!i.isSubscribed)return;r.push(s)}})),r},e.prototype.getUserProfiles=function(e){var t=this,n=[],r=[];return e.forEach((function(e){var i=t._subStore.getSubscribeUserData(nt.USER_PROFILE,e);if(i&&i.profile){var s=i.profile,a=s.version,u=s.info;if(i.isSubscribed)return t._delayTime+Date.now()-a>J?void r.push(e):void n.push(o(o({},u),{extraProfile:o({},u.extraProfile)}));t._delayTime+Date.now()-a>X?r.push(e):n.push(o(o({},u),{extraProfile:o({},u.extraProfile)}))}else r.push(e)})),{list:n,needQueryUserIds:r}},e.prototype.getSubscribeUserList=function(e,t,n){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,n).map((function(t){var n={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===nt.ONLINE_STATUS){var r=Object.keys(t.statusMap).map((function(e){return o({platform:~~e},t.statusMap[~~e])}));n.details=Nr(r)}return n}))},e.prototype.updateOwnProfile=function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)},e.prototype.getOwnProfile=function(){return this._subStore.getOwnProfile()},e}(),Kl=function(){function e(e,t,n,r,i,o,s){this._connectManager=e,this._event=t,this._currentUserId=n,this._delayTime=r,this._logger=i,this._isOpenUserProfile=o,this._subDriven=s,this._isPullingRelationship=!1,this._pullRelationshipQueue=[],this._pullRelationshipFailTime=0,this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue=[],this._pullSubUserStatusFailTime=0,this._subscribeService=new Yl(r)}return e.prototype.syncData=function(){return a(this,void 0,void 0,(function(){return u(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(nt.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(nt.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(nt.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(nt.FRIEND_USER_PROFILE),[2]}}))}))},e.prototype.startSyncSubscribeRelationship=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship(),[2]}))}))},e.prototype._syncSubscribeRelationship=function(e){return void 0===e&&(e=!0),a(this,void 0,void 0,(function(){return u(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]}}))}))},e.prototype._pullSubscribeRelationship=function(e,t){return void 0===t&&(t=""),a(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,l,d,h,p,_,g,f,E;return u(this,(function(u){switch(u.label){case 0:return n=this._subscribeService.getRelationshipStatusVersion(),r=this._logger.createTraceId(),this._logger.info(Re.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:n,_pageToken:t}),r),i=this._connectManager.codec.encodePullUserSubReq({version:n,pageToken:t}),o=new Oo(Po[Po.pullUserSub],i,this._currentUserId),[4,this._connectManager.send(o,su)];case 1:return s=u.sent(),a=s.code,c=s.data,a===re.SUCCESS&&c?(this._pullRelationshipFailTime=0,l=c.list,d=c.version,h=c.hasNext,p=c.pageToken,d=Ln(d),l.forEach((function(e){e.subTime=Ln(e.subTime)})),this._logger.info(Re.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:a,data:c}),r),e?(_=this._subscribeService.updateSubscribeRelation(l),g=_.newSubscribeOnlineStatusList,f=_.newSubscribeUserProfileList,E=_.subscribeUserChangeList,this._event.subscribeRelationChanged(E),g.length>0&&this._queryAndUpdateUserOnlineStatus(g),f.length>0&&this._queryAndUpdateUserProfile(f)):this._subscribeService.updateSubscribeRelation(l,!t),this._subscribeService.updateRelationshipStatusVersion(d),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>d})),h?[4,this._pullSubscribeRelationship(e,p)]:[3,3]):(this._logger.error(Re.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:a,failTime:this._pullRelationshipFailTime}),r),this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:u.sent(),u.label=3;case 3:return[2]}}))}))},e.prototype.startsyncSubscribeUserStatus=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus(),[2]}))}))},e.prototype._syncSubscribeUserStatus=function(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){return u(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]}}))}))},e.prototype._pullSubscribeUserStatus=function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=""),a(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,l,d,h,p,_,g,f;return u(this,(function(u){switch(u.label){case 0:return n=this._subscribeService.getSubscribeUserStatusVersion(),r=this._logger.createTraceId(),this._logger.info(Re.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:n,_pageToken:t,needAllData:e}),r),i=this._connectManager.codec.encodePullSubDataReq({version:n,needAllData:e,pageToken:t}),o=new Oo(Po[Po.pullSubData],i,this._currentUserId),[4,this._connectManager.send(o,lu)];case 1:return s=u.sent(),a=s.code,c=s.data,a===re.SUCCESS&&c?(this._pullSubUserStatusFailTime=0,l=c.list,d=c.versionTime,h=c.hasNext,p=c.pageToken,_=c.isFull,d=Ln(d),this._logger.info(Re.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:a,data:c}),r),l.forEach((function(e){e.data.forEach((function(e){e.versionTime=Ln(e.versionTime)}))})),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>d})),this._subscribeService.updateSubscribeUserStatusVersion(d),g=[],f=[],l.forEach((function(e){e.subType===nt.ONLINE_STATUS?g.push(e):e.subType===nt.USER_PROFILE&&f.push(e.subUserId)})),_&&""===t&&this._subscribeService.clearSubscribeStatus(),g.length>0&&this._updateUserOnlineStatus(g,!_),f.length>0?[4,this._queryAndUpdateUserProfile(f,!_)]:[3,3]):(this._logger.warn(Re.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:a,failTime:this._pullSubUserStatusFailTime}),r),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:u.sent(),u.label=3;case 3:return h?[4,this._pullSubscribeUserStatus(e,p)]:[3,5];case 4:u.sent(),u.label=5;case 5:return[2]}}))}))},e.prototype._queryAndUpdateUserOnlineStatus=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(Re.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),n=this._connectManager.codec.encodeQrySubDataReq(nt.ONLINE_STATUS,e),r=new Oo(Po[Po.qrySubData],n,this._currentUserId),[4,this._connectManager.send(r,lu)];case 1:return i=a.sent(),o=i.code,s=i.data,this._logger.info(Re.L_QUERY_SUBSCRIBE_DATA_R,JSON.stringify({code:o,data:s}),t),o===re.SUCCESS&&s?(this._updateUserOnlineStatus(s.list),[2]):[2]}}))}))},e.prototype._updateUserOnlineStatus=function(e,t){void 0===t&&(t=!0),e.forEach((function(e){e.data.forEach((function(e){e.versionTime=Ln(e.versionTime)}))}));var n=this._subscribeService.updateSubscribeUserOnlineStatus(e);n=n.filter((function(e){return e.details&&e.details.length>0})),t&&n.length>0&&this._event.subscribeUserStatusChanged(n)},e.prototype._queryAndUpdateUserProfile=function(e,t){return void 0===t&&(t=!0),a(this,void 0,void 0,(function(){var n,r,i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return n=this._logger.createTraceId(),this._logger.info(Re.L_PULL_USER_PROFILE_T,JSON.stringify(e),n),r=this._connectManager.codec.encodePullUserProfileReq(e),i=new Oo(Po[Po.pullUserProfile],r,this._currentUserId),[4,this._connectManager.send(i,Iu)];case 1:return o=u.sent(),s=o.code,a=o.data,this._logger.info(Re.L_PULL_USER_PROFILE_R,JSON.stringify({code:s,data:a}),n),s===re.SUCCESS&&a?(a.UserProfile.forEach((function(e){e.version=Ln(e.version)})),c=this._subscribeService.updateSubscribeUserProfile(a.UserProfile),t&&c.length>0&&this._event.subscribeUserStatusChanged(c),[2,{code:s,data:a.UserProfile}]):[2,{code:s}]}}))}))},e.prototype.updateUserStatus=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i;return u(this,(function(o){switch(o.label){case 0:return(t=this._connectManager.codec.decodeByPBName(e.data,du)).subType!==nt.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==nt.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==nt.FRIEND_ONLINE_STATUS?[3,3]:(n=t.data.map((function(e){return{changeTime:Ln(e.versionTime),eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:n}]),[3,5]);case 3:return t.subType!==nt.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:r=o.sent(),(i=r.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Or(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),o.label=5;case 5:return[2]}}))}))},e.prototype.getSubscribeUserStatus=function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)},e.prototype.getSubscribeUserList=function(e,t,n){return this._subscribeService.getSubscribeUserList(e,t,n)},e.prototype.updateSubscribeRelation=function(e,t,n,r){return void 0===r&&(r=0),a(this,void 0,void 0,(function(){var i,o,s,a,c,l;return u(this,(function(u){switch(u.label){case 0:return i=this._connectManager.codec.encodeUpdateUserSubReq(t,e,n,r),o=new Oo(Po[Po.updUserSub],i,this._currentUserId),[4,this._connectManager.send(o,ou)];case 1:return s=u.sent(),a=s.code,c=s.data,a===re.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT&&c?[2,{code:a,data:c.subUsers.map((function(e){return e.subUserId}))}]:a===re.SUCCESS&&c?(l=c.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:l,expiry:r,opType:n,subUsers:e.map((function(e){return{subUserId:e}}))}]),n===rt.SUBSCRIBE&&(t===nt.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===nt.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,{code:a}]):[2,{code:a}]}}))}))},e.prototype.getUserProfiles=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return t=this._subscribeService.getUserProfiles(e),n=t.needQueryUserIds,r=t.list,0===n.length?[2,Promise.resolve({code:re.SUCCESS,data:r})]:[4,this._queryAndUpdateUserProfile(n,!1)];case 1:return i=u.sent(),o=i.code,s=i.data,o===re.SUCCESS&&s?(a=s.map((function(e){return Or(e.userId,e.userProfile,e.userExtProfile)})),[2,{code:o,data:c(c([],r,!0),a,!0)}]):[2,{code:o,data:c([],r,!0)}]}}))}))},e.prototype.syncOwnProfile=function(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,d,h,p;return u(this,(function(u){switch(u.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(Re.L_PULL_OWN_PROFILE_T,"",t),n=this._connectManager.codec.encodeUserProfileInput(),r=new Oo(Po[Po.pullOwnProfile],n,this._currentUserId),[4,this._connectManager.send(r,_u)]):[2,Promise.resolve({code:re.RC_USER_PROFILE_SERVICE_UNAVAILABLE})];case 1:return i=u.sent(),o=i.code,s=i.data,this._logger.info(Re.L_PULL_OWN_PROFILE_R,JSON.stringify({code:o,data:s}),t),o===re.SUCCESS&&s?(a=s.userExtProfile,c=s.userProfile,l=s.version,d=s.userId,h=Ln(l),p=Or(d,c,a),this._subscribeService.updateOwnProfile(p,h),e&&this._event.ownUserProfileChanged(p),[2,{code:o,data:p}]):[2,{code:o}]}}))}))},e.prototype.getOwnProfile=function(){return a(this,void 0,void 0,(function(){var e;return u(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,{code:re.SUCCESS,data:e}]:[2,this.syncOwnProfile()]}))}))},e.prototype.updateOwnProfile=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))},e}();function ql(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:Ln(e.relationTime),inBlackList:!!e.flag}})):[]}function jl(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:Ln(e.operateTime),extra:e.info||"",friendType:e.friendType}})):[]}var Ql=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._pullQueue=[],t._isPulling=!1,t}return r(t,e),t.prototype.startPull=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return this._isPulling?[2]:(this._isPulling=!0,[4,this.pullQueueConsumption()]);case 1:return e=a.sent(),t=e.code,n=e.data,this._isPulling=!1,r=n&&n.hasNext||!1,t!==re.SUCCESS||Zt(n)||(this.pullDataHandler(n),i=this.getVersion(),o=this._pullQueue.filter((function(e){return e>i})),this._pullQueue.length=0,(s=this._pullQueue).push.apply(s,o)),r?(this.startPull(),[2]):(this._pullQueue.length>0&&(this._pullQueue.length=0,this.startPull()),[2])}}))}))},t.prototype._triggerPull=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this.startPull()];case 1:return t.sent(),[2]}}))}))},t}(Bo),Wl=function(e){function t(t,n,r,i,o,s){var a=e.call(this)||this;return a.runtime=t,a._connectManager=n,a._currentUserId=r,a._logger=i,a._appkey=o,a._callBack=s,a._lastPullingChangeMessageTime=0,a._lastPullingChangeMessageTimeLocal=(new Date).getTime(),a._duration=18e4,a._pullEventChangeIntervalTimer=-1,a._localStorageKey=Z.PULL_EVENT_CHANGE_TIME_KEY(o,r),a._storage=new p(t,a._localStorageKey),a._lastPullingChangeMessageTime=a._storage.get(r)||0,a}return r(t,e),Object.defineProperty(t.prototype,"_isConnected",{get:function(){return this._connectManager.getConnectionStatus()===Zc.CONNECTED},enumerable:!1,configurable:!0}),t.prototype._setLastPullingChangeMessageTime=function(e){this._lastPullingChangeMessageTime=e,this._storage.set(this._currentUserId,e)},t.prototype._startPullEventChangeInterval=function(){var e=this,t=function(){e._pullEventChangeIntervalTimer=setTimeout((function(){var n=Date.now();n-e._lastPullingChangeMessageTimeLocal>=e._duration&&(e.startPullEventChange(e._lastPullingChangeMessageTime,!0),e._lastPullingChangeMessageTimeLocal=n),e._stopUltraSyncInterval(),t()}),3e4)};t()},t.prototype._stopUltraSyncInterval=function(){-1!==this._pullEventChangeIntervalTimer&&(clearTimeout(this._pullEventChangeIntervalTimer),this._pullEventChangeIntervalTimer=-1)},t.prototype.startPullEventChange=function(e,t){void 0===t&&(t=!1);var n=this.getVersion();(e>n||0===e||t)&&this._triggerPull(n)},t.prototype.pullQueueConsumption=function(){if(!this._isConnected)return Promise.resolve({code:re.CONNECTION_TIMEOUT});this._logger.info(Re.L_PULL_EVENT_CHANGE_T,"PullEventChange time: "+this._lastPullingChangeMessageTime);var e=this._connectManager.codec.encodeQueryMsgChange(this._lastPullingChangeMessageTime),t=new Oo(Po[Po.pullEventChange],e,this._currentUserId);return t.setHeaderQos(Ei.AT_LEAST_ONCE),this._connectManager.send(t,Va)},t.prototype.pullDataHandler=function(e){this._logger.info(Re.L_PULL_EVENT_CHANGE_R,"PullEventChange data: "+JSON.stringify(e));var t=e.list,n=(null==e?void 0:e.syncTime)||0;this._callBack(t),this._setLastPullingChangeMessageTime(n)},t.prototype.getVersion=function(){return this._lastPullingChangeMessageTime||0},t.prototype.notificationOnline=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){return this._isConnected?(this.startPullEventChange(this._lastPullingChangeMessageTime,!0),this._startPullEventChangeInterval(),this._logger.info(Re.L_PULL_EVENT_CHANGE_NOTIFY_ULTRA_ONLINE_S,"PullEventChange notify online"),[2]):[2]}))}))},t}(Ql),Jl=function(e,n,r,i,o,s,a){return{conversationType:e,targetId:n,senderUserId:s,messageDirection:te.SEND,isCounted:!!r.isCounted,isMentioned:!!r.isMentioned,content:r.content,messageType:r.messageType,isOffLineMessage:!1,isPersited:!!r.isPersited,messageUId:i,sentTime:o,receivedTime:0,disableNotification:!!r.disableNotification,isStatusMessage:!!r.isStatusMessage,canIncludeExpansion:!!r.canIncludeExpansion,expansion:r.canIncludeExpansion?r.expansion:null,receivedStatus:t.UNREAD,receivedStatusInfo:mr(t.UNREAD),pushConfig:r.pushConfig,channelId:r.channelId,isInterrupt:r.isInterrupt,messageId:a||0,sentStatus:Me.SENT,directedUserIds:r.directionalUserIdList,disableUpdateLastMessage:r.disableUpdateLastMessage}},Xl=function(e){return e.sort((function(e,t){var n,r,i=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-i})),e};Ke.CHANNEL_CHANGE,Ke.MSG_RECALL,Ke.MSG_EXPANSION,Ke.MSG_MODIFY,Ke.USER_GROUP_CHANGE;var Zl=[Rt.GROUP_OPERATION,Rt.GROUP_PROFILE_CHANGE,Rt.GROUP_APPLICATION_INVITATION,Rt.GROUP_FOLLOW_USER_CHANGE],zl=[Mt.FRIEND_APPLICATION];function $l(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a(this,void 0,void 0,(function(){return u(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve({code:re.RC_NET_UNAVAILABLE})]}))}))},n}}var ed=function(e){function n(t,n,r,i){var o=e.call(this,t,n,r,i,new Bc(i.appkey,"RC-E","IM"),new Ol(i.appkey,"RC-E","IM"))||this;o._customMessageType={},o._reconnectTimer=-1,o._pullOfflineFinished=!1,o.currentUserId="",o._openCallPlus=!1,o.cloudControllerUri="",o._pullingMsg=!1,o._pullQueue=[],o._chrmsQueue={},o._latestSyncTimestamp=0,o._intervalTimer=-1,o._latestPullKVMsgTimestamp=0,o._intervalTimerForChrmPull=-1,o._handleInnerMsgOptions=function(e,t,n){var r,i=n.messageType;if(i===ce.SYNC_READ_STATUS&&br(e)&&Object.assign(n,{directionalUserIdList:[o.currentUserId]}),i===ce.READ_RECEIPT_RESPONSE){if(!n.content.receiptMessageDic||0===Object.keys(n.content.receiptMessageDic).length){var s=null===(r=o._readReceiptManager)||void 0===r?void 0:r.getReceiptMessageDic({conversationType:e,targetId:t,channelId:n.channelId});n.content.receiptMessageDic=s||{}}for(var a in n.directionalUserIdList=[],n.content.receiptMessageDic)n.directionalUserIdList.push(a)}return n},o._lastSyncUltraMsgTimeStamp=0,o._lastSyncUltraMsgLocalTimeStamp=0,o._ultraGroupTimer=-1,o._isUltraPulling=!1,o._ultraGroupTimeQue=[],o._isUltraGroupListExist=!1,o._ultraGroupMap={},o._ultraMsgMap={},o._pullUltraChangeMessageQue=[],o._isPullingUltraChangeMessage=!1,o._lastPullingUltraChangeMessageTime=0;var s=i.appkey,a=i.logOutputLevel,u=i.logExpireTime,c=i.navigators,l=i.areaCode,d=i.logServerUrl,h=i.miniCMPProxy,p=i.environment;return o._environment=p||"default",o.logger.setOutputLevel(a),Ci.init({areaCode:l,navigators:c,logServerUrl:d,miniCMPProxy:h}),yc(s,o.logger,t,u),o.reporter=new Xc(s,o.runtime,o.logger,o._options.__reportLogLevel),o.navi=new ns(s,o.logger,o.statisticLog,t,new wl(s,o.logger,t),o._environment),gl(s,o.logger,u),o.reporterStatistic=new Dl(s,o.runtime,o.logger,o.statisticLog),o._letterbox=new bo(t,s),o._sendMessageStore=new rs(t,s),o._chrmEntryHandler=new Vo(o),o._connMgr=new cl(s,o.navi,o.logger,o.statisticLog,o.runtime,{signal:o._signalHandler.bind(o),onConnected:o.onConnected.bind(o),onDisconnected:o.onDisconnected.bind(o),onConnecting:o._watcher.onConnecting,onSuspend:o.onSuspend.bind(o)}),"browser"===o.runtime.tag&&o._initCloudController(),o}return r(n,e),n.prototype._initCloudController=function(){var e=Ci.getCloudControllerUrl();this.cloudControllerUri=e[0],this.cloudController=new kl(this._appkey,this.runtime,this.logger,this.reporter,this.statisticLog),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Tl.init)},n.prototype.onConnected=function(){var e,t=this.navi.getNaviInfoFromCache(this._connMgr.getToken()),n=this._connMgr.getCurrentUserId();this.currentUserId=n,this._pullOfflineFinished=!1,this._EventChangeManager||(this._EventChangeManager=new Wl(this.runtime,this._connMgr,this.currentUserId,this.logger,this._appkey,this._handleEventChangeList.bind(this))),this._joinedChrmManager||(this._joinedChrmManager=new Go(t.joinMChrm)),this._conversationManager||(this._conversationManager=new Jo(this,this._appkey,this.currentUserId,this._watcher.conversation,this._watcher.conversationTag)),this._ultraGroupManager||(this._ultraGroupManager=new ds(this,this._appkey,this.currentUserId)),this._userSettingManager||(this._userSettingManager=new Xo(this,this._appkey,this.currentUserId,this._watcher.tag)),this._readReceiptManager||(this._readReceiptManager=new xl(this.runtime,this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(t),this._conversationManager.startPullConversationStatus(0),this._conversationManager.adaptOldStore(),this._userSettingManager.pullUserSettings(0),this._sendMessageStore.init(this.currentUserId),this._rejoinChrm(),this._startSyncInterval(),this._openCallPlus&&this._syncCallPullKVMsg(),1===t.ugMsg&&this._notificationOnline(),1===t.eventDriven&&(null===(e=this._EventChangeManager)||void 0===e||e.notificationOnline()),this._watcher.onConnected(),this.reporter.checkStart(t),this.reporterStatistic.checkStart(t)},n.prototype.onDisconnected=function(e){var t,n,r;this._resetMemoryState(),null===(t=this._userSettingManager)||void 0===t||t.stopAllTask(),null===(n=this._conversationManager)||void 0===n||n.stopAllTask(),null===(r=this._EventChangeManager)||void 0===r||r.stopAllTask(),this._watcher.onDisconnected(e)},n.prototype.onSuspend=function(e){var t,n,r;null===(t=this._userSettingManager)||void 0===t||t.stopAllTask(),null===(n=this._conversationManager)||void 0===n||n.stopAllTask(),null===(r=this._EventChangeManager)||void 0===r||r.stopAllTask(),this._watcher.onSuspend(e)},n.prototype._initSubscribeManager=function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new Kl(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var n,r;null===(r=(n=t._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(n,e)},subscribeUserStatusChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedUserStatusChange)||void 0===r||r.call(n,e)},subscribeRelationChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedRelationChange)||void 0===r||r.call(n,e)},ownUserProfileChanged:function(e){var n,r;null===(r=(n=t._watcher).ownUserProfileChanged)||void 0===r||r.call(n,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())},n.prototype.createLogger=function(e,t){return new Bc(this._appkey,e,t)},n.prototype.createStatisticLogger=function(e,t){return new Ol(this._appkey,e,t)},n.prototype.refetchNaviInfo=function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())},n.prototype.getNaviInfoFromCache=function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())},n.prototype.getConnectedTime=function(){return this._connMgr.getConnectedTime()},n.prototype.getConnectionStatus=function(){return this._connMgr.getConnectionStatus()},n.prototype.connect=function(e,t,n,r){return a(this,void 0,void 0,(function(){return u(this,(function(i){return this._openCallPlus=n,[2,this._connMgr.connect(e,t,n,r)]}))}))},n.prototype._signalHandler=function(e,t){var n,r=e.syncMsg,i=e.topic;if(r)this._receiveSyncMsg(e,t);else{var o=this.logger.createTraceId();this.logger.debug(Re.L_RECV_RMTP_O,i,o);var s=Po[i];if(s)switch(s){case Po.s_ntf:this._pullMsg(e);break;case Po.s_msg:this._receiveMsg(e);break;case Po.s_cmd:this._receiveStateNotify(e);break;case Po.s_us:this._receiveSettingNotify(e);break;case Po.rtc_ntf:this._receiveRtcKv(e.data);break;case Po.s_opNtf:this._pullOperateStatusNotify(e);break;case Po.s_pubCall:this._pubCallInfo(e);break;case Po.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(e)}else this.logger.error(Re.L_RECV_RMTP_E,i,o)}},n.prototype._receiveStateNotify=function(e){var t,n,r,i=this._connMgr.codec.decodeByPBName(e.data,Rs),o=i.time,s=i.type,a=i.chrmId;switch(s){case 2:this._chrmEntryHandler.pullEntry(a,o);break;case 3:this._conversationManager.startPullConversationStatus(o);break;case 4:this._chrmEntryHandler.reset(a),this._watcher.chatroom({chatroomDestroyed:e.targetId});break;case 6:this._ultraGroupTimeQue.push(o),this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp);break;case 7:this._pullUltraChangeMessageQue.push(o),this._pullUltraChangeMessageList(this._lastPullingUltraChangeMessageTime);break;case 8:null===(t=this._subscribeManager)||void 0===t||t.startsyncSubscribeUserStatus(o);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(o);break;case 10:null===(r=this._subscribeManager)||void 0===r||r.syncOwnProfile(!0);break;case 11:this._EventChangeManager.startPullEventChange(o)}},n.prototype._receiveSettingNotify=function(e){var t=this._connMgr.codec.decodeByPBName(e.data,oa).version;this._userSettingManager.pullUserSettings(t)},n.prototype._receiveMessageExpansion=function(e){var t=e.content,n=e.channelId,r=void 0===n?"":n,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:r,conversationType:i,targetId:o}}),a&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:a,channelId:r,conversationType:i,targetId:o}})},n.prototype._clearUltraGroupUnreadCount=function(e,t){var n=this._connMgr.codec.decodeByPBName(e.data,ws),r=n.targetId,i=n.channelId,o=n.timestamp,s=this._ultraGroupMap[i+"_"+r];s&&(s.unreadMessageCount=0,s.unreadMentionedCount=0,s.unreadMentionedMeCount=0,s.firstUnreadMessage&&(s.firstUnreadMessage=null),s.lastReadTime=o,this._watcher.conversation(Sr([s]))),t&&(this._ultraMsgMap[t.messageUId]=t.timestamp)},n.prototype._receiveSyncMsg=function(e,t){var n,r=this,i=((n={})[Po[Po.ugMsg]]=function(){r._ultraGroupTimeQue.push(t.timestamp),r._syncUltraMsg(r._lastSyncUltraMsgTimeStamp)},n[Po[Po.updRTime]]=function(){r._receivesyncReadStatus(e)},n[Po[Po.updUgRTime]]=function(){r._clearUltraGroupUnreadCount(e,t)},n[Po[Po.updUserSub]]=function(){var e;null===(e=r._subscribeManager)||void 0===e||e.startSyncSubscribeRelationship(t.timestamp)},n);if(i[e.topic])i[e.topic]();else if(is.includes(e.topic)){var o=this._connMgr.codec.decodeByPBName(e.data,hs,{currentUserId:this.currentUserId,signal:e});((o=this._handleMsgProperties(o)).conversationType!==oe.CHATROOM||this._chrmsQueue[o.targetId])&&(this._pullingMsg?this._pullQueue.push((null==t?void 0:t.timestamp)||o.sentTime):(t&&(o.sentTime=t.timestamp,o.messageUId=t.messageUId,this._sendMessageStore.setMessage(t.messageUId,t.timestamp)),this.logger.info(Re.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:o.messageUId,messgeId:o.messageId,sentTime:o.sentTime})),o.messageType!==ce.EXPANSION_NOTIFY?((o.messageType===ce.SYNC_READ_STATUS||o.messageType===ce.READ_RECEIPT&&o.senderUserId===this.currentUserId)&&this._conversationManager.clearUnreadCount(o.conversationType,o.targetId,o.channelId,o.sentTime),o.messageType===ce.READ_RECEIPT_REQUEST&&this._processRRReqMsg(o),o.messageType===ce.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(o),this._conversationManager.setConversationCacheByMessage(o,!0),this._batchMessage([o])):this._receiveMessageExpansion(o)))}},n.prototype._batchMessage=function(e){for(var t=this,n=[],r=[],i=[],o=e.length-1;o>=0;o-=1){var s=e[o];s.messageType===ce.LOG_COMMAND&&s.senderUserId===Q?r.unshift(s):s.messageType===ce.CLOUD_CONTROL&&s.senderUserId===Q?i.push(s):n.unshift(s)}this._watcher.batchMessage(n),r.forEach((function(e){var n=e.content,r=n.startTime,i=n.endTime,o=n.platform,s=n.logId,a=n.uri;t.reporter.report(parseInt(r,10),parseInt(i,10),o,a,s,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)},n.prototype._ccMsgHandler=function(e){var t;return a(this,void 0,void 0,(function(){var n,r,i;return u(this,(function(o){switch(o.label){case 0:return e.shift()?(n=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,Tl.other,n)]):[3,2];case 1:r=o.sent()||0,(i=e.filter((function(e){return e.sentTime>r}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))},n.prototype._pubCallInfo=function(e){var t=this._connMgr.codec.decodeByPBName(e.data,Qa),n=t.key,r=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:n,value:r}]}))},n.prototype._pullMsg=function(e){var t=this._connMgr.codec.decodeByPBName(e.data,Rs),n=t.type,r=t.chrmId,i=t.time;if(this.logger.info(Re.L_RECV_S_NTF_O,"type: "+n+", chrmId: "+n+", time: "+i),2===n){var o=this._chrmsQueue[r];if(!o)return;o.queue.push(i),this._pullChrmMsg(r)}else this._pullQueue.push(i),this._syncMsg()},n.prototype._receivesyncReadStatus=function(e){var t=this._connMgr.codec.decodeByPBName(e.data,ws),n=t.conversationType,r=t.targetId,i=t.channelId,o=t.timestamp,s=t.sentTime;this._conversationManager.clearUnreadCount(n,r,i,s),this._watcher.syncReadStatus({conversationType:n,targetId:r,channelId:i,timestamp:o})},n.prototype._startSyncInterval=function(){var e=this;this._stopSyncInterval();this._intervalTimer=setInterval((function(){Date.now()-e._latestSyncTimestamp>=18e4&&e._syncMsg()}),3e4),this._latestSyncTimestamp=Date.now(),this._syncMsg()},n.prototype._stopSyncInterval=function(){-1!==this._intervalTimer&&(clearInterval(this._intervalTimer),this._intervalTimer=-1)},n.prototype._syncCallPullKVMsg=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i;return u(this,(function(o){switch(o.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodePullKVMsg(this._latestPullKVMsgTimestamp),t=new Oo(Qi,e,this.currentUserId),[4,this._connMgr.send(t,Ja)]):[2];case 1:return n=o.sent(),r=n.code,i=n.data,r===re.SUCCESS&&i?(this._latestPullKVMsgTimestamp=i.maxTime,this._watcher.callInfo(JSON.stringify({list:i.info})),[2]):[2]}}))}))},Object.defineProperty(n.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===Zc.CONNECTED},enumerable:!1,configurable:!0}),n.prototype._filterMessage=function(e){var t=e.messageType;return t===ce.DELIVERED||t===ce.DELIVERED_MSG||t===ce.SYNC_READ_STATUS&&!this._processSRSMsg(e)},n.prototype._messageProcessor=function(e){var t=this,n=0,r=[],i=[],o=[],s=[],a=[];return e.forEach((function(e){var u=e.conversationType,c=e.targetId,l=e.channelId,d=e.messageDirection,h=e.messageUId,p=e.messageType,_=e.sentTime,g=e.senderUserId,f=e.content;if(r.push(h),d===te.SEND){n=Math.max(_,n);var E=t._sendMessageStore.getSendMessageMap(),I=p===ce.RECALL?"Cmd:"+f.messageUId:h;if(E[I])return void t._sendMessageStore.removeByUID(I)}if(!t._filterMessage(e))if(p!==ce.EXPANSION_NOTIFY)if(_>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,h)&&a.push(h),p===ce.READ_RECEIPT&&g===t.currentUserId&&t._conversationManager.clearUnreadCount(u,c,l,_),p!==ce.READ_STATE){p===ce.READ_RECEIPT_REQUEST&&t._processRRReqMsg(e),p===ce.READ_RECEIPT_RESPONSE&&t._processRRRspMsg(e);var T=t._handleMsgProperties(e);t._conversationManager.setConversationCacheByMessage(T,!0),i.push(T)}else s.push(e);else o.push(e)})),{newOutboxTime:n,messageUIds:r,messages:i,messageExpansionList:o,RSMsgList:s,msgUIds2Statistic:a}},n.prototype._processSRSMsg=function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=e.content,o=e.senderUserId,s=e.sentTime;if(o!==this.currentUserId)return!1;var a=this.getNaviInfoFromCache();return this._conversationManager.clearUnreadCount(t,n,r,s),1!==a.sesDriven||(s>this.getConnectedTime()||this._watcher.syncReadStatus({conversationType:t,targetId:n,channelId:r,timestamp:i.lastMessageSendTime}),!1)},n.prototype._processRSMsg=function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=e.content,s={conversationType:t,targetId:n,channelId:r};this._watcher.messageReadReceipt(t===oe.PRIVATE?{privateReadReceipt:o(o({},s),{endMsgTime:i.endMsgTime})}:{groupReadReceipt:o(o({},s),{totalCount:i.tmn,readedCount:i.rrn,messageUId:i.msgId})})},n.prototype._processRRReqMsg=function(e){var t,n=e.conversationType,r=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:n,channelId:r,targetId:i},o.messageUId,a,s,u)},n.prototype._processRRRspMsg=function(e){var t,n=this,r=e.conversationType,i=e.channelId,o=e.targetId,s=e.content,a=e.senderUserId,u=s.receiptMessageDic,c=void 0===u?{}:u;if(a===this.currentUserId)for(var l in c)for(var d=0,h=c[l];d<h.length;d++){var p=h[d];null===(t=this._readReceiptManager)||void 0===t||t.remove({conversationType:r,channelId:i,targetId:o},p)}else(c[this.currentUserId]||[]).forEach((function(e){var t;null===(t=n._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:r,channelId:i,targetId:o},e,a)}))},n.prototype._syncMsg=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a,c,l,d,h,p,_,g,f,E,I,T,R,v,C,y,S=this;return u(this,(function(u){switch(u.label){case 0:return this._pullingMsg?[2]:this._isConnected?(this._pullingMsg=!0,e=this._letterbox.getOutboxTime(this.currentUserId),t=this._letterbox.getInboxTime(this.currentUserId),n=this._letterbox.getBroadcastSyncTime(this.currentUserId),r=this._connMgr.codec.encodeSyncMsg({sendboxTime:e,inboxTime:t,broadcastSyncTime:n}),i=new Oo(Po[Po.pullMsg],r,this.currentUserId),o=this.logger.createTraceId(),this.logger.info(Re.L_PULL_MSG_T,JSON.stringify({outboxTime:e,inboxTime:t,broadcastSyncTime:n}),o),[4,this._connMgr.send(i,gs,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId,customMessageTypes:this._customMessageType})]):(this._pullingMsg=!1,[2]);case 1:if(s=u.sent(),a=s.code,c=s.data,this._latestSyncTimestamp=Date.now(),this._pullingMsg=!1,a!==re.SUCCESS||!c||Zt(c.finished)||Zt(c.list)||Zt(c.syncTime))return this.logger.warn(Re.L_PULL_MSG_R,JSON.stringify({code:a,timestamp:this._latestSyncTimestamp}),o),[2];l=c.list,d=c.finished,h=c.syncTime,p=c.broadcastSyncTime,_=void 0===p?1:p,this.logger.info(Re.L_PULL_MSG_R,JSON.stringify({syncTime:h,finished:d,messages:l.map((function(e){return{messageUId:e.messageUId,messageId:e.messageId,sentTime:e.sentTime}}))}),o);try{if(g=this._messageProcessor(l),f=g.newOutboxTime,E=g.messageUIds,I=g.messages,T=g.messageExpansionList,R=g.RSMsgList,(v=g.msgUIds2Statistic).length>0&&this.statisticLog.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:v.join(",")})),this._batchMessage(I),T.forEach((function(e){S._receiveMessageExpansion(e)})),R.forEach((function(e){S._processRSMsg(e)})),this._letterbox.setInboxTime(h,this.currentUserId),this._letterbox.setOutboxTime(f,this.currentUserId),this._letterbox.setBroadcastSyncTime(_,this.currentUserId),this._sendMessageStore.removeByTimestamp(f),C=this._pullQueue.filter((function(e){return e>h})),this._pullQueue.length=0,(y=this._pullQueue).push.apply(y,C),d&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this._watcher.pullFinished()),this.logger.info(Re.L_PULL_MSG_R,JSON.stringify({code:a,messageUIds:E.join(","),timestamp:this._latestSyncTimestamp,hasmore:!d,tmpPullQueue:C}),o),!d)return this._syncMsg(),[2];this._pullQueue.length>0&&(this._pullQueue.length=0,this._syncMsg())}catch(e){this.logger.error(Re.L_PULL_MSG_E,null==e?void 0:e.stack,o)}return[2]}}))}))},n.prototype._receiveMsg=function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.data,_s,{currentUserId:this.currentUserId,connectedTime:this._connMgr.getConnectedTime()}),n=(t=this._handleMsgProperties(t)).conversationType,r=t.messageType,i=t.senderUserId,o=t.messageUId,s=t.sentTime,a=t.isStatusMessage;if(this.logger.info(Re.L_RECV_S_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),this._writeMessagesLog(n,o)&&this.statisticLog.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:o})),n!==oe.RTC_ROOM&&r!==ce.INTERCEPT){if(this._pullingMsg)return;if(this._pullQueue.length>0)return void this._syncMsg()}i===this.currentUserId&&this._sendMessageStore.setMessage(o,s),a||i===this.currentUserId||this._letterbox.setInboxTime(s,this.currentUserId),this._handleNotNotifyMsg(t)||(r===ce.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),r===ce.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._conversationManager.setConversationCacheByMessage(t,!0),this._batchMessage([t]))}},n.prototype._handleNotNotifyMsg=function(e){var t=e.messageType,n=e.senderUserId;return t===ce.DELIVERED||(t===ce.DELIVERED_MSG||(t===ce.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===ce.SYNC_READ_STATUS&&n!==this.currentUserId||t===ce.READ_STATE&&(this._processRSMsg(e),!0)))},n.prototype._handleMsgProperties=function(e,t){void 0===t&&(t=!1);var n,r=e.messageType,i=e.isStatusMessage,s=e.isCounted,a=void 0!==s&&s,u=e.isPersited,c=void 0!==u&&u,l=r in w,d=r in this._customMessageType;if(n=l?o(o({},w[r]),{isStatusMessage:G.includes(r)}):d?this._customMessageType[r]:{isCounted:a,isPersited:c,isStatusMessage:!1},Object.assign(e,n),t&&!Zt(i)&&(e.isStatusMessage=i),!t){var h=e.content.user;if(h){var p=h.portrait,_=h.portraitUri,g=p||_;g&&(h.portrait=h.portraitUri=g)}}return e},n.prototype._fixDownstreamData=function(e,t,n){return e&&2===t.list.length&&(t.hasMore=!0,0===n?t.list.shift():t.list.pop()),t},n.prototype.getHistoryMessage=function(e,t,n,r,i,o,s,c){var l;return void 0===o&&(o=""),a(this,void 0,void 0,(function(){var s,a,d,h,p,_,g,f,E,I,T,R=this;return u(this,(function(u){switch(u.label){case 0:return a=(s=this).currentUserId,d=s._connMgr,h=no[e]||Wi,p=1===r&&0===n,d?(_=d.codec.encodeGetHistoryMsg(t,{timestamp:n,count:p?2:r,order:i,channelId:o}),this.logger.info(Re.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:o,timestamp:n,count:r,order:i}),c),[4,d.send(new Oo(h,_,a),Cs,{currentUserId:a,connectedTime:d.getConnectedTime(),conversation:{targetId:t},afterDecode:function(n){var r,i=null===(r=R._readReceiptManager)||void 0===r?void 0:r.getReadReceiptInfo({conversationType:e,channelId:o,targetId:t},n.messageUId);if(i){var s=i.users;n.readReceiptInfo={isReceiptRequestMessage:!0,readerList:s}}return n}})]):[3,2];case 1:return g=u.sent(),f=g.code,E=g.data,f===re.SUCCESS&&E?(I=this._fixDownstreamData(p,E,i),T=[],null===(l=I.list)||void 0===l||l.forEach((function(e){e&&T.push(e.messageUId)})),this.logger.info(Re.L_GET_HISTORY_MSG_R,JSON.stringify({code:f,messageUIds:T.join(",")}),c),[2,{code:f,data:{list:I.list,hasMore:I.hasMore}}]):(this.logger.warn(Re.L_GET_HISTORY_MSG_R,JSON.stringify({code:f,messageUIds:""}),c),[2,{code:f}]);case 2:return[2,{code:re.RC_NET_CHANNEL_INVALID}]}}))}))},n.prototype.getMessages=function(e,t,n,r,i,o,s){return this.getHistoryMessage(e,t,n,r,i,o,s)},n.prototype.reportSDKInfo=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(Re.L_VER_REPORT_T,o,i),s=r.codec.encodeReportSDKInfo(o),a=new Oo(Po[Po.reportsdk],s,n),[4,r.send(a)]):[2];case 1:return(c=u.sent().code)!==re.SUCCESS&&this.logger.warn(Re.L_VER_REPORT_R,c,i),[2]}}))}))},n.prototype.deleteRemoteMessage=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,o,s,a,c,l,d;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(o=(i=this).currentUserId,s=i._connMgr,a=s.codec.encodeDeleteMessages(e,t,n,r),c=Li,e===oe.ULTRA_GROUP&&(c=Pi),l=new Oo(c,a,o),[4,s.send(l)]):[2,re.RC_NET_UNAVAILABLE];case 1:return d=u.sent(),[2,d.code]}}))}))},n.prototype.deleteRemoteMessageByTimestamp=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,o,s,a,c,l,d;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(o=(i=this).currentUserId,s=i._connMgr,a=s.codec.encodeClearMessages(t,n,r,e),c=ro[e],l=new Oo(c,a,o),[4,s.send(l)]):[2,re.RC_NET_UNAVAILABLE];case 1:return d=u.sent(),[2,d.code]}}))}))},n.prototype.batchClearRemoteHistoryMessages=function(e,t){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,i=r.codec.encodeBatchClearRemoteMessages(e),o=new Oo(qi,i,n),[4,r.send(o)]):[2,re.RC_NET_UNAVAILABLE];case 1:return s=a.sent(),[2,s.code]}}))}))},n.prototype.getConversationList=function(e,t,n,r,i){return void 0===e&&(e=300),a(this,void 0,void 0,(function(){var i,o,s,a,c,l,d,h,p=this;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(o=(i=this).currentUserId,s=i._connMgr,t=t||oe.PRIVATE,a=s.codec.encodeOldConversationList({count:e,type:t,startTime:n,order:r}),c=new Oo(ki,a,o),[4,s.send(c,Ss,{currentUserId:o,connectedTime:s.getConnectedTime(),afterDecode:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=p._conversationManager.get(t,n,r);Object.assign(e,i);var o=p._conversationManager.getDraft(t,n,r);return e.draft=o,e}})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return l=u.sent(),d=l.code,h=l.data,d!==re.SUCCESS?[2,{code:d}]:[2,{code:d,data:null==h?void 0:h.list}]}}))}))},n.prototype.removeConversation=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=this._connMgr,i=r.codec.encodeRemoveOldConversationList({conversationType:e,channelId:n,targetId:t}),o=new Oo(xi,i,t),[4,r.send(o)]):[2,re.RC_NET_UNAVAILABLE];case 1:return s=a.sent(),[2,s.code]}}))}))},n.prototype.batchRemoveConversation=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i;return u(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=this._connMgr,n=t.codec.encodeBatchDeleteConversation(e),r=new Oo(Hi,n,this.getCurrentUserId()),[4,t.send(r)]):[2,re.RC_NET_UNAVAILABLE];case 1:return i=o.sent(),[2,i.code]}}))}))},n.prototype.getConversation=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a,c,l;return u(this,(function(u){switch(u.label){case 0:return e!==oe.ULTRA_GROUP?[3,1]:(r=this._ultraGroupMap[n+"_"+t])?[3,3]:[2,{code:re.CONVER_GET_ERROR}];case 1:return(i=this._conversationManager.get(e,t,n))?[4,this.getHistoryMessage(e,t,0,1,0)]:[2,{code:re.CONVER_GET_ERROR}];case 2:if(o=u.sent(),s=o.code,a=o.data,s!==re.SUCCESS)return[2,{code:re.CONVER_GET_ERROR}];c=this._conversationManager.getDraft(e,t,n),l=(null==a?void 0:a.list[0])||null,r={conversationType:e,targetId:t,channelId:n,unreadMessageCount:i.unreadMessageCount||0,latestMessage:l,notificationStatus:i.notificationStatus||de.CLOSE,notificationLevel:i.notificationLevel||pe.NOT_SET,isTop:i.isTop||!1,lastUnreadTime:i.lastUnreadTime||0,unreadMentionedCount:i.unreadMentionedCount||0,draft:c},u.label=3;case 3:return[2,{code:re.SUCCESS,data:r}]}}))}))},n.prototype.getAllConversationUnreadCount=function(e,t,n){var r=this._conversationManager.getAllUnreadCount(e,t,n);return Promise.resolve({code:re.SUCCESS,data:r})},n.prototype.getTotalUnreadCountByLevels=function(e,t,n){void 0===n&&(n=!1);var r=0;if(e.includes(oe.ULTRA_GROUP)){if(!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});for(var i in this._ultraGroupMap){var o=this._ultraGroupMap[i];(0===t.length||t.includes(o.notificationLevel))&&(r+=n?o.unreadMentionedCount:o.unreadMessageCount)}}return r+=this._conversationManager.getTotalUnreadCountByLevels(e,t,n),Promise.resolve({code:re.SUCCESS,data:r})},n.prototype.getConversationUnreadCount=function(e,t,n){var r,i;return e===oe.ULTRA_GROUP?(i=(null===(r=this._ultraGroupMap[n+"_"+t])||void 0===r?void 0:r.unreadMessageCount)||0,i=this._getUnreadCount(i)):i=this._conversationManager.getUnreadCount(e,t,n),Promise.resolve({code:re.SUCCESS,data:i})},n.prototype.clearConversationUnreadCount=function(e,t,n){return this._conversationManager.clearUnreadCount(e,t,n,this.getServerTime(),!1),Promise.resolve(re.SUCCESS)},n.prototype.clearAllUnreadCount=function(){return this._conversationManager.clearAllUnreadCount(),Promise.resolve(re.SUCCESS)},n.prototype.getFirstUnreadMessage=function(e,t){throw new Error("Method not implemented.")},n.prototype.getFirstUnreadMessageInfo=function(e,t,n){var r=this._conversationManager.get(e,t,n),i=r.firstUnreadMessageUid,o=r.firstUnreadTime;return Promise.resolve({code:re.SUCCESS,data:o&&i?{messageUId:i,sentTime:o}:null})},n.prototype.saveConversationMessageDraft=function(e,t,n,r){return this._conversationManager.setDraft(e,t,n,r),Promise.resolve(re.SUCCESS)},n.prototype.getConversationMessageDraft=function(e,t,n){var r=this._conversationManager.getDraft(e,t,n);return Promise.resolve({code:re.SUCCESS,data:r})},n.prototype.clearConversationMessageDraft=function(e,t,n){return this._conversationManager.clearDraft(e,t,n),Promise.resolve(re.SUCCESS)},n.prototype.pullConversationStatus=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,d=this;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=(t=this)._connMgr,r=t.currentUserId,i=n.codec.encodeGetConversationStatus(e),o=new Oo(Po[Po.pullSeAtts],i,r),[4,n.send(o,aa)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return s=u.sent(),a=s.code,c=s.data,this.logger.info(Re.L_PULL_CONVERSATION_S,JSON.stringify({timestamp:e,userId:r})),a!==re.SUCCESS?[2,{code:a}]:(l=[],Array.isArray(c)&&c.forEach((function(e){var t=e.conversationType,n=e.updatedTime;n&&d._conversationManager.setConversationUpdatedTime(n),t===oe.ULTRA_GROUP?d._setUltraConversationStatus(e):l.push(e)})),[2,{code:a,data:l}])}}))}))},n.prototype._setUltraConversationStatus=function(e){var t=e.targetId,n=e.notificationStatus,r=e.notificationLevel,i=e.channelId,o=e.isTop,s=e.conversationType;if(""!==t||void 0===r){var a=this._ultraGroupMap[i+"_"+t];return a&&void 0!==r&&(a.notificationLevel=r,this._ultraGroupManager.addUltraGroupStatus(a)),a&&void 0!==n&&(a.notificationStatus=n,this._ultraGroupManager.addUltraGroupStatus(a)),a&&void 0!==o&&(a.isTop=o),a}this._ultraGroupManager.addUltraGroupStatus({conversationType:s,targetId:"",channelId:"",notificationLevel:r})},n.prototype.batchSetConversationStatus=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i=this;return u(this,(function(s){switch(s.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,[4,this._conversationManager.pushTask((function(t){return a(i,void 0,void 0,(function(){var i,s,a,c,l,d,h,p,_=this;return u(this,(function(u){switch(u.label){case 0:return i=r.codec.encodeSetConversationStatus(e,t),s=new Oo(Yi,i,n),[4,r.send(s,da)];case 1:return a=u.sent(),c=a.code,l=a.data,c!==re.SUCCESS?[2,{code:c}]:(d=l,this._conversationManager.setConversationUpdatedTime(d.version),h=[],e.forEach((function(e){if(e.conversationType!==oe.ULTRA_GROUP)_._conversationManager.addStatus(o(o({},e),{updatedTime:d.version}),!0);else{var t=_._setUltraConversationStatus(e);t&&h.push(t)}})),h.length>0&&(p=Sr(h),p=Xl(p),this._watcher.conversation(p)),[2,{code:c}])}}))}))}))]):[2,re.RC_NET_UNAVAILABLE];case 1:return[2,s.sent().code]}}))}))},n.prototype.batchSetConversationToTop=function(e,t,n){return a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this.batchSetConversationStatus(e.map((function(e){return o(o({},e),{isTop:t})})))]}))}))},n.prototype.setConversationNotificationLevel=function(e,t,n,r){return void 0===r&&(r=""),a(this,void 0,void 0,(function(){return u(this,(function(i){return[2,this.batchSetConversationStatus([{conversationType:e,targetId:t,notificationLevel:n,channelId:r}])]}))}))},n.prototype.batchSetConversationNotificationLevel=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this.batchSetConversationStatus(e.map((function(e){return o(o({},e),{notificationLevel:t})})))]}))}))},n.prototype._joinChrm=function(e,t,n,r,i){return a(this,void 0,void 0,(function(){var o,s,a,c,l,d,h,p,_,g,f,E,I,T,R,v;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(o=this._connMgr,s=o.codec.encodeJoinOrQuitChatRoom(r),c=new Oo(a=n?Di:bi,s,e),this.logger.info(Re.L_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,topic:a}),i),[4,o.send(c,Gs)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return l=u.sent(),d=l.code,h=l.data,p=d===re.SUCCESS?"info":"warn",this.logger[p](Re.L_JOIN_CHATROOM_R,JSON.stringify({code:d,timestamp:(new Date).getTime()}),i),d===re.SUCCESS?(g=(_=h).joinTime,f=_.createTime,E=_.memberCount,I=_.isAllChatroomBanned,T=_.isCurrentUserBanned,R=_.isCurrentChatroomBanned,v=_.isCurrentChatroomInWhitelist,this._chrmsQueue[e]||(this._chrmsQueue[e]={pulling:!1,queue:[],timestamp:0}),this._pullChrmMsg(e,t,g),this.getNaviInfoFromCache().kvStorage&&this._chrmEntryHandler.pullEntry(e,0),this._joinedChrmManager.set(e,t,r),this._startSyncIntervalForChrmPull(),[2,{code:d,data:{joinTime:g,createTime:f,memberCount:E,isAllChatroomBanned:I,isCurrentUserBanned:T,isCurrentChatroomBanned:R,isCurrentChatroomInWhitelist:v}}]):[2,{code:d}]}}))}))},n.prototype._rejoinChrm=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i,s,a,c,l,d,h,p,_,g;return u(this,(function(u){switch(u.label){case 0:for(n in e=this._joinedChrmManager.get(),t=[],e)t.push(n);r=0,u.label=1;case 1:return r<t.length?(i=t[r],s=e[i],a=s.count,c=void 0===a?10:a,l=s.extra,this.logger.info(Re.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:i,count:c,extra:l,topic:Di})),d=this.logger.createTraceId(),[4,this._joinChrm(i,c,!0,l,d)]):[3,4];case 2:if(h=u.sent(),p=h.code,_=h.data,g=p===re.SUCCESS?"info":"warn",this.logger[g](Re.L_REJOIN_CHATROOM_R,JSON.stringify({code:p,timestamp:(new Date).getTime()}),d),p===re.SUCCESS)return this._watcher.chatroom({rejoinedRoom:o({chatroomId:i,count:c},_)}),[2];p===re.RC_CHATROOM_USER_KICKED&&(this._joinedChrmManager.remove(i),delete this._chrmsQueue[i]),this._watcher.chatroom({rejoinedRoom:{chatroomId:i,errorCode:p}}),u.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))},n.prototype._pullChrmMsg=function(e,t,n){return void 0===t&&(t=10),void 0===n&&(n=0),a(this,void 0,void 0,(function(){var r,i,o,s,a,c,l,d,h,p,_,g,f,E,I=this;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(r=this._chrmsQueue[e],i=r.pulling,o=r.timestamp,i?[2]:(r.pulling=!0,s=this._connMgr.codec.encodeChrmSyncMsg(n?0:o,t),a=new Oo(Po[Po.chrmPull],s,e),this.logger.info(Re.L_PULL_CHATROOM_MSG_T,JSON.stringify({chatroomId:e,timestamp:o})),[4,this._connMgr.send(a,gs,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})])):[2];case 1:return c=u.sent(),l=c.code,d=c.data,r.pulling=!1,l===re.SUCCESS&&d?(h=d.list,p=d.syncTime,_=d.finished,r.timestamp=n?Math.max(p,n):p,r.queue=r.queue.filter((function(e){return e>p})),g=[],f=[],E=[],h.forEach((function(e){e.sentTime<o||(e.sentTime>=I._connMgr.getConnectedTime()&&I._writeMessagesLog(oe.CHATROOM,e.messageUId)&&f.push(e.messageUId),g.push(e.messageUId),E.push(e))})),this._batchMessage(E),this.logger.info(Re.L_PULL_CHATROOM_MSG_R,JSON.stringify({code:l,timestamp:o,messageUIds:g.join(",")})),f.length>0&&this.statisticLog.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:f.join(",")})),_?(r.queue.length>0&&(r.queue.length=0,this._pullChrmMsg(e)),[2]):(this._pullChrmMsg(e),[2])):(this.logger.warn(Re.L_PULL_CHATROOM_MSG_R,JSON.stringify({code:l,timestamp:o,messageUIds:""})),[2])}}))}))},n.prototype.joinChatroom=function(e,t,n,r){return a(this,void 0,void 0,(function(){return u(this,(function(i){switch(i.label){case 0:return[4,this._joinChrm(e,t,!1,n,r)];case 1:return[2,i.sent().code]}}))}))},n.prototype.joinExistChatroom=function(e,t,n,r){return a(this,void 0,void 0,(function(){return u(this,(function(i){return[2,this._joinChrm(e,t,!0,n,r)]}))}))},n.prototype.quitChatroom=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o;return u(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._connMgr,n=t.codec.encodeJoinOrQuitChatRoom(),r=new Oo(wi,n,e),[4,t.send(r)]):[2,re.RC_NET_UNAVAILABLE];case 1:return i=s.sent(),(o=i.code)===re.SUCCESS&&(delete this._chrmsQueue[e],this._chrmEntryHandler.reset(e),this._joinedChrmManager.remove(e)),[2,o]}}))}))},n.prototype.getChatroomInfo=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(r=this._connMgr,i=r.codec.encodeGetChatRoomInfo(t,n),o=new Oo(Po[Po.queryChrmI],i,e),[4,r.send(o,Fs)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return s=u.sent(),a=s.code,c=s.data,a!==re.SUCCESS?[2,{code:a}]:[2,{code:a,data:c}]}}))}))},n.prototype.getChatroomHistoryMessages=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,o,s,a,c,l;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(i=this._connMgr,o=i.codec.encodeGetHistoryMsg(e,{timestamp:t,count:n,order:r}),s=new Oo(Xi,o,e),[4,i.send(s,Cs,{conversation:{targetId:e}})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return a=u.sent(),c=a.code,l=a.data,c!==re.SUCCESS?[2,{code:c}]:[2,{code:c,data:{list:l.list,hasMore:l.hasMore}}]}}))}))},n.prototype._modifyChatroomKV=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,l,d;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,o=this._chrmEntryHandler.getVersion(e,t.key),t.version=null==o?this.getServerTime():o,s=r.codec.encodeModifyChatRoomKV(e,t,i),a=t.type===ye.UPDATE?Vi:Gi,c=new Oo(a,s,e),[4,r.send(c,Gs)]):[2,re.RC_NET_UNAVAILABLE];case 1:return l=u.sent(),(d=l.code)===re.SUCCESS?(this._chrmEntryHandler.setLocal(e,{kvEntries:[t],syncTime:this.getServerTime()},i),[2,d]):[2,d]}}))}))},n.prototype._chatroomKVStoreNotAllSuccess=function(e,t){var n=t.data,r=e;return n&&Array.isArray(n.errorKeys)&&n.errorKeys.forEach((function(e){var t=r.findIndex((function(t){return e.key===t.key}));-1!==t&&r.splice(t,1)})),r},n.prototype._modifyChatroomKVS=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,s,a,c,l,d,h,p,_,g,f=this;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,t.entries.forEach((function(t){var n=f._chrmEntryHandler.getVersion(e,t.key);t.version=null==n?f.getServerTime():n})),s=r.codec.encodeModifyChatRoomKVS(e,t,i),a=t.type===ye.UPDATE?Bi:Fi,c=new Oo(a,s,e),[4,r.send(c,Zs)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return l=u.sent(),d=l.code,-1!==[re.SUCCESS,re.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(d)&&(p=[],delete(_=o({},t)).entries,t.entries.forEach((function(e){p.push(o(o({},e),_))})),d===re.CHATROOM_KV_STORE_NOT_ALL_SUCCESS&&(g=l.data,h=g.errorKeys,p=this._chatroomKVStoreNotAllSuccess(p,l)),this._chrmEntryHandler.setLocal(e,{kvEntries:p,syncTime:(new Date).getTime()},i)),[2,{code:d,data:h}]}}))}))},n.prototype.setChatroomEntry=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return t.type=ye.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.setChatroomEntries=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return t.type=ye.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))},n.prototype.forceSetChatroomEntry=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return t.type=ye.UPDATE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.removeChatroomEntry=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return t.type=ye.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.removeChatroomEntries=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return t.type=ye.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))},n.prototype.forceRemoveChatroomEntry=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return t.type=ye.DELETE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.getChatroomEntry=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return(n=this._chrmEntryHandler.getValue(e,t))?[2,{code:re.SUCCESS,data:n}]:this._isConnected?(r=this._connMgr,i=r.codec.encodePullChatRoomKV(0),o=new Oo(Po[Po.pullKV],i,e),[4,r.send(o,Xs)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return s=u.sent(),(a=s.data)&&a.kvEntries&&a.kvEntries.length&&(c=a.kvEntries.find((function(e){return e.key===t})),void 0!==c)?[2,{code:re.SUCCESS,data:null==c?void 0:c.value}]:[2,{code:re.CHATROOM_KEY_NOT_EXIST}]}}))}))},n.prototype.getAllChatroomEntry=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return(t=this._chrmEntryHandler.getAll(e))&&Object.keys(t).length?[2,{code:re.SUCCESS,data:t}]:this._isConnected?(n=this._connMgr,t={},r=n.codec.encodePullChatRoomKV(0),i=new Oo(Po[Po.pullKV],r,e),[4,n.send(i,Xs)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return o=a.sent(),(s=o.data)&&s.kvEntries&&s.kvEntries.length&&s.kvEntries.forEach((function(e){e.key&&(t[e.key]=e.value||"")})),[2,{code:re.SUCCESS,data:t}]}}))}))},n.prototype.pullChatroomEntry=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,l,d,h,p,_=this;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,o=r.codec.encodePullChatRoomKV(t),s=new Oo(Po[Po.pullKV],o,e),this.logger.info(Re.L_PULL_CHATROOM_KV_T,JSON.stringify({chatroomId:e,timestamp:t})),[4,r.send(s,Xs)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return a=u.sent(),c=a.code,l=a.data,d=c===re.SUCCESS?"info":"warn",this.logger[d](Re.L_PULL_CHATROOM_KV_R,JSON.stringify({code:c,timestamp:t})),c===re.SUCCESS&&l?(h=l.kvEntries,p=[],h.length>0&&(h.forEach((function(t){var n=t.key,r=t.value,i=t.type,o=t.timestamp,s=t.userId;_._chrmEntryHandler.getValue(e,n)===r&&s===_.getCurrentUserId()||p.push({key:n,value:r,type:i,timestamp:o,chatroomId:e})})),this._chrmEntryHandler.setLocal(e,l,i),p.length>0&&this._watcher.chatroom({updatedEntries:p})),[2,{code:c,data:l}]):[2,{code:c}]}}))}))},n.prototype._startSyncIntervalForChrmPull=function(){var e=this;this._stopSyncIntervalForChrmPull(),this._intervalTimerForChrmPull=setInterval((function(){var t=Object.keys(e._chrmsQueue);0!==t.length&&e._isConnected?t.forEach((function(t){e._pullChrmMsg(t),e.getNaviInfoFromCache().kvStorage&&e._chrmEntryHandler.pullEntry(t,0)})):e._stopSyncIntervalForChrmPull()}),M)},n.prototype._stopSyncIntervalForChrmPull=function(){"number"!=typeof this._intervalTimerForChrmPull&&(clearInterval(this._intervalTimerForChrmPull),this._intervalTimerForChrmPull=-1)},n.prototype.removeChatroomFromCatch=function(e){var t;null===(t=this._joinedChrmManager)||void 0===t||t.remove(e)},n.prototype._writeMessagesLog=function(e,t){var n,r=null===(n=this.cloudController)||void 0===n?void 0:n.getMRTRConfig();if(!r)return!1;var i=sr(t),o=0;switch(e){case oe.PRIVATE:o=r.private;break;case oe.GROUP:o=r.group;break;case oe.CHATROOM:o=r.chatroom;break;case oe.ULTRA_GROUP:o=r.ultraGroup}return!!o&&i%(1/o)==0},n.prototype.sendMessage=function(e,t,n,r,i){var s;return a(this,void 0,void 0,(function(){var a,c,l,d,h,p,_,g,f,E,I,T;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=this._handleInnerMsgOptions(e,t,n),n=this._handleMsgProperties(n,!0),a=!1,[oe.PRIVATE,oe.GROUP].includes(e)&&(n.isStatusMessage||(null===(s=this._customMessageType[n.messageType])||void 0===s?void 0:s.isStatusMessage))&&(a=!0),c=a?function(e){var t;return(t={},t[oe.PRIVATE]=Po.ppMsgS,t[oe.GROUP]=Po.pgMsgS,t)[e]}(e):function(e){var t;return(t={},t[oe.PRIVATE]=Po.ppMsgP,t[oe.GROUP]=Po.pgMsgP,t[oe.CHATROOM]=Po.chatMsg,t[oe.CUSTOMER_SERVICE]=Po.pcMsgP,t[oe.RTC_ROOM]=Po.prMsgS,t[oe.SYSTEM]=Po.pbMsgP,t)[e]}(e)||Po.ppMsgP,a&&(n.isPersited=!1,n.isCounted=!1),l=n.messageId?n.messageId:nr(),n.messageId=l,d=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},n),(h=new mo(Po[c],d,e===oe.SYSTEM?this.currentUserId:t)).setHeaderQos(Ei.AT_LEAST_ONCE),a?(this._connMgr.sendOnly(h),[2,{code:re.SUCCESS,data:Jl(e,t,o({},n),"",0,this.currentUserId,l)}]):(p=this._connMgr.getCrtServerTime(),_=Jl(e,t,o(o({},n),{isStatusMessage:a}),"",p,this.currentUserId,l),null==r||r(l),this.logger.info(Re.L_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e,targetId:t,channelId:n.channelId}),i),g=Date.now(),[4,this._connMgr.send(h)])):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return f=u.sent(),E=f.code,I=f.data,E!==re.SUCCESS?(this.logger.warn(Re.L_SEND_MSG_R,JSON.stringify({code:E,messageUId:_.messageUId,messageId:_.messageId}),i),this._writeMessagesLog(e)&&this.statisticLog.record(ve.IM_MSG_SEND,JSON.stringify({channel:e,start_ts:g,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:E})),_.sentStatus=Me.FAILED,[2,{code:E,data:_}]):(this.logger.info(Re.L_SEND_MSG_R,JSON.stringify({code:E,messageUId:null==I?void 0:I.messageUId,messageId:null==I?void 0:I.messageId}),i),T=I,this._sendMessageSuccessHandle(_,T),this._writeMessagesLog(e,T.messageUId)&&this.statisticLog.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:T.messageUId,channel:e,start_ts:g,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:E})),[2,{code:re.SUCCESS,data:_}])}}))}))},n.prototype._sendMessageSuccessHandle=function(e,t){var n,r=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._conversationManager.setConversationCacheByMessage(e,!0);var i=e.messageType,o=e.conversationType,s=e.targetId,a=e.channelId,u=e.sentTime,c=e.content,l=e.messageDirection;if(i===ce.READ_RECEIPT_REQUEST){var d=c.messageUId;null===(n=this._readReceiptManager)||void 0===n||n.insert({conversationType:o,targetId:s,channelId:a},d,l,u)}if(i===ce.READ_RECEIPT_RESPONSE){var h=c.receiptMessageDic;if(!h)return;for(var p in h)h[p].forEach((function(e){var t;null===(t=r._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:s,channelId:a},e)}))}},n.prototype.recallMsg=function(e,t,n,r,i){var s;return a(this,void 0,void 0,(function(){var a,c,l,d,h,p,_,g,f,E,I,T,R,v,C,y;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(a=i.user,c=i.extra,l=i.isDelete,d=i.directionalUserIdList,h=i.disableUpdateLastMessage,p={conversationType:e,targetId:t,messageUId:n,sentTime:r,channelId:i.channelId||"",isDelete:l||!1},a&&(p.user=a),c&&(p.extra=c),_={content:p,messageType:"RC:RcCmd",disableNotification:null==i?void 0:i.disableNotification,pushConfig:null==i?void 0:i.pushConfig,pushContent:(null===(s=i.pushConfig)||void 0===s?void 0:s.pushContent)||i.pushContent||"",channelId:i.channelId,disableUpdateLastMessage:h,isPersited:!0},[oe.GROUP,oe.ULTRA_GROUP].includes(e)&&d&&(_.directionalUserIdList=d),g=Po[Po.recallMsg],f=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},_),(E=new mo(g,f,this.currentUserId)).setHeaderQos(Ei.AT_LEAST_ONCE),[4,this._connMgr.send(E)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return I=u.sent(),T=I.code,R=I.data,e===oe.ULTRA_GROUP&&this.logger.debug(Re.L_RECALL_ULTRA_MSG_S,JSON.stringify({code:T,conversationType:e,targetId:t,channelId:i.channelId})),T!==re.SUCCESS?[2,{code:T}]:(v=R,e===oe.ULTRA_GROUP?(this._ultraMsgMap[v.messageUId]=v.timestamp,this._updateUltraGroupWhenRecallMsg(t,i.channelId||"",n),[2,{code:re.SUCCESS}]):(C="Cmd:"+n,this._sendMessageStore.setMessage(C,v.timestamp),y=Jl(e,t,o(o({},_),{isPersited:!0}),v.messageUId,v.timestamp,this.currentUserId),this._conversationManager.setConversationCacheByMessage(y,!0),[2,{code:re.SUCCESS,data:y}]))}}))}))},n.prototype.sendReadReceiptMessage=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i;return u(this,(function(o){return this._isConnected?(r=this._connMgr.codec.encodeReadReceipt(t,n),i=new Oo(Po[Po.rrMsg],r,e),[2,this._connMgr.send(i)]):[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getMessageReader=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i;return u(this,(function(o){return this._isConnected?(r=this._connMgr.codec.encodeMessageReader(t,n),i=new Oo(Po[Po.rrList],r,e),[2,this._connMgr.send(i,va)]):[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.sendReadReceiptMessageV4=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i;return u(this,(function(o){return r=this._connMgr.codec.encodeReadReceiptMsg(e,t,n),i=new mo(Po[Po.sendMsgRead],r,e.targetId),[2,this._connMgr.send(i)]}))}))},n.prototype.getMessageReadReceiptV4=function(e,t){return a(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){return n=this._connMgr.codec.encodeReceiptQryReq(e,t),r=new Oo(Po[Po.qryMsgRead],n,e.targetId),[2,this._connMgr.send(r,za)]}))}))},n.prototype.batchGetMessageReadReceiptInfoV4=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,s,a,c;return u(this,(function(u){switch(u.label){case 0:return n=this._connMgr.codec.encodeReceiptCntQryReq(e,t),r=new Oo(Po[Po.qryMsgReadCntBatch],n,e.targetId),[4,this._connMgr.send(r,tu)];case 1:return i=u.sent(),s=i.code,a=i.data,c=(a||{result:[]}).result,s===re.SUCCESS&&c?[2,{code:s,data:c.map((function(t){return o({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}]:[2,{code:s}]}}))}))},n.prototype.updateConversationReadTime=function(e,t){return a(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){return n=this._connMgr.codec.encodeSessionMsgReadInput(e,t),r=new mo(Po[Po.updRTime],n,this.currentUserId),[2,this._connMgr.send(r)]}))}))},n.prototype.pullUserSettings=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o;return u(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodePullUserSetting(e),n=new Oo(Po[Po.pullUS],t,this.currentUserId),[4,this._connMgr.send(n,ia)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return r=s.sent(),i=r.code,o=r.data,i===re.SUCCESS&&this._naviChangeHandler(o),[2,{code:i,data:o}]}}))}))},n.prototype._naviChangeHandler=function(e){var t;if(e){var n=e.settings,r=null===(t=null==n?void 0:n.VoipInfo)||void 0===t?void 0:t.value;if(r){var i=this._connMgr.getToken();this.navi.updateVoipCallInfo(i,r);var s=this.navi.getNaviInfoFromCache(i);this._watcher.onNaviDataChange(o({},s))}}else this.logger.warn(Re.L_NOTIFY_NAVI_CHANGE_E,JSON.stringify({data:e}))},n.prototype.getFileToken=function(e,t,n,r,i,s){return a(this,void 0,void 0,(function(){var a,c,l,d,h,p,_,g,f,E;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(a=r&&"uploads"!==r?t||"":Xn(e,t),c=this.getNaviInfoFromCache(),l=lr(c,this.logger),d="",l||(d=JSON.stringify({uploadDomain:l})),s=s?Math.ceil(s):0,h=this._connMgr.codec.encodeGetFileToken(e,a,n||"",r||"",i||"",d,s),p=new Oo(Po[Po.qnTkn],h,this.currentUserId),[4,this._connMgr.send(p,xs)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return _=u.sent(),g=_.code,f=_.data,g!==re.SUCCESS?[2,{code:g}]:(E=o(o({},f),{fileName:a,downloadAuthInfo:f.downloadAuthInfo?JSON.parse(f.downloadAuthInfo):null}),[2,{code:g,data:E}])}}))}))},n.prototype.getFileUrl=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,o,s,a,c,l,d,h,p,_,g;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(i="","","",a="",c="",o=Ys,s=qs,t===Ee.QINIU?i=Po[Po.qnUrl]:t===Ee.AWS?i=Po[Po.s3Url]:t===Ee.STC?i=Po[Po.stcUrl]:t===Ee.MINIO?(i=Po[Po.minioUrl],a=lr(this.getNaviInfoFromCache(),this.logger),c=JSON.stringify({url:a})):i=Po[Po.aliUrl],l=this._connMgr.codec.encodeGetFileUrl(o,e,n,r,c,-1),d=new Oo(i,l,this.currentUserId),[4,this._connMgr.send(d,s)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return h=u.sent(),p=h.code,_=h.data,g=_,p===re.SUCCESS?[2,{code:p,data:g}]:[2,{code:p}]}}))}))},n.prototype.disconnect=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect()];case 1:return e.sent(),this._resetMemoryState(),[2]}}))}))},n.prototype._resetMemoryState=function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._pullQueue.length=0,this._stopSyncInterval(),this.resetUltraGroupData(),this._joinedChrmManager&&(this._joinedChrmManager.clear(),delete this._joinedChrmManager),this._conversationManager&&delete this._conversationManager,this._ultraGroupManager&&delete this._ultraGroupManager,this._userSettingManager&&delete this._userSettingManager,this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager,this._chrmsQueue={}},n.prototype.resetUltraGroupData=function(){this._stopUltraSyncInterval(),this._lastSyncUltraMsgTimeStamp=0,this._lastSyncUltraMsgLocalTimeStamp=0,this._isUltraPulling=!1,this._ultraGroupTimeQue=[],this._isUltraGroupListExist=!1,this._ultraGroupMap={}},n.prototype.registerMessageType=function(e,t,n,r,i){this._customMessageType[e]={isPersited:t,isCounted:n,isStatusMessage:i}},n.prototype.getServerTime=function(){return this._connMgr.getCrtServerTime()},n.prototype.getCurrentUserId=function(){return this.currentUserId},n.prototype.createTag=function(e){return a(this,void 0,void 0,(function(){var t=this;return u(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return a(t,void 0,void 0,(function(){var t,r,i,s,a,c;return u(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],n),r=new Oo(Po[Po.addSeTag],t,this.currentUserId),[4,this._connMgr.send(r,na)];case 1:return i=u.sent(),s=i.code,a=i.data,s===re.SUCCESS&&a&&(c=a.version,this._userSettingManager.addTag([o(o({},e),{createdTime:c})],c)),[2,{code:s}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.removeTag=function(e){return a(this,void 0,void 0,(function(){var t=this;return u(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return a(t,void 0,void 0,(function(){var t,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeRemoveTag([e],n),r=new Oo(Po[Po.delSeTag],t,this.currentUserId),[4,this._connMgr.send(r,na)];case 1:return i=u.sent(),o=i.code,s=i.data,o===re.SUCCESS&&s&&(a=s.version,this._userSettingManager.deleteTag([e],a)),[2,{code:o}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.updateTag=function(e){return a(this,void 0,void 0,(function(){var t=this;return u(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return a(t,void 0,void 0,(function(){var t,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],n),r=new Oo(Po[Po.addSeTag],t,this.currentUserId),[4,this._connMgr.send(r,na)];case 1:return i=u.sent(),o=i.code,s=i.data,o===re.SUCCESS&&(a=s.version,this._userSettingManager.addTag([e],a)),[2,{code:o}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getTagList=function(){return a(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){return e=this._userSettingManager.getTags(),t=this._conversationManager.getConversationListForTag(),e.forEach((function(e){e.conversationCount=t[e.tagId]?t[e.tagId].length:0})),[2,{code:re.SUCCESS,data:e}]}))}))},n.prototype.addTagForConversations=function(e,t){return a(this,void 0,void 0,(function(){var n=this;return u(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return a(n,void 0,void 0,(function(){var n,i,o,s,a,c,l=this;return u(this,(function(u){switch(u.label){case 0:return this._userSettingManager.getTagById(e)?(n=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,r),i=new Oo(Po[Po.addTag],n,this.currentUserId),[4,this._connMgr.send(i,da)]):[2,{code:re.TAG_NOT_EXIST}];case 1:return o=u.sent(),s=o.code,a=o.data,s===re.SUCCESS&&a&&((c={})[e]={},t.forEach((function(e){l._conversationManager.addTagStatus(e.conversationType,e.targetId,c,e.channelId)})),this._conversationManager.setConversationUpdatedTime(a.version)),[2,{code:s}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.removeTagForConversations=function(e,t){return a(this,void 0,void 0,(function(){var n=this;return u(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return a(n,void 0,void 0,(function(){var n,i,o,s,a,c=this;return u(this,(function(u){switch(u.label){case 0:return n=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,r),i=new Oo(Po[Po.delTag],n,this.currentUserId),[4,this._connMgr.send(i,da)];case 1:return o=u.sent(),s=o.code,a=o.data,s===re.SUCCESS&&a&&(t.forEach((function(t){c._conversationManager.deleteTagStatus(t.conversationType,t.targetId,[e],t.channelId)})),this._conversationManager.setConversationUpdatedTime(a.version)),[2,{code:s}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.removeTagsForConversation=function(e,t){return a(this,void 0,void 0,(function(){var n=this;return u(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return a(n,void 0,void 0,(function(){var n,i,o,s,a,c,l,d,h;return u(this,(function(u){switch(u.label){case 0:return n=e.conversationType,i=e.targetId,o=e.channelId,s=t.map((function(e){return{tagId:e}})),a=this._connMgr.codec.encodeUpdateConversationTag(s,[e],r),c=new Oo(Po[Po.delTag],a,this.currentUserId),[4,this._connMgr.send(c,da)];case 1:return l=u.sent(),d=l.code,h=l.data,d===re.SUCCESS&&h&&(this._conversationManager.deleteTagStatus(n,i,t,o),this._conversationManager.setConversationUpdatedTime(h.version)),[2,{code:d}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getConversationListByTag=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a,c,l,d,h;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(i=(r=this).currentUserId,o=r._connMgr,s=o.codec.encodeOldConversationList({count:n,type:oe.PRIVATE,startTime:t}),a=new Oo(ki,s,i),[4,o.send(a,Ss,{currentUserId:i,connectedTime:o.getConnectedTime()})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return c=u.sent(),l=c.code,d=c.data,l!==re.SUCCESS?[2,{code:l}]:(h=this._conversationHasTagFilter(e,null==d?void 0:d.list),[2,{code:l,data:h}])}}))}))},n.prototype._conversationHasTagFilter=function(e,t){var n=this,r=[],i=[];function s(e,t){return e.latestMessage&&t.latestMessage?e.latestMessage.sentTime-t.latestMessage.sentTime:0}return t.forEach((function(t){var s=t.conversationType,a=t.targetId,u=t.channelId,c=n._conversationManager.get(s,a,u),l=c.hasMentioned,d=c.mentionedInfo,h=c.lastUnreadTime,p=c.notificationStatus,_=c.isTop,g=c.tags,f=c.unreadMessageCount,E=g&&g[e];if(E){var I=o(o({},t),{hasMentioned:l,mentionedInfo:d,lastUnreadTime:h,notificationStatus:p,isTop:_,unreadMessageCount:f});E.isTop?r.push(o(o({},I),{isTopInTag:!0})):i.push(o(o({},I),{isTopInTag:!1}))}})),r.sort(s),i.sort(s),c(c([],r,!0),i,!0)},n.prototype.getUnreadCountByTag=function(e,t){return a(this,void 0,void 0,(function(){var n;return u(this,(function(r){return this._isConnected?(n=this._conversationManager.getUnreadCountByTag(e,t),[2,{code:re.SUCCESS,data:n}]):[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.setConversationStatusInTag=function(e,t,n){return a(this,void 0,void 0,(function(){var r=this;return u(this,(function(i){return this._isConnected?[2,this._conversationManager.pushTask((function(i){return a(r,void 0,void 0,(function(){var r,o,s,a,c,l,d,h,p,_,g,f;return u(this,(function(u){switch(u.label){case 0:return r=t.targetId,o=t.conversationType,s=t.channelId,a=n.isTop,c=[{tagId:e,isTop:a}],(l=this._conversationManager.get(o,r,s)).tags&&Object.hasOwnProperty.call(l.tags,e)?(d=this._connMgr.codec.encodeUpdateConversationTag(c,[t],i),h=new Oo(Po[Po.addTag],d,this.currentUserId),[4,this._connMgr.send(h,da)]):[2,{code:re.NO_TAG_IN_CONVER}];case 1:return p=u.sent(),_=p.code,g=p.data,_===re.SUCCESS&&g&&((f={})[e]={},a&&(f[e].isTop=!0),this._conversationManager.addTagStatus(o,r,f,s),this._conversationManager.setConversationUpdatedTime(g.version)),[2,{code:_}]}}))}))}))]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getTagsForConversation=function(e){var t;return a(this,void 0,void 0,(function(){var n,r,i,o;return u(this,(function(s){if(!this._isConnected)return[2,{code:re.RC_NET_UNAVAILABLE}];if(n=this._conversationManager.get(e.conversationType,e.targetId,e.channelId),r=this._userSettingManager.getTagsInfo(),i=[],n.tags)for(o in n.tags)i.push({tagId:o,tagName:null===(t=r[o])||void 0===t?void 0:t.tagName});return[2,{code:re.SUCCESS,data:i}]}))}))},n.prototype.getBlockConversationList=function(){var e=this._conversationManager.getBlockConversationList();return Promise.resolve({code:re.SUCCESS,data:e})},n.prototype.getTopConversationList=function(e,t){var n=this._conversationManager.getTopConversationList(e,t);return Promise.resolve({code:re.SUCCESS,data:n})},n.prototype.getUnreadConversationList=function(e){return a(this,void 0,void 0,(function(){var t;return u(this,(function(n){return t=this._conversationManager.getUnreadConversationList(e),[2,Promise.resolve({code:re.SUCCESS,data:t})]}))}))},n.prototype.getUnreadMentionedCount=function(e){var t,n;return n=e.conversationType===oe.ULTRA_GROUP?(null===(t=this._ultraGroupMap[e.channelId+"_"+e.targetId])||void 0===t?void 0:t.unreadMentionedCount)||0:this._conversationManager.getUnreadMentionedCount(e.conversationType,e.targetId,e.channelId),n=this._getUnreadCount(n),Promise.resolve({code:re.SUCCESS,data:n})},n.prototype.getAllUnreadMentionedCount=function(){var e=this._conversationManager.getAllUnreadMentionedCount();return Promise.resolve({code:re.SUCCESS,data:e})},n.prototype.getConversationNotificationLevel=function(e,t,n){if(!this._isUltraGroupListExist&&e===oe.ULTRA_GROUP)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var r;if(!(r=e===oe.ULTRA_GROUP?this._ultraGroupManager.get(oe.ULTRA_GROUP,t,n):this._conversationManager.get(e,t,n)))return Promise.resolve({code:re.SUCCESS,data:pe.NOT_SET});var i=r.notificationLevel;return Zt(r.notificationLevel)&&!Zt(r.notificationStatus)&&(i=de.OPEN===r.notificationStatus?1:0),Promise.resolve({code:re.SUCCESS,data:i})},n.prototype.getConversationNotificationStatus=function(e,t,n){var r;return(r=e===oe.ULTRA_GROUP?this._ultraGroupManager.get(oe.ULTRA_GROUP,t,n):this._conversationManager.get(e,t,n))?Promise.resolve({code:re.SUCCESS,data:r.notificationStatus}):Promise.resolve({code:re.SUCCESS,data:de.CLOSE})},n.prototype.setConversationTypeNotificationLevel=function(e,t){var n;return a(this,void 0,void 0,(function(){var r,i,o,s,a,c,l,d,h,p;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(i=(r=this).currentUserId,o=r._connMgr,s=this._conversationManager.getConversationUpdatedTime(),a=o.codec.encodeSetConversationTypeLevel(e,s,t),c=new Oo(Po[Po.setTypeUnpush],a,i),[4,o.send(c,pa)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return l=u.sent(),d=l.code,h=l.data,d!==re.SUCCESS?[2,{code:d}]:(p=h,this._conversationManager.setConversationUpdatedTime(p.version),e===oe.ULTRA_GROUP?null===(n=this._ultraGroupManager)||void 0===n||n.addUltraGroupStatus({conversationType:e,targetId:"",notificationLevel:t,channelId:""}):this._conversationManager.addStatus({conversationType:e,targetId:"",channelId:"",updatedTime:p.version,notificationLevel:t},!0),[2,{code:re.SUCCESS}])}}))}))},n.prototype.getConversationTypeNotificationLevel=function(e){if(e===oe.ULTRA_GROUP){var t=this._ultraGroupManager.get(e,"","");return Promise.resolve({code:re.SUCCESS,data:t.notificationLevel||0})}var n=this._conversationManager.get(e,"","");return Promise.resolve({code:re.SUCCESS,data:n.notificationLevel||0})},n.prototype.getRemoteHistoryMessages=function(e,t,n,r,i,o){return this.getHistoryMessage(e,t,n,r,i,o)},n.prototype.getUltraGroupList=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,s=this;return u(this,(function(a){return t=e.targetId,n=e.channelType,this._isUltraGroupListExist?(r=(r=Object.values(this._ultraGroupMap).filter((function(e){return!(e.targetId!==t&&t||e.channelType!==n&&xt(n))}))).map((function(e){var t=e.unreadMessageCount,n=e.unreadMentionedCount,r=e.unreadMentionedMeCount;return t=s._getUnreadCount(t),n=s._getUnreadCount(n),r=s._getUnreadCount(r),o(o({},e),{unreadMessageCount:t,unreadMentionedCount:n,unreadMentionedMeCount:r})})),r=Xl(r),i=Sr(r),[2,{code:re.SUCCESS,data:i}]):[2,{code:re.METHOD_NOT_AVAILABLE}]}))}))},n.prototype._getUnreadCount=function(e){return e>999?999:e},n.prototype.getBlockUltraGroupList=function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){(e.notificationStatus===de.OPEN||e.notificationLevel>0)&&t.push({conversationType:oe.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:re.SUCCESS,data:t})},n.prototype.getTopUltraGroupList=function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){!0===e.isTop&&t.push({conversationType:oe.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:re.SUCCESS,data:t})},n.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){if(!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var n=0;for(var r in this._ultraGroupMap){r.match(/_.*/g)[0].substring(1)!==e||t&&0!==t.length&&!t.includes(this._ultraGroupMap[r].notificationLevel)||(n+=this._ultraGroupMap[r].unreadMentionedCount)}return n=this._getUnreadCount(n),Promise.resolve({code:re.SUCCESS,data:n})},n.prototype.getUltraGroupUnreadCountByTargetId=function(e,t){var n=0;for(var r in this._ultraGroupMap){var i=this._ultraGroupMap[r];i.targetId!==e||t&&0!==t.length&&!t.includes(this._ultraGroupMap[r].notificationLevel)||(n+=i.unreadMessageCount||0)}return n=this._getUnreadCount(n),Promise.resolve({code:re.SUCCESS,data:n})},n.prototype.getUltraGroupUnreadInfoList=function(e){var t=this;if(!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var n=[];return Object.keys(this._ultraGroupMap).forEach((function(r){var i=t._ultraGroupMap[r];e.includes(i.targetId)&&n.push({type:i.conversationType,targetId:i.targetId,channelId:i.channelId,unreadMessageCount:t._getUnreadCount(i.unreadMessageCount),mentionedCount:t._getUnreadCount(i.unreadMentionedCount),mentionedMeCount:t._getUnreadCount(i.unreadMentionedMeCount),notificationLevel:i.notificationLevel})})),Promise.resolve({code:re.SUCCESS,data:n})},n.prototype.getAllUltraGroupUnreadCount=function(e){if(void 0===e&&(e=!1),!this._isUltraGroupListExist)return Promise.resolve({code:re.METHOD_NOT_AVAILABLE});var t=0;for(var n in this._ultraGroupMap)t+=e?this._ultraGroupMap[n].unreadMentionedCount||0:this._ultraGroupMap[n].unreadMessageCount||0;return t=this._getUnreadCount(t),Promise.resolve({code:re.SUCCESS,data:t})},n.prototype.clearUltraUnreadcount=function(e,t){return void 0===t&&(t=""),a(this,void 0,void 0,(function(){var n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this.getServerTime(),r=this._connMgr.codec.encodeClearUnreadCount({conversationType:oe.ULTRA_GROUP,targetId:e,channelId:t},{timestamp:n}),(i=new mo(Po[Po.updUgRTime],r,this.currentUserId)).setHeaderQos(Ei.AT_LEAST_ONCE),[4,this._connMgr.send(i)]):[2,re.RC_NET_UNAVAILABLE]:[2,Promise.resolve(re.METHOD_NOT_AVAILABLE)];case 1:return(o=a.sent().code)===re.SUCCESS&&((s=this._ultraGroupMap[t+"_"+e])&&(s.unreadMessageCount=0,s.unreadMentionedCount=0,s.unreadMentionedMeCount=0,s.lastReadTime=n),s&&s.firstUnreadMessage&&(s.firstUnreadMessage=null)),[2,o]}}))}))},n.prototype._getUltraGroupList=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,d,h,p,_,g=this;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUltraGroup(e,false),n=new Oo(Po[Po.pullUgSes],t,this.currentUserId),[4,this._connMgr.send(n,Ss,{currentUserId:this.currentUserId,conversationType:oe.ULTRA_GROUP})]):[2];case 1:return r=u.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(a=o.list,c=o.isFinished,a.forEach((function(e){e.notificationStatus=de.CLOSE,e.notificationLevel=pe.NOT_SET,e.isTop=!1,g._ultraGroupMap[e.channelId+"_"+e.targetId]=e,g._ultraGroupManager.addUltraGroupStatus(e)})),!1!==c?[3,2]:(l=a.length>0&&a[a.length-1].versionTime||0,this._getUltraGroupList(l),[3,4])):(this.logger.warn(Re.L_ULTRA_SYNC_DONE_S,"Pull ultra group conversation failured, code: "+i+", try again"),s=setTimeout((function(){g._getUltraGroupList(e),clearTimeout(s)}),3e3),[2]);case 2:return this.logger.info(Re.L_ULTRA_SYNC_DONE_S,"Pull ultra group conversation success"),[4,this.pullConversationStatus(0)];case 3:d=u.sent(),h=d.code,p=d.data,h!==re.SUCCESS&&this.logger.warn(Re.O,"pullConversationStatus fail code: "+h+", data: "+p),_=Object.values(this._ultraGroupMap),_=Xl(_),this._isUltraGroupListExist=!0,this._watcher.ultraGroupEnable(Sr(_)),this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp),u.label=4;case 4:return[2]}}))}))},n.prototype._startUltraSyncInterval=function(){var e=this,t=function(){e._ultraGroupTimer=setTimeout((function(){Date.now()-e._lastSyncUltraMsgLocalTimeStamp>=18e4&&e._syncUltraMsg(e._lastSyncUltraMsgTimeStamp),e._stopUltraSyncInterval(),t()}),3e4)};this._lastSyncUltraMsgLocalTimeStamp=Date.now(),t()},n.prototype._stopUltraSyncInterval=function(){-1!==this._ultraGroupTimer&&(clearTimeout(this._ultraGroupTimer),this._ultraGroupTimer=-1)},n.prototype._notificationOnline=function(){return a(this,void 0,void 0,(function(){var e,t,n,r=this;return u(this,(function(i){switch(i.label){case 0:return this._isConnected?[4,this._fetchUltraMsg(0)]:[2];case 1:return e=i.sent(),t=e.code,n=e.data,t===re.SUCCESS&&n?(this.logger.info(Re.L_NOTIFY_ULTRA_ONLINE_S,"Notify ultra group online success."),this._getUltraGroupList(0),-1===this._ultraGroupTimer&&this._startUltraSyncInterval(),[2]):(this.logger.warn(Re.L_NOTIFY_ULTRA_ONLINE_S,"Notify ultra group online failured, try again."),setTimeout((function(){r._notificationOnline()}),3e3),[2])}}))}))},n.prototype._fetchUltraMsg=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l;return u(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeSuperSyncMsg(e),n=new Oo(Po[Po.pullUgMsg],t,this.currentUserId),r=this.logger.createTraceId(),this.logger.info(Re.L_PULL_ULTRA_MSG_T,JSON.stringify({timestamp:e}),r),[4,this._connMgr.send(n,gs,{currentUserId:this.currentUserId,conversation:{conversationType:oe.ULTRA_GROUP}})];case 1:return i=u.sent(),o=i.code,s=i.data,o===re.SUCCESS&&s?(a=s.list,c=s.syncTime,l=a.map((function(e){return e.messageUId})).join(","),this.logger.info(Re.L_PULL_ULTRA_MSG_R,JSON.stringify({code:o,messageUIds:l,timestamp:e,syncTime:c}),r)):this.logger.warn(Re.L_PULL_ULTRA_MSG_R,JSON.stringify({code:o,timestamp:e}),r),[2,{code:o,data:s}]}}))}))},n.prototype._getUltraGroup=function(e,t,n){var r,i,o,s=e.targetId,a=e.messageType,u=e.channelId,c=e.isCounted,l=e.channelType,d=e.sentTime,h=e.senderUserId,p=e.content,_=e.isMentioned,g=this._ultraGroupMap[u+"_"+s],f=g||{conversationType:oe.ULTRA_GROUP,targetId:s,channelId:u,unreadMessageCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,notificationStatus:de.CLOSE,notificationLevel:pe.NOT_SET,isTop:!1};return c&&h!==this.currentUserId&&a!==ce.RECALL&&(f.unreadMessageCount+=1,f.unreadMentionedCount+=t,f.firstUnreadMessage||(f.firstUnreadMessage={sentTime:d}),_&&(null===(r=null==p?void 0:p.mentionedInfo)||void 0===r?void 0:r.type)!==ge.ALL&&(null===(o=null===(i=null==p?void 0:p.mentionedInfo)||void 0===i?void 0:i.userIdList)||void 0===o?void 0:o.includes(this.currentUserId))&&(f.unreadMentionedMeCount+=1)),f.versionTime=n,f.latestMessage=e,f.channelType=l,g||(this._ultraGroupMap[u+"_"+s]=f),f},n.prototype._syncUltraMsg=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,d=this;return u(this,(function(u){switch(u.label){case 0:return!this._isConnected||this._isUltraPulling?[2]:(this._isUltraPulling=!0,[4,this._fetchUltraMsg(e)]);case 1:return t=u.sent(),n=t.code,r=t.data,this._lastSyncUltraMsgLocalTimeStamp=Date.now(),this._isUltraPulling=!1,n===re.SUCCESS&&r?(i=r.list,o=r.syncTime,s=r.finished,a={},c=[],i.forEach((function(e){var t,n,r,i=e.targetId,s=e.content,u=e.messageUId,l=e.channelId,h=e.isMentioned;if(d._ultraMsgMap[u])delete d._ultraMsgMap[u];else{var p=0;h&&((null===(t=null==s?void 0:s.mentionedInfo)||void 0===t?void 0:t.type)===ge.ALL||(null===(r=null===(n=null==s?void 0:s.mentionedInfo)||void 0===n?void 0:n.userIdList)||void 0===r?void 0:r.includes(d.currentUserId)))&&(p=1);var _=d._getUltraGroup(e,p,o);a[l+"_"+i]=_,d._ultraGroupManager.addUltraGroupStatus(_),c.push(e)}})),Object.keys(a).length>0&&(this.logger.debug(Re.O,"notice ultragroups"),l=Object.values(a),l=Xl(l),this._watcher.conversation(Sr(l))),this.logger.debug(Re.O,"notice ultragroup message"),this._batchMessage(c),this._ultraGroupTimeQue=this._ultraGroupTimeQue.filter((function(e){return e>o})),this._lastSyncUltraMsgTimeStamp=o,s?(this._ultraGroupTimeQue.length>0&&(this._ultraGroupTimeQue.length=0,this._syncUltraMsg(o)),[2]):(this._syncUltraMsg(o),[2])):[2]}}))}))},n.prototype.sendUltraMessage=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,s,a,c,l,d,h,p,_,g,f,E;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?("RC:SRSMsg"===t.messageType&&this.logger.warn(Re.O,"ultra group -> direction message convert to message"),t=this._handleMsgProperties(t,!0),i=t.messageId?t.messageId:nr(),t.messageId=i,s=this._connMgr.codec.encodeUpMsg({conversationType:oe.ULTRA_GROUP,targetId:e},t),(a=new mo(Po[Po.ugMsg],s,e)).setHeaderQos(Ei.AT_LEAST_ONCE),c=this._connMgr.getCrtServerTime(),l=Jl(oe.ULTRA_GROUP,e,o({},t),"",c,this.currentUserId,i),n&&n(i),this.logger.info(Re.L_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:oe.ULTRA_GROUP,targetId:e,channelId:t.channelId}),r),d=Date.now(),[4,this._connMgr.send(a)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return h=u.sent(),p=h.code,_=h.data,p!==re.SUCCESS?(this.logger.warn(Re.L_SEND_MSG_R,JSON.stringify({code:p,messageUId:l.messageUId,messageId:l.messageId}),r),this._writeMessagesLog(oe.ULTRA_GROUP)&&this.statisticLog.record(ve.IM_MSG_SEND,JSON.stringify({channel:oe.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),l.sentStatus=Me.FAILED,[2,{code:p,data:l}]):(this.logger.info(Re.L_SEND_MSG_R,JSON.stringify({code:p,messageUId:null==_?void 0:_.messageUId,messageId:null==_?void 0:_.messageId}),r),g=_,this._writeMessagesLog(oe.ULTRA_GROUP,g.messageUId)&&this.statisticLog.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:g.messageUId,channel:oe.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),l.sentTime=g.timestamp,l.messageUId=g.messageUId,this._ultraMsgMap[g.messageUId]=g.timestamp,f=t.channelId||"",(E=this._ultraGroupMap[f+"_"+e])?(E.latestMessage=l,xt(E.channelType)&&(l.channelType=E.channelType)):(E={conversationType:oe.ULTRA_GROUP,targetId:e,channelId:f,unreadMessageCount:0,unreadMentionedCount:0,versionTime:l.sentTime,latestMessage:l,notificationStatus:de.CLOSE,notificationLevel:pe.NOT_SET,isTop:!1},this._ultraGroupMap[f+"_"+e]=E,this._ultraGroupManager.addUltraGroupStatus(E)),this._watcher.conversation(Sr([E])),[2,{code:p,data:l}])}}))}))},n.prototype.sendUltraGroupTypingStatus=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=e.conversationType,r=e.channelId,i=e.targetId,o=this._connMgr.codec.encodeOperateStatus(i,n,r||"",t||0),(s=new mo(Po[Po.operate],o,i)).setHeaderQos(Ei.AT_LEAST_ONCE),[4,this._connMgr.send(s)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return(a=u.sent().code)!==re.SUCCESS?[2,{code:a,msg:re[a]}]:[2,{code:a}]}}))}))},n.prototype.getUltraGroupMessageListByMessageUId=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?e.messages&&e.messages.length<1||e.messages&&e.messages.length>20?[2,{code:re.MSG_LIMIT_ERROR}]:(t={},e.messages.forEach((function(e){t[e.messageUId]=void 0})),n=this._connMgr.codec.encodeMsgQuery(e),(r=new Oo(Po[Po.qryMsg],n,this.currentUserId)).setHeaderQos(Ei.AT_LEAST_ONCE),[4,this._connMgr.send(r,Fa,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return i=u.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o,msg:re[o]}]:(a=(s||{}).list,Array.isArray(a)&&a.forEach((function(e){var n=e.messageUId;t[n]=e})),[2,{code:0,data:t}])}}))}))},n.prototype._pullOperateStatusNotify=function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.data,xa),n=t.conversationType,r=t.info,i=t.summary;this.logger.debug(Re.O,"s_opNtf -> type: "+n+", info: "+r+", summary: "+i),this._watcher.operateStatus(t)}},n.prototype.expandUltraMessage=function(e){return a(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeExpandUltraMessage(e,this.currentUserId),(n=new Oo(Po[Po.upMsgEx],t,e.targetId)).setHeaderQos(Ei.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return(r=i.sent().code)!==re.SUCCESS?[2,{code:r,msg:re[r]}]:[2,{code:r}]}}))}))},n.prototype.modifyMessage=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodemodifyMessage(e,this.currentUserId),(n=new Oo(Po[Po.modifyMsg],t,e.targetId)).setHeaderQos(Ei.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),i=r.code,o=r.data,i!==re.SUCCESS?[2,{code:i,msg:re[i]}]:(s=o,this._ultraMsgMap[s.messageUId]=s.timestamp,[2,{code:i}])}}))}))},n.prototype._handleEventChangeList=function(e){var t={Group:{map:{},types:Zl},Friend:{map:{},types:zl}},n=function(e,t,n){e[t]||(e[t]=[]),e[t].push(n)};e.forEach((function(e){var r=e.changeType;for(var i in t)if(t[i].types.includes(r)){n(t[i].map,r,e);break}}));var r={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&r[i](t[i].map)},n.prototype._pullUltraChangeMessageList=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,d;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?this._isPullingUltraChangeMessage?[2]:(this._isPullingUltraChangeMessage=!0,t=this._connMgr.codec.encodeQueryMsgChange(e),(n=new Oo(Po[Po.qryMsgChange],t,this.currentUserId)).setHeaderQos(Ei.AT_LEAST_ONCE),[4,this._connMgr.send(n,Da)]):[2];case 1:return r=u.sent(),i=r.code,o=r.data,this._isPullingUltraChangeMessage=!1,i===re.SUCCESS&&o?(s=o.hasNext,a=o.list,c=(null==o?void 0:o.syncTime)||0,this._handleUltraChangeList(a),l=this._pullUltraChangeMessageQue.filter((function(e){return e>c})),this._pullUltraChangeMessageQue.length=0,(d=this._pullUltraChangeMessageQue).push.apply(d,l),s?this._pullUltraChangeMessageList(c):this._lastPullingUltraChangeMessageTime=c,[2]):[2]}}))}))},n.prototype._handleUltraChangeList=function(e){var t={};e.forEach((function(e){var n=e.changeType;t[n]||(t[n]=[]),t[n].push(e)}));var n=Ke.CHANNEL_CHANGE,r=Ke.MSG_RECALL,i=Ke.MSG_EXPANSION,o=Ke.MSG_MODIFY,s=Ke.USER_GROUP_CHANGE;t[n]&&this._handleUltraChannelChange(t[n]),t[r]&&this._handleMsgRecall(t[r]),t[i]&&this._handleMsgUpdate(t[i]),t[o]&&this._handleMsgUpdate(t[o]),t[s]&&this._handleUserGroupStatus(t[s])},n.prototype._processChangeMapGroup=function(e){var t=Rt.GROUP_OPERATION,n=Rt.GROUP_PROFILE_CHANGE,r=Rt.GROUP_APPLICATION_INVITATION,i=Rt.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[n]&&this._handleGroupProfileChange(e[n]),e[r]&&this._handleApplication(e[r]),e[i]&&this._handleFollowUserChange(e[i])},n.prototype._processChangeMapFriend=function(e){var t=this;(e[Mt.FRIEND_APPLICATION]||[]).forEach((function(e){var n,r,i,o,s,a,u,c,l,d,h=e.subChangeType,p=e.businessId,_=e.time,g=e.eventData,f=Ut.FRIEND_APPLY,E=Ut.FRIEND_REFUSE,I=Ut.FRIEND_USER_INFO,T=Ut.FRIENDS_INPUT,R=Ut.FRIEND_CLEAR,v=Ut.FRIEND_INFO_CHANGE,C=Ut.FRIEND_INFO_CHANGE_SYNC;switch(h){case f:case E:var y=h===f?Ot.UNHANDLED:Ot.REFUSED;null===(r=(n=t._watcher).friendApplicationStatusChanged)||void 0===r||r.call(n,{userId:p,applicationType:g.applyType,applicationStatus:y,directionType:g.friendType,operationTime:_,extra:g.info||""});break;case I:null===(o=(i=t._watcher).friendAdd)||void 0===o||o.call(i,{userId:p,name:g.name,portraitUri:g.portraitUrl,directionType:g.friendType,operationTime:_});break;case T:null===(a=(s=t._watcher).friendDelete)||void 0===a||a.call(s,{userIds:g.targetId,directionType:g.type,operationTime:_});break;case R:null===(c=(u=t._watcher).friendCleared)||void 0===c||c.call(u,_);break;case v:break;case C:null===(d=(l=t._watcher).friendInfoChangedSync)||void 0===d||d.call(l,{userId:p,remark:g.remarkname,extProfile:g.extProfile,operationTime:_})}}))},n.prototype._handleGroupOperation=function(e){var t=this;e.forEach((function(e){var n,r,i=e.subChangeType,o=e.businessId,s=e.time,a=e.eventData,u=a.optUserInfo,c=a.channelInfo,l=a.userInfos,d={groupId:o,operation:i,operationTime:s};u&&(d.operatorInfo=wn([u])[0]),i===lt.CREATE&&(d.groupInfo=Pn([c])[0]),[lt.CREATE,lt.DISMISS].includes(i)||(d.memberInfos=wn(l)),null===(r=(n=t._watcher).groupOperation)||void 0===r||r.call(n,d)}))},n.prototype._handleGroupProfileChange=function(e){var t=this;e.forEach((function(e){var n,r,i,o,s,a,u=e.businessId,c=e.time,l=e.eventData,d=e.subChangeType,h=e.secondaryId;switch(d){case ht.GROUP_INFO_CHANGE:var p=wn([l.optUserInfo])[0],_=bn([l.channelInfo])[0];null===(r=(n=t._watcher).groupInfoChanged)||void 0===r||r.call(n,{operatorInfo:p,groupInfo:_,operationTime:c});break;case ht.MEMBER_PROFILE_CHANGE:p=wn([l.optUserInfo])[0];var g=wn(l.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:u,operatorInfo:p,memberInfo:g,operationTime:c});break;case ht.GROUP_REMARK_DELETE:case ht.GROUP_REMARK_SET:var f=d===ht.GROUP_REMARK_SET?ft.ADD:ft.REMOVE;null===(a=(s=t._watcher).groupRemarkChangedSync)||void 0===a||a.call(s,{groupId:u,operationType:f,operationTime:c,groupRemark:h})}}))},n.prototype._handleApplication=function(e){var t=this;e.forEach((function(e){var n=e.eventData.statusInfo;Fn(n).forEach((function(e){var n,r;null===(r=(n=t._watcher).groupApplicationEvent)||void 0===r||r.call(n,e)}))}))},n.prototype._handleFollowUserChange=function(e){var t=this;e.forEach((function(e){var n,r,i=e.subChangeType,o=e.businessId,s=e.time,a=e.userGroupIds,u=1===i?ft.ADD:ft.REMOVE;null===(r=(n=t._watcher).groupFollowsChangedSync)||void 0===r||r.call(n,{groupId:o,operationType:u,operationTime:s,userIds:a})}))},n.prototype._handleUltraChannelChange=function(e){var t=this,n=[],r=[],i=[];e.forEach((function(e){var o=e.subChangeType,s=e.targetId,a=e.channelId,u=e.sendTime,c=e.operatorId,l=a+"_"+s,d=t._ultraGroupMap[l];if(d){var h=qe.PUBLIC_TO_PRIVATE,p=qe.PRIVATE_TO_PUBLIC,_=qe.PUBLIC_TO_PRIVATE_USER_NOT_IN,g=qe.CHANNEL_DELETE,f=qe.CHANNEL_USER_KICKED;switch(o){case p:d.channelType=He.PUBLIC,n.push({targetId:s,channelId:a,changeType:Ye.PRIVATE_TO_PUBLIC,channelType:d.channelType});break;case h:d.channelType=He.PRIVATE,n.push({targetId:s,channelId:a,changeType:Ye.PUBLIC_TO_PRIVATE,channelType:d.channelType});break;case _:n.push({targetId:s,channelId:a,changeType:Ye.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:d.channelType}),delete t._ultraGroupMap[l];break;case g:r.push({targetId:s,channelId:a,channelType:d.channelType,deleteTime:u}),delete t._ultraGroupMap[l];break;case f:i.push({targetId:s,channelId:a,userId:c,channelType:He.PRIVATE}),c===t.currentUserId&&delete t._ultraGroupMap[l]}}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),r.length>0&&this._watcher.ultraGroupChannelDelete(r),i.length>0&&this._watcher.ultraGroupChannelUserKicked(i)},n.prototype._handleMsgRecall=function(e){var n=this,r=[];e.forEach((function(e){var i=e.targetId,o=e.channelId,s=e.messageUId,a=e.sendTime,u=e.conversationType,c=e.operatorId,l=e.mentionedType;n._updateUltraGroupWhenRecallMsg(i,o,s,a,l),r.push({targetId:i,conversationType:u,sentTime:a,messageUId:s,senderUserId:c,channelId:o,content:{conversationType:u,targetId:i,messageUId:s,channelId:o},messageDirection:1,messageType:ce.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:t.UNREAD,receivedStatusInfo:mr(t.UNREAD)})})),this._watcher.ultraGroupMessageRecalled(r)},n.prototype._handleMsgUpdate=function(e){var t={};for(var n in e.forEach((function(e){var n=e.targetId,r=e.conversationType,i=e.sendTime,o=e.messageUId,s=e.channelId,a=r+"_"+n;t[a]||(t[a]=[]),t[a].push({messageUId:o,channelId:s,sendTime:i})})),t){var r=n.split("_"),i=r.shift(),o=r.join("_");this._pullUltraMessageList(e[0].changeType,{targetId:o,conversationType:Number(i),messages:c([],t[n],!0)})}},n.prototype._pullUltraMessageList=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,l=this;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=this._connMgr.codec.encodeMsgQuery(t),(r=new Oo(Po[Po.qryMsg],n,this.currentUserId)).setHeaderQos(Ei.AT_LEAST_ONCE),[4,this._connMgr.send(r,Fa,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return i=u.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o,msg:re[o]}]:(a=(s||{}).list,c=[],Array.isArray(a)&&a.forEach((function(e){var t=e.targetId,n=e.channelId,r=e.messageUId,i=l._ultraGroupMap[n+"_"+t];i&&i.latestMessage.messageUId===r&&(i.latestMessage=e),c.push(e)})),e===Ke.MSG_EXPANSION&&this._watcher.ultraGroupMessageExpansionUpdated(c),e===Ke.MSG_MODIFY&&this._watcher.ultraGroupMessageModified(c),[2])}}))}))},n.prototype._handleUserGroupStatus=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,d,h;return u(this,(function(u){return t=je.REMOVE_USER_GROUP,n=je.JOIN_USER_GROUP,r=je.EXIT_USER_GROUP,i=je.CHANNEL_BIND_USER_GROUP,o=je.CHANNEL_UNBIND_USER_GROUP,s=[],a=[],c=[],l=[],d=[],e.forEach((function(e){var u=e.conversationType,h=e.targetId,p=e.userGroupIds,_=e.busChannelType,g=e.channelId;switch(e.subChangeType){case t:s.push({conversation:{conversationType:u,targetId:h},userGroupIds:p});break;case n:a.push({conversation:{conversationType:u,targetId:h},userGroupIds:p});break;case r:c.push({conversation:{conversationType:u,targetId:h},userGroupIds:p});break;case i:l.push({conversation:{conversationType:u,targetId:h,channelId:g},channelType:_,userGroupIds:p});break;case o:d.push({conversation:{conversationType:u,targetId:h,channelId:g},channelType:_,userGroupIds:p})}})),h={},s.length>0&&(h.userGroupDisband=s),a.length>0&&(h.userAdded=a),c.length>0&&(h.userRemoved=c),l.length>0&&(h.userGroupBindChannel=l),d.length>0&&(h.userGroupUnBindChannel=d),this._watcher.userGroupStatus(h),[2]}))}))},n.prototype.getUltraHistoryMsg=function(e,t,n){var r;return a(this,void 0,void 0,(function(){var i,o,s,a,c,l;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(i=this._connMgr.codec.encodeGetHistoryMsg(e,t),o=new Oo(Po[Po.qryUgMsg],i,this.currentUserId),this.logger.info(Re.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:e,conversationType:oe.ULTRA_GROUP,channelId:t.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,this._connMgr.send(o,Cs,{currentUserId:this.currentUserId,conversation:{conversationType:oe.ULTRA_GROUP,targetId:e}})]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return s=u.sent(),a=s.code,c=s.data,a===re.SUCCESS&&c?(l=[],null===(r=c.list)||void 0===r||r.forEach((function(e){e&&l.push(e.messageUId)})),this.logger.info(Re.L_GET_HISTORY_MSG_R,JSON.stringify({code:a,messageUIds:l.join(",")}),n),[2,{code:a,data:c}]):(this.logger.warn(Re.L_GET_HISTORY_MSG_R,JSON.stringify({code:a,messageUIds:""}),n),[2,{code:a}])}}))}))},n.prototype.setUltraGroupDefaultNotificationLevel=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(r=this._connMgr.codec.encodeSetUltraGroupDefaultNotificationLevel(t,n),i=new Oo(Po[Po.ugUnpushSet],r,e),[4,this._connMgr.send(i)]):[2,{code:re.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:re.METHOD_NOT_AVAILABLE})];case 1:return o=a.sent(),s=o.code,re.SUCCESS,[2,{code:s}]}}))}))},n.prototype.getUltraGroupDefaultNotificationLevel=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this._connMgr,r=n.codec.encodeGetUltraGroupDefaultNotificationLevel(t),i=new Oo(Po[Po.ugUnpushQuery],r,e),[4,n.send(i,Ia)]):[2,{code:re.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:re.METHOD_NOT_AVAILABLE})];case 1:return o=u.sent(),s=o.code,a=o.data,s===re.SUCCESS&&a?(c=a.unpushLevel,[2,{code:s,data:c}]):[2,{code:s}]}}))}))},n.prototype._updateUltraGroupWhenRecallMsg=function(e,t,n,r,i){var o=t+"_"+e;if(this._ultraGroupMap[o]){var s=this._ultraGroupMap[o],a=s.latestMessage,u=s.lastReadTime;a&&a.messageUId===n&&(s.latestMessage=null),r&&u<r&&s.unreadMessageCount>0&&(--s.unreadMessageCount,(i===Qe.ALL||i===Qe.ME)&&s.unreadMentionedCount>0&&--s.unreadMentionedCount,i===Qe.ME&&s.unreadMentionedCount>0&&--s.unreadMentionedMeCount,this._watcher.conversation(Sr([s])))}},n.prototype.getAllConversationState=function(){return Promise.resolve({code:re.SUCCESS,data:this._conversationManager.getAllConversationState()})},n.prototype.getUltraGroupUnreadMentionedMessages=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o;return u(this,(function(s){switch(s.label){case 0:return this._isConnected?this._isUltraGroupListExist?(t=this._connMgr.codec.encodeUnreadMentionedMsgQuery(e),n=new Oo(Po[Po.qryUgUal],t,this.currentUserId),[4,this._connMgr.send(n,Ea)]):[2,Promise.resolve({code:re.METHOD_NOT_AVAILABLE})]:[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return r=s.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?[2,{code:i,data:o}]:[2,{code:i}]}}))}))},n.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i;return u(this,(function(o){return this._isConnected?this._isUltraGroupListExist?(t=e.targetId,n=e.channelId,r=this._ultraGroupMap[n+"_"+t]||{},i=r.firstUnreadMessage||null,[2,{code:re.SUCCESS,data:i}]):[2,Promise.resolve({code:re.METHOD_NOT_AVAILABLE})]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.subscribeUser=function(e,t,n){return a(this,void 0,void 0,(function(){return u(this,(function(r){return this._isConnected?[2,this._subscribeManager.updateSubscribeRelation(e,t,rt.SUBSCRIBE,n)]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.unSubscribeUser=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){switch(n.label){case 0:return this._isConnected?[4,this._subscribeManager.updateSubscribeRelation(e,t,rt.UNSUBSCRIBE)]:[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return[2,{code:n.sent().code}]}}))}))},n.prototype.getSubscribeUserList=function(e,t,n){var r;return a(this,void 0,void 0,(function(){var i;return u(this,(function(o){return this._isConnected?(i=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserList(e,t,n),[2,Promise.resolve({code:re.SUCCESS,data:i})]):[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getSubscribeUserStatus=function(e,t){var n;return a(this,void 0,void 0,(function(){var r;return u(this,(function(i){return this._isConnected?(r=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserStatus(e,t),[2,Promise.resolve({code:re.SUCCESS,data:r})]):[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.updateMyUserProfile=function(e){var t;return a(this,void 0,void 0,(function(){var n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=this._connMgr.codec.encodeUserProfile(e),r=new Oo(Po[Po.updUserProfile],n,this.currentUserId),[4,this._connMgr.send(r,fu)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return i=u.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o,data:{errorKey:null==s?void 0:s.key}}]:(a=s.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,a),[2,{code:o}])}}))}))},n.prototype.getMyUserProfile=function(){return this._isConnected?this._subscribeManager.getOwnProfile():Promise.resolve({code:re.RC_NET_UNAVAILABLE})},n.prototype.getUserProfiles=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return this._isConnected?[2,this._subscribeManager.getUserProfiles(e)]:[2,{code:re.RC_NET_UNAVAILABLE}]}))}))},n.prototype.updateMyUserProfileVisibility=function(e){return a(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUserProfilePermission(e),n=new Oo(Po[Po.updProfilePermiss],t,this.currentUserId),[4,this._connMgr.send(n)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return[2,{code:r.sent().code}]}}))}))},n.prototype.getMyUserProfileVisibility=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i;return u(this,(function(o){switch(o.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodeUserProfileInput(),t=new Oo(Po[Po.qProfilePermiss],e,this.currentUserId),[4,this._connMgr.send(t,Ru)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return n=o.sent(),r=n.code,i=n.data,r!==re.SUCCESS?[2,{code:r}]:[2,{code:r,data:null==i?void 0:i.permission}]}}))}))},n.prototype.searchUserProfileByUniqueId=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeSearchUserProfile(e),n=new Oo(Po[Po.searchUserProfile],t,this.currentUserId),[4,this._connMgr.send(n,_u)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(s=Or(o.userId,o.userProfile,o.userExtProfile),[2,{code:i,data:s}]):[2,{code:i}]}}))}))},n.prototype.bindRTCRoomForChatroom=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i;return u(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=e.chatRoomId,n=this._connMgr.codec.encodebindRTCRoomForChatroom(e),r=new Oo(Po[Po.setRtcRoomId],n,t),[4,this._connMgr.send(r)]):[2,re.RC_NET_UNAVAILABLE];case 1:return i=o.sent(),[2,i.code]}}))}))},n.prototype.rtcSignaling=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return this._isConnected?(i=r instanceof ArrayBuffer?Array.prototype.slice.call(new Int8Array(r)):r,o=n?new Oo(t,i,e):new mo(t,i,e),[4,this._connMgr.send(o)]):[2,{code:re.RC_NET_UNAVAILABLE}];case 1:return s=u.sent(),a=s.code,c=s.data,[2,{code:a,buffer:null==c?void 0:c.data}]}}))}))},n.prototype.rtcPing=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return r=pc(this.rtcCodec,t,n),[4,this.rtcSignaling(e,Po[Po.rtcPing],!0,r)];case 1:return i=u.sent(),o=i.code,s=i.buffer,o!==re.SUCCESS?[2,{code:o}]:((a=this.rtcCodec.decode(_r.RtcOutput,s)).version=Ln(a.version),[2,{code:o,data:a}])}}))}))},n.prototype.getDeviceId=function(){return Rn(this.runtime)},n.prototype.getOSInfo=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,{code:re.NOT_SUPPORT}]}))}))},n.prototype.getProcessInfo=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,{code:re.NOT_SUPPORT}]}))}))},n.prototype.getMainProcessInfo=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,{code:re.NOT_SUPPORT}]}))}))},n.prototype.destroy=function(){mc(),El()},n.prototype.callExtra=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Promise.resolve({code:re.NOT_SUPPORT})},n.prototype.setProxy=function(e){return Promise.resolve({code:re.NOT_SUPPORT})},n.prototype.getProxy=function(){return Promise.resolve({code:re.NOT_SUPPORT})},n.prototype.testProxy=function(e,t){return Promise.resolve({status:re.NOT_SUPPORT})},n.prototype.setNetwork=function(e,t){var n;if(this._connMgr.setNetwork(e,t),e.status&&this.cloudControllerUri){var r=this._connMgr.getToken();null===(n=this.cloudController)||void 0===n||n.request(this.cloudControllerUri,Tl.newWorkChange,r)}},n.prototype.createGroup=function(e,t,n,r){var i,o;return a(this,void 0,void 0,(function(){var s,a,c,l,d;return u(this,(function(u){switch(u.label){case 0:return s=this._connMgr.codec.encodeGroupInfo("create",e,t,n,r),a=new Oo(Po[Po.channelCreate],s,e),[4,this._connMgr.send(a,mu)];case 1:return c=u.sent(),l=c.code,d=c.data,l!==re.SUCCESS?[2,{code:l,msg:null!==(i=null==d?void 0:d.msg)&&void 0!==i?i:""}]:[2,{code:l,data:{processCode:null!==(o=null==d?void 0:d.processCode)&&void 0!==o?o:0}}]}}))}))},n.prototype.updateGroupInfo=function(e,t,n){var r;return a(this,void 0,void 0,(function(){var i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return i=this._connMgr.codec.encodeGroupInfo("update",e,t,n),o=new Oo(Po[Po.upChannelInfo],i,e),[4,this._connMgr.send(o,mu)];case 1:return s=u.sent(),a=s.code,c=s.data,a!==re.SUCCESS?[2,{code:a,msg:null!==(r=null==c?void 0:c.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))},n.prototype.getGroupsInfo=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeMultiChannels(e),n=new Oo(Po[Po.qChannelInfo],t,e[0]),[4,this._connMgr.send(n,Lu)];case 1:return r=u.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(s=o.result.list,a=Pn(void 0===s?[]:s),[2,{code:i,data:a}]):[2,{code:i}]}}))}))},n.prototype.kickGroupMembers=function(e,t,n){var r;return a(this,void 0,void 0,(function(){var i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return i=this._connMgr.codec.encodeQuitGroup("kick",e,t,!0,n),o=new Oo(Po[Po.channelMemKick],i,e),[4,this._connMgr.send(o,mu)];case 1:return s=u.sent(),a=s.code,c=s.data,a!==re.SUCCESS?[2,{code:a,msg:null!==(r=null==c?void 0:c.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))},n.prototype.quitGroup=function(e,t){var n;return a(this,void 0,void 0,(function(){var r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return r=this._connMgr.codec.encodeQuitGroup("quit",e,[],!0,t),i=new Oo(Po[Po.channelMemQuit],r,e),[4,this._connMgr.send(i,mu)];case 1:return o=u.sent(),s=o.code,a=o.data,s!==re.SUCCESS?[2,{code:s,msg:null!==(n=null==a?void 0:a.msg)&&void 0!==n?n:""}]:[2,{code:s}]}}))}))},n.prototype.dismissGroup=function(e){var t;return a(this,void 0,void 0,(function(){var n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeQuitGroup("dismiss",e),r=new Oo(Po[Po.channelDismiss],n,e),[4,this._connMgr.send(r,mu)];case 1:return i=a.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o,msg:null!==(t=null==s?void 0:s.msg)&&void 0!==t?t:""}]:[2,{code:o}]}}))}))},n.prototype.transferGroupOwner=function(e,t,n,r){var i;return a(this,void 0,void 0,(function(){var o,s,a,c,l;return u(this,(function(u){switch(u.label){case 0:return o=this._connMgr.codec.encodeQuitGroup("transfer",e,[t],n,r),s=new Oo(Po[Po.channelTransfer],o,e),[4,this._connMgr.send(s,mu)];case 1:return a=u.sent(),c=a.code,l=a.data,c!==re.SUCCESS?[2,{code:c,msg:null!==(i=null==l?void 0:l.msg)&&void 0!==i?i:""}]:[2,{code:c}]}}))}))},n.prototype.setGroupManagers=function(e,t,n){var r;return a(this,void 0,void 0,(function(){var i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return i=this._connMgr.codec.encodeModifyChannelsInput(e,t,n),o=new Oo(Po[Po.upChannelManager],i,t),[4,this._connMgr.send(o,mu)];case 1:return s=u.sent(),a=s.code,c=s.data,a!==re.SUCCESS?[2,{code:a,msg:null!==(r=null==c?void 0:c.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))},n.prototype.getGroupMembersByRole=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a,c,l,d,h,p,_;return u(this,(function(u){switch(u.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembersByRole",groupId:e,option:n,roleType:t}),i=new Oo(Po[Po.qChannelMem],r,e),[4,this._connMgr.send(i,Lu)];case 1:return o=u.sent(),s=o.code,a=o.data,s===re.SUCCESS&&a?(c=a.result,l=a.page,h=(d=l||{}).pageToken,p=d.hasNext,[],_=wn(c.list),[2,{code:s,data:{data:_,pageToken:p&&h?h:""}}]):[2,{code:s}]}}))}))},n.prototype.getGroupMembers=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembers",groupId:e,ids:t}),r=new Oo(Po[Po.qChannelSpeMem],n,e),[4,this._connMgr.send(r,Lu)];case 1:return i=u.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o}]:s?(a=s.result,[],c=wn(a.list),[2,{code:o,data:c}]):[2,{code:o,data:[]}]}}))}))},n.prototype.setGroupMemberInfo=function(e,t,n,r){var i;return a(this,void 0,void 0,(function(){var o,s,a,c,l;return u(this,(function(u){switch(u.label){case 0:return o=this._connMgr.codec.encodeSetGroupMemberInfo(e,t,n,r),s=new Oo(Po[Po.upChannelMem],o,e),[4,this._connMgr.send(s,mu)];case 1:return a=u.sent(),c=a.code,l=a.data,c!==re.SUCCESS?[2,{code:c,msg:null!==(i=null==l?void 0:l.msg)&&void 0!==i?i:""}]:[2,{code:c}]}}))}))},n.prototype.searchGroupMembers=function(e,t,n){return Promise.resolve({code:re.NOT_SUPPORT})},n.prototype.joinGroup=function(e){var t;return a(this,void 0,void 0,(function(){var n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeJoinGroup("join",e),r=new Oo(Po[Po.channelMemJoin],n,e),[4,this._connMgr.send(r,mu)];case 1:return i=a.sent(),o=i.code,s=i.data,[2,{code:o,data:{processCode:null!==(t=null==s?void 0:s.processCode)&&void 0!==t?t:0}}]}}))}))},n.prototype.inviteUsersToGroup=function(e,t){var n,r;return a(this,void 0,void 0,(function(){var i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return i=this._connMgr.codec.encodeJoinGroup("invite",e,t),o=new Oo(Po[Po.channelMemInvite],i,e),[4,this._connMgr.send(o,mu)];case 1:return s=u.sent(),a=s.code,c=s.data,a!==re.SUCCESS?[2,{code:a,msg:null!==(n=null==c?void 0:c.msg)&&void 0!==n?n:""}]:[2,{code:a,data:{processCode:null!==(r=null==c?void 0:c.processCode)&&void 0!==r?r:0}}]}}))}))},n.prototype.memberInviteResponse=function(e){var t,n;return a(this,void 0,void 0,(function(){var r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return r=this._connMgr.codec.encodeMemberResponseInput(e),i=new Oo(Po[Po.channelApplyResp],r,e.groupId),[4,this._connMgr.send(i,mu)];case 1:return o=u.sent(),s=o.code,a=o.data,s!==re.SUCCESS?[2,{code:s,msg:null!==(t=null==a?void 0:a.msg)&&void 0!==t?t:""}]:[2,{code:s,data:{processCode:null!==(n=null==a?void 0:a.processCode)&&void 0!==n?n:0}}]}}))}))},n.prototype.getGroupApplications=function(e,t,n){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,d,h;return u(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupApplications",option:e}),n=new Oo(Po[Po.qChannelApplyList],t,this.currentUserId),[4,this._connMgr.send(n,Lu)];case 1:return r=u.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(s=o.result,a=o.page,l=(c=a||{}).pageToken,d=c.hasNext,h=Fn(null==s?void 0:s.list)||[],[2,{code:i,data:{data:h,pageToken:d&&l?l:""}}]):[2,{code:i}]}}))}))},n.prototype.getJoinedGroupsByRole=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,l,d,h,p;return u(this,(function(u){switch(u.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroupsByRole",option:t,roleType:e}),r=new Oo(Po[Po.qChannelMemJoin],n,this.currentUserId),[4,this._connMgr.send(r,Lu)];case 1:return i=u.sent(),o=i.code,s=i.data,o===re.SUCCESS&&s?(a=s.result,c=s.page,d=(l=c||{}).pageToken,h=l.hasNext,p=Pn(a.list),[2,{code:o,data:{data:p,pageToken:h&&d?d:""}}]):[2,{code:o}]}}))}))},n.prototype.searchJoinedGroups=function(e,t){return Promise.resolve({code:re.NOT_SUPPORT})},n.prototype.getJoinedGroups=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroups",ids:e}),n=new Oo(Po[Po.qChannelMemSpeJoin],t,this.currentUserId),[4,this._connMgr.send(n,Lu)];case 1:return r=u.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(s=o.result.list,a=Pn(s),[2,{code:i,data:a}]):[2,{code:i}]}}))}))},n.prototype.setGroupRemark=function(e,t){return a(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeSetGroupRemark(e,t),r=new Oo(Po[Po.upChannelRemark],n,e),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))},n.prototype.setGroupFollows=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i;return u(this,(function(o){switch(o.label){case 0:return r=this._connMgr.codec.encodeSetGroupFollows(e,t,n),i=new Oo(Po[Po.upChannelFollow],r,t),[4,this._connMgr.send(i)];case 1:return[2,{code:o.sent().code}]}}))}))},n.prototype.getGroupFollows=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupFollows",groupId:e}),n=new Oo(Po[Po.qChannelFollow],t,this.currentUserId),[4,this._connMgr.send(n,Lu)];case 1:return r=u.sent(),i=r.code,o=r.data,i===re.SUCCESS&&o?(s=o.result,a=Gn(s.list),[2,{code:i,data:a}]):[2,{code:i}]}}))}))},n.prototype.addFriend=function(e,t,n){var r;return a(this,void 0,void 0,(function(){var i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return i=this._connMgr.codec.encodeFriendInput({targetId:e,type:t,info:n}),o=new Oo(Po[Po.friendAdd],i,this.currentUserId),[4,this._connMgr.send(o,mu)];case 1:return s=u.sent(),a=s.code,c=s.data,a===re.SUCCESS&&c?[2,{code:a,data:{processCode:null!==(r=null==c?void 0:c.processCode)&&void 0!==r?r:0}}]:[2,{code:a}]}}))}))},n.prototype.deleteFriends=function(e,t){return a(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new Oo(Po[Po.friendDel],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))},n.prototype.acceptFriendApplication=function(e){return a(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return t=this._connMgr.codec.encodeFriendInput({targetId:e,type:1}),n=new Oo(Po[Po.friendHandle],t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))},n.prototype.refuseFriendApplication=function(e,t){return a(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeFriendInput({targetId:e,type:2,info:t}),r=new Oo(Po[Po.friendHandle],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))},n.prototype.setFriendInfo=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i;return u(this,(function(o){switch(o.label){case 0:return r=this._connMgr.codec.encodeFriendProfileInput({targetId:e,remark:t,extProfile:n}),i=new Oo(Po[Po.friendSetPf],r,this.currentUserId),[4,this._connMgr.send(i)];case 1:return[2,{code:o.sent().code}]}}))}))},n.prototype.checkFriends=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new Oo(Po[Po.friendCheck],n,this.currentUserId),[4,this._connMgr.send(r,Xu)];case 1:return i=u.sent(),o=i.code,s=i.data,o!==re.SUCCESS?[2,{code:o}]:s?(a=s.list.map((function(e){return{userId:e.targetId,relationType:e.status}})),[2,{code:o,data:a}]):[2,{code:o,data:[]}]}}))}))},n.prototype.getFriends=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,l,d,h;return u(this,(function(u){switch(u.label){case 0:return n=this._connMgr.codec.encodeFriendQueryInput(11,t,e),r=new Oo(Po[Po.friendsQuery],n,this.currentUserId),[4,this._connMgr.send(r,Lu)];case 1:return i=u.sent(),o=i.code,s=i.data,o===re.SUCCESS&&s?(a=s.result,c=s.page,d=(l=c||{}).pageToken,h=l.hasNext,a&&a.list?[2,{code:o,data:{data:ql(a.list),pageToken:h&&d?d:""}}]:[2,{code:o,data:{data:[],pageToken:h&&d?d:""}}]):[2,{code:o}]}}))}))},n.prototype.getFriendApplications=function(e,t,n){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,d;return u(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeFriendQueryInput(12,e),n=new Oo(Po[Po.friendsQuery],t,this.currentUserId),[4,this._connMgr.send(n,Lu)];case 1:return r=u.sent(),i=r.code,o=r.data,i!==re.SUCCESS?[2,{code:i}]:o?(s=o.result,a=o.page,l=(c=a||{}).pageToken,d=c.hasNext,[2,{code:i,data:{data:jl(s),pageToken:d&&l?l:""}}]):[2,{code:i,data:{data:[],pageToken:""}}]}}))}))},n.prototype.deleteFriendApplication=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,{code:re.NOT_SUPPORT}]}))}))},n.prototype.getFriendsInfo=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o;return u(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeFriendsListInput(e),n=new Oo(Po[Po.friendsInfoQry],t,this.currentUserId),[4,this._connMgr.send(n,oc)];case 1:return r=s.sent(),i=r.code,o=r.data,i!==re.SUCCESS?[2,{code:i}]:o?[2,{code:i,data:ql(o.list)}]:[2,{code:i,data:[]}]}}))}))},n.prototype.searchFriendsInfo=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,Promise.resolve({code:re.NOT_SUPPORT})]}))}))},n.prototype.setFriendAddPermission=function(e){return a(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return t=this._connMgr.codec.encodeFriendLevelSet(e),n=new Oo(Po[Po.friendAuthSet],t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))},n.prototype.getFriendAddPermission=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i;return u(this,(function(o){switch(o.label){case 0:return e=this._connMgr.codec.encodeFriendInput({targetId:this.currentUserId}),t=new Oo(Po[Po.friendAuthGet],e,this.currentUserId),[4,this._connMgr.send(t,rc)];case 1:return n=o.sent(),r=n.code,i=n.data,r===re.SUCCESS&&i?[2,{code:r,data:i}]:[2,{code:r}]}}))}))},n.prototype.getConversationListWithAllChannel=function(){throw new Error("Method not implemented.")},n.prototype.getConversationListWithAllChannelByPage=function(e,t){throw new Error("Method not implemented.")},n.prototype.getConversationsByPage=function(e,t,n,r,i){throw new Error("Method not implemented.")},n.prototype.getContinuousMessages=function(e,t,n,r,i,o){throw new Error("Method not implemented.")},n.prototype.getHistoryMessagesByObjectNames=function(e,t,n,r,i,o,s){throw new Error("Method not implemented.")},n.prototype.clearConversations=function(){throw new Error("Method not implemented.")},n.prototype.setUserStatusListener=function(e,t){throw new Error("Method not implemented.")},n.prototype.setUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.subscribeUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.getUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.addToBlacklist=function(e){return Promise.resolve(re.NOT_SUPPORT)},n.prototype.removeFromBlacklist=function(e){return Promise.resolve(re.NOT_SUPPORT)},n.prototype.getBlacklist=function(){return Promise.resolve({code:re.NOT_SUPPORT})},n.prototype.getBlacklistStatus=function(e){return Promise.resolve({code:re.NOT_SUPPORT})},n.prototype.insertMessage=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.batchInsertMessage=function(e,t){throw new Error("Method not implemented.")},n.prototype.getMessageCount=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.deleteMessages=function(e){throw new Error("Method not implemented.")},n.prototype.deleteMessagesByTimestamp=function(e,t,n,r,i){throw new Error("Method not implemented.")},n.prototype.batchClearMessagesByTimestamp=function(e){throw new Error("Method not implemented.")},n.prototype.clearMessages=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.getMessage=function(e){throw new Error("Method not implemented.")},n.prototype.setMessageContent=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.setMessageSearchField=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.searchConversationByContent=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.searchConversationByContentWithAllChannel=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.searchMessageByContent=function(e,t,n,r,i,o){throw new Error("Method not implemented.")},n.prototype.searchMessageByContentAndMessageType=function(e,t,n,r,i,o,s){throw new Error("Method not implemented.")},n.prototype.searchMessagesByUser=function(e,t,n,r,i,o){throw new Error("Method not implemented.")},n.prototype.getMessagesByTimestamp=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.searchMessageByContentWithAllChannel=function(e,t,n,r,i){throw new Error("Method not implemented.")},n.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,r,i,o,s){throw new Error("Method not implemented.")},n.prototype.getUnreadMentionedMessages=function(e,t){throw new Error("Method not implemented.")},n.prototype.setMessageSentStatus=function(e,t){throw new Error("Method not implemented.")},n.prototype.updateMessageReceiptStatus=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.setMessageReceivedStatus=function(e,t){throw new Error("Method not implemented.")},n.prototype.clearData=function(){throw new Error("Method not implemented.")},n.prototype.clearUnreadCountByTimestamp=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.setCallInfo=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return(r=this._connMgr)?(i=r.codec.encodeSetCallInfo(t,n),[4,r.send(new Oo(ji,i,e),ja)]):[3,2];case 1:return o=u.sent(),s=o.code,a=o.data,s===re.SUCCESS&&a?[2,Promise.resolve({code:s,data:{key:a.key,value:a.dataContent}})]:[2,Promise.resolve({code:s})];case 2:return[2,Promise.resolve({code:re.RC_NET_CHANNEL_INVALID})]}}))}))},n.prototype.getGroupMessageDeliverList=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.getPrivateMessageDeliverTime=function(e,t){throw new Error("Method not implemented.")},n.prototype.setCheckDuplicateMessage=function(e){throw new Error("Method not implemented.")},n.prototype.setCheckChatRoomDuplicateMessage=function(e){throw new Error("Method not implemented.")},n.prototype.getConversations=function(e){throw new Error("Method not implemented.")},s([$l()],n.prototype,"createGroup",null),s([$l()],n.prototype,"updateGroupInfo",null),s([$l()],n.prototype,"getGroupsInfo",null),s([$l()],n.prototype,"kickGroupMembers",null),s([$l()],n.prototype,"quitGroup",null),s([$l()],n.prototype,"dismissGroup",null),s([$l()],n.prototype,"transferGroupOwner",null),s([$l()],n.prototype,"setGroupManagers",null),s([$l()],n.prototype,"getGroupMembersByRole",null),s([$l()],n.prototype,"getGroupMembers",null),s([$l()],n.prototype,"setGroupMemberInfo",null),s([$l()],n.prototype,"joinGroup",null),s([$l()],n.prototype,"inviteUsersToGroup",null),s([$l()],n.prototype,"memberInviteResponse",null),s([$l()],n.prototype,"getGroupApplications",null),s([$l()],n.prototype,"getJoinedGroupsByRole",null),s([$l()],n.prototype,"getJoinedGroups",null),s([$l()],n.prototype,"setGroupRemark",null),s([$l()],n.prototype,"setGroupFollows",null),s([$l()],n.prototype,"getGroupFollows",null),s([$l()],n.prototype,"addFriend",null),s([$l()],n.prototype,"deleteFriends",null),s([$l()],n.prototype,"acceptFriendApplication",null),s([$l()],n.prototype,"refuseFriendApplication",null),s([$l()],n.prototype,"setFriendInfo",null),s([$l()],n.prototype,"checkFriends",null),s([$l()],n.prototype,"getFriends",null),s([$l()],n.prototype,"getFriendApplications",null),s([$l()],n.prototype,"deleteFriendApplication",null),s([$l()],n.prototype,"getFriendsInfo",null),s([$l()],n.prototype,"searchFriendsInfo",null),s([$l()],n.prototype,"setFriendAddPermission",null),s([$l()],n.prototype,"getFriendAddPermission",null),n}(ai),td=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.joinRTCRoom=function(e,t,n,r,i,o){return a(this,void 0,void 0,(function(){var s,a,c,l,d;return u(this,(function(u){switch(u.label){case 0:return s=pc(this._context.rtcCodec,t,n,r,i,o),[4,this.rtcSignaling(e,Gr,!0,s)];case 1:return a=u.sent(),c=a.code,l=a.buffer,c===re.SUCCESS&&l&&(d=_c(this._context.rtcCodec,l)),[2,{code:c,data:d}]}}))}))},t.prototype.quitRTCRoom=function(e){return a(this,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return t=this._context.rtcCodec.encode(_r.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,Br,!0,t)];case 1:return[2,n.sent().code]}}))}))},t.prototype.rtcPing=function(e,t,n){return a(this,void 0,void 0,(function(){return u(this,(function(r){switch(r.label){case 0:return[4,this._context.rtcPing(e,t,n)];case 1:return[2,r.sent().code]}}))}))},t.prototype.rtcPingResVersion=function(e,t,n){return this._context.rtcPing(e,t,n)},t.prototype.getRTCRoomInfo=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o;return u(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(_r.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Fr,!0,t)];case 1:return n=s.sent(),r=n.code,i=n.buffer,r===re.SUCCESS&&i&&(o=this._context.rtcCodec.decode(_r.RtcRoomInfoOutput,i)),[2,{code:r,data:o}]}}))}))},t.prototype.getRTCUserInfoList=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s;return u(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(_r.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,kr,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===re.SUCCESS&&i&&(s=_c(this._context.rtcCodec,i),o={users:s.users}),[2,{code:r,data:o}]}}))}))},t.prototype.getRTCUserInfo=function(e){throw new Error("Method not implemented.")},t.prototype.setRTCUserInfo=function(e,t,n){return a(this,void 0,void 0,(function(){var r;return u(this,(function(i){switch(i.label){case 0:return r=this._context.rtcCodec.encode(_r.RtcValueInfo,{key:t,value:n}),[4,this.rtcSignaling(e,xr,!0,r)];case 1:return[2,i.sent().code]}}))}))},t.prototype.removeRTCUserInfo=function(e,t){return a(this,void 0,void 0,(function(){var n;return u(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(_r.RtcKeyDeleteInput,{key:t}),[4,this.rtcSignaling(e,Hr,!1,n)];case 1:return[2,r.sent().code]}}))}))},t.prototype.setRTCData=function(e,t,n,r,i,o){return a(this,void 0,void 0,(function(){var s;return u(this,(function(a){switch(a.label){case 0:return s=this._context.rtcCodec.encode(_r.RtcSetDataInput,{interior:r,target:i,key:t,value:n,objectName:null==o?void 0:o.name,content:null==o?void 0:o.content}),[4,this.rtcSignaling(e,Yr,!1,s)];case 1:return[2,a.sent().code]}}))}))},t.prototype.setRTCTotalRes=function(e,t,n,r,i){return void 0===i&&(i=""),a(this,void 0,void 0,(function(){var o,s;return u(this,(function(a){switch(a.label){case 0:return o={objectName:r,content:this._context.rtcCodec.encode(_r.RtcValueInfo,{key:t.name,value:t.content},!0),valueInfo:[this._context.rtcCodec.encode(_r.RtcValueInfo,{key:"uris",value:n},!0),this._context.rtcCodec.encode(_r.RtcValueInfo,{key:"mcu_uris",value:i},!0)]},s=this._context.rtcCodec.encode(_r.RtcUserSetDataInput,o),[4,this.rtcSignaling(e,Kr,!0,s)];case 1:return[2,a.sent().code]}}))}))},t.prototype.setRTCCDNUris=function(e,t,n){return a(this,void 0,void 0,(function(){var r;return u(this,(function(i){switch(i.label){case 0:return r=this._context.rtcCodec.encode(_r.RtcUserSetDataInput,{objectName:t,valueInfo:this._context.rtcCodec.encode(_r.RtcValueInfo,{key:"cdn_uris",value:n},!0)}),[4,this.rtcSignaling(e,Kr,!0,r)];case 1:return[2,i.sent().code]}}))}))},t.prototype.getRTCData=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,o,s,a,c,l;return u(this,(function(u){switch(u.label){case 0:return i=this._context.rtcCodec.encode(_r.RtcDataInput,{interior:n,target:r,key:t}),[4,this.rtcSignaling(e,qr,!0,i)];case 1:return o=u.sent(),s=o.code,a=o.buffer,s===re.SUCCESS&&a?(c=this._context.rtcCodec.decode(_r.RtcQryOutput,a).outInfo,l={},c.forEach((function(e){l[e.key]=e.value})),[2,{code:s,data:l}]):[2,{code:s}]}}))}))},t.prototype.removeRTCData=function(e,t,n,r,i){return a(this,void 0,void 0,(function(){var o;return u(this,(function(s){switch(s.label){case 0:return o=this._context.rtcCodec.encode(_r.RtcDataInput,{interior:n,target:r,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,jr,!1,o)];case 1:return[2,s.sent().code]}}))}))},t.prototype.setRTCOutData=function(e,t,n,r){return a(this,void 0,void 0,(function(){return u(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))},t.prototype.getRTCOutData=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))},t.prototype.getRTCToken=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return r=pc(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,Qr,!0,r)];case 1:return i=u.sent(),o=i.code,s=i.buffer,o===re.SUCCESS&&s?(a=this._context.rtcCodec.decode(_r.RtcTokenOutput,s).rtcToken,[2,{code:o,data:{rtcToken:a}}]):[2,{code:o}]}}))}))},t.prototype.setRTCState=function(e,t){return a(this,void 0,void 0,(function(){var n;return u(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(_r.MCFollowInput,{state:t}),[4,this.rtcSignaling(e,Wr,!0,n)];case 1:return[2,r.sent().code]}}))}))},t.prototype.getRTCUserList=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o;return u(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(_r.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Jr,!0,t)];case 1:return n=s.sent(),r=n.code,i=n.buffer,r===re.SUCCESS&&i?(o=_c(this._context.rtcCodec,i),[2,{code:r,data:o}]):[2,{code:r}]}}))}))},t.prototype.joinLivingRoomAsAudience=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a,c,l;return u(this,(function(u){switch(u.label){case 0:return r=pc(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,Xr,!0,r)];case 1:return i=u.sent(),o=i.code,s=i.buffer,o===re.SUCCESS&&s?(a=this._context.rtcCodec.decode(_r.RtcViewerJoinedOutput,s),c=a.rtcToken,l=a.entries,[2,{code:o,data:{token:c,kvEntries:l}}]):[2,{code:o}]}}))}))},t.prototype.quitLivingRoomAsAudience=function(e){return a(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return t=this._context.rtcCodec.encode(_r.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,Zr,!0,t)];case 1:return n=r.sent().code,this._context.rtcKVManager.reset(),[2,n]}}))}))},t.prototype.rtcIdentityChange=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return r=this._context.rtcCodec.encode(_r.RtcInput,{roomType:Lt.LIVE,broadcastType:n,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,$r,!0,r)];case 1:return i=u.sent(),o=i.code,s=i.buffer,o===re.SUCCESS&&s?(a=_c(this._context.rtcCodec,s),[2,{code:o,data:a}]):[2,{code:o}]}}))}))},t.prototype.requestRoomPK=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c;return u(this,(function(u){switch(u.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,s=e.roomId,a=this._context.rtcCodec.encode(_r.RtcInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(s,ei,!0,a)];case 1:return c=u.sent().code,this._context.rtcKVManager.reset(),[2,c]}}))}))},t.prototype.cancelRoomPK=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,s=this._context.rtcCodec.encode(_r.RtcCancelInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,inviteInfo:i}),[4,this.rtcSignaling(o,ti,!0,s)];case 1:return a=u.sent().code,this._context.rtcKVManager.reset(),[2,a]}}))}))},t.prototype.responseRoomPK=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,d;return u(this,(function(u){switch(u.label){case 0:return t=e.inviteUserId,n=e.inviteRoomId,r=e.inviteSessionId,i=e.content,o=e.key,s=e.value,a=e.agree,c=e.roomId,l=this._context.rtcCodec.encode(_r.RtcInviteAnswerInput,{inviteUserId:t,inviteRoomId:n,inviteSessionId:r,content:i,key:o,value:s,answerCode:a?1:0}),[4,this.rtcSignaling(c,ni,!0,l)];case 1:return d=u.sent().code,this._context.rtcKVManager.reset(),[2,d]}}))}))},t.prototype.endRoomPK=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return t=e.endRoomId,n=e.sessionId,r=e.content,i=e.keys,o=e.roomId,s=this._context.rtcCodec.encode(_r.RtcEndInviteInput,{inviteRoomId:t,inviteSessionId:n,inviteContent:r,inviteRoomKeys:i}),[4,this.rtcSignaling(o,ri,!0,s)];case 1:return a=u.sent().code,this._context.rtcKVManager.reset(),[2,a]}}))}))},t.prototype.registerRTCSignalListener=function(e){this._context.registerRTCSignalingListener(e)},t.prototype.rtcSignaling=function(e,t,n,r){return this._context.rtcSignaling(e,t,n,r)},t.prototype.getRTCJoinedUserInfo=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o;return u(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(_r.RtcQueryUserJoinedInput,{userId:e}),[4,this.rtcSignaling("",ii,!0,t)];case 1:return n=s.sent(),r=n.code,i=n.buffer,r===re.SUCCESS&&i?(o=this._context.rtcCodec.decode(_r.RtcQueryUserJoinedOutput,i).info||[],[2,{code:r,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:Ln(e.joinTime)}}))}]):[2,{code:r}]}}))}))},t}(mi);function nd(e){return o({},e)}function rd(e,t,n){var r=n.value;n.value=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1!==(null===(e=this.getNaviInfoFromCache())||void 0===e?void 0:e.userProfile)?Promise.resolve({code:re.RC_USER_PROFILE_SERVICE_UNAVAILABLE}):r.call.apply(r,c([this],t,!1))}}var id=function(){function e(e,t){var n,r;this._runtime=e,this._token="",this._pluginContextQueue=[],this._pluginInstanseMap={},this._versionInfo={},this._typingInfo={},this._compatibleMessageProccessor=((n={})[ce.CHATROOM_MERGE_CHANGE]=this._processChrmMemChangeMessage.bind(this),n[ce.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),n[ce.INTERCEPT]=this._processInterceptMessage.bind(this),n[ce.CHATROOM_SYNC_MSG]=this._processChrmSyncMessage.bind(this),n[ce.CHATROOM_MERGE_BLOCK]=this._processChrmMemBlockMessage.bind(this),n[ce.CHATROOM_MERGE_BAN]=this._processChrmMemBanMessage.bind(this),n),this._messageProccessor=((r={})[ce.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),r[ce.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),r[ce.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),r),this._watcher={message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag:void 0,conversationTagChanged:void 0,pullFinished:void 0,readReceiptReceived:void 0,messageReceiptRequest:void 0,messageReceiptResponse:void 0,typingState:void 0,messageBlocked:void 0,ultraGroupEnable:void 0,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageModified:void 0,ultraGroupMessageRecalled:void 0,messageDelivered:void 0,groupMessageDeliveredStatus:void 0,ultraGroupChannelChangeType:void 0,ultraGroupChannelUserKicked:void 0,ultraGroupChannelDelete:void 0,userGroupStatus:void 0,messageReadReceipt:void 0,syncReadStatus:void 0,subscribedUserStatusChange:void 0,subscribedRelationChange:void 0,syncSubscribedUserStatusFinished:void 0,ownUserProfileChanged:void 0,groupOperation:void 0,groupInfoChanged:void 0,groupMemberInfoChanged:void 0,groupApplicationEvent:void 0,groupRemarkChangedSync:void 0,groupFollowsChangedSync:void 0,friendAdd:void 0,friendDelete:void 0,friendApplicationStatusChanged:void 0,friendCleared:void 0,friendInfoChangedSync:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0},this._typingInternalTimer=-1,this._typingExpireTime=2e3,this._typingChangedList=[],this._registerMessageSearchPropsMapping={},this.getChatRoomHistoryMessages=this.getChatroomHistoryMessages,this._options=o({},t),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:this._onConnectionStatusChange.bind(this,Zc.CONNECTED),onConnecting:this._onConnectionStatusChange.bind(this,Zc.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,Zc.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,Zc.DISCONNECTED),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),conversationTag:this._conversationTagListener.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageModified:this._ultraGroupMessageModifiedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this),messageDelivered:this._messageDeliveredListerer.bind(this),groupMessageDeliveredStatus:this._groupMessageDeliveredStatusListerer.bind(this),callInfo:this._callInfoListener.bind(this),ultraGroupChannelChangeType:this._ultraGroupChannelChangeTypeListener.bind(this),ultraGroupChannelUserKicked:this._ultraGroupChannelUserKickedListener.bind(this),ultraGroupChannelDelete:this._ultraGroupChannelDeleteListener.bind(this),onNaviDataChange:this._naviDataChange.bind(this),userGroupStatus:this._userGroupStatusListener.bind(this),messageReadReceipt:this._messageReadReceipt.bind(this),syncReadStatus:this._syncReadStatus.bind(this),subscribedUserStatusChange:this._subscribedUserStatusChange.bind(this),subscribedRelationChange:this._subscribedRelationChange.bind(this),syncSubscribedUserStatusFinished:this._syncSubscribedUserStatusFinished.bind(this),ownUserProfileChanged:this._ownUserProfileChanged.bind(this),groupOperation:this._groupOperation.bind(this),groupInfoChanged:this._groupInfoChanged.bind(this),groupMemberInfoChanged:this._groupMemberInfoChanged.bind(this),groupApplicationEvent:this._groupApplicationEvent.bind(this),groupRemarkChangedSync:this._groupRemarkChangedSync.bind(this),groupFollowsChangedSync:this._groupFollowsChangedSync.bind(this),friendAdd:this._friendAdd.bind(this),friendDelete:this._friendDelete.bind(this),friendApplicationStatusChanged:this._friendApplicationStatusChanged.bind(this),friendCleared:this._friendCleared.bind(this),friendInfoChangedSync:this._friendInfoChangedSync.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this)};this.rtcCodec=this.createCodec(oi,si),this._engine=vr()?new RCCppEngine(e,this.rtcCodec,i,this._options):new ed(e,this.rtcCodec,i,this._options),this.logger=this._engine.getInnerLogger(),this.rtcKVManager=new Vr(this._engine)}return e.init=function(t,n){if(this._context)return this._context.logger.warn(Re.A_INIT_REPEAT_O),this._context;this._context=new e(t,n),this._context.logger.info(Re.L_INIT_O,JSON.stringify({appkey:n.appkey,navigators:n.navigators,typingExpireTime:n.typingExpireTime})),this._context.logger.warn(Re.L_IMSDK_VER_O,JSON.stringify({commitId:"0ee6914ce81f879f025bd82bb70811af5c426be9",version:"5.12.2"}));var r=this._context._engine;return t.setNetworkStatusListener(r.setNetwork.bind(r)),this._context},e.getContext=function(){return this._context},e.prototype.getOptions=function(){return this._options},e.destroy=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(Re.L_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))},e.prototype.createCodec=function(e,t){return new di(e,t)},e.prototype.install=function(e,t){var n=this.logger.createTraceId();if(this.logger.info(Re.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),n),this._pluginInstanseMap[e.tag])return this.logger.warn(Re.L_INSTALL_PLUGIN_R,"repeat install",n),this._pluginInstanseMap[e.tag];var r="RCRTC"===e.tag?new td(this):new mi(this),i=null;try{if(!e.verify(this._runtime))return null;i=e.setup(r,this._runtime,t)}catch(e){this.logger.error(Re.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,n)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(r),this._pluginInstanseMap[e.tag]=i),i},e.prototype._onConnectionStatusChange=function(e,t){var n,r;this.logger.warn(Re.A_CONNECT_S,"status: "+e+", code: "+t),null===(r=(n=this._watcher).connection)||void 0===r||r.call(n,e,t),this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onconnectionstatechange)||void 0===r||r.call(n,e,t)}))},e.prototype._processChrmMemChangeMessage=function(e){if("function"==typeof this._watcher.chatroomState){var t={},n=[],r=e.content.memberCount,i=void 0===r?0:r;Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,n.push({userId:e.userId,action:e.status,extra:e.extra})})),this._watcher.chatroomState({userChange:{users:t,chatroomId:e.targetId,memberCount:i,userList:n}})}return!0},e.prototype._processTypingStatusMessage=function(e){if(this._addTypingInfo(nd(e)),this._watcher.typingState)return!0},e.prototype._processInterceptMessage=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===oe.ULTRA_GROUP){var n=e.content.sourceType;if(t.sourceType=n,(n===me.MSG_EXPANSION||n===me.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(Re.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0},e.prototype._processChrmSyncMessage=function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyMultiLoginSync:{chatroomId:e.content.chatroomId,status:e.content.status,reason:e.content.reason,time:e.content.time,extra:e.content.extra||null}}),!0},e.prototype._processChrmMemBlockMessage=function(e){var t,n=e.content;return n.operateType===we.Blocked&&(null===(t=n.userList)||void 0===t?void 0:t.includes(this.getCurrentUserId()))&&this._engine.removeChatroomFromCatch(n.chatroomId),"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBlock:{chatroomId:n.chatroomId,operateType:n.operateType,durationTime:n.durationTime,operateTime:n.operateTime,userIdList:n.userList,extra:n.extra||null}}),!0},e.prototype._processChrmMemBanMessage=function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBan:{chatroomId:e.content.chatroomId,banType:e.content.operateType,durationTime:e.content.durationTime,operateTime:e.content.operateTime,userIdList:e.content.userList,extra:e.content.extra||null}}),!0},e.prototype._processReadReceiptMessage=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)},e.prototype._processReadReceiptRequestMessage=function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)},e.prototype._processReadReceiptResponseMessage=function(e){var t,n=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,r=this._engine.getCurrentUserId();n&&Array.isArray(n[r])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,n[r])},e.prototype._messageReceiver=function(e,t,n){var r,i,o,s,a=this;if(!(null===(i=(r=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(r,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(nd(e))}catch(e){return a.logger.error(Re.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(s=(o=this._watcher).message)||void 0===s||s.call(o,nd(e),t,n),e},e.prototype._batchMessageReceiver=function(e,t,n){var r=this,i=[],o=[],s=[ce.READ_RECEIPT,ce.READ_RECEIPT_REQUEST,ce.READ_RECEIPT_RESPONSE];e.forEach((function(e){var a=r._messageReceiver(e,t,n);a&&s.includes(a.messageType)?o.push(a):a&&i.push(a)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(Re.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.forEach((function(e){r._messageProccessor[e.messageType]&&r._messageProccessor[e.messageType](e)}))},e.prototype._chatroomInfoListener=function(e){var t,n;null===(n=(t=this._watcher).chatroomState)||void 0===n||n.call(t,e)},e.prototype._conversationInfoListener=function(e){var t,n;null===(n=(t=this._watcher).conversationState)||void 0===n||n.call(t,e)},e.prototype._expansionInfoListener=function(e){var t,n;null===(n=(t=this._watcher).expansion)||void 0===n||n.call(t,e)},e.prototype._tagListener=function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)},e.prototype._conversationTagListener=function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)},e.prototype._typingStatusListener=function(e){var t,n;null===(n=(t=this._watcher).typingState)||void 0===n||n.call(t,e)},e.prototype._pullFinishedListener=function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)},e.prototype._MessageBlockedListener=function(e){var t,n;null===(n=(t=this._watcher).messageBlocked)||void 0===n||n.call(t,e)},e.prototype._messageDeliveredListerer=function(e){var t,n;null===(n=(t=this._watcher).messageDelivered)||void 0===n||n.call(t,e)},e.prototype._groupMessageDeliveredStatusListerer=function(e){var t,n;null===(n=(t=this._watcher).groupMessageDeliveredStatus)||void 0===n||n.call(t,e)},e.prototype._callInfoListener=function(e){var t=this;this._pluginContextQueue.forEach((function(n){try{n.onCallInfo&&n.onCallInfo(e)}catch(e){t.logger.warn(Re.L_CALLBACK_E,null==e?void 0:e.stack)}}))},e.prototype._ultraGroupEnableListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupEnable)||void 0===n||n.call(t,e)},e.prototype._operateStatusListener=function(e){var t,n;null===(n=(t=this._watcher).operateStatus)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageExpansionUpdatedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageModifiedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageModified)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageRecalledListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageRecalled)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelChangeTypeListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelChangeType)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelUserKickedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelDeleteListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelDelete)||void 0===n||n.call(t,e)},e.prototype._userGroupStatusListener=function(e){var t,n;null===(n=(t=this._watcher).userGroupStatus)||void 0===n||n.call(t,e)},e.prototype._messageReadReceipt=function(e){var t,n;null===(n=(t=this._watcher).messageReadReceipt)||void 0===n||n.call(t,e)},e.prototype._syncReadStatus=function(e){var t,n;null===(n=(t=this._watcher).syncReadStatus)||void 0===n||n.call(t,e)},e.prototype._subscribedUserStatusChange=function(e){var t,n;null===(n=(t=this._watcher).subscribedUserStatusChange)||void 0===n||n.call(t,e)},e.prototype._subscribedRelationChange=function(e){var t,n;null===(n=(t=this._watcher).subscribedRelationChange)||void 0===n||n.call(t,e)},e.prototype._syncSubscribedUserStatusFinished=function(e){var t,n;this.logger.info(Re.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(n=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(t,e)},e.prototype._ownUserProfileChanged=function(e){var t,n;this.logger.info(Re.L_OWN_USER_PROFILE_CHANGED_S),null===(n=(t=this._watcher).ownUserProfileChanged)||void 0===n||n.call(t,e)},e.prototype._groupOperation=function(e){var t,n;null===(n=(t=this._watcher).groupOperation)||void 0===n||n.call(t,e)},e.prototype._groupInfoChanged=function(e){var t,n;null===(n=(t=this._watcher).groupInfoChanged)||void 0===n||n.call(t,e)},e.prototype._groupMemberInfoChanged=function(e){var t,n;null===(n=(t=this._watcher).groupMemberInfoChanged)||void 0===n||n.call(t,e)},e.prototype._groupApplicationEvent=function(e){var t,n;null===(n=(t=this._watcher).groupApplicationEvent)||void 0===n||n.call(t,e)},e.prototype._groupRemarkChangedSync=function(e){var t,n;null===(n=(t=this._watcher).groupRemarkChangedSync)||void 0===n||n.call(t,e)},e.prototype._groupFollowsChangedSync=function(e){var t,n;null===(n=(t=this._watcher).groupFollowsChangedSync)||void 0===n||n.call(t,e)},e.prototype._friendAdd=function(e){var t,n;null===(n=(t=this._watcher).friendAdd)||void 0===n||n.call(t,e)},e.prototype._friendDelete=function(e){var t,n;null===(n=(t=this._watcher).friendDelete)||void 0===n||n.call(t,e)},e.prototype._friendApplicationStatusChanged=function(e){var t,n;null===(n=(t=this._watcher).friendApplicationStatusChanged)||void 0===n||n.call(t,e)},e.prototype._friendCleared=function(e){var t,n;null===(n=(t=this._watcher).friendCleared)||void 0===n||n.call(t,e)},e.prototype._friendInfoChangedSync=function(e){var t,n;null===(n=(t=this._watcher).friendInfoChangedSync)||void 0===n||n.call(t,e)},e.prototype._rtcDataChange=function(e,t){this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onrtcdatachange)||void 0===r||r.call(n,e,t)}))},e.prototype._naviDataChange=function(e){this._pluginContextQueue.forEach((function(t){var n;null===(n=t.onnavidatachange)||void 0===n||n.call(t,e)}))},e.prototype._databaseUpgradeWillStart=function(){var e,t;this.logger.info(Re.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)},e.prototype._databaseUpgrading=function(e){var t,n;this.logger.info(Re.L_DB_UPGRATING_S,e),null===(n=(t=this._watcher).databaseUpgrading)||void 0===n||n.call(t,e)},e.prototype._databaseUpgradeDidComplete=function(e){var t,n;this.logger.info(Re.L_DB_UPGRATE_COMPLETE_S),null===(n=(t=this._watcher).databaseUpgradeDidComplete)||void 0===n||n.call(t,e)},e.prototype.assignWatcher=function(e){var t=this;Object.keys(this._watcher).forEach((function(n){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];t._watcher[n]=Xt(r)||Jt(r)?r:void 0}}))},e.prototype._resetWatcher=function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))},e.prototype._addTypingInfo=function(e){var t=e.senderUserId,n=e.conversationType,r=e.targetId,i=e.content,o=e.channelId,s=i.typingContentType,a=n+"#"+r+"#"+(o||"");this._typingInfo[a]||(this._typingInfo[a]=[]);var u=this._typingInfo[a].findIndex((function(e){return e.userId===t}));u>=0&&this._typingInfo[a][u].messageType===s?this._typingInfo[a][u].timestamp=Date.now():(u>=0&&this._typingInfo[a].splice(u,1),this._typingInfo[a].push({userId:t,messageType:s,timestamp:Date.now()}),this._typingChangedList.includes(a)||this._typingChangedList.push(a),this._startCheckTypingInfo())},e.prototype._startCheckTypingInfo=function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var n=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===n||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))},e.prototype._notifyTypingChanged=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)},e.prototype.getConnectedTime=function(){return this._engine.getConnectedTime()},e.prototype.getServerTime=function(){return this._engine.getServerTime()},e.prototype.getDeviceId=function(){return this._engine.getDeviceId()},e.prototype.getCurrentUserId=function(){return this._engine.getCurrentUserId()},e.prototype.getConnectionStatus=function(){return this._engine.getConnectionStatus()},Object.defineProperty(e.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),e.prototype.refetchNaviInfo=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))},e.prototype.connect=function(e,t,n){var r,i;return a(this,void 0,void 0,(function(){var o,s,a,c,l,d;return u(this,(function(u){switch(u.label){case 0:return this._token=e,[4,this._runtime.getNetworkType()];case 1:return o=u.sent(),this._engine.setNetwork({status:!0,type:o},!0),s=!!this._pluginInstanseMap.RCCallPlus,[4,this._engine.connect(e,t,s,n)];case 2:return a=u.sent(),c=a.code,l=a.data,c!==re.SUCCESS?[2,{code:c}]:(1!==this._engine.getNaviInfoFromCache().type&&(d=_n.getInfo(),null===(i=(r=this._engine).reportSDKInfo)||void 0===i||i.call(r,d)),[2,{code:c,userId:l}])}}))}))},e.prototype.disconnect=function(e){return a(this,void 0,void 0,(function(){var t=this;return u(this,(function(n){switch(n.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e)];case 1:return n.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){t.logger.error(Re.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},e.prototype.reconnect=function(e){return this.connect(this.token,!!e,this.logger.createTraceId())},e.prototype._getTokenWithoutNavi=function(){return this._token.replace(/@.+$/,"@")},e.prototype._channelIdConvert=function(e,t){if(e!==oe.ULTRA_GROUP)return t;var n=this.getNaviInfoFromCache();return!!(2&((null==n?void 0:n.ugDriven)||0))&&!t?"RCDefault":t},e.prototype.getNaviInfoFromCache=function(){return this._engine.getNaviInfoFromCache()},e.prototype.registerMessageType=function(e,t,n,r,i){void 0===r&&(r=[]),void 0===i&&(i=!1),Yt(r)&&r.length>0&&(this._registerMessageSearchPropsMapping[e]=r),this._engine.registerMessageType(e,t,n,r,i)},e.prototype.registerRTCSignalingListener=function(e){this._engine.registerRTCSignalingListener(e)},e.prototype.checkSearchPropsMsg=function(e,t){var n=this._registerMessageSearchPropsMapping[e],r={};return n&&Jt(t)&&Object.keys(t).forEach((function(e){if(n.includes(e)){var i=t[e];xt(i)&&(i>-Math.pow(2,64)&&i<Math.pow(2,64)&&Number.isInteger(i)||(r[e]=i))}})),Object.keys(r).length>0?{msg:JSON.stringify(r),code:re.SEARCH_PROPS_LIMIT_ERROR}:{code:re.SUCCESS}},e.prototype._handleExpansioResult=function(e,t){if(t){var n=ln(e),r=n.isIllgalEx,i=n.isExKeyOrValLengthExceedLimit;return n.isExceedLimit||i?re.EXPANSION_LIMIT_EXCEET:r?re.INVALID_PARAMETER_MESSAGE_EXPANSION:void 0}},e.prototype.sendMessage=function(e,t,n,r,i){var o=this.checkSearchPropsMsg(n.messageType,n.content),s=o.code,a=o.msg;if(s!==re.SUCCESS)return Promise.resolve({code:s,msg:a});if(e===oe.SYSTEM&&n.messageType!==ce.SYNC_READ_STATUS)return Promise.resolve({code:re.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE});var u=n.canIncludeExpansion,c=void 0!==u&&u,l=n.expansion,d=this._handleExpansioResult(l,c);if(d)return Promise.resolve({code:d});var h=n.isMentioned,p=n.mentionedUserIdList,_=n.mentionedType;h&&[oe.GROUP,oe.ULTRA_GROUP].includes(e)?n.content.mentionedInfo=dr(n.content,p,_):delete n.content.mentionedInfo;var g,f,T=JSON.stringify(n.content);if(g=T,void 0===f&&(f="utf-8"),("utf-16"===f?E(g):I(g))>O)return Promise.resolve({code:re.RC_MSG_CONTENT_EXCEED_LIMIT});if(e===oe.ULTRA_GROUP)return n.channelId=this._channelIdConvert(e,n.channelId),this._engine.sendUltraMessage(t,n,r,i);var R=this.getNaviInfoFromCache();return(null==R?void 0:R.grpRRVer)&&n.messageType===ce.READ_RECEIPT_RESPONSE?Promise.resolve({code:re.READ_RECEIPT_ERROR}):this._engine.sendMessage(e,t,n,r,i)},e.prototype.sendExpansionMessage=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,d,h;return u(this,(function(u){switch(u.label){case 0:return t=e.channelId,n=e.conversationType,r=e.targetId,i=e.messageUId,o=e.keys,s=e.expansion,a=e.removeAll,e.canIncludeExpansion?(c=ln(s),l=c.isIllgalEx,d=c.isExKeyOrValLengthExceedLimit,c.isExceedLimit||d?[2,Promise.resolve({code:re.EXPANSION_LIMIT_EXCEET})]:l?[2,Promise.resolve({code:re.INVALID_PARAMETER_MESSAGE_EXPANSION})]:(h={mid:i},s&&(h.put=s),o&&(h.del=o),a&&(h.removeAll=1),[4,this._engine.sendMessage(n,r,{content:h,messageType:ce.EXPANSION_NOTIFY,channelId:t})])):[2,{code:re.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:u.sent().code}]}}))}))},e.prototype.sendReadReceiptMessage=function(e,t,n){return a(this,void 0,void 0,(function(){var r;return u(this,(function(i){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:re.READ_RECEIPT_ERROR,msg:"The read receipt switch is not on, please call the sendMessage method!"}]:[2,this._engine.sendReadReceiptMessage(e,t,n)]}))}))},e.prototype.getMessageReader=function(e,t,n){return a(this,void 0,void 0,(function(){var r;return u(this,(function(i){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:re.READ_RECEIPT_ERROR}]:[2,this._engine.getMessageReader(e,t,n||"")]}))}))},e.prototype.sendReadReceiptMessageV4=function(e,t,n){return a(this,void 0,void 0,(function(){return u(this,(function(r){return[2,this._engine.sendReadReceiptMessageV4(e,t,n)]}))}))},e.prototype.getMessageReadReceiptV4=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this._engine.getMessageReadReceiptV4(e,t)]}))}))},e.prototype.batchGetMessageReadReceiptInfoV4=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this._engine.batchGetMessageReadReceiptInfoV4(e,t)]}))}))},e.prototype.updateConversationReadTime=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this._engine.updateConversationReadTime(e,t)]}))}))},e.prototype._destroy=function(){return a(this,void 0,void 0,(function(){var e=this;return u(this,(function(t){switch(t.label){case 0:return this._resetWatcher(),this._engine.destroy(),this._runtime.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(Re.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))},e.prototype.getHistoryMessage=function(e,t,n,r,i,o,s,a){var u={timestamp:n||0,count:r||20,order:i||0,channelId:o||""};if(e===oe.ULTRA_GROUP){var c=this._channelIdConvert(e,u.channelId);return u.channelId=c,this._engine.getUltraHistoryMsg(t,u,a)}return this._engine.getHistoryMessage(e,t,u.timestamp,u.count,u.order,u.channelId,s||"",a)},e.prototype.getMessages=function(e,t,n,r,i,o,s){var a={timestamp:n||0,count:r||20,order:i||0,channelId:o||""};if(e===oe.ULTRA_GROUP){var u=this._channelIdConvert(e,a.channelId);return a.channelId=u,this._engine.getUltraHistoryMsg(t,a,s)}return this._engine.getMessages(e,t,a.timestamp,a.count,a.order,a.channelId,s)},e.prototype.getContinuousMessages=function(e,t,n,r,i,o){return void 0===n&&(n=0),void 0===r&&(r=20),void 0===i&&(i=0),void 0===o&&(o=""),this._engine.getContinuousMessages(e,t,n,r,i,o)},e.prototype.getHistoryMessagesByObjectNames=function(e,t,n,r,i,o,s){return this._engine.getHistoryMessagesByObjectNames(e,t,n,r,i,o,s)},e.prototype.getConversationList=function(e,t,n,r,i){if(t===oe.ULTRA_GROUP){var o=re.METHOD_NOT_SUPPORT;return Promise.resolve({code:o,msg:re[o]})}return this._engine.getConversationList(e||300,t,n,r,i||"")},e.prototype.getConversationsByPage=function(e,t,n,r,i){return this._engine.getConversationsByPage(e,t,n,r,i)},e.prototype.getConversation=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversation(e,t,r||"")},e.prototype.removeConversation=function(e,t,n){return e===oe.ULTRA_GROUP?Promise.resolve(re.METHOD_NOT_SUPPORT):this._engine.removeConversation(e,t,n||"")},e.prototype.batchRemoveConversation=function(e){return this._engine.batchRemoveConversation(e)},e.prototype.getUltraGroupList=function(e){return this._engine.getUltraGroupList(e)},e.prototype.getBlockUltraGroupList=function(){return this._engine.getBlockUltraGroupList()},e.prototype.getTopUltraGroupList=function(){return this._engine.getTopUltraGroupList()},e.prototype.clearUnreadCount=function(e,t,n){if(e===oe.ULTRA_GROUP){var r=this._channelIdConvert(e,n);return this._engine.clearUltraUnreadcount(t,r||"")}return this._engine.clearConversationUnreadCount(e,t,n||"")},e.prototype.clearAllUnreadCount=function(){return this._engine.clearAllUnreadCount()},e.prototype.getUnreadCount=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationUnreadCount(e,t,r||"")},e.prototype.getTotalUnreadCount=function(e,t,n){if(t&&t.includes(oe.ULTRA_GROUP)){var r=re.METHOD_NOT_SUPPORT;return Promise.resolve({code:r,msg:re[r]})}return this._engine.getAllConversationUnreadCount(e,t&&t.length>0?t:[oe.PRIVATE,oe.GROUP,oe.SYSTEM,oe.PUBLIC_SERVICE],!!n)},e.prototype.getTotalUnreadCountByLevels=function(e,t,n){return this._engine.getTotalUnreadCountByLevels(e,t,n)},e.prototype.getFirstUnreadMessage=function(e,t,n){return this._engine.getFirstUnreadMessage(e,t,n||"")},e.prototype.getFirstUnreadMessageInfo=function(e,t,n){return this._engine.getFirstUnreadMessageInfo(e,t,n)},e.prototype.setConversationNotificationLevel=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i;return u(this,(function(o){return i=this._channelIdConvert(e,r),[2,this._engine.setConversationNotificationLevel(e,t,n,i||"")]}))}))},e.prototype.batchSetConversationNotificationLevel=function(e,t){return this._engine.batchSetConversationNotificationLevel(e,t)},e.prototype.setConversationStatus=function(e,t,n,r,i,o){if(void 0===o&&(o=!0),e===oe.ULTRA_GROUP&&void 0!==n)return Promise.resolve(re.METHOD_NOT_SUPPORT);var s=[{conversationType:e,targetId:t,isTop:n,notificationStatus:r,channelId:this._channelIdConvert(e,i)||"",isUpdateTime:o}];return this._engine.batchSetConversationStatus(s)},e.prototype.batchSetConversationToTop=function(e,t,n){return this._engine.batchSetConversationToTop(e,t,!!n)},e.prototype.saveConversationMessageDraft=function(e,t,n,r){var i=this._channelIdConvert(e,r);return this._engine.saveConversationMessageDraft(e,t,n,i||"")},e.prototype.getConversationMessageDraft=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationMessageDraft(e,t,r||"")},e.prototype.clearConversationMessageDraft=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.clearConversationMessageDraft(e,t,r||"")},e.prototype.recallMessage=function(e,t,n,r,i){var o=this._channelIdConvert(e,i.channelId);return i.channelId=o||"",this._engine.recallMsg(e,t,n,r,i)},e.prototype.deleteRemoteMessage=function(e,t,n,r){if(e===oe.ULTRA_GROUP&&vr())return Promise.resolve(re.METHOD_NOT_SUPPORT);var i=this._channelIdConvert(e,r);return this._engine.deleteRemoteMessage(e,t,n,i||"")},e.prototype.deleteRemoteMessageByTimestamp=function(e,t,n,r){var i=this._channelIdConvert(e,r);return this._engine.deleteRemoteMessageByTimestamp(e,t,n,i||"")},e.prototype.joinChatroom=function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinChatroom(e,t,r,n)},e.prototype.joinExistChatroom=function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinExistChatroom(e,t,r,n)},e.prototype.quitChatroom=function(e){return this._engine.quitChatroom(e)},e.prototype.getChatroomInfo=function(e,t,n){return this._engine.getChatroomInfo(e,t||0,n||0)},e.prototype.setChatroomEntry=function(e,t){var n=t.key,r=t.value;return er(n)?tr(r)?this._engine.setChatroomEntry(e,t):Promise.resolve(re.INVALID_PARAMETER_VALUE):Promise.resolve(re.INVALID_PARAMETER_KEY)},e.prototype.setChatroomEntries=function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n],i=r.key,s=r.value;if(!er(i))return Promise.resolve({code:re.INVALID_PARAMETER_KEY});if(!tr(s))return Promise.resolve({code:re.INVALID_PARAMETER_VALUE})}var a=o(o({},t),{isOverwrite:t.isForce});return this._engine.setChatroomEntries(e,a)},e.prototype.forceSetChatroomEntry=function(e,t){var n=t.key,r=t.value;return er(n)?tr(r)?this._engine.forceSetChatroomEntry(e,t):Promise.resolve(re.INVALID_PARAMETER_VALUE):Promise.resolve(re.INVALID_PARAMETER_KEY)},e.prototype.removeChatroomEntry=function(e,t){var n=t.key;return er(n)?this._engine.removeChatroomEntry(e,t):Promise.resolve(re.INVALID_PARAMETER_KEY)},e.prototype.removeChatroomEntries=function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n].key;if(!er(r))return Promise.resolve({code:re.INVALID_PARAMETER_KEY})}return this._engine.removeChatroomEntries(e,t)},e.prototype.forceRemoveChatroomEntry=function(e,t){var n=t.key;return er(n)?this._engine.forceRemoveChatroomEntry(e,t):Promise.resolve(re.INVALID_PARAMETER_KEY)},e.prototype.getChatroomEntry=function(e,t){return this._engine.getChatroomEntry(e,t)},e.prototype.getAllChatroomEntries=function(e){return this._engine.getAllChatroomEntry(e)},e.prototype.getChatroomHistoryMessages=function(e,t,n,r){return this._engine.getChatroomHistoryMessages(e,r||0,t||20,n||0)},e.prototype.getFileToken=function(e,t,n,r,i,o){return a(this,void 0,void 0,(function(){var s,a,c,l,d,h,p;return u(this,(function(u){switch(u.label){case 0:return s=this.getNaviInfoFromCache(),a=(null==s?void 0:s.bosAddr)||"",c=(null==s?void 0:s.uploadServer)||"",l=(null==s?void 0:s.ossConfig)||"",[4,this._engine.getFileToken(e,t,n,r,i,o)];case 1:return d=u.sent(),h=d.code,p=d.data,h===re.SUCCESS&&p?[2,Promise.resolve(Object.assign(p,{bos:a,qiniu:c,ossConfig:l}))]:[2,Promise.reject(h)]}}))}))},e.prototype.getFileUrl=function(e,t,n,r,i){return void 0===i&&(i=Ee.QINIU),a(this,void 0,void 0,(function(){var o,s,a;return u(this,(function(u){switch(u.label){case 0:return(null==r?void 0:r.isBosRes)?[2,Promise.resolve(r)]:[4,this._engine.getFileUrl(e,i,t,n)];case 1:return o=u.sent(),s=o.code,a=o.data,s===re.SUCCESS?[2,Promise.resolve(a)]:[2,Promise.reject(s)]}}))}))},e.prototype.createTag=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.createTag(e)]}))}))},e.prototype.removeTag=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.removeTag(e)]}))}))},e.prototype.updateTag=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.updateTag(e)]}))}))},e.prototype.getTagList=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,this._engine.getTagList()]}))}))},e.prototype.addTagForConversations=function(e,t){return a(this,void 0,void 0,(function(){var n,r=this;return u(this,(function(i){return t.length>1e3?[2,Promise.resolve({code:re.CONVER_OUT_LIMIT_ERROR})]:(n=t.map((function(e){var t=e.conversationType,n=e.targetId,i=e.channelId;return{conversationType:t,targetId:n,channelId:r._channelIdConvert(t,i)}})),[2,this._engine.addTagForConversations(e,n)])}))}))},e.prototype.removeTagForConversations=function(e,t){return a(this,void 0,void 0,(function(){var n,r=this;return u(this,(function(i){return n=t.map((function(e){var t=e.conversationType,n=e.targetId,i=e.channelId;return{conversationType:t,targetId:n,channelId:r._channelIdConvert(t,i)}})),[2,this._engine.removeTagForConversations(e,n)]}))}))},e.prototype.removeTagsForConversation=function(e,t){return a(this,void 0,void 0,(function(){var n;return u(this,(function(r){return n=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=n,[2,this._engine.removeTagsForConversation(e,t)]}))}))},e.prototype.getConversationListByTag=function(e,t,n,r){return a(this,void 0,void 0,(function(){return u(this,(function(i){return[2,this._engine.getConversationListByTag(e,t,n,r)]}))}))},e.prototype.getUnreadCountByTag=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this._engine.getUnreadCountByTag(e,t)]}))}))},e.prototype.setConversationStatusInTag=function(e,t,n){return a(this,void 0,void 0,(function(){var r;return u(this,(function(i){return r=this._channelIdConvert(t.conversationType,t.channelId),t.channelId=r,[2,this._engine.setConversationStatusInTag(e,t,n)]}))}))},e.prototype.getTagsForConversation=function(e){return a(this,void 0,void 0,(function(){var t;return u(this,(function(n){return t=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=t,[2,this._engine.getTagsForConversation(e)]}))}))},e.prototype.getBlockConversationList=function(){return this._engine.getBlockConversationList()},e.prototype.getTopConversationList=function(e,t){return e&&0!==e.length||(e=[oe.PRIVATE,oe.CHATROOM,oe.GROUP,oe.SYSTEM,oe.APP_PUBLIC_SERVICE,oe.PUBLIC_SERVICE]),this._engine.getTopConversationList(e,t||"")},e.prototype.getUnreadConversationList=function(e){return e&&0!==e.length||(e=[oe.PRIVATE,oe.CHATROOM,oe.GROUP,oe.SYSTEM,oe.APP_PUBLIC_SERVICE,oe.PUBLIC_SERVICE]),this._engine.getUnreadConversationList(e)},e.prototype.getUnreadMentionedCount=function(e){var t=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=t,this._engine.getUnreadMentionedCount(e)},e.prototype.getAllUnreadMentionedCount=function(){return this._engine.getAllUnreadMentionedCount()},e.prototype.sendUltraGroupTypingStatus=function(e){if(e.conversationType!==oe.ULTRA_GROUP){var t=re.CONVERSATION_TYPE_NOT_SUPPORT;return Promise.resolve({code:t,msg:re[t]})}var n=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=n,this._engine.sendUltraGroupTypingStatus(e)},e.prototype.getUltraGroupMessageListByMessageUId=function(e){var t=this,n=e.messages.map((function(n){var r=n.sendTime,i=n.messageUId,o=n.channelId;return{sendTime:r,messageUId:i,channelId:t._channelIdConvert(e.conversationType,o)}}));return e.messages=n,this._engine.getUltraGroupMessageListByMessageUId(e)},e.prototype.expandUltraMessage=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(u){switch(u.label){case 0:return t=e.conversationType,n=e.expansion,r=e.canIncludeExpansion,t!==oe.ULTRA_GROUP?[2,{code:i=re.CONVERSATION_TYPE_NOT_SUPPORT,msg:re[i]}]:r?(o=ln(n),s=o.isIllgalEx,a=o.isExKeyOrValLengthExceedLimit,o.isExceedLimit||a?[2,{code:re.EXPANSION_LIMIT_EXCEET}]:s?[2,{code:re.INVALID_PARAMETER_MESSAGE_EXPANSION}]:[4,this._engine.expandUltraMessage(e)]):[2,{code:re.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:u.sent().code}]}}))}))},e.prototype.modifyMessage=function(e){return a(this,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return e.conversationType!==oe.ULTRA_GROUP?[2,{code:t=re.CONVERSATION_TYPE_NOT_SUPPORT,msg:re[t]}]:[4,this._engine.modifyMessage(e)];case 1:return[2,{code:n.sent().code}]}}))}))},e.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){return this._engine.getUltraGroupUnreadMentionedCountByTargetId(e,t)},e.prototype.getUltraGroupUnreadCountByTargetId=function(e,t){return this._engine.getUltraGroupUnreadCountByTargetId(e,t)},e.prototype.getAllUltraGroupUnreadCount=function(e){return void 0===e&&(e=!1),this._engine.getAllUltraGroupUnreadCount(e)},e.prototype.getAllConversationState=function(){return this._engine.getAllConversationState()},e.prototype.getUltraGroupUnreadMentionedMessages=function(e){var t=this._channelIdConvert(oe.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupUnreadMentionedMessages(e)},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(e){var t=this._channelIdConvert(oe.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupFirstUnreadMessageTimestamp(e)},e.prototype.getUltraGroupUnreadInfoList=function(e){return this._engine.getUltraGroupUnreadInfoList(e)},e.prototype.callExtra=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(t=this._engine).callExtra.apply(t,c([e],n,!1))},e.prototype.getOSInfo=function(){return this._engine.getOSInfo()},e.prototype.getProcessInfo=function(){return this._engine.getProcessInfo()},e.prototype.getMainProcessInfo=function(){return this._engine.getMainProcessInfo()},e.prototype.setCallInfo=function(e,t,n){return this._engine.setCallInfo(e,t,n)},e.prototype.getGroupMessageDeliverList=function(e,t,n){return void 0===n&&(n=""),this._engine.getGroupMessageDeliverList(e,t,n)},e.prototype.getPrivateMessageDeliverTime=function(e,t){return void 0===t&&(t=""),this._engine.getPrivateMessageDeliverTime(e,t)},e.prototype._isEnableSubDriven=function(e){var t=(this.getNaviInfoFromCache()||{}).subDriven,n=void 0===t?0:t;switch(e){case nt.ONLINE_STATUS:return 1&n;case nt.USER_PROFILE:return 2&n;default:return!1}},e.prototype.subscribeUser=function(e,t,n){return this._isEnableSubDriven(t)?this._engine.subscribeUser(e,t,n):Promise.resolve({code:re.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.unSubscribeUser=function(e,t){return this._isEnableSubDriven(t)?this._engine.unSubscribeUser(e,t):Promise.resolve({code:re.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.getSubscribeUserList=function(e,t,n){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserList(e,t,n):Promise.resolve({code:re.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.getSubscribeUserStatus=function(e,t){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserStatus(e,t):Promise.resolve({code:re.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.updateMyUserProfile=function(e){return this._engine.updateMyUserProfile(e)},e.prototype.getUserProfiles=function(e){return this._engine.getUserProfiles(e)},e.prototype.getMyUserProfile=function(){return this._engine.getMyUserProfile()},e.prototype.updateMyUserProfileVisibility=function(e){return this._engine.updateMyUserProfileVisibility(e)},e.prototype.getMyUserProfileVisibility=function(){return this._engine.getMyUserProfileVisibility()},e.prototype.searchUserProfileByUniqueId=function(e){return this._engine.searchUserProfileByUniqueId(e)},e.prototype.clearConversations=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this._engine.clearConversations(e,t)]}))}))},e.prototype.setUserStatusListener=function(e,t){var n=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){n.logger.error(Re.L_CALLBACK_E,null==e?void 0:e.stack)}}))},e.prototype.addToBlacklist=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.addToBlacklist(e)]}))}))},e.prototype.removeFromBlacklist=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.removeFromBlacklist(e)]}))}))},e.prototype.getBlacklist=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,this._engine.getBlacklist()]}))}))},e.prototype.getBlacklistStatus=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.getBlacklistStatus(e)]}))}))},e.prototype.insertMessage=function(e,t,n){return a(this,void 0,void 0,(function(){var r,i,o;return u(this,(function(s){return r=this.checkSearchPropsMsg(n.messageType,n.content),i=r.code,o=r.msg,i!==re.SUCCESS?[2,Promise.resolve({code:i,msg:o})]:[2,this._engine.insertMessage(e,t,n)]}))}))},e.prototype.batchInsertMessage=function(e,t){return this._engine.batchInsertMessage(e,t)},e.prototype.getMessageCount=function(e,t,n){return void 0===n&&(n=""),a(this,void 0,void 0,(function(){return u(this,(function(r){return[2,this._engine.getMessageCount(e,t,n)]}))}))},e.prototype.deleteMessages=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.deleteMessages(e)]}))}))},e.prototype.deleteMessagesByTimestamp=function(e,t,n,r,i){return void 0===i&&(i=""),a(this,void 0,void 0,(function(){return u(this,(function(o){return[2,this._engine.deleteMessagesByTimestamp(e,t,n,!!r,i)]}))}))},e.prototype.batchClearMessagesByTimestamp=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.batchClearMessagesByTimestamp(e)]}))}))},e.prototype.batchClearRemoteHistoryMessages=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this._engine.batchClearRemoteHistoryMessages(e,t)]}))}))},e.prototype.clearMessages=function(e,t,n){return void 0===n&&(n=""),a(this,void 0,void 0,(function(){return u(this,(function(r){return[2,this._engine.clearMessages(e,t,n)]}))}))},e.prototype.getMessage=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.getMessage(e)]}))}))},e.prototype.setMessageContent=function(e,t,n){return a(this,void 0,void 0,(function(){return u(this,(function(r){return[2,this._engine.setMessageContent(e,t,n)]}))}))},e.prototype.setMessageSearchField=function(e,t,n){return a(this,void 0,void 0,(function(){return u(this,(function(r){return[2,this._engine.setMessageSearchField(e,t,n)]}))}))},e.prototype.setMessageSentStatus=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this._engine.setMessageSentStatus(e,t)]}))}))},e.prototype.setMessageReceivedStatus=function(e,t){return a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this._engine.setMessageReceivedStatus(e,t)]}))}))},e.prototype.setMessageStatusToRead=function(e,t,n,r){return a(this,void 0,void 0,(function(){return u(this,(function(i){return[2,this._engine.updateMessageReceiptStatus(e,t,n,r)]}))}))},e.prototype.setUserStatus=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))},e.prototype.subscribeUserStatus=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))},e.prototype.getUserStatus=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))},e.prototype.searchConversationByContent=function(e,t,n,r){return void 0===t&&(t=[]),a(this,void 0,void 0,(function(){return u(this,(function(i){return[2,this._engine.searchConversationByContent(e,t,n||"",r)]}))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n){return void 0===t&&(t=[]),a(this,void 0,void 0,(function(){return u(this,(function(r){return[2,this._engine.searchConversationByContentWithAllChannel(e,t,n)]}))}))},e.prototype.searchMessageByContent=function(e,t,n,r,i,o,s){return void 0===s&&(s=""),a(this,void 0,void 0,(function(){return u(this,(function(a){return[2,this._engine.searchMessageByContent(e,t,n,r,i,o,s)]}))}))},e.prototype.searchMessageByContentAndMessageType=function(e,t,n,r,i,o,s){return a(this,void 0,void 0,(function(){return u(this,(function(a){return[2,this._engine.searchMessageByContentAndMessageType(e,t,n,r,i,o,s)]}))}))},e.prototype.searchMessagesByUser=function(e,t,n,r,i,o){return void 0===i&&(i=5),void 0===o&&(o=""),a(this,void 0,void 0,(function(){return u(this,(function(s){return[2,this._engine.searchMessagesByUser(e,t,n,r,i,o)]}))}))},e.prototype.getMessagesByTimestamp=function(e,t,n,r){return a(this,void 0,void 0,(function(){return u(this,(function(i){return[2,this._engine.getMessagesByTimestamp(e,t,n,r)]}))}))},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,r,i){return a(this,void 0,void 0,(function(){return u(this,(function(o){return[2,this._engine.searchMessageByContentWithAllChannel(e,t,n,r,i)]}))}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,r,i,o,s){return a(this,void 0,void 0,(function(){return u(this,(function(a){return[2,this._engine.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,r,i,o,s)]}))}))},e.prototype.getUnreadMentionedMessages=function(e,t,n){return void 0===n&&(n=""),this._engine.getUnreadMentionedMessages(e,t,n)},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,r){return void 0===r&&(r=""),this._engine.clearUnreadCountByTimestamp(e,t,n,r)},e.prototype.getUltraGroupDefaultNotificationLevel=function(e,t){var n=this._channelIdConvert(oe.ULTRA_GROUP,t);return this._engine.getUltraGroupDefaultNotificationLevel(e,n||"")},e.prototype.setUltraGroupDefaultNotificationLevel=function(e,t,n){var r=this._channelIdConvert(oe.ULTRA_GROUP,n);return this._engine.setUltraGroupDefaultNotificationLevel(e,t,r||"")},e.prototype.getConversationNotificationLevel=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationNotificationLevel(e,t,r||"")},e.prototype.setConversationTypeNotificationLevel=function(e,t){return this._engine.setConversationTypeNotificationLevel(e,t)},e.prototype.getConversationTypeNotificationLevel=function(e){return this._engine.getConversationTypeNotificationLevel(e)},e.prototype.getConversationNotificationStatus=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationNotificationStatus(e,t,r||"")},e.prototype.getRemoteHistoryMessages=function(e,t,n,r,i,o){return this._engine.getRemoteHistoryMessages(e,t,n,r,i,o)},e.prototype.getConversationListWithAllChannel=function(){return this._engine.getConversationListWithAllChannel()},e.prototype.getConversationListWithAllChannelByPage=function(e,t){return this._engine.getConversationListWithAllChannelByPage(e,t)},e.prototype.clearData=function(){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,this._engine.clearData()]}))}))},e.prototype.createLogger=function(e,t){return this._engine.createLogger(e,t)},e.prototype.createStatisticLogger=function(e,t){return this._engine.createStatisticLogger(e,t)},e.prototype.getConversations=function(e){return this._engine.getConversations(e)},e.prototype.setCheckDuplicateMessage=function(e){return this._engine.setCheckDuplicateMessage(e)},e.prototype.setCheckChatRoomDuplicateMessage=function(e){return this._engine.setCheckChatRoomDuplicateMessage(e)},e.prototype.rtcSignaling=function(e,t,n,r){return this._engine.rtcSignaling(e,t,n,r)},e.prototype.rtcPing=function(e,t,n){return this._engine.rtcPing(e,t,n)},e.prototype.bindRTCRoomForChatroom=function(e){return this._engine.bindRTCRoomForChatroom(e)},e.prototype.setProxy=function(e){return this._engine.setProxy(e)},e.prototype.getProxy=function(){return this._engine.getProxy()},e.prototype.testProxy=function(e,t){return this._engine.testProxy(e,t)},e.prototype.createGroup=function(e,t,n,r){return void 0===r&&(r=[]),this._engine.createGroup(e,t,n,r)},e.prototype.updateGroupInfo=function(e,t,n){return this._engine.updateGroupInfo(e,t,n)},e.prototype.getGroupsInfo=function(e){return this._engine.getGroupsInfo(e)},e.prototype.kickGroupMembers=function(e,t,n){return this._engine.kickGroupMembers(e,t,n)},e.prototype.quitGroup=function(e,t){return this._engine.quitGroup(e,t)},e.prototype.dismissGroup=function(e){return this._engine.dismissGroup(e)},e.prototype.transferGroupOwner=function(e,t,n,r){return void 0===r&&(r=!1),this._engine.transferGroupOwner(e,t,r,n)},e.prototype.setGroupManagers=function(e,t,n){return this._engine.setGroupManagers(e,t,n)},e.prototype.getGroupMembersByRole=function(e,t,n){return this._engine.getGroupMembersByRole(e,t,n)},e.prototype.getGroupMembers=function(e,t){return this._engine.getGroupMembers(e,t)},e.prototype.setGroupMemberInfo=function(e,t,n,r){return this._engine.setGroupMemberInfo(e,t,n,r)},e.prototype.searchGroupMembers=function(e,t,n){return this._engine.searchGroupMembers(e,t,n)},e.prototype.joinGroup=function(e){return this._engine.joinGroup(e)},e.prototype.inviteUsersToGroup=function(e,t){return this._engine.inviteUsersToGroup(e,t)},e.prototype.acceptGroupInvite=function(e,t){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:It.ACCEPT})},e.prototype.refuseGroupInvite=function(e,t,n){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:It.REFUSE,reason:n})},e.prototype.acceptGroupApplication=function(e,t,n){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:It.ACCEPT})},e.prototype.refuseGroupApplication=function(e,t,n,r){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:It.REFUSE,reason:r})},e.prototype.getGroupApplications=function(e,t,n){return this._engine.getGroupApplications(e,t,n)},e.prototype.getJoinedGroupsByRole=function(e,t){return this._engine.getJoinedGroupsByRole(e,t)},e.prototype.searchJoinedGroups=function(e,t){return this._engine.searchJoinedGroups(e,t)},e.prototype.getJoinedGroups=function(e){return this._engine.getJoinedGroups(e)},e.prototype.setGroupRemark=function(e,t){return this._engine.setGroupRemark(e,t)},e.prototype.addGroupFollows=function(e,t){return this._engine.setGroupFollows(ft.ADD,e,t)},e.prototype.removeGroupFollows=function(e,t){return this._engine.setGroupFollows(ft.REMOVE,e,t)},e.prototype.getGroupFollows=function(e){return this._engine.getGroupFollows(e)},e.prototype.addFriend=function(e,t,n){return this._engine.addFriend(e,t,n)},e.prototype.deleteFriends=function(e,t){return this._engine.deleteFriends(e,t)},e.prototype.acceptFriendApplication=function(e){return this._engine.acceptFriendApplication(e)},e.prototype.refuseFriendApplication=function(e,t){return this._engine.refuseFriendApplication(e,t)},e.prototype.setFriendInfo=function(e,t,n){return this._engine.setFriendInfo(e,t,n)},e.prototype.checkFriends=function(e,t){return this._engine.checkFriends(e,t)},e.prototype.getFriends=function(e,t){return this._engine.getFriends(e,t)},e.prototype.getFriendApplications=function(e,t,n){return this._engine.getFriendApplications(e,t,n)},e.prototype.getFriendsInfo=function(e){return this._engine.getFriendsInfo(e)},e.prototype.searchFriendsInfo=function(e){return this._engine.searchFriendsInfo(e)},e.prototype.setFriendAddPermission=function(e){return this._engine.setFriendAddPermission(e)},e.prototype.getFriendAddPermission=function(){return this._engine.getFriendAddPermission()},s([rd],e.prototype,"updateMyUserProfile",null),s([rd],e.prototype,"getUserProfiles",null),s([rd],e.prototype,"getMyUserProfile",null),s([rd],e.prototype,"updateMyUserProfileVisibility",null),s([rd],e.prototype,"getMyUserProfileVisibility",null),s([rd],e.prototype,"searchUserProfileByUniqueId",null),s([rd],e.prototype,"createGroup",null),s([rd],e.prototype,"updateGroupInfo",null),s([rd],e.prototype,"getGroupsInfo",null),s([rd],e.prototype,"kickGroupMembers",null),s([rd],e.prototype,"quitGroup",null),s([rd],e.prototype,"dismissGroup",null),s([rd],e.prototype,"transferGroupOwner",null),s([rd],e.prototype,"setGroupManagers",null),s([rd],e.prototype,"getGroupMembersByRole",null),s([rd],e.prototype,"getGroupMembers",null),s([rd],e.prototype,"setGroupMemberInfo",null),s([rd],e.prototype,"searchGroupMembers",null),s([rd],e.prototype,"joinGroup",null),s([rd],e.prototype,"inviteUsersToGroup",null),s([rd],e.prototype,"acceptGroupInvite",null),s([rd],e.prototype,"refuseGroupInvite",null),s([rd],e.prototype,"acceptGroupApplication",null),s([rd],e.prototype,"refuseGroupApplication",null),s([rd],e.prototype,"getGroupApplications",null),s([rd],e.prototype,"getJoinedGroupsByRole",null),s([rd],e.prototype,"searchJoinedGroups",null),s([rd],e.prototype,"getJoinedGroups",null),s([rd],e.prototype,"setGroupRemark",null),s([rd],e.prototype,"addGroupFollows",null),s([rd],e.prototype,"removeGroupFollows",null),s([rd],e.prototype,"getGroupFollows",null),s([rd],e.prototype,"addFriend",null),s([rd],e.prototype,"deleteFriends",null),s([rd],e.prototype,"acceptFriendApplication",null),s([rd],e.prototype,"refuseFriendApplication",null),s([rd],e.prototype,"setFriendInfo",null),s([rd],e.prototype,"checkFriends",null),s([rd],e.prototype,"getFriends",null),s([rd],e.prototype,"getFriendApplications",null),s([rd],e.prototype,"getFriendsInfo",null),s([rd],e.prototype,"searchFriendsInfo",null),s([rd],e.prototype,"setFriendAddPermission",null),s([rd],e.prototype,"getFriendAddPermission",null),e}(),od=function(){function e(e,t){var n,r;this._logTagT=e,this._logTagR=t,this.verificationFaileList=[],this.context=id.getContext(),this.logger=null===(n=this.context)||void 0===n?void 0:n.logger,this.option=null===(r=this.context)||void 0===r?void 0:r.getOptions()}return e.prototype.validate=function(e,t,n,r,i){if(void 0===r&&(r=!1),this.verificationFaileList.length>0)return this;n=Hn[n]||n;var o=r?n(t):Zt(t)||null==t||n(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:Si[a]}),this}return o||this.verificationFaileList.push({key:e,value:t,isValid:o,message:i,code:Si[e]}),this},e.prototype.validateParameters=function(e,t,n,r,i,o){if(void 0===i&&(i=!1),this.verificationFaileList.length>0)return this;n=Hn[n]||n;var s=i?n(t):Zt(t)||null==t||n(t);if("object"==typeof s){var a=s.valid,u=s.errorKey,c=s.errorCode;return!a&&u&&this.verificationFaileList.push({key:u,value:t,code:c||r,message:o,isValid:!1}),this}return s||this.verificationFaileList.push({key:e,value:t,code:r,message:o,isValid:!1}),this},e.prototype._getValidationResult=function(){if(this.verificationFaileList.length>0)return this.verificationFaileList[0]},e.prototype.ifReady=function(e){var t;if(!this.context)return Promise.resolve({code:re.BIZ_ERROR_CLIENT_NOT_INIT});var n=this._getValidationResult();if(n){var r=n.code,i=n.value,o=n.message,s=n.key;return null===(t=this.logger)||void 0===t||t.error(this._logTagR,JSON.stringify({code:r})),Promise.resolve({code:r,msg:"'"+s+"' is invalid: "+(o||JSON.stringify(i))})}var a=this.logger.createTraceId();return e(this.context,this.logger,this.option,a)},e.prototype.try2do=function(e){if(!this.context)throw new Error("Not initialized yet!");return e(this.context,this.logger,this.option)},e.prototype.ifReadySync=function(e){var t;if(!this.context)return{code:re.BIZ_ERROR_CLIENT_NOT_INIT};var n=this._getValidationResult();if(!n)return e(this.context,this.logger,this.option);var r=n.code,i=n.value,o=n.message,s=n.key;return null===(t=this.logger)||void 0===t||t.warn(this._logTagR,JSON.stringify({code:r})),{code:r,msg:"'"+s+"' is invalid: "+(o||i)}},e}(),sd=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,n){return void 0===t&&(t=Date.now()-sd),void 0===n&&(n=Date.now()),a(this,void 0,void 0,(function(){var r,i;return u(this,(function(o){switch(o.label){case 0:return t=t<0?Date.now()+t:t,(n=n<=0?Date.now():n)-t>sd&&(t=n-sd),(r=new Bc(e,"RC-IM","IM")).debug(Re.T,"get logs: startTime "+t+" endTime "+n),yc(e,r,{tag:"browser"}),[4,wc().getLogs(t,n,dc.DEBUG,!1)];case 1:return i=o.sent().logs,r.debug(Re.T,"get logs "+i.length),function(e,t){var n=t.map((function(e){return e.sessionId+","+e.time+","+e.type+","+e.level+","+e.tag+","+e.traceId+","+e.loggerId+',"'+e.content+'"\n'})),r=new Blob(n,{type:"text/csv"}),i=URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=e+".csv",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}(e+"-"+t+"-"+n,i),[2]}}))}))}}}}var ad=H;export{ol as AConnectionMgr,ai as AEngine,id as APIContext,p as AppStorage,li as AreaCode,Sn as AssertRules,Fl as BaseCloudController,Ec as BasicLogger,zo as BasicNavi,Fc as BasicReporter,yi as BasicStaticConfigManager,ml as BasicStatistic,Al as BasicStatisticReporter,V as CPP_PROTOCAL_MSGTYPE_OPTION,Bt as CallLibMsgType,ye as ChatroomEntryType,Dt as ChatroomSyncStatusReason,Ae as ChatroomUserChangeType,Ge as ChrmMemBanType,we as ChrmMemOperateType,be as ChrmSyncStatus,di as Codec,$e as ConnectReason,ze as ConnectType,ae as ConnectionStatus,oe as ConversationType,k as DB_LOG_FLUSH_FREQUENCY,F as DB_LOG_MAX_SIZE,Dr as DelayTimer,yt as DirectionType,Be as EConnectProtocol,We as EnterpriseType,re as ErrorCode,Si as ErrorCodeMap,hn as EventEmitter,Y as FORMATED_VERSION,$ as FileType,mt as FriendAddPermission,Ot as FriendApplicationStatus,Nt as FriendApplicationType,Ut as FriendEventType,Mt as FriendMsgChangeType,At as FriendRelationType,gt as FriendSubChangeType,Ct as GroupApplicationDirection,Et as GroupApplicationStatus,pt as GroupApplicationSubChangeType,vt as GroupApplicationType,_t as GroupFollowUserChangeType,ht as GroupInfoChangeSubChangeType,ut as GroupInviteHandlePermission,ot as GroupJoinPermission,at as GroupMemberInfoEditPermission,ct as GroupMemberRole,Rt as GroupMsgChangeType,lt as GroupOperation,st as GroupOperationPermission,Tt as GroupOperationRole,It as GroupOperationStatus,dt as GroupOperationSubChangeType,ft as GroupOperationType,v as HTTP_TIMEOUT,ar as HttpMethod,M as IM_CHATROOM_PULL_INTERVAL_TIME,m as IM_PING_INTERVAL_TIME,N as IM_PING_MIN_TIMEOUT,A as IM_PING_TIMEOUT,S as IM_SIGNAL_TIMEOUT,Bc as IndexDBLogger,Xc as IndexDBReporter,Ol as IndexDBStatistic,Dl as IndexDBStatisticReporter,Fe as InterruptionLevel,Tl as InvokerType,Z as LOCAL_STORAGE_KEYS,bt as LiveRole,Pt as LiveType,dc as LogL,Ie as LogLevel,Te as LogSource,Re as LogTagId,D as MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH,O as MAX_MESSAGE_CONTENT_BYTES,U as MAX_MESSAGE_EXPANSION_KEY_LENGTH,L as MAX_MESSAGE_EXPANSION_VAL_LENGTH,K as MAX_UPLOAD_FILE_SIZE,ge as MentionedType,me as MessageBlockSourceType,Oe as MessageBlockType,te as MessageDirection,ce as MessageType,R as NAVI_CACHE_DURATION,C as NAVI_REQ_TIMEOUT,X as NON_SUBSCRIBE_USER_PROFILE_VALID_TIME,Xe as NaviCacheType,ur as NetworkType,pe as NotificationLevel,de as NotificationStatus,x as ONE_LOG_SIZE_MAX,et as OnlineStatus,Le as OperateStatus,tt as PlatformInfo,mi as PluginContext,Je as ProtocalType,ke as PushImportanceHonor,St as QueryFriendsDirectionType,Yn as RCAssertError,Zc as RCConnectionStatus,Q as RC_DEFAULT_USER,W as READ_RECEIPT_CATCH_TIME,B as REAT_TIME_LOG_SIZE,wt as RTCApiType,Vt as RTCIdentityChangeType,Gt as RTCJoinType,Lt as RTCMode,td as RTCPluginContext,t as ReceivedStatus,w as SEND_MESSAGE_TYPE_OPTION,j as STATIC_CONFIG_CACHE_TIME,b as STATIC_CONFIG_IV,P as STATIC_CONFIG_KEY,G as STATUS_MESSAGE,J as SUBSCRIBE_USER_PROFILE_VALID_TIME,Me as SentStatus,il as StatisticL,ve as StatisticsTag,Ze as StatisticsVersion,xe as StoreKeys,rt as SubscribeOperationType,nt as SubscribeType,xn as SuspendablePromise,cr as TagChangeType,q as UPLOAD_FILE_CHUNK_SIZE,Ye as UltraGroupChannelChangeType,He as UltraGroupChannelType,Qe as UltraMentionedType,Ke as UltraMsgChangeType,qe as UltraMsgSubChangeType,Ee as UploadMethod,je as UserGroupChangeType,it as UserProfileVisibility,H as VERSION,od as ValidatorManage,_n as VersionManage,y as WEB_SOCKET_TIMEOUT,ns as WebSocketNavi,T as appendUrl,kn as arrayToKeyValue,Kn as assert,Ur as clearOldIndexDB,Sr as clone,Rr as cloneByJSON,Nr as completeSubscriptionPlatformStatus,mc as deInitLogDB,ir as decryptCBC,or as fixUrlProtocol,gr as forEach,Pr as formatCmpList,Gn as formatFollowsInfo,Pn as formatGetGroupsInfo,Fn as formatGroupApplications,Dn as formatGroupBaseInfo,wn as formatGroupMembers,bn as formatGroupsInfo,Vn as formatUserProfiles,Cr as getBrowser,nr as getClientMessageId,Rn as getDeviceId,sr as getMessageUIdHash,Zn as getMimeKey,lr as getMinionURL,fn as getUUID,En as getUUID22,Xn as getUploadFileName,rr as getbundleId,hr as httpRequest,Er as indexOf,yc as initLogDB,gl as initStatisticDB,Yt as isArray,jt as isArrayBuffer,kt as isBoolean,nl as isConnnectAck,tl as isDisconnectedByServer,Xt as isFunction,$t as isHttpUrl,Tr as isInObject,Ir as isInclude,Ht as isInteger,Kt as isLimitedArray,qt as isLimitedString,zt as isNull,xt as isNumber,Jt as isObject,gn as isStartCloudController,Ft as isString,br as isSupportDirectMessage,Mr as isSupportIndexDB,un as isTypeInConversationList,Zt as isUndefined,rn as isValidChannelId,er as isValidChrmEntryKey,tr as isValidChrmEntryValue,dn as isValidConversation,tn as isValidConversationType,on as isValidEnum,ln as isValidExpansion,cn as isValidFileType,an as isValidGroupId,nn as isValidNotificationLevel,sn as isValidTargetId,Un as logger,fr as map,Wt as notEmptyArray,en as notEmptyObject,Qt as notEmptyString,zn as pushConfigsToJSON,$n as pushJSONToConfigs,yl as statisticTranscsv,f as todo,Jc as transcsv,Bn as transforServerProfileInfo,Ar as transformReceivedStatusFlag,mr as transformReceivedStatusInfo,Or as transformUserProfiles,El as unInitStatisticDB,dr as updateMentionedInfo,Ci as urlCenter,vr as usingCppEngine,qn as validate,Hn as validators,ad as version};
|