@tencentcloud/chat
Version:
Tencent Cloud Chat SDK for Web/Mini Program/uni-app/React Native/Donut
1 lines • 469 kB
JavaScript
let e={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",ROOM_CUSTOM_DATA_RECEIVED:"onRoomCustomDataReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",MESSAGE_EXTENSIONS_UPDATED:"onMessageExtensionsUpdated",MESSAGE_EXTENSIONS_DELETED:"onMessageExtensionsDeleted",MESSAGE_REACTIONS_UPDATED:"onMessageReactionsUpdated",CONVERSATION_LIST_UPDATED:"onConversationListUpdated",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:"onTotalUnreadMessageCountUpdated",CONVERSATION_GROUP_LIST_UPDATED:"onConversationGroupListUpdated",CONVERSATION_IN_GROUP_UPDATED:"onConversationInGroupUpdated",GROUP_LIST_UPDATED:"onGroupListUpdated",GROUP_ATTRIBUTES_UPDATED:"groupAttributesUpdated",GROUP_COUNTER_UPDATED:"onGroupCounterUpdated",TOPIC_CREATED:"onTopicCreated",TOPIC_DELETED:"onTopicDeleted",TOPIC_UPDATED:"onTopicUpdated",PROFILE_UPDATED:"onProfileUpdated",USER_STATUS_UPDATED:"onUserStatusUpdated",BLACKLIST_UPDATED:"blacklistUpdated",FRIEND_LIST_UPDATED:"onFriendListUpdated",FRIEND_GROUP_LIST_UPDATED:"onFriendGroupListUpdated",FRIEND_APPLICATION_LIST_UPDATED:"onFriendApplicationListUpdated",MY_FOLLOWERS_LIST_UPDATED:"onMyFollowersListUpdated",MY_FOLLOWING_LIST_UPDATED:"onMyFollowingListUpdated",MUTUAL_FOLLOWERS_LIST_UPDATED:"onMutualFollowersListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange",ALL_RECEIVE_MESSAGE_OPT_UPDATED:"onAllReceiveMessageOptUpdated",SERVER_CONFIG_UPDATED:"onServerConfigUpdated",PINNED_GROUP_MESSAGE_UPDATED:"onPinnedGroupMessageUpdated"},t={MSG_TEXT:"TIMTextElem",MSG_IMAGE:"TIMImageElem",MSG_SOUND:"TIMSoundElem",MSG_AUDIO:"TIMSoundElem",MSG_FILE:"TIMFileElem",MSG_FACE:"TIMFaceElem",MSG_VIDEO:"TIMVideoFileElem",MSG_GEO:"TIMLocationElem",MSG_LOCATION:"TIMLocationElem",MSG_GRP_TIP:"TIMGroupTipElem",MSG_GRP_SYS_NOTICE:"TIMGroupSystemNoticeElem",MSG_CUSTOM:"TIMCustomElem",MSG_MERGER:"TIMRelayElem",MSG_PRIORITY_HIGH:"High",MSG_PRIORITY_NORMAL:"Normal",MSG_PRIORITY_LOW:"Low",MSG_PRIORITY_LOWEST:"Lowest",CONV_C2C:"C2C",CONV_GROUP:"GROUP",CONV_TOPIC:"TOPIC",CONV_SYSTEM:"@TIM#SYSTEM",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:"Private",GRP_WORK:"Private",GRP_PUBLIC:"Public",GRP_CHATROOM:"ChatRoom",GRP_MEETING:"ChatRoom",GRP_AVCHATROOM:"AVChatRoom",GRP_COMMUNITY:"Community",GRP_ROOM:"Room",GRP_LIVE:"Live",GRP_MBR_ROLE_OWNER:"Owner",GRP_MBR_ROLE_ADMIN:"Admin",GRP_MBR_ROLE_MEMBER:"Member",GRP_MBR_ROLE_CUSTOM:"Custom",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:"AcceptAndNotify",MSG_REMIND_ACPT_NOT_NOTE:"AcceptNotNotify",MSG_REMIND_DISCARD:"Discard",RECEIVE_WITH_OFFLINE_PUSH_EXCEPT_AT:"AcceptNotNotifyExceptAt",NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT:"AcceptNotNotifyExceptAt",NOT_RECEIVE_MSG_EXCEPT_AT:"NotReceiveMsgExceptAt",GENDER_UNKNOWN:"Gender_Type_Unknown",GENDER_FEMALE:"Gender_Type_Female",GENDER_MALE:"Gender_Type_Male",KICKED_OUT_MULT_ACCOUNT:"multipleAccount",KICKED_OUT_MULT_DEVICE:"multipleDevice",KICKED_OUT_USERSIG_EXPIRED:"userSigExpired",KICKED_OUT_REST_API:"REST_API_Kick",ALLOW_TYPE_ALLOW_ANY:"AllowType_Type_AllowAny",ALLOW_TYPE_NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_TYPE_DENY_ANY:"AllowType_Type_DenyAny",FORBID_TYPE_NONE:"AdminForbid_Type_None",FORBID_TYPE_SEND_OUT:"AdminForbid_Type_SendOut",JOIN_OPTIONS_FREE_ACCESS:"FreeAccess",JOIN_OPTIONS_NEED_PERMISSION:"NeedPermission",JOIN_OPTIONS_DISABLE_APPLY:"DisableApply",JOIN_STATUS_SUCCESS:"JoinedSuccess",JOIN_STATUS_ALREADY_IN_GROUP:"AlreadyInGroup",JOIN_STATUS_WAIT_APPROVAL:"WaitAdminApproval",INVITE_OPTIONS_DISABLE_INVITE:"DisableInvite",INVITE_OPTIONS_NEED_PERMISSION:"NeedPermission",INVITE_OPTIONS_FREE_ACCESS:"FreeAccess",GRP_PROFILE_OWNER_ID:"ownerID",GRP_PROFILE_CREATE_TIME:"createTime",GRP_PROFILE_LAST_INFO_TIME:"lastInfoTime",GRP_PROFILE_MEMBER_NUM:"memberNum",GRP_PROFILE_MAX_MEMBER_NUM:"maxMemberNum",GRP_PROFILE_JOIN_OPTION:"joinOption",GRP_PROFILE_INVITE_OPTION:"inviteOption",GRP_PROFILE_INTRODUCTION:"introduction",GRP_PROFILE_NOTIFICATION:"notification",GRP_PROFILE_MUTE_ALL_MBRS:"muteAllMembers",SNS_ADD_TYPE_SINGLE:"Add_Type_Single",SNS_ADD_TYPE_BOTH:"Add_Type_Both",SNS_DELETE_TYPE_SINGLE:"Delete_Type_Single",SNS_DELETE_TYPE_BOTH:"Delete_Type_Both",SNS_APPLICATION_TYPE_BOTH:"Pendency_Type_Both",SNS_APPLICATION_SENT_TO_ME:"Pendency_Type_ComeIn",SNS_APPLICATION_SENT_BY_ME:"Pendency_Type_SendOut",SNS_APPLICATION_AGREE:"Response_Action_Agree",SNS_APPLICATION_AGREE_AND_ADD:"Response_Action_AgreeAndAdd",SNS_CHECK_TYPE_BOTH:"CheckResult_Type_Both",SNS_CHECK_TYPE_SINGLE:"CheckResult_Type_Single",SNS_TYPE_NO_RELATION:"CheckResult_Type_NoRelation",SNS_TYPE_A_WITH_B:"CheckResult_Type_AWithB",SNS_TYPE_B_WITH_A:"CheckResult_Type_BWithA",SNS_TYPE_BOTH_WAY:"CheckResult_Type_BothWay",NET_STATE_CONNECTED:"connected",NET_STATE_CONNECTING:"connecting",NET_STATE_DISCONNECTED:"disconnected",MSG_AT_ALL:"__kImSDK_MesssageAtALL__",READ_ALL_C2C_MSG:"readAllC2CMessage",READ_ALL_GROUP_MSG:"readAllGroupMessage",READ_ALL_MSG:"readAllMessage",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3,IOS_OFFLINE_PUSH_NO_SOUND:"push.no_sound",IOS_OFFLINE_PUSH_DEFAULT_SOUND:"default"};class s{constructor(){this.cache=[],this.options=null}use(e){if("function"!=typeof e)throw"middleware must be a function";return this.cache.push(e),this}next(e){if(this.middlewares&&0<this.middlewares.length)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}run(e){return this.middlewares=this.cache.map(function(e){return e}),this.options=e,this.next()}}class i{constructor(e=0,t=0){this.high=e,this.low=t}equal(e){return null!==e&&this.low===e.low&&this.high===e.high}toString(){var e=Number(this.high).toString(16);let t=Number(this.low).toString(16);if(t.length<8){let e=8-t.length;for(;e;)t="0"+t,e--}return e+t}}let n={TEST:{CHINA:{DEFAULT:"wss://wss-dev.tim.qq.com"},OVERSEA:{DEFAULT:"wss://wss-dev.tim.qq.com"},SINGAPORE:{DEFAULT:"wss://wsssgp-dev.im.qcloud.com"},KOREA:{DEFAULT:"wss://wsskr-dev.im.qcloud.com"},GERMANY:{DEFAULT:"wss://wssger-dev.im.qcloud.com"},IND:{DEFAULT:"wss://wssind-dev.im.qcloud.com"},JPN:{DEFAULT:"wss://wssjpn-dev.im.qcloud.com"},USA:{DEFAULT:"wss://wssusa-dev.im.qcloud.com"},INDONESIA:{DEFAULT:"wss://wssidn-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",BACKUP_WEB:"wss://*w4c.my-cpaas.com",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",BACKUP_WEB:"wss://*w4c.my-cpaas.com",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT0:"wss://*w4s.my-imcloud.com",DEFAULT:"wss://wsssgp.im.qcloud.com",IPV6:"wss://wsssgpv6.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",BACKUP_WEB:"wss://*w4s.my-cpaas.com",STAT:"https://apisgp.my-imcloud.com",ANYCAST:"wss://162.14.19.159"},KOREA:{DEFAULT0:"wss://*w4k.my-imcloud.com",DEFAULT:"wss://wsskr.im.qcloud.com",IPV6:"wss://wsskrv6.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",BACKUP_WEB:"wss://*w4k.my-cpaas.com",STAT:"https://apikr.my-imcloud.com",ANYCAST:"wss://162.14.13.104"},GERMANY:{DEFAULT0:"wss://*w4g.my-imcloud.com",DEFAULT:"wss://wssger.im.qcloud.com",IPV6:"wss://wssgerv6.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",BACKUP_WEB:"wss://*w4g.my-cpaas.com",STAT:"https://apiger.my-imcloud.com",ANYCAST:"wss://162.14.3.17"},IND:{DEFAULT0:"wss://*w4i.my-imcloud.com",DEFAULT:"wss://wssind.my-imcloud.com",IPV6:"wss://wssindv6.im.qcloud.com",BACKUP:"wss://wssind.im.qcloud.com",BACKUP_WEB:"wss://*w4i.my-cpaas.com",STAT:"https://apiind.my-imcloud.com",ANYCAST:"wss://162.14.19.46"},JPN:{DEFAULT0:"wss://*w4j.my-imcloud.com",DEFAULT:"wss://wssjpn.im.qcloud.com",IPV6:"wss://wssjpnv6.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",BACKUP_WEB:"wss://*w4j.my-cpaas.com",STAT:"https://apijpn.my-imcloud.com"},USA:{DEFAULT0:"wss://*w4u.my-imcloud.com",DEFAULT:"wss://wssusa.im.qcloud.com",IPV6:"wss://wssusav6.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",BACKUP_WEB:"wss://*w4u.my-cpaas.com",STAT:"https://apiusa.my-imcloud.com",ANYCAST:"wss://162.14.10.42"},INDONESIA:{DEFAULT0:"wss://*w4y.my-imcloud.com",DEFAULT:"wss://wssidn.im.qcloud.com",IPV6:"wss://wssidnv6.im.qcloud.com",BACKUP:"wss://wssidn.my-imcloud.com",BACKUP_WEB:"wss://*w4y.my-cpaas.com",STAT:"https://apiidn.my-imcloud.com",ANYCAST:"wss://43.129.34.169"}}},o={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15,DONUT_NATIVE_APP:19,NS_NATIVE_APP:20,RN_NATIVE_APP:21},r="1.7.3",a=537048168,c="CHINA",l="OVERSEA",u="SINGAPORE",d="KOREA",_="GERMANY",h="IND",p="JPN",g="USA",m="INDONESIA",f={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent(e=c){this.CURRENT=n.PRODUCTION[e]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GRP:"group_open_http_svc",GRP_AV:"group_open_avchatroom_http_svc",GRP_COMMUNITY:"million_group_open_http_svc",GRP_ATTR:"group_open_attr_http_svc",FD:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GRP_NO_AUTH:"group_open_http_noauth_svc",BIG_GRP_POLLING:"group_open_long_polling_http_svc",BIG_GRP_POLLING_NO_AUTH:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",WEB_IM:"webim",IM_COS_SIGN:"im_cos_sign_svr",CUSTOM_UPLOAD:"im_cos_msg",HEARTBEAT:"heartbeat",IM_OPEN_PUSH:"im_open_push",IM_OPEN_STATUS:"im_open_status",IM_LONG_MSG:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush",IM_MSG_AUDIT_MGR:"im_msg_audit_mgr",TUIROOM_SVR:"tui_room_svr",IM_OPEN_TRANSLATE:"im_open_translate",IM_OPEN_SPEECH:"im_open_speech",MSG_SEARCH:"message_search",GRP_SEARCH:"group_search",GRP_MEMBER_SEARCH:"group_member_search",USER_SEARCH:"user_search",FOLLOW:"follow",OFFLINE_PUSH_REPORT:"offline_push_report",IM_MSG_LOGIC:"im_msg_db_logic"}},M={SEARCH_GRP_SNS:new i(0,Math.pow(2,1)).toString(),AV_HISTORY_MSG:new i(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new i(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new i(0,Math.pow(2,4)).toString(),AV_MBR_LIST:new i(0,Math.pow(2,6)).toString(),USER_STATUS:new i(0,Math.pow(2,7)).toString(),CONV_MARK:new i(0,Math.pow(2,9)).toString(),CONV_GROUP:new i(0,Math.pow(2,10)).toString(),AV_BAN_MBR:new i(0,Math.pow(2,11)).toString(),MSG_EXT:new i(0,Math.pow(2,13)).toString(),GRP_COUNTER:new i(0,Math.pow(2,15)).toString(),PLUGIN_TRANSLATE:new i(Math.pow(2,6)).toString(),PLUGIN_VOICE_TO_TEXT:new i(Math.pow(2,7)).toString(),PLUGIN_CS:new i(Math.pow(2,8)).toString(),PLUGIN_PUSH:new i(Math.pow(2,9)).toString(),PLUGIN_BOT:new i(Math.pow(2,10)).toString(),MSG_REACTION:new i(Math.pow(2,16)).toString(),FOLLOW:new i(Math.pow(2,20)).toString()},I="c2c_text_message",C="c2c_custom_message",T="group_text_message",y="group_custom_message",v="user_profile",E="group_profile",S="web.sdk.qcloud.com",D="web.sdk.cloud.tencent.cn",R="web.sdk.tencent.cn",L=(f.HOST.setCurrent(c),"undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&("mac"===wx.getSystemInfoSync().platform||"windows"===wx.getSystemInfoSync().platform)),A="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting)||L,O=A&&"function"==typeof wx.createGamePortal,N="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),P="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),U="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),G="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),k="undefined"!=typeof jd&&"function"==typeof jd.getSystemInfoSync,w="undefined"!=typeof uni&&"undefined"==typeof window&&"function"==typeof uni.requireNativePlugin,b=A&&"object"==typeof wx.miniapp,F="undefined"!=typeof uni,$=A||N||P||U||G||w||k,q="undefined"==typeof window&&!$&&"undefined"!=typeof global&&void 0!==global.NativeScriptGlobals,x="undefined"!=typeof global&&(void 0!==global.nativeModuleProxy||void 0!==global.ReactNative),V="undefined"!=typeof uni?!$:"undefined"!=typeof window&&!$&&!x,B=N?qq:P?tt:U?swan:G?my:A?wx:w?uni:k?jd:{},K=V&&window&&window.navigator&&window.navigator.userAgent||"",H=/(micromessenger|webbrowser)/i.test(K),W=function(){let e="WEB";return H?e="WEB":N?e="QQ_MP":P?e="TT_MP":U?e="BAIDU_MP":G?e="ALI_MP":A?e=b?"DONUT_NATIVE_APP":"WX_MP":w?e="UNI_NATIVE_APP":q?e="NS_NATIVE_APP":x&&(e="RN_NATIVE_APP"),o[e]}(),Y=/iPad/i.test(K),z=/iPhone/i.test(K)&&!Y,j=/iPod/i.test(K),J=z||Y||j,X=function(){var e=K.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Z=/Android/i.test(K),Q=function(){var e,t,s=K.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);return s?(e=s[1]&&parseFloat(s[1]),t=s[2]&&parseFloat(s[2]),e&&t?parseFloat(s[1]+"."+s[2]):e||null):null}(),ee=/Edge/i.test(K),te=!ee&&/Chrome/i.test(K),se=/MSIE/.test(K)||-1<K.indexOf("Trident")&&-1<K.indexOf("rv:11.0"),ie=function(){var e=/MSIE\s(\d+)\.\d/.exec(K);let t=e&&parseFloat(e[1]);return t=!t&&/Trident\/7.0/i.test(K)&&/rv:11.0/.test(K)?11:t}(),ne=/Safari/i.test(K)&&!te&&!Z&&!ee,oe=/Windows/i.test(K),re=/MAC OS X/i.test(K),ae=V&&"undefined"!=typeof Worker&&!se,ce=Z||J,le=V&&void 0!==window.tencent_cloud_im_csig_flutter_for_web_25F_cy,ue=function(){var e;return"undefined"!=typeof window&&void 0!==window.navigator&&(e=window.navigator.standalone,!(!J||e||ne))}(),de,_e,he=(de="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{},function(){}),pe=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],ge=pe.length;for(;ge--;)_e=pe[ge],console[_e]||(de[_e]=he);var me=de;let fe=0,Me=function(){return(new Date).getTime()+fe},Ie=function(){fe=0},Ce=function(){return Math.floor(Me()/1e3)},Te=0;function ye(){return Lt()?"%c Chat %c":"Chat"}function ve(){(e=new Date).setTime(Me());var e;return e.toLocaleTimeString("en-US",{hour12:!1})+"."+function(e){let t;switch(e.toString().length){case 1:t="00"+e;break;case 2:t="0"+e;break;default:t=e}return t}(e.getMilliseconds())}let Ee={arguments2String(s){let i="";if(1===s.length)i=s[0];else for(let e=0,t=s.length;e<t;e++){if(Ke(s[e]))try{i+=We(s[e])?JSON.stringify(s[e],["message","code"]):JSON.stringify(s[e])}catch(e){i+=e?e.message:"";break}else i+=s[e];i+=" "}return i},_exec(e,t){Lt()?me[e](ye(),"background:#0abf5b; padding:1px; border-radius:3px; color: #fff","background:transparent",ve(),t):me[e](`${ye()} ${ve()} `+t)},d:function(){var e;Te<=-1&&(e=this.arguments2String(arguments),this._exec("debug",e))},l:function(){var e;Te<=0&&(e=this.arguments2String(arguments),this._exec("log",e))},log:function(){var e;Te<=0&&(e=this.arguments2String(arguments),this._exec("log",e))},i:function(){var e;Te<=1&&(e=this.arguments2String(arguments),this._exec("info",e))},w:function(){var e;Te<=2&&(e=this.arguments2String(arguments),this._exec("warn",e))},e:function(){var e;Te<=3&&(e=this.arguments2String(arguments),this._exec("error",e))},setLevel:function(e){e<4&&this._exec("log","set level from "+Te+" to "+e),Te=e},getLevel:function(){return Te}},Se={JPG:1,JPEG:1,GIF:2,PNG:3,BMP:4,UNKNOWN:255},De={NICK:"Tag_Profile_IM_Nick",GENDER:"Tag_Profile_IM_Gender",BIRTHDAY:"Tag_Profile_IM_BirthDay",LOCATION:"Tag_Profile_IM_Location",SELFSIGNATURE:"Tag_Profile_IM_SelfSignature",ALLOWTYPE:"Tag_Profile_IM_AllowType",LANGUAGE:"Tag_Profile_IM_Language",AVATAR:"Tag_Profile_IM_Image",MESSAGESETTINGS:"Tag_Profile_IM_MsgSettings",ADMINFORBIDTYPE:"Tag_Profile_IM_AdminForbidType",LEVEL:"Tag_Profile_IM_Level",ROLE:"Tag_Profile_IM_Role"},Re="Gender_Type_",Le={UNKNOWN:Re+"Unknown",FEMALE:Re+"Female",MALE:Re+"Male"},Ae={NONE:"AdminForbid_Type_None",SEND_OUT:"AdminForbid_Type_SendOut"},Oe={NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_ANY:"AllowType_Type_AllowAny",DENY_ANY:"AllowType_Type_DenyAny"},Ne="@TGS#_",Pe="@TOPIC#_",Ue=Object.prototype.hasOwnProperty;function Ge(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(xe(e)){for(var t in e)if(Ue.call(e,t))return!1;return!0}return!!(ke(e)||we(e)||be(e))&&0===e.size}let ke=function(e){return"map"===ze(e)},we=function(e){return"set"===ze(e)},be=function(e){return"file"===ze(e)},Fe=function(e){return null!==e&&("number"==typeof e&&!isNaN(+e)||"object"==typeof e&&e.constructor===Number)},$e=function(e){return"string"==typeof e},qe=function(e){return null!==e&&"object"==typeof e},xe=function(e){if("object"!=typeof e||null===e)return!1;e=Object.getPrototypeOf(e);if(null===e)return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return e===t},Ve=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"array"===ze(e)},Be=function(e){return void 0===e},Ke=function(e){return Ve(e)||qe(e)},He=function(e){return"function"==typeof e},We=function(e){return e instanceof Error},Ye=function(e){return"filelist"===ze(e)},ze=function(e){return Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase()},je=function(e){return"string"==typeof e&&(e=e[0],!/[^a-zA-Z0-9]/.test(e))},Je=(Date.now||(Date.now=function(){return(new Date).getTime()}),function(s,i,o,n){if(!Ke(s)||!Ke(i))return 0;let r=0;var a,l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)if(a=l[e],!(Be(i[a])||o&&o.includes(a)))if(Ke(s[a])&&Ke(i[a]))r+=Je(s[a],i[a],o,n);else{if(n&&n.includes(i[a]))continue;s[a]!==i[a]&&(s[a]=i[a],r+=1)}return r}),Xe=function(e,t){var s,i,o=new Map;for([s,i]of e.entries())i&&o.set(s,t?JSON.stringify(i):JSON.parse(JSON.stringify(i)));return o},Ze=function(e){if(0===e.length)return 0;let t=0,s=0,i;for(var o="undefined"!=typeof document&&void 0!==document.characterSet?document.characterSet:"UTF-8";void 0!==e[t];)i=e[t++].charCodeAt[t]<=255?1:!1===o?3:2,s+=i;return s},Qe=function(e){e=e||99999999;return Math.round(Math.random()*e)},et="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",st=et.length,it=function(e,t){for(var s in e)if(e[s]===t)return!0;return!1},nt={},ot=function(e){return-1===e.indexOf("http://")||-1===e.indexOf("https://")?"https://"+e:e.replace(/https|http/,"https")};function rt(i,e){if(!Ve(i)||!Ve(e))return!1;let o=!1;return e.forEach(({key:t,value:e})=>{var s=i.find(e=>e.key===t);s?s.value!==e&&(s.value=e,o=!0):(i.push({key:t,value:e}),o=!0)}),o}function at(e){var t;if(xe(e)&&xe(e.webhookInfo))return t=[],e.webhookInfo.disableCloudMessagePreHook&&t.push("ForbidBeforeSendMsgCallback"),e.webhookInfo.disableCloudMessagePostHook&&t.push("ForbidAfterSendMsgCallback"),0!==t.length?t:void 0}let ct=e=>e===t.GRP_AVCHATROOM,lt=({type:e,groupID:s})=>e===t.GRP_COMMUNITY||(""+s).startsWith(Ne)&&!(""+s).includes(Pe),ut=e=>(""+e).startsWith(Ne)&&(""+e).includes(Pe),dt=e=>$e(e)&&e.slice(0,3)===t.CONV_C2C,_t=e=>$e(e)&&e.slice(0,5)===t.CONV_GROUP,ht=e=>$e(e)&&e===t.CONV_SYSTEM;function pt(t,s){let i={};return Object.keys(t).forEach(e=>{i[e]=s(t[e],e)}),i}function gt(i){return x?Promise.resolve({width:0,height:0}):$?new Promise((t,e)=>{B.getImageInfo({src:i,success(e){t({width:e.width,height:e.height})},fail(){t({width:0,height:0})}})}):se&&9===ie?Promise.resolve({width:0,height:0}):new Promise((e,t)=>{let s=new Image;s.onload=function(){e({width:this.width,height:this.height}),s=null},s.onerror=function(){e({width:0,height:0}),s=null},s.src=i})}function mt(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return""+(e()+e())+e()+e()+e()+e()+e()+e()}function ft(){let e="unknown";if(re&&(e="mac"),oe&&(e="windows"),J&&(e="ios"),Z&&(e="android"),$)try{var t=B.getSystemInfoSync().platform;void 0!==t&&(e=t)}catch(e){}return e}function Mt(i,o){i=i.split("."),o=o.split(".");let e=Math.max(i.length,o.length);for(;i.length<e;)i.push("0");for(;o.length<e;)o.push("0");for(let s=0;s<e;s++){let e=parseInt(i[s]),t=parseInt(o[s]);if(e>t)return 1;if(e<t)return-1}return 0}function It(e){let{originUrl:t,originWidth:s,originHeight:i,min:o=198}=e,n=parseInt(s),r=parseInt(i),a={url:void 0,width:0,height:0};if((n<=r?n:r)<=o)a.url=t,a.width=n,a.height=r;else{r<=n?(a.width=Math.ceil(n*o/r),a.height=o):(a.width=o,a.height=Math.ceil(r*o/n));let e=t&&-1<t.indexOf("?")?t+"&":t+"?";a.url=198===o?e+"imageView2/3/w/198/h/198":e+"imageView2/3/w/720/h/720"}if(Be(t)){let{url:e,...t}=a;return t}return a}function Ct(t){var e=t[2];t[2]=t[1],t[1]=e;for(let e=0;e<t.length;e++)t[e].setType(e)}function Tt(e){e=e.servcmd;return e.slice(e.indexOf(".")+1)}function yt(e,t){return Math.round(Number(e)*Math.pow(10,t))/Math.pow(10,t)}function vt(e,t){return e.includes(t)}function Et(e,t){return e.includes(t)}function St(e){return e.split(Pe)[0]}let Dt=function(e,s,i){if(Be(s))return"";switch(e){case t.MSG_TEXT:return s.text;case t.MSG_IMAGE:return i?"[Image]":"[图片]";case t.MSG_LOCATION:return i?"[Location]":"[位置]";case t.MSG_AUDIO:return i?"[Voice]":"[语音]";case t.MSG_VIDEO:return i?"[Video]":"[视频]";case t.MSG_FILE:return i?"[File]":"[文件]";case t.MSG_CUSTOM:return i?"[Custom Messages]":"[自定义消息]";case t.MSG_GRP_TIP:return i?"[Group Notification]":"[群提示消息]";case t.MSG_GRP_SYS_NOTICE:return i?"[Group System Message]":"[群系统通知]";case t.MSG_FACE:return i?"[Animated Sticker]":"[动画表情]";case t.MSG_MERGER:return i?"[Chat Record]":"[聊天记录]";default:return""}};function Rt(t){var s=[];if($e(t)){var i=t.length;if(0!==i)for(let e=i-1;0<=e;e--)"1"===t[e]&&s.push(Math.pow(2,i-e-1))}return s}function Lt(){return!se&&!$}function At(e){return"the length of userIDList cannot exceed "+e}function Ot(e,t=!0,s=!0){var i=Date.now();return t?s?i-e+" ms":Math.round((i-e)/1e3)+" s":s?i-e:Math.round((i-e)/1e3)}function Nt(e){let t=e&&1<e?!0:!1;return t}function Pt(s,i,o){if(void 0===i)return!0;let n=!0;if(xe(i))Object.keys(i).forEach(e=>{var t=1===s.length?s[0][e]:void 0;n=!!Ut(t,i[e],o,e)&&n});else if(Ve(i))for(let e=0;e<i.length;e++)n=!!Ut(s[e],i[e],o,i[e].name)&&n;if(n)return n;throw new Error("Params validate failed.")}function Ut(e,t,s,i){if(void 0===t)return!0;let o=!0;var n,r;return t.required&&Ge(e)&&(Ee.e(`[${s}] Missing required params: "${i}".`),o=!1),Ge(e)||(n=ze(e))===(r=t.type.toLowerCase())||"asyncfunction"===n&&"function"===r||(Ee.e(`[${s}] Invalid params: type check failed for "${i}". Expected ${t.type}.`),o=!1),t.validator&&!t.validator(e,s,i)&&(Ee.e(`[${s}] Invalid params: custom validator check failed for "${i}".`),o=!1),o}let Gt="unSend",kt="success",wt="fail",bt="notStart",Ft="pending",$t="resolved",qt="rejected",xt=function(e){return!(!e||!(dt(e)||_t(e)||ht(e))&&((e=Is("InvalidConversationID",e))&&Ee.w(e),1))},Vt=function(e){""!==e.desc&&""!==Is("API_REFER")&&Ee.w(`[${e.api}] | ${e.paramName} | ${e.desc}, `+Is("API_REFER")+e.api)},Bt=function(){return Is("StringRequiredLog")},Kt=function(e){return Is("NonEmptyStringRequiredLog",e)},Ht=function(){return Is("NumberRequiredLog")},Wt=function(){return Is("UndefinedNotAllowedLog")},Yt=function(){return Is("FileRequiredLog")},zt=function(){return Is("FunctionRequiredLog")},jt=function(){return Is("ArrayRequiredLog")},Jt=function(){return Is("NonEmptyArrayLog")},Xt=function(){return Is("CallbackMissingLog")},Zt=function(){return Is("PositiveIntegerRequiredLog")},Qt=function(e,t){return Is("StringNotLongerThanLog",e,t)},es=function(e,t){return Is("NumberGreaterThanLog",e,t)},ts=function(e,t){return Is("NumberGreaterOrEqualLog",e,t)},ss=function(e){return Is("KeyValueStringRequiredLog",e)},is=function(){return Is("PlainObjectRequiredLog")},ns=function(){return Is("NonEmptyContentRequiredLog")},os=function(){return Is("FileNotSelectedLog")},rs=function(){return Is("MessageInstanceRequiredLog")},as=function(){return Is("NonAnonymousFunctionLog")},cs=function(){return Is("MessageExtensionNotAvailableLog")},ls=function(){return Is("MessageReactionRequiredLog")},us=function(e,t){return Is("ContainsUnsupportedTypeLog",e,t)},ds={type:"String",required:!0},_s={type:"Array",required:!0},hs={type:"Object",required:!0},ps={type:"Boolean",required:!0},gs={type:"number",required:!0},ms=function(e,t,s,{allowUndefined:i,allowEmpty:o,maxLength:n}){return Be(e)?!!i||(Vt({api:t,paramName:s,desc:Wt()}),!1):Ve(e)?!(0===e.length&&(Vt({api:t,paramName:s,desc:Jt()}),!o)||n&&e.length>n&&(Vt({api:t,paramName:s,desc:(i=s,o=n,Is("MaximumArrayLengthLog",i,o))}),1)):(Vt({api:t,paramName:s,desc:jt()}),!1)},fs=function(e,t,s,{allowUndefined:i,min:o,max:n}){return Be(e)?!!i||(Vt({api:t,paramName:s,desc:Wt()}),!1):Fe(e)?Fe(o)&&e<o?(Vt({api:t,paramName:s,desc:0===o?ts(s,o):es(s,o-1)}),!1):!(Fe(n)&&n<e&&(Vt({api:t,paramName:s,desc:(i=s,o=n,Is("MaximumNumberLog",i,o))}),1)):(Vt({api:t,paramName:s,desc:Ht()}),!1)},Ms={keywordListForMsg:{type:"Array",required:!1,validator:(e,t,s)=>ms(e,t,s,{allowUndefined:!0,allowEmpty:!0,maxLength:5})},keywordListExceptMsg:{type:"Array",required:!0,validator:(e,t,s)=>ms(e,t,s,{allowUndefined:!1,allowEmpty:!1,maxLength:5})},keywordListMatchType:{type:"String",required:!1,validator:(e,t,s)=>!e||"or"===e||"and"===e||Vt({api:t,paramName:s,desc:e+" is invalid match type"})},cursor:{type:"String",required:!1},count:{type:"Number",required:!1,validator:(e,t,s)=>fs(e,t,s,{allowUndefined:!0,min:1,max:100})},groupTypeList:{type:"Array",required:!1,validator:(e,s,i)=>{if(!e)return!0;if(!ms(e,s,i,{allowUndefined:!0,allowEmpty:!0}))return!1;let o=[t.GRP_PUBLIC,t.GRP_COMMUNITY,t.GRP_WORK,t.GRP_MEETING];return!(0<e.filter(e=>-1===o.indexOf(e)).length&&(Vt({api:s,paramName:i,desc:us(i,"group")}),1))}}},Is=null,Cs={hookGetAPITips:function(e){Is=e},login:{userID:ds,userSig:ds},addToBlacklist:{userIDList:_s},removeFromBlacklist:{userIDList:_s},on:[{name:"eventName",type:"String",validator:(e,t,s)=>"string"==typeof e&&0!==e.length||(Vt({api:t,paramName:s,desc:Kt(s)}),!1)},{name:"handler",type:"Function",validator:(e,t,s)=>"function"!=typeof e?(Vt({api:t,paramName:s,desc:zt()}),!1):(""===e.name&&Vt({api:t,paramName:s,desc:as()}),!0)}],once:[{name:"eventName",type:"String",validator:(e,t,s)=>"string"==typeof e&&0!==e.length||(Vt({api:t,paramName:s,desc:Kt(s)}),!1)},{name:"handler",type:"Function",validator:(e,t,s)=>"function"!=typeof e?(Vt({api:t,paramName:s,desc:zt()}),!1):(""===e.name&&Vt({api:t,paramName:s,desc:as()}),!0)}],off:[{name:"eventName",type:"String",validator:(e,t,s)=>"string"==typeof e&&0!==e.length||(Vt({api:t,paramName:s,desc:Kt(s)}),!1)},{name:"handler",type:"Function",validator:(e,t,s)=>"function"!=typeof e?(Vt({api:t,paramName:s,desc:zt()}),!1):(""===e.name&&Vt({api:t,paramName:s,desc:as()}),!0)}],sendMessage:[{name:"message",...hs}],setMessageExtensions:[{name:"message",...hs,validator:(e,t,s)=>e.status===kt&&!0===e.isSupportExtension||(Vt({api:t,paramName:s,desc:cs()}),!1)},{name:"extensions",..._s}],getMessageExtensions:[{name:"message",...hs,validator:(e,t,s)=>e.status===kt&&!0===e.isSupportExtension||(Vt({api:t,paramName:s,desc:cs()}),!1)}],deleteMessageExtensions:[{name:"message",...hs,validator:(e,t,s)=>e.status===kt&&!0===e.isSupportExtension||(Vt({api:t,paramName:s,desc:cs()}),!1)}],addMessageReaction:[{name:"message",...hs,validator:(e,t,s)=>e.status===kt||(Vt({api:t,paramName:s,desc:ls()}),!1)},{name:"reactionID",...ds}],removeMessageReaction:[{name:"message",...hs,validator:(e,t,s)=>e.status===kt||(Vt({api:t,paramName:s,desc:ls()}),!1)},{name:"reactionID",...ds}],getMessageReactions:{messageList:{..._s}},getAllUserListOfMessageReaction:{message:{...hs,validator:(e,t,s)=>e.status===kt||(Vt({api:t,paramName:s,desc:ls()}),!1)},reactionID:{...ds},nextSeq:{type:"Number"},count:{type:"Number"}},getMessageList:{conversationID:{...ds,validator:e=>xt(e)},nextReqMessageID:{type:"String"},count:{type:"Number",validator:(e,t,s)=>!(!Be(e)&&!/^[1-9][0-9]*$/.test(e)&&(Vt({api:t,paramName:s,desc:Zt()}),1))}},getMessageListHopping:{conversationID:{...ds,validator:e=>xt(e)},sequence:{type:"Number"},time:{type:"Number"},direction:{type:"Number",validator:(e,t,s)=>!(!Be(e)&&0!==e&&1!==e&&(Vt({api:t,paramName:s,desc:Is("0Or1RequiredLog")}),1))},count:{type:"Number",validator:(e,t,s)=>!(!Be(e)&&!/^[1-9][0-9]*$/.test(e)&&(Vt({api:t,paramName:s,desc:Zt}),1))}},setMessageRead:{conversationID:{...ds,validator:e=>xt(e)}},setAllMessageRead:{scope:{type:"String",required:!1,validator:(e,s,i)=>!e||-1!==[t.READ_ALL_C2C_MSG,t.READ_ALL_GROUP_MSG,t.READ_ALL_MSG].indexOf(e)||(Vt({api:s,paramName:i,desc:Is("ValidScopeRequired")}),!1)}},getConversationProfile:[{name:"conversationID",...ds,validator:e=>xt(e)}],clearHistoryMessage:[{name:"conversationID",...ds,validator:e=>xt(e)}],pinConversation:{conversationID:{...ds,validator:e=>xt(e)},isPinned:{...ps}},setConversationDraft:{conversationID:{...ds,validator:e=>xt(e)},draftText:{type:"String",validator:(e,t,s)=>!!$e(e)||(Vt({api:t,paramName:s,desc:Bt()}),!1)}},setConversationCustomData:{conversationIDList:{..._s},customData:{type:"String",validator:(e,t,s)=>$e(e)?!(256<e.length&&(Vt({api:t,paramName:s,desc:Qt(s,256)}),1)):(Vt({api:t,paramName:s,desc:Bt()}),!1)}},markConversation:{conversationIDList:{..._s},markType:{type:"number",validator:(e,t,s)=>{return Fe(e)?e<=0?(Vt({api:t,paramName:s,desc:es(s,0)}),!1):!(e>=Math.pow(2,64)&&(Vt({api:t,paramName:s,desc:(e=s,Is("NumberLessThanLog",e,"Math.pow(2,64)"))}),1)):(Vt({api:t,paramName:s,desc:Ht()}),!1)}},enableMark:{...ps}},createConversationGroup:{conversationIDList:{..._s},groupName:{...ds,validator:(e,t,s)=>!(!e||32<e.length&&(Vt({api:t,paramName:s,desc:Qt(s,32)}),1))}},deleteConversationGroup:[{name:"groupName",...ds}],renameConversationGroup:{oldName:{...ds},newName:{...ds,validator:(e,t,s)=>!(!e||32<e.length&&(Vt({api:t,paramName:s,desc:Qt(s,32)}),1))}},addConversationsToGroup:{conversationIDList:{..._s},groupName:{...ds}},deleteConversationsFromGroup:{conversationIDList:{..._s},groupName:{...ds}},getGroupList:{groupProfileFilter:{type:"Array"}},getGroupProfile:{groupID:ds,groupCustomFieldFilter:{type:"Array"},memberCustomFieldFilter:{type:"Array"}},getGroupProfileAdvance:{groupIDList:_s},createGroup:{name:ds},joinGroup:{groupID:ds,type:{type:"String"},applyMessage:{type:"String"}},quitGroup:[{name:"groupID",...ds}],pinGroupMessage:{groupID:ds,message:hs,isPinned:ps},getPinnedGroupMessageList:[{name:"groupID",...ds}],handleApplication:{message:hs,handleAction:ds,handleMessage:{type:"String"}},changeGroupOwner:{groupID:ds,newOwnerID:ds},updateGroupProfile:{groupID:ds,muteAllMembers:{type:"Boolean"}},dismissGroup:[{name:"groupID",...ds}],searchGroupByID:[{name:"groupID",...ds}],getGroupOnlineMemberCount:[{name:"groupID",...ds}],initGroupAttributes:{groupID:ds,groupAttributes:{...hs,validator:(t,s,i)=>{let o=!0;return Object.keys(t).forEach(e=>{if(!$e(t[e]))return Vt({api:s,paramName:i,desc:ss("value")}),o=!1}),o}}},setGroupAttributes:{groupID:ds,groupAttributes:{...hs,validator:(t,s,i)=>{let o=!0;return Object.keys(t).forEach(e=>{if(!$e(t[e]))return Vt({api:s,paramName:i,desc:ss("value")}),o=!1}),o}}},deleteGroupAttributes:{groupID:ds,keyList:{type:"Array",validator:(e,s,i)=>{if(Be(e)||!Ve(e))return Vt({api:s,paramName:i,desc:jt()}),!1;if(Ge(e))return!0;{let t=!0;return e.forEach(e=>{if(!$e(e))return Vt({api:s,paramName:i,desc:Is("StringArrayRequiredLog")}),t=!1}),t}}}},getGroupAttributes:{groupID:ds,keyList:{type:"Array",validator:(e,s,i)=>{if(Be(e)||!Ve(e))return Vt({api:s,paramName:i,desc:jt()}),!1;if(Ge(e))return!0;{let t=!0;return e.forEach(e=>{if(!$e(e))return Vt({api:s,paramName:i,desc:ss("key")}),t=!1}),t}}}},setGroupCounters:{groupID:ds,counters:hs},increaseGroupCounter:{groupID:ds,key:ds,value:gs},decreaseGroupCounter:{groupID:ds,key:ds,value:gs},getGroupCounters:{groupID:ds},getGroupMemberList:{groupID:ds,count:{type:"Number"}},getGroupMemberProfile:{groupID:ds,userIDList:_s,memberCustomFieldFilter:{type:"Array"}},addGroupMember:{groupID:ds,userIDList:_s},setGroupMemberRole:{groupID:ds,userID:ds,role:ds},setGroupMemberMuteTime:{groupID:ds,userID:ds,muteTime:{type:"Number",validator:e=>0<=e}},setGroupMemberNameCard:{groupID:ds,userID:{type:"String"},nameCard:{type:"String",validator:(e,t,s)=>$e(e)?(e.length,!0):(Vt({api:t,paramName:s,desc:Bt()}),!1)}},setGroupMemberCustomField:{groupID:ds,userID:{type:"String"},memberCustomField:_s},deleteGroupMember:{groupID:ds},markGroupMemberList:{groupID:ds,markType:{type:"number",validator:(e,t,s)=>Fe(e)?!(e<1e3&&(Vt({api:t,paramName:s,desc:ts(s,1e3)}),1)):(Vt({api:t,paramName:s,desc:Ht()}),!1)},userIDList:{..._s},enableMark:{...ps}},createTextMessage:{to:ds,conversationType:ds,payload:{...hs,validator:(e,t,s)=>xe(e)?$e(e.text)?0!==e.text.length||(Vt({api:t,paramName:"payload.text",desc:ns()}),!1):(Vt({api:t,paramName:"payload.text",desc:Bt()}),!1):(Vt({api:t,paramName:s,desc:is()}),!1)}},createTextAtMessage:{to:ds,conversationType:ds,payload:{...hs,validator:(e,t,s)=>xe(e)?$e(e.text)?0===e.text.length?(Vt({api:t,paramName:"payload.text",desc:ns()}),!1):!(e.atUserList&&!Ve(e.atUserList)&&(Vt({api:t,paramName:"payload.atUserList",desc:jt()}),1)):(Vt({api:t,paramName:"payload.text",desc:Bt()}),!1):(Vt({api:t,paramName:s,desc:is()}),!1)}},createCustomMessage:{to:ds,conversationType:ds,payload:{...hs,validator:(e,t,s)=>xe(e)?e.data&&!$e(e.data)?(Vt({api:t,paramName:"payload.data",desc:Bt()}),!1):e.description&&!$e(e.description)?(Vt({api:t,paramName:"payload.description",desc:Bt()}),!1):!(e.extension&&!$e(e.extension)&&(Vt({api:t,paramName:"payload.extension",desc:Bt()}),1)):(Vt({api:t,paramName:"payload",desc:is()}),!1)}},createImageMessage:{to:ds,conversationType:ds,payload:{...hs,validator:(e,t,s)=>{if(!xe(e))return Vt({api:t,paramName:s,desc:is()}),!1;if(Be(e.file))return Vt({api:t,paramName:"payload.file",desc:Wt()}),!1;if(V){if(!(e.file instanceof HTMLInputElement||be(e.file)))return xe(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(Vt({api:t,paramName:"payload.file",desc:os()}),!1):(Vt({api:t,paramName:"payload.file",desc:Yt()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Vt({api:t,paramName:"payload.file",desc:os()}),!1}return!0},onProgress:{type:"Function",required:!1,validator:(e,t,s)=>(Be(e)&&Vt({api:t,paramName:s,desc:Xt()}),!0)}}},createAudioMessage:{to:ds,conversationType:ds,payload:{...hs,validator:(e,t,s)=>!!xe(e)||(Vt({api:t,paramName:s,desc:is()}),!1)},onProgress:{type:"Function",required:!1,validator:(e,t,s)=>(Be(e)&&Vt({api:t,paramName:s,desc:Xt()}),!0)}},createVideoMessage:{to:ds,conversationType:ds,payload:{...hs,validator:(e,t,s)=>{if(!xe(e))return Vt({api:t,paramName:s,desc:is()}),!1;if(Be(e.file))return Vt({api:t,paramName:"payload.file",desc:Wt()}),!1;if(V){if(!(e.file instanceof HTMLInputElement||be(e.file)))return xe(e.file)&&"undefined"!=typeof uni?!!be(e.file.tempFile)||(Vt({api:t,paramName:"payload.file",desc:os()}),!1):(Vt({api:t,paramName:"payload.file",desc:Yt()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Vt({api:t,paramName:"payload.file",desc:os()}),!1}return!0}},onProgress:{type:"Function",required:!1,validator:(e,t,s)=>(Be(e)&&Vt({api:t,paramName:s,desc:Xt()}),!0)}},createFaceMessage:{to:ds,conversationType:ds,payload:{...hs,validator:(e,t,s)=>xe(e)?Fe(e.index)?!!$e(e.data)||(Vt({api:t,paramName:"payload.data",desc:Bt()}),!1):(Vt({api:t,paramName:"payload.index",desc:Ht()}),!1):(Vt({api:t,paramName:s,desc:is()}),!1)}},createFileMessage:{to:ds,conversationType:ds,payload:{...hs,validator:(e,t,s)=>{if(!xe(e))return Vt({api:t,paramName:s,desc:is()}),!1;if(Be(e.file))return Vt({api:t,paramName:"payload.file",desc:Wt()}),!1;if(V){if(!(e.file instanceof HTMLInputElement||be(e.file)))return xe(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(Vt({api:t,paramName:"payload.file",desc:os()}),!1):(Vt({api:t,paramName:"payload.file",desc:Yt()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Vt({api:t,paramName:"payload.file",desc:os()}),!1}return!0}},onProgress:{type:"Function",required:!1,validator:(e,t,s)=>(Be(e)&&Vt({api:t,paramName:s,desc:Xt()}),!0)}},createLocationMessage:{to:ds,conversationType:ds,payload:{...hs,validator:(e,t,s)=>xe(e)?$e(e.description)?Fe(e.longitude)?!!Fe(e.latitude)||(Vt({api:t,paramName:"payload.latitude",desc:Ht()}),!1):(Vt({api:t,paramName:"payload.longitude",desc:Ht()}),!1):(Vt({api:t,paramName:"payload.description",desc:Bt()}),!1):(Vt({api:t,paramName:s,desc:is()}),!1)}},createMergerMessage:{to:ds,conversationType:ds,payload:{...hs,validator:(e,t,s)=>{if(Ge(e.messageList))return Vt({api:t,paramName:"payload.messageList",desc:Jt()}),!1;if(Ge(e.compatibleText))return Vt({api:t,paramName:"payload.compatibleText",desc:Kt("compatibleText")}),!1;let i=!1;return e.messageList.forEach(e=>{e.status===wt&&(i=!0)}),!i||(Vt({api:t,paramName:"payload.messageList",desc:Is("MergeFailedMessageLog")}),!1)}}},revokeMessage:[{name:"message",...hs,validator:(e,s,i)=>Ge(e)?(Vt({api:s,paramName:i,desc:rs()}),!1):e.conversationType===t.CONV_SYSTEM?(Vt({api:s,paramName:i,desc:Is("MessageCanBeRevokedDesc")}),!1):!0!==e.isRevoked||(Vt({api:s,paramName:i,desc:Is("MessageRevokedLog")}),!1)}],deleteMessage:[{name:"messageList",..._s,validator:(e,t,s)=>!Ge(e)||(Vt({api:t,paramName:s,desc:Jt()}),!1)}],translateText:{sourceTextList:_s,sourceLanguage:ds,targetLanguage:ds},convertVoiceToText:{message:{...hs,validator:(e,s,i)=>Ge(e)?(Vt({api:s,paramName:i,desc:rs()}),!1):e.type===t.MSG_AUDIO&&e.status===kt||(Vt({api:s,paramName:i,desc:Is("AudioMessageRequiredLog")}),!1)}},modifyMessage:[{name:"message",...hs,validator:(e,s,i)=>Ge(e)?(Vt({api:s,paramName:i,desc:rs()}),!1):e.conversationType===t.CONV_SYSTEM?(Vt({api:s,paramName:i,desc:Is("MessageCanBeModifiedLog")}),!1):!0!==e._onlineOnlyFlag||(Vt({api:s,paramName:i,desc:Is("OnlineMessageNotSupportLog")}),!1)}],searchCloudMessages:{keywordList:Ms.keywordListForMsg,keywordListMatchType:Ms.keywordListMatchType,cursor:Ms.cursor,senderUserIDList:{type:"Array",required:!1,validator:(e,t,s)=>ms(e,t,s,{allowUndefined:!0,allowEmpty:!0,maxLength:5})},messageTypeList:{type:"Array",required:!1,validator:(e,s,i)=>{if(!e)return!0;if(!ms(e,s,i,{allowUndefined:!0,allowEmpty:!0}))return!1;let o=[t.MSG_TEXT,t.MSG_IMAGE,t.MSG_AUDIO,t.MSG_FILE,t.MSG_VIDEO,t.MSG_LOCATION,t.MSG_CUSTOM,t.MSG_MERGER];return!(0<e.filter(e=>-1===o.indexOf(e)).length&&(Vt({api:s,paramName:i,desc:us(i,"message")}),1))}},conversationID:{type:"String",required:!1,validator:e=>!e||xt(e)},timePosition:{type:"number",required:!1,validator:(e,t,s)=>fs(e,t,s,{allowUndefined:!0,min:0})},timePeriod:{type:"number",required:!1,validator:(e,t,s)=>fs(e,t,s,{allowUndefined:!0,min:0})}},searchCloudUsers:{keywordList:Ms.keywordListExceptMsg,keywordListMatchType:Ms.keywordListMatchType,cursor:Ms.cursor,count:Ms.count,miniBirthday:{type:"Number",required:!1,validator:(e,t,s)=>fs(e,t,s,{allowUndefined:!0,min:0})},maxBirthday:{type:"Number",required:!1,validator:(e,t,s)=>fs(e,t,s,{allowUndefined:!0,min:0})},gender:{type:"String",required:!1,validator:(e,s,i)=>!e||e===t.GENDER_FEMALE||e===t.GENDER_MALE||Vt({api:s,paramName:i,desc:e+" is invalid match type"})}},searchCloudGroups:{keywordList:Ms.keywordListExceptMsg,keywordListMatchType:Ms.keywordListMatchType,cursor:Ms.cursor,count:Ms.count,groupTypeList:Ms.groupTypeList},searchCloudGroupMembers:{keywordList:Ms.keywordListExceptMsg,keywordListMatchType:Ms.keywordListMatchType,cursor:Ms.cursor,count:Ms.count,groupTypeList:Ms.groupTypeList,groupIDList:{type:"Array",required:!1,validator:(e,t,s)=>ms(e,t,s,{allowUndefined:!0,allowEmpty:!0})}},getUserProfile:{userIDList:{type:"Array",validator:(e,t,s)=>Ve(e)?(0===e.length&&Vt({api:t,paramName:s,desc:Jt()}),!0):(Vt({api:t,paramName:s,desc:jt()}),!1)}},updateMyProfile:{profileCustomField:{type:"Array",validator:(e,t,s)=>!!Be(e)||!!Ve(e)||(Vt({api:t,paramName:s,desc:jt()}),!1)}},setSelfStatus:{customStatus:{type:"String",validator:(e,t,s)=>!!$e(e)||(Vt({api:t,paramName:s,desc:Bt()}),!1)}},getUserStatus:{userIDList:{type:"Array",validator:(e,t,s)=>Ve(e)?0!==e.length||(Vt({api:t,paramName:s,desc:Jt()}),!1):(Vt({api:t,paramName:s,desc:jt()}),!1)}},subscribeUserStatus:{userIDList:{type:"Array",validator:(e,t,s)=>Ve(e)?0!==e.length||(Vt({api:t,paramName:s,desc:Jt()}),!1):(Vt({api:t,paramName:s,desc:jt()}),!1)}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:(e,t,s)=>!e||!!Ve(e)||(Vt({api:t,paramName:s,desc:jt()}),!1)}},addFriend:{to:ds,source:{type:"String",required:!0,validator:(e,t,s)=>!(!e||(e.startsWith("AddSource_Type_")?8<e.replace("AddSource_Type_","").length&&(Vt({api:t,paramName:s,desc:Qt("keyword",8)}),1):(Vt({api:t,paramName:s,desc:Is("SourcePrefixLog")}),1)))},remark:{type:"String",required:!1,validator:(e,t,s)=>!($e(e)&&96<e.length&&(Vt({api:t,paramName:s,desc:Qt(s,96)}),1))}},deleteFriend:{userIDList:_s},checkFriend:{userIDList:_s},getFriendProfile:{userIDList:_s},updateFriend:{userID:ds,remark:{type:"String",required:!1,validator:(e,t,s)=>!($e(e)&&96<e.length&&(Vt({api:t,paramName:s,desc:Qt(s,96)}),1))},friendCustomField:{type:"Array",required:!1,validator:(e,s,i)=>{if(e){if(!Ve(e))return Vt({api:s,paramName:i,desc:jt()}),!1;let t=!0;return e.forEach(e=>$e(e.key)&&-1!==e.key.indexOf("Tag_SNS_Custom")?$e(e.value)?8<e.key.replace("Tag_SNS_Custom_","").length?(Vt({api:s,paramName:i,desc:Qt("keyword",8)}),t=!1):void 0:(Vt({api:s,paramName:i,desc:ss("value")}),t=!1):(Vt({api:s,paramName:i,desc:Is("FriendCustomFieldPrefixLog")}),t=!1)),t}return!0}}},acceptFriendApplication:{userID:ds},refuseFriendApplication:{userID:ds},deleteFriendApplication:{userID:ds},createFriendGroup:{name:ds},deleteFriendGroup:{name:ds},addToFriendGroup:{name:ds,userIDList:_s},removeFromFriendGroup:{name:ds,userIDList:_s},renameFriendGroup:{oldName:ds,newName:ds},sendMessageReadReceipt:[{name:"messageList",type:"Array",validator:(e,t,s)=>Ve(e)?0!==e.length||(Vt({api:t,paramName:s,desc:Jt()}),!1):(Vt({api:t,paramName:s,desc:jt()}),!1)}],getMessageReadReceiptList:[{name:"messageList",type:"Array",validator:(e,t,s)=>Ve(e)?0!==e.length||(Vt({api:t,paramName:s,desc:Jt()}),!1):(Vt({api:t,paramName:s,desc:jt()}),!1)}],createTopicInCommunity:{groupID:ds,topicName:ds},deleteTopicFromCommunity:{groupID:ds,topicIDList:{type:"Array",validator:(e,t,s)=>!e||!!Ve(e)||(Vt({api:t,paramName:s,desc:jt()}),!1)}},updateTopicProfile:{groupID:ds,topicID:ds},getTopicList:{groupID:ds,topicIDList:{type:"Array",validator:(e,t,s)=>!e||!!Ve(e)||(Vt({api:t,paramName:s,desc:jt()}),!1)}},followUser:[{name:"userIDList",..._s}],unfollowUser:[{name:"userIDList",..._s}],getMyFollowingList:[{name:"startIndex",...ds,required:!1}],getMyFollowersList:[{name:"startIndex",...ds,required:!1}],getMutualFollowersList:[{name:"startIndex",...ds,required:!1}],getUserFollowInfo:[{name:"userIDList",..._s,required:!1}],checkFollowType:[{name:"userIDList",..._s}],addSignalingListener:[{name:"eventName",type:"String",validator:(e,t,s)=>"string"==typeof e&&0!==e.length||(Vt({api:t,paramName:s,desc:Kt(s)}),!1)},{name:"handler",type:"Function",validator:(e,t,s)=>"function"!=typeof e?(Vt({api:t,paramName:s,desc:zt()}),!1):(""===e.name&&Vt({api:t,paramName:s,desc:as()}),!0)}],removeSignalingListener:[{name:"eventName",type:"String",validator:(e,t,s)=>"string"==typeof e&&0!==e.length||(Vt({api:t,paramName:s,desc:Kt(s)}),!1)},{name:"handler",type:"Function",validator:(e,t,s)=>"function"!=typeof e?(Vt({api:t,paramName:s,desc:zt()}),!1):(""===e.name&&Vt({api:t,paramName:s,desc:as()}),!0)}],invite:{userID:ds},inviteSync:[{...hs,validator:(e,t,s)=>xe(e)?!!$e(e.userID)||(Vt({api:t,paramName:"options.userID",desc:Bt()}),!1):(Vt({api:t,paramName:"options",desc:is()}),!1)},{name:"successCb",type:"Function",required:!1,validator:(e,t,s)=>(Be(e)&&Vt({api:t,paramName:s,desc:zt()}),!0)},{name:"errorCb",type:"Function",required:!1,validator:(e,t,s)=>(Be(e)&&Vt({api:t,paramName:s,desc:zt()}),!0)}],inviteInGroup:{groupID:ds,inviteeList:_s},inviteInGroupSync:[{...hs,validator:(e,t,s)=>xe(e)?$e(e.groupID)?!!Ve(e.inviteeList)||(Vt({api:t,paramName:"options.inviteeList",desc:jt()}),!1):(Vt({api:t,paramName:"options.groupID",desc:Bt()}),!1):(Vt({api:t,paramName:"options",desc:is()}),!1)},{name:"successCb",type:"Function",required:!1,validator:(e,t,s)=>(Be(e)&&Vt({api:t,paramName:s,desc:zt()}),!0)},{name:"errorCb",type:"Function",required:!1,validator:(e,t,s)=>(Be(e)&&Vt({api:t,paramName:s,desc:zt()}),!0)}],accept:{inviteID:ds},reject:{inviteID:ds},getSignalingInfo:[{name:"message",...hs,validator:(e,t,s)=>!Ge(e)||(Vt({api:t,paramName:s,desc:rs()}),!1)}],modifyInvitation:{inviteID:ds,data:ds}},Ts={login:1,logout:1,getLoginUser:1,getServerTime:1,on:1,once:1,off:1,setLogLevel:1,registerPlugin:1,destroy:1,isReady:1,createTextMessage:1,createTextAtMessage:1,createImageMessage:1,createAudioMessage:1,createVideoMessage:1,createCustomMessage:1,createFaceMessage:1,createFileMessage:1,createLocationMessage:1,createMergerMessage:1,downloadMergerMessage:1,createForwardMessage:1,sendMessage:1,resendMessage:1,revokeMessage:1,deleteMessage:1,translateText:1,convertVoiceToText:1,modifyMessage:1,sendMessageReadReceipt:1,getGroupMessageReadMemberList:1,getMessageReadReceiptList:1,setMessageExtensions:1,getMessageExtensions:1,deleteMessageExtensions:1,addMessageReaction:1,removeMessageReaction:1,getMessageReactions:1,getAllUserListOfMessageReaction:1,getMessageList:1,findMessage:1,getMessageListHopping:1,setMessageRead:1,setAllMessageRead:1,getConversationList:1,getConversationProfile:1,deleteConversation:1,setConversationDraft:1,pinConversation:1,getTotalUnreadMessageCount:1,setConversationCustomData:1,markConversation:1,createConversationGroup:1,getConversationGroupList:1,deleteConversationGroup:1,renameConversationGroup:1,addConversationsToGroup:1,deleteConversationsFromGroup:1,clearHistoryMessage:1,setMessageRemindType:1,setAllReceiveMessageOpt:1,getAllReceiveMessageOpt:1,getGroupList:1,getGroupProfile:1,createGroup:1,joinGroup:1,updateGroupProfile:1,quitGroup:1,dismissGroup:1,changeGroupOwner:1,searchGroupByID:1,getGroupApplicationList:1,handleGroupApplication:1,pinGroupMessage:1,getPinnedGroupMessageList:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getJoinedCommunityList:1,createTopicInCommunity:1,deleteTopicFromCommunity:1,updateTopicProfile:1,getTopicList:1,getGroupMemberProfile:1,getGroupMemberList:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberNameCard:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberCustomField:1,getGroupOnlineMemberCount:1,markGroupMemberList:1,getMyProfile:1,getUserProfile:1,updateMyProfile:1,setSelfStatus:1,getUserStatus:1,subscribeUserStatus:1,unsubscribeUserStatus:1,getBlacklist:1,addToBlacklist:1,removeFromBlacklist:1,searchCloudMessages:1,searchCloudUsers:1,searchCloudGroups:1,searchCloudGroupMembers:1,getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,updateFriend:1,getFriendProfile:1,getFriendApplicationList:1,refuseFriendApplication:1,deleteFriendApplication:1,acceptFriendApplication:1,setFriendApplicationRead:1,getFriendGroupList:1,createFriendGroup:1,renameFriendGroup:1,deleteFriendGroup:1,addToFriendGroup:1,removeFromFriendGroup:1,followUser:1,unfollowUser:1,getMyFollowingList:1,getMyFollowersList:1,getMutualFollowersList:1,getUserFollowInfo:1,checkFollowType:1,callExperimentalAPI:1,addSignalingListener:1,removeSignalingListener:1,invite:1,inviteSync:1,inviteInGroup:1,inviteInGroupSync:1,cancel:1,accept:1,reject:1,getSignalingInfo:1,modifyInvitation:1},ys=1,vs=2,Es=3,Ss=4,Ds=6,Rs=7,Ls=8,As=10,Os=11,Ns=12,Ps=13,Us=14,Gs=15,ks=17,ws=18,bs=19,Fs=20,$s=21,qs=23,xs=24,Vs=25,Bs=26,Ks=27,Hs=28,Ws=29,Ys=30,zs=31,js=32,Js=33,Xs=34,Zs=35,Qs=36,ei=37,ti=38,si=function(e){return{code:0,data:e||{}}};class ii extends Error{constructor(e){super();var{code:e,message:t,data:s}=e;this.code=e,t?this.message=t:this._getErrMsg&&(this.message=this._getErrMsg(this.code)),this.data=s||{}}}let ni={NO_SDKAPPID:2e3,NO_ACCOUNT_TYPE:2001,NO_IDENTIFIER:2002,NO_USERSIG:2003,NO_TINYID:2022,NO_A2KEY:2023,USER_NOT_LOGGED_IN:2024,REPEAT_LOGIN:2025,COS_UNDETECTED:2040,COS_GET_SIG_FAIL:2041,MSG_SEND_FAIL:2100,MSG_SEND_FAIL_NOT_IN_AV:2101,MSG_INSTANCE_REQUIRED:2105,MSG_INVALID_CONV_TYPE:2106,MSG_F_IS_EMPTY:2108,MSG_ONPROGRESS_ERR:2109,MSG_REVOKE_FAIL:2110,MSG_DELETE_FAIL:2111,MSG_UNREAD_ALL_FAIL:2112,READ_RECEIPT_MSG_LIST_EMPTY:2114,MSG_SEND_GRP_WITH_TOPIC_FAIL:2115,CANNOT_DELETE_GRP_SYSTEM_NOTICE:2116,TRANSLATE_TEXT_FAIL:2117,VOICE_TO_TEXT_FAIL:2118,UNSUPPORTED_VOICE_FORMAT:2119,MSG_I_SELECT_F_FIRST:2251,MSG_I_TYPES_LIMIT:2252,MSG_I_SIZE_LIMIT:2253,MSG_A_UPLOAD_FAIL:2300,MSG_A_SIZE_LIMIT:2301,MSG_V_UPLOAD_FAIL:2350,MSG_V_SIZE_LIMIT:2351,MSG_V_TYPES_LIMIT:2352,MSG_F_UPLOAD_FAIL:2400,MSG_F_SELECT_F_FIRST:2401,MSG_F_SIZE_LIMIT:2402,MSG_F_URL_IS_EMPTY:2403,MSG_MERGER_TYPE_INVALID:2450,MSG_MERGER_KEY_INVALID:2451,MSG_MERGER_DOWNLOAD_FAIL:2452,MSG_FORWARD_TYPE_INVALID:2453,MSG_FORWARD_INVALID_ELEMENTS:2454,MSG_MODIFY_CONFLICT:2480,MSG_MODIFY_DISABLED_IN_AV:2481,CONV_NOT_FOUND:2500,USER_OR_GRP_NOT_FOUND:2501,CONV_UN_RECORDED_TYPE:2502,INVALID_CONV_ID:2503,ILLEGAL_GRP_TYPE:2600,ILLEGAL_GRP_ID:2602,CANNOT_FIND_GRP:2603,CANNOT_CHANGE_OWNER_IN_AV:2620,CANNOT_C