easemob-websdk 4.12.1 → 4.14.0
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/CHANGELOG.md +29 -4
- package/Easemob-chat.d.ts +104 -13
- package/Easemob-chat.js +1 -1
- package/chatroom/chatroom.d.ts +3 -3
- package/chatroom/chatroom.js +1 -1
- package/contact/contact.d.ts +7 -3
- package/contact/contact.js +1 -1
- package/group/group.d.ts +54 -3
- package/group/group.js +1 -1
- package/localCache/localCache.js +1 -1
- package/message/audio.d.ts +4 -0
- package/message/cmd.d.ts +3 -0
- package/message/combine.d.ts +3 -0
- package/message/file.d.ts +3 -0
- package/message/img.d.ts +3 -0
- package/message/location.d.ts +3 -0
- package/message/video.d.ts +3 -0
- package/miniCore/miniCore.d.ts +4 -0
- package/miniCore/miniCore.js +1 -1
- package/miniProgram/Easemob-chat.js +1 -1
- package/package.json +1 -1
- package/presence/presence.js +1 -1
- package/silent/silent.js +1 -1
- package/status.d.ts +4 -0
- package/thread/thread.js +1 -1
- package/translation/translation.js +1 -1
- package/types/groupApi.d.ts +6 -0
- package/types/indexApi.d.ts +3 -3
- package/types/message.d.ts +10 -2
- package/uniApp/Easemob-chat.js +1 -1
package/Easemob-chat.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.websdk=t():e.websdk=t()}(self,(function(){return function(){var __webpack_modules__={4537:function(e){"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,o=2,i=!0;o<arguments.length;)r[n++]=arguments[o++];return new Promise((function(o,a){r[n]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,a(e))}}))}},7419:function(e,t){"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),o=new Array(123),i=0;i<64;)o[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r.encode=function(e,t,r){for(var o,i=null,a=[],s=0,c=0;t<r;){var u=e[t++];switch(c){case 0:a[s++]=n[u>>2],o=(3&u)<<4,c=1;break;case 1:a[s++]=n[o|u>>4],o=(15&u)<<2,c=2;break;case 2:a[s++]=n[o|u>>6],a[s++]=n[63&u],c=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=n[o],a[s++]=61,1===c&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";r.decode=function(e,t,r){for(var n,i=r,s=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&s>1)break;if(void 0===(u=o[u]))throw Error(a);switch(s){case 0:n=u,s=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,s=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,s=3;break;case 3:t[r++]=(3&n)<<6|u,s=0}}if(1===s)throw Error(a);return r-i},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},5124:function(e){"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function o(e){if("string"!=typeof e){var r=i();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var a=Object.keys(e),s=new Array(a.length+1),c=new Array(a.length),u=0;u<a.length;)s[u]=a[u],c[u]=e[a[u++]];return s[u]=r,Function.apply(null,s).apply(null,c)}return Function(r)()}for(var l=new Array(arguments.length-1),d=0;d<l.length;)l[d]=arguments[++d];if(d=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=l[d++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),d!==l.length)throw Error("parameter count mismatch");return n.push(e),o}function i(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return o.toString=i,o}e.exports=t,t.verbose=!1},9211:function(e){"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},9054:function(e,t,r){"use strict";e.exports=i;var n=r(4537),o=r(7199)("fs");function i(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&o&&o.readFile?o.readFile(e,(function(n,o){return n&&"undefined"!=typeof XMLHttpRequest?i.xhr(e,t,r):n?r(n):r(null,t.binary?o:o.toString("utf8"))})):i.xhr(e,t,r):n(i,this,e,t)}i.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var o=0;o<n.responseText.length;++o)e.push(255&n.responseText.charCodeAt(o))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},945:function(e){"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3]}function i(e,n,o){t[0]=e,n[o]=r[3],n[o+1]=r[2],n[o+2]=r[1],n[o+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?o:i,e.writeFloatBE=n?i:o,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function t(e,t,r,n){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),o=2*(n>>31)+1,i=n>>>23&255,a=8388607&n;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=a.bind(null,o),e.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3],n[o+4]=r[4],n[o+5]=r[5],n[o+6]=r[6],n[o+7]=r[7]}function i(e,n,o){t[0]=e,n[o]=r[7],n[o+1]=r[6],n[o+2]=r[5],n[o+3]=r[4],n[o+4]=r[3],n[o+5]=r[2],n[o+6]=r[1],n[o+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?o:i,e.writeDoubleBE=n?i:o,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function t(e,t,r,n,o,i){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,o,i+t),e(1/n>0?0:2147483648,o,i+r);else if(isNaN(n))e(0,o,i+t),e(2146959360,o,i+r);else if(n>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=n*Math.pow(2,-c))>>>0,o,i+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,o,i+r)}}}function a(e,t,r,n,o){var i=e(n,o+t),a=e(n,o+r),s=2*(a>>31)+1,c=a>>>20&2047,u=4294967296*(1048575&a)+i;return 2047===c?u?NaN:s*(1/0):0===c?5e-324*s*u:s*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=a.bind(null,o,0,4),e.readDoubleBE=a.bind(null,i,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:function(module){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},8626:function(e,t){"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),o="";r&&(o=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):r?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return o+t.join("/")};r.resolve=function(e,t,r){return r||(t=o(t)),n(t)?t:(r||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},6662:function(e){"use strict";e.exports=function(e,t,r){var n=r||8192,o=n>>>1,i=null,a=n;return function(r){if(r<1||r>o)return e(r);a+r>n&&(i=e(n),a=0);var s=t.call(i,a,a+=r);return 7&a&&(a=1+(7|a)),s}}},4997:function(e,t){"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,o=null,i=[],a=0;t<r;)(n=e[t++])<128?i[a++]=n:n>191&&n<224?i[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(n>>10),i[a++]=56320+(1023&n)):i[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},r.write=function(e,t,r){for(var n,o,i=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(o=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&o),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-i}},4188:function(e,t,r){var n,o,i;!function(a){"use strict";if(null!=t&&"number"!=typeof t.nodeType)e.exports=a();else if(null!=r.amdO)o=[],void 0===(i="function"==typeof(n=a)?n.apply(t,o):n)||(e.exports=i);else{var s=a(),c="undefined"!=typeof self?self:$.global;"function"!=typeof c.btoa&&(c.btoa=s.btoa),"function"!=typeof c.atob&&(c.atob=s.atob)}}((function(){"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function t(e){this.message=e}return t.prototype=new Error,t.prototype.name="InvalidCharacterError",{btoa:function(r){for(var n,o,i=String(r),a=0,s=e,c="";i.charAt(0|a)||(s="=",a%1);c+=s.charAt(63&n>>8-a%1*8)){if((o=i.charCodeAt(a+=3/4))>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|o}return c},atob:function(r){var n=String(r).replace(/[=]+$/,"");if(n.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,i,a=0,s=0,c="";i=n.charAt(s++);~i&&(o=a%4?64*o+i:i,a++%4)?c+=String.fromCharCode(255&o>>(-2*a&6)):0)i=e.indexOf(i);return c}}}))},9667:function(e,t,r){"use strict";r.r(t),r.d(t,{addUsersToChatRoom:function(){return E},addUsersToChatRoomAllowlist:function(){return V},addUsersToChatRoomWhitelist:function(){return z},blockChatRoomMember:function(){return P},blockChatRoomMembers:function(){return L},chatRoomBlockMulti:function(){return x},chatRoomBlockSingle:function(){return U},createChatRoom:function(){return l},deleteChatRoomSharedFile:function(){return ie},destroyChatRoom:function(){return d},disableSendChatRoomMsg:function(){return q},enableSendChatRoomMsg:function(){return K},fetchChatRoomAnnouncement:function(){return re},fetchChatRoomSharedFileList:function(){return ae},getChatRoomAdmin:function(){return R},getChatRoomAllowlist:function(){return Q},getChatRoomAttributes:function(){return ce},getChatRoomBlacklist:function(){return F},getChatRoomBlacklistNew:function(){return H},getChatRoomBlocklist:function(){return W},getChatRoomDetails:function(){return p},getChatRoomMuteList:function(){return w},getChatRoomMuted:function(){return M},getChatRoomMutelist:function(){return k},getChatRoomSharedFilelist:function(){return se},getChatRoomWhitelist:function(){return Y},getChatRooms:function(){return u},getJoinedChatRooms:function(){return he},isChatRoomWhiteUser:function(){return $},isInChatRoomAllowlist:function(){return ee},isInChatRoomMutelist:function(){return te},joinChatRoom:function(){return y},leaveChatRoom:function(){return T},listChatRoomMember:function(){return I},listChatRoomMembers:function(){return O},modifyChatRoom:function(){return h},muteChatRoomMember:function(){return S},quitChatRoom:function(){return _},removeChatRoomAdmin:function(){return N},removeChatRoomAllowlistMember:function(){return Z},removeChatRoomAttribute:function(){return pe},removeChatRoomAttributes:function(){return de},removeChatRoomBlockMulti:function(){return G},removeChatRoomBlockSingle:function(){return D},removeChatRoomMember:function(){return m},removeChatRoomMembers:function(){return v},removeChatRoomWhitelistMember:function(){return J},removeMultiChatRoomMember:function(){return g},removeMuteChatRoomMember:function(){return b},removeSingleChatRoomMember:function(){return f},rmUsersFromChatRoomWhitelist:function(){return X},setChatRoomAdmin:function(){return C},setChatRoomAttribute:function(){return le},setChatRoomAttributes:function(){return ue},unblockChatRoomMember:function(){return j},unblockChatRoomMembers:function(){return B},unmuteChatRoomMember:function(){return A},updateChatRoomAnnouncement:function(){return ne},uploadChatRoomSharedFile:function(){return oe}}),r(1539),r(8674),r(8309),r(2526),r(1817),r(2222),r(9753),r(9600),r(1249),r(4916),r(3123),r(2165),r(6992),r(8783),r(3948);var n=r(5531),o=r(4024),i=r(3246),a=r(7360),s=r(1595);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e){var t=this;if("number"!=typeof e.pagenum||"number"!=typeof e.pagesize)throw Error("Invalid parameter");var r=i.XZ.call(this).error;if(r)return Promise.reject(r);var c={pagenum:e.pagenum||1,pagesize:e.pagesize||20},u=this.context,l=u.orgName,d=u.appName,p=u.accessToken,h={url:this.apiUrl+"/"+l+"/"+d+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+p},data:c,success:function(t){"function"==typeof e.success&&e.success(t)},error:function(r){r.error&&r.error_description&&t.onError&&t.onError({type:n.E.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:r.error_description,data:r}),"function"==typeof e.error&&e.error(r)}};return a.kg.debug("Call getChatRooms",e),o.hj.call(this,h,s.fI.GET_CHATROOM_LIST)}function l(e){if("string"!=typeof e.name)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r={name:e.name,description:e.description,maxusers:e.maxusers,owner:this.user,members:e.members},n=this.context,c=n.orgName,u=n.appName,l=n.accessToken,d=n.jid,p={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/chatrooms?resource=").concat(d.clientResource),dataType:"json",type:"POST",data:JSON.stringify(r),headers:{Authorization:"Bearer "+(e.token||l),"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call createChatRoom",e),o.hj.call(this,p,s.fI.CREATE_CHATROOM)}function d(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(e.chatRoomId,"?resource=").concat(l.clientResource,"&version=v3"),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+(e.token||u)},success:e.success,error:e.error};return a.kg.debug("Call destroyChatRoom",e),o.hj.call(this,d,s.fI.DESTROY_CHATROOM)}function p(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getChatRoomDetails",e),o.hj.call(this,l,s.fI.GET_CHATROOM_DETAIL)}function h(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={groupname:e.chatRoomName,description:e.description,maxusers:e.maxusers},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"?resource=").concat(l.clientResource),type:"PUT",data:JSON.stringify(p),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call modifyChatRoom",e),o.hj.call(this,h,s.fI.MODIFY_CHATROOM)}function f(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||"string"!=typeof e.username)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeChatRoomMember",e),o.hj.call(this,h,s.fI.REMOVE_CHATROOM_MEMBER)}var m=f;function g(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=e.chatRoomId,n=e.users.join(","),c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.jid,h={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatrooms/").concat(r,"/users/").concat(n,"?resource=").concat(p.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+d,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeChatRoomMembers",e),o.hj.call(this,h,s.fI.MULTI_REMOVE_CHATROOM_MEMBER)}var v=g;function E(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=e.chatRoomId,n={usernames:e.users},c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.jid,h={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatrooms/").concat(r,"/users?resource=").concat(p.clientResource),type:"POST",data:JSON.stringify(n),dataType:"json",headers:{Authorization:"Bearer "+d,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call addUsersToChatRoom",e),o.hj.call(this,h,s.fI.ADD_USERS_TO_CHATROOM)}function y(e){var t=e.roomId,r=e.message,o=void 0===r?"":r,s=e.ext,c=void 0===s?"":s,u=e.leaveOtherRooms,l=void 0!==u&&u,d=e.success,p=e.error;if("string"!=typeof t||""===t)throw Error("Invalid parameter roomId");if("string"!=typeof c)throw Error("Invalid parameter ext");if("boolean"!=typeof l)throw Error("Invalid parameter leaveOtherRooms");var h=i.XZ.call(this).error;return h?Promise.reject(h):(a.kg.debug("Call joinChatRoom",e),this.logOut?Promise.reject({type:n.E.WEBIM_CONNECTION_CLOSED,message:"not login"}):this.mSync.handleChatRoom({roomId:t,ext:c,leaveOtherRooms:l,message:o,success:d,errorCb:p},"join"))}function _(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");var t=i.XZ.call(this).error;return t?Promise.reject(t):(a.kg.debug("Call leaveChatRoom",e),this.logOut?Promise.reject({type:n.E.WEBIM_CONNECTION_CLOSED,message:"not login"}):this.mSync.handleChatRoom(e,"leave"))}var T=_;function I(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r={pagenum:e.pageNum,pagesize:e.pageSize},n=this.context,c=n.orgName,u=n.appName,l=n.accessToken,d={url:this.apiUrl+"/"+c+"/"+u+"/chatrooms/"+e.chatRoomId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call listChatRoomMembers",e),o.hj.call(this,d,s.fI.LIST_CHATROOM_MEMBERS)}var O=I;function R(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.chatRoomId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+l+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getChatRoomAdmin",e),o.hj.call(this,d,s.fI.GET_CHATROOM_ADMIN)}function C(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={newadmin:e.username},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/admin?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call setChatRoomAdmin",e),o.hj.call(this,h,s.fI.SET_CHATROOM_ADMIN)}function N(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/admin/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeChatRoomAdmin",e),o.hj.call(this,h,s.fI.REMOVE_CHATROOM_ADMIN)}function S(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={usernames:[e.username],mute_duration:e.muteDuration},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/mute?resource=").concat(l.clientResource),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},data:JSON.stringify(p),success:e.success,error:e.error};return a.kg.debug("Call muteChatRoomMember",e),o.hj.call(this,h,s.fI.MUTE_CHATROOM_MEMBER)}function b(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/mute/").concat(p,"?resource=").concat(l.clientResource),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call unmuteChatRoomMember",e),o.hj.call(this,h,s.fI.REMOVE_MUTE_CHATROOM_MEMBER)}var A=b;function M(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.chatRoomId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+l+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getChatRoomMutelist",e),o.hj.call(this,d,s.fI.GET_MUTE_CHATROOM_MEMBERS)}var w=M,k=M;function U(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call blockChatRoomMember",e),o.hj.call(this,h,s.fI.SET_CHATROOM_MEMBER_TO_BLACK)}var P=U;function x(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={usernames:e.usernames},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/blocks/users?resource=").concat(l.clientResource),data:JSON.stringify(p),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Chat blockChatRoomMembers:",h),o.hj.call(this,h,s.fI.MULTI_SET_CHATROOM_MEMBER_TO_BLACK)}var L=x;function D(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call unblockChatRoomMember",e),o.hj.call(this,h,s.fI.REMOVE_CHATROOM_MEMBER_BLACK)}var j=D;function G(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.usernames.join(","),h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call unblockChatRoomMembers",e),o.hj.call(this,h,s.fI.MULTI_REMOVE_CHATROOM_MEMBER_BLACK)}var B=G;function H(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.chatRoomId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+l+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getChatRoomBlocklist",e),o.hj.call(this,d,s.fI.GET_CHATROOM_BLOCK_MEMBERS)}var F=H,W=H;function q(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/ban?resource=").concat(l.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call disableSendChatRoomMsg",e),o.hj.call(this,p,s.fI.DISABLED_CHATROOM_SEND_MSG)}function K(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/ban?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call enableSendChatRoomMsg",e),o.hj.call(this,p,s.fI.ENABLE_CHATROOM_SEND_MSG)}function z(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={usernames:e.users},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/white/users?resource=").concat(l.clientResource),type:"POST",data:JSON.stringify(p),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call addUsersToChatRoomWhitelist",e),o.hj.call(this,h,s.fI.ADD_USERS_TO_CHATROOM)}var V=z;function X(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/white/users/").concat(e.userName,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeChatRoomAllowlistMember",e),o.hj.call(this,p,s.fI.REMOVE_CHATROOM_WHITE_USERS)}var J=X,Z=X;function Y(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.chatRoomId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+l+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getChatRoomAllowlist",e),o.hj.call(this,d,s.fI.GET_CHATROOM_WHITE_USERS)}var Q=Y;function $(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.chatRoomId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+l+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call isInChatRoomAllowlist",e),o.hj.call(this,d,s.fI.CHECK_CHATROOM_WHITE_USER)}var ee=$;function te(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,s=r.appName,c=r.accessToken,u=r.userId,l={url:this.apiUrl+"/"+n+"/"+s+"/sdk/chatrooms/"+e.chatRoomId+"/mute/"+u,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+c}};return a.kg.debug("Call isInChatRoomMutelist",e),o.hj.call(this,l).then((function(e){return{type:e.type,data:e.data}}))}function re(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.roomId,d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(l,"/announcement"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call fetchChatRoomAnnouncement",e),o.hj.call(this,d,s.fI.GET_CHATROOM_ANN)}function ne(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.roomId,p={announcement:e.announcement},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/announcement?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call updateChatRoomAnnouncement:",e),o.hj.call(this,h,s.fI.UPDATE_CHATROOM_ANN)}function oe(e){var t;if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("object"!==c(e.file))throw Error('Invalid parameter: "file"');var r=i.XZ.call(this).error;if(r)return null===(t=e.onFileUploadError)||void 0===t?void 0:t.call(e,r);var n=this.context,u=n.orgName,l=n.appName,d=n.accessToken,p=n.jid,h=e.roomId;o.cT.call(this,{uploadUrl:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatrooms/").concat(h,"/share_files?resource=").concat(p.clientResource),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:d,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey},s.fI.UPLOAD_CHATROOM_FILE),a.kg.debug("Call uploadChatRoomSharedFile",e)}function ie(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "fileId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.roomId,p=e.fileId,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/share_files/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call deleteChatRoomSharedFile",e),o.hj.call(this,h,s.fI.DELETE_CHATROOM_FILE)}function ae(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.roomId,d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(l,"/share_files"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json",accept:"application/json"},success:e.success,error:e.error};return a.kg.debug("Call fetchChatRoomSharedFileList",e),o.hj.call(this,d,s.fI.GET_CHATROOM_FILES)}var se=ae;function ce(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if(e.attributeKeys&&!Array.isArray(e.attributeKeys))throw Error('"Invalid parameter attributeKeys": '+e.attributeKeys);var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=(r.jid,e.chatRoomId),d={keys:e.attributeKeys},p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/metadata/chatroom/").concat(l),type:"POST",dataType:"json",data:JSON.stringify(d),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}};return a.kg.debug("Call getChatRoomAttributes:",e),o.hj.call(this,p,s.fI.GET_CHATROOM_ATTR).then((function(e){return{data:e.data,type:e.type}}))}function ue(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("object"!==c(e.attributes))throw Error("Invalid parameter attributes: "+e.attributes);var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,u=r.appName,l=r.accessToken,d=r.userId,p=e.chatRoomId,h=e.attributes,f=e.autoDelete,m=void 0===f||f,g=e.isForced?"/forced":"",v={metaData:h,autoDelete:m?"DELETE":"NO_DELETE"},E={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(u,"/metadata/chatroom/").concat(p,"/user/").concat(d)+g,type:"PUT",dataType:"json",data:JSON.stringify(v),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"}};return a.kg.debug("Call setChatRoomAttributes:",e),o.hj.call(this,E,s.fI.SET_CHATROOM_ATTR).then((function(e){return(0,i._W)(e)}))}function le(e){var t;if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("string"!=typeof e.attributeKey||""===e.attributeKey)throw Error("Invalid parameter attributeKey: "+e.attributeKey);if("string"!=typeof e.attributeValue||""===e.attributeValue)throw Error("Invalid parameter attributeValue: "+e.attributeValue);var r=i.XZ.call(this).error;if(r)return Promise.reject(r);var n=this.context,c=n.orgName,u=n.appName,l=n.accessToken,d=n.userId,p=e.chatRoomId,h=e.attributeKey,f=e.attributeValue,m=e.autoDelete,g=void 0===m||m,v=e.isForced?"/forced":"",E={metaData:(t={},t[h]=f,t),autoDelete:g?"DELETE":"NO_DELETE"},y={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/metadata/chatroom/").concat(p,"/user/").concat(d)+v,type:"PUT",dataType:"json",data:JSON.stringify(E),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"}};return a.kg.debug("Call setChatRoomAttribute:",e),o.hj.call(this,y,s.fI.SET_CHATROOM_ATTR).then((function(e){var t=(0,i.H7)(e);if(t)throw t}))}function de(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if(!Array.isArray(e.attributeKeys))throw Error('"Invalid parameter attributes": '+e.attributeKeys);var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.userId,d=e.chatRoomId,p=e.attributeKeys,h=e.isForced?"/forced":"",f={keys:p},m={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/metadata/chatroom/").concat(d,"/user/").concat(l)+h,type:"DELETE",dataType:"json",data:JSON.stringify(f),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}};return a.kg.debug("Call removeChatRoomAttributes:",e),o.hj.call(this,m,s.fI.DELETE_CHATROOM_ATTR).then((function(e){return(0,i._W)(e)}))}function pe(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("string"!=typeof e.attributeKey||""===e.attributeKey)throw Error('"Invalid parameter attributeKey": '+e.attributeKey);var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.userId,d=e.chatRoomId,p=e.attributeKey,h=e.isForced?"/forced":"",f={keys:[p]},m={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/metadata/chatroom/").concat(d,"/user/").concat(l)+h,type:"DELETE",dataType:"json",data:JSON.stringify(f),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}};return a.kg.debug("Call removeChatRoomAttribute:",e),o.hj.call(this,m,s.fI.DELETE_CHATROOM_ATTR).then((function(e){var t=(0,i.H7)(e);if(t)throw t}))}function he(e){var t=this,r=e||{},n=r.pageNum,c=r.pageSize;if(isNaN(n)||n<=0)throw Error("Invalid parameter pageNum:".concat(n));if(isNaN(c)||c<=0)throw Error("Invalid parameter pageSize:".concat(c));var u=i.XZ.call(this).error;if(u)return Promise.reject(u);var l={pagenum:n,pagesize:c,detail:!0},d=this.context,p=d.orgName,h=d.appName,f=d.accessToken,m={url:"".concat(this.apiUrl,"/").concat(p,"/").concat(h,"/users/").concat(this.user,"/joined_chatrooms"),dataType:"json",type:"GET",data:l,headers:{Authorization:"Bearer "+f,"Content-Type":"application/json"}};return a.kg.debug("Call getJoinedChatRooms",e),o.hj.call(this,m,s.fI.GET_USER_JOINED_CHATROOM).then((function(e){var r=(e.data||[]).map((function(e){var r=e.id,n=e.title,o=e.owner,i=e.created,a=e.description,s=e.max_users;return{id:r,name:n,owner:o.split("".concat(t.appKey,"_"))[1],created:i,description:a,maxusers:s}}));return{type:e.type,data:r}}))}},4363:function(e,t,r){"use strict";r.d(t,{U:function(){return s},w:function(){return c}}),r(9601),r(2772),r(1249);var n=r(7360),o=r(8161),i=r(4024),a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)},s={chat:"singleChat",chatroom:"chatRoom",groupchat:"groupChat",singleChat:"singleChat",chatRoom:"chatRoom",groupChat:"groupChat"};function c(e,t){var r,c,u,l=t||{},d=l.formatCustomExts,p=void 0===d||d,h=l.formatChatType,f=void 0!==h&&h,m=e.id,g=e.payload,v=e.timestamp,E=e.to,y=g.bodies&&g.bodies.length>0?g.bodies[0]:{},_={},T={},I=g.type?g.type:E.indexOf("@conference.easemob.com")>-1?"groupChat":"singleChat";I="chat"===I?"singleChat":I,f&&g.type&&(I=s[g.type]);var O="";switch(y.type){case"txt":if(Object.prototype.hasOwnProperty.call(y,"subType")&&"sub_combine"===y.subType)O=o.t.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"combine",chatType:I,to:g.to,from:g.from,ext:g.ext,time:v,title:y.title||"",summary:y.summary||"",url:O||"",secret:y.secret||"",file_length:y.file_length||0,filename:y.filename||"",compatibleText:y.msg,combineLevel:y.combineLevel||0};else{var R=null===(r=null==g?void 0:g.meta)||void 0===r?void 0:r.edit_msg;if(_={id:m,type:"txt",chatType:I,msg:y.msg||"",to:g.to||"",from:g.from,time:v,ext:g.ext},R){var C=R.edit_time,N=R.operator,S=R.count;_.modifiedInfo={operationTime:C,operatorId:N,operationCount:S}}}break;case"img":O=this.useOwnUploadFun?null==y?void 0:y.url:o.t.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"img",chatType:I,to:g.to,from:g.from,time:v,ext:g.ext,width:(null===(c=y.size)||void 0===c?void 0:c.width)||0,height:(null===(u=y.size)||void 0===u?void 0:u.height)||0,thumb:this.useOwnUploadFun?"":"".concat(O,"&thumbnail=true"),thumb_secret:y.secret,secret:y.secret||"",url:O||"",file_length:y.file_length||0,file:{}};break;case"video":O=this.useOwnUploadFun?null==y?void 0:y.url:o.t.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"video",chatType:I,from:g.from,to:g.to,thumb:i.P6.formatAttachUrl.call(this,y.thumb),thumb_secret:y.thumb_secret||"",url:O||"",secret:y.secret||"",filename:y.filename,length:y.length||0,file:{},file_length:y.file_length||0,filetype:g.ext.file_type||"",ext:g.ext,time:v};break;case"loc":_={id:m,type:"loc",chatType:I,from:g.from,to:g.to,buildingName:y.buildingName||"",addr:y.addr,lat:y.lat,lng:y.lng,ext:g.ext,time:v};break;case"audio":O=this.useOwnUploadFun?null==y?void 0:y.url:o.t.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"audio",chatType:I,from:g.from,to:g.to,secret:y.secret||"",ext:g.ext,time:v,url:O||"",file:{},filename:y.filename,length:y.length||0,file_length:y.file_length||0,filetype:g.ext.file_type||""};break;case"file":O=this.useOwnUploadFun?null==y?void 0:y.url:o.t.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"file",chatType:I,from:g.from,to:g.to,ext:g.ext,time:v,url:O||"",secret:y.secret||"",file:{},filename:y.filename||"",file_length:y.file_length||0,filetype:g.ext.file_type||""};break;case"cmd":_={id:m,type:"cmd",chatType:I,from:g.from,to:g.to,ext:g.ext,time:v,action:y.action||""};break;case"custom":var b=y.customExts||{};p&&y.customExts&&(b={},y.customExts.map((function(e){b=a(a({},b),e)}))),_={id:m,type:"custom",chatType:I,from:g.from,to:g.to,ext:g.ext,time:v,customEvent:y.customEvent||"",customExts:b};break;case"combine":O=o.t.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"combine",chatType:I,msg:y.msg||"",to:g.to||"",from:g.from,time:v,ext:g.ext,title:y.title||"",summary:y.summary||"",url:O||"",compatibleText:y.text,combineLevel:y.combineLevel||0,secret:y.secret||"",filename:y.filename||"",file_length:y.file_length||0};break;default:n.kg.error("unexpected message: ".concat(e))}if(g.msgConfig&&(T.msgConfig=g.msgConfig),null==g?void 0:g.meta){var A=g.meta;A.thread&&(T.chatThread={messageId:A.thread.msg_parent_id,parentId:A.thread.muc_parent_id,chatThreadName:A.thread.thread_name}),A.reaction&&(T.reactions=A.reaction),A.translations&&(T.translations=A.translations)}return a(a({},_),T)}},2856:function(e,t,r){"use strict";r.r(t),r.d(t,{acceptGroupInvite:function(){return H},acceptGroupJoinRequest:function(){return D},addUsersToGroupAllowlist:function(){return me},addUsersToGroupWhitelist:function(){return fe},agreeInviteIntoGroup:function(){return B},agreeJoinGroup:function(){return L},blockGroup:function(){return p},blockGroupMember:function(){return re},blockGroupMembers:function(){return oe},blockGroupMessages:function(){return h},changeGroupOwner:function(){return y},changeOwner:function(){return E},createGroup:function(){return d},createGroupNew:function(){return l},deleteGroupSharedFile:function(){return Ae},destroyGroup:function(){return M},disableSendGroupMsg:function(){return pe},dissolveGroup:function(){return A},downloadGroupSharedFile:function(){return ke},enableSendGroupMsg:function(){return he},fetchGroupAnnouncement:function(){return Ne},fetchGroupSharedFileList:function(){return Me},getGroup:function(){return g},getGroupAdmin:function(){return R},getGroupAllowlist:function(){return _e},getGroupBlacklist:function(){return le},getGroupBlacklistNew:function(){return ue},getGroupBlocklist:function(){return de},getGroupInfo:function(){return _},getGroupMemberAttributes:function(){return Pe},getGroupMembersAttributes:function(){return xe},getGroupMsgReadUser:function(){return Ce},getGroupMuteList:function(){return $},getGroupMutelist:function(){return ee},getGroupSharedFilelist:function(){return we},getGroupWhitelist:function(){return ye},getJoinedGroups:function(){return v},getMuted:function(){return Q},getPublicGroups:function(){return m},groupBlockMulti:function(){return ne},groupBlockSingle:function(){return te},inviteToGroup:function(){return U},inviteUsersToGroup:function(){return P},isGroupWhiteUser:function(){return Te},isInGroupAllowlist:function(){return Oe},isInGroupMutelist:function(){return Re},isInGroupWhiteList:function(){return Ie},joinGroup:function(){return x},leaveGroup:function(){return k},listGroupMember:function(){return I},listGroupMembers:function(){return O},listGroups:function(){return f},modifyGroup:function(){return T},mute:function(){return X},muteGroupMember:function(){return J},quitGroup:function(){return w},rejectGroupInvite:function(){return W},rejectGroupJoinRequest:function(){return G},rejectInviteIntoGroup:function(){return F},rejectJoinGroup:function(){return j},removeAdmin:function(){return S},removeGroupAdmin:function(){return b},removeGroupAllowlistMember:function(){return Ee},removeGroupBlockMulti:function(){return se},removeGroupBlockSingle:function(){return ie},removeGroupMember:function(){return K},removeGroupMembers:function(){return V},removeGroupWhitelistMember:function(){return ve},removeMultiGroupMember:function(){return z},removeMute:function(){return Z},removeSingleGroupMember:function(){return q},rmUsersFromGroupWhitelist:function(){return ge},setAdmin:function(){return C},setGroupAdmin:function(){return N},setGroupMemberAttributes:function(){return Ue},unblockGroupMember:function(){return ae},unblockGroupMembers:function(){return ce},unmuteGroupMember:function(){return Y},updateGroupAnnouncement:function(){return Se},uploadGroupSharedFile:function(){return be}}),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(2222),r(6699),r(2023),r(9554),r(4747),r(8309),r(9753),r(9600);var n=r(4024),o=r(3246),i=r(7360),a=r(1595);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var c=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},u=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function l(e){if(!e||!e.data)throw Error("Invalid parameter");var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups?resource=").concat(l.clientResource),dataType:"json",type:"POST",data:JSON.stringify({owner:this.user,groupname:e.data.groupname,desc:e.data.desc,members:e.data.members,public:e.data.public,approval:e.data.approval,allowinvites:e.data.allowinvites,invite_need_confirm:e.data.inviteNeedConfirm,maxusers:e.data.maxusers,custom:e.data.ext}),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:function(t){e.success&&e.success(t)},error:e.error};return i.kg.debug("Call createGroup:",e),n.hj.call(this,d,a.fI.CREATE_GROUP)}var d=l;function p(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");var r=o.XZ.call(this).error;if(r)return Promise.reject(r);var s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d=s.jid,p={entities:[(t={},t["notification_ignore_"+e.groupId]=!0,t)]},h={type:"PUT",url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(this.user,"?resource=").concat(d.clientResource),data:JSON.stringify(p),dataType:"json",headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call blockGroupMessages",e),n.hj.call(this,h,a.fI.BLOCK_GROUP)}var h=p;function f(e){if("number"!=typeof e.limit)throw Error("Invalid parameter");var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l={limit:e.limit,cursor:e.cursor};e.cursor||delete l.cursor;var d={url:this.apiUrl+"/"+s+"/"+c+"/publicchatgroups",type:"GET",dataType:"json",data:l,headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call listGroups",e),n.hj.call(this,d,a.fI.LIST_GROUP)}var m=f;function g(e){var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l={url:this.apiUrl+"/"+s+"/"+c+"/users/"+this.user+"/joined_chatgroups",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return i.kg.debug("Call getJoinedGroups",e),n.hj.call(this,l,a.fI.GET_USER_GROUP)}function v(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=e.needAffiliations||e.needRole?"/chatgroups/user/".concat(this.user,"?pagenum=").concat(e.pageNum,"&pagesize=").concat(e.pageSize,"&needAffiliations=").concat(e.needAffiliations,"&needRole=").concat(e.needRole):"/users/".concat(this.user,"/joined_chatgroups?pagenum=").concat(e.pageNum,"&pagesize=").concat(e.pageSize),d={url:this.apiUrl+"/"+s+"/"+c+l,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return i.kg.debug("Call getGroup",e),n.hj.call(this,d,a.fI.GET_USER_GROUP).then((function(e){var t=e.uri,r=e.entities,n=[];return t.includes("joined_chatgroups")||(r.forEach((function(e){var t={affiliationsCount:e.affiliations_count,groupName:e.name,groupId:e.groupId,role:e.permission,disabled:e.disabled,approval:e.membersonly,allowInvites:e.allowinvites,description:e.description,maxUsers:e.maxusers,public:e.public};n.push(t)})),e.entities=n),e}))}function E(e){if("string"!=typeof e.groupId||"string"!=typeof e.newOwner)throw Error("Invalid parameter");var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r={newowner:e.newOwner},s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d=s.jid,p={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/chatgroups/").concat(e.groupId,"?resource=").concat(d.clientResource),type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},data:JSON.stringify(r),success:e.success,error:e.error};return i.kg.debug("Call changeOwner",e),n.hj.call(this,p,a.fI.CHANGE_OWNER)}var y=E;function _(e){if("string"!=typeof e.groupId&&!Array.isArray(e.groupId))throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l={url:this.apiUrl+"/"+s+"/"+c+"/chatgroups/"+e.groupId+"?joined_time=true",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getGroupInfo",e),n.hj.call(this,l,a.fI.GET_GROUP_INFO)}function T(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={groupname:e.groupName,description:e.description,custom:e.ext},h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"?resource=").concat(l.clientResource),type:"PUT",data:JSON.stringify(p),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call modifyGroup",e),n.hj.call(this,h,a.fI.MODIFY_GROUP)}function I(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r={pagenum:e.pageNum,pagesize:e.pageSize},s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d={url:this.apiUrl+"/"+c+"/"+u+"/chatgroups/"+e.groupId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call listGroupMember",e),n.hj.call(this,d,a.fI.LIST_GROUP_MEMBER)}var O=I;function R(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:this.apiUrl+"/"+s+"/"+c+"/chatgroups/"+l+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getGroupAdmin",e),n.hj.call(this,d,a.fI.GET_GROUP_ADMIN)}function C(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={newadmin:e.username},h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/admin?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call setGroupAdmin",e),n.hj.call(this,h,a.fI.SET_GROUP_ADMIN)}var N=C;function S(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/admin/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call removeAdmin",e),n.hj.call(this,h,a.fI.REMOVE_GROUP_ADMIN)}var b=S;function A(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"?version=v3&resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call destroyGroup",e),n.hj.call(this,p,a.fI.DISSOLVE_GROUP)}var M=A;function w(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/quit?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call quitGroup",e),n.hj.call(this,p,a.fI.QUIT_GROUP)}var k=w;function U(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=e.groupId,s={usernames:e.users},c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.jid,h={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatgroups/").concat(r,"/invite?resource=").concat(p.clientResource),type:"POST",data:JSON.stringify(s),dataType:"json",headers:{Authorization:"Bearer "+d,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call inviteUsersToGroup",e),n.hj.call(this,h,a.fI.INVITE_TO_GROUP)}var P=U;function x(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(e.groupId,"/apply?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify({message:e.message||""}),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call joinGroup",e),n.hj.call(this,d,a.fI.JOIN_GROUP)}function L(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={applicant:e.applicant,verifyResult:!0,reason:"no clue"},h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/apply_verify?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call agreeJoinGroup",e),n.hj.call(this,h,a.fI.AGREE_JOIN_GROUP)}var D=L;function j(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={applicant:e.applicant,verifyResult:!1,reason:e.reason||""},h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/apply_verify?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call rejectGroupJoinRequest",e),n.hj.call(this,h,a.fI.REJECT_JOIN_GROUP)}var G=j;function B(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={invitee:e.invitee,verifyResult:!0},h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/invite_verify?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call acceptGroupInvite",e),n.hj.call(this,h,a.fI.AGREE_INVITE_GROUP)}var H=B;function F(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={invitee:e.invitee,verifyResult:!1},h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/invite_verify?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call rejectGroupInvite",e),n.hj.call(this,h,a.fI.REJECT_INVITE_GROUP)}var W=F;function q(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=e.groupId,s=e.username,c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.jid,h={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatgroups/").concat(r,"/users/").concat(s,"?resource=").concat(p.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+d,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call removeGroupMember",e),n.hj.call(this,h,a.fI.REMOVE_GROUP_MEMBER)}var K=q;function z(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.users.join(","),h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call removeGroupMembers",e),n.hj.call(this,h,a.fI.MULTI_REMOVE_GROUP_MEMBER)}var V=z;function X(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!(Array.isArray(e.username)||"string"==typeof e.username&&""!==e.username))throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={usernames:"string"==typeof e.username?[e.username]:e.username,mute_duration:e.muteDuration},h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/mute?resource=").concat(l.clientResource),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},data:JSON.stringify(p),success:e.success,error:e.error};return i.kg.debug("Call muteGroupMember",e),n.hj.call(this,h,a.fI.MUTE_GROUP_MEMBER)}var J=X;function Z(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!(Array.isArray(e.username)||"string"==typeof e.username&&""!==e.username))throw Error('Invalid parameter: "username"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/mute/").concat(p,"?resource=").concat(l.clientResource),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call unmuteGroupMember",e),n.hj.call(this,h,a.fI.UNMUTE_GROUP_MEMBER)}var Y=Z;function Q(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:this.apiUrl+"/"+s+"/"+c+"/chatgroups/"+l+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getGroupMuteList",e),n.hj.call(this,d,a.fI.GET_GROUP_MUTE_LIST)}var $=Q,ee=Q;function te(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call blockGroupMember",e),n.hj.call(this,h,a.fI.BLOCK_GROUP_MEMBER)}var re=te;function ne(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={usernames:e.usernames},h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/blocks/users?resource=").concat(l.clientResource),data:JSON.stringify(p),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call blockGroupMembers",e),n.hj.call(this,h,a.fI.BLOCK_GROUP_MEMBERS)}var oe=ne;function ie(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call unblockGroupMember",e),n.hj.call(this,h,a.fI.UNBLOCK_GROUP_MEMBER)}var ae=ie;function se(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.usernames.join(","),h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call unblockGroupMembers",e),n.hj.call(this,h,a.fI.UNBLOCK_GROUP_MEMBERS)}var ce=se;function ue(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:this.apiUrl+"/"+s+"/"+c+"/chatgroups/"+l+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getGroupBlacklist",e),n.hj.call(this,d,a.fI.GET_GROUP_BLACK_LIST)}var le=ue,de=ue;function pe(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/ban?resource=").concat(l.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call disableSendGroupMsg",e),n.hj.call(this,p,a.fI.DISABLED_SEND_GROUP_MSG)}function he(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/ban?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call enableSendGroupMsg",e),n.hj.call(this,p,a.fI.ENABLE_SEND_GROUP_MSG)}function fe(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={usernames:e.users},h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/white/users?resource=").concat(l.clientResource),type:"POST",data:JSON.stringify(p),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call addUsersToGroupWhitelist",e),n.hj.call(this,h,a.fI.ADD_USERS_TO_GROUP_WHITE)}var me=fe;function ge(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/white/users/").concat(e.userName,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call removeGroupAllowlistMember",e),n.hj.call(this,p,a.fI.REMOVE_GROUP_WHITE_MEMBER)}var ve=ge,Ee=ge;function ye(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:this.apiUrl+"/"+s+"/"+c+"/chatgroups/"+l+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getGroupAllowlist",e),n.hj.call(this,d,a.fI.GET_GROUP_WHITE_LIST)}var _e=ye;function Te(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:this.apiUrl+"/"+s+"/"+c+"/chatgroups/"+l+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call isInGroupAllowlist",e),n.hj.call(this,d,a.fI.IS_IN_GROUP_WHITE_LIST)}var Ie=Te,Oe=Te;function Re(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.orgName,s=r.appName,c=r.accessToken,u=r.userId,l={url:this.apiUrl+"/"+a+"/"+s+"/sdk/chatgroups/"+e.groupId+"/mute/"+u,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+c}};return i.kg.debug("Call isInGroupMutelist",e),n.hj.call(this,l).then((function(e){return{type:e.type,data:e.data}}))}function Ce(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.msgId||""===e.msgId)throw Error('Invalid parameter: "msgId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l={url:this.apiUrl+"/"+s+"/"+c+"/chatgroups/"+e.groupId+"/acks/"+e.msgId,dataType:"json",type:"GET",data:{limit:500,key:void 0},headers:{Authorization:"Bearer "+u},success:e.success,error:e.error};return i.kg.debug("Call getGroupMsgReadUser",e),n.hj.call(this,l,a.fI.GET_GROUP_MSG_READ_USER)}function Ne(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(l,"/announcement"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call fetchGroupAnnouncement",e),n.hj.call(this,d,a.fI.GET_GROUP_ANN)}function Se(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={announcement:e.announcement},h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/announcement?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call updateGroupAnnouncement",e),n.hj.call(this,h,a.fI.UPDATE_GROUP_ANN)}function be(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("object"!==s(e.file))throw Error('Invalid parameter: "file"');var r=o.XZ.call(this).error;if(r)return null===(t=e.onFileUploadError)||void 0===t?void 0:t.call(e,r);var c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.jid,h=e.groupId;n.cT.call(this,{uploadUrl:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatgroups/").concat(h,"/share_files?resource=").concat(p.clientResource),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:d,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey},a.fI.UPLOAD_GROUP_FILE),i.kg.debug("Call uploadGroupSharedFile",e)}function Ae(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "file"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.fileId,h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(d,"/share_files/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call deleteGroupSharedFile",e),n.hj.call(this,h,a.fI.DELETE_GROUP_FILE)}function Me(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l=e.pageNum||1,d=e.pageSize||10,p=e.groupId,h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/chatgroups/").concat(p,"/share_files?pagenum=").concat(l,"&pagesize=").concat(d),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getGroupSharedFilelist",e),n.hj.call(this,h,a.fI.GET_GROUP_FILE_LIST)}var we=Me;function ke(e){var t=this.context,r=t.orgName,o=t.appName,s=t.accessToken,c=this.apiUrl,u=e.groupId,l=e.fileId;n.LR.call(this,{url:"".concat(c,"/").concat(r,"/").concat(o,"/chatgroups/").concat(u,"/share_files/").concat(l),onFileDownloadComplete:e.onFileDownloadComplete,onFileDownloadError:e.onFileDownloadError,accessToken:s,id:l,secret:e.secret},a.fI.DOWN_GROUP_FILE),i.kg.debug("Call downloadGroupSharedFile",e)}function Ue(e){return c(this,void 0,void 0,(function(){var t,r,c,l,d,p,h,f,m,g,v;return u(this,(function(u){switch(u.label){case 0:if(t=e.groupId,r=e.userId,c=e.memberAttributes,"string"!=typeof t||""===t)throw Error('Invalid parameter: "groupId"');if("string"!=typeof r||""===r)throw Error('Invalid parameter: "userId"');if("object"!==s(c))throw Error('Invalid parameter: "memberAttributes"');return(l=o.XZ.call(this).error)?[2,Promise.reject(l)]:(d=this.context,p=d.orgName,h=d.appName,f=d.accessToken,m=d.jid,g={metaData:c},v={url:"".concat(this.apiUrl,"/").concat(p,"/").concat(h,"/sdk/metadata/chatgroup/").concat(t,"/user/").concat(r,"?resource=").concat(m.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(g),headers:{Authorization:"Bearer "+f,"Content-Type":"application/json"}},i.kg.debug("Call setGroupMemberAttributes",e),[4,n.hj.call(this,v,a.fI.SET_GROUP_MEMBER_ATTRS)]);case 1:return u.sent(),[2]}}))}))}function Pe(e){var t=e.groupId,r=e.userId;return xe.call(this,{groupId:t,userIds:[r]}).then((function(e){var t;return{type:e.type,data:null===(t=e.data)||void 0===t?void 0:t[r]}}))}function xe(e){var t=e.groupId,r=e.userIds,s=e.keys,c=void 0===s?[]:s;if("string"!=typeof t||""===t)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(r)||(null==r?void 0:r.length)<=0)throw Error('Invalid parameter: "userIds"');if(!Array.isArray(c))throw Error('Invalid parameter: "keys"');var u=o.XZ.call(this).error;if(u)return Promise.reject(u);var l=this.context,d=l.orgName,p=l.appName,h=l.accessToken,f={targets:r,properties:c},m={url:"".concat(this.apiUrl,"/").concat(d,"/").concat(p,"/sdk/metadata/chatgroup/").concat(t,"/get"),type:"POST",dataType:"json",data:JSON.stringify(f),headers:{Authorization:"Bearer "+h,"Content-Type":"application/json"}};return i.kg.debug("Call getGroupMembersAttributes",e),n.hj.call(this,m,a.fI.GET_GROUP_MEMBER_ATTR).then((function(e){return{type:e.type,data:(null==e?void 0:e.data)||{}}}))}},7479:function(e,t,r){"use strict";r.r(t),r.d(t,{acceptContactInvite:function(){return q},acceptInvitation:function(){return W},addContact:function(){return B},addConversationMark:function(){return ge},addReaction:function(){return te},addToBlackList:function(){return V},addUsersToBlacklist:function(){return X},addUsersToBlocklist:function(){return J},declineContactInvite:function(){return z},declineInvitation:function(){return K},deleteAllMessagesAndConversations:function(){return _e},deleteContact:function(){return F},deleteConversation:function(){return w},deleteReaction:function(){return re},deleteSession:function(){return M},fetchHistoryMessages:function(){return D},fetchUserInfoById:function(){return P},getAllContacts:function(){return he},getBlacklist:function(){return T},getBlocklist:function(){return I},getContacts:function(){return R},getContactsWithCursor:function(){return fe},getConversationlist:function(){return b},getHistoryMessages:function(){return G},getReactionDetail:function(){return ie},getReactionList:function(){return ne},getReactionlist:function(){return oe},getRoster:function(){return O},getSelfIdsOnOtherPlatform:function(){return ye},getServerConversations:function(){return ce},getServerConversationsByFilter:function(){return Ee},getServerPinnedConversations:function(){return le},getServerPinnedMessages:function(){return Re},getSessionList:function(){return S},getTokenExpireTimestamp:function(){return L},modifyMessage:function(){return ee},pinConversation:function(){return de},pinMessage:function(){return Ie},recallMessage:function(){return $},removeConversationMark:function(){return ve},removeFromBlackList:function(){return Z},removeHistoryMessages:function(){return se},removeRoster:function(){return H},removeUserFromBlackList:function(){return Y},removeUserFromBlocklist:function(){return Q},reportMessage:function(){return ae},setContactRemark:function(){return pe},unbindPushToken:function(){return Ce},unpinMessage:function(){return Oe},updateCurrentUserNick:function(){return x},updateOwnUserInfo:function(){return k},updateUserInfo:function(){return U},uploadPushToken:function(){return N},uploadToken:function(){return C}}),r(9601),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(9554),r(4747),r(2222),r(7941),r(6699),r(3710),r(9714),r(9600),r(5069),r(561),r(9753),r(8309),r(1249),r(7327);var n=r(3246),o=r(5531),i=r(7252),a=r(4024),s=r(9937),c=r(8161),u=r(4188),l=r.n(u),d=r(7360),p=r(1595),h=r(4363),f=r(7288),m=r(9743),g=r(6801),v=function(){return v=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},v.apply(this,arguments)},E=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},y=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},_={singleChat:"chat",chatRoom:"chatroom",groupChat:"groupchat"};function T(e){var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c={url:this.apiUrl+"/"+o+"/"+i+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},success:function(t){var r={};t.data.forEach((function(e){r[e]={name:e}})),"function"==typeof(null==e?void 0:e.success)&&e.success(t)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return d.kg.debug("Call getBlocklist"),a.hj.call(this,c,p.fI.GET_BLACK_LIST)}var I=T,O=R;function R(e){var t=this,r=n.XZ.call(this).error;if(r)return Promise.reject(r);var o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+c},success:function(r){var n=[];r.data.forEach((function(e){n.push({name:e,subscription:"both",jid:t.context.jid})})),"function"==typeof(null==e?void 0:e.success)&&e.success(n)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return d.kg.debug("Call getContacts"),a.hj.call(this,u,p.fI.GET_CONTACTS)}function C(e){return d.kg.debug("Call uploadPushToken"),g.r.call(this,e)}var N=C;function S(e){var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/user_channels"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return d.kg.debug("Call getSessionList"),a.hj.call(this,c,p.fI.GET_SESSION_LIST)}function b(e){var t=this,r=n.XZ.call(this).error;if(r)return Promise.reject(r);var o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u=!!(e&&"number"==typeof e.pageNum&&"number"==typeof e.pageSize&&e.pageNum>0&&e.pageSize>0),l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/users/").concat(this.user,"/user_channels").concat(u?"/page":""),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return u&&(l.data={pageNum:e.pageNum,pageSize:e.pageSize}),d.kg.debug("Call getConversationlist"),a.hj.call(this,l,p.fI.GET_SESSION_LIST).then((function(e){return A.call(t,e)}))}function A(e){var t=this,r=e.data.channel_infos;return null==r||r.forEach((function(e){e.meta&&"{}"!==JSON.stringify(e.meta)?(e.meta.payload=JSON.parse(e.meta.payload),e.lastMessage=h.w.call(t,e.meta,{formatCustomExts:!1})):e.lastMessage=e.meta,delete e.meta})),e}function M(e){if(e&&"string"!=typeof e.channel)throw Error("Invalid parameter channel: ".concat(e.channel));if(e&&"singleChat"!==e.chatType&&"groupChat"!==e.chatType)throw Error("Invalid parameter chatType: ".concat(e.chatType));if(e&&"boolean"!=typeof e.deleteRoam)throw Error("Invalid parameter deleteRoam: ".concat(e.deleteRoam));var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r,o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u=o.jid;r="singleChat"===e.chatType?"chat":"groupChat";var l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/user/").concat(this.user,"/user_channel?resource=").concat(u.clientResource),dataType:"json",type:"DELETE",data:JSON.stringify({channel:e.channel,type:r,delete_roam:e.deleteRoam}),headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"},success:e.success,error:e.error};return d.kg.debug("Call deleteSession",e),a.hj.call(this,l,p.fI.DELETE_SESSION)}var w=M;function k(e,t){var r=n.XZ.call(this).error;if(r)return Promise.reject(r);var o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u=["nickname","avatarurl","mail","phone","gender","sign","birth","ext"],l={},h=a.P6.getEnvInfo();if("wx"===h.platform||"qq"===h.platform)if("string"==typeof e&&void 0!==t){if(!u.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");l[e]=t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");u.forEach((function(t){u.includes(t)&&void 0!==e[t]&&(l[t]=e[t])}))}else if("string"==typeof e){if(!u.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");l=e+"="+t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");var f=[];u.forEach((function(t){if(u.includes(t)&&void 0!==e[t]){var r=encodeURIComponent(t),n=encodeURIComponent(e[t]);f.push(r+"="+n)}})),l=f.join("&")}var m={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/metadata/user/").concat(this.user),type:"PUT",data:l,dataType:"json",headers:{Authorization:"Bearer "+c,"Content-Type":"application/x-www-form-urlencoded"}};return d.kg.debug("Call updateOwnUserInfo",e),a.hj.call(this,m,p.fI.UPDATE_USER_INFO)}var U=k;function P(e,t){var r=n.XZ.call(this).error;if(r)return Promise.reject(r);var o,i=this.context,s=i.orgName,c=i.appName,u=i.accessToken,l=[];if("string"==typeof e)l=[e];else{if("[object Array]"!==Object.prototype.toString.call(e))throw new Error("illegal params");l=e}o="string"==typeof t?[t]:t&&"[object Array]"===Object.prototype.toString.call(t)?t:["nickname","avatarurl","mail","phone","gender","sign","birth","ext"];var h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/metadata/user/get"),type:"POST",data:JSON.stringify({targets:l,properties:o}),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}};return d.kg.debug("Call fetchUserInfoById",e),a.hj.call(this,h,p.fI.GET_USER_INFO)}function x(e){var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user),type:"PUT",dataType:"json",data:JSON.stringify({nickname:e}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return d.kg.debug("Call updateCurrentUserNick",e),a.hj.call(this,c)}function L(e){if("string"!=typeof e||""===e)throw Error('Invalid parameter: "token"');var t=this.context,r=t.orgName,n=t.appName,o={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/sdk/users/").concat(this.user,"/token/expires"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return d.kg.debug("Call getTokenExpireTimestamp",e),a.hj.call(this,o,p.fI.SDK_INTERNAL)}function D(e){var t=this;return new Promise((function(r,o){if(!e.queue)throw Error('Invalid parameter: "specified"');var i=n.XZ.call(t).error;if(i)return Promise.reject(i);(function e(t){var n=this,i=t.count||20;j.call(this,{count:i,isGroup:!!t.isGroup,queue:t.queue,start:t.start,format:t.format,success:function(o){if(o.msgs.length>=i||o.is_last){var a=o.msgs.splice(0,i).reverse();t.success&&t.success(a),r(a)}else e.call(n,v(v({},t),{start:null}))},fail:function(e){o(e),t.fail&&t.fail(e)}})}).call(t,e),d.kg.debug("Call fetchHistoryMessages",e)}))}function j(e){var t=this,r=e.queue,n=this.mr_cache[r]||(this.mr_cache[r]={msgs:[]}),s=this.context.userId,u=e.start||-1,d=e.count||20;if(n.msgs.length>=d||n.is_last)"function"==typeof e.success&&e.success(n);else{n&&n.next_key&&(u=n.next_key),e.start&&(u=e.start);var h={queue:r+(e.isGroup?"@conference.easemob.com":"@easemob.com"),start:u,end:-1},f=this.context,m=f.orgName,g=f.appName,v={url:"".concat(this.apiUrl,"/").concat(m,"/").concat(g,"/users/").concat(s,"/messageroaming"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(h),success:function(r){return E(t,void 0,void 0,(function(){var t,o,i,a,s,u,d=this;return y(this,(function(p){switch(p.label){case 0:if(t=null==r?void 0:r.data,!r.data.msgs)return"function"==typeof e.success&&e.success(n),n.is_last=!0,n.next_key="",[2];o=t.msgs,i=o.length,n.is_last=t.is_last,n.next_key=t.next_key,a=function(t){return E(d,void 0,void 0,(function(){var r,n,o,i,a;return y(this,(function(s){switch(s.label){case 0:for(r=[],t=l().atob(t),n=0,o=t.length;n<o;++n)r.push(t.charCodeAt(n));return i=(i=this.context.root.lookup("easemob.pb.Meta")).decode(r),a={errorCode:0,reason:""},1!==i.ns?[3,2]:[4,c.Z.call(this,i,a,!0,e.format)];case 1:return[2,s.sent()];case 2:return[2]}}))}))},s=0,p.label=1;case 1:return s<i?[4,a(o[s].msg)]:[3,4];case 2:(u=p.sent())&&n.msgs.push(u),p.label=3;case 3:return s++,[3,1];case 4:return"function"==typeof e.success&&e.success(n),[2]}}))}))},error:function(e){if(e.error&&e.error_description){var r=i.Z.create({type:o.E.WEBIM_CONNCTION_AJAX_ERROR,message:"fetch history messages error",data:e});t.onError&&t.onError(r)}}};a.hj.call(this,v,p.fI.GET_HISTORY_MSG).catch((function(t){"function"==typeof e.fail&&e.fail(t)}))}}function G(e){var t=this;return new Promise((function(r,o){var i=e.targetId,s=e.cursor,u=void 0===s?-1:s,p=e.pageSize,h=void 0===p?20:p,f=e.chatType,m=e.searchDirection,g=e.searchOptions,v=void 0===g?{}:g,_=v.msgTypes,T=void 0===_?[]:_,I=v.startTime,O=void 0===I?null:I,R=v.endTime,C=void 0===R?null:R,N=v.from,S=void 0===N?null:N;if("string"!=typeof i||""===i)throw Error('"Invalid parameter": "targetId"');if(S&&"string"!=typeof S)throw Error('"Invalid parameter": "searchOptions.from"');if(T&&!Array.isArray(T))throw Error('"Invalid parameter": "searchOptions.msgTypes"');if(O&&"number"!=typeof O)throw Error('"Invalid parameter": "searchOptions.startTime"');if(C&&"number"!=typeof O)throw Error('"Invalid parameter": "searchOptions.endTime"');var b=n.XZ.call(t).error;if(b)return Promise.reject(b);var A=t.context,M=A.orgName,w=A.appName,k=A.userId,U="singleChat"===e.chatType?"@easemob.com":"@conference.easemob.com",P={queue:"".concat(i).concat(U),start:u,pull_number:h,is_positive:"down"===m,msgType:T.join(",")||"",end:-1,startTime:O,endTime:C,userId:"singleChat"===f?null:S},x={url:"".concat(t.apiUrl,"/").concat(M,"/").concat(w,"/users/").concat(k,"/messageroaming"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+t.token,"Content-Type":"application/json"},data:JSON.stringify(P),success:function(n){return E(t,void 0,void 0,(function(){var t,o,i,a,s,u,d,p,h=this;return y(this,(function(f){switch(f.label){case 0:t=null==n?void 0:n.data,o=t.msgs||[],i=function(e){return E(h,void 0,void 0,(function(){var t,r,n,o,i;return y(this,(function(a){switch(a.label){case 0:for(t=[],e=l().atob(e),r=0,n=e.length;r<n;++r)t.push(e.charCodeAt(r));return o=(o=this.context.root.lookup("easemob.pb.Meta")).decode(t),i={errorCode:0,reason:""},1!==o.ns?[3,2]:[4,c.Z.call(this,o,i,!0,!0)];case 1:return[2,a.sent()];case 2:return[2]}}))}))},a=[],s=0,f.label=1;case 1:return s<o.length?[4,i(o[s].msg)]:[3,4];case 2:(u=f.sent())&&a.push(u),f.label=3;case 3:return s++,[3,1];case 4:return t.msgs=a,d={cursor:t.next_key,messages:a,isLast:t.is_last},null===(p=e.success)||void 0===p||p.call(e,d),r(d),[2]}}))}))},error:e.fail};a.hj.call(t,x).catch((function(e){o(e)})),d.kg.debug("Call getHistoryMessages",e)}))}function B(e,t){return E(this,void 0,void 0,(function(){var r,o,i,s,c,u,l;return y(this,(function(h){switch(h.label){case 0:if(r=n.XZ.call(this).error)return[2,Promise.reject(r)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return d.kg.debug("Call addContact",e,t),o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u=o.jid,l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/users/").concat(this.user,"/contacts/apply?resource=").concat(u.clientResource),type:"POST",dataType:"json",data:JSON.stringify({usernames:[e],reason:t}),headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}},[4,a.hj.call(this,l,p.fI.ROSTER_ADD)];case 1:return h.sent(),[2]}}))}))}var H=F;function F(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u;return y(this,(function(l){switch(l.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return d.kg.debug("Call deleteContact",e),r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=r.jid,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/contacts/users/").concat(e,"?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,u,p.fI.ROSTER_REMOVE)];case 1:return l.sent(),[2]}}))}))}function W(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u;return y(this,(function(l){switch(l.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return d.kg.debug("Call acceptInvitation",e),r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=r.jid,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/contacts/accept/users/").concat(e,"?resource=").concat(c.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,u,p.fI.ROSTER_ACCEPT)];case 1:return l.sent(),[2]}}))}))}var q=W;function K(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u;return y(this,(function(l){switch(l.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return d.kg.debug("Call declineInvitation",e),r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=r.jid,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/contacts/decline/users/").concat(e,"?resource=").concat(c.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,u,p.fI.ROSTER_DECLINE)];case 1:return l.sent(),[2]}}))}))}var z=K;function V(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,h;return y(this,(function(f){switch(f.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if(r=e.name,o=[],"string"==typeof r){if(""===r)throw Error('"Invalid parameter": "name"');o=[r]}else{if(!Array.isArray(r))throw Error('"Invalid parameter": "name"');o=r}return d.kg.debug("Call addToBlockList",e),i=this.context,s=i.orgName,c=i.appName,u=i.accessToken,l=i.jid,h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/sdk/user/").concat(this.user,"/blocks?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify({usernames:o}),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}},[4,a.hj.call(this,h,p.fI.ROSTER_BAN).then((function(e){return{type:e.type,data:{userIds:(null==e?void 0:e.data)||[]}}}))];case 1:return[2,f.sent()]}}))}))}var X=V,J=V;function Z(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,h;return y(this,(function(f){switch(f.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if(r=e.name,o=[],"string"==typeof r){if(""===r)throw Error('"Invalid parameter": "name"');o=[r]}else{if(!Array.isArray(r))throw Error('"Invalid parameter": "name"');o=r}return d.kg.debug("Call removeFromBlockList",e),i=this.context,s=i.orgName,c=i.appName,u=i.accessToken,l=i.jid,h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/sdk/user/").concat(this.user,"/blocks?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",data:JSON.stringify({usernames:o}),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}},[4,a.hj.call(this,h,p.fI.ROSTER_ALLOW)];case 1:return f.sent(),[2]}}))}))}var Y=Z,Q=Z;function $(e){var t=this,r=(null==e?void 0:e.ext)||"";if("string"!=typeof r)throw Error('"Invalid parameter": "ext"',r);var n=this.getUniqueId(),o={id:n,to:e.to};this._msgHash[n]=v({},o);var i="";void 0!==e.chatType?i=e.chatType:void 0!==e.type&&(i="chat"===e.type?"singleChat":e.type);var a={id:n,type:"recall",chatType:i,ackId:e.mid,to:e.to,isChatThread:e.isChatThread||!1,metaExt:r,success:function(r){return E(t,void 0,void 0,(function(){var t,n,o,a,s,c,u,l,d;return y(this,(function(p){switch(p.label){case 0:return p.trys.push([0,5,,6]),"singleChat"!==i&&"groupChat"!==i?[3,4]:[4,null===(o=null===(n=this._localCache)||void 0===n?void 0:n.getInstance())||void 0===o?void 0:o.removeMsgByServerMsgId(e.mid)];case 1:return p.sent(),[4,null===(s=null===(a=this._localCache)||void 0===a?void 0:a.getInstance())||void 0===s?void 0:s.getConversationLastMessage(e.to,i)];case 2:return t=p.sent(),[4,null===(u=null===(c=this._localCache)||void 0===c?void 0:c.getInstance())||void 0===u?void 0:u.updateLocalConversation((0,m.MQ)({conversationId:e.to,conversationType:i}),{lastMessageId:null==t?void 0:t.serverMsgId})];case 3:p.sent(),p.label=4;case 4:return null===(l=null==e?void 0:e.success)||void 0===l||l.call(e,r),[3,6];case 5:return p.sent(),null===(d=null==e?void 0:e.success)||void 0===d||d.call(e,r),[3,6];case 6:return[2]}}))}))},fail:e.fail};return d.kg.debug("Call recallMessage",e),this.mSync.send(a,this)}function ee(e){var t=e||{},r=t.messageId,n=t.modifiedMessage;if(d.kg.debug("Call modifyMessage",r,n),""===r)throw Error('Invalid parameter: "messageId"');if("txt"!==n.type)throw Error('Invalid parameter: "modifiedMessage.type"');return this.mSync.send(v({editMessageId:r},n))}function te(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,d;return y(this,(function(p){switch(p.label){case 0:if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: ".concat(e.reaction));return(t=n.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=e.reaction,u=e.messageId,l={msgId:u,message:c},d={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/reaction/user/").concat(this.user),type:"POST",data:JSON.stringify(l),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,d)]);case 1:return p.sent(),[2]}}))}))}function re(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l;return y(this,(function(d){switch(d.label){case 0:if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reactionId: ".concat(e.reaction));return(t=n.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=e.messageId,u=e.reaction,l={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/reaction/user/").concat(this.user,"?msgId=").concat(c,"&message=").concat(u),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,l)]);case 1:return d.sent(),[2]}}))}))}function ne(e){if("string"!=typeof e.chatType||!e.chatType)throw Error("Invalid parameter chatType: ".concat(e.chatType));if(!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=e.chatType,u=e.messageId,l={msgIdList:"string"==typeof u?[u]:u,msgType:"singleChat"===c?"chat":"groupchat",groupId:e.groupId||null},d={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/reaction/user/").concat(this.user),type:"GET",data:l,dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return a.hj.call(this,d).then((function(e){var t=e.data;return null==t||t.forEach((function(e){null==e||e.reactionList.forEach((function(e){e.isAddedBySelf=e.state,delete e.state,delete e.reactionId}))})),e}))}var oe=ne;function ie(e){if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: ".concat(e.reaction));if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=e.cursor,u=e.pageSize,l={msgId:e.messageId,message:e.reaction,currentPage:c||null,pageSize:u||20},d={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/reaction/user/").concat(this.user,"/detail"),type:"GET",data:l,dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return a.hj.call(this,d).then((function(e){return e.data.isAddedBySelf=e.data.state,delete e.data.state,delete e.data.reactionId,e}))}function ae(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,d,p,h;return y(this,(function(f){switch(f.label){case 0:if("string"!=typeof e.reportType||!e.reportType)throw Error("Invalid parameter reportType: ".concat(e.reportType));if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.reportReason||!e.reportReason)throw Error("Invalid parameter messageId: ".concat(e.reportReason));return(t=n.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=e.reportType,u=e.reportReason,l=e.messageId,d={username:this.user,reportType:c,reportReason:u},p="".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/user/").concat(this.user,"/moderation/report/message/").concat(l),h={url:p,type:"POST",data:JSON.stringify(d),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,h)]);case 1:return f.sent(),[2]}}))}))}function se(e){var t;return E(this,void 0,void 0,(function(){var r,o,i,s,c,u,l,p,h;return y(this,(function(f){switch(f.label){case 0:if("string"!=typeof e.targetId||""===e.targetId)throw Error('"Invalid parameter targetId": '+e.targetId);if(!["singleChat","groupChat","chatRoom"].includes(e.chatType))throw Error('"Invalid parameter chatType": '+e.chatType);if(e.beforeTimeStamp&&("number"!=typeof e.beforeTimeStamp||e.beforeTimeStamp<0||(null===(t=e.beforeTimeStamp)||void 0===t?void 0:t.toString().length)>18))throw Error('"Invalid parameter beforeTimeStamp": '+e.beforeTimeStamp);if(e.messageIds&&!(Array.isArray(e.messageIds)&&e.messageIds.length>0&&e.messageIds.length<=20))throw Error('"Invalid parameter messageIds": '+e.messageIds);if(!e.messageIds&&!e.beforeTimeStamp)throw Error("messageIds or beforeTimeStamp field is required.");return(r=n.XZ.call(this).error)?[2,Promise.reject(r)]:(o=this.context,i=o.orgName,s=o.appName,c=o.userId,u="singleChat"===e.chatType?"userId":"groupId",l="singleChat"===e.chatType?"chat":"group",p=e.messageIds?"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/sdk/message/roaming/").concat(l,"/user/").concat(c,"?").concat(u,"=").concat(e.targetId,"&msgIdList=").concat(e.messageIds,"&resource=").concat(this.clientResource):"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/sdk/message/roaming/").concat(l,"/user/").concat(c,"/time?").concat(u,"=").concat(e.targetId,"&delTime=").concat(e.beforeTimeStamp,"&&resource=").concat(this.clientResource),h={url:p,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}},d.kg.debug("Call removeHistoryMessages",e),[4,a.hj.call(this,h)]);case 1:return f.sent(),[2]}}))}))}function ce(e){var t=this,r=n.XZ.call(this).error;if(r)return Promise.reject(r);if((null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));var o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/sdk/user/").concat(this.user,"/user_channels/list?"),type:"GET",dataType:"json",data:{limit:(null==e?void 0:e.pageSize)||20,cursor:(null==e?void 0:e.cursor)||"",need_mark:!0},headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}};return d.kg.debug("Call getServerConversations",e),new Promise((function(e,r){a.hj.call(t,u,p.fI.GET_SESSION_LIST).then((function(r){return E(t,void 0,void 0,(function(){var t,n,o=this;return y(this,(function(i){switch(i.label){case 0:return t=ue.call(this,r),this._localCache?(n=t.data.conversations.map((function(e){return E(o,void 0,void 0,(function(){var t,r,n,o;return y(this,(function(i){switch(i.label){case 0:return[4,null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r?void 0:r.storeMessage(e.lastMessage,f.r.SUCCESS,!0)];case 1:return i.sent(),[4,null===(o=null===(n=this._localCache)||void 0===n?void 0:n.getInstance())||void 0===o?void 0:o.updateLocalConversation((0,m.MQ)({conversationId:e.conversationId,conversationType:e.conversationType}),{unReadCount:e.unReadCount})];case 2:return i.sent(),[2]}}))}))})),[4,Promise.all(n)]):[3,2];case 1:i.sent(),i.label=2;case 2:return e(t),[2]}}))}))})).catch((function(e){r(e)}))}))}function ue(e){var t=this,r=e.data,n=r.cursor,o=r.channel_infos,i=[];null==o||o.forEach((function(e){var r=null;(null==e?void 0:e.meta)&&"{}"!==JSON.stringify(e.meta)&&(e.meta.payload=JSON.parse(e.meta.payload),"delivery"!==(r=h.w.call(t,e.meta)).type&&"read"!==r.type&&"channel"!==r.type&&(r.chatType=h.U[r.chatType]));var n={conversationId:e.session_to,conversationType:"chat"===e.session_type?"singleChat":"groupChat",isPinned:e.is_top,pinnedTime:e.is_top?e.update_top_status_time:0,unReadCount:e.unread_num,lastMessage:r};e.marks&&(n.marks=e.marks.map((function(e){return s.Z[e]}))),i.push(n)}));var a={conversations:i,cursor:n||""};return{type:e.type,data:a}}function le(e){var t=this,r=n.XZ.call(this).error;if(r)return Promise.reject(r);if((null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));var o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/sdk/user/").concat(this.user,"/user_channels/list?"),type:"GET",dataType:"json",data:{limit:(null==e?void 0:e.pageSize)||20,cursor:(null==e?void 0:e.cursor)||"",is_top:!0,need_mark:!0},headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}};return d.kg.debug("Call getServerPinnedConversations",e),a.hj.call(this,u,p.fI.GET_SESSION_LIST).then((function(e){return ue.call(t,e)}))}function de(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,h,f,m,g,v,E;return y(this,(function(y){if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if(r=e.conversationId,o=e.conversationType,i=e.isPinned,s="singleChat"===o?"chat":"groupChat","string"!=typeof r||""===r)throw Error("Invalid parameter conversationId: ".concat(r));if(!["singleChat","groupChat"].includes(o))throw Error("Invalid parameter conversationType: ".concat(o));if("boolean"!=typeof i)throw Error("Invalid parameter isPinned: ".concat(i));return c=this.context,u=c.orgName,l=c.appName,h=c.accessToken,f=c.jid,m={type:s,to:r},g=i?"":"type=".concat(s,"&to=").concat(r,"&"),v="".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/sdk/user/").concat(this.user,"/user_channel/top?").concat(g,"resource=").concat(f.clientResource),E={url:v,type:i?"POST":"DELETE",dataType:"json",headers:{Authorization:"Bearer "+h,"Content-Type":"application/json"}},i&&(E.data=JSON.stringify(m)),d.kg.debug("Call pinConversation",e),[2,a.hj.call(this,E,p.fI.PIN_CONVERSATION).then((function(e){var t=e.type,r=e.data;return{type:t,data:{isPinned:r.is_top||!1,pinnedTime:r.is_top?r.update_top_status_time:0}}}))]}))}))}function pe(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,h,f;return y(this,(function(m){switch(m.label){case 0:if(t=e.userId,r=e.remark,o=n.XZ.call(this).error)return[2,Promise.reject(o)];if("string"!=typeof t||""===t)throw Error('Invalid parameter: "userId"');if("string"!=typeof r)throw Error('Invalid parameter: "remark"');return d.kg.debug("Call setContactRemark",e),i=this.context,s=i.orgName,c=i.appName,u=i.accessToken,l=i.jid,h="".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(this.context.userId,"/contacts/users/").concat(t,"?resource=").concat(l.clientResource),f={url:h,type:"PUT",data:JSON.stringify({remark:r}),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}},[4,a.hj.call(this,f,p.fI.ROSTER_SET_CONTACT_REMARK)];case 1:return m.sent(),[2]}}))}))}function he(){var e=n.XZ.call(this).error;if(e)return Promise.reject(e);var t=this.context,r=t.orgName,o=t.appName,i=t.accessToken,s={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(o,"/users/").concat(this.user,"/contacts/users?needReturnRemark=true"),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i}};return d.kg.debug("Call getAllContacts"),a.hj.call(this,s,p.fI.ROSTER_GET_ALL_CONTACTS_REMARKS).then((function(e){var t=((null==e?void 0:e.entities)||[]).map((function(e){return{userId:e.username,remark:e.remark}}));return{type:e.type,data:t}}))}function fe(e){var t=n.XZ.call(this).error;if(t)return Promise.reject(t);d.kg.debug("Call getContactsWithCursor",e);var r=e||{},o=r.pageSize,i=void 0===o?20:o,s=r.cursor,c=void 0===s?"":s;if(i&&"number"!=typeof i)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));var u=this.context,l=u.orgName,h=u.appName,f=u.accessToken,m={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(h,"/users/").concat(this.user,"/contacts?needReturnRemark=true&limit=").concat(i,"&cursor=").concat(c),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+f}};return a.hj.call(this,m,p.fI.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE).then((function(e){var t,r,n=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.contacts)||[],o=(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.cursor)||"",i=n.map((function(e){return{userId:e.username,remark:e.remark}}));return{type:e.type,data:{cursor:o,contacts:i}}}))}function me(e){return E(this,void 0,void 0,(function(){var t,r,o,i,c,u,l,f,m,g,v,E,T,I,O;return y(this,(function(y){switch(y.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if(d.kg.debug("Call markConversation",e),o=(r=e||{}).conversations,i=void 0===o?[]:o,c=r.mark,u=r.isMarked,!Array.isArray(i))throw Error("Invalid parameter conversations");if(l=i.map((function(e){if(!e.conversationId||!["singleChat","groupChat"].includes(e.conversationType))throw Error("Invalid parameter conversations");return{to:e.conversationId,type:_[e.conversationType]}})),"boolean"!=typeof u)throw Error("Invalid parameter isMarked: ".concat(u));if("number"!=typeof c)throw Error("Invalid parameter mark: ".concat(c));return f=this.context,m=f.orgName,g=f.appName,v=f.accessToken,E=f.userId,T=f.jid,I={mark:s.Z[c],targets:l},O={url:"".concat(this.apiUrl,"/").concat(m,"/").concat(g,"/sdk/user/").concat(E,"/user_channels/mark?resource=").concat(T.clientResource),dataType:"json",data:JSON.stringify(I),type:u?"Post":"Delete",headers:{Authorization:"Bearer "+v}},[4,a.hj.call(this,O,p.fI.MARK_CONVERSATION).then((function(e){var t,r=(null===(t=e.data)||void 0===t?void 0:t.ignore)||[];r&&Array.isArray(r)&&r.length>0&&d.kg.debug("markConversation has ignored conversations",r.map((function(e){return{conversationId:e.to,conversationType:h.U[e.type]}})))}))];case 1:return y.sent(),[2]}}))}))}function ge(e){return E(this,void 0,void 0,(function(){var t,r;return y(this,(function(n){return d.kg.debug("Call addConversationMark",e),t=e.conversations,r=e.mark,[2,me.call(this,{conversations:t,mark:r,isMarked:!0})]}))}))}function ve(e){return E(this,void 0,void 0,(function(){var t,r;return y(this,(function(n){return d.kg.debug("Call removeConversationMark",e),t=e.conversations,r=e.mark,[2,me.call(this,{conversations:t,mark:r,isMarked:!1})]}))}))}function Ee(e){var t,r,o=this,i=n.XZ.call(this).error;if(i)return Promise.reject(i);if(d.kg.debug("Call getServerConversationsByFilter",e),(null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));if("number"!=typeof(null===(t=null==e?void 0:e.filter)||void 0===t?void 0:t.mark))throw Error("Invalid parameter mark: ".concat(null===(r=null==e?void 0:e.filter)||void 0===r?void 0:r.mark));var c=this.context,u=c.orgName,l=c.appName,h=c.accessToken,f="".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/sdk/user/").concat(this.user,"/user_channels/mark/search?"),m=e.pageSize,g=e.cursor,v=((null==e?void 0:e.filter)||{}).mark,E={url:f,type:"GET",dataType:"json",data:{limit:m||10,cursor:g||"",need_mark:!0,mark:s.Z[v]},headers:{Authorization:"Bearer "+h,"Content-Type":"application/json"}};return a.hj.call(this,E,p.fI.GET_SESSION_LIST).then((function(e){return ue.call(o,e)}))}function ye(){var e=n.XZ.call(this).error;if(e)return Promise.reject(e);d.kg.debug("Call getSelfIdsOnOtherPlatform");var t=this.context,r=t.orgName,o=t.appName,i=t.accessToken,s=t.userId,c=t.jid,u={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(o,"/users/").concat(s,"/resources"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return a.hj.call(this,u,p.fI.USER_LOGGEDIN_OTHER_PLATFORM).then((function(e){var t,r=null===(t=e.data)||void 0===t?void 0:t.filter((function(e){return e.res!==c.clientResource})),n=null==r?void 0:r.map((function(e){return"".concat(s,"/").concat(e.res)}));return{type:e.type,data:n}}))}function _e(){var e,t,r,o,i,s;return E(this,void 0,void 0,(function(){var c,u,l,h,f,m,g,v,E;return y(this,(function(y){switch(y.label){case 0:return(c=n.XZ.call(this).error)?[2,Promise.reject(c)]:(d.kg.debug("Call deleteAllMessagesAndConversations"),u=this.context,l=u.orgName,h=u.appName,f=u.accessToken,m=u.userId,g=u.jid,v="".concat(this.apiUrl,"/").concat(l,"/").concat(h,"/sdk/message/roaming/user/").concat(m,"/delete/all?resource=").concat(g.clientResource),E={url:v,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+f,"Content-Type":"application/json"}},[4,a.hj.call(this,E,p.fI.REST_DELETE_MESSAGES_CONVERSATIONS)]);case 1:return y.sent(),null===(t=null===(e=this._localCache)||void 0===e?void 0:e.getInstance())||void 0===t||t.clearConversationMap(),[4,null===(o=null===(r=this._localCache)||void 0===r?void 0:r.getInstance())||void 0===o?void 0:o.clearStoreData("conversationList")];case 2:return y.sent(),[4,null===(s=null===(i=this._localCache)||void 0===i?void 0:i.getInstance())||void 0===s?void 0:s.clearStoreData("message")];case 3:return y.sent(),[2]}}))}))}function Te(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,h,f,m,g,v,E,T;return y(this,(function(y){switch(y.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if(d.kg.debug("Call setMessagePinStatus",e),o=(r=e||{}).conversationId,i=void 0===o?"":o,s=r.conversationType,c=r.messageId,u=r.isPinned,"string"!=typeof i||""===i)throw Error("Invalid parameter conversationId");if("string"!=typeof c||""===c)throw Error("Invalid parameter messageId");if("boolean"!=typeof u)throw Error("Invalid parameter isPinned");return l=this.context,h=l.orgName,f=l.appName,m=l.accessToken,g=l.userId,v=l.jid,E={to:i,type:_[s],pin_msg_id:c},T={url:"".concat(this.apiUrl,"/").concat(h,"/").concat(f,"/sdk/user/").concat(g,"/user_channel/pin?resource=").concat(v.clientResource),dataType:"json",data:JSON.stringify(E),type:u?"Post":"Delete",headers:{Authorization:"Bearer "+m}},[4,a.hj.call(this,T,p.fI.REST_PIN_MESSAGE)];case 1:return y.sent(),[2]}}))}))}function Ie(e){return E(this,void 0,void 0,(function(){var t,r,n,o;return y(this,(function(i){return d.kg.debug("Call pinMessage",e),r=(t=e||{}).conversationType,n=t.conversationId,o=t.messageId,[2,Te.call(this,{conversationId:n,conversationType:r,messageId:o,isPinned:!0})]}))}))}function Oe(e){return E(this,void 0,void 0,(function(){var t,r,n,o;return y(this,(function(i){return d.kg.debug("Call unpinMessage",e),r=(t=e||{}).conversationType,n=t.conversationId,o=t.messageId,[2,Te.call(this,{conversationId:n,conversationType:r,messageId:o,isPinned:!1})]}))}))}function Re(e){var t=this,r=n.XZ.call(this).error;if(r)return Promise.reject(r);d.kg.debug("Call getServerPinnedMessages",e);var o=e.conversationId,i=e.conversationType,s=e.pageSize,c=e.cursor;if("string"!=typeof o||""===o)throw Error("Invalid parameter conversationId");if(s&&"number"!=typeof s)throw Error("Invalid parameter pageSize: ".concat(s));if(c&&"string"!=typeof c)throw Error("Invalid parameter cursor: ".concat(c));var u=this.context,l=u.orgName,f=u.appName,m=u.accessToken,g={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(f,"/sdk/user/").concat(this.user,"/user_channel/pin"),type:"GET",dataType:"json",data:{to:o,type:_[i],limit:s||10,cursor:c||""},headers:{Authorization:"Bearer "+m,"Content-Type":"application/json"}};return a.hj.call(this,g,p.fI.GET_SESSION_LIST).then((function(e){return{type:0,data:{list:e.data.msg_infos.map((function(e){e.message.payload=JSON.parse(e.message.payload);var r=e.message,n=e.pin_opt_at,o=e.pin_operator;return{message:h.w.call(t,r,{formatChatType:!0}),pinTime:n,operatorId:o}})),cursor:e.data.cursor||""}}}))}function Ce(){var e=this;d.kg.debug("Call unbindPushToken");var t={deviceId:this.clientResource,deviceToken:"",notifierName:this.pushCertificateName};return g.r.call(this,t).then((function(t){return e.isRegisterPush=!1,t}))}},3770:function(e,t,r){"use strict";r.r(t),r.d(t,{getPresenceStatus:function(){return h},getSubscribedPresenceList:function(){return d},getSubscribedPresencelist:function(){return p},publishPresence:function(){return c},subscribePresence:function(){return u},unsubscribePresence:function(){return l}}),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(2222),r(9753);var n=r(4024),o=r(3246),i=r(7360),a=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},s=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function c(e){return a(this,void 0,void 0,(function(){var t,r,a,c,u,l,d,p,h;return s(this,(function(s){switch(s.label){case 0:if("string"!=typeof e.description)throw Error('Invalid parameter: "description"');return(t=o.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,a=r.accessToken,c=r.orgName,u=r.appName,l=r.userId,d=this.context.jid.clientResource,p={ext:e.description},h={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(l,"/presence/").concat(d,"/1"),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error},i.kg.debug("Call publishPresence:",e),[4,n.hj.call(this,h)]);case 1:return s.sent(),[2]}}))}))}function u(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if("number"!=typeof e.expiry)throw Error('Invalid parameter: "expiry"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.orgName,s=r.appName,c=r.userId,u=r.accessToken,l={usernames:e.usernames},d={url:"".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/users/").concat(c,"/presence/").concat(e.expiry),type:"POST",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call subscribePresence:",e),n.hj.call(this,d).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}function l(e){return a(this,void 0,void 0,(function(){var t,r,a,c,u,l,d;return s(this,(function(s){switch(s.label){case 0:if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');return(t=o.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,a=r.orgName,c=r.appName,u=r.userId,l=r.accessToken,d={url:"".concat(this.apiUrl,"/").concat(a,"/").concat(c,"/users/").concat(u,"/presence"),type:"DELETE",dataType:"json",data:JSON.stringify(e.usernames),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error},i.kg.debug("Call unsubscribePresence:",e),[4,n.hj.call(this,d)]);case 1:return s.sent(),[2]}}))}))}function d(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.orgName,s=r.appName,c=r.userId,u=r.accessToken,l={url:"".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/users/").concat(c,"/presence/sublist?pageNum=").concat(e.pageNum,"&pageSize=").concat(e.pageSize),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getSubscribedPresenceList:",e),n.hj.call(this,l).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}var p=d;function h(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r={usernames:e.usernames},a=this.context,s=a.orgName,c=a.appName,u=a.userId,l=a.accessToken,d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/presence"),type:"POST",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getPresenceStatus:",e),n.hj.call(this,d).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}},6801:function(e,t,r){"use strict";r.d(t,{r:function(){return s}}),r(1539),r(8674),r(2222),r(4812);var n=r(3246),o=r(4024),i=r(7360),a=r(1595);function s(e){if("string"!=typeof e.deviceId||""===e.deviceId)throw Error('Invalid parameter: "deviceId"');var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(this.user),type:"PUT",data:JSON.stringify({device_id:e.deviceId,device_token:e.deviceToken,notifier_name:e.notifierName}),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};i.kg.debug("Call uploadPushTokenToServer",e);var d=o.hj.bind(this,l,a.fI.UPLOAD_PUSH_TOKEN);return o.P6.retryPromise(d).then((function(e){var t=e.entities[0]||{};return{type:e.type,data:t}}))}},1735:function(e,t,r){"use strict";r.r(t),r.d(t,{clearRemindTypeForConversation:function(){return u},getPushPerformLanguage:function(){return h},getSilentModeForAll:function(){return s},getSilentModeForConversation:function(){return l},getSilentModeForConversations:function(){return d},getSilentModeRemindTypeConversations:function(){return f},setPushPerformLanguage:function(){return p},setSilentModeForAll:function(){return a},setSilentModeForConversation:function(){return c}}),r(7941),r(1539),r(8674),r(2222),r(9753),r(9554),r(4747),r(9600),r(1249);var n=r(4024),o=r(3246),i=r(7360);function a(e){if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var t=e.options.paramType;if("number"!=typeof t||t<0||t>2)throw Error('Invalid parameter: "options of paramType"');if(0===t){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===t){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===t){var r=e.options,a=r.startTime,s=r.endTime;if(!(a instanceof Object&&Object.keys(a).length))throw Error('Invalid parameter: "options of startTime"');if(!a.hours||"number"!=typeof a.hours||!a.minutes||"number"!=typeof a.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(s instanceof Object&&Object.keys(s).length))throw Error('Invalid parameter: "options of endTime"');if(!s.hours||"number"!=typeof s.hours||!s.minutes||"number"!=typeof s.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var c=o.XZ.call(this).error;if(c)return Promise.reject(c);var u=this.context,l=u.accessToken,d=u.orgName,p=u.appName,h=u.userId,f=u.jid,m={};switch(t){case 0:m={type:e.options.remindType};break;case 1:m={ignoreDuration:e.options.duration};break;case 2:var g=e.options;a=g.startTime,s=g.endTime,m={ignoreInterval:"".concat(a.hours,":").concat(a.minutes,"-").concat(s.hours,":").concat(s.minutes)}}var v={url:"".concat(this.apiUrl,"/").concat(d,"/").concat(p,"/users/").concat(h,"/notification/user/").concat(h,"?resource=").concat(f.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(m),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call setSilentModeForAll:",e),n.hj.call(this,v)}function s(e){var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/user/").concat(u),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return i.kg.debug("Call getSilentModeForAll:",e),n.hj.call(this,l)}function c(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var t=e.options.paramType;if("number"!=typeof t||t<0||t>2)throw Error('Invalid parameter: "options of paramType"');if(0===t){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===t){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===t){var r=e.options,a=r.startTime,s=r.endTime;if(!(a instanceof Object&&Object.keys(a).length))throw Error('Invalid parameter: "options of startTime"');if(!a.hours||"number"!=typeof a.hours||!a.minutes||"number"!=typeof a.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(s instanceof Object&&Object.keys(s).length))throw Error('Invalid parameter: "options of endTime"');if(!s.hours||"number"!=typeof s.hours||!s.minutes||"number"!=typeof s.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var c=o.XZ.call(this).error;if(c)return Promise.reject(c);var u=this.context,l=u.accessToken,d=u.orgName,p=u.appName,h=u.userId,f=u.jid,m="chatgroup",g={};switch(t){case 0:g={type:e.options.remindType};break;case 1:g={ignoreDuration:e.options.duration};break;case 2:var v=e.options;a=v.startTime,s=v.endTime,g={ignoreInterval:"".concat(a.hours,":").concat(a.minutes,"-").concat(s.hours,":").concat(s.minutes)}}"singleChat"===e.type&&(m="user");var E={url:"".concat(this.apiUrl,"/").concat(d,"/").concat(p,"/users/").concat(h,"/notification/").concat(m,"/").concat(e.conversationId,"?resource=").concat(f.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(g),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call setSilentModeForConversation:",e),n.hj.call(this,E)}function u(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l=r.jid,d="chatgroup";"singleChat"===e.type&&(d="user");var p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/").concat(d,"/").concat(e.conversationId,"?resource=").concat(l.clientResource),type:"PUT",dataType:"json",data:JSON.stringify({type:"DEFAULT"}),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call clearRemindTypeForConversation:",e),n.hj.call(this,p)}function l(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l="chatgroup";"singleChat"===e.type&&(l="user");var d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/").concat(l,"/").concat(e.conversationId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getSilentModeForConversation:",e),n.hj.call(this,d)}function d(e){if(!Array.isArray(e.conversationList))throw Error('Invalid parameter: "conversationList"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l=[],d=[];e.conversationList.forEach((function(e){"singleChat"===e.type?l.push(e.id):d.push(e.id)}));var p=l.length?l.join(","):"",h=d.length?d.join(","):"",f={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification?user=").concat(p,"&group=").concat(h),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getSilentModeForConversations:",e),n.hj.call(this,f)}function p(e){if("string"!=typeof e.language||!e.language)throw Error('Invalid parameter: "language"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r={translationLanguage:e.language},a=this.context,s=a.accessToken,c=a.orgName,u=a.appName,l=a.userId,d={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(l,"/notification/language"),type:"PUT",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call setPushPerformLanguage:",e),n.hj.call(this,d)}function h(e){var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/language"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return i.kg.debug("Call getPushPerformLanguage:",e),n.hj.call(this,l)}function f(e){var t=o.XZ.call(this).error;if(t)return Promise.reject(t);if("number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageSize"');var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l={limit:e.pageSize||10,cursor:e.cursor};e.cursor||delete l.cursor;var d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/mute/type"),type:"GET",dataType:"json",data:l,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return i.kg.debug("Call getSilentModeRemindTypeConversations:",e),n.hj.call(this,d).then((function(e){return e.data?{data:{conversations:e.data.map((function(e){return"user"in e?{conversationId:e.user,type:"singleChat",remindType:e.value}:{conversationId:e.group,type:"groupChat",remindType:e.value}})),cursor:e.cursor},type:e.type}:e}))}},7384:function(e,t,r){"use strict";r.r(t),r.d(t,{changeChatThreadName:function(){return p},createChatThread:function(){return c},destroyChatThread:function(){return d},getChatThreadDetail:function(){return y},getChatThreadLastMessage:function(){return v},getChatThreadMembers:function(){return h},getChatThreads:function(){return g},getJoinedChatThreads:function(){return m},joinChatThread:function(){return u},leaveChatThread:function(){return l},removeChatThreadMember:function(){return f}}),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(8309),r(2222),r(9554),r(4747),r(9753);var n=r(4024),o=r(3246),i=r(4363),a=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},s=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function c(e){if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: ".concat(e.name));if("string"!=typeof e.messageId||""===e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: ".concat(e.parentId));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c=r.jid,u={name:e.name,msg_id:e.messageId,group_id:e.parentId,owner:this.user},l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread?resource=").concat(c.clientResource),type:"POST",dataType:"json",data:JSON.stringify(u),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,l).then((function(e){var t=e.data.thread_id;return e.data={chatThreadId:t},e}))}function u(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c=r.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"/user/").concat(this.user,"/join?resource=").concat(c.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,u).then((function(e){var t=e.data.detail;return t.messageId=t.msgId,t.parentId=t.groupId,delete t.msgId,delete t.groupId,e}))}function l(e){return a(this,void 0,void 0,(function(){var t,r,i,a,c,u,l;return s(this,(function(s){switch(s.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));return(t=o.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,i=r.orgName,a=r.appName,c=r.accessToken,u=r.jid,l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"/user/").concat(this.user,"/quit?resource=").concat(u.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}},[4,n.hj.call(this,l)]);case 1:return s.sent(),[2]}}))}))}function d(e){return a(this,void 0,void 0,(function(){var t,r,i,a,c,u,l;return s(this,(function(s){switch(s.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));return(t=o.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,i=r.orgName,a=r.appName,c=r.accessToken,u=r.jid,l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"?resource=").concat(u.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}},[4,n.hj.call(this,l)]);case 1:return s.sent(),[2]}}))}))}function p(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: ".concat(e.name));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c=r.jid,u={name:e.name},l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"?resource=").concat(c.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(u),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,l)}function h(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c={limit:e.pageSize||20,cursor:e.cursor||""},u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"/users"),type:"GET",dataType:"json",data:c,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,u)}function f(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if("string"!=typeof e.username||""===e.username)throw Error("Invalid parameter username: ".concat(e.username));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c=r.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"/users/").concat(e.username,"?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,u)}function m(e){var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c={limit:e.pageSize||20,cursor:e.cursor||""},u={url:e.parentId?"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/threads/chatgroups/").concat(e.parentId,"/user/").concat(this.user):"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/threads/user/").concat(this.user),type:"GET",dataType:"json",data:c,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,u).then((function(e){var t=e.entities;return null==t||t.forEach((function(e){e.parentId=e.groupId,e.messageId=e.msgId,delete e.groupId,delete e.msgId})),e}))}function g(e){if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: ".concat(e.parentId));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c={cursor:e.cursor||"",limit:e.pageSize||20},u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/threads/chatgroups/").concat(e.parentId),type:"GET",dataType:"json",data:c,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,u).then((function(e){var t=e.entities;return null==t||t.forEach((function(e){e.parentId=e.groupId,e.messageId=e.msgId,delete e.groupId,delete e.msgId})),e}))}function v(e){var t=this;if(!Array.isArray(e.chatThreadIds))throw Error("Invalid parameter chatThreadIds: ".concat(e.chatThreadIds));var r=o.XZ.call(this).error;if(r)return Promise.reject(r);var i=this.context,a=i.orgName,s=i.appName,c=i.accessToken,u={threadIds:e.chatThreadIds},l={url:"".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/thread/message"),type:"POST",dataType:"json",data:JSON.stringify(u),headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}};return n.hj.call(this,l).then((function(e){return E.call(t,e)}))}function E(e){var t=this,r=e.entities;return null==r||r.forEach((function(e){e.chatThreadId=e.thread_id,e.last_message&&"{}"!==JSON.stringify(e.last_message)?e.lastMessage=i.w.call(t,e.last_message):e.lastMessage=e.last_message,delete e.thread_id,delete e.last_message})),e}function y(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,c).then((function(e){return e.data.affiliationsCount=e.data.affiliations_count,e.data.messageId=e.data.msgId,e.data.parentId=e.data.groupId,delete e.data.affiliations_count,delete e.data.msgId,delete e.data.groupId,e}))}},70:function(e,t,r){"use strict";r.r(t),r.d(t,{getSupportedLanguages:function(){return a},translateMessage:function(){return s}}),r(1539),r(8674),r(2222),r(9753);var n=r(3246),o=r(7360),i=r(4024);function a(){var e=n.XZ.call(this).error;if(e)return Promise.reject(e);var t=this.context,r=t.orgName,a=t.appName,s=t.accessToken,c={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(a,"/users/").concat(this.user,"/translate/support/language"),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s}};return o.kg.debug("Call getSupportedLanguages"),i.hj.call(this,c)}function s(e){if("string"!=typeof e.text||""===e.text)throw Error('Invalid parameter: "text"');if(!Array.isArray(e.languages))throw Error('Invalid parameter: "language"');var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.orgName,s=r.appName,c=r.accessToken,u="".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/users/").concat(this.user,"/translate"),l={text:e.text,to:e.languages},d={url:u,dataType:"json",type:"POST",data:JSON.stringify(l),headers:{Authorization:"Bearer "+c}};return o.kg.debug("Call translateMessage"),i.hj.call(this,d)}},3246:function(e,t,r){"use strict";r.d(t,{H7:function(){return l},XZ:function(){return c},_W:function(){return u}}),r(7941),r(9554),r(1539),r(4747),r(6699),r(2023);var n=r(5531),o=r(7252),i=r(7360);function a(){var e=this.context.appName,t=this.context.orgName;return!(!e||!t)||(this.onError&&this.onError({type:n.E.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function s(){var e,t=this.context.accessToken;if(!t){var r=o.Z.create({type:n.E.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return i.kg.debug("token not assign error",t),this.onError&&this.onError(r),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",r),!1}return!0}function c(){if(this._initWithAppId){if(!a.call(this))return{error:o.Z.create({type:n.E.WEBIM_CONNECTION_CLOSED,message:"not login"})};if(!s.call(this))return{error:o.Z.create({type:n.E.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"})}}else if(!a.call(this))return{error:o.Z.create({type:n.E.REST_PARAMS_STATUS,message:"appkey or token error"})};return{}}function u(e){var t=e.data,r=e.type;return{data:{status:Object.keys(t.errorKeys).length>0?"fail":"success",errorKeys:t.errorKeys,successKeys:t.successKeys},type:r}}function l(e){var t=e.data,r=void 0;return Object.keys(t.errorKeys).length>0&&Object.keys(t.errorKeys).forEach((function(e){var i=t.errorKeys[e];r=i.includes("is not part of you")?o.Z.create({type:n.E.NO_PERMISSION,message:i}):i.includes("size of metadata for this single chatroom exceeds the user defined limit")||i.includes("total size of chatroom metadata for this app exceeds the user defined limit")||i.includes("is exceeding maximum limit")?o.Z.create({type:n.E.MAX_LIMIT,message:i}):i.includes("is not Legal")?o.Z.create({type:n.E.REQUEST_PARAMETER_ERROR,message:i}):i.includes("Failed to update userMetadata. Concurrent updates not allowed")?o.Z.create({type:n.E.OPERATION_NOT_ALLOWED,message:i}):o.Z.create({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,message:i})})),r}},4319:function(e,t,r){"use strict";r.d(t,{Ge:function(){return h},Gf:function(){return i},Nt:function(){return c},XV:function(){return l},al:function(){return d},bh:function(){return f},ke:function(){return p},th:function(){return s},xd:function(){return u},xz:function(){return o},zj:function(){return a}});var n=r(5531),o=15e3,i=15e3,a=3e5,s=1e4,c=1e4,u=8e3,l=3e5,d=3e4,p=5,h=3,f=[n.E.MAX_LIMIT,n.E.WEBIM_TOKEN_EXPIRED,n.E.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,n.E.USER_NOT_FOUND,n.E.WEBIM_CONNCTION_AUTH_ERROR,n.E.REQUEST_PARAMETER_ERROR,n.E.WEBIM_CONNCTION_AUTH_ERROR,n.E.WEBIM_SERVER_SERVING_DISABLED]},2071:function(e,t,r){"use strict";r.d(t,{$x:function(){return s},F3:function(){return c},TJ:function(){return o},Tp:function(){return d},Wc:function(){return n},el:function(){return i},iB:function(){return u},iO:function(){return a},yK:function(){return l}}),r(6992),r(1532),r(1539),r(8783),r(3948);var n=7,o=new Map,i="im",a=new Map,s="32f24ab2ddb74f508aa9286c356cec84",c=1e3,u={INIT:9674,API:9675},l="direct",d=-1},1595:function(e,t,r){"use strict";var n,o,i,a,s,c;r.d(t,{C8:function(){return n},aC:function(){return c},c:function(){return i},dd:function(){return s},fI:function(){return o},td:function(){return a}}),function(e){e[e.UNKNOWOPERATION=-1]="UNKNOWOPERATION",e[e.REST_GET_SESSION_LIST=1]="REST_GET_SESSION_LIST",e[e.REST_DEL_SESSION=2]="REST_DEL_SESSION",e[e.REST_GET_HISTORY_MESSAGE=3]="REST_GET_HISTORY_MESSAGE",e[e.REST_PIN_CONVERSATION=4]="REST_PIN_CONVERSATION",e[e.REST_MARK_CONVERSATION=5]="REST_MARK_CONVERSATION",e[e.REST_UPLOAD_FILE_IN_PARTS=6]="REST_UPLOAD_FILE_IN_PARTS",e[e.REST_DELETE_MESSAGES_CONVERSATIONS=7]="REST_DELETE_MESSAGES_CONVERSATIONS",e[e.REST_PIN_MESSAGE=8]="REST_PIN_MESSAGE",e[e.REST_FETCH_PINMESSAGES=9]="REST_FETCH_PINMESSAGES",e[e.REST_OPERATE=100]="REST_OPERATE",e[e.MSYNC_SENDMESSAGE=101]="MSYNC_SENDMESSAGE",e[e.MSYNC_RECALLMESSAGE=102]="MSYNC_RECALLMESSAGE",e[e.MSYNC_MODIFYMESSAGE=103]="MSYNC_MODIFYMESSAGE",e[e.MSYNC_OPERATE=200]="MSYNC_OPERATE",e[e.ROSTER_ADD=201]="ROSTER_ADD",e[e.ROSTER_REMOVE=202]="ROSTER_REMOVE",e[e.ROSTER_ACCEPT=203]="ROSTER_ACCEPT",e[e.ROSTER_DECLINE=204]="ROSTER_DECLINE",e[e.ROSTER_BAN=205]="ROSTER_BAN",e[e.ROSTER_ALLOW=206]="ROSTER_ALLOW",e[e.ROSTER_BLACKLIST=207]="ROSTER_BLACKLIST",e[e.ROSTER_CONTACTS=208]="ROSTER_CONTACTS",e[e.ROSTER_GET_ALL_CONTACTS_REMARKS=209]="ROSTER_GET_ALL_CONTACTS_REMARKS",e[e.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE=210]="ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE",e[e.ROSTER_SET_CONTACT_REMARK=211]="ROSTER_SET_CONTACT_REMARK",e[e.ROSTER_OPERATE=300]="ROSTER_OPERATE",e[e.USER_LOGIN=301]="USER_LOGIN",e[e.USER_CREATE=302]="USER_CREATE",e[e.USER_UPDATE_USERINFO=303]="USER_UPDATE_USERINFO",e[e.USER_FETCH_USERINFO=304]="USER_FETCH_USERINFO",e[e.USER_UPDATE_NICK=305]="USER_UPDATE_NICK",e[e.USER_UPLOAD_PUSH_TOKEN=306]="USER_UPLOAD_PUSH_TOKEN",e[e.USER_LOGGEDIN_OTHER_PLATFORM=307]="USER_LOGGEDIN_OTHER_PLATFORM",e[e.USER_OPERATE=400]="USER_OPERATE",e[e.GROUP_CREATEGROUP=401]="GROUP_CREATEGROUP",e[e.GROUP_BLOCK_MESSAGE=402]="GROUP_BLOCK_MESSAGE",e[e.GROUP_FETCH_PUBLICGROUPS_WITHCURSOR=403]="GROUP_FETCH_PUBLICGROUPS_WITHCURSOR",e[e.GROUP_FETCH_USERS_GROUP=404]="GROUP_FETCH_USERS_GROUP",e[e.GROUP_CHANGE_OWNER=405]="GROUP_CHANGE_OWNER",e[e.GROUP_FETCH_SPECIFICATION=406]="GROUP_FETCH_SPECIFICATION",e[e.GROUP_CHANGE_GROUPATTRIBUTE=407]="GROUP_CHANGE_GROUPATTRIBUTE",e[e.GROUP_FETCH_MEMEBERS=408]="GROUP_FETCH_MEMEBERS",e[e.GROUP_GET_ADMIN=409]="GROUP_GET_ADMIN",e[e.GROUP_SET_ADMIN=410]="GROUP_SET_ADMIN",e[e.GROUP_REMOVE_ADMIN=411]="GROUP_REMOVE_ADMIN",e[e.GROUP_DESTOTYGROUP=412]="GROUP_DESTOTYGROUP",e[e.GROUP_LEAVEGROUP=413]="GROUP_LEAVEGROUP",e[e.GROUP_INVITE_TO_GROUP=414]="GROUP_INVITE_TO_GROUP",e[e.GROUP_JOIN_PUBLICGROUP=415]="GROUP_JOIN_PUBLICGROUP",e[e.GROUP_ACCEPT_JOINPUBLICGROUPAPPL=416]="GROUP_ACCEPT_JOINPUBLICGROUPAPPL",e[e.GROUP_DECLINE_JOINPUBLICGROUPAPPL=417]="GROUP_DECLINE_JOINPUBLICGROUPAPPL",e[e.GROUP_ACCEPT_INVITATION=418]="GROUP_ACCEPT_INVITATION",e[e.GROUP_DECLINE_INVITATION=419]="GROUP_DECLINE_INVITATION",e[e.GROUP_REMOVE_MEMBER=420]="GROUP_REMOVE_MEMBER",e[e.GROUP_REMOVE_MEMBERS=421]="GROUP_REMOVE_MEMBERS",e[e.GROUP_MUTE_MEMBERS=422]="GROUP_MUTE_MEMBERS",e[e.GROUP_UNMUTE_MEMBERS=423]="GROUP_UNMUTE_MEMBERS",e[e.GROUP_FETCH_MUTES=424]="GROUP_FETCH_MUTES",e[e.GROUP_BLOCK_MEMBER=425]="GROUP_BLOCK_MEMBER",e[e.GROUP_BLOCK_MEMBERS=426]="GROUP_BLOCK_MEMBERS",e[e.GROUP_UNBLOCK_MEMBER=427]="GROUP_UNBLOCK_MEMBER",e[e.GROUP_UNBLOCK_MEMBERS=428]="GROUP_UNBLOCK_MEMBERS",e[e.GROUP_GET_BLOCK_LIST=429]="GROUP_GET_BLOCK_LIST",e[e.GROUP_MUTE_ALLMEMBERS=430]="GROUP_MUTE_ALLMEMBERS",e[e.GROUP_UNMUTE_ALLMEMBERS=431]="GROUP_UNMUTE_ALLMEMBERS",e[e.GROUP_ADD_WHITELIST=432]="GROUP_ADD_WHITELIST",e[e.GROUP_REMOVE_WHITELIST=433]="GROUP_REMOVE_WHITELIST",e[e.GROUP_FETCH_WHITELIST=434]="GROUP_FETCH_WHITELIST",e[e.GROUP_IS_IN_WHITELIST=435]="GROUP_IS_IN_WHITELIST",e[e.GROUP_GET_READ_USERS=436]="GROUP_GET_READ_USERS",e[e.GROUP_FETCH_ANNOUNCEMENT=437]="GROUP_FETCH_ANNOUNCEMENT",e[e.GROUP_UPDATE_ANNOUNCEMENT=438]="GROUP_UPDATE_ANNOUNCEMENT",e[e.GROUP_UPLOAD_SHAREDFILE=439]="GROUP_UPLOAD_SHAREDFILE",e[e.GROUP_DELETE_SHAREDFILE=440]="GROUP_DELETE_SHAREDFILE",e[e.GROUP_FETCH_SHAREDFILE=441]="GROUP_FETCH_SHAREDFILE",e[e.GROUP_DOWNLOAD_SHAREDFILE=442]="GROUP_DOWNLOAD_SHAREDFILE",e[e.GROUP_MEMBER_SET_META_DATA=443]="GROUP_MEMBER_SET_META_DATA",e[e.GROUP_MEMBER_FETCH_META_DATA=444]="GROUP_MEMBER_FETCH_META_DATA",e[e.GROUP_OPERATE=500]="GROUP_OPERATE",e[e.CHATROOM_FETCH_CHATROOMSWITHPAGE=501]="CHATROOM_FETCH_CHATROOMSWITHPAGE",e[e.CHATROOM_CREATECHATROOM=502]="CHATROOM_CREATECHATROOM",e[e.CHATROOM_DESTORYCHATROOM=503]="CHATROOM_DESTORYCHATROOM",e[e.CHATROOM_FETCH_SPECIFICATION=504]="CHATROOM_FETCH_SPECIFICATION",e[e.CHATROOM_CHANGE_ATTRIBUTE=505]="CHATROOM_CHANGE_ATTRIBUTE",e[e.CHATROOM_REMOVE_MEMBER=506]="CHATROOM_REMOVE_MEMBER",e[e.CHATROOM_REMOVE_MEMBERS=507]="CHATROOM_REMOVE_MEMBERS",e[e.CHATROOM_ADD_MEMBERS=508]="CHATROOM_ADD_MEMBERS",e[e.CHATROOM_JOINCAHTROOM=509]="CHATROOM_JOINCAHTROOM",e[e.CHATROOM_LEAVECAHTROOM=510]="CHATROOM_LEAVECAHTROOM",e[e.CHATROOM_FETCH_MEMBERS=511]="CHATROOM_FETCH_MEMBERS",e[e.CHATROOM_GET_ADMIN=512]="CHATROOM_GET_ADMIN",e[e.CHATROOM_SET_ADMIN=513]="CHATROOM_SET_ADMIN",e[e.CHATROOM_REMOVE_ADMIN=514]="CHATROOM_REMOVE_ADMIN",e[e.CHATROOM_MUTE_USER=515]="CHATROOM_MUTE_USER",e[e.CHATROOM_UNMUTE_USER=516]="CHATROOM_UNMUTE_USER",e[e.CHATROOM_FETCH_MUTES=517]="CHATROOM_FETCH_MUTES",e[e.CHATROOM_BLOCK_USER=518]="CHATROOM_BLOCK_USER",e[e.CHATROOM_BLOCK_USERS=519]="CHATROOM_BLOCK_USERS",e[e.CHATROOM_UNBLOCK_USER=520]="CHATROOM_UNBLOCK_USER",e[e.CHATROOM_UNBLOCK_USERS=521]="CHATROOM_UNBLOCK_USERS",e[e.CHATROOM_FETCH_BANS=522]="CHATROOM_FETCH_BANS",e[e.CHATROOM_MUTE_ALLMEMEBERS=523]="CHATROOM_MUTE_ALLMEMEBERS",e[e.CHATROOM_UNMUTE_ALLMEMEBERS=524]="CHATROOM_UNMUTE_ALLMEMEBERS",e[e.CHATROOM_ADD_WHITELIST=525]="CHATROOM_ADD_WHITELIST",e[e.CHATROOM_REMOVE_WHITELIST=526]="CHATROOM_REMOVE_WHITELIST",e[e.CHATROOM_FETCH_WHITELIST=527]="CHATROOM_FETCH_WHITELIST",e[e.CHATROOM_FETCH_MEMBERIN_WHITELIST=528]="CHATROOM_FETCH_MEMBERIN_WHITELIST",e[e.CHATROOM_FETCH_ANNOUNCEMENT=529]="CHATROOM_FETCH_ANNOUNCEMENT",e[e.CHATROOM_UPDATE_ANNOUNCEMENT=530]="CHATROOM_UPDATE_ANNOUNCEMENT",e[e.CHATROOM_REMOVE_SHARE_FILE=531]="CHATROOM_REMOVE_SHARE_FILE",e[e.CHATROOM_GET_SHARE_FILE_LIST=532]="CHATROOM_GET_SHARE_FILE_LIST",e[e.CHATROOM_UPLOAD_FILE=533]="CHATROOM_UPLOAD_FILE",e[e.CHATROOM_SET_META_DATA=534]="CHATROOM_SET_META_DATA",e[e.CHATROOM_DELETE_META_DATA=535]="CHATROOM_DELETE_META_DATA",e[e.CHATROOM_FETCH_META_DATA=536]="CHATROOM_FETCH_META_DATA",e[e.CHATROOM_FETCH_USER_JOINED_CHATROOM=537]="CHATROOM_FETCH_USER_JOINED_CHATROOM",e[e.CHATROOM_OPERATE=600]="CHATROOM_OPERATE"}(n||(n={})),function(e){e.SDK_INTERNAL="SDK_INTERNAL",e.LOGIN="USER_LOGIN",e.REGISTER="USER_CREATE",e.GET_CHATROOM_LIST="CHATROOM_FETCH_CHATROOMSWITHPAGE",e.CREATE_CHATROOM="CHATROOM_CREATECHATROOM",e.DESTROY_CHATROOM="CHATROOM_DESTORYCHATROOM",e.GET_CHATROOM_DETAIL="CHATROOM_FETCH_SPECIFICATION",e.MODIFY_CHATROOM="CHATROOM_CHANGE_ATTRIBUTE",e.REMOVE_CHATROOM_MEMBER="CHATROOM_REMOVE_MEMBER",e.MULTI_REMOVE_CHATROOM_MEMBER="CHATROOM_REMOVE_MEMBERS",e.ADD_USERS_TO_CHATROOM="CHATROOM_ADD_MEMBERS",e.JOIN_CHATROOM="CHATROOM_JOINCAHTROOM",e.QUIT_CHATROOM="CHATROOM_LEAVECAHTROOM",e.LIST_CHATROOM_MEMBERS="CHATROOM_FETCH_MEMBERS",e.GET_CHATROOM_ADMIN="CHATROOM_GET_ADMIN",e.SET_CHATROOM_ADMIN="CHATROOM_SET_ADMIN",e.REMOVE_CHATROOM_ADMIN="CHATROOM_REMOVE_ADMIN",e.MUTE_CHATROOM_MEMBER="CHATROOM_MUTE_USER",e.REMOVE_MUTE_CHATROOM_MEMBER="CHATROOM_UNMUTE_USER",e.GET_MUTE_CHATROOM_MEMBERS="CHATROOM_FETCH_MUTES",e.SET_CHATROOM_MEMBER_TO_BLACK="CHATROOM_BLOCK_USER",e.MULTI_SET_CHATROOM_MEMBER_TO_BLACK="CHATROOM_BLOCK_USERS",e.REMOVE_CHATROOM_MEMBER_BLACK="CHATROOM_UNBLOCK_USER",e.MULTI_REMOVE_CHATROOM_MEMBER_BLACK="CHATROOM_UNBLOCK_USERS",e.GET_CHATROOM_BLOCK_MEMBERS="CHATROOM_FETCH_BANS",e.DISABLED_CHATROOM_SEND_MSG="CHATROOM_MUTE_ALLMEMEBERS",e.ENABLE_CHATROOM_SEND_MSG="CHATROOM_UNMUTE_ALLMEMEBERS",e.ADD_CHATROOM_WHITE_USERS="CHATROOM_ADD_WHITELIST",e.REMOVE_CHATROOM_WHITE_USERS="CHATROOM_REMOVE_WHITELIST",e.GET_CHATROOM_WHITE_USERS="CHATROOM_FETCH_WHITELIST",e.CHECK_CHATROOM_WHITE_USER="CHATROOM_FETCH_MEMBERIN_WHITELIST",e.GET_CHATROOM_ANN="CHATROOM_FETCH_ANNOUNCEMENT",e.UPDATE_CHATROOM_ANN="CHATROOM_UPDATE_ANNOUNCEMENT",e.DELETE_CHATROOM_FILE="CHATROOM_REMOVE_SHARE_FILE",e.GET_CHATROOM_FILES="CHATROOM_GET_SHARE_FILE_LIST",e.UPLOAD_CHATROOM_FILE="CHATROOM_UPLOAD_FILE",e.SET_CHATROOM_ATTR="CHATROOM_SET_META_DATA",e.DELETE_CHATROOM_ATTR="CHATROOM_DELETE_META_DATA",e.GET_CHATROOM_ATTR="CHATROOM_FETCH_META_DATA",e.GET_USER_JOINED_CHATROOM="CHATROOM_FETCH_USER_JOINED_CHATROOM",e.CREATE_GROUP="GROUP_CREATEGROUP",e.BLOCK_GROUP="GROUP_BLOCK_MESSAGE",e.LIST_GROUP="GROUP_FETCH_PUBLICGROUPS_WITHCURSOR",e.GET_USER_GROUP="GROUP_FETCH_USERS_GROUP",e.CHANGE_OWNER="GROUP_CHANGE_OWNER",e.GET_GROUP_INFO="GROUP_FETCH_SPECIFICATION",e.MODIFY_GROUP="GROUP_CHANGE_GROUPATTRIBUTE",e.LIST_GROUP_MEMBER="GROUP_FETCH_MEMEBERS",e.GET_GROUP_ADMIN="GROUP_GET_ADMIN",e.SET_GROUP_ADMIN="GROUP_SET_ADMIN",e.REMOVE_GROUP_ADMIN="GROUP_REMOVE_ADMIN",e.DISSOLVE_GROUP="GROUP_DESTOTYGROUP",e.QUIT_GROUP="GROUP_LEAVEGROUP",e.INVITE_TO_GROUP="GROUP_INVITE_TO_GROUP",e.JOIN_GROUP="GROUP_JOIN_PUBLICGROUP",e.AGREE_JOIN_GROUP="GROUP_ACCEPT_JOINPUBLICGROUPAPPL",e.REJECT_JOIN_GROUP="GROUP_DECLINE_JOINPUBLICGROUPAPPL",e.AGREE_INVITE_GROUP="GROUP_ACCEPT_INVITATION",e.REJECT_INVITE_GROUP="GROUP_DECLINE_INVITATION",e.REMOVE_GROUP_MEMBER="GROUP_REMOVE_MEMBER",e.MULTI_REMOVE_GROUP_MEMBER="GROUP_REMOVE_MEMBERS",e.MUTE_GROUP_MEMBER="GROUP_MUTE_MEMBERS",e.UNMUTE_GROUP_MEMBER="GROUP_UNMUTE_MEMBERS",e.GET_GROUP_MUTE_LIST="GROUP_FETCH_MUTES",e.BLOCK_GROUP_MEMBER="GROUP_BLOCK_MEMBER",e.BLOCK_GROUP_MEMBERS="GROUP_BLOCK_MEMBERS",e.UNBLOCK_GROUP_MEMBER="GROUP_UNBLOCK_MEMBER",e.UNBLOCK_GROUP_MEMBERS="GROUP_UNBLOCK_MEMBERS",e.GET_GROUP_BLACK_LIST="GROUP_GET_BLOCK_LIST",e.DISABLED_SEND_GROUP_MSG="GROUP_MUTE_ALLMEMBERS",e.ENABLE_SEND_GROUP_MSG="GROUP_UNMUTE_ALLMEMBERS",e.ADD_USERS_TO_GROUP_WHITE="GROUP_ADD_WHITELIST",e.REMOVE_GROUP_WHITE_MEMBER="GROUP_REMOVE_WHITELIST",e.GET_GROUP_WHITE_LIST="GROUP_FETCH_WHITELIST",e.IS_IN_GROUP_WHITE_LIST="GROUP_IS_IN_WHITELIST",e.GET_GROUP_MSG_READ_USER="GROUP_GET_READ_USERS",e.GET_GROUP_ANN="GROUP_FETCH_ANNOUNCEMENT",e.UPDATE_GROUP_ANN="GROUP_UPDATE_ANNOUNCEMENT",e.UPLOAD_GROUP_FILE="GROUP_UPLOAD_SHAREDFILE",e.DELETE_GROUP_FILE="GROUP_DELETE_SHAREDFILE",e.GET_GROUP_FILE_LIST="GROUP_FETCH_SHAREDFILE",e.DOWN_GROUP_FILE="GROUP_DOWNLOAD_SHAREDFILE",e.SET_GROUP_MEMBER_ATTRS="GROUP_MEMBER_SET_META_DATA",e.GET_GROUP_MEMBER_ATTR="GROUP_MEMBER_FETCH_META_DATA",e.GET_SESSION_LIST="REST_GET_SESSION_LIST",e.DELETE_SESSION="REST_DEL_SESSION",e.GET_HISTORY_MSG="REST_GET_HISTORY_MESSAGE",e.PIN_CONVERSATION="REST_PIN_CONVERSATION",e.REST_UPLOAD_FILE_IN_PARTS="REST_UPLOAD_FILE_IN_PARTS",e.REST_DELETE_MESSAGES_CONVERSATIONS="REST_DELETE_MESSAGES_CONVERSATIONS",e.MARK_CONVERSATION="REST_MARK_CONVERSATION",e.REST_FETCH_PINMESSAGES="REST_FETCH_PINMESSAGES",e.REST_PIN_MESSAGE="REST_PIN_MESSAGE",e.UPDATE_USER_INFO="USER_UPDATE_USERINFO",e.GET_USER_INFO="USER_FETCH_USERINFO",e.UPDATE_USER_NICK="USER_UPDATE_NICK",e.UPLOAD_PUSH_TOKEN="USER_UPLOAD_PUSH_TOKEN",e.USER_LOGGEDIN_OTHER_PLATFORM="USER_LOGGEDIN_OTHER_PLATFORM",e.GET_BLACK_LIST="ROSTER_BLACKLIST",e.GET_CONTACTS="ROSTER_CONTACTS",e.ROSTER_GET_ALL_CONTACTS_REMARKS="ROSTER_GET_ALL_CONTACTS_REMARKS",e.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE="ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE",e.ROSTER_SET_CONTACT_REMARK="ROSTER_SET_CONTACT_REMARK",e.ROSTER_ADD="ROSTER_ADD",e.ROSTER_REMOVE="ROSTER_REMOVE",e.ROSTER_ACCEPT="ROSTER_ACCEPT",e.ROSTER_DECLINE="ROSTER_DECLINE",e.ROSTER_BAN="ROSTER_BAN",e.ROSTER_ALLOW="ROSTER_ALLOW",e.SEND_MSG="MSYNC_SENDMESSAGE",e.UPLOAD_MSG_ATTACH="UPLOAD_MSG_ATTACH",e.SEND_RECALL_MSG="MSYNC_RECALLMESSAGE",e.MODIFY_MESSAGE="MSYNC_MODIFYMESSAGE"}(o||(o={})),function(e){e.GET_DNS="REST_DNSLIST",e.LOGIN_BY_AGORA_TOKEN="LOGIN_BY_AGORA_TOKEN",e.LOGIN_BY_PWD="LOGIN_BY_PWD",e.RESISTER="REGISTER",e.REST_INIT_UPLOAD_TASK_IN_PARTS="REST_INIT_UPLOAD_TASK_IN_PARTS",e.REST_UPLOAD_PART="REST_UPLOAD_PART",e.REST_COMPLETE_UPLOAD_PART="REST_COMPLETE_UPLOAD_PART",e.REST_ABORT_UPLOAD_PART="REST_ABORT_UPLOAD_PART",e.CONNECT_WEBSOCKET="CONNECT_WEBSOCKET"}(i||(i={})),function(e){e[e["5G"]=7]="5G",e[e["4G"]=7]="4G",e[e["3G"]=7]="3G",e[e["2G"]=7]="2G",e[e["SLOW-2G"]=7]="SLOW-2G",e[e.WIFI=2]="WIFI",e[e.LAN=1]="LAN",e[e.DISCONNECTED=0]="DISCONNECTED",e[e.NONE=0]="NONE",e[e.UNKNOWN=-1]="UNKNOWN",e[e["WEBIM UNABLE TO GET"]=-2]="WEBIM UNABLE TO GET"}(a||(a={})),function(e){e[e.success=200]="success",e[e.failed=500]="failed",e[e.disconnect=-1]="disconnect",e[e.closed=401]="closed",e[e.notFound=404]="notFound",e[e.reachLimit=429]="reachLimit"}(s||(s={})),function(e){e[e.web=0]="web",e[e.native=1]="native"}(c||(c={}))},6424:function(e,t,r){"use strict";r.d(t,{gA:function(){return L},ZP:function(){return Ne}}),r(9601),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(7042),r(2222),r(3710),r(7941),r(9714),r(3843),r(8309),r(2772),r(5212),r(7327),r(5827),r(9826),r(4553),r(561),r(9653),r(1038),r(2564),r(9575),r(2472),r(2990),r(8927),r(3105),r(5035),r(4345),r(7174),r(2846),r(4731),r(7209),r(6319),r(8867),r(7789),r(3739),r(9368),r(4483),r(2056),r(3462),r(678),r(7462),r(3824),r(5021),r(2974),r(5016),r(6699),r(2023),r(3161),r(4048),r(9753),r(9554),r(4747),r(285),r(1637),r(8145),r(1249),r(4812);var n=r(4188),o=r.n(n),i=r(3720),a=r.n(i),s=r(5531),c=r(8161),u=r(7360),l=["public","members_only","allow_user_invites","invite_need_confirm"],d={name:"name",title:"name",description:"description",public:"public",members_only:"approval",allow_user_invites:"allowInvites",max_users:"maxUsers",invite_need_confirm:"inviteNeedConfirm",custom:"ext",last_modified:"lastModified"};function p(e,t){var r,n,o,i,a,s,c=this,u=this.context,p=u.userId,h=u.jid,f=t.from.name===p&&h.clientResource!==t.from.clientResource;return t.isThread?(o={id:t.mucId.name,name:t.mucName,operation:"",parentId:t.mucParentId.name,operator:t.from.name,userName:t.to.length?t.to[0].name:""},i={chatThreadId:t.mucId.name,chatThreadName:t.mucName,operation:"",parentId:t.mucParentId.name}):(n={type:"",owner:t.from.name,gid:t.mucId.name,from:t.from.name,fromJid:t.from,to:t.to.length?t.to[0].name:"",toJid:t.to,chatroom:t.isChatroom,status:t.status},a={operation:"",id:t.mucId.name,from:t.from.name},t.isChatroom&&(null===(r=null==t?void 0:t.eventInfo)||void 0===r?void 0:r.ext)&&(s=JSON.parse(t.eventInfo.ext))),({45:function(){var e,r,n;a.operation="memberAttributesUpdate";var o=JSON.parse(null===(e=null==t?void 0:t.eventInfo)||void 0===e?void 0:e.ext)||{};a.attributes=o.properties||{},a.userId=o.username||"",f?null===(r=c.eventHandler)||void 0===r||r.dispatch("onMultiDeviceEvent",a):null===(n=c.eventHandler)||void 0===n||n.dispatch("onGroupEvent",a)},44:function(){var e;a.operation="removeChatRoomAttributes",a.attributes=s.result.successKeys,s.result.successKeys.length>0&&(null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a))},43:function(){var e;a.operation="updateChatRoomAttributes";var t={};s.result.successKeys.forEach((function(e){t[e]=s.properties[e]})),a.attributes=t,s.result.successKeys.length>0&&(null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a))},42:function(){},41:function(){},40:function(){},39:function(){},38:function(){var e;i.operation="chatThreadNameUpdate",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},37:function(){var e;o.operation="userRemove",null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatThreadChange",o)},36:function(){var e;i.operation="chatThreadLeave",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},35:function(){var e;i.operation="chatThreadJoin",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},34:function(){var e;i.operation="chatThreadDestroy",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},33:function(){var e;i.operation="chatThreadCreate",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},32:function(){var e,r,o,i;n.type=t.isChatroom?"rmChatRoomMute":"rmGroupMute",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="unmuteAllMembers",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},31:function(){var e,r,o,i;n.type=t.isChatroom?"muteChatRoom":"muteGroup",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="muteAllMembers",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},30:function(){var e,r,o,i;n.type=t.isChatroom?"rmUserFromChatRoomWhiteList":"rmUserFromGroupWhiteList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeAllowlistMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},29:function(){var e,r,o,i;n.type=t.isChatroom?"addUserToChatRoomWhiteList":"addUserToGroupWhiteList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="addUserToAllowlist",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},28:function(){var e,r,o,i;n.type="deleteFile",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="deleteFile",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},27:function(){var e,r,o,i;n.type="uploadFile",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="uploadFile",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},26:function(){var e,r,o,i;n.type="deleteAnnouncement",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="deleteAnnouncement",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},25:function(){var e,r,o,i;n.type="updateAnnouncement",n.announcement=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="updateAnnouncement",a.announcement=t.reason,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},24:function(){var e,r,o,i;n.type="removeMute",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="unmuteMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},23:function(){var e,r,o,i;if(n.type="addMute",c.onPresence&&c.onPresence(n),t.ext&&"string"==typeof t.ext){var s=JSON.parse(t.ext);s.user_mute_time&&(n.muteTimestamp=s.user_mute_time,a.muteTimestamp=s.user_mute_time)}t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="muteMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},22:function(){var e,r,o,i;n.type="removeAdmin",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeAdmin",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},21:function(){var e,r,o,i;n.type="addAdmin",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="setAdmin",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},20:function(){var e,r,o,i;n.type="changeOwner",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="changeOwner",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},19:function(){var e,r,o,i;n.type="direct_joined",n.groupName=t.mucName,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="directJoined",a.name=t.mucName,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},18:function(){var e,r,o,i;n.type=t.isChatroom?"leaveChatRoom":"leaveGroup",c.onPresence&&c.onPresence(n);var s=t.mucMemberCount;s&&(a.memberCount=s),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="memberAbsence",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},17:function(){var e,r,o,i;t.isChatroom&&t.ext&&(a.ext=t.ext,n.ext=t.ext),n.type=t.isChatroom?"memberJoinChatRoomSuccess":"memberJoinPublicGroupSuccess",c.onPresence&&c.onPresence(n);var s=t.mucMemberCount;t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="memberPresence",s&&(a.memberCount=s),t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},16:function(){var e,r;n.type="unblock",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},15:function(){var e,r;n.type="block",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},14:function(){var e,r,o,i,s,u=t.isChatroom;if(!u){var p=JSON.parse((null===(e=null==t?void 0:t.eventInfo)||void 0===e?void 0:e.ext)||"{}",(function(e,t){return"last_modified"===e?Number(t):l.includes(e)?"true"===t||!0===t:t}));a.detail=n.detail={},Object.keys(p).forEach((function(e){var t=d[e];if(t){var r=p[e];a.detail&&(a.detail[t]=r),n.detail&&(n.detail[t]=r)}}))}n.type="update",c.onPresence&&c.onPresence(n),u?null===(r=c.eventHandler)||void 0===r||r.dispatch("onChatroomChange",n):null===(o=c.eventHandler)||void 0===o||o.dispatch("onGroupChange",n),a.operation="updateInfo",u?null===(i=c.eventHandler)||void 0===i||i.dispatch("onChatroomEvent",a):null===(s=c.eventHandler)||void 0===s||s.dispatch("onGroupEvent",a)},13:function(){var e,r,o,i;n.type="allow",n.reason=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),t.reason&&(a.reason=t.reason),a.operation="unblockMember",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},12:function(){var e,r;n.type="ban",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},11:function(){var e,r;n.type="getBlackList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},10:function(){var e,r,o,i;n.type="removedFromGroup",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeMember",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},9:function(){var e,r,o,i;n.type="invite_decline",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="rejectInvite",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},8:function(){var e,r,o,i;n.type="invite_accept",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="acceptInvite",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},7:function(){var e,r,o,i;n.type="invite",n.kicked=n.to,n.groupName=t.mucName,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="inviteToJoin",a.name=t.mucName,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},6:function(){var e,r,o,i;n.type="joinPublicGroupDeclined",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="joinPublicGroupDeclined",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):(a.userId=t.to.length?t.to[0].name:"",null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a))},5:function(){var e,r,o,i;n.type="joinPublicGroupSuccess",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="acceptRequest",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},4:function(){var e,r,o,i;n.type="joinGroupNotifications",n.reason=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),t.reason&&(a.reason=t.reason),a.operation="requestToJoin",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},3:function(){var e,r;n.type="leave",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},2:function(){var e,r;n.type="join",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},1:function(){var e,r,o,i;n.type="deleteGroupChat",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="destroy",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},0:function(){var e,r;a.operation="create",t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupEvent",a)}}[e]||function(){console.error("No match operation ".concat(e))})()}var h=function(e){var t=this.root.lookup("easemob.pb.MUCBody").decode(e.payload),r=t.operation;u.kg.debug("onMucMessage",t),p.call(this,r,t)},f={handleRosterMsg:function(e){var t,r,n,o,i,a,s=this.root.lookup("easemob.pb.RosterBody").decode(e.payload),c={type:"",to:s.to[0].name,from:s.from.name,status:s.reason};switch(s.operation){case 2:c.type="subscribe",this.onContactInvited&&this.onContactInvited(c),null===(t=this.eventHandler)||void 0===t||t.dispatch("onContactInvited",c);break;case 3:c.type="unsubscribed",this.onContactDeleted&&this.onContactDeleted(c),null===(r=this.eventHandler)||void 0===r||r.dispatch("onContactDeleted",c);break;case 4:c.type="subscribed",this.onContactAdded&&this.onContactAdded(c),null===(n=this.eventHandler)||void 0===n||n.dispatch("onContactAdded",c);break;case 5:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(o=this.eventHandler)||void 0===o||o.dispatch("onContactRefuse",c);break;case 6:case 7:break;case 8:c.type="subscribed",this.onContactAgreed&&this.onContactAgreed(c),null===(i=this.eventHandler)||void 0===i||i.dispatch("onContactAgreed",c);break;case 9:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(a=this.eventHandler)||void 0===a||a.dispatch("onContactRefuse",c);break;default:u.kg.error("handleRosterMsg:",s)}this.onPresence&&c.type&&this.onPresence(c)}},m=r(7252),g=function(e){var t,r,n,o,i,a,c=this.root.lookup("easemob.pb.StatisticsBody").decode(e.payload),l=c.operation,d=c.reason;switch(l){case 0:this.onStatisticMessage&&this.onStatisticMessage(c),null===(t=this.eventHandler)||void 0===t||t.dispatch("onStatisticMessage",c);break;case 1:a=m.Z.create({type:s.E.WEBIM_CONNCTION_USER_REMOVED,message:"user has been removed"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(r=this.eventHandler)||void 0===r||r.dispatch("onError",a);break;case 2:a=m.Z.create({type:s.E.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE,message:"the user is already logged on another device"}),d&&(a.data={loginInfoCustomExt:c.reason}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(n=this.eventHandler)||void 0===n||n.dispatch("onError",a);break;case 3:a=m.Z.create({type:s.E.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD,message:"the user was kicked by changing password"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",a);break;case 4:a=m.Z.create({type:s.E.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE,message:"the user was kicked by other device"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(i=this.eventHandler)||void 0===i||i.dispatch("onError",a);break;default:u.kg.error("handleStatisticsMsg:",c)}},v=(r(9720),r(4024)),E=r(4363),y=r(9937);function _(e){var t,r=[],n=[],o=e.data;o&&o.values&&o.values.forEach((function(e){Object.entries(e.status).forEach((function(e){n.push({device:e[0],status:Number(e[1])})})),r.push({userId:e.uid,lastTime:Number(e.last_time),expire:Number(e.expiry),ext:e.ext,statusDetails:n})})),this.onPresenceStatusChange&&this.onPresenceStatusChange(r),null===(t=this.eventHandler)||void 0===t||t.dispatch("onPresenceStatusChange",r)}function T(e){var t=this;e.data.forEach((function(e){var r,n={from:e.from,to:e.to,chatType:"chat"===e.channel_type?"singleChat":"groupChat",messageId:e.messageId,reactions:e.reactions,ts:e.ts};null===(r=t.eventHandler)||void 0===r||r.dispatch("onReactionChange",n)}))}function I(e){var t,r,n,o;if(e.data){var i=e.data,a={id:i.id||"",name:i.name||"",parentId:i.muc_parent_id||"",messageId:i.msg_parent_id||"",timestamp:i.timestamp||0,operator:i.from||"",operation:""};switch(i.operation){case"create":a.operation="create",a.createTimestamp=a.timestamp,a.messageCount=0,null===(t=this.eventHandler)||void 0===t||t.dispatch("onChatThreadChange",a);break;case"update_msg":a.operation="update",a.messageCount=i.message_count,i.last_message&&"{}"!==JSON.stringify(i.last_message)?a.lastMessage=E.w.call(this,i.last_message):"{}"===JSON.stringify(i.last_message)&&(a.lastMessage={}),null===(r=this.eventHandler)||void 0===r||r.dispatch("onChatThreadChange",a);break;case"update":a.operation="update",a.messageCount=i.message_count,null===(n=this.eventHandler)||void 0===n||n.dispatch("onChatThreadChange",a);break;case"delete":a.operation="destroy",null===(o=this.eventHandler)||void 0===o||o.dispatch("onChatThreadChange",a)}}}function O(e){var t,r=e.data;if(r.resource!==this.clientResource){var n={operation:"deleteRoaming",conversationId:r.to,chatType:"chat"===r.chatType?"singleChat":"groupChat",resource:r.resource};null===(t=this.eventHandler)||void 0===t||t.dispatch("onMultiDeviceEvent",n)}}function R(e){var t,r,n=e.data,o="";if(this.clientResource!==n.res||n.from!==this.user){switch(n.op){case"del":o="deleteConversation";break;case"top":o="pinnedConversation";break;case"not_top":o="unpinnedConversation";break;case"mark":o="markConversation";break;case"mark_delete":o="unMarkConversation";break;case"pin":o="pin";break;case"pin_delete":o="unpin";break;default:return void u.kg.error("unexpected conversation op:",n.op)}if("pin"!==o&&"unpin"!==o){var i={operation:o,conversationId:n.id,conversationType:"chat"===n.type?"singleChat":"groupChat",timestamp:n.ts};"markConversation"!==i.operation&&"unMarkConversation"!==i.operation||n.ext&&(i.conversationMark=y.Z[n.ext]),null===(r=this.eventHandler)||void 0===r||r.dispatch("onMultiDeviceEvent",i)}else{var a=n.ext,s=n.from,c=n.id,l=n.type,d=n.ts,p={messageId:a||"",conversationId:"chat"===l?s:c,conversationType:E.U[l],operation:o,operatorId:s,time:d};null===(t=this.eventHandler)||void 0===t||t.dispatch("onMessagePinEvent",p)}}}function C(e){var t,r=this;null===(t=e.values)||void 0===t||t.forEach((function(e){var t,n,o,i,a;if(e.operator_resource!==r.clientResource)if("ignoreInterval"in e.data){var s={operation:"setSilentModeForUser",resource:e.operator_resource,data:e.data};null===(t=r.eventHandler)||void 0===t||t.dispatch("onMultiDeviceEvent",s)}else"group"in e?(s={operation:0===Object.keys(null!==(n=e.data)&&void 0!==n?n:{}).length?"removeSilentModeForConversation":"setSilentModeForConversation",resource:e.operator_resource,conversationId:e.group,type:"groupChat",data:e.data},null===(o=r.eventHandler)||void 0===o||o.dispatch("onMultiDeviceEvent",s)):(s={operation:0===Object.keys(null!==(i=e.data)&&void 0!==i?i:{}).length?"removeSilentModeForConversation":"setSilentModeForConversation",resource:e.operator_resource,conversationId:e.user,type:"singleChat",data:e.data},null===(a=r.eventHandler)||void 0===a||a.dispatch("onMultiDeviceEvent",s))}))}var N=function(e){var t=v.P6.parseNotify(e.payload);switch(t.type){case"presence":_.call(this,t);break;case"reaction":T.call(this,t);break;case"thread":I.call(this,t);break;case"roaming_delete":O.call(this,t);break;case"conv":R.call(this,t);break;case"user_notification_mute":C.call(this,t);break;default:u.kg.error("unexpected notify type: ".concat(t.type))}},S=r(7288),b=r(9743),A=2,M=r(4998),w=r(6801),k=r(2071),U=r(1595),P=r(4319);function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}var L,D,j,G=function(){return G=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},G.apply(this,arguments)},B=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},H=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},F=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};!function(e){e[e.NORMAL=0]="NORMAL",e[e.SINGLECHAT=1]="SINGLECHAT",e[e.GROUPCHAT=2]="GROUPCHAT",e[e.CHATROOM=3]="CHATROOM",e[e.READ_ACK=4]="READ_ACK",e[e.DELIVER_ACK=5]="DELIVER_ACK",e[e.RECALL=6]="RECALL",e[e.CHANNEL_ACK=7]="CHANNEL_ACK",e[e.EDIT=8]="EDIT"}(L||(L={})),function(e){e[e.APNs=0]="APNs",e[e.FCM=1]="FCM",e[e.HMSPUSH=2]="HMSPUSH",e[e.MIPUSH=3]="MIPUSH",e[e.MEIZUPUSH=4]="MEIZUPUSH",e[e.VIVOPUSH=5]="VIVOPUSH",e[e.OPPOPUSH=6]="OPPOPUSH",e[e.HONORPUSH=7]="HONORPUSH"}(D||(D={})),function(e){e[e.OK=0]="OK",e[e.FAIL=1]="FAIL",e[e.UNAUTHORIZED=2]="UNAUTHORIZED",e[e.MISSING_PARAMETER=3]="MISSING_PARAMETER",e[e.WRONG_PARAMETER=4]="WRONG_PARAMETER",e[e.REDIRECT=5]="REDIRECT",e[e.TOKEN_EXPIRED=6]="TOKEN_EXPIRED",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.NO_ROUTE=8]="NO_ROUTE",e[e.UNKNOWN_COMMAND=9]="UNKNOWN_COMMAND",e[e.PB_PARSER_ERROR=10]="PB_PARSER_ERROR",e[e.BIND_ANOTHER_DEVICE=11]="BIND_ANOTHER_DEVICE",e[e.IM_FORBIDDEN=12]="IM_FORBIDDEN",e[e.TOO_MANY_DEVICES=13]="TOO_MANY_DEVICES",e[e.PLATFORM_LIMIT=14]="PLATFORM_LIMIT",e[e.USER_MUTED=15]="USER_MUTED",e[e.ENCRYPT_DISABLE=16]="ENCRYPT_DISABLE",e[e.ENCRYPT_ENABLE=17]="ENCRYPT_ENABLE",e[e.DECRYPT_FAILURE=18]="DECRYPT_FAILURE",e[e.PERMISSION_DENIED_EXTERNAL=19]="PERMISSION_DENIED_EXTERNAL"}(j||(j={}));var W=["txt","img","video","audio","file","loc","custom","cmd","combine"],q=v.P6.getEnvInfo();function K(){var e,t,r,n,o="webim",i="",a="",s=[],c=(new Date).valueOf(),l=v.P6.getDevicePlatform(q);if(this.isFixedDeviceId){var d=v.P6.getLocalDeviceInfo();if(d){var p=JSON.parse(d);o=p.deviceId,i=p.deviceName,a=p.deviceUuid}else"webim"===this.deviceId?(a="".concat(l,"_").concat(c.toString()),o="".concat(this.deviceId,"_").concat(a),i=this.deviceId):o=i=a="webim_".concat(l,"_").concat(this.deviceId),v.P6.setLocalDeviceInfo(JSON.stringify({deviceId:o,deviceName:i,deviceUuid:a}))}else"webim"===this.deviceId?(a="random_".concat(l,"_").concat(c.toString()),o="".concat(this.deviceId,"_").concat(a),i=this.deviceId):o=i=a="webim_".concat(l,"_").concat(this.deviceId);this.context.jid&&(this.context.jid.clientResource=o);var h=this.root.lookup("easemob.pb.Provision"),f=h.decode(s);f.compressType=this.compressType,f.encryptType=this.encryptType,f.osType=this.osType,f.version=this.version,f.deviceName=i,f.resource=o,f.deviceUuid=a,f.authToken='{"token":"$t$'+this.token+'"}',f.sessionId=Date.now().toString()+":",this.loginInfoCustomExt&&(f.reason=this.loginInfoCustomExt),u.kg.debug("provision info",{version:this.version,resource:o,isFixedDeviceId:this.isFixedDeviceId,loginInfoCustomExt:!!this.loginInfoCustomExt,token:(null===(t=null===(e=this.token)||void 0===e?void 0:e.slice)||void 0===t?void 0:t.call(e,0,10))+"...",userId:null===(n=null===(r=this.context)||void 0===r?void 0:r.jid)||void 0===n?void 0:n.name}),f.actionVersion="v5.0",f=h.encode(f).finish();var m=this.root.lookup("easemob.pb.MSync"),g=m.decode(s);return g.version=this.version,g.guid=this.context.jid,g.auth="$t$"+this.token,g.command=3,g.deviceId=i,g.serviceId=this.dataReport.getServiceId(),g.encryptType=this.encryptType,g.payload=f,m.encode(g).finish()}function z(e,t){var r=this,n=v.P6.getEnvInfo();if("zfb"===n.platform||"dd"===n.platform){for(var i="",a=0;a<e.length;a++)i+=String.fromCharCode(e[a]);return{data:i=o().btoa(i),isBuffer:!1,complete:function(){},fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||(u.kg.debug("send message fail and reconnect"),r.reconnecting||r.reconnect()),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}var s=e;return{data:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||r.reconnecting||r.reconnect(),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}function V(e,t){var r;return B(this,void 0,void 0,(function(){var n,o,i,s,l,d;return H(this,(function(p){switch(p.label){case 0:for(u.kg.debug("distributeMeta, metas length: ",e.length),n=[],o=function(r){var o=e[r],s=new(a())(o.id.low,o.id.high,o.id.unsigned).toString(),l=o.from.name,d=o.to?o.to.name:"",p=!!o.to&&-1!==o.to.domain.indexOf("conference");if(i._load_msg_cache.some((function(e){return e.msgId===s})))return"continue";switch(i._load_msg_cache.length<=i.max_cache_length||i._load_msg_cache.shift(),i._load_msg_cache.push({msgId:s,from:l,to:d,isGroup:p}),o.ns){case 0:g.call(i,o);break;case 1:n.push(c.Z.call(i,o,t,!1,!0,!0));break;case 2:h.call(i,o);break;case 3:f.handleRosterMsg.call(i,o);break;case 4:i.registerConfrIQHandler&&i.registerConfrIQHandler(o,t,i);break;case 5:N.call(i,o);break;default:u.kg.error("distributeMeta",o)}},i=this,s=0;s<e.length;s++)o(s);return[4,Promise.all(n)];case 1:return l=p.sent(),(d=l.filter((function(e){return e&&"cmd"!==e.type}))).length>0&&(null===(r=this.eventHandler)||void 0===r||r.dispatch("onMessage",d)),[2]}}))}))}function X(e,t){V.call(this,e,t)}function J(e){var t;this._offlineMessagePullState===M.a.SYNC_INIT&&(this._offlineMessagePullState=M.a.SYNC_START,this._offlineMessagePullQueue=e.unread.reduce((function(e,t){return e.find((function(e){return e.name===t.queue.name}))||e.push(t.queue),e}),[]),null===(t=this.eventHandler)||void 0===t||t.dispatch("onOfflineMessageSyncStart"))}function Z(e){var t;if(this._offlineMessagePullState===M.a.SYNC_START){var r=this._offlineMessagePullQueue.findIndex((function(t){return t.name===e.queue.name}));r>-1&&this._offlineMessagePullQueue.splice(r,1),0===this._offlineMessagePullQueue.length&&(this._offlineMessagePullState=M.a.SYNC_FINISH,null===(t=this.eventHandler)||void 0===t||t.dispatch("onOfflineMessageSyncFinish"))}}function Y(e){var t=this.root.lookup("easemob.pb.CommUnreadDL");t=t.decode(e.payload);var r=new(a())(t.timestamp.low,t.timestamp.high,t.timestamp.unsigned).toString();if(this.expirationTime&&this.compareTokenExpireTime(Number(r),this.expirationTime),0===t.unread.length)se.call(this);else{J.call(this,t),u.kg.debug("pull unread message",t.unread);for(var n=0;n<t.unread.length;n++)ee.call(this,t.unread[n].queue)}se.call(this)}function Q(){var e=[],t=this.root.lookup("easemob.pb.StatisticsBody"),r=t.decode(e);r.operation=0,r=t.encode(r).finish();var n=this.root.lookup("easemob.pb.Meta").decode(e);n.id=(new Date).valueOf(),n.ns=0,n.payload=r;var o=this.root.lookup("easemob.pb.CommSyncUL"),i=o.decode(e);i.meta=n,i=o.encode(i).finish();var a=this.root.lookup("easemob.pb.MSync"),s=a.decode(e);return s.version=this.version,s.encryptType=[0],s.command=0,s.payload=i,a.encode(s).finish()}function $(e){var t=[],r=this.root.lookup("easemob.pb.CommSyncUL"),n=r.decode(t);n.queue=e,n=r.encode(n).finish();var o=this.root.lookup("easemob.pb.MSync"),i=o.decode(t);return i.version=this.version,i.encryptType=this.encryptType,i.command=0,i.payload=n,o.encode(i).finish()}function ee(e){u.kg.debug("sendBackqueue",e);var t=$.call(this,e);Ce.call(this,t)}function te(e,t){var r=[],n=this.root.lookup("easemob.pb.CommSyncUL"),o=n.decode(r);o.queue=t,o.key=new(a())(e.low,e.high,e.unsigned).toString(),o=n.encode(o).finish();var i=this.root.lookup("easemob.pb.MSync"),s=i.decode(r);return s.version=this.version,s.encryptType=this.encryptType,s.command=0,s.payload=o,i.encode(s).finish()}function re(){var e=this;this.uniPush&&!1===this.isRegisterPush&&(this.isRegisterPush=!0,this.uniPush.onRegister((function(t){u.kg.debug("push token onRegister",t);var r=e.uniPushConfig||{},n=r.APNsCertificateName,o=void 0===n?"":n,i=r.HMSCertificateName,a=void 0===i?"":i,s=r.HONORCertificateName,c=void 0===s?"":s,l=r.MEIZUCertificateName,d=void 0===l?"":l,p=r.MICertificateName,h=void 0===p?"":p,f=r.OPPOCertificateName,m=void 0===f?"":f,g=r.VIVOCertificateName,v=void 0===g?"":g;switch(t.push_type){case D.APNs:e.pushCertificateName=o;break;case D.HMSPUSH:e.pushCertificateName=a;break;case D.HONORPUSH:e.pushCertificateName=c;break;case D.MEIZUPUSH:e.pushCertificateName=d;break;case D.MIPUSH:e.pushCertificateName=h;break;case D.OPPOPUSH:e.pushCertificateName=m;break;case D.VIVOPUSH:e.pushCertificateName=v;break;default:u.kg.error("unexpected push type",t.push_type)}e.pushCertificateName&&t.push_token&&w.r.call(e,{deviceId:e.clientResource,deviceToken:t.push_token,notifierName:e.pushCertificateName}).then((function(){u.kg.debug("uploadPushToken success")})).catch((function(e){u.kg.debug("uploadPushToken failed",e)}))})))}function ne(){var e;this._offlineMessagePullState=M.a.SYNC_INIT,this._offlineMessagePullQueue=[],this.times=1,this.autoReconnectNumTotal=0,this.onOpened&&this.onOpened(),re.call(this),null===(e=this.eventHandler)||void 0===e||e.dispatch("onConnected"),ae.call(this),ue.call(this),ce.call(this),se.call(this)}function oe(e,t){u.kg.debug("sendLastSession",e);var r=te.call(this,e,t);Ce.call(this,r)}function ie(e){var t,r,n,o,i,a,c,l,d,p,h,f,g,v,E=this,y=this.root.lookup("easemob.pb.Provision").decode(e.payload);if(this.context.jid&&(this.context.jid.clientResource=y.resource),this.clientResource=y.resource,this.provisionTimer&&clearTimeout(this.provisionTimer),u.kg.debug("receiveProvisionResult",y.status),this._isLogging=!1,y.status.errorCode===j.OK){if(this.disconnectedReason=void 0,y.authToken){var _=JSON.parse(y.authToken).expires_in;if(!this.tokenExpiredTimer&&!this.tokenWillExpireTimer){var T=Date.now();this.expirationTime=_;var I=this.expirationTime-T;this.expiresIn=I<0?0:I,this.tokenExpireTimeCountDown(this.expiresIn)}}this.reconnecting=!1,this.logOut=!1,this.needSetReadyState&&(this.sock=G(G({},this.sock),{close:this.sock.close,send:this.sock.send,readyState:1})),this._localCache?(null===(t=this._localCache)||void 0===t?void 0:t.getInstance())?ne.call(this):this._localCache&&new this._localCache({user:this.user,dbName:"cache_".concat(Math.abs((0,b.un)(this.appKey||this.appId)),"_").concat(this.user),version:A,onInit:function(){return B(E,void 0,void 0,(function(){return H(this,(function(e){return u.kg.debug("localCache init success"),ne.call(this),[2]}))}))}}):ne.call(this),null===(r=this.connectionResolve)||void 0===r||r.call(this)}else{var O=void 0,R=y.status,C=R.reason,N=R.errorCode;switch(u.kg.debug("provision errorCode: ",N),u.kg.debug("provision reason: ",C),N){case j.FAIL:O="Sorry, user register limit"===C?m.Z.create({type:s.E.MAX_LIMIT,message:"Sorry, the number of user registrations limit has been reached"}):"Sorry, user register rate limit"===C?m.Z.create({type:s.E.MAX_LIMIT,message:"Sorry, user register rate limit"}):"Sorry, token expired"===C?m.Z.create({type:s.E.WEBIM_TOKEN_EXPIRED,message:"Sorry, token expired"}):"Sorry, token or password does not match login info"===C?m.Z.create({type:s.E.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"INVALID_TOKEN"}):"Sorry, user not found"===C?m.Z.create({type:s.E.USER_NOT_FOUND,message:"User not found"}):m.Z.create({type:s.E.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(n=this.connectionReject)||void 0===n||n.call(this,O),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",O);break;case j.WRONG_PARAMETER:O=m.Z.create({type:s.E.REQUEST_PARAMETER_ERROR,message:"Invalid parameter"}),null===(i=this.connectionReject)||void 0===i||i.call(this,O),null===(a=this.eventHandler)||void 0===a||a.dispatch("onError",O);break;case j.UNAUTHORIZED:O=m.Z.create({type:s.E.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(c=this.connectionReject)||void 0===c||c.call(this,O),null===(l=this.eventHandler)||void 0===l||l.dispatch("onError",O);break;case j.IM_FORBIDDEN:O=m.Z.create({type:s.E.WEBIM_SERVER_SERVING_DISABLED,message:"Server serving disabled."}),null===(d=this.connectionReject)||void 0===d||d.call(this,O),null===(p=this.eventHandler)||void 0===p||p.dispatch("onError",O);break;case j.PERMISSION_DENIED:O="Sorry, the app month live count limit"===C?m.Z.create({type:s.E.MAX_LIMIT,message:"Sorry, the monthly active user limit for this app has been reached"}):"Sorry, the app day live count limit"===C?m.Z.create({type:s.E.MAX_LIMIT,message:"Sorry, the daily active user limit for this app has been reached"}):"Sorry, the app online count limit"===C?m.Z.create({type:s.E.MAX_LIMIT,message:"Sorry, the maximum number limit of online users for this app has been reached"}):m.Z.create({type:s.E.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(h=this.connectionReject)||void 0===h||h.call(this,O),null===(f=this.eventHandler)||void 0===f||f.dispatch("onError",O);break;default:O=m.Z.create({type:s.E.WEBIM_CONNCTION_AUTH_ERROR,message:C}),null===(g=this.connectionReject)||void 0===g||g.call(this,O),null===(v=this.eventHandler)||void 0===v||v.dispatch("onError",O)}this.disconnectedReason=O}}function ae(){var e,t;if((null===(e=this.unMSyncSendMsgMap)||void 0===e?void 0:e.size)>0){for(var r=Array.from(this.unMSyncSendMsgMap.keys()),n=0;n<r.length;n++){var o=this.unMSyncSendMsgMap.get(r[n]);Ce.call(this,o,r[n])}null===(t=this.unMSyncSendMsgMap)||void 0===t||t.clear()}}function se(){var e=Q.call(this);Ce.call(this,e)}function ce(){u.kg.debug("sendUnreadDeal");var e=de.call(this);Ce.call(this,e)}function ue(){var e=this;le.call(this),this.heartBeatID=setInterval((function(){(Date.now()-e.lastHeartbeat)/1e3>=30&&(u.kg.debug("send heart beat"),ce.call(e),e.lastHeartbeat=Date.now())}),this.heartBeatWait)}function le(){clearInterval(this.heartBeatID)}function de(){var e=this.root.lookup("easemob.pb.MSync"),t=e.decode([]);return t.version=this.version,t.encryptType=this.encryptType,t.command=1,e.encode(t).finish()}function pe(e,t){return e.some((function(e){return e.name===t.name}))}function he(e){var t=this.root.lookup("easemob.pb.CommNotice").decode(e.payload),r=pe(this._queues,t.queue);u.kg.debug("receive notice",t.queue,this._queues),r||this.clientResource===t.queue.clientResource&&t.queue.name===this.context.userId||(this._queues.push(t.queue),1===this._queues.length&&ee.call(this,t.queue))}function fe(e){return B(this,void 0,void 0,(function(){var t,r,n,i,a,s,c,u;return H(this,(function(l){if(t=v.P6.getEnvInfo(),r=this.root.lookup("easemob.pb.MSync"),"miniCore"===this.name||"web"===t.platform){try{i=new Uint8Array(e.data),n=r.decode(i)}catch(e){throw new Error("decode message fail.")}return[2,n]}if("zfb"===t.platform||"dd"===t.platform){for(a=o().atob(e.data),s=[],c=0,u=a.length;c<u;++c)s.push(a.charCodeAt(c));return[2,r.decode(s)]}try{n=r.decode(e.data)}catch(e){throw new Error("decode message fail.")}return[2,n]}))}))}function me(e){var t=this;this.lastHeartbeat=Date.now(),this.probingTimer&&clearTimeout(this.probingTimer),e.then((function(e){if(e)switch(e.command){case 0:ge.call(t,e);break;case 1:Y.call(t,e);break;case 2:he.call(t,e);break;case 3:ie.call(t,e);break;default:u.kg.error("unexpected msync command: ".concat(e.command))}else u.kg.error("unexpected msync result: ".concat(e))}))}function ge(e){var t,r,n,o,i,l,d,p,h,f,g,E,y,_,T,I,O,R,C,N,b,A,M,w,P,x,L,D,j,F,W,q,K,z,V,J,Y,Q,$,te,re,ne,ie,ae,se,ce;return B(this,void 0,void 0,(function(){var B,ue,le,de,pe,he,fe,me,ge,ve,Ee,ye,_e,Te,Ie,Oe,Re,Ce,Ne,Se,be,Ae,Me,we,ke,Ue,Pe,xe,Le,De,je,Ge,Be,He,Fe,We,qe,Ke,ze,Ve,Xe,Je,Ze,Ye,Qe,$e=this;return H(this,(function(H){switch(H.label){case 0:if(B=(B=this.root.lookup("easemob.pb.CommSyncDL")).decode(e.payload),ue=new(a())(B.serverId.low,B.serverId.high,B.serverId.unsigned).toString(),le=new(a())(B.metaId.low,B.metaId.high,B.metaId.unsigned).toString(),!(Number(le)>0))return[3,23];if(clearTimeout(null===(t=this._msgHash[le])||void 0===t?void 0:t.messageTimer),!B.status)return[3,22];if(0!==B.status.errorCode)return[3,21];if(null==(de=this._msgHash[le])?void 0:de.isHandleChatroom){try{if(pe="join"===(null===(r=this._msgHash[le])||void 0===r?void 0:r.operation)){he={};try{B.metas.length>0&&(fe=this.root.lookup("easemob.pb.MUCBody"),me=fe.decode(B.metas[0].payload),(ge=JSON.parse(me.status.chatroomInfo||"{}")[this.user])&&(he={isAllMembersMuted:ge.is_all_mute,createTimestamp:ge.create_timestamp,isInAllowlist:ge.is_in_white_list,memberCount:ge.member_count,muteExpireTimestamp:ge.mute_duration?ge.mute_duration:-1}))}catch(e){u.kg.error("decode chat room info error",e)}(null===(n=this._msgHash[le])||void 0===n?void 0:n.resolve)instanceof Function&&this._msgHash[le].resolve({type:0,data:{action:"apply",id:this._msgHash[le].roomId,result:!0,user:this.context.userId,info:he}}),(null===(o=this._msgHash[le])||void 0===o?void 0:o.success)instanceof Function&&this._msgHash[le].success({type:0,data:{action:"apply",id:this._msgHash[le].roomId,result:!0,user:this.context.userId,info:he}})}(null===(i=this._msgHash[le])||void 0===i?void 0:i.resolve)instanceof Function&&!pe&&this._msgHash[le].resolve({type:0,data:{result:!0}}),(null===(l=this._msgHash[le])||void 0===l?void 0:l.success)instanceof Function&&!pe&&this._msgHash[le].success({type:0,data:{result:!0}}),k.iO.has(le)&&(ve=k.iO.get(le),ze=ve.rpt,Ve=ve.requestName,ze({isEndApi:!0,data:{isSuccess:1,requestName:Ve,requestMethod:"WEBSOCKET",requestUrl:this.url,code:U.dd.success}}),k.iO.delete(le))}catch(e){k.iO.has(le)&&(Ee=k.iO.get(le),ze=Ee.rpt,Ve=Ee.requestName,ze({isEndApi:!0,data:{isSuccess:0,requestName:Ve,requestMethod:"WEBSOCKET",requestUrl:this.url,code:U.dd.failed,codeDesc:"when executing success function error"}}),k.iO.delete(le)),Je=m.Z.create({type:s.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e}),this.onError&&this.onError(Je),null===(d=this.eventHandler)||void 0===d||d.dispatch("onError",Je)}delete this._msgHash[le]}return!de||de.isHandleChatroom?[3,20]:(ye=null,_e="",Te=0,Ie=null,this._msgHash[le].thirdMessage?(this._msgHash[le].thirdMessage.id=B.serverId,this._msgHash[le].thirdMessage.timestamp=B.timestamp,[4,c.Z.call(this,this._msgHash[le].thirdMessage,B.status,!0,!0)]):[3,2]);case 1:Ie=H.sent(),H.label=2;case 2:if(0===B.metas.length)return[3,13];H.label=3;case 3:switch(H.trys.push([3,12,,13]),Oe=B.metas[0],Re=B.status,Oe.ns){case 1:return[3,4];case 5:return[3,9]}return[3,10];case 4:return this.useReplacedMessageContents?[4,c.Z.call(this,Oe,Re,!0,!0)]:[3,8];case 5:return Ie=H.sent(),[4,null===(h=null===(p=this._localCache)||void 0===p?void 0:p.getInstance())||void 0===h?void 0:h.getMessageByServerMsgId(le)];case 6:return(Ce=H.sent())?[4,null===(g=null===(f=this._localCache)||void 0===f?void 0:f.getInstance())||void 0===g?void 0:g.putMessageToDB(G(G(G({},Ce),Ie),{id:le}))]:[3,8];case 7:H.sent(),H.label=8;case 8:return[3,11];case 9:return(Ne=v.P6.parseNotify(B.metas[0].payload)).edit_msg&&(Se=Ne.edit_msg,be=Se.count,Ae=Se.operator,Me=Se.edit_time,we=Se.sender,ke=Se.send_time,ye={operationTime:Me,operatorId:Ae,operationCount:be},_e=we,Te=Number(ke)),[3,11];case 10:return u.kg.error("decode local meta error",Oe),[3,11];case 11:return[3,13];case 12:return Ue=H.sent(),Je=m.Z.create({type:s.E.WEBIM_LOAD_MSG_ERROR,message:"decode local meta message error",data:Ue}),this.onError&&this.onError(Je),null===(E=this.eventHandler)||void 0===E||E.dispatch("onError",Je),[3,13];case 13:k.TJ.has(le)&&(k.TJ.get(le).rpt({isEndApi:!0,data:{isSuccess:1,requestMethod:"WEBSOCKET",requestUrl:this.url,code:U.dd.success,msgId:ue}}),k.TJ.delete(le)),H.label=14;case 14:return H.trys.push([14,18,,19]),Pe={localMsgId:le,serverMsgId:ue},ye&&(this._msgHash[le].modifiedInfo=ye,xe=this._msgHash[le],Le=xe.editMessageId,We=xe.type,De=xe.chatType,je=xe.msg,Ge=xe.to,Be=xe.translations,He={id:Le,type:We,chatType:De,msg:je,modifiedInfo:ye,to:Ge,from:_e,time:Number(Te)},Be&&(He.translations=Be),Pe.message=He,null===(T=null===(_=null===(y=this._localCache)||void 0===y?void 0:y.getInstance())||void 0===_?void 0:_.getMessageByServerMsgId(Le))||void 0===T||T.then((function(e){var t,r;e&&"txt"===e.type&&(null===(r=null===(t=$e._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.putMessageToDB(G(G({},e),{msg:He.msg,modifiedInfo:He.modifiedInfo,translations:He.translations})))}))),Ie&&(Pe.message=Ie),[4,null===(O=null===(I=this._localCache)||void 0===I?void 0:I.getInstance())||void 0===O?void 0:O.updateLocalMessage(le,{serverMsgId:ue,status:S.r.SUCCESS})];case 15:return H.sent(),(null===(R=this._msgHash[le])||void 0===R?void 0:R.success)instanceof Function?[4,this._msgHash[le].success(le,ue)]:[3,17];case 16:H.sent(),H.label=17;case 17:return(null===(C=this._msgHash[le])||void 0===C?void 0:C.resolve)instanceof Function&&this._msgHash[le].resolve(Pe),[3,19];case 18:return Fe=H.sent(),Je=m.Z.create({type:s.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:Fe}),this.onError&&this.onError(Je),null===(N=this.eventHandler)||void 0===N||N.dispatch("onError",Je),[3,19];case 19:this.onReceivedMessage&&this.onReceivedMessage({id:le,mid:ue,to:this._msgHash[le].to,time:0}),null===(b=this.eventHandler)||void 0===b||b.dispatch("onReceivedMessage",{id:le,mid:ue,to:this._msgHash[le].to}),delete this._msgHash[le],H.label=20;case 20:return[3,22];case 21:if(15===B.status.errorCode)(null===(A=this._msgHash[le])||void 0===A?void 0:A.fail)instanceof Function&&this._msgHash[le].fail({type:s.E.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject({type:s.E.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"}),null===(w=null===(M=this._localCache)||void 0===M?void 0:M.getInstance())||void 0===w||w.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL});else if(1===B.status.errorCode){switch(We=void 0,B.status.reason){case"blocked":We=s.E.PERMISSION_DENIED;break;case"group not found":We=s.E.GROUP_NOT_EXIST;break;case"not in group or chatroom":We=s.E.GROUP_NOT_JOINED;break;case"exceed recall time limit":We=s.E.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":We=s.E.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":We=s.E.SERVICE_NOT_ALLOW_MESSAGING;break;case"nonroster":We=s.E.USER_NOT_FRIEND,B.status.reason="not contact";break;case"group is disabled":We=s.E.GROUP_IS_DISABLED,B.status.reason="group is disabled";break;case"limit directed users":We=s.E.MAX_LIMIT;break;case"Sorry, edit limit reached":We=s.E.MAX_LIMIT,B.status.reason="Modify message limit reached";break;case"Sorry, message does not exist":We=s.E.MODIFY_MESSAGE_NOT_EXIST,B.status.reason="The message does not exist.";break;case"Sorry, You do not have permission":We=s.E.PERMISSION_DENIED,B.status.reason="You do not have the modified permission.";break;case"Sorry, format is incorrect":We=s.E.MODIFY_MESSAGE_FORMAT_ERROR,B.status.reason="The modify messaged format error.";break;case"Sorry, edit is not available":We=s.E.SERVICE_NOT_ENABLED,B.status.reason="The message modify function is not activated.";break;case"Sorry, edit fail":We=s.E.MODIFY_MESSAGE_FAILED,B.status.reason="Modify message failed.";break;default:B.status.reason.includes("grpID")&&B.status.reason.includes("does not exist!")?(We=s.E.CHATROOM_NOT_EXIST,B.status.reason="The chat room dose not exist."):B.status.reason.includes("username")&&B.status.reason.includes("doesn't exist!")?We=s.E.USER_NOT_FOUND:"group member list is full!"===B.status.reason?We=s.E.CHATROOM_MEMBERS_FULL:B.status.reason.includes("can not join this group")&&B.status.reason.includes("is in the blacklist")?(We=s.E.PERMISSION_DENIED,B.status.reason="permission denied"):"can not operate this group, reason: group is disabled"===B.status.reason?We=s.E.GROUP_IS_DISABLED:B.status.reason.includes("moderation")?We=s.E.MESSAGE_MODERATION_BLOCKED:B.status.reason.includes("group ID illegal, please check it")?(We=s.E.REQUEST_PARAMETER_ERROR,B.status.reason="Invalid parameter"):We=B.status.reason.includes("has create too many chatrooms")||B.status.reason.includes("has joined too many chatrooms")?s.E.MAX_LIMIT:B.status.reason.includes("auto create failed")?s.E.SERVER_BUSY:s.E.SERVER_UNKNOWN_ERROR}this._msgHash[le]&&((null===(P=this._msgHash[le])||void 0===P?void 0:P.isHandleChatroom)?(Xe=m.Z.create({type:We,message:B.status.reason||"",data:""}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].error instanceof Function&&this._msgHash[le].error(Xe),k.iO.has(le)&&(qe=U.dd.failed,We===s.E.CHATROOM_NOT_EXIST?qe=U.dd.notFound:We===s.E.CHATROOM_MEMBERS_FULL&&(qe=U.dd.reachLimit),Ke=k.iO.get(le),ze=Ke.rpt,Ve=Ke.requestName,ze({isEndApi:!0,data:{isSuccess:0,requestName:Ve,requestMethod:"WEBSOCKET",requestUrl:this.url,code:qe,codeDesc:B.status.reason}}),k.iO.delete(le))):(Xe=m.Z.create({type:We,message:B.status.reason||"",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail({type:We,reason:B.status.reason?B.status.reason:"",data:{id:le,mid:ue}}),null===(L=null===(x=this._localCache)||void 0===x?void 0:x.getInstance())||void 0===L||L.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL})),delete this._msgHash[le])}else if(7===B.status.errorCode)"sensitive words"===B.status.reason&&this._msgHash[le]?(Xe=m.Z.create({type:s.E.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"sensitive words",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail({type:s.E.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:le,mid:ue,reason:"sensitive words"}}),null===(j=null===(D=this._localCache)||void 0===D?void 0:D.getInstance())||void 0===j||j.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL})):"blocked by mod_antispam"===B.status.reason&&this._msgHash[le]?(Xe=m.Z.create({type:s.E.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"blocked by mod_antispam",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail({type:s.E.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:le,mid:ue,reason:"blocked by mod_antispam"}}),null===(W=null===(F=this._localCache)||void 0===F?void 0:F.getInstance())||void 0===W||W.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL})):"user is mute"===B.status.reason&&this._msgHash[le]?(Xe=m.Z.create({type:s.E.USER_MUTED_BY_ADMIN,message:"user is mute",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail(Xe),null===(K=null===(q=this._localCache)||void 0===q?void 0:q.getInstance())||void 0===K||K.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL})):"traffic limit"===B.status.reason&&this._msgHash[le]?(Xe=m.Z.create({type:s.E.MESSAGE_CURRENT_LIMITING,message:"traffic limit",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail(Xe),null===(V=null===(z=this._localCache)||void 0===z?void 0:z.getInstance())||void 0===V||V.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL})):"Sorry, data is too large"===B.status.reason&&this._msgHash[le]&&(Xe=m.Z.create({type:s.E.MESSAGE_SIZE_LIMIT,message:"Sorry, data is too large",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail(Xe),null===(Y=null===(J=this._localCache)||void 0===J?void 0:J.getInstance())||void 0===Y||Y.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL}));else if(19===B.status.errorCode)this._msgHash[le]&&(k.TJ.has(le)&&(k.TJ.get(le).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.E.MESSAGE_EXTERNAL_LOGIC_BLOCKED,codeDesc:B.status.reason||"",msgId:ue}}),k.TJ.delete(le)),Xe=m.Z.create({type:s.E.MESSAGE_EXTERNAL_LOGIC_BLOCKED,message:B.status.reason||"",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail({type:s.E.MESSAGE_EXTERNAL_LOGIC_BLOCKED,data:{id:le,mid:ue,reason:B.status.reason}}),null===($=null===(Q=this._localCache)||void 0===Q?void 0:Q.getInstance())||void 0===$||$.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL}));else if(this._msgHash[le]){k.TJ.has(le)&&(k.TJ.get(le).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.E.WEBIM_LOAD_MSG_ERROR,codeDesc:(null===(te=B.status)||void 0===te?void 0:te.reason)||"",msgId:ue}}),k.TJ.delete(le));try{Xe=m.Z.create({type:s.E.WEBIM_LOAD_MSG_ERROR,message:(null===(re=B.status)||void 0===re?void 0:re.reason)||"",data:{id:le,mid:ue,reason:B.status&&B.status.reason}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),null===(ie=null===(ne=this._localCache)||void 0===ne?void 0:ne.getInstance())||void 0===ie||ie.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL}),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail({type:s.E.WEBIM_LOAD_MSG_ERROR,data:{errorCode:B.status&&B.status.errorCode,reason:B.status&&B.status.reason}})}catch(e){Je=m.Z.create({type:s.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e}),this.onError&&this.onError(Je),null===(ae=this.eventHandler)||void 0===ae||ae.dispatch("onError",Je)}delete this._msgHash[le]}else k.TJ.has(le)&&(k.TJ.get(le).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,codeDesc:"on message error",msgId:ue}}),k.TJ.delete(le)),Je=m.Z.create({type:s.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"on message error"}),this.onError&&this.onError(Je),null===(se=this.eventHandler)||void 0===se||se.dispatch("onError",Je);H.label=22;case 22:return[2];case 23:if(B.metas&&0!==B.metas.length)try{X.call(this,B.metas,B.status)}catch(e){Je=m.Z.create({type:s.E.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e}),u.kg.error("decode message error",e),this.onError&&this.onError(Je),null===(ce=this.eventHandler)||void 0===ce||ce.dispatch("onError",Je)}finally{B.isLast?(u.kg.debug("metas & CommSyncDLMessage.isLast",B.isLast),Ze=-1,this._queues.some((function(e,t){return e.name===B.name&&(Ze=t,!0)}))&&Ze>0&&this._queues.splice(Ze,1),this._queues.length>0&&ee.call(this,this._queues[0]),Z.call(this,B)):B.nextKey&&(Qe=new(a())(B.nextKey.low,B.nextKey.high,B.nextKey.unsigned).toString(),u.kg.debug("nexKey:",Qe,"this.nextKey:",this.nexKey),Qe!==this.nexKey&&(this.nexKey=Qe,oe.call(this,B.nextKey,B.queue)))}else B.isLast?(u.kg.debug("CommSyncDLMessage.isLast",B.isLast),Ye=-1,this._queues.some((function(e,t){return e.name===B.queue.name&&(Ye=t,!0)}))&&this._queues.splice(Ye,1),this._queues.length>0&&ee.call(this,this._queues[0]),Z.call(this,B)):B.nextKey&&(Qe=new(a())(B.nextKey.low,B.nextKey.high,B.nextKey.unsigned).toString(),u.kg.debug("nexKey:",Qe,"this.nextKey:",this.nexKey),Qe!==this.nexKey&&(this.nexKey=Qe,oe.call(this,B.nextKey,B.queue)));return[2]}}))}))}function ve(e){var t=[],r=this.root.lookup("easemob.pb.KeyValue"),n=[];for(var o in e){var i=r.decode(t);if(i.key=o,void 0!==e[o]){if("object"===x(e[o]))i.type=8,i.stringValue=JSON.stringify(e[o]);else if("string"==typeof e[o])i.type=7,i.stringValue=e[o];else if("boolean"==typeof e[o])i.type=1,i.varintValue=!0===e[o]?1:0;else if(Number.isInteger(e[o]))i.type=2,i.varintValue=e[o];else if("bigint"==typeof e[o]||"symbol"===x(e[o])||"function"==typeof e[o]||Number.isNaN(e[o]))i.type=7,i.stringValue=e[o].toString();else{if("number"!=typeof e[o]||Number.isInteger(e[o]))continue;i.type=6,i.doubleValue=e[o]}n.push(i)}}return n}function Ee(e){var t,r,n,o=[];if(this.root){var i,c=this.root.lookup("easemob.pb.MessageBody.Content").decode(o);switch(i=!e.group&&"groupchat"!==(null===(t=null==e?void 0:e.chatType)||void 0===t?void 0:t.toLowerCase())||e.roomType?e.group&&e.roomType||"chatroom"===(null===(r=null==e?void 0:e.chatType)||void 0===r?void 0:r.toLowerCase())?"chatRoom":"singleChat":"groupChat",e.type){case"txt":c.type=0,c.text=e.msg;break;case"img":c.type=1,e.body?(c.displayName=e.body.filename,c.remotePath=e.body.url,c.secretKey=e.body.secret,c.fileLength=e.body.file_length,c.size=e.body.size,c.thumbnailDisplayName=e.body.filename):e.file?(c.displayName=e.file.filename,c.remotePath=e.file.url,c.secretKey=e.file.secret,c.fileLength=e.file.file_length,c.size=e.file.size,c.thumbnailDisplayName=e.file.filename):(c.displayName=e.filename,c.remotePath=e.url,c.secretKey=e.secret,c.fileLength=e.file_length,c.size=e.size,c.thumbnailDisplayName=e.filename),e.isBuildCombinedMsg&&(c.remotePath=e.url,c.secretKey=e.secret,c.size={height:e.height,width:e.width});break;case"video":c.type=2,e.body?(c.displayName=e.body.filename,c.remotePath=e.body.url,c.secretKey=e.body.secret,c.fileLength=e.body.file_length,c.duration=e.body.length,c.thumbnailDisplayName=e.body.filename,c.thumbnailRemotePath=this.useOwnUploadFun?"":"".concat(e.body.url,"?vframe=true"),c.thumbnailSecretKey=this.useOwnUploadFun?"":e.body.secret):e.isBuildCombinedMsg&&(c.displayName=e.filename,c.remotePath=e.url,c.secretKey=e.secret,c.fileLength=e.file_length,c.duration=e.length,c.thumbnailDisplayName=e.filename,c.thumbnailRemotePath=e.thumb,c.thumbnailSecretKey=e.thumb_secret);break;case"loc":c.type=3,c.latitude=e.lat,c.longitude=e.lng,c.address=e.addr,c.buildingName=e.buildingName,c.latitude=e.lat;break;case"audio":c.type=4,e.body?(c.displayName=e.body.filename,c.remotePath=e.body.url,c.secretKey=e.body.secret,c.fileLength=e.body.file_length,c.duration=e.body.length,c.thumbnailDisplayName=e.body.filename):e.isBuildCombinedMsg&&(c.displayName=e.filename,c.remotePath=e.url,c.secretKey=e.secret,c.fileLength=e.file_length,c.duration=e.length,c.thumbnailDisplayName=e.filename);break;case"file":c.type=5,e.body?(c.displayName=e.body.filename,c.remotePath=e.body.url,c.secretKey=e.body.secret,c.fileLength=e.body.file_length,c.thumbnailDisplayName=e.body.filename):e.isBuildCombinedMsg&&(c.displayName=e.filename,c.remotePath=e.url,c.secretKey=e.secret,c.fileLength=e.file_length,c.thumbnailDisplayName=e.filename);break;case"cmd":c.type=6,c.action=e.action;break;case"custom":c.type=7,c.customEvent=e.customEvent,c.customExts=ve.call(this,e.customExts);break;case"combine":c.type=0,c.subType=0,c.text=e.compatibleText,c.displayName=e.filename,c.remotePath=e.url,c.secretKey=e.secret,c.fileLength=e.file_length,c.title=e.title,c.summary=e.summary,c.combineLevel=e.combineLevel}var u=[];e.ext&&(u=ve.call(this,e.ext));var l=this.root.lookup("easemob.pb.MessageBody"),d=l.decode(o),p=e.from||this.context.jid.name;d.from={name:e.isBuildCombinedMsg?p:this.context.jid.name};var h=e.to.indexOf("/"),f=h>-1?e.to.substring(0,h):e.to;if(d.to={name:f},"channel"===e.type)d.type=L.CHANNEL_ACK;else if("recall"===e.type)d.type=L.RECALL,d.ackMessageId=e.ackId;else if("delivery"===e.type)d.type=L.DELIVER_ACK,d.ackMessageId=e.ackId;else if("read"===e.type)d.type=L.READ_ACK,d.ackMessageId=e.ackId,"groupChat"===i&&(d.msgConfig={allowGroupAck:!0},d.ackContent=e.ackContent);else if("chatRoom"===i)d.type=L.CHATROOM;else if("groupChat"===i){if(d.type=L.GROUPCHAT,e.msgConfig){var m=e.msgConfig.allowGroupAck;d.msgConfig={allowGroupAck:!!m}}}else"singleChat"===i&&(d.type=L.SINGLECHAT);e.editMessageId&&(d.type=L.EDIT,d.editMessageId=e.editMessageId),d.contents=[c],d.ext=u;var g=function(e){var t={};return"translations"in e&&(t.translations=e.translations),"isChatThread"in e&&e.isChatThread&&(t.thread={}),Object.keys(t).length>0?JSON.stringify(t):""}(e);g&&(d.meta=g),d=l.encode(d).finish();var v=this.root.lookup("easemob.pb.Meta"),E=v.decode(o);E.id=e.id;var y="easemob.com";if("chatRoom"!==i&&"groupChat"!==i||(y="conference.easemob.com"),E.to={appKey:this.appKey,name:f,domain:y},h>-1&&(E.to.clientResource=e.to.substring(h+1,e.to.length)),"chatRoom"===i&&(E.ext=ve.call(this,function(e){return{chatroom_msg_tag:"high"===e.priority?0:"low"===e.priority?2:1}}(e))),"recall"===e.type&&e.metaExt&&(E.ext=ve.call(this,{recallMessageExtensionInfo:e.metaExt})),E.ns=1,E.payload=d,E.routetype=e.deliverOnlineOnly?1:0,"singleChat"!==i&&Array.isArray(e.receiverList)&&(null===(n=e.receiverList)||void 0===n?void 0:n.length)>0&&(E.directedUsers=e.receiverList,E.routetype=2),e.isBuildCombinedMsg)return E.timestamp=a().fromValue(e.time),v.encode(E).finish();var _=this.root.lookup("easemob.pb.CommSyncUL"),T=_.decode(o);T.meta=E,!e.isPing&&_e.call(this,e,E),T=_.encode(T).finish();var I=this.root.lookup("easemob.pb.MSync"),O=I.decode(o);return O.version=this.version,O.encryptType=this.encryptType,O.command=0,O.payload=T,I.encode(O).finish()}e.fail&&e.fail({type:s.E.WEBIM_CONNCTION_CLIENT_OFFLINE,message:"Not logged in"})}function ye(e){var t,r,n=this,o=G({},e);if(e.file)return o.accessToken=this.token,o.appKey=this.appKey,o.apiUrl=this.apiUrl,o.body&&o.body.url?Ee.call(this,o):new Promise((function(t,r){var i=o.onFileUploadComplete;o.onFileUploadComplete=function(t){var r,a,s,c,u,l;if(t.entities[0]["file-metadata"]){var d=t.entities[0]["file-metadata"]["content-length"];o.file_length=d,o.filetype=t.entities[0]["file-metadata"]["content-type"],d>204800&&(o.thumbnail=!0)}var p="".concat(n.apiUrl,"/").concat(n.orgName,"/").concat(n.appName,"/chatfiles/").concat(t.entities[0].uuid);o.body={type:o.type||"file",secret:t.entities[0]["share-secret"],filename:o.file.filename||o.filename,url:p,length:o.length||0,filetype:o.filetype||o.file.filetype,file_length:(null===(a=null===(r=o.file)||void 0===r?void 0:r.data)||void 0===a?void 0:a.size)||0,size:{width:o.width||0,height:o.height||0}},o.file.url=t.uri,e.secret=t.entities[0]["share-secret"],t.url=e.url="".concat(p,"?em-redirect=true&share-secret=").concat(t.entities[0]["share-secret"]),e.file_length=o.file_length=(null===(c=null===(s=o.file)||void 0===s?void 0:s.data)||void 0===c?void 0:c.size)||0,"img"===o.type&&(e.thumb="".concat(e.url,"&thumbnail=true"),t.thumb="".concat(t.url,"&thumbnail=true")),"video"===o.type&&(e.thumb="".concat(e.url,"&vframe=true"),e.thumb_secret=t.entities[0]["share-secret"],t.thumb="".concat(t.url,"&vframe=true")),i instanceof Function&&i(t,o.id);var h=Ee.call(n,o);k.TJ.size<=k.F3&&k.TJ.set(o.id,{rpt:n.dataReport.geOperateFun({operationName:U.fI.SEND_MSG})}),null===(l=null===(u=n._localCache)||void 0===u?void 0:u.getInstance())||void 0===l||l.storeMessage(e,S.r.INPROGRESS),Ce.call(n,h)},v.P6.uploadFile.call(n,o,U.fI.UPLOAD_MSG_ATTACH)}));if("combine"===e.type){o.accessToken=this.token,o.appKey=this.appKey,o.apiUrl=this.apiUrl;var i=o.onFileUploadComplete,a=o.onFileUploadError;return new Promise((function(t,r){var c,l,d,p;if((null===(c=e.messageList)||void 0===c?void 0:c.length)>300||0===(null===(l=e.messageList)||void 0===l?void 0:l.length))return n._msgHash[o.id].reject({type:s.E.MAX_LIMIT,message:"The number of combined messages exceeded the limit."});var h=F([],e.messageList,!0),f=0;if(h.forEach((function(e){(null==e?void 0:e.combineLevel)>f&&(f=null==e?void 0:e.combineLevel)})),o.combineLevel=f+1,o.combineLevel>10)return n._msgHash[o.id].reject({type:s.E.MAX_LIMIT,message:"The level of the merged message exceeded the limit."});var m=Te.call(n,h),g=function(t,r){var a,s,c,u,l,d,p="".concat(n.apiUrl,"/").concat(n.orgName,"/").concat(n.appName,"/chatfiles/").concat(t.entities[0].uuid),h=null===(a=t.entities[0])||void 0===a?void 0:a["share-secret"],f=p+"?em-redirect=true";h&&(f="".concat(f,"&share-secret=").concat(h)),i instanceof Function&&i({url:f,secret:h}),e.url=f,e.secret=h,o.url=f,o.secret=t.entities[0]["share-secret"],o.filename=(null===(s=o.file)||void 0===s?void 0:s.filename)||(null==r?void 0:r.fileName),o.file_length=(null===(u=null===(c=o.file)||void 0===c?void 0:c.data)||void 0===u?void 0:u.size)||(null==r?void 0:r.fileLength)||0,null===(d=null===(l=n._localCache)||void 0===l?void 0:l.getInstance())||void 0===d||d.storeMessage(e,S.r.INPROGRESS);var m=Ee.call(n,o);Ce.call(n,m)},E=v.P6.getEnvInfo();if("web"!==E.platform&&"node"!==E.platform&&"quick_app"!==E.platform&&(null===(p=null===(d=E.global)||void 0===d?void 0:d.canIUse)||void 0===p?void 0:p.call(d,"getFileSystemManager"))){var y=E.global.getFileSystemManager(),_="".concat(n.apiUrl,"/").concat(n.orgName,"/").concat(n.appName,"/chatfiles");y.writeFile({filePath:"".concat(E.global.env.USER_DATA_PATH,"/combine"),data:m.buffer,encoding:"binary",success:function(e){E.global.uploadFile({url:_,filePath:"".concat(E.global.env.USER_DATA_PATH,"/combine"),name:"file",header:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+o.accessToken},success:function(e){if(200===e.statusCode){u.kg.debug("upload success",e);var t=JSON.parse(e.data);g(t,{fileName:"combine",fileLength:m.length})}else u.kg.debug("upload fail"),o.onFileUploadError instanceof Function&&o.onFileUploadError(e),this._msgHash[o.id].reject({type:s.E.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})},fail:function(t){u.kg.debug("upload fail"),o.onFileUploadError instanceof Function&&o.onFileUploadError(e),this._msgHash[o.id].reject({type:s.E.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:t})}})},fail:function(e){u.kg.debug("write file fail",e),this._msgHash[o.id].reject({type:s.E.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})}})}else{var T=new File([m],"combine",{type:"application/octet-stream"}),I={url:URL.createObjectURL(T),filename:o.id,data:T};o.file=I,o.onFileUploadComplete=function(e){g(e)},o.onFileUploadError=function(e){a instanceof Function&&a(e),n._msgHash[o.id].reject({type:s.E.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})},v.P6.uploadFile.call(n,o,U.fI.UPLOAD_MSG_ATTACH)}}))}"img"===e.type&&(o.body||(o.body=G(G({},o),{size:{width:o.width||0,height:o.height||0}}))),null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.storeMessage(e,S.r.INPROGRESS);var c=Ee.call(this,o);Ce.call(this,c)}function _e(e,t){e.editMessageId||W.includes(e.type)&&(this._msgHash[e.id].thirdMessage=t)}function Te(e){for(var t=Uint8Array.from("cm",(function(e){return e.charCodeAt(0)})),r=0;r<e.length;r++){for(var n=e[r],o=G(G({},n),{isBuildCombinedMsg:!0}),i=this.mSync.encodeChatMsg.call(this,o),a=i.length,s=new Uint8Array(4),c=0;c<4;c++)s[c]=a>>8*(3-c)&255;u.kg.debug("message length:",s);var l=new Uint8Array(t.length+s.length+i.length);l.set(t),l.set(s,t.length),l.set(i,t.length+s.length),t=l}var d=new Uint8Array(t.length+1),p=0;for(r=2;r<t.length;r++)r%2==1&&(p^=t[r]);return d.set(t),u.kg.debug("checkResult:",p),d[t.length]=p,d}function Ie(e,t,r){var n=[],o=this.root.lookup("easemob.pb.MUCBody"),i=e.roomId,a=e.ext,s=void 0===a?"":a,c=e.leaveOtherRooms,u=void 0!==c&&c,l=o.decode(n);l.mucId={appKey:this.appKey,name:i,domain:"conference.easemob.com"},l.operation="join"===r?2:3,l.from={name:this.context.userId},l.isChatroom=!0,"join"===r&&(l.ext=s,l.leaveOtherRooms=u),l=o.encode(l).finish();var d=this.root.lookup("easemob.pb.Meta").decode(n);d.id=t,d.from={appKey:this.appKey,name:this.context.userId,domain:"easemob.com",client_resource:this.context.jid.clientResource},d.to={domain:"easemob.com"},d.ns=2,d.payload=l;var p=this.root.lookup("easemob.pb.CommSyncUL"),h=p.decode(n);h.meta=d,h=p.encode(h).finish();var f=this.root.lookup("easemob.pb.MSync"),m=f.decode(n);return m.version=this.version,m.encryptType=this.encryptType,m.command=0,m.payload=h,f.encode(m).finish()}function Oe(e,t){var r=v.P6.getUniqueId(),n=Ie.call(this,e,r,t),o="join"===t?U.fI.JOIN_CHATROOM:U.fI.QUIT_CHATROOM,i=this.dataReport.geOperateFun({operationName:o});return k.iO.size<=k.F3&&k.iO.set(r,{rpt:i,requestName:o}),Ce.call(this,G(G({},e),{isHandleChatroom:!0,joinMsg:n,id:r,operation:t}),r)}function Re(e){var t=this;return new Promise((function(r,n){var o,i,a,c,l,d;if(u.kg.debug("call send"),t.logOut)return u.kg.debug("send message failed",s.E.WEBIM_CONNECTION_CLOSED),n({type:s.E.WEBIM_CONNECTION_CLOSED,message:"not login"});if(!e.id||"string"!=typeof e.id||""===e.id)return n({type:s.E.MESSAGE_PARAMETER_ERROR,message:'Missing required parameter: "id"'});if(!e.to||"string"!=typeof e.to||""===e.to)return n({type:s.E.MESSAGE_PARAMETER_ERROR,message:'Missing required parameter: "to"'});var p="file"===e.type||"img"===e.type||"audio"===e.type||"video"===e.type,h="delivery"===e.type||"read"===e.type||"channel"===e.type,f="cmd"===e.type,m="recall"===e.type,g=null==e?void 0:e.editMessageId,v=!(h||m||f||g);if(e.id){if(!p&&!h||p&&t.useOwnUploadFun){var E="recall"===e.type?U.fI.SEND_RECALL_MSG:U.fI.SEND_MSG;g&&(E=U.fI.MODIFY_MESSAGE),k.TJ.size<=k.F3&&k.TJ.set(e.id,{rpt:t.dataReport.geOperateFun({operationName:E})})}v&&(null===(i=null===(o=t._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.storeMessage(e,S.r.CREATE)),t._msgHash[e.id]=G(G({},e),{resolve:r,reject:n})}if(p||"combine"===e.type)return ye.call(t,e);if("txt"===e.type&&(null===(a=e.msgConfig)||void 0===a?void 0:a.languages)&&Array.isArray(null===(c=e.msgConfig)||void 0===c?void 0:c.languages)&&e.msgConfig.languages.length>0){var y=t.translateMessage||t.translation.translateMessage;if(!y)throw new Error("there is no method to translate message");y.call(t,{text:e.msg,languages:e.msgConfig.languages}).then((function(r){var n,o,i,a=null===(n=r.data[0])||void 0===n?void 0:n.translations;a=a.map((function(e){return{code:e.to,text:e.text}})),e.translations=a,t._msgHash[e.id].translations=a,null===(i=null===(o=t._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.storeMessage(e,S.r.INPROGRESS);var s=Ee.call(t,e);Ce.call(t,s,e.id)})).catch((function(e){n(e)}))}else{v&&(null===(d=null===(l=t._localCache)||void 0===l?void 0:l.getInstance())||void 0===d||d.storeMessage(e,S.r.INPROGRESS));var _=Ee.call(t,e);Ce.call(t,_,e.id)}}))}function Ce(e,t){var r,n=this;if(e.isHandleChatroom){if(!this.isOpened()){var o={data:"",type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};if(k.iO.has(e.id)){var i=k.iO.get(e.id);(0,i.rpt)({isEndApi:!0,data:{isSuccess:0,requestName:i.requestName,requestMethod:"WEBSOCKET",requestUrl:this.url,code:U.dd.disconnect,codeDesc:"websocket has been disconnected"}}),k.iO.delete(e.id)}return Promise.reject(o)}return new Promise((function(r,o){var i;n._msgHash[e.id]=G(G({},e),{resolve:r,reject:o});var a=v.P6.getEnvInfo();i="miniCore"===n.name||"web"===a.platform?e.joinMsg:z.call(n,e.joinMsg,t);var c=t&&setTimeout((function(){var t,r,o;if(n._msgHash[e.id]){var i={type:s.E.REQUEST_TIMEOUT,message:"request timeout"};null===(r=(t=n._msgHash[e.id]).reject)||void 0===r||r.call(t,i),clearTimeout(null===(o=n._msgHash[e.id])||void 0===o?void 0:o.messageTimer),delete n._msgHash[e.id],n.reconnecting||n.reconnect(!0)}}),P.xz);n._msgHash[e.id].messageTimer=c,n.sock.send(i)}))}if(!this.isOpened())return null===(r=this.unMSyncSendMsgMap)||void 0===r||r.set(t,e),!this.logOut&&this.autoReconnectNumTotal<this.autoReconnectNumMax&&(u.kg.debug("need to reconnect",this.autoReconnectNumTotal,this.autoReconnectNumMax),this.offLineSendConnecting=!0,this.reconnecting||this.reconnect()),void(this.onError&&this.onError({type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}));var a,c=t&&setTimeout((function(){var e,r,o;if(n._msgHash[null!=t?t:""]){var i={type:s.E.MESSAGE_SEND_TIMEOUT,message:"send message timeout"};null===(r=(e=n._msgHash[null!=t?t:""]).reject)||void 0===r||r.call(e,i),clearTimeout(null===(o=n._msgHash[null!=t?t:""])||void 0===o?void 0:o.messageTimer),delete n._msgHash[null!=t?t:""],n.reconnecting||n.reconnect(!0)}}),P.xz);this._msgHash[null!=t?t:""]&&(this._msgHash[null!=t?t:""].messageTimer=c);var l=v.P6.getEnvInfo();a="miniCore"===this.name||"web"===l.platform?e:z.call(this,e,t),this.sock.send(a)}var Ne=function(e,t){return e.send=Re,e.sendMsg=Re,u.kg.debug("init Msync by ".concat(e.name)),{generateProvision:K.bind(e),base64transform:z.bind(e),distributeMeta:V.bind(e),decodeMeta:X.bind(e),decodeUnreadDL:Y.bind(e),_rebuild:Q.bind(e),_lastsession:te.bind(e),receiveProvision:ie.bind(e),isInQueue:pe.bind(e),decodeNotice:he.bind(e),decodeMSync:fe.bind(e),distributeMSync:me.bind(e),encodeChatMsg:Ee.bind(e),upLoadFile:ye.bind(e),send:Re.bind(e),stopHeartBeat:le.bind(e),handleChatRoom:Oe.bind(e),sendUnreadDeal:ce.bind(e)}}},7252:function(e,t){"use strict";var r=function(){function e(e){this.type=e.type,this.message=e.message,this.data=e.data}return e.create=function(t){return new e(t)},e}();t.Z=r},8161:function(e,t,r){"use strict";r.d(t,{t:function(){return v}}),r(9601),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(7941),r(3710),r(9714),r(9653),r(6699),r(2023),r(2222),r(8309),r(9554),r(4747),r(2772);var n=r(3720),o=r.n(n),i=r(4363),a=r(4024),s=r(6424),c=r(9743),u=r(7360),l=r(2449),d=r(7288),p=function(){return p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},p.apply(this,arguments)},h=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},f=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},m={0:"TEXT",1:"IMAGE",2:"VIDEO",3:"LOCATION",4:"VOICE",5:"FILE",6:"COMMAND",7:"CUSTOM",8:"COMBINE"};function g(e){for(var t={},r=0;r<e.length;r++)if(8===e[r].type)t[e[r].key]=JSON.parse(e[r].stringValue);else if(7===e[r].type)t[e[r].key]=e[r].stringValue;else if(6===e[r].type)t[e[r].key]=e[r].doubleValue;else if(5===e[r].type)t[e[r].key]=e[r].floatValue;else if(1===e[r].type){var n=e[r].varintValue,i=new(o())(n.low,n.high,n.unsigned).toString();t[e[r].key]=0!==Number(i)}else 2!==e[r].type&&3!==e[r].type&&4!==e[r].type||(n=e[r].varintValue,i=new(o())(n.low,n.high,n.unsigned).toString(),t[e[r].key]=Number(i));return t}function v(e){var t="";return e.remotePath&&(t=a.P6.formatAttachUrl.call(this,e.remotePath),e.remotePath.includes("?em-redirect")||(t="".concat(t,"?em-redirect=true"),e.secretKey&&(t="".concat(t,"&share-secret=").concat(e.secretKey)))),t}function E(e,t){var r,n,o=t.from&&t.from.name;if(o===this.context.userId){var i=null===(r=null==e?void 0:e.from)||void 0===r?void 0:r.clientResource;o===(null===(n=null==t?void 0:t.to)||void 0===n?void 0:n.name)&&i&&i!==this.clientResource&&(o="".concat(o,"/").concat(i))}return o}function y(e,t){var r,n=t.to&&t.to.name;return(null===(r=null==e?void 0:e.to)||void 0===r?void 0:r.clientResource)&&(n="".concat(n,"/").concat(e.to.clientResource)),n}function _(e){var t,r,n,o,c,l,p,E,y,_,T,I,O,R,C,N,S,b,A,M,w,k,U,P,x,L,D;return h(this,void 0,void 0,(function(){var h,j,G,B,H,F,W,q,K,z,V,X,J,Z,Y,Q,$,ee,te,re,ne,oe,ie,ae,se,ce,ue,le,de,pe,he,fe,me,ge,ve,Ee,ye,_e,Te,Ie,Oe,Re,Ce,Ne,Se,be,Ae,Me,we,ke,Ue,Pe,xe,Le;return f(this,(function(f){switch(f.label){case 0:switch(h=e.status,j=e.thirdMessage,G=e.msgBody,B=e.msgId,H=e.type,F=e.from,W=e.to,q=e.time,K=e.onlineState,z=e.chatType,V=e.ignoreCallback,X=e.priority,J=e.format,Z=e.broadcast,Y=void 0!==Z&&Z,Q=e.isContentReplaced,$=void 0!==Q&&Q,ee={},te={},re=h.errorCode>0,ne=h.errorCode,oe=h.reason,ie={},ae=[],se=[],ce={},ue="",le=0,de=null,pe=null,fe=!1,me=!1,j.ext&&(ie=g(j.ext)),j.meta&&"string"==typeof j.meta&&((ge=JSON.parse(j.meta)).reaction&&(ae=ge.reaction).forEach((function(e){e.isAddedBySelf=e.state,delete e.state})),ge.translations&&(se=ge.translations),ge.edit_msg&&(ve=ge.edit_msg,Ee=ve.count,ye=ve.operator,_e=ve.edit_time,Te=ve.sender,Ie=ve.send_time,ce={operationTime:_e,operatorId:ye,operationCount:Ee},ue=Te,le=Ie),ge.thread&&"{}"!==JSON.stringify(ge.thread)&&(de={messageId:ge.thread.msg_parent_id,parentId:ge.thread.muc_parent_id,chatThreadName:ge.thread.thread_name}),ge.thread_overview&&"{}"!==JSON.stringify(ge.thread_overview)&&(pe={id:ge.thread_overview.id,parentId:ge.thread_overview.muc_parent_id,name:ge.thread_overview.name,lastMessage:ge.thread_overview.last_message&&"{}"!==JSON.stringify(ge.thread_overview.last_message)?i.w.call(this,ge.thread_overview.last_message):null,createTimestamp:ge.thread_overview.create_timestamp,updateTimestamp:ge.thread_overview.update_timestamp,messageCount:ge.thread_overview.message_count||0}),ge.isDelivered&&(fe=!0),ge.isRead&&(me=!0)),G.type){case 0:return[3,1];case 1:return[3,7];case 2:return[3,10];case 3:return[3,13];case 4:return[3,16];case 5:return[3,19];case 6:return[3,22];case 7:return[3,23];case 8:return[3,26]}return[3,27];case 1:return Object.prototype.hasOwnProperty.call(G,"subType")&&0===G.subType?(he=v.call(this,G),Oe={id:B,type:"combine",chatType:z,to:W,from:F,ext:ie,time:Number(q),onlineState:K,title:G.title||"",summary:G.summary||"",url:he||"",secret:G.secretKey||"",file_length:G.fileLength||0,filename:G.displayName||"",compatibleText:G.text,combineLevel:G.combineLevel||0},ee.msgConfig&&(Oe.msgConfig=ee.msgConfig),ae.length>0&&(Oe.reactions=ae),de&&(Oe.chatThread=de),pe&&(Oe.chatThreadOverview=pe),"chatRoom"===z&&(Oe.priority=X,Oe.broadcast=Y),$&&(Oe.isContentReplaced=$),me&&(Oe.isRead=!0),fe&&(Oe.isDelivered=!0),te=Oe,V?[3,3]:[4,null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r?void 0:r.storeMessage(Oe,d.r.SUCCESS)]):[3,4];case 2:f.sent(),null===(n=this.eventHandler)||void 0===n||n.dispatch("onCombineMessage",Oe),f.label=3;case 3:return[3,28];case 4:return!(ee={id:B,type:H,contentsType:m[G.type],from:F,to:W,data:G.text,ext:ie,sourceMsg:G.text,time:q,msgConfig:j.msgConfig,onlineState:K}).msgConfig&&delete j.msgConfig,ee.error=re,ee.errorText=oe,ee.errorCode=ne,!V&&this.onTextMessage&&this.onTextMessage(ee),Re={id:B,type:"txt",chatType:z,msg:G.text,to:W,from:F,ext:ie,time:Number(q),onlineState:K},ee.msgConfig&&(Re.msgConfig=ee.msgConfig),ae.length>0&&(Re.reactions=ae),de&&(Re.chatThread=de),pe&&(Re.chatThreadOverview=pe),se.length>0&&(Re.translations=se),ce.operationCount>0&&(Re.modifiedInfo=ce,j.type===s.gA.EDIT&&(Re.from=ue,Re.time=le)),"chatRoom"===z&&(Re.priority=X,Re.broadcast=Y),$&&(Re.isContentReplaced=$),me&&(Re.isRead=!0),fe&&(Re.isDelivered=!0),te=Re,V?[3,6]:[4,null===(c=null===(o=this._localCache)||void 0===o?void 0:o.getInstance())||void 0===c?void 0:c.storeMessage(Re,d.r.SUCCESS)];case 5:f.sent(),null===(l=this.eventHandler)||void 0===l||l.dispatch("onTextMessage",Re),f.label=6;case 6:return[3,28];case 7:return Ce=(null===(p=null==G?void 0:G.size)||void 0===p?void 0:p.width)||0,Ne=(null===(E=null==G?void 0:G.size)||void 0===E?void 0:E.height)||0,he=this.useOwnUploadFun?G.remotePath:v.call(this,G),!(ee={id:B,type:H,contentsType:m[G.type],from:F,to:W,url:he,secret:G.secretKey,filename:G.displayName,thumb:this.useOwnUploadFun?"":"".concat(he,"&thumbnail=true"),thumb_secret:G.secretKey,file_length:G.fileLength||"",width:Ce,height:Ne,filetype:G.filetype||"",accessToken:this.token,ext:ie,time:q,msgConfig:j.msgConfig,onlineState:K}).delay&&delete ee.delay,!ee.msgConfig&&delete j.msgConfig,ee.error=re,ee.errorText=oe,ee.errorCode=ne,!V&&this.onPictureMessage&&this.onPictureMessage(ee),Se={id:B,type:"img",chatType:z,from:F,to:W,url:he||"",width:Ce,height:Ne,secret:G.secretKey||"",thumb:this.useOwnUploadFun?"":"".concat(he,"&thumbnail=true"),thumb_secret:G.secretKey,file_length:G.fileLength||0,ext:ie,time:Number(q),onlineState:K},ee.msgConfig&&(Se.msgConfig=ee.msgConfig),ae.length>0&&(Se.reactions=ae),de&&(Se.chatThread=de),pe&&(Se.chatThreadOverview=pe),"chatRoom"===z&&(Se.priority=X,Se.broadcast=Y),$&&(Se.isContentReplaced=$),me&&(Se.isRead=!0),fe&&(Se.isDelivered=!0),te=Se,V?[3,9]:[4,null===(_=null===(y=this._localCache)||void 0===y?void 0:y.getInstance())||void 0===_?void 0:_.storeMessage(Se,d.r.SUCCESS)];case 8:f.sent(),null===(T=this.eventHandler)||void 0===T||T.dispatch("onImageMessage",Se),f.label=9;case 9:return[3,28];case 10:return he=this.useOwnUploadFun?G.remotePath:v.call(this,G),!(ee={id:B,type:H,contentsType:m[G.type],from:F,to:W,url:he,secret:G.secretKey,filename:G.displayName,length:G.duration||"",file_length:G.fileLength||"",filetype:G.filetype||"",accessToken:this.token||"",ext:ie,time:q,msgConfig:j.msgConfig,onlineState:K}).delay&&delete ee.delay,!ee.msgConfig&&delete j.msgConfig,ee.error=re,ee.errorText=oe,ee.errorCode=ne,!V&&this.onVideoMessage&&this.onVideoMessage(ee),be={id:B,type:"video",chatType:z,from:F,to:W,url:he,secret:G.secretKey,thumb:a.P6.formatAttachUrl.call(this,G.thumbnailRemotePath),thumb_secret:G.thumbnailSecretKey,filename:G.displayName,length:G.duration||0,file:{},file_length:G.fileLength||0,filetype:G.filetype||"",accessToken:this.token||"",ext:ie,time:Number(q),onlineState:K},ee.msgConfig&&(be.msgConfig=ee.msgConfig),ae.length>0&&(be.reactions=ae),de&&(be.chatThread=de),pe&&(be.chatThreadOverview=pe),"chatRoom"===z&&(be.priority=X,be.broadcast=Y),$&&(be.isContentReplaced=$),me&&(be.isRead=!0),fe&&(be.isDelivered=!0),te=be,V?[3,12]:[4,null===(O=null===(I=this._localCache)||void 0===I?void 0:I.getInstance())||void 0===O?void 0:O.storeMessage(be,d.r.SUCCESS)];case 11:f.sent(),null===(R=this.eventHandler)||void 0===R||R.dispatch("onVideoMessage",be),f.label=12;case 12:return[3,28];case 13:return!(ee={id:B,type:H,contentsType:m[G.type],from:F,to:W,addr:G.address,buildingName:G.buildingName,lat:G.latitude,lng:G.longitude,ext:ie,time:q,msgConfig:j.msgConfig,onlineState:K}).delay&&delete ee.delay,!ee.msgConfig&&delete j.msgConfig,ee.error=re,ee.errorText=oe,ee.errorCode=ne,!V&&this.onLocationMessage&&this.onLocationMessage(ee),Ae={id:B,type:"loc",chatType:z,from:F,to:W,buildingName:G.buildingName,addr:G.address,lat:G.latitude,lng:G.longitude,ext:ie,time:Number(q),onlineState:K},ee.msgConfig&&(Ae.msgConfig=ee.msgConfig),ae.length>0&&(Ae.reactions=ae),de&&(Ae.chatThread=de),pe&&(Ae.chatThreadOverview=pe),"chatRoom"===z&&(Ae.priority=X,Ae.broadcast=Y),$&&(Ae.isContentReplaced=$),me&&(Ae.isRead=!0),fe&&(Ae.isDelivered=!0),te=Ae,V?[3,15]:[4,null===(N=null===(C=this._localCache)||void 0===C?void 0:C.getInstance())||void 0===N?void 0:N.storeMessage(Ae,d.r.SUCCESS)];case 14:f.sent(),null===(S=this.eventHandler)||void 0===S||S.dispatch("onLocationMessage",Ae),f.label=15;case 15:return[3,28];case 16:return he=this.useOwnUploadFun?G.remotePath:v.call(this,G),!(ee={id:B,type:H,contentsType:m[G.type],from:F,to:W,url:he,secret:G.secretKey,filename:G.displayName,file_length:G.fileLength||"",accessToken:this.token||"",ext:ie,length:G.duration,time:q,msgConfig:j.msgConfig,onlineState:K}).delay&&delete ee.delay,!ee.msgConfig&&delete j.msgConfig,ee.error=re,ee.errorText=oe,ee.errorCode=ne,!V&&this.onAudioMessage&&this.onAudioMessage(ee),Me={id:B,type:"audio",chatType:z,from:F,to:W,url:he,secret:G.secretKey,file:{},filename:G.displayName,length:G.duration||0,file_length:G.fileLength||0,filetype:G.filetype||"",accessToken:this.token||"",ext:ie,time:Number(q),onlineState:K},ee.msgConfig&&(Me.msgConfig=ee.msgConfig),ae.length>0&&(Me.reactions=ae),de&&(Me.chatThread=de),pe&&(Me.chatThreadOverview=pe),"chatRoom"===z&&(Me.priority=X,Me.broadcast=Y),$&&(Me.isContentReplaced=$),me&&(Me.isRead=!0),fe&&(Me.isDelivered=!0),te=Me,V?[3,18]:[4,null===(A=null===(b=this._localCache)||void 0===b?void 0:b.getInstance())||void 0===A?void 0:A.storeMessage(Me,d.r.SUCCESS)];case 17:f.sent(),null===(M=this.eventHandler)||void 0===M||M.dispatch("onAudioMessage",Me),f.label=18;case 18:return[3,28];case 19:return he=this.useOwnUploadFun?G.remotePath:v.call(this,G),!(ee={id:B,type:H,contentsType:m[G.type],from:F,to:W,url:he,secret:G.secretKey,filename:G.displayName,file_length:G.fileLength,accessToken:this.token||"",ext:ie,time:q,msgConfig:j.msgConfig,onlineState:K}).delay&&delete ee.delay,!ee.msgConfig&&delete j.msgConfig,ee.error=re,ee.errorText=oe,ee.errorCode=ne,!V&&this.onFileMessage&&this.onFileMessage(ee),we={id:B,type:"file",chatType:z,from:F,to:W,url:he,secret:G.secretKey,file:{},filename:G.displayName,length:G.duration||0,file_length:G.fileLength||0,filetype:G.filetype||"",accessToken:this.token||"",ext:ie,time:Number(q),onlineState:K},ee.msgConfig&&(we.msgConfig=ee.msgConfig),ae.length>0&&(we.reactions=ae),de&&(we.chatThread=de),pe&&(we.chatThreadOverview=pe),"chatRoom"===z&&(we.priority=X,we.broadcast=Y),$&&(we.isContentReplaced=$),me&&(we.isRead=!0),fe&&(we.isDelivered=!0),te=we,V?[3,21]:[4,null===(k=null===(w=this._localCache)||void 0===w?void 0:w.getInstance())||void 0===k?void 0:k.storeMessage(we,d.r.SUCCESS)];case 20:f.sent(),null===(U=this.eventHandler)||void 0===U||U.dispatch("onFileMessage",we),f.label=21;case 21:return[3,28];case 22:return!(ee={id:B,type:H,contentsType:m[G.type],from:F,to:W,action:G.action,ext:ie,time:q,msgConfig:j.msgConfig,onlineState:K}).msgConfig&&delete j.msgConfig,ee.error=re,ee.errorText=oe,ee.errorCode=ne,!V&&this.onCmdMessage&&this.onCmdMessage(ee),ke={id:B,type:"cmd",chatType:z,from:F,to:W,action:G.action,ext:ie,time:Number(q),onlineState:K},ee.msgConfig&&(ke.msgConfig=ee.msgConfig),ae.length>0&&(ke.reactions=ae),de&&(ke.chatThread=de),pe&&(ke.chatThreadOverview=pe),"chatRoom"===z&&(ke.priority=X,ke.broadcast=Y),$&&(ke.isContentReplaced=$),me&&(ke.isRead=!0),fe&&(ke.isDelivered=!0),te=ke,V||null===(P=this.eventHandler)||void 0===P||P.dispatch("onCmdMessage",ke),[3,28];case 23:return Ue={},Pe={},j.contents[0].customExts&&(Ue=g(j.contents[0].customExts)),j.contents[0].params&&(Pe=g(j.contents[0].params)),ee={id:B,type:H,contentsType:m[G.type],from:F,to:W,customEvent:G.customEvent,params:Pe,customExts:Ue,ext:ie,time:q,onlineState:K},!V&&this.onCustomMessage&&this.onCustomMessage(ee),xe={id:B,type:"custom",chatType:z,from:F,to:W,customEvent:G.customEvent,params:Pe,customExts:Ue,ext:ie,time:Number(q),onlineState:K},ee.msgConfig&&(xe.msgConfig=ee.msgConfig),ae.length>0&&(xe.reactions=ae),de&&(xe.chatThread=de),pe&&(xe.chatThreadOverview=pe),ce.operationCount>0&&(xe.modifiedInfo=ce,j.type===s.gA.EDIT&&(xe.from=ue,xe.time=le)),"chatRoom"===z&&(xe.priority=X,xe.broadcast=Y),$&&(xe.isContentReplaced=$),me&&(xe.isRead=!0),fe&&(xe.isDelivered=!0),te=xe,V?[3,25]:[4,null===(L=null===(x=this._localCache)||void 0===x?void 0:x.getInstance())||void 0===L?void 0:L.storeMessage(xe,d.r.SUCCESS)];case 24:f.sent(),null===(D=this.eventHandler)||void 0===D||D.dispatch("onCustomMessage",xe),f.label=25;case 25:return[3,28];case 26:return he=v.call(this,G),Le={id:B,type:"combine",chatType:z,to:W,from:F,ext:ie,time:Number(q),onlineState:K,title:G.title||"",summary:G.summary||"",url:he||"",secret:G.secretKey||"",file_length:G.fileLength||0,filename:G.displayName||"",compatibleText:G.text,combineLevel:G.combineLevel||0},ee.msgConfig&&(Le.msgConfig=ee.msgConfig),ae.length>0&&(Le.reactions=ae),de&&(Le.chatThread=de),pe&&(Le.chatThreadOverview=pe),"chatRoom"===z&&(Le.priority=X,Le.broadcast=Y),$&&(Le.isContentReplaced=$),me&&(Le.isRead=!0),fe&&(Le.isDelivered=!0),te=Le,!V&&this.eventHandler&&this.eventHandler.dispatch("onCombineMessage",Le),[3,28];case 27:return u.kg.error("Unknow message type, message:",G),[3,28];case 28:return J?[2,te]:[2,ee]}}))}))}function T(e,t,r){if(this.delivery&&e!==t){var n=this.getUniqueId(),o=new l.Message("delivery",n);o.set({ackId:r,to:e}),u.kg.debug("send delivery ack"),this.send(o.body)}}t.Z=function(e,t,r,n,i){var l,d,m,v,I,O,R,C,N,S,b,A,M,w,k,U,P,x,L,D,j,G,B,H,F,W;return h(this,void 0,void 0,(function(){var h,q,K,z,V,X,J,Z,Y,Q,$,ee,te,re,ne,oe,ie,ae,se,ce,ue,le,de,pe,he,fe,me,ge,ve,Ee,ye,_e,Te,Ie,Oe,Re,Ce,Ne,Se,be,Ae;return f(this,(function(f){switch(f.label){case 0:if(h=new(o())(e.timestamp.low,e.timestamp.high,e.timestamp.unsigned).toString(),q=this.root.lookup("easemob.pb.MessageBody"),K=q.decode(e.payload),z=3,V=!1,X=new(o())(e.id.low,e.id.high,e.id.unsigned).toString(),i&&e.from&&e.from.name===this.context.userId&&e.from.clientResource===this.clientResource&&K.type===s.gA.CHATROOM)return[2,u.kg.debug("Discard your own chat room message:",X)];if(e.meta&&e.meta.length){if(J=a.P6.parseNotify(e.meta),Z=J.is_online,Y=J.callback_replace,this.useReplacedMessageContents&&Y&&(V=!0),Z||0===Z)switch(Z){case 0:z=0;break;case 1:z=1;break;default:z=2}}else z=3;switch(Q=K.ackMessageId?new(o())(K.ackMessageId.low,K.ackMessageId.high,K.ackMessageId.unsigned).toString():"",$="",ee=E.call(this,e,K),te=y.call(this,e,K),u.kg.debug("meta thirdMessage:",{metaId:X,metaNs:e.ns,type:K.type,from:ee,to:te,contentType:null===(d=null===(l=K.contents)||void 0===l?void 0:l[0])||void 0===d?void 0:d.type,contentLen:null===(m=K.contents)||void 0===m?void 0:m.length}),K.type){case s.gA.SINGLECHAT:return[3,1];case s.gA.GROUPCHAT:return[3,2];case s.gA.CHATROOM:return[3,3];case s.gA.READ_ACK:return[3,4];case s.gA.DELIVER_ACK:return[3,5];case s.gA.RECALL:return[3,6];case s.gA.CHANNEL_ACK:return[3,15];case s.gA.EDIT:return[3,16]}return[3,20];case 1:return $="chat","agoraToken"===this.grantType&&($="singleChat"),this.delivery&&!r&&ee!==this.context.userId&&T.call(this,ee,te,X),[3,21];case 2:return $="groupchat","agoraToken"===this.grantType&&($="groupChat"),[3,21];case 3:return $="chatroom","agoraToken"===this.grantType&&($="chatRoom"),z=1,[3,21];case 4:return $="read_ack",re=void 0,K.ext[0]&&JSON.parse(K.ext[0].stringValue)?(re={id:X,type:"read",from:ee,to:te,mid:Q,groupReadCount:K.ext[0]&&JSON.parse(K.ext[0].stringValue),ackContent:K.ackContent,onlineState:z},this.onReadMessage&&this.onReadMessage(re),null===(v=this.eventHandler)||void 0===v||v.dispatch("onReadMessage",re),[2]):(re={id:X,type:"read",from:ee,to:te,mid:Q,onlineState:z},this.onReadMessage&&this.onReadMessage(re),null===(I=this.eventHandler)||void 0===I||I.dispatch("onReadMessage",re),[2]);case 5:return $="deliver_ack",this.onDeliveredMessage&&this.onDeliveredMessage({id:X,type:"delivery",from:ee,to:te,mid:Q,onlineState:z}),ne={id:X,type:"delivery",from:ee,to:te,mid:Q,onlineState:z},null===(O=this.eventHandler)||void 0===O||O.dispatch("onDeliveredMessage",ne),[2];case 6:return $="recall",oe="",e.ext&&(oe=(null===(R=g(e.ext))||void 0===R?void 0:R.recallMessageExtensionInfo)||""),ie={id:X,from:ee||"admin",to:te,mid:Q,ext:oe,onlineState:z},ae=te===this.user?ee:te,[4,null===(N=null===(C=this._localCache)||void 0===C?void 0:C.getInstance())||void 0===N?void 0:N.getMessageByServerMsgId(ie.mid)];case 7:return(se=f.sent())?[4,null===(b=null===(S=this._localCache)||void 0===S?void 0:S.getInstance())||void 0===b?void 0:b.removeMsgByServerMsgId(ie.mid)]:[3,9];case 8:f.sent(),f.label=9;case 9:return"singleChat"!==(null==se?void 0:se.chatType)&&"groupChat"!==(null==se?void 0:se.chatType)?[3,14]:(ce=(null==se?void 0:se.from)===this.user||""===(null==se?void 0:se.from),[4,null===(M=null===(A=this._localCache)||void 0===A?void 0:A.getInstance())||void 0===M?void 0:M.getConversationLastMessage(ae,se.chatType)]);case 10:return ue=f.sent(),[4,null===(k=null===(w=this._localCache)||void 0===w?void 0:w.getInstance())||void 0===k?void 0:k.getConversationBySessionId((0,c.MQ)({conversationId:ae,conversationType:se.chatType}))];case 11:return(le=f.sent())?[4,null===(P=null===(U=this._localCache)||void 0===U?void 0:U.getInstance())||void 0===P?void 0:P.updateLocalConversation((0,c.MQ)({conversationId:ae,conversationType:se.chatType}),{lastMessageId:null==ue?void 0:ue.serverMsgId,unReadCount:(0,c.E7)({conversation:le,isRecallSelfMsg:ce,recalledMsgTime:se.time})})]:[3,13];case 12:f.sent(),f.label=13;case 13:f.label=14;case 14:return this.onRecallMessage&&this.onRecallMessage(ie),null===(x=this.eventHandler)||void 0===x||x.dispatch("onRecallMessage",ie),[2];case 15:return this.onChannelMessage&&this.onChannelMessage({id:X,type:"channel",chatType:"singleChat",from:ee,to:te,time:Number(h),onlineState:z}),de={id:X,type:"channel",chatType:"singleChat",from:ee,to:te,time:Number(h),onlineState:z},null===(L=this.eventHandler)||void 0===L||L.dispatch("onChannelMessage",de),[2];case 16:return pe={errorCode:0,reason:""},[4,_.call(this,{status:pe,thirdMessage:K,msgBody:K.contents[0],msgId:X,type:$,from:ee,to:te,time:h,onlineState:z,ignoreCallback:!0,format:!0,isContentReplaced:V})];case 17:return he=f.sent(),fe=!!e.to&&-1!==e.to.domain.indexOf("conference"),he.chatType=fe?"groupChat":"singleChat",me=K.editMessageId&&new(o())(K.editMessageId.low,K.editMessageId.high,K.editMessageId.unsigned).toString(),ge={},ve=he.ext&&Object.keys(he.ext).length>0,"txt"===he.type?(Ee=he.type,ye=he.chatType,_e=he.to,Te=he.from,Ie=he.time,Oe=he.modifiedInfo,ge={id:me,type:Ee,chatType:ye,to:_e,from:Te,time:Ie,modifiedInfo:Oe,msg:he.msg},he.translations&&(ge.translations=he.translations)):"custom"===he.type&&((ge=he).id=me,delete ge.onlineState),ve&&(ge.ext=he.ext),ge?[4,null===(j=null===(D=this._localCache)||void 0===D?void 0:D.getInstance())||void 0===j?void 0:j.getMessageByServerMsgId(me)]:[3,19];case 18:"txt"===(null==(Re=f.sent())?void 0:Re.type)&&"txt"===ge.type?null===(B=null===(G=this._localCache)||void 0===G?void 0:G.getInstance())||void 0===B||B.putMessageToDB(p(p({},Re),{msg:ge.msg,ext:ge.ext||Re.ext,modifiedInfo:ge.modifiedInfo,translations:ge.translations})):"custom"===(null==Re?void 0:Re.type)&&"custom"===ge.type&&(null===(F=null===(H=this._localCache)||void 0===H?void 0:H.getInstance())||void 0===F||F.putMessageToDB(p(p({},Re),{modifiedInfo:ge.modifiedInfo,customEvent:ge.customEvent,customExts:ge.customExts,ext:ge.ext||Re.ext}))),f.label=19;case 19:return"txt"!==he.type&&"custom"!==he.type||null===(W=this.eventHandler)||void 0===W||W.dispatch("onModifiedMessage",ge),[2];case 20:return u.kg.error("unexpected message type: ".concat(K.type)),[2];case 21:Ce="normal",Se=!1,"chat"===$.toLowerCase()||"singleChat"===$?Ne="singleChat":"groupchat"===$.toLowerCase()||"groupChat"===$?Ne="groupChat":(Ne="chatRoom",z=1,e.ext&&(be=g(e.ext),Se=!!(null==be?void 0:be.is_broadcast),Ce=0===be.chatroom_msg_tag?"high":2===be.chatroom_msg_tag?"low":"normal")),Ae=0,f.label=22;case 22:return Ae<K.contents.length?[4,_.call(this,{status:t,thirdMessage:K,msgBody:K.contents[Ae],msgId:X,type:$,from:ee,to:te,time:h,onlineState:z,chatType:Ne,ignoreCallback:r,priority:Ce,format:n,broadcast:Se,isContentReplaced:V})]:[3,25];case 23:return[2,f.sent()];case 24:return Ae++,[3,22];case 25:return[2]}}))}))}},7288:function(e,t,r){"use strict";var n;r.d(t,{r:function(){return n}}),function(e){e[e.CREATE=0]="CREATE",e[e.FAIL=1]="FAIL",e[e.INPROGRESS=2]="INPROGRESS",e[e.SUCCESS=3]="SUCCESS"}(n||(n={}))},9743:function(e,t,r){"use strict";r.d(t,{E7:function(){return o},MQ:function(){return n},un:function(){return i}}),r(2222);var n=function(e){return"".concat(e.conversationType,"-").concat(e.conversationId)},o=function(e){var t=e.isRecallSelfMsg,r=e.conversation,n=e.recalledMsgTime,o=r.unReadCount,i=void 0===o?0:o,a=r.unreadCountClearTimestamp;return t||(void 0===a?0:a)>n?i:i&&i>0?i-1:0},i=function(e){var t,r=0;if(0===e.length)return r;for(t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return r}},7360:function(e,t,r){"use strict";function n(){console.log&&(console.log.apply?console.log.apply(console,Array.prototype.slice.call(arguments)):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}r.d(t,{kg:function(){return m}}),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(7042),r(2222),r(8309),r(9600),r(3843),r(3710),r(2564),r(285),r(1637),r(4812),r(9554),r(2772),r(4916);var o="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=r(4024);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var s,c=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},u=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},l=function(){},d={};!function(e){e[e.TRACE=0]="TRACE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(s||(s={}));var p=function(){function e(e,t,r){this.name=e||"defaultLogger",this.currentLevel=0,this.useCookiePersist=!1,this.storageLogLevelKey="loglevel",this.levels=s,this.consoleLogVisibility=!0,this.logMethods=["trace","debug","info","warn","error"],this.methodFactory=r||this.defaultMethodFactory,this.report=!1;var n=this._getPersistedLevel();null==n&&(n=null===t?"WARN":t),this.logs=[],this.reportLogs=[],this.reportInterval=3e5,this.timer=null,this.config={useCache:!1,maxCache:3145728,color:"",background:""},this.logBytes=0,this.setLevel(n,!1,"")}return e.prototype.reportLog=function(){var e,t,r;return c(this,void 0,void 0,(function(){var n,o,a,s,c,l,d,p;return u(this,(function(u){switch(u.label){case 0:if(0===(null===(e=this.reportLogs)||void 0===e?void 0:e.length))return[2];for(n=2097152,o=this.reportLogs.join("\n")+"\n",a=o.length,s=[];a>n;)s.push(o.substring(0,n)),a-=n,o=o.substring(n);s.push(o),c=0,l=s,u.label=1;case 1:if(!(c<l.length))return[3,8];if(d=l[c],this.reportLogs=[],!(null===(r=null===(t=this.connection)||void 0===t?void 0:t.context)||void 0===r?void 0:r.accessToken))return[2];u.label=2;case 2:return u.trys.push([2,4,,5]),[4,this.reportData(d)];case 3:return"ok"!==(null==(p=u.sent())?void 0:p.status)&&this.reportLogs.unshift(d),[3,5];case 4:return u.sent(),this.reportLogs.unshift(d),[3,5];case 5:return[4,i.P6.delay(3e3)];case 6:u.sent(),u.label=7;case 7:return c++,[3,1];case 8:return[2]}}))}))},e.prototype.reportData=function(e){var t,r=this;if(this.connection){var n=this.connection.context||{},o=n.orgName,a=n.appName,s=n.accessToken,c=n.userId;if(o&&a){var u={url:"".concat(null===(t=this.connection)||void 0===t?void 0:t.apiUrl,"/").concat(o,"/").concat(a,"/sdk/users/").concat(c,"/client/logs"),type:"POST",data:JSON.stringify({resource:this.connection.clientResource||"random_".concat(Date.now()),logContent:e}),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return i.hj.call(this.connection,u).then((function(e){return r.log("report log success",e),e})).catch((function(e){r.error("report log error",e)}))}}else this.error("report log error","connection is null")},e.prototype._regularlyReportLogs=function(){var e,t=this;this.timer&&clearInterval(this.timer),(null!==(e=this.reportInterval)&&void 0!==e?e:0)<6e4&&(this.reportInterval=6e4),this.timer=setInterval((function(){t.reportLog()}),this.reportInterval||3e5)},e.prototype._stopReportLogs=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.reportLog()];case 1:return e.sent(),[3,3];case 2:return e.sent(),this.error("report log error when stopping upload"),[3,3];case 3:return this.reportLogs=[],clearInterval(this.timer),[2]}}))}))},e.prototype.setConfig=function(e){this.config=e},e.prototype.getLevel=function(){return this.currentLevel},e.prototype.setLevel=function(e,t,r){if("string"==typeof e&&(e=s[e]),void 0===e&&(e=0),!("number"==typeof e&&e>=0&&e<=this.levels.SILENT))throw Error("log.setLevel() called with invalid level: "+e);if(this.currentLevel=e,!1!==t&&this._persistLevel(e),this.replaceLoggingMethods(e,r||""),"undefined"==typeof console&&e<s.SILENT)throw Error("No console available for logging")},e.prototype.setDefaultLevel=function(e){this._getPersistedLevel()||this.setLevel(e,!1,"")},e.prototype.enableAll=function(e){this.setLevel(this.levels.TRACE,!0,"")},e.prototype.disableAll=function(e){this.setLevel(this.levels.SILENT,!0,"")},e.prototype.getLogs=function(){return this.logs},e.prototype.download=function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var e=this.getLogs().join("\n"),t=new Blob([e],{type:"text/plain;charset=UTF-8"}),r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.setAttribute("download","sdklog"),document.body.appendChild(n),n.click()}},e.prototype.setConsoleLogVisibility=function(e){this.consoleLogVisibility=e},e.prototype._bindMethod=function(e,t,r){var n=this,o=e[t],i=this.getTime();if(r)return this._cacheLog;if("function"==typeof o.bind)return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=n.getTime();n.consoleLogVisibility&&o.call.apply(o,function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}([e,"".concat(a," IM SDK [").concat("log"===t?"debug":t,"]: ")],r,!1)),n.onLog&&n.onLog({time:a,level:"log"===t?"debug":t,logs:r}),n._cacheReportLogs.apply(n,r)};try{return Function.prototype.bind.call(o,e,"".concat(i," IM SDK [").concat("log"===t?"debug":t,"]: "))}catch(t){return function(){return Function.prototype.apply.apply(o,[e,arguments])}}},e.prototype.getTime=function(){var e=new Date;return e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()},e.prototype._cacheLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(new Date).toLocaleString()+": ",n="";e.forEach((function(e){"object"===a(e)?n+=JSON.stringify(e)+" ":n+=e+" "})),this._cacheLogCall(r+n),this._cacheReportLogs.apply(this,e)},e.prototype._cacheLogCall=function(e){var t=e.length,r=this.logBytes+t,n=this.config.maxCache;if(!(t>=n)){if(r<n)this.logBytes+=t;else for(var o=r-n,i=0;i<o;){var a=this.logs.shift();void 0!==a&&(i+=a.length)}this.logs.push(e)}},e.prototype._cacheReportLogs=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.report){var r=(new Date).toLocaleString()+": ",n="";e.forEach((function(e){"object"===a(e)?n+=JSON.stringify(e)+" ":n+=e+" "})),this.reportLogs.push(r+n)}},e.prototype._getPersistedLevel=function(){var e;if("undefined"==typeof window)return 5;if("undefined"===(e=window&&window.localStorage&&window.localStorage[this.storageLogLevelKey])){var t=window.document.cookie,r=t.indexOf(encodeURIComponent(this.storageLogLevelKey));-1!==r&&(e=/^([^;]+)/.exec(t.slice(r))[1])}return e||5},e.prototype._persistLevel=function(e){var t=this.logMethods[e]||"SILENT";if("undefined"!=typeof window){if(window.localStorage)try{window.localStorage[this.storageLogLevelKey]=t}catch(e){console.log(e)}this.useCookiePersist&&(window.document.cookie=encodeURIComponent(this.storageLogLevelKey)+"="+t+";")}},e.prototype.replaceLoggingMethods=function(e,t){for(var r=this,n=0;n<this.logMethods.length;n++){var o=this.logMethods[n];this[o]=n<e?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r.report&&r._cacheReportLogs.apply(r,e)}:this.methodFactory(o,e,t)}this.log=this.debug},e.prototype.defaultMethodFactory=function(e,t,r){return this.realMethod(e)||this.enableLoggingWhenConsoleArrives.apply(this,[e,t,r])},e.prototype.realMethod=function(e){return"debug"===e&&(e="log"),"undefined"!=typeof console&&("trace"===e&&o?n:void 0!==console[e]?this._bindMethod(console,e,this.config.useCache):void 0!==console.log?this._bindMethod(console,"log",this.config.useCache):l)},e.prototype.enableLoggingWhenConsoleArrives=function(e,t,r){return function(){"undefined"!=typeof console&&(this.replaceLoggingMethods.call(this,t,r),this[e].apply(this,arguments))}.bind(this)},e}(),h=new p;h.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");return this};var f="undefined"!=typeof window?window.log:void 0;h.noConflict=function(){return"undefined"!=typeof window&&window.log===h&&(window.log=f),h},h.getLoggers=function(){return d},h.initReport=function(e){var t=e.report,r=e.reportInterval,n=e.connection;h.report=t,h.reportInterval=r,h.connection=n,t&&h._regularlyReportLogs()};var m=h},2449:function(e,t,r){"use strict";r.d(t,{Message:function(){return g}});var n=r(4024),o=function(){function e(e){var t=e.id;this.id=t,this.type=e.type}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.id,type:"read",to:e.to,from:e.from||"",chatType:e.chatType}},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType,ackId:e.id,type:"read",to:e.to,from:e.from||"",ackContent:e.ackContent,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),i=function(){function e(e){this.id=e.id,this.type=e.type}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.ackId,type:"delivery",to:e.to,from:e.from||""}},e.create=function(e){return{id:n.P6.getUniqueId(),ackId:e.ackId,type:"delivery",to:e.to,from:e.from||"",isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),a=(r(3843),r(3710),function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"channel",to:e.to,from:e.from||"",time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),type:"channel",chatType:e.chatType||"singleChat",to:e.to,from:e.from||"",time:Date.now(),isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}()),s=(r(9753),function(){function e(e){var t=e.type,r=e.id||n.P6.getUniqueId();this.id=r,this.type=t,this.value=""}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"txt",to:e.to,msg:e.msg,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),isChatThread:e.isChatThread},this.value=e.msg},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){var t,r;return(null===(t=e.msgConfig)||void 0===t?void 0:t.languages)&&Array.isArray(null===(r=e.msgConfig)||void 0===r?void 0:r.languages),{type:"txt",id:n.P6.getUniqueId(),msg:e.msg,to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}()),c=function(){function e(e){var t=e.type,r=e.id;this.id=r||n.P6.getUniqueId(),this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"cmd",to:e.to,action:e.action,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),type:"cmd",to:e.to,from:e.from||"",chatType:e.chatType||"singleChat",action:e.action,time:Date.now(),ext:e.ext,msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),u=function(){function e(e){var t=e.type,r=e.id||n.P6.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),l=function(){function e(e){var t=e.type,r=e.id;this.id=r||n.P6.getUniqueId(),this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),d=function(){function e(e){var t=e.type,r=e.id||n.P6.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&n.P6.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"img",file:e.file,width:e.width,height:e.height,to:e.to,from:e.from||"",roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType,type:"img",url:e.url,width:e.width,height:e.height,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,file_length:e.file_length,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,thumbnailWidth:e.thumbnailWidth,thumbnailHeight:e.thumbnailHeight}},e}(),p=function(){function e(e){var t=e.type,r=e.id||n.P6.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&n.P6.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"audio",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType,type:"audio",filename:e.filename,length:e.length,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,file_length:e.file_length,msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),h=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&n.P6.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),apiUrl:e.apiUrl,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),f=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&n.P6.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,file_length:e.file_length,to:e.to,from:e.from||"",ext:e.ext,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),m=function(){function e(e){var t=e.type,r=e.id||n.P6.getUniqueId();this.id=r,this.type=t,this.value=""}return e.create=function(e){return{type:"combine",id:n.P6.getUniqueId(),to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,compatibleText:e.compatibleText,title:e.title,summary:e.summary,messageList:e.messageList,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete}},e}(),g=function(){function e(t,r){return this.type=t,this.id=r||n.P6.getUniqueId(),e.createOldMsg({type:t,id:this.id})}return e.createOldMsg=function(e){switch(e.type){case"read":return new o({type:"read",id:e.id});case"delivery":return new i({type:"delivery",id:e.id});case"channel":return new a({type:"channel",id:e.id});case"txt":return new s({type:"txt",id:e.id});case"cmd":return new c({type:"cmd",id:e.id});case"custom":return new u({type:"custom",id:e.id});case"loc":return new l({type:"loc",id:e.id});case"img":return new d({type:"img",id:e.id});case"audio":return new p({type:"audio",id:e.id});case"video":return new h({type:"video",id:e.id});case"file":return new f({type:"file",id:e.id})}},e.create=function(e){return"txt"!==(t=e).type||"version"in t?function(e){return"img"===e.type&&!("version"in e)}(e)?d.create(e):function(e){return"cmd"===e.type&&!("version"in e)}(e)?c.create(e):function(e){return"file"===e.type&&!("version"in e)}(e)?f.create(e):function(e){return"audio"===e.type&&!("version"in e)}(e)?p.create(e):function(e){return"video"===e.type&&!("version"in e)}(e)?h.create(e):function(e){return"custom"===e.type&&!("version"in e)}(e)?u.create(e):function(e){return"loc"===e.type&&!("version"in e)}(e)?l.create(e):function(e){return"channel"===e.type&&!("version"in e)}(e)?a.create(e):function(e){return"delivery"===e.type&&!("version"in e)}(e)?i.create(e):function(e){return"read"===e.type&&!("version"in e)}(e)?o.create(e):function(e){return"combine"===e.type&&!("version"in e)}(e)?m.create(e):{}:s.create(e);var t},e.prototype.set=function(e){},e.getFileUrl=n.P6.getFileUrl,e.download=n.P6.download,e.parseDownloadResponse=n.P6.parseDownloadResponse,e}()},5531:function(e,t,r){"use strict";var n;r.d(t,{E:function(){return n}}),function(e){e[e.REQUEST_SUCCESS=0]="REQUEST_SUCCESS",e[e.REQUEST_TIMEOUT=-1]="REQUEST_TIMEOUT",e[e.REQUEST_UNKNOWN=-2]="REQUEST_UNKNOWN",e[e.REQUEST_PARAMETER_ERROR=-3]="REQUEST_PARAMETER_ERROR",e[e.REQUEST_ABORT=-4]="REQUEST_ABORT",e[e.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR=0]="WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_OPEN_ERROR=1]="WEBIM_CONNCTION_OPEN_ERROR",e[e.WEBIM_CONNCTION_AUTH_ERROR=2]="WEBIM_CONNCTION_AUTH_ERROR",e[e.WEBIM_CONNCTION_OPEN_USERGRID_ERROR=3]="WEBIM_CONNCTION_OPEN_USERGRID_ERROR",e[e.WEBIM_CONNCTION_ATTACH_ERROR=4]="WEBIM_CONNCTION_ATTACH_ERROR",e[e.WEBIM_CONNCTION_ATTACH_USERGRID_ERROR=5]="WEBIM_CONNCTION_ATTACH_USERGRID_ERROR",e[e.WEBIM_CONNCTION_REOPEN_ERROR=6]="WEBIM_CONNCTION_REOPEN_ERROR",e[e.WEBIM_CONNCTION_SERVER_CLOSE_ERROR=7]="WEBIM_CONNCTION_SERVER_CLOSE_ERROR",e[e.WEBIM_CONNCTION_SERVER_ERROR=8]="WEBIM_CONNCTION_SERVER_ERROR",e[e.WEBIM_CONNCTION_IQ_ERROR=9]="WEBIM_CONNCTION_IQ_ERROR",e[e.WEBIM_CONNCTION_PING_ERROR=10]="WEBIM_CONNCTION_PING_ERROR",e[e.WEBIM_CONNCTION_NOTIFYVERSION_ERROR=11]="WEBIM_CONNCTION_NOTIFYVERSION_ERROR",e[e.WEBIM_CONNCTION_GETROSTER_ERROR=12]="WEBIM_CONNCTION_GETROSTER_ERROR",e[e.WEBIM_CONNCTION_CROSSDOMAIN_ERROR=13]="WEBIM_CONNCTION_CROSSDOMAIN_ERROR",e[e.WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES=14]="WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES",e[e.WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR=15]="WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR",e[e.WEBIM_CONNCTION_DISCONNECTED=16]="WEBIM_CONNCTION_DISCONNECTED",e[e.WEBIM_CONNCTION_AJAX_ERROR=17]="WEBIM_CONNCTION_AJAX_ERROR",e[e.WEBIM_CONNCTION_JOINROOM_ERROR=18]="WEBIM_CONNCTION_JOINROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOM_ERROR=19]="WEBIM_CONNCTION_GETROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOMINFO_ERROR=20]="WEBIM_CONNCTION_GETROOMINFO_ERROR",e[e.WEBIM_CONNCTION_GETROOMMEMBER_ERROR=21]="WEBIM_CONNCTION_GETROOMMEMBER_ERROR",e[e.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR=22]="WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR",e[e.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR=23]="WEBIM_CONNCTION_LOAD_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR=24]="WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_JOINCHATROOM_ERROR=25]="WEBIM_CONNCTION_JOINCHATROOM_ERROR",e[e.WEBIM_CONNCTION_QUITCHATROOM_ERROR=26]="WEBIM_CONNCTION_QUITCHATROOM_ERROR",e[e.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR=27]="WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR=28]="WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR=29]="WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR=30]="WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_CALLBACK_INNER_ERROR=31]="WEBIM_CONNCTION_CALLBACK_INNER_ERROR",e[e.WEBIM_CONNCTION_CLIENT_OFFLINE=32]="WEBIM_CONNCTION_CLIENT_OFFLINE",e[e.WEBIM_CONNCTION_CLIENT_LOGOUT=33]="WEBIM_CONNCTION_CLIENT_LOGOUT",e[e.WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR=34]="WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR",e[e.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP=35]="WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP=36]="WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP=37]="WEBIM_CONNECTION_ACCEPT_JOIN_GROUP",e[e.WEBIM_CONNECTION_DECLINE_JOIN_GROUP=38]="WEBIM_CONNECTION_DECLINE_JOIN_GROUP",e[e.WEBIM_CONNECTION_CLOSED=39]="WEBIM_CONNECTION_CLOSED",e[e.WEBIM_CONNECTION_ERROR=40]="WEBIM_CONNECTION_ERROR",e[e.MAX_LIMIT=50]="MAX_LIMIT",e[e.MESSAGE_NOT_FOUND=51]="MESSAGE_NOT_FOUND",e[e.NO_PERMISSION=52]="NO_PERMISSION",e[e.OPERATION_UNSUPPORTED=53]="OPERATION_UNSUPPORTED",e[e.OPERATION_NOT_ALLOWED=54]="OPERATION_NOT_ALLOWED",e[e.WEBIM_TOKEN_EXPIRED=56]="WEBIM_TOKEN_EXPIRED",e[e.WEBIM_SERVER_SERVING_DISABLED=57]="WEBIM_SERVER_SERVING_DISABLED",e[e.WEBIM_UPLOADFILE_BROWSER_ERROR=100]="WEBIM_UPLOADFILE_BROWSER_ERROR",e[e.WEBIM_UPLOADFILE_ERROR=101]="WEBIM_UPLOADFILE_ERROR",e[e.WEBIM_UPLOADFILE_NO_LOGIN=102]="WEBIM_UPLOADFILE_NO_LOGIN",e[e.WEBIM_UPLOADFILE_NO_FILE=103]="WEBIM_UPLOADFILE_NO_FILE",e[e.WEBIM_DOWNLOADFILE_ERROR=200]="WEBIM_DOWNLOADFILE_ERROR",e[e.WEBIM_DOWNLOADFILE_NO_LOGIN=201]="WEBIM_DOWNLOADFILE_NO_LOGIN",e[e.WEBIM_DOWNLOADFILE_BROWSER_ERROR=202]="WEBIM_DOWNLOADFILE_BROWSER_ERROR",e[e.PARSE_FILE_ERROR=203]="PARSE_FILE_ERROR",e[e.USER_NOT_FOUND=204]="USER_NOT_FOUND",e[e.MESSAGE_PARAMETER_ERROR=205]="MESSAGE_PARAMETER_ERROR",e[e.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE=206]="WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE",e[e.WEBIM_CONNCTION_USER_REMOVED=207]="WEBIM_CONNCTION_USER_REMOVED",e[e.WEBIM_USER_ALREADY_LOGIN=208]="WEBIM_USER_ALREADY_LOGIN",e[e.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD=216]="WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD",e[e.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE=217]="WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE",e[e.USER_MUTED_BY_ADMIN=219]="USER_MUTED_BY_ADMIN",e[e.USER_NOT_FRIEND=221]="USER_NOT_FRIEND",e[e.WEBIM_MESSAGE_REC_TEXT=300]="WEBIM_MESSAGE_REC_TEXT",e[e.WEBIM_MESSAGE_REC_TEXT_ERROR=301]="WEBIM_MESSAGE_REC_TEXT_ERROR",e[e.WEBIM_MESSAGE_REC_EMOTION=302]="WEBIM_MESSAGE_REC_EMOTION",e[e.WEBIM_MESSAGE_REC_PHOTO=303]="WEBIM_MESSAGE_REC_PHOTO",e[e.SERVER_GET_DNSLIST_FAILED=304]="SERVER_GET_DNSLIST_FAILED",e[e.WEBIM_MESSAGE_REC_AUDIO_FILE=305]="WEBIM_MESSAGE_REC_AUDIO_FILE",e[e.WEBIM_MESSAGE_REC_VEDIO=306]="WEBIM_MESSAGE_REC_VEDIO",e[e.WEBIM_MESSAGE_REC_VEDIO_FILE=307]="WEBIM_MESSAGE_REC_VEDIO_FILE",e[e.WEBIM_MESSAGE_REC_FILE=308]="WEBIM_MESSAGE_REC_FILE",e[e.WEBIM_MESSAGE_SED_TEXT=309]="WEBIM_MESSAGE_SED_TEXT",e[e.WEBIM_MESSAGE_SED_EMOTION=310]="WEBIM_MESSAGE_SED_EMOTION",e[e.WEBIM_MESSAGE_SED_PHOTO=311]="WEBIM_MESSAGE_SED_PHOTO",e[e.WEBIM_MESSAGE_SED_AUDIO=312]="WEBIM_MESSAGE_SED_AUDIO",e[e.WEBIM_MESSAGE_SED_AUDIO_FILE=313]="WEBIM_MESSAGE_SED_AUDIO_FILE",e[e.WEBIM_MESSAGE_SED_VEDIO=314]="WEBIM_MESSAGE_SED_VEDIO",e[e.WEBIM_MESSAGE_SED_VEDIO_FILE=315]="WEBIM_MESSAGE_SED_VEDIO_FILE",e[e.WEBIM_MESSAGE_SED_FILE=316]="WEBIM_MESSAGE_SED_FILE",e[e.WEBIM_MESSAGE_SED_ERROR=317]="WEBIM_MESSAGE_SED_ERROR",e[e.STATUS_INIT=400]="STATUS_INIT",e[e.STATUS_DOLOGIN_USERGRID=401]="STATUS_DOLOGIN_USERGRID",e[e.STATUS_DOLOGIN_IM=402]="STATUS_DOLOGIN_IM",e[e.STATUS_OPENED=403]="STATUS_OPENED",e[e.STATUS_CLOSING=404]="STATUS_CLOSING",e[e.STATUS_CLOSED=405]="STATUS_CLOSED",e[e.STATUS_ERROR=406]="STATUS_ERROR",e[e.SERVER_BUSY=500]="SERVER_BUSY",e[e.MESSAGE_INCLUDE_ILLEGAL_CONTENT=501]="MESSAGE_INCLUDE_ILLEGAL_CONTENT",e[e.MESSAGE_EXTERNAL_LOGIC_BLOCKED=502]="MESSAGE_EXTERNAL_LOGIC_BLOCKED",e[e.SERVER_UNKNOWN_ERROR=503]="SERVER_UNKNOWN_ERROR",e[e.MESSAGE_RECALL_TIME_LIMIT=504]="MESSAGE_RECALL_TIME_LIMIT",e[e.SERVICE_NOT_ENABLED=505]="SERVICE_NOT_ENABLED",e[e.SERVICE_NOT_ALLOW_MESSAGING=506]="SERVICE_NOT_ALLOW_MESSAGING",e[e.SERVICE_NOT_ALLOW_MESSAGING_MUTE=507]="SERVICE_NOT_ALLOW_MESSAGING_MUTE",e[e.MESSAGE_MODERATION_BLOCKED=508]="MESSAGE_MODERATION_BLOCKED",e[e.MESSAGE_CURRENT_LIMITING=509]="MESSAGE_CURRENT_LIMITING",e[e.MESSAGE_WEBSOCKET_DISCONNECTED=510]="MESSAGE_WEBSOCKET_DISCONNECTED",e[e.MESSAGE_SIZE_LIMIT=511]="MESSAGE_SIZE_LIMIT",e[e.MESSAGE_SEND_TIMEOUT=512]="MESSAGE_SEND_TIMEOUT",e[e.GROUP_NOT_EXIST=605]="GROUP_NOT_EXIST",e[e.GROUP_NOT_JOINED=602]="GROUP_NOT_JOINED",e[e.GROUP_MEMBERS_FULL=606]="GROUP_MEMBERS_FULL",e[e.PERMISSION_DENIED=603]="PERMISSION_DENIED",e[e.WEBIM_LOAD_MSG_ERROR=604]="WEBIM_LOAD_MSG_ERROR",e[e.GROUP_ALREADY_JOINED=601]="GROUP_ALREADY_JOINED",e[e.GROUP_MEMBERS_LIMIT=607]="GROUP_MEMBERS_LIMIT",e[e.GROUP_IS_DISABLED=608]="GROUP_IS_DISABLED",e[e.GROUP_MEMBER_ATTRIBUTES_SET_FAILED=609]="GROUP_MEMBER_ATTRIBUTES_SET_FAILED",e[e.REST_PARAMS_STATUS=700]="REST_PARAMS_STATUS",e[e.CHATROOM_NOT_JOINED=702]="CHATROOM_NOT_JOINED",e[e.CHATROOM_MEMBERS_FULL=704]="CHATROOM_MEMBERS_FULL",e[e.CHATROOM_NOT_EXIST=705]="CHATROOM_NOT_EXIST",e[e.LOCAL_DB_OPERATION_FAILED=800]="LOCAL_DB_OPERATION_FAILED",e[e.SDK_RUNTIME_ERROR=999]="SDK_RUNTIME_ERROR",e[e.PRESENCE_PARAM_EXCEED=1100]="PRESENCE_PARAM_EXCEED",e[e.REACTION_ALREADY_ADDED=1101]="REACTION_ALREADY_ADDED",e[e.REACTION_CREATING=1102]="REACTION_CREATING",e[e.REACTION_OPERATION_IS_ILLEGAL=1103]="REACTION_OPERATION_IS_ILLEGAL",e[e.TRANSLATION_NOT_VALID=1200]="TRANSLATION_NOT_VALID",e[e.TRANSLATION_TEXT_TOO_LONG=1201]="TRANSLATION_TEXT_TOO_LONG",e[e.TRANSLATION_FAILED=1204]="TRANSLATION_FAILED",e[e.THREAD_NOT_EXIST=1300]="THREAD_NOT_EXIST",e[e.THREAD_ALREADY_EXIST=1301]="THREAD_ALREADY_EXIST",e[e.MODIFY_MESSAGE_NOT_EXIST=1302]="MODIFY_MESSAGE_NOT_EXIST",e[e.MODIFY_MESSAGE_FORMAT_ERROR=1303]="MODIFY_MESSAGE_FORMAT_ERROR",e[e.MODIFY_MESSAGE_FAILED=1304]="MODIFY_MESSAGE_FAILED",e[e.CONVERSATION_NOT_EXIST=1400]="CONVERSATION_NOT_EXIST"}(n||(n={}))},4998:function(e,t,r){"use strict";var n;r.d(t,{a:function(){return n}}),r(7252),function(e){e[e.SYNC_INIT=0]="SYNC_INIT",e[e.SYNC_START=1]="SYNC_START",e[e.SYNC_FINISH=2]="SYNC_FINISH"}(n||(n={}))},9937:function(e,t,r){"use strict";var n;r.d(t,{Z:function(){return n}}),function(e){e[e.mark_0=0]="mark_0",e[e.mark_1=1]="mark_1",e[e.mark_2=2]="mark_2",e[e.mark_3=3]="mark_3",e[e.mark_4=4]="mark_4",e[e.mark_5=5]="mark_5",e[e.mark_6=6]="mark_6",e[e.mark_7=7]="mark_7",e[e.mark_8=8]="mark_8",e[e.mark_9=9]="mark_9",e[e.mark_10=10]="mark_10",e[e.mark_11=11]="mark_11",e[e.mark_12=12]="mark_12",e[e.mark_13=13]="mark_13",e[e.mark_14=14]="mark_14",e[e.mark_15=15]="mark_15",e[e.mark_16=16]="mark_16",e[e.mark_17=17]="mark_17",e[e.mark_18=18]="mark_18",e[e.mark_19=19]="mark_19"}(n||(n={}))},4024:function(e,t,r){"use strict";r.d(t,{PU:function(){return O},iw:function(){return b},hj:function(){return R},LR:function(){return P},cT:function(){return U},P6:function(){return D}}),r(9601),r(1539),r(8674),r(3710),r(7941),r(2564),r(6699),r(7042),r(2772),r(9714),r(9653),r(6992),r(8783),r(3948),r(285),r(1637),r(8309),r(4986),r(2222),r(4916),r(6977);var n=r(5531),o=(r(2023),function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)}),i=function(e,t,r,i){var a,s,c,u,l,d,p,h,f,m,g,v,E,y,_,T,I,O,R,C,N,S,b,A,M=e.response;M&&"string"==typeof M&&(M=JSON.parse(M));var w=e.status,k={elapse:i,httpCode:w,errDesc:null==M?void 0:M.error_description};if(400===w){if(40002===M.error_code)return void t({type:n.E.THREAD_ALREADY_EXIST,message:null==M?void 0:M.error_description,extraInfo:k});if(40009===M.error_code)return void t({type:n.E.OPERATION_UNSUPPORTED,message:null==M?void 0:M.error_description,extraInfo:k});if(60005===M.error_code)return void t({type:n.E.GROUP_MEMBER_ATTRIBUTES_SET_FAILED,message:(null==M?void 0:M.desc)||(null==M?void 0:M.error_description),extraInfo:k});if(60010===M.error_code)return void((null==M?void 0:M.error_description.includes("exceeds chatgroup user metadata single value limit"))?t({type:n.E.MAX_LIMIT,message:(null==M?void 0:M.desc)||M.error_description,extraInfo:k}):t({type:n.E.NO_PERMISSION,message:(null==M?void 0:M.desc)||M.error_description,extraInfo:k}));if(60011===M.error_code)return void t({type:n.E.CHATROOM_NOT_JOINED,message:null==M?void 0:M.desc,extraInfo:k});if(14403===M.error_code)return void t({type:n.E.WEBIM_UPLOADFILE_ERROR,message:null==M?void 0:M.error_description,data:M,extraInfo:k});if(60006===M.error_code||60007===M.error_code||60009===M.error_code||60012===M.error_code)return void t({type:n.E.MAX_LIMIT,message:(null==M?void 0:M.desc)||(null==M?void 0:M.error_description),extraInfo:k});if(91104===M.error_code)return void t({type:n.E.NO_PERMISSION,message:null==M?void 0:M.error_description,extraInfo:k});if(null===(a=M.error_description)||void 0===a?void 0:a.includes("are not members of this group"))return(null===(s=e.responseURL)||void 0===s?void 0:s.includes("chatgroups"))?t({type:n.E.GROUP_NOT_JOINED,data:e.response||e.responseText,message:M.error_description,extraInfo:k}):t({type:n.E.CHATROOM_NOT_JOINED,data:e.response||e.responseText,message:M.error_description,extraInfo:k}),void r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,message:null==M?void 0:M.error_description,data:e.responseText,extraInfo:k});if("the app not open presence"===(null==M?void 0:M.result))return void t({type:n.E.SERVICE_NOT_ENABLED,message:null==M?void 0:M.result,extraInfo:k});if(null==M?void 0:M.error_description.includes("remark length must less"))return void t({type:n.E.MAX_LIMIT,message:null==M?void 0:M.error_description,extraInfo:k});switch(null==M?void 0:M.error_description){case"the user is already operation this message":t({type:n.E.REACTION_ALREADY_ADDED,message:null==M?void 0:M.error_description,extraInfo:k});break;case"The quantity has exceeded the limit!":t({type:n.E.MAX_LIMIT,message:null==M?void 0:M.error_description,extraInfo:k});break;case"The user not in this group!":t({type:n.E.GROUP_NOT_JOINED,message:null==M?void 0:M.error_description,extraInfo:k});break;case"the user operation is illegal!":t({type:n.E.REACTION_OPERATION_IS_ILLEGAL,message:null==M?void 0:M.error_description,extraInfo:k});break;case"this appKey is not open reaction service!":case"this appKey not open message roaming":t({type:n.E.SERVICE_NOT_ENABLED,message:null==M?void 0:M.error_description,extraInfo:k});break;case"this message is creating reaction, please try again.":t({type:n.E.REACTION_CREATING,message:null==M?void 0:M.error_description,extraInfo:k});break;case"groupId can not be null!":t({type:n.E.GROUP_NOT_EXIST,message:null==M?void 0:M.error_description,extraInfo:k});break;case"The input text is too long.":t({type:n.E.TRANSLATION_TEXT_TOO_LONG,message:null==M?void 0:M.error_description,extraInfo:k});break;case"The target language is not valid.":t({type:n.E.TRANSLATION_NOT_VALID,message:null==M?void 0:M.error_description,extraInfo:k});break;case"report failed, get message by id failed":t({type:n.E.MESSAGE_NOT_FOUND,message:null==M?void 0:M.error_description,extraInfo:k});break;case"ext is too big ":t({type:n.E.PRESENCE_PARAM_EXCEED,message:null==M?void 0:M.error_description,extraInfo:k});break;case"Request body not readable.Please check content type is correct!":case"param mark must be not empty, please check!":case"param mark illegal, please check it!":case"param pin_msg_id illegal, please check it!":t({type:n.E.REQUEST_PARAMETER_ERROR,message:null==M?void 0:M.error_description,extraInfo:k});break;case"updateRemark | they are not friends, please add as a friend first.":t({type:n.E.USER_NOT_FRIEND,message:null==M?void 0:M.error_description,extraInfo:k});break;default:t({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,message:null==M?void 0:M.error_description,data:e.responseText,extraInfo:k}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,message:null==M?void 0:M.error_description,data:e.responseText,extraInfo:k})}}else if(401===w)40001===M.error_code||60001===M.error_code||"Unable to authenticate (OAuth)"===M.error_description?t({type:n.E.NO_PERMISSION,message:null==M?void 0:M.error_description,extraInfo:k}):(r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:k}),t({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:k}));else if(403===w)4e4===M.error_code||60004===M.error_code||15002===M.error_code?t({type:n.E.SERVICE_NOT_ENABLED,message:null==M?void 0:M.error_description,extraInfo:k}):40003===M.error_code||40004===M.error_code?t({type:n.E.THREAD_ALREADY_EXIST,message:null==M?void 0:M.error_description,extraInfo:k}):40005===M.error_code||40007===M.error_code||91002===M.error_code?t({type:n.E.MAX_LIMIT,message:null==M?void 0:M.error_description,extraInfo:k}):60002===M.error_code?t({type:n.E.PERMISSION_DENIED,message:null==M?void 0:M.error_description,extraInfo:k}):91101===M.error_code?t({type:n.E.MAX_LIMIT,message:null==M?void 0:M.error_description,extraInfo:k}):91102===M.error_code&&t({type:n.E.REQUEST_PARAMETER_ERROR,message:M.error_description,extraInfo:k}),"group member list is full!"===M.error_description?(null===(c=e.responseURL)||void 0===c?void 0:c.includes("chatgroups"))?t({type:n.E.GROUP_MEMBERS_FULL,data:e.response||e.responseText,message:M.error_description,extraInfo:k}):t({type:n.E.CHATROOM_MEMBERS_FULL,data:e.response||e.responseText,message:M.error_description,extraInfo:k}):(null===(u=M.error_description)||void 0===u?void 0:u.includes(M.error_description.includes("already in group")))?(null===(l=e.responseURL)||void 0===l?void 0:l.includes("chatgroups"))&&t({type:n.E.GROUP_ALREADY_JOINED,data:e.response||e.responseText,message:M.error_description,extraInfo:k}):(null===(d=M.error_description)||void 0===d?void 0:d.includes("are not members of this group"))?(null===(p=e.responseURL)||void 0===p?void 0:p.includes("chatgroups"))?t({type:n.E.GROUP_NOT_JOINED,data:e.response||e.responseText,message:M.error_description,extraInfo:k}):t({type:n.E.CHATROOM_NOT_JOINED,data:e.response||e.responseText,message:M.error_description,extraInfo:k}):(null===(h=M.error_description)||void 0===h?void 0:h.includes("service not open!"))||(null===(f=M.error_description)||void 0===f?void 0:f.includes("message report not open"))||(null===(m=M.error_description)||void 0===m?void 0:m.includes("messageroaming function not open"))?t({type:n.E.SERVICE_NOT_ENABLED,data:e.response||e.responseText,message:M.error_description,extraInfo:k}):(null===(g=M.error_description)||void 0===g?void 0:g.includes("members size is greater than max user size !"))?t({type:n.E.GROUP_MEMBERS_LIMIT,data:e.response||e.responseText,message:M.error_description,extraInfo:k}):(null===(v=M.error_description)||void 0===v?void 0:v.includes("can not operate this group, reason: group is disabled"))?t({type:n.E.GROUP_IS_DISABLED,data:e.response||e.responseText,message:M.error_description,extraInfo:k}):(null===(E=M.error_description)||void 0===E?void 0:E.includes("Invitee's contact max count"))||(null===(y=M.error_description)||void 0===y?void 0:y.includes("Inviter's contact max count"))?t({type:n.E.MAX_LIMIT,data:e.response||e.responseText,message:M.error_description,extraInfo:k}):t({type:n.E.PERMISSION_DENIED,data:e.response||e.responseText,message:"permission denied",extraInfo:o(o({},k),{errDesc:"permission denied"})}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:k});else if(404===w)40011===M.error_code?t({type:n.E.THREAD_NOT_EXIST,message:null==M?void 0:M.error_description,extraInfo:k}):40012===M.error_code?t({type:n.E.NO_PERMISSION,message:null==M?void 0:M.error_description,extraInfo:k}):60003===M.error_code||20004===M.error_code?t({type:n.E.GROUP_NOT_JOINED,message:null==M?void 0:M.error_description,extraInfo:k}):91001===M.error_code&&t({type:n.E.CONVERSATION_NOT_EXIST,message:null==M?void 0:M.error_description,extraInfo:k}),(null===(_=M.error_description)||void 0===_?void 0:_.includes("do not find this group"))||(null===(T=M.error_description)||void 0===T?void 0:T.includes("does not exist"))?(null===(I=e.responseURL)||void 0===I?void 0:I.includes("chatgroups"))?t({type:n.E.GROUP_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:o(o({},k),{errDesc:"The chat room dose not exist."})}):t({type:n.E.CHATROOM_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:o(o({},k),{errDesc:"The chat room dose not exist."})}):(null===(O=M.error_description)||void 0===O?void 0:O.includes("username"))&&(null===(R=M.error_description)||void 0===R?void 0:R.includes("doesn't exist!'"))||(null===(C=M.error_description)||void 0===C?void 0:C.includes("user not found"))||(null===(N=M.error_description)||void 0===N?void 0:N.includes("Service resource not found"))&&"UserNotFoundException"===(null==M?void 0:M.exception)?t({type:n.E.USER_NOT_FOUND,data:e.response||e.responseText,message:M.error_description,extraInfo:k}):M.error_description.includes("user session pin message not exist")?t({type:n.E.MESSAGE_NOT_FOUND,message:M.error_description,extraInfo:k}):t({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:k}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:k});else if(406===w)90004===M.error_code&&t({type:n.E.OPERATION_NOT_ALLOWED,message:null==M?void 0:M.error_description,extraInfo:k});else if(429===w||503===w){if(null===(S=M.error_description)||void 0===S?void 0:S.includes("The request has reached the maximum limit"))return void t({type:n.E.MAX_LIMIT,message:e.responseText,extraInfo:k});if(null===(b=M.error_description)||void 0===b?void 0:b.includes("upload client logs reached limit"))return void t({type:n.E.MAX_LIMIT,message:e.responseText});t({type:n.E.SERVER_BUSY,data:e.response||e.responseText,message:"Server is busy.",extraInfo:o(o({},k),{errDesc:"Server is busy."})}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"Server is busy.",extraInfo:o(o({},k),{errDesc:"Server is busy."})})}else if(500===w){if(40006===M.error_code||40008===M.error_code||40010===M.error_code)return void t({type:n.E.SERVER_UNKNOWN_ERROR,message:null==M?void 0:M.error_description,extraInfo:k});if(90005===M.error_code||99999===M.error_code)return void t({type:n.E.REQUEST_UNKNOWN,message:null==M?void 0:M.error_description,extraInfo:k});if(null===(A=M.error_description)||void 0===A?void 0:A.includes("translte failed!"))return void t({type:n.E.TRANSLATION_FAILED,message:e.responseText,extraInfo:k});t({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:k}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:k})}else t({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:o(o({},k),{errDesc:"ajax error"})}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:o(o({},k),{errDesc:"ajax error"})})},a=r(1595),s=r(2071),c=r(7360),u=5242880,l=5242880,d={size:0},p=(r(2526),r(1817),r(2165),r(5827),r(4553),r(561),r(4319)),h=function(){return h=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},h.apply(this,arguments)};function f(){var e=this.context,t=e.orgName,r=e.appName,n=e.accessToken,o={url:"".concat(this.apiUrl,"/").concat(t,"/").concat(r,"/sdk/chatfiles/part-upload"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+n}};return c.kg.debug("Call multipartInit"),R.call(this,o,a.fI.SDK_INTERNAL).then((function(e){var t=e.entities[0];return{data:{fileMaxSize:t.file_upper_limit,partMinSize:t.part_lower_limit,uuid:t.uuid},extraInfo:e.extraInfo,type:e.type}}))}function m(e){var t=this;return new Promise((function(r,o){var i,a,s=(new Date).getTime(),u=t.context,l=u.orgName,d=u.appName,f=u.accessToken,m=e.uuid,g=e.partNumber,v=e.part,E=e.onProgress,y="".concat(t.apiUrl,"/").concat(l,"/").concat(d,"/sdk/chatfiles/part-upload/").concat(m),_=new XMLHttpRequest;c.kg.debug("Call multipartUpload"),_.upload&&(null===(a=(i=_.upload).addEventListener)||void 0===a||a.call(i,"progress",(function(e){null==E||E(e)}),!1)),_.addEventListener("abort",(function(){o({type:n.E.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:_,extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"Request Abort",url:y}})}),!1),_.addEventListener("error",(function(){o({type:n.E.WEBIM_UPLOADFILE_ERROR,data:_,extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"request error",url:y}})}),!1),_.addEventListener("load",(function(){try{var e=JSON.parse(_.responseText);if(200!==_.status)return o({type:n.E.WEBIM_UPLOADFILE_ERROR,data:e,extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"part upload failed",url:y}}),!1;try{r(h(h({},e),{extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,url:y}}))}catch(e){o({type:n.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e,extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"part upload failed",url:y}})}}catch(e){o({type:n.E.WEBIM_UPLOADFILE_ERROR,data:_.responseText,extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"part upload failed",url:y}})}}),!1),_.addEventListener("timeout",(function(){o({type:n.E.REQUEST_TIMEOUT,message:"request timeout",extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"request timeout",url:y}})}),!1);var T=new FormData;T.append("part_file",v),T.append("part_number",g),_.timeout=p.zj,_.open("PUT",y),_.setRequestHeader("restrict-access","true"),_.setRequestHeader("Accept","*/*"),_.setRequestHeader("Authorization","Bearer "+f),_.send(T)}))}function g(e){var t=e.uuid,r=e.thumbnailHeight,n=e.thumbnailWidth,o=this.context,i=o.orgName,s=o.appName,u=o.accessToken,l="".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/sdk/chatfiles/part-upload/").concat(t,"?restrict-access=true");n&&(l+="&thumbnail-width=".concat(n)),r&&(l+="&thumbnail-height=".concat(r));var d={url:l,dataType:"json",type:"POST",headers:{Authorization:"Bearer "+u}};return c.kg.debug("Call multipartComplete"),R.call(this,d,a.fI.SDK_INTERNAL)}function v(e){var t=e.uuid,r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/sdk/chatfiles/part-upload/").concat(t),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i}};return c.kg.debug("Call multipartAbort"),R.call(this,s,a.fI.SDK_INTERNAL)}var E=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},y=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},_=function(){function e(e,t){var r=this;this.handleUploadProgress=function(e,t){var n,o;if(e.total){r.progressArr[t]=e.loaded;var i=r.progressArr.reduce((function(e,t){return e+t}),0);null===(o=(n=r.options).onFileUploadProgress)||void 0===o||o.call(n,{isTrusted:e.isTrusted,type:e.type,loaded:i>r.file.size?r.file.size:i,total:r.file.size,lengthComputable:e.lengthComputable})}},this.uuid="",this.pool=[],this.progressArr=[],this.connection=e,this.options=t,this.partSize=u,this.file=t.file,this.init(),this.rpt=this.connection.dataReport.geOperateFun({operationName:a.fI.REST_UPLOAD_FILE_IN_PARTS})}return e.prototype.init=function(){var e,t,r,o;return E(this,void 0,void 0,(function(){var i,s,l,p,h,m,g,v,E,_,T,I,O,R,C;return y(this,(function(y){switch(y.label){case 0:return y.trys.push([0,4,,6]),[4,f.call(this.connection)];case 1:return i=y.sent(),s=i.data||{},l=s.fileMaxSize,p=void 0===l?0:l,h=s.partMinSize,m=void 0===h?u:h,g=s.uuid,v=void 0===g?"":g,E=i.extraInfo,I=E.elapse,O=E.httpCode,C=E.url,this.partSize=m,this.uuid=v,d.size=m,c.kg.debug("multipartInit success","uuid: ".concat(v),"fileMaxSize: ".concat(p),"partMinSize: ".concat(m)),this.file.size>p?[4,this.multipartAbort()]:[3,3];case 2:return y.sent(),null===(t=(e=this.options).onFileUploadError)||void 0===t||t.call(e,{code:n.E.WEBIM_UPLOADFILE_ERROR,message:"The file size exceeds the maximum limit"}),[2];case 3:return this.rpt({data:{requestUrl:C,requestName:a.c.REST_INIT_UPLOAD_TASK_IN_PARTS,requestElapse:I,requestMethod:"POST",isSuccess:1,code:O}}),this.upload(),[3,6];case 4:return _=y.sent(),T=(null==_?void 0:_.extraInfo)||{},I=T.elapse,O=T.httpCode,R=T.errDesc,C=T.url,this.rpt({data:{requestUrl:C,requestName:a.c.REST_INIT_UPLOAD_TASK_IN_PARTS,requestElapse:I,requestMethod:"POST",isSuccess:0,codeDesc:R,code:O}}),[4,this.multipartAbort()];case 5:return y.sent(),null===(o=null===(r=this.options)||void 0===r?void 0:r.onInitFail)||void 0===o||o.call(r),[3,6];case 6:return[2]}}))}))},e.prototype.upload=function(){var e,t,r;return E(this,void 0,void 0,(function(){var n,o,i,s,c,u,l=this;return y(this,(function(d){switch(d.label){case 0:(new FileReader).readAsArrayBuffer(this.file),n=this.file.size,o=Math.ceil(n/this.partSize),d.label=1;case 1:d.trys.push([1,7,,9]),i=function(t){var r,o,i,c;return y(this,(function(u){switch(u.label){case 0:return r=t*s.partSize,o=Math.min(n,r+s.partSize),i=null===(e=s.file)||void 0===e?void 0:e.slice(r,o),(c=m.call(s.connection,{uuid:s.uuid,partNumber:"".concat(t+1),part:i,onProgress:function(e){l.handleUploadProgress(e,t)}})).then((function(e){var t=(null==e?void 0:e.extraInfo)||{},r=t.elapse,n=t.httpCode,o=t.url;l.rpt({data:{requestUrl:o,requestName:a.c.REST_UPLOAD_PART,requestElapse:r,isSuccess:1,requestMethod:"PUT",code:n}}),l.handleTask(c)})),c.catch((function(e){var t=(null==e?void 0:e.extraInfo)||{},r=t.elapse,n=t.httpCode,o=t.url,i=t.errDesc;l.rpt({data:{requestUrl:o,requestName:a.c.REST_UPLOAD_PART,requestElapse:r,isSuccess:0,requestMethod:"PUT",code:n,codeDesc:i}}),delete e.extraInfo})),s.pool.push(c),4!==s.pool.length?[3,2]:[4,Promise.race(s.pool)];case 1:u.sent(),u.label=2;case 2:return[2]}}))},s=this,c=0,d.label=2;case 2:return c<o?[5,i(c)]:[3,5];case 3:d.sent(),d.label=4;case 4:return c++,[3,2];case 5:return[4,Promise.all(this.pool)];case 6:return d.sent(),this.multipartComplete(),[3,9];case 7:return u=d.sent(),[4,this.multipartAbort()];case 8:return d.sent(),this.rpt({data:{isLastApi:1,isSuccess:0}}),null===(r=(t=this.options).onFileUploadError)||void 0===r||r.call(t,u),[3,9];case 9:return[2]}}))}))},e.prototype.multipartComplete=function(){var e,t,r,n;return E(this,void 0,void 0,(function(){var o,i,s,c,u,l,d,p,h,f,m;return y(this,(function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),o=this.options.thumbnailInfo||{},i=o.width,s=o.height,[4,g.call(this.connection,{uuid:this.uuid,thumbnailHeight:s,thumbnailWidth:i})];case 1:return c=v.sent(),u=(null==c?void 0:c.extraInfo)||{},p=u.elapse,h=u.httpCode,m=u.url,this.rpt({data:{requestUrl:m,requestName:a.c.REST_COMPLETE_UPLOAD_PART,requestElapse:p,requestMethod:"POST",isSuccess:1,code:h}}),this.rpt({data:{isLastApi:1,isSuccess:1}}),null===(t=(e=this.options).onFileUploadComplete)||void 0===t||t.call(e,c),[3,3];case 2:return l=v.sent(),d=(null==l?void 0:l.extraInfo)||{},p=d.elapse,h=d.httpCode,f=d.errDesc,m=d.url,this.rpt({data:{requestUrl:m,requestName:a.c.REST_COMPLETE_UPLOAD_PART,requestElapse:p,requestMethod:"POST",isSuccess:0,codeDesc:f,code:h}}),this.rpt({data:{isLastApi:1,isSuccess:0}}),null===(n=(r=this.options).onFileUploadError)||void 0===n||n.call(r,l),[3,3];case 3:return[2]}}))}))},e.prototype.multipartAbort=function(){return E(this,void 0,void 0,(function(){var e,t,r,n,o,i,s,c;return y(this,(function(u){switch(u.label){case 0:if(!this.uuid)return[2];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,v.call(this.connection,{uuid:this.uuid})];case 2:return e=u.sent(),t=(null==e?void 0:e.extraInfo)||{},o=t.elapse,i=t.httpCode,c=t.url,this.rpt({data:{requestUrl:c,requestName:a.c.REST_ABORT_UPLOAD_PART,requestElapse:o,requestMethod:"DELETE",isSuccess:1,code:i}}),[3,4];case 3:return r=u.sent(),n=(null==r?void 0:r.extraInfo)||{},o=n.elapse,i=n.httpCode,s=n.errDesc,c=n.url,this.rpt({data:{requestUrl:c,requestName:a.c.REST_ABORT_UPLOAD_PART,requestElapse:o,requestMethod:"DELETE",isSuccess:0,codeDesc:s,code:i}}),[3,4];case 4:return[2]}}))}))},e.prototype.handleTask=function(e){var t=this.pool.findIndex((function(t){return t===e}));this.pool.splice(t,1)},e}(),T=function(e){var t,r,o=this,i=(new Date).getTime(),s=e.apiUrl,c=e.orgName,u=e.appName,l=e.operateName,d=e.accessToken,h=e.uploadUrl||"".concat(s,"/").concat(c,"/").concat(u,"/chatfiles"),f=function(t){var r=(new Date).getTime()-i;o.dataReport&&l&&[a.fI.UPLOAD_MSG_ATTACH,a.fI.UPLOAD_CHATROOM_FILE,a.fI.UPLOAD_GROUP_FILE].includes(l)&&o.dataReport.geOperateFun({operationName:l})({isEndApi:!0,data:{isSuccess:0,requestMethod:"POST",requestName:l,requestElapse:r,requestUrl:h,code:(null==g?void 0:g.status)||0,codeDesc:"upload file error"}}),e.onFileUploadError&&e.onFileUploadError(t)};function m(e){f({type:n.E.WEBIM_UPLOADFILE_ERROR,data:g})}var g=new XMLHttpRequest;g.upload&&(null===(r=(t=g.upload).addEventListener)||void 0===r||r.call(t,"progress",e.onFileUploadProgress||O,!1)),g.addEventListener("abort",e.onFileUploadCanceled||O,!1),g.addEventListener("error",m,!1),g.addEventListener("load",(function(t){try{var r=JSON.parse(g.responseText);if(400===g.status)return f({type:n.E.WEBIM_UPLOADFILE_ERROR,data:r}),!1;try{!function(t){var r=(new Date).getTime()-i;o.dataReport&&l&&[a.fI.UPLOAD_MSG_ATTACH,a.fI.UPLOAD_CHATROOM_FILE,a.fI.UPLOAD_GROUP_FILE].includes(l)&&o.dataReport.geOperateFun({operationName:l})({isEndApi:!0,data:{isSuccess:(null==t?void 0:t.error)?0:1,requestMethod:"POST",requestName:l,requestElapse:r,requestUrl:h,code:g.status,codeDesc:(null==t?void 0:t.error_description)||""}}),e.onFileUploadComplete&&e.onFileUploadComplete(t)}(r)}catch(t){f({type:n.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){f({type:n.E.WEBIM_UPLOADFILE_ERROR,data:g.responseText})}}),!1),g.addEventListener("timeout",m,!1),g.timeout=p.zj,g.open("POST",h),g.setRequestHeader("restrict-access","true"),g.setRequestHeader("Accept","*/*"),g.setRequestHeader("Authorization","Bearer "+d);var v=new FormData;v.append("file",e.file.data),e.thumbnailWidth&&v.append("thumbnail-width",e.thumbnailWidth+""),e.thumbnailHeight&&v.append("thumbnail-height",e.thumbnailHeight+""),g.send(v)},I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},I.apply(this,arguments)},O=function(){};function R(e,t){var r,o=this;return w().platform===b.WEB?new Promise((function(t,o){var a=e.dataType||"text",s=e.success||O,u=e.error||O,l=new XMLHttpRequest;l.timeout=p.Gf;var d=!1;l.ontimeout=function(){c.kg.warn("request timeout"),d=!0;var e={type:n.E.REQUEST_TIMEOUT,message:"Request Timeout",errorType:"timeout_error",xhr:l};u(e),o(e)},l.onerror=function(){o({type:n.E.REQUEST_UNKNOWN,message:"Request Unknow Error",errorType:"onerror",xhr:l})},l.onabort=function(){o({type:n.E.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:l})},l.onreadystatechange=function(){if(4===l.readyState){var e=(new Date).getTime()-r,p=l.status||0,h={elapse:e,httpCode:p};if(200===p){D.ajaxUnconventionalErrorTimes=0;try{switch(a){case"text":return s(l.responseText),void t(l.responseText);case"json":var f=JSON.parse(l.responseText);return f.extraInfo=h,s(f),void t(f);case"xml":return l.responseXML&&l.responseXML.documentElement?(s(l.responseXML.documentElement),void t(l.responseXML.documentElement)):(u({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}),void o({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}));default:u({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"Invalid dataType"}),o({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"Invalid dataType"})}return t(l.response||l.responseText),void s(l.response||l.responseText,l)}catch(e){o(e)}return}0===p?setTimeout((function(){c.kg.debug("request timeout:",d),!d&&i(l,o,u,e)}),0):([400,401,403,404,429,500,503].includes(p)||(c.kg.debug("rest api request fail status:",p),D.ajaxUnconventionalErrorTimes++),i(l,o,u,e))}0===l.readyState&&(u({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"Request not initialized"}),o({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"Request not initialized"}))},e.responseType&&l.responseType&&(l.responseType=e.responseType),e.mimeType&&l.overrideMimeType(e.mimeType);var h=e.type||"POST",f=e.data||null,m="";if("get"===h.toLowerCase()&&f){for(var g in f)f.hasOwnProperty(g)&&(m+=g+"="+f[g]+"&");m=m?m.slice(0,-1):m,e.url+=(e.url.indexOf("?")>0?"&":"?")+(m?m+"&":m)+"_v="+(new Date).getTime(),f=null,m=""}r=(new Date).getTime(),l.open(h,e.url);var v=e.headers||{};for(var E in v["Content-Type"]||(v["Content-Type"]="application/json"),v)v.hasOwnProperty(E)&&l.setRequestHeader(E,v[E]);l.send(f)})).then((function(r){return o.dataReport&&t&&t!==a.fI.SDK_INTERNAL&&o.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:I({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},x(r.extraInfo))}),t===a.fI.SDK_INTERNAL&&(r.extraInfo.url=e.url),t!==a.fI.SDK_INTERNAL&&delete r.extraInfo,"Object"===C(r)?I(I({},r),{type:n.E.REQUEST_SUCCESS}):{data:r,type:n.E.REQUEST_SUCCESS}})).catch((function(n){var i,s;if(o.dataReport&&t&&t!==a.fI.SDK_INTERNAL&&o.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:I({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},x(n.extraInfo))}),t===a.fI.SDK_INTERNAL)if(n.extraInfo)n.extraInfo.url=e.url;else{var c={elapse:(new Date).getTime()-r,httpCode:null!==(s=null===(i=n.xhr)||void 0===i?void 0:i.status)&&void 0!==s?s:0,url:e.url};n.extraInfo=c}throw t!==a.fI.SDK_INTERNAL&&delete n.extraInfo,n})):N.call(this,e,t)}function C(e){return Object.prototype.toString.call(e).slice(8,-1)}function N(e,t){var r=this;return new Promise((function(r,o){var i=e.success||O,a=e.error||O,u=e.type||"POST",l=e.data||null,d="",h=(new Date).getTime(),f=D.getEnvInfo();if("get"===u.toLowerCase()&&l){for(var m in l)l.hasOwnProperty(m)&&(d+=m+"="+l[m]+"&");d=d?d.slice(0,-1):d,e.url+=(e.url.indexOf("?")>0?"&":"?")+(d?d+"&":d)+"_v="+(new Date).getTime(),l=null,d=""}var g={url:e.url,data:e.data,method:u,headers:{},timeout:p.Gf,success:function(e){var n,s,u,l,d,p={elapse:(new Date).getTime()-h,httpCode:Number((null===(n=e.statusCode)||void 0===n?void 0:n.toString())||(null===(s=e.status)||void 0===s?void 0:s.toString())),errDesc:(null===(u=null==e?void 0:e.data)||void 0===u?void 0:u.error_description)||""};if("200"===(null===(l=e.statusCode)||void 0===l?void 0:l.toString())||"200"===(null===(d=e.status)||void 0===d?void 0:d.toString())){e.data.extraInfo=p;var f=e.data;i(f),r(f)}else e.extraInfo=p,a(f=e),o(f),c.kg.debug(t,"reject reason: ",f)},complete:function(){},fail:function(e){var r={elapse:(new Date).getTime()-h,httpCode:s.Tp,errDesc:"request:fail"};if(e.extraInfo=r,e.data={error:"request:fail",error_description:"request:fail"},"request:fail timeout"===e.errMsg)return o({type:n.E.REQUEST_TIMEOUT,message:"Request Timeout",extraInfo:r}),void a({type:n.E.REQUEST_TIMEOUT,message:"Request Timeout",extraInfo:r});a(e),o(e),c.kg.error(t,"fail reason:",e)}};if("zfb"===f.platform||"dd"===f.platform?g.headers=e.headers:g.header=e.headers,"dd"===f.platform)return dd.httpRequest(g);f.global.request(g)})).then((function(o){return r.dataReport&&t&&t!==a.fI.SDK_INTERNAL&&r.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:I({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},x(o.extraInfo))}),t!==a.fI.SDK_INTERNAL&&delete o.extraInfo,"Object"===C(o)?I(I({},o),{type:n.E.REQUEST_SUCCESS}):{data:o,type:n.E.REQUEST_SUCCESS}})).catch((function(n){r.dataReport&&t&&t!==a.fI.SDK_INTERNAL&&r.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:I({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},x(n.extraInfo))}),t!==a.fI.SDK_INTERNAL&&delete n.extraInfo;var o=JSON.stringify(n.data||{}),s=I(I({},n),{status:n.statusCode||n.status||0,response:o,responseText:o});i(s,(function(e){throw I(I({},n),{message:e.message,type:e.type})}),O,0)}))}function S(e,t){var r;return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(!e)return r;r=t?e.apply(t,n):e.apply(void 0,n),e=null}}var b,A=S((function(e,t){var r=w();if(r.platform!==b.WEB){var n=r.global,o=function(r){r.isConnected?e():t()};n.offNetworkStatusChange&&n.offNetworkStatusChange(o),n.onNetworkStatusChange&&n.onNetworkStatusChange(o)}else"undefined"!=typeof addEventListener&&(window.addEventListener("online",e),window.addEventListener("offline",t))})),M=S((function(e,t){var r,n,o=w();if(o.platform===b.WEB)document&&document.addEventListener("visibilitychange",(function(){document.hidden?null==t||t():null==e||e()}),!1);else{var i=o.global;i.onAppShow&&(null===(r=i.onAppShow)||void 0===r||r.call(i,e)),i.onAppHide&&(null===(n=i.onAppHide)||void 0===n||n.call(i,t))}}));function w(){return"undefined"!=typeof swan&&k(swan)?{platform:b.BAIDU,global:swan}:"undefined"!=typeof tt&&k(tt)?{platform:b.TT,global:tt}:"undefined"!=typeof dd&&k(dd)?{platform:b.DD,global:dd}:"undefined"!=typeof my&&k(my)?{platform:b.ZFB,global:my}:"undefined"!=typeof wx&&k(wx)?{platform:b.WX,global:wx}:"undefined"!=typeof qq&&k(qq)?{platform:b.QQ,global:qq}:"undefined"!=typeof uni&&k(uni)?{platform:b.UNI,global:uni}:"undefined"!=typeof window&&window.WebSocket?{platform:b.WEB,global:window}:{platform:b.NODE,global:r.g||{}}}function k(e){for(var t=["canIUse","getSystemInfo"],r=0,n=t.length;r<n;r++)if(!e[t[r]])return!1;return!0}function U(e,t){var r,o,i,a=this,s=e.accessToken,c=e.appKey,u=null===(o=null===(r=null==e?void 0:e.file)||void 0===r?void 0:r.data)||void 0===o?void 0:o.size,p=[],h="",f="";if(s)if(c&&(p=c.split("#"),h=p[0],f=p[1]),h||f)if(u<=0)e.onFileUploadError&&e.onFileUploadError({type:n.E.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"});else if(e.uploadUrl)T.call(this,I(I({},e),{orgName:h,appName:f,operateName:t}));else{var m=d.size||l;this.uploadPartEnable&&u>1.5*m?new _(this,{file:null===(i=null==e?void 0:e.file)||void 0===i?void 0:i.data,onFileUploadProgress:e.onFileUploadProgress||O,onFileUploadComplete:e.onFileUploadComplete||O,onFileUploadError:e.onFileUploadError||O,onFileUploadCanceled:e.onFileUploadCanceled||O,onInitFail:function(){T.call(a,I(I({},e),{orgName:h,appName:f,operateName:t}))},thumbnailInfo:{width:e.thumbnailWidth,height:e.thumbnailHeight}}):T.call(this,I(I({},e),{orgName:h,appName:f,operateName:t}))}else e.onFileUploadError&&e.onFileUploadError({type:n.E.WEBIM_UPLOADFILE_ERROR,message:this._initWithAppId?"appId illegal":"AppKey illegal"});else e.onFileUploadError&&e.onFileUploadError({type:n.E.WEBIM_UPLOADFILE_NO_LOGIN,message:"AccessToken cannot be empty"})}function P(e,t){var r;e.onFileDownloadComplete=e.onFileDownloadComplete||O,e.onFileDownloadError=e.onFileDownloadError||O;var o=(new Date).getTime(),i=new XMLHttpRequest,s=this;i.addEventListener("load",(function(r){var n=(new Date).getTime()-o;s.dataReport&&t&&t===a.fI.DOWN_GROUP_FILE&&s.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:200===i.status?1:0,requestMethod:"POST",requestName:t,requestElapse:n,requestUrl:null==e?void 0:e.url,code:i.status,codeDesc:200===i.status?"":"download file error"}}),e.onFileDownloadComplete&&e.onFileDownloadComplete(i.response)}),!1),i.addEventListener("error",(function(r){var c=(new Date).getTime()-o;s.dataReport&&t&&t===a.fI.DOWN_GROUP_FILE&&s.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:0,requestMethod:"POST",requestName:t,requestElapse:c,requestUrl:null==e?void 0:e.url,code:(null==i?void 0:i.status)||0,codeDesc:"download file error"}}),e.onFileDownloadError&&e.onFileDownloadError({type:n.E.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:i})}),!1);var c=e.method||"GET",u=e.responseType||"blob",l=e.mimeType||"text/plain; charset=x-user-defined";i.open(c,e.url),"undefined"!=typeof Blob?i.responseType=u:i.overrideMimeType(l);var d={"X-Requested-With":"XMLHttpRequest",Accept:"application/octet-stream","share-secret":e.secret,Authorization:"Bearer "+(null===(r=null==this?void 0:this.context)||void 0===r?void 0:r.accessToken)},p=e.headers||{};for(var h in p)d[h]=p[h];for(var h in d)d[h]&&i.setRequestHeader(h,d[h]);i.send(null)}function x(e){void 0===e&&(e={});var t=e.elapse,r=void 0===t?0:t,n=e.httpCode,o=void 0===n?0:n,i=e.errDesc;return{requestElapse:r,code:o,codeDesc:void 0===i?"":i}}!function(e){e.WEB="web",e.WX="wx",e.QQ="qq",e.ZFB="zfb",e.DD="dd",e.TT="tt",e.BAIDU="baidu",e.QUICK_APP="quick_app",e.UNI="uni",e.NODE="node"}(b||(b={}));var L="localDeviceInfo",D={autoIncrement:0,ajaxUnconventionalErrorTimes:0,isUseHttps:function(e){var t;return"boolean"==typeof e?e:!("undefined"!=typeof window)||"https:"===(null===(t=window.location)||void 0===t?void 0:t.protocol)},getRetryDelay:function(e){return e<=5?Number((Math.random()+1).toFixed(2)):e>5&&e<20?Math.floor(4*Math.random())+3:Math.floor(6*Math.random())+5},ajax:R,getUniqueId:function(){this.autoIncrement?this.autoIncrement++:this.autoIncrement=1;var e=new Date,t=new Date(2010,1,1);return(e.getTime()-t.getTime()+this.autoIncrement).toString()},getFileUrl:function(e){var t={url:"",filename:"",filetype:"",data:{}},r="string"==typeof e?document.getElementById(e):e;if(window.URL.createObjectURL){if(!r.files)throw Error("this is not HTMLInputElement");var n=r.files;if(n.length>0){var o=n.item(0);t.data=o,t.url=window.URL.createObjectURL(o),t.filename=(null==o?void 0:o.name)||""}}else{if("string"!=typeof e)throw Error("in IE fileInputId must be string");o=document.getElementById(e).value,t.url=o;var i=o.lastIndexOf("/"),a=o.lastIndexOf("\\"),s=Math.max(i,a);t.filename=s<0?o:o.substring(s+1)}var c=t.filename.lastIndexOf(".");return-1!==c&&(t.filetype=t.filename.substring(c+1).toLowerCase()),t},uploadFile:U,flow:function(e){for(var t=e.length,r=t;r--;)if("function"!=typeof e[r])throw new TypeError("Expected a function");return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var o=0,i=t?e[o].apply(this,r):r[0];++o<t;)i=e[o].call(this,i);return i}},listenNetwork:A,listenBrowserVisibility:M,getEnvInfo:w,wxRequest:N,parseDownloadResponse:function(e){if(!window||!window.URL)throw Error("parseDownloadResponse can be used in broswer only");return e&&e.type&&"application/json"===e.type||0>Object.prototype.toString.call(e).indexOf("Blob")?this.url+"?token=":window.URL.createObjectURL(e)},download:P,parseNotify:function(e){for(var t="",r=0;r<e.length;r++)t+="%"+e[r].toString(16);return JSON.parse(decodeURIComponent(t))},getExtraData:x,retryPromise:function(e,t,r){return new Promise((function(n,o){!function t(i){e().then(n).catch((function(e){i>0?setTimeout((function(){t(i-1)}),r||1e3):o(e)}))}(t||3)}))},formatAttachUrl:function(e){return e&&"string"==typeof e?"".concat(this.apiUrl).concat(e.substr(e.indexOf("/",9))):""},Uint8ArrayToString:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},getLocalDeviceInfo:function(){return function(e){var t,r=D.getEnvInfo(),n=r.platform,o="";n!==b.NODE&&n!==b.QUICK_APP||(o="");try{n===b.WEB?o=localStorage.getItem(e)||"":n===b.WX||n===b.QQ||n===b.TT||n===b.BAIDU||n===b.UNI?o=r.global.getStorageSync(e)||"":n!==b.ZFB&&n!==b.DD||(o=(null===(t=r.global.getStorageSync({key:e}))||void 0===t?void 0:t.data)||"")}catch(t){c.kg.debug("get local ".concat(e," failed: "),t)}return c.kg.debug("".concat(e," "),o),o}(L)},setLocalDeviceInfo:function(e){!function(e,t){var r=D.getEnvInfo(),n=r.platform;if(n!==b.NODE&&n!==b.QUICK_APP)if(n===b.WEB)try{localStorage.setItem(e,t)}catch(t){c.kg.error("set local ".concat(e," failed: "),t)}else r.global.setStorage({key:e,data:t,success:function(t){c.kg.debug("set local ".concat(e," success: "),t)},fail:function(t){c.kg.error("set local ".concat(e," failed: "),t)}})}(L,e)},detectBrowser:function(){if("undefined"==typeof navigator)return"unknown";var e=navigator.userAgent;return/MicroMessenger/i.test(e)?"WeChat":/QQBrowser/i.test(e)?"QQ":!/Chrome/i.test(e)||/Edg/i.test(e)||/OPR/i.test(e)?!/Safari/i.test(e)||/Chrome/i.test(e)||/CriOS/i.test(e)?/Firefox/i.test(e)?"Firefox":/MSIE/i.test(e)||/Trident/i.test(e)?"IE":/Edg/i.test(e)?"Edge":"unknown":"Safari":"Chrome"},getDevicePlatform:function(e){return e.platform===b.WX&&"undefined"!=typeof uni&&k(uni)?b.UNI:e.platform},delay:function(e){return new Promise((function(t){return setTimeout(t,e)}))}}},9662:function(e,t,r){var n=r(614),o=r(6330),i=TypeError;e.exports=function(e){if(n(e))return e;throw i(o(e)+" is not a function")}},9483:function(e,t,r){var n=r(4411),o=r(6330),i=TypeError;e.exports=function(e){if(n(e))return e;throw i(o(e)+" is not a constructor")}},6077:function(e,t,r){var n=r(614),o=String,i=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw i("Can't set "+o(e)+" as a prototype")}},1223:function(e,t,r){var n=r(5112),o=r(30),i=r(3070).f,a=n("unscopables"),s=Array.prototype;null==s[a]&&i(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},1530:function(e,t,r){"use strict";var n=r(8710).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},5787:function(e,t,r){var n=r(7976),o=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw o("Incorrect invocation")}},9670:function(e,t,r){var n=r(111),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw i(o(e)+" is not an object")}},3013:function(e){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7556:function(e,t,r){var n=r(7293);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},260:function(e,t,r){"use strict";var n,o,i,a=r(3013),s=r(9781),c=r(7854),u=r(614),l=r(111),d=r(2597),p=r(648),h=r(6330),f=r(8880),m=r(8052),g=r(7045),v=r(7976),E=r(9518),y=r(7674),_=r(5112),T=r(9711),I=r(9909),O=I.enforce,R=I.get,C=c.Int8Array,N=C&&C.prototype,S=c.Uint8ClampedArray,b=S&&S.prototype,A=C&&E(C),M=N&&E(N),w=Object.prototype,k=c.TypeError,U=_("toStringTag"),P=T("TYPED_ARRAY_TAG"),x="TypedArrayConstructor",L=a&&!!y&&"Opera"!==p(c.opera),D=!1,j={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},G={BigInt64Array:8,BigUint64Array:8},B=function(e){var t=E(e);if(l(t)){var r=R(t);return r&&d(r,x)?r[x]:B(t)}},H=function(e){if(!l(e))return!1;var t=p(e);return d(j,t)||d(G,t)};for(n in j)(i=(o=c[n])&&o.prototype)?O(i)[x]=o:L=!1;for(n in G)(i=(o=c[n])&&o.prototype)&&(O(i)[x]=o);if((!L||!u(A)||A===Function.prototype)&&(A=function(){throw k("Incorrect invocation")},L))for(n in j)c[n]&&y(c[n],A);if((!L||!M||M===w)&&(M=A.prototype,L))for(n in j)c[n]&&y(c[n].prototype,M);if(L&&E(b)!==M&&y(b,M),s&&!d(M,U))for(n in D=!0,g(M,U,{configurable:!0,get:function(){return l(this)?this[P]:void 0}}),j)c[n]&&f(c[n],P,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:D&&P,aTypedArray:function(e){if(H(e))return e;throw k("Target is not a typed array")},aTypedArrayConstructor:function(e){if(u(e)&&(!y||v(A,e)))return e;throw k(h(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(s){if(r)for(var o in j){var i=c[o];if(i&&d(i.prototype,e))try{delete i.prototype[e]}catch(r){try{i.prototype[e]=t}catch(e){}}}M[e]&&!r||m(M,e,r?t:L&&N[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,o;if(s){if(y){if(r)for(n in j)if((o=c[n])&&d(o,e))try{delete o[e]}catch(e){}if(A[e]&&!r)return;try{return m(A,e,r?t:L&&A[e]||t)}catch(e){}}for(n in j)!(o=c[n])||o[e]&&!r||m(o,e,t)}},getTypedArrayConstructor:B,isView:function(e){if(!l(e))return!1;var t=p(e);return"DataView"===t||d(j,t)||d(G,t)},isTypedArray:H,TypedArray:A,TypedArrayPrototype:M}},3331:function(e,t,r){"use strict";var n=r(7854),o=r(1702),i=r(9781),a=r(3013),s=r(6530),c=r(8880),u=r(7045),l=r(9190),d=r(7293),p=r(5787),h=r(9303),f=r(7466),m=r(7067),g=r(1179),v=r(9518),E=r(7674),y=r(8006).f,_=r(1285),T=r(1589),I=r(8003),O=r(9909),R=s.PROPER,C=s.CONFIGURABLE,N="ArrayBuffer",S="DataView",b="prototype",A="Wrong index",M=O.getterFor(N),w=O.getterFor(S),k=O.set,U=n[N],P=U,x=P&&P[b],L=n[S],D=L&&L[b],j=Object.prototype,G=n.Array,B=n.RangeError,H=o(_),F=o([].reverse),W=g.pack,q=g.unpack,K=function(e){return[255&e]},z=function(e){return[255&e,e>>8&255]},V=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},X=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},J=function(e){return W(e,23,4)},Z=function(e){return W(e,52,8)},Y=function(e,t,r){u(e[b],t,{configurable:!0,get:function(){return r(this)[t]}})},Q=function(e,t,r,n){var o=m(r),i=w(e);if(o+t>i.byteLength)throw B(A);var a=i.bytes,s=o+i.byteOffset,c=T(a,s,s+t);return n?c:F(c)},$=function(e,t,r,n,o,i){var a=m(r),s=w(e);if(a+t>s.byteLength)throw B(A);for(var c=s.bytes,u=a+s.byteOffset,l=n(+o),d=0;d<t;d++)c[u+d]=l[i?d:t-d-1]};if(a){var ee=R&&U.name!==N;if(d((function(){U(1)}))&&d((function(){new U(-1)}))&&!d((function(){return new U,new U(1.5),new U(NaN),1!=U.length||ee&&!C})))ee&&C&&c(U,"name",N);else{(P=function(e){return p(this,x),new U(m(e))})[b]=x;for(var te,re=y(U),ne=0;re.length>ne;)(te=re[ne++])in P||c(P,te,U[te]);x.constructor=P}E&&v(D)!==j&&E(D,j);var oe=new L(new P(2)),ie=o(D.setInt8);oe.setInt8(0,2147483648),oe.setInt8(1,2147483649),!oe.getInt8(0)&&oe.getInt8(1)||l(D,{setInt8:function(e,t){ie(this,e,t<<24>>24)},setUint8:function(e,t){ie(this,e,t<<24>>24)}},{unsafe:!0})}else x=(P=function(e){p(this,x);var t=m(e);k(this,{type:N,bytes:H(G(t),0),byteLength:t}),i||(this.byteLength=t,this.detached=!1)})[b],D=(L=function(e,t,r){p(this,D),p(e,x);var n=M(e),o=n.byteLength,a=h(t);if(a<0||a>o)throw B("Wrong offset");if(a+(r=void 0===r?o-a:f(r))>o)throw B("Wrong length");k(this,{type:S,buffer:e,byteLength:r,byteOffset:a,bytes:n.bytes}),i||(this.buffer=e,this.byteLength=r,this.byteOffset=a)})[b],i&&(Y(P,"byteLength",M),Y(L,"buffer",w),Y(L,"byteLength",w),Y(L,"byteOffset",w)),l(D,{getInt8:function(e){return Q(this,1,e)[0]<<24>>24},getUint8:function(e){return Q(this,1,e)[0]},getInt16:function(e){var t=Q(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Q(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return X(Q(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return X(Q(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return q(Q(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return q(Q(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){$(this,1,e,K,t)},setUint8:function(e,t){$(this,1,e,K,t)},setInt16:function(e,t){$(this,2,e,z,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){$(this,2,e,z,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){$(this,4,e,V,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){$(this,4,e,V,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){$(this,4,e,J,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){$(this,8,e,Z,t,arguments.length>2?arguments[2]:void 0)}});I(P,N),I(L,S),e.exports={ArrayBuffer:P,DataView:L}},1048:function(e,t,r){"use strict";var n=r(7908),o=r(1400),i=r(6244),a=r(5117),s=Math.min;e.exports=[].copyWithin||function(e,t){var r=n(this),c=i(r),u=o(e,c),l=o(t,c),d=arguments.length>2?arguments[2]:void 0,p=s((void 0===d?c:o(d,c))-l,c-u),h=1;for(l<u&&u<l+p&&(h=-1,l+=p-1,u+=p-1);p-- >0;)l in r?r[u]=r[l]:a(r,u),u+=h,l+=h;return r}},1285:function(e,t,r){"use strict";var n=r(7908),o=r(1400),i=r(6244);e.exports=function(e){for(var t=n(this),r=i(t),a=arguments.length,s=o(a>1?arguments[1]:void 0,r),c=a>2?arguments[2]:void 0,u=void 0===c?r:o(c,r);u>s;)t[s++]=e;return t}},8533:function(e,t,r){"use strict";var n=r(2092).forEach,o=r(9341)("forEach");e.exports=o?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},7745:function(e,t,r){var n=r(6244);e.exports=function(e,t){for(var r=0,o=n(t),i=new e(o);o>r;)i[r]=t[r++];return i}},8457:function(e,t,r){"use strict";var n=r(9974),o=r(6916),i=r(7908),a=r(3411),s=r(7659),c=r(4411),u=r(6244),l=r(6135),d=r(4121),p=r(1246),h=Array;e.exports=function(e){var t=i(e),r=c(this),f=arguments.length,m=f>1?arguments[1]:void 0,g=void 0!==m;g&&(m=n(m,f>2?arguments[2]:void 0));var v,E,y,_,T,I,O=p(t),R=0;if(!O||this===h&&s(O))for(v=u(t),E=r?new this(v):h(v);v>R;R++)I=g?m(t[R],R):t[R],l(E,R,I);else for(T=(_=d(t,O)).next,E=r?new this:[];!(y=o(T,_)).done;R++)I=g?a(_,m,[y.value,R],!0):y.value,l(E,R,I);return E.length=R,E}},1318:function(e,t,r){var n=r(5656),o=r(1400),i=r(6244),a=function(e){return function(t,r,a){var s,c=n(t),u=i(c),l=o(a,u);if(e&&r!=r){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},2092:function(e,t,r){var n=r(9974),o=r(1702),i=r(8361),a=r(7908),s=r(6244),c=r(5417),u=o([].push),l=function(e){var t=1==e,r=2==e,o=3==e,l=4==e,d=6==e,p=7==e,h=5==e||d;return function(f,m,g,v){for(var E,y,_=a(f),T=i(_),I=n(m,g),O=s(T),R=0,C=v||c,N=t?C(f,O):r||p?C(f,0):void 0;O>R;R++)if((h||R in T)&&(y=I(E=T[R],R,_),e))if(t)N[R]=y;else if(y)switch(e){case 3:return!0;case 5:return E;case 6:return R;case 2:u(N,E)}else switch(e){case 4:return!1;case 7:u(N,E)}return d?-1:o||l?l:N}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},6583:function(e,t,r){"use strict";var n=r(2104),o=r(5656),i=r(9303),a=r(6244),s=r(9341),c=Math.min,u=[].lastIndexOf,l=!!u&&1/[1].lastIndexOf(1,-0)<0,d=s("lastIndexOf"),p=l||!d;e.exports=p?function(e){if(l)return n(u,this,arguments)||0;var t=o(this),r=a(t),s=r-1;for(arguments.length>1&&(s=c(s,i(arguments[1]))),s<0&&(s=r+s);s>=0;s--)if(s in t&&t[s]===e)return s||0;return-1}:u},1194:function(e,t,r){var n=r(7293),o=r(5112),i=r(7392),a=o("species");e.exports=function(e){return i>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:function(e,t,r){"use strict";var n=r(7293);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){return 1},1)}))}},3671:function(e,t,r){var n=r(9662),o=r(7908),i=r(8361),a=r(6244),s=TypeError,c=function(e){return function(t,r,c,u){n(r);var l=o(t),d=i(l),p=a(l),h=e?p-1:0,f=e?-1:1;if(c<2)for(;;){if(h in d){u=d[h],h+=f;break}if(h+=f,e?h<0:p<=h)throw s("Reduce of empty array with no initial value")}for(;e?h>=0:p>h;h+=f)h in d&&(u=r(u,d[h],h,l));return u}};e.exports={left:c(!1),right:c(!0)}},3658:function(e,t,r){"use strict";var n=r(9781),o=r(3157),i=TypeError,a=Object.getOwnPropertyDescriptor,s=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(o(e)&&!a(e,"length").writable)throw i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},1589:function(e,t,r){var n=r(1400),o=r(6244),i=r(6135),a=Array,s=Math.max;e.exports=function(e,t,r){for(var c=o(e),u=n(t,c),l=n(void 0===r?c:r,c),d=a(s(l-u,0)),p=0;u<l;u++,p++)i(d,p,e[u]);return d.length=p,d}},206:function(e,t,r){var n=r(1702);e.exports=n([].slice)},4362:function(e,t,r){var n=r(1589),o=Math.floor,i=function(e,t){var r=e.length,c=o(r/2);return r<8?a(e,t):s(e,i(n(e,0,c),t),i(n(e,c),t),t)},a=function(e,t){for(var r,n,o=e.length,i=1;i<o;){for(n=i,r=e[i];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==i++&&(e[n]=r)}return e},s=function(e,t,r,n){for(var o=t.length,i=r.length,a=0,s=0;a<o||s<i;)e[a+s]=a<o&&s<i?n(t[a],r[s])<=0?t[a++]:r[s++]:a<o?t[a++]:r[s++];return e};e.exports=i},7475:function(e,t,r){var n=r(3157),o=r(4411),i=r(111),a=r(5112)("species"),s=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(o(t)&&(t===s||n(t.prototype))||i(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?s:t}},5417:function(e,t,r){var n=r(7475);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},3411:function(e,t,r){var n=r(9670),o=r(9212);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){o(e,"throw",t)}}},7072:function(e,t,r){var n=r(5112)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},4326:function(e,t,r){var n=r(1702),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},648:function(e,t,r){var n=r(1694),o=r(614),i=r(4326),a=r(5112)("toStringTag"),s=Object,c="Arguments"==i(function(){return arguments}());e.exports=n?i:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?r:c?i(t):"Object"==(n=i(t))&&o(t.callee)?"Arguments":n}},5631:function(e,t,r){"use strict";var n=r(30),o=r(7045),i=r(9190),a=r(9974),s=r(5787),c=r(8554),u=r(408),l=r(1656),d=r(6178),p=r(6340),h=r(9781),f=r(2423).fastKey,m=r(9909),g=m.set,v=m.getterFor;e.exports={getConstructor:function(e,t,r,l){var d=e((function(e,o){s(e,p),g(e,{type:t,index:n(null),first:void 0,last:void 0,size:0}),h||(e.size=0),c(o)||u(o,e[l],{that:e,AS_ENTRIES:r})})),p=d.prototype,m=v(t),E=function(e,t,r){var n,o,i=m(e),a=y(e,t);return a?a.value=r:(i.last=a={index:o=f(t,!0),key:t,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=a),n&&(n.next=a),h?i.size++:e.size++,"F"!==o&&(i.index[o]=a)),e},y=function(e,t){var r,n=m(e),o=f(t);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==t)return r};return i(p,{clear:function(){for(var e=m(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,h?e.size=0:this.size=0},delete:function(e){var t=this,r=m(t),n=y(t,e);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first==n&&(r.first=o),r.last==n&&(r.last=i),h?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=m(this),n=a(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!y(this,e)}}),i(p,r?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return E(this,0===e?0:e,t)}}:{add:function(e){return E(this,e=0===e?0:e,e)}}),h&&o(p,"size",{configurable:!0,get:function(){return m(this).size}}),d},setStrong:function(e,t,r){var n=t+" Iterator",o=v(t),i=v(n);l(e,t,(function(e,t){g(this,{type:n,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?d("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1):(e.target=void 0,d(void 0,!0))}),r?"entries":"values",!r,!0),p(t)}}},7710:function(e,t,r){"use strict";var n=r(2109),o=r(7854),i=r(1702),a=r(4705),s=r(8052),c=r(2423),u=r(408),l=r(5787),d=r(614),p=r(8554),h=r(111),f=r(7293),m=r(7072),g=r(8003),v=r(9587);e.exports=function(e,t,r){var E=-1!==e.indexOf("Map"),y=-1!==e.indexOf("Weak"),_=E?"set":"add",T=o[e],I=T&&T.prototype,O=T,R={},C=function(e){var t=i(I[e]);s(I,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(y&&!h(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return y&&!h(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(y&&!h(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(a(e,!d(T)||!(y||I.forEach&&!f((function(){(new T).entries().next()})))))O=r.getConstructor(t,e,E,_),c.enable();else if(a(e,!0)){var N=new O,S=N[_](y?{}:-0,1)!=N,b=f((function(){N.has(1)})),A=m((function(e){new T(e)})),M=!y&&f((function(){for(var e=new T,t=5;t--;)e[_](t,t);return!e.has(-0)}));A||((O=t((function(e,t){l(e,I);var r=v(new T,e,O);return p(t)||u(t,r[_],{that:r,AS_ENTRIES:E}),r}))).prototype=I,I.constructor=O),(b||M)&&(C("delete"),C("has"),E&&C("get")),(M||S)&&C(_),y&&I.clear&&delete I.clear}return R[e]=O,n({global:!0,constructor:!0,forced:O!=T},R),g(O,e),y||r.setStrong(O,e,E),O}},9920:function(e,t,r){var n=r(2597),o=r(3887),i=r(1236),a=r(3070);e.exports=function(e,t,r){for(var s=o(t),c=a.f,u=i.f,l=0;l<s.length;l++){var d=s[l];n(e,d)||r&&n(r,d)||c(e,d,u(t,d))}}},4964:function(e,t,r){var n=r(5112)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},8544:function(e,t,r){var n=r(7293);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},6178:function(e){e.exports=function(e,t){return{value:e,done:t}}},8880:function(e,t,r){var n=r(9781),o=r(3070),i=r(9114);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},9114:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6135:function(e,t,r){"use strict";var n=r(4948),o=r(3070),i=r(9114);e.exports=function(e,t,r){var a=n(t);a in e?o.f(e,a,i(0,r)):e[a]=r}},7045:function(e,t,r){var n=r(6339),o=r(3070);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),o.f(e,t,r)}},8052:function(e,t,r){var n=r(614),o=r(3070),i=r(6339),a=r(3072);e.exports=function(e,t,r,s){s||(s={});var c=s.enumerable,u=void 0!==s.name?s.name:t;if(n(r)&&i(r,u,s),s.global)c?e[t]=r:a(t,r);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=r:o.f(e,t,{value:r,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},9190:function(e,t,r){var n=r(8052);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},3072:function(e,t,r){var n=r(7854),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},5117:function(e,t,r){"use strict";var n=r(6330),o=TypeError;e.exports=function(e,t){if(!delete e[t])throw o("Cannot delete property "+n(t)+" of "+n(e))}},9781:function(e,t,r){var n=r(7293);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4154:function(e){var t="object"==typeof document&&document.all,r=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:r}},317:function(e,t,r){var n=r(7854),o=r(111),i=n.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},7207:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},8324:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:function(e,t,r){var n=r(317)("span").classList,o=n&&n.constructor&&n.constructor.prototype;e.exports=o===Object.prototype?void 0:o},8886:function(e,t,r){var n=r(8113).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},7871:function(e,t,r){var n=r(3823),o=r(5268);e.exports=!n&&!o&&"object"==typeof window&&"object"==typeof document},9363:function(e){e.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},3823:function(e){e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},256:function(e,t,r){var n=r(8113);e.exports=/MSIE|Trident/.test(n)},1528:function(e,t,r){var n=r(8113);e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},6833:function(e,t,r){var n=r(8113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},5268:function(e,t,r){var n=r(4326);e.exports="undefined"!=typeof process&&"process"==n(process)},1036:function(e,t,r){var n=r(8113);e.exports=/web0s(?!.*chrome)/i.test(n)},8113:function(e){e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7392:function(e,t,r){var n,o,i=r(7854),a=r(8113),s=i.process,c=i.Deno,u=s&&s.versions||c&&c.version,l=u&&u.v8;l&&(o=(n=l.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),e.exports=o},8008:function(e,t,r){var n=r(8113).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(e,t,r){var n=r(7854),o=r(1236).f,i=r(8880),a=r(8052),s=r(3072),c=r(9920),u=r(4705);e.exports=function(e,t){var r,l,d,p,h,f=e.target,m=e.global,g=e.stat;if(r=m?n:g?n[f]||s(f,{}):(n[f]||{}).prototype)for(l in t){if(p=t[l],d=e.dontCallGetSet?(h=o(r,l))&&h.value:r[l],!u(m?l:f+(g?".":"#")+l,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),a(r,l,p,e)}}},7293:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},7007:function(e,t,r){"use strict";r(4916);var n=r(1470),o=r(8052),i=r(2261),a=r(7293),s=r(5112),c=r(8880),u=s("species"),l=RegExp.prototype;e.exports=function(e,t,r,d){var p=s(e),h=!a((function(){var t={};return t[p]=function(){return 7},7!=""[e](t)})),f=h&&!a((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[u]=function(){return r},r.flags="",r[p]=/./[p]),r.exec=function(){return t=!0,null},r[p](""),!t}));if(!h||!f||r){var m=n(/./[p]),g=t(p,""[e],(function(e,t,r,o,a){var s=n(e),c=t.exec;return c===i||c===l.exec?h&&!a?{done:!0,value:m(t,r,o)}:{done:!0,value:s(r,t,o)}:{done:!1}}));o(String.prototype,e,g[0]),o(l,p,g[1])}d&&c(l[p],"sham",!0)}},6677:function(e,t,r){var n=r(7293);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},2104:function(e,t,r){var n=r(4374),o=Function.prototype,i=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},9974:function(e,t,r){var n=r(1470),o=r(9662),i=r(4374),a=n(n.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},4374:function(e,t,r){var n=r(7293);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},7065:function(e,t,r){"use strict";var n=r(1702),o=r(9662),i=r(111),a=r(2597),s=r(206),c=r(4374),u=Function,l=n([].concat),d=n([].join),p={};e.exports=c?u.bind:function(e){var t=o(this),r=t.prototype,n=s(arguments,1),c=function(){var r=l(n,s(arguments));return this instanceof c?function(e,t,r){if(!a(p,t)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";p[t]=u("C,a","return new C("+d(n,",")+")")}return p[t](e,r)}(t,r.length,r):t.apply(e,r)};return i(r)&&(c.prototype=r),c}},6916:function(e,t,r){var n=r(4374),o=Function.prototype.call;e.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},6530:function(e,t,r){var n=r(9781),o=r(2597),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,u=s&&(!n||n&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},5668:function(e,t,r){var n=r(1702),o=r(9662);e.exports=function(e,t,r){try{return n(o(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},1470:function(e,t,r){var n=r(4326),o=r(1702);e.exports=function(e){if("Function"===n(e))return o(e)}},1702:function(e,t,r){var n=r(4374),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);e.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}},5005:function(e,t,r){var n=r(7854),o=r(614);e.exports=function(e,t){return arguments.length<2?(r=n[e],o(r)?r:void 0):n[e]&&n[e][t];var r}},1246:function(e,t,r){var n=r(648),o=r(8173),i=r(8554),a=r(7497),s=r(5112)("iterator");e.exports=function(e){if(!i(e))return o(e,s)||o(e,"@@iterator")||a[n(e)]}},4121:function(e,t,r){var n=r(6916),o=r(9662),i=r(9670),a=r(6330),s=r(1246),c=TypeError;e.exports=function(e,t){var r=arguments.length<2?s(e):t;if(o(r))return i(n(r,e));throw c(a(e)+" is not iterable")}},8044:function(e,t,r){var n=r(1702),o=r(3157),i=r(614),a=r(4326),s=r(1340),c=n([].push);e.exports=function(e){if(i(e))return e;if(o(e)){for(var t=e.length,r=[],n=0;n<t;n++){var u=e[n];"string"==typeof u?c(r,u):"number"!=typeof u&&"Number"!=a(u)&&"String"!=a(u)||c(r,s(u))}var l=r.length,d=!0;return function(e,t){if(d)return d=!1,t;if(o(this))return t;for(var n=0;n<l;n++)if(r[n]===e)return t}}}},8173:function(e,t,r){var n=r(9662),o=r(8554);e.exports=function(e,t){var r=e[t];return o(r)?void 0:n(r)}},7854:function(e,t,r){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||this||Function("return this")()},2597:function(e,t,r){var n=r(1702),o=r(7908),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},3501:function(e){e.exports={}},842:function(e){e.exports=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}}},490:function(e,t,r){var n=r(5005);e.exports=n("document","documentElement")},4664:function(e,t,r){var n=r(9781),o=r(7293),i=r(317);e.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},1179:function(e){var t=Array,r=Math.abs,n=Math.pow,o=Math.floor,i=Math.log,a=Math.LN2;e.exports={pack:function(e,s,c){var u,l,d,p=t(c),h=8*c-s-1,f=(1<<h)-1,m=f>>1,g=23===s?n(2,-24)-n(2,-77):0,v=e<0||0===e&&1/e<0?1:0,E=0;for((e=r(e))!=e||e===1/0?(l=e!=e?1:0,u=f):(u=o(i(e)/a),e*(d=n(2,-u))<1&&(u--,d*=2),(e+=u+m>=1?g/d:g*n(2,1-m))*d>=2&&(u++,d/=2),u+m>=f?(l=0,u=f):u+m>=1?(l=(e*d-1)*n(2,s),u+=m):(l=e*n(2,m-1)*n(2,s),u=0));s>=8;)p[E++]=255&l,l/=256,s-=8;for(u=u<<s|l,h+=s;h>0;)p[E++]=255&u,u/=256,h-=8;return p[--E]|=128*v,p},unpack:function(e,t){var r,o=e.length,i=8*o-t-1,a=(1<<i)-1,s=a>>1,c=i-7,u=o-1,l=e[u--],d=127&l;for(l>>=7;c>0;)d=256*d+e[u--],c-=8;for(r=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)r=256*r+e[u--],c-=8;if(0===d)d=1-s;else{if(d===a)return r?NaN:l?-1/0:1/0;r+=n(2,t),d-=s}return(l?-1:1)*r*n(2,d-t)}}},8361:function(e,t,r){var n=r(1702),o=r(7293),i=r(4326),a=Object,s=n("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?s(e,""):a(e)}:a},9587:function(e,t,r){var n=r(614),o=r(111),i=r(7674);e.exports=function(e,t,r){var a,s;return i&&n(a=t.constructor)&&a!==r&&o(s=a.prototype)&&s!==r.prototype&&i(e,s),e}},2788:function(e,t,r){var n=r(1702),o=r(614),i=r(5465),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},2423:function(e,t,r){var n=r(2109),o=r(1702),i=r(3501),a=r(111),s=r(2597),c=r(3070).f,u=r(8006),l=r(1156),d=r(2050),p=r(9711),h=r(6677),f=!1,m=p("meta"),g=0,v=function(e){c(e,m,{value:{objectID:"O"+g++,weakData:{}}})},E=e.exports={enable:function(){E.enable=function(){},f=!0;var e=u.f,t=o([].splice),r={};r[m]=1,e(r).length&&(u.f=function(r){for(var n=e(r),o=0,i=n.length;o<i;o++)if(n[o]===m){t(n,o,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,m)){if(!d(e))return"F";if(!t)return"E";v(e)}return e[m].objectID},getWeakData:function(e,t){if(!s(e,m)){if(!d(e))return!0;if(!t)return!1;v(e)}return e[m].weakData},onFreeze:function(e){return h&&f&&d(e)&&!s(e,m)&&v(e),e}};i[m]=!0},9909:function(e,t,r){var n,o,i,a=r(4811),s=r(7854),c=r(111),u=r(8880),l=r(2597),d=r(5465),p=r(6200),h=r(3501),f="Object already initialized",m=s.TypeError,g=s.WeakMap;if(a||d.state){var v=d.state||(d.state=new g);v.get=v.get,v.has=v.has,v.set=v.set,n=function(e,t){if(v.has(e))throw m(f);return t.facade=e,v.set(e,t),t},o=function(e){return v.get(e)||{}},i=function(e){return v.has(e)}}else{var E=p("state");h[E]=!0,n=function(e,t){if(l(e,E))throw m(f);return t.facade=e,u(e,E,t),t},o=function(e){return l(e,E)?e[E]:{}},i=function(e){return l(e,E)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=o(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return r}}}},7659:function(e,t,r){var n=r(5112),o=r(7497),i=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},3157:function(e,t,r){var n=r(4326);e.exports=Array.isArray||function(e){return"Array"==n(e)}},4067:function(e,t,r){var n=r(648);e.exports=function(e){var t=n(e);return"BigInt64Array"==t||"BigUint64Array"==t}},614:function(e,t,r){var n=r(4154),o=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===o}:function(e){return"function"==typeof e}},4411:function(e,t,r){var n=r(1702),o=r(7293),i=r(614),a=r(648),s=r(5005),c=r(2788),u=function(){},l=[],d=s("Reflect","construct"),p=/^\s*(?:class|function)\b/,h=n(p.exec),f=!p.exec(u),m=function(e){if(!i(e))return!1;try{return d(u,l,e),!0}catch(e){return!1}},g=function(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!h(p,c(e))}catch(e){return!0}};g.sham=!0,e.exports=!d||o((function(){var e;return m(m.call)||!m(Object)||!m((function(){e=!0}))||e}))?g:m},4705:function(e,t,r){var n=r(7293),o=r(614),i=/#|\.prototype\./,a=function(e,t){var r=c[s(e)];return r==l||r!=u&&(o(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=a.data={},u=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},5988:function(e,t,r){var n=r(111),o=Math.floor;e.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&o(e)===e}},8554:function(e){e.exports=function(e){return null==e}},111:function(e,t,r){var n=r(614),o=r(4154),i=o.all;e.exports=o.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===i}:function(e){return"object"==typeof e?null!==e:n(e)}},1913:function(e){e.exports=!1},7850:function(e,t,r){var n=r(111),o=r(4326),i=r(5112)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},2190:function(e,t,r){var n=r(5005),o=r(614),i=r(7976),a=r(3307),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return o(t)&&i(t.prototype,s(e))}},408:function(e,t,r){var n=r(9974),o=r(6916),i=r(9670),a=r(6330),s=r(7659),c=r(6244),u=r(7976),l=r(4121),d=r(1246),p=r(9212),h=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,r){var g,v,E,y,_,T,I,O=r&&r.that,R=!(!r||!r.AS_ENTRIES),C=!(!r||!r.IS_RECORD),N=!(!r||!r.IS_ITERATOR),S=!(!r||!r.INTERRUPTED),b=n(t,O),A=function(e){return g&&p(g,"normal",e),new f(!0,e)},M=function(e){return R?(i(e),S?b(e[0],e[1],A):b(e[0],e[1])):S?b(e,A):b(e)};if(C)g=e.iterator;else if(N)g=e;else{if(!(v=d(e)))throw h(a(e)+" is not iterable");if(s(v)){for(E=0,y=c(e);y>E;E++)if((_=M(e[E]))&&u(m,_))return _;return new f(!1)}g=l(e,v)}for(T=C?e.next:g.next;!(I=o(T,g)).done;){try{_=M(I.value)}catch(e){p(g,"throw",e)}if("object"==typeof _&&_&&u(m,_))return _}return new f(!1)}},9212:function(e,t,r){var n=r(6916),o=r(9670),i=r(8173);e.exports=function(e,t,r){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw r;if(s)throw a;return o(a),r}},3061:function(e,t,r){"use strict";var n=r(3383).IteratorPrototype,o=r(30),i=r(9114),a=r(8003),s=r(7497),c=function(){return this};e.exports=function(e,t,r,u){var l=t+" Iterator";return e.prototype=o(n,{next:i(+!u,r)}),a(e,l,!1,!0),s[l]=c,e}},1656:function(e,t,r){"use strict";var n=r(2109),o=r(6916),i=r(1913),a=r(6530),s=r(614),c=r(3061),u=r(9518),l=r(7674),d=r(8003),p=r(8880),h=r(8052),f=r(5112),m=r(7497),g=r(3383),v=a.PROPER,E=a.CONFIGURABLE,y=g.IteratorPrototype,_=g.BUGGY_SAFARI_ITERATORS,T=f("iterator"),I="keys",O="values",R="entries",C=function(){return this};e.exports=function(e,t,r,a,f,g,N){c(r,t,a);var S,b,A,M=function(e){if(e===f&&x)return x;if(!_&&e in U)return U[e];switch(e){case I:case O:case R:return function(){return new r(this,e)}}return function(){return new r(this)}},w=t+" Iterator",k=!1,U=e.prototype,P=U[T]||U["@@iterator"]||f&&U[f],x=!_&&P||M(f),L="Array"==t&&U.entries||P;if(L&&(S=u(L.call(new e)))!==Object.prototype&&S.next&&(i||u(S)===y||(l?l(S,y):s(S[T])||h(S,T,C)),d(S,w,!0,!0),i&&(m[w]=C)),v&&f==O&&P&&P.name!==O&&(!i&&E?p(U,"name",O):(k=!0,x=function(){return o(P,this)})),f)if(b={values:M(O),keys:g?x:M(I),entries:M(R)},N)for(A in b)(_||k||!(A in U))&&h(U,A,b[A]);else n({target:t,proto:!0,forced:_||k},b);return i&&!N||U[T]===x||h(U,T,x,{name:f}),m[t]=x,b}},3383:function(e,t,r){"use strict";var n,o,i,a=r(7293),s=r(614),c=r(111),u=r(30),l=r(9518),d=r(8052),p=r(5112),h=r(1913),f=p("iterator"),m=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(n=o):m=!0),!c(n)||a((function(){var e={};return n[f].call(e)!==e}))?n={}:h&&(n=u(n)),s(n[f])||d(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},7497:function(e){e.exports={}},6244:function(e,t,r){var n=r(7466);e.exports=function(e){return n(e.length)}},6339:function(e,t,r){var n=r(1702),o=r(7293),i=r(614),a=r(2597),s=r(9781),c=r(6530).CONFIGURABLE,u=r(2788),l=r(9909),d=l.enforce,p=l.get,h=String,f=Object.defineProperty,m=n("".slice),g=n("".replace),v=n([].join),E=s&&!o((function(){return 8!==f((function(){}),"length",{value:8}).length})),y=String(String).split("String"),_=e.exports=function(e,t,r){"Symbol("===m(h(t),0,7)&&(t="["+g(h(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!a(e,"name")||c&&e.name!==t)&&(s?f(e,"name",{value:t,configurable:!0}):e.name=t),E&&r&&a(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=d(e);return a(n,"source")||(n.source=v(y,"string"==typeof t?t:"")),e};Function.prototype.toString=_((function(){return i(this)&&p(this).source||u(this)}),"toString")},4758:function(e){var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},5948:function(e,t,r){var n,o,i,a,s,c=r(7854),u=r(9974),l=r(1236).f,d=r(261).set,p=r(8572),h=r(6833),f=r(1528),m=r(1036),g=r(5268),v=c.MutationObserver||c.WebKitMutationObserver,E=c.document,y=c.process,_=c.Promise,T=l(c,"queueMicrotask"),I=T&&T.value;if(!I){var O=new p,R=function(){var e,t;for(g&&(e=y.domain)&&e.exit();t=O.get();)try{t()}catch(e){throw O.head&&n(),e}e&&e.enter()};h||g||m||!v||!E?!f&&_&&_.resolve?((a=_.resolve(void 0)).constructor=_,s=u(a.then,a),n=function(){s(R)}):g?n=function(){y.nextTick(R)}:(d=u(d,c),n=function(){d(R)}):(o=!0,i=E.createTextNode(""),new v(R).observe(i,{characterData:!0}),n=function(){i.data=o=!o}),I=function(e){O.head||n(),O.add(e)}}e.exports=I},8523:function(e,t,r){"use strict";var n=r(9662),o=TypeError,i=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw o("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new i(e)}},3929:function(e,t,r){var n=r(7850),o=TypeError;e.exports=function(e){if(n(e))throw o("The method doesn't accept regular expressions");return e}},1574:function(e,t,r){"use strict";var n=r(9781),o=r(1702),i=r(6916),a=r(7293),s=r(1956),c=r(5181),u=r(5296),l=r(7908),d=r(8361),p=Object.assign,h=Object.defineProperty,f=o([].concat);e.exports=!p||a((function(){if(n&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),o="abcdefghijklmnopqrst";return e[r]=7,o.split("").forEach((function(e){t[e]=e})),7!=p({},e)[r]||s(p({},t)).join("")!=o}))?function(e,t){for(var r=l(e),o=arguments.length,a=1,p=c.f,h=u.f;o>a;)for(var m,g=d(arguments[a++]),v=p?f(s(g),p(g)):s(g),E=v.length,y=0;E>y;)m=v[y++],n&&!i(h,g,m)||(r[m]=g[m]);return r}:p},30:function(e,t,r){var n,o=r(9670),i=r(6048),a=r(748),s=r(3501),c=r(490),u=r(317),l=r(6200),d="prototype",p="script",h=l("IE_PROTO"),f=function(){},m=function(e){return"<"+p+">"+e+"</"+p+">"},g=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;v="undefined"!=typeof document?document.domain&&n?g(n):(t=u("iframe"),r="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):g(n);for(var o=a.length;o--;)delete v[d][a[o]];return v()};s[h]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[d]=o(e),r=new f,f[d]=null,r[h]=e):r=v(),void 0===t?r:i.f(r,t)}},6048:function(e,t,r){var n=r(9781),o=r(3353),i=r(3070),a=r(9670),s=r(5656),c=r(1956);t.f=n&&!o?Object.defineProperties:function(e,t){a(e);for(var r,n=s(t),o=c(t),u=o.length,l=0;u>l;)i.f(e,r=o[l++],n[r]);return e}},3070:function(e,t,r){var n=r(9781),o=r(4664),i=r(3353),a=r(9670),s=r(4948),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",h="writable";t.f=n?i?function(e,t,r){if(a(e),t=s(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&h in r&&!r[h]){var n=l(e,t);n&&n[h]&&(e[t]=r.value,r={configurable:p in r?r[p]:n[p],enumerable:d in r?r[d]:n[d],writable:!1})}return u(e,t,r)}:u:function(e,t,r){if(a(e),t=s(t),a(r),o)try{return u(e,t,r)}catch(e){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},1236:function(e,t,r){var n=r(9781),o=r(6916),i=r(5296),a=r(9114),s=r(5656),c=r(4948),u=r(2597),l=r(4664),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=s(e),t=c(t),l)try{return d(e,t)}catch(e){}if(u(e,t))return a(!o(i.f,e,t),e[t])}},1156:function(e,t,r){var n=r(4326),o=r(5656),i=r(8006).f,a=r(1589),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"==n(e)?function(e){try{return i(e)}catch(e){return a(s)}}(e):i(o(e))}},8006:function(e,t,r){var n=r(6324),o=r(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},5181:function(e,t){t.f=Object.getOwnPropertySymbols},9518:function(e,t,r){var n=r(2597),o=r(614),i=r(7908),a=r(6200),s=r(8544),c=a("IE_PROTO"),u=Object,l=u.prototype;e.exports=s?u.getPrototypeOf:function(e){var t=i(e);if(n(t,c))return t[c];var r=t.constructor;return o(r)&&t instanceof r?r.prototype:t instanceof u?l:null}},2050:function(e,t,r){var n=r(7293),o=r(111),i=r(4326),a=r(7556),s=Object.isExtensible,c=n((function(){s(1)}));e.exports=c||a?function(e){return!!o(e)&&(!a||"ArrayBuffer"!=i(e))&&(!s||s(e))}:s},7976:function(e,t,r){var n=r(1702);e.exports=n({}.isPrototypeOf)},6324:function(e,t,r){var n=r(1702),o=r(2597),i=r(5656),a=r(1318).indexOf,s=r(3501),c=n([].push);e.exports=function(e,t){var r,n=i(e),u=0,l=[];for(r in n)!o(s,r)&&o(n,r)&&c(l,r);for(;t.length>u;)o(n,r=t[u++])&&(~a(l,r)||c(l,r));return l}},1956:function(e,t,r){var n=r(6324),o=r(748);e.exports=Object.keys||function(e){return n(e,o)}},5296:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},7674:function(e,t,r){var n=r(5668),o=r(9670),i=r(6077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return o(r),i(n),t?e(r,n):r.__proto__=n,r}}():void 0)},4699:function(e,t,r){var n=r(9781),o=r(1702),i=r(1956),a=r(5656),s=o(r(5296).f),c=o([].push),u=function(e){return function(t){for(var r,o=a(t),u=i(o),l=u.length,d=0,p=[];l>d;)r=u[d++],n&&!s(o,r)||c(p,e?[r,o[r]]:o[r]);return p}};e.exports={entries:u(!0),values:u(!1)}},288:function(e,t,r){"use strict";var n=r(1694),o=r(648);e.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},2140:function(e,t,r){var n=r(6916),o=r(614),i=r(111),a=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&o(r=e.toString)&&!i(s=n(r,e)))return s;if(o(r=e.valueOf)&&!i(s=n(r,e)))return s;if("string"!==t&&o(r=e.toString)&&!i(s=n(r,e)))return s;throw a("Can't convert object to primitive value")}},3887:function(e,t,r){var n=r(5005),o=r(1702),i=r(8006),a=r(5181),s=r(9670),c=o([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),r=a.f;return r?c(t,r(e)):t}},857:function(e,t,r){var n=r(7854);e.exports=n},2534:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},3702:function(e,t,r){var n=r(7854),o=r(2492),i=r(614),a=r(4705),s=r(2788),c=r(5112),u=r(7871),l=r(3823),d=r(1913),p=r(7392),h=o&&o.prototype,f=c("species"),m=!1,g=i(n.PromiseRejectionEvent),v=a("Promise",(function(){var e=s(o),t=e!==String(o);if(!t&&66===p)return!0;if(d&&(!h.catch||!h.finally))return!0;if(!p||p<51||!/native code/.test(e)){var r=new o((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[f]=n,!(m=r.then((function(){}))instanceof n))return!0}return!t&&(u||l)&&!g}));e.exports={CONSTRUCTOR:v,REJECTION_EVENT:g,SUBCLASSING:m}},2492:function(e,t,r){var n=r(7854);e.exports=n.Promise},9478:function(e,t,r){var n=r(9670),o=r(111),i=r(8523);e.exports=function(e,t){if(n(e),o(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},612:function(e,t,r){var n=r(2492),o=r(7072),i=r(3702).CONSTRUCTOR;e.exports=i||!o((function(e){n.all(e).then(void 0,(function(){}))}))},8572:function(e){var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},7651:function(e,t,r){var n=r(6916),o=r(9670),i=r(614),a=r(4326),s=r(2261),c=TypeError;e.exports=function(e,t){var r=e.exec;if(i(r)){var u=n(r,e,t);return null!==u&&o(u),u}if("RegExp"===a(e))return n(s,e,t);throw c("RegExp#exec called on incompatible receiver")}},2261:function(e,t,r){"use strict";var n,o,i=r(6916),a=r(1702),s=r(1340),c=r(7066),u=r(2999),l=r(2309),d=r(30),p=r(9909).get,h=r(9441),f=r(7168),m=l("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,v=g,E=a("".charAt),y=a("".indexOf),_=a("".replace),T=a("".slice),I=(o=/b*/g,i(g,n=/a/,"a"),i(g,o,"a"),0!==n.lastIndex||0!==o.lastIndex),O=u.BROKEN_CARET,R=void 0!==/()??/.exec("")[1];(I||R||O||h||f)&&(v=function(e){var t,r,n,o,a,u,l,h=this,f=p(h),C=s(e),N=f.raw;if(N)return N.lastIndex=h.lastIndex,t=i(v,N,C),h.lastIndex=N.lastIndex,t;var S=f.groups,b=O&&h.sticky,A=i(c,h),M=h.source,w=0,k=C;if(b&&(A=_(A,"y",""),-1===y(A,"g")&&(A+="g"),k=T(C,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==E(C,h.lastIndex-1))&&(M="(?: "+M+")",k=" "+k,w++),r=new RegExp("^(?:"+M+")",A)),R&&(r=new RegExp("^"+M+"$(?!\\s)",A)),I&&(n=h.lastIndex),o=i(g,b?r:h,k),b?o?(o.input=T(o.input,w),o[0]=T(o[0],w),o.index=h.lastIndex,h.lastIndex+=o[0].length):h.lastIndex=0:I&&o&&(h.lastIndex=h.global?o.index+o[0].length:n),R&&o&&o.length>1&&i(m,o[0],r,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(o[a]=void 0)})),o&&S)for(o.groups=u=d(null),a=0;a<S.length;a++)u[(l=S[a])[0]]=o[l[1]];return o}),e.exports=v},7066:function(e,t,r){"use strict";var n=r(9670);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},4706:function(e,t,r){var n=r(6916),o=r(2597),i=r(7976),a=r(7066),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||o(e,"flags")||!i(s,e)?t:n(a,e)}},2999:function(e,t,r){var n=r(7293),o=r(7854).RegExp,i=n((function(){var e=o("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),a=i||n((function(){return!o("a","y").sticky})),s=i||n((function(){var e=o("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:i}},9441:function(e,t,r){var n=r(7293),o=r(7854).RegExp;e.exports=n((function(){var e=o(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},7168:function(e,t,r){var n=r(7293),o=r(7854).RegExp;e.exports=n((function(){var e=o("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},4488:function(e,t,r){var n=r(8554),o=TypeError;e.exports=function(e){if(n(e))throw o("Can't call method on "+e);return e}},7152:function(e,t,r){"use strict";var n,o=r(7854),i=r(2104),a=r(614),s=r(9363),c=r(8113),u=r(206),l=r(8053),d=o.Function,p=/MSIE .\./.test(c)||s&&((n=o.Bun.version.split(".")).length<3||0==n[0]&&(n[1]<3||3==n[1]&&0==n[2]));e.exports=function(e,t){var r=t?2:1;return p?function(n,o){var s=l(arguments.length,1)>r,c=a(n)?n:d(n),p=s?u(arguments,r):[],h=s?function(){i(c,this,p)}:c;return t?e(h,o):e(h)}:e}},6340:function(e,t,r){"use strict";var n=r(5005),o=r(7045),i=r(5112),a=r(9781),s=i("species");e.exports=function(e){var t=n(e);a&&t&&!t[s]&&o(t,s,{configurable:!0,get:function(){return this}})}},8003:function(e,t,r){var n=r(3070).f,o=r(2597),i=r(5112)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!o(e,i)&&n(e,i,{configurable:!0,value:t})}},6200:function(e,t,r){var n=r(2309),o=r(9711),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},5465:function(e,t,r){var n=r(7854),o=r(3072),i="__core-js_shared__",a=n[i]||o(i,{});e.exports=a},2309:function(e,t,r){var n=r(1913),o=r(5465);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:function(e,t,r){var n=r(9670),o=r(9483),i=r(8554),a=r(5112)("species");e.exports=function(e,t){var r,s=n(e).constructor;return void 0===s||i(r=n(s)[a])?t:o(r)}},8710:function(e,t,r){var n=r(1702),o=r(9303),i=r(1340),a=r(4488),s=n("".charAt),c=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,r){var n,l,d=i(a(t)),p=o(r),h=d.length;return p<0||p>=h?e?"":void 0:(n=c(d,p))<55296||n>56319||p+1===h||(l=c(d,p+1))<56320||l>57343?e?s(d,p):n:e?u(d,p,p+2):l-56320+(n-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},3197:function(e,t,r){var n=r(1702),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",c=RangeError,u=n(a.exec),l=Math.floor,d=String.fromCharCode,p=n("".charCodeAt),h=n([].join),f=n([].push),m=n("".replace),g=n("".split),v=n("".toLowerCase),E=function(e){return e+22+75*(e<26)},y=function(e,t,r){var n=0;for(e=r?l(e/700):e>>1,e+=l(e/t);e>455;)e=l(e/35),n+=36;return l(n+36*e/(e+38))},_=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=p(e,r++);if(o>=55296&&o<=56319&&r<n){var i=p(e,r++);56320==(64512&i)?f(t,((1023&o)<<10)+(1023&i)+65536):(f(t,o),r--)}else f(t,o)}return t}(e);var r,n,i=e.length,a=128,u=0,m=72;for(r=0;r<e.length;r++)(n=e[r])<128&&f(t,d(n));var g=t.length,v=g;for(g&&f(t,"-");v<i;){var _=o;for(r=0;r<e.length;r++)(n=e[r])>=a&&n<_&&(_=n);var T=v+1;if(_-a>l((o-u)/T))throw c(s);for(u+=(_-a)*T,a=_,r=0;r<e.length;r++){if((n=e[r])<a&&++u>o)throw c(s);if(n==a){for(var I=u,O=36;;){var R=O<=m?1:O>=m+26?26:O-m;if(I<R)break;var C=I-R,N=36-R;f(t,d(E(R+C%N))),I=l(C/N),O+=36}f(t,d(E(I))),m=y(u,T,v==g),u=0,v++}}u++,a++}return h(t,"")};e.exports=function(e){var t,r,n=[],o=g(m(v(e),a,"."),".");for(t=0;t<o.length;t++)r=o[t],f(n,u(i,r)?"xn--"+_(r):r);return h(n,".")}},8415:function(e,t,r){"use strict";var n=r(9303),o=r(1340),i=r(4488),a=RangeError;e.exports=function(e){var t=o(i(this)),r="",s=n(e);if(s<0||s==1/0)throw a("Wrong number of repetitions");for(;s>0;(s>>>=1)&&(t+=t))1&s&&(r+=t);return r}},3111:function(e,t,r){var n=r(1702),o=r(4488),i=r(1340),a=r(1361),s=n("".replace),c=RegExp("^["+a+"]+"),u=RegExp("(^|[^"+a+"])["+a+"]+$"),l=function(e){return function(t){var r=i(o(t));return 1&e&&(r=s(r,c,"")),2&e&&(r=s(r,u,"$1")),r}};e.exports={start:l(1),end:l(2),trim:l(3)}},6293:function(e,t,r){var n=r(7392),o=r(7293),i=r(7854).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},6532:function(e,t,r){var n=r(6916),o=r(5005),i=r(5112),a=r(8052);e.exports=function(){var e=o("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,s=i("toPrimitive");t&&!t[s]&&a(t,s,(function(e){return n(r,this)}),{arity:1})}},2015:function(e,t,r){var n=r(6293);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},261:function(e,t,r){var n,o,i,a,s=r(7854),c=r(2104),u=r(9974),l=r(614),d=r(2597),p=r(7293),h=r(490),f=r(206),m=r(317),g=r(8053),v=r(6833),E=r(5268),y=s.setImmediate,_=s.clearImmediate,T=s.process,I=s.Dispatch,O=s.Function,R=s.MessageChannel,C=s.String,N=0,S={},b="onreadystatechange";p((function(){n=s.location}));var A=function(e){if(d(S,e)){var t=S[e];delete S[e],t()}},M=function(e){return function(){A(e)}},w=function(e){A(e.data)},k=function(e){s.postMessage(C(e),n.protocol+"//"+n.host)};y&&_||(y=function(e){g(arguments.length,1);var t=l(e)?e:O(e),r=f(arguments,1);return S[++N]=function(){c(t,void 0,r)},o(N),N},_=function(e){delete S[e]},E?o=function(e){T.nextTick(M(e))}:I&&I.now?o=function(e){I.now(M(e))}:R&&!v?(a=(i=new R).port2,i.port1.onmessage=w,o=u(a.postMessage,a)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!p(k)?(o=k,s.addEventListener("message",w,!1)):o=b in m("script")?function(e){h.appendChild(m("script"))[b]=function(){h.removeChild(this),A(e)}}:function(e){setTimeout(M(e),0)}),e.exports={set:y,clear:_}},863:function(e,t,r){var n=r(1702);e.exports=n(1..valueOf)},1400:function(e,t,r){var n=r(9303),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},4599:function(e,t,r){var n=r(7593),o=TypeError;e.exports=function(e){var t=n(e,"number");if("number"==typeof t)throw o("Can't convert number to bigint");return BigInt(t)}},7067:function(e,t,r){var n=r(9303),o=r(7466),i=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=n(e),r=o(t);if(t!==r)throw i("Wrong length or index");return r}},5656:function(e,t,r){var n=r(8361),o=r(4488);e.exports=function(e){return n(o(e))}},9303:function(e,t,r){var n=r(4758);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},7466:function(e,t,r){var n=r(9303),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},7908:function(e,t,r){var n=r(4488),o=Object;e.exports=function(e){return o(n(e))}},4590:function(e,t,r){var n=r(3002),o=RangeError;e.exports=function(e,t){var r=n(e);if(r%t)throw o("Wrong offset");return r}},3002:function(e,t,r){var n=r(9303),o=RangeError;e.exports=function(e){var t=n(e);if(t<0)throw o("The argument can't be less than 0");return t}},7593:function(e,t,r){var n=r(6916),o=r(111),i=r(2190),a=r(8173),s=r(2140),c=r(5112),u=TypeError,l=c("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var r,c=a(e,l);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!o(r)||i(r))return r;throw u("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},4948:function(e,t,r){var n=r(7593),o=r(2190);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},1694:function(e,t,r){var n={};n[r(5112)("toStringTag")]="z",e.exports="[object z]"===String(n)},1340:function(e,t,r){var n=r(648),o=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},6330:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},9843:function(e,t,r){"use strict";var n=r(2109),o=r(7854),i=r(6916),a=r(9781),s=r(3832),c=r(260),u=r(3331),l=r(5787),d=r(9114),p=r(8880),h=r(5988),f=r(7466),m=r(7067),g=r(4590),v=r(4948),E=r(2597),y=r(648),_=r(111),T=r(2190),I=r(30),O=r(7976),R=r(7674),C=r(8006).f,N=r(7321),S=r(2092).forEach,b=r(6340),A=r(7045),M=r(3070),w=r(1236),k=r(9909),U=r(9587),P=k.get,x=k.set,L=k.enforce,D=M.f,j=w.f,G=Math.round,B=o.RangeError,H=u.ArrayBuffer,F=H.prototype,W=u.DataView,q=c.NATIVE_ARRAY_BUFFER_VIEWS,K=c.TYPED_ARRAY_TAG,z=c.TypedArray,V=c.TypedArrayPrototype,X=c.aTypedArrayConstructor,J=c.isTypedArray,Z="BYTES_PER_ELEMENT",Y="Wrong length",Q=function(e,t){X(e);for(var r=0,n=t.length,o=new e(n);n>r;)o[r]=t[r++];return o},$=function(e,t){A(e,t,{configurable:!0,get:function(){return P(this)[t]}})},ee=function(e){var t;return O(F,e)||"ArrayBuffer"==(t=y(e))||"SharedArrayBuffer"==t},te=function(e,t){return J(e)&&!T(t)&&t in e&&h(+t)&&t>=0},re=function(e,t){return t=v(t),te(e,t)?d(2,e[t]):j(e,t)},ne=function(e,t,r){return t=v(t),!(te(e,t)&&_(r)&&E(r,"value"))||E(r,"get")||E(r,"set")||r.configurable||E(r,"writable")&&!r.writable||E(r,"enumerable")&&!r.enumerable?D(e,t,r):(e[t]=r.value,e)};a?(q||(w.f=re,M.f=ne,$(V,"buffer"),$(V,"byteOffset"),$(V,"byteLength"),$(V,"length")),n({target:"Object",stat:!0,forced:!q},{getOwnPropertyDescriptor:re,defineProperty:ne}),e.exports=function(e,t,r){var a=e.match(/\d+/)[0]/8,c=e+(r?"Clamped":"")+"Array",u="get"+e,d="set"+e,h=o[c],v=h,E=v&&v.prototype,y={},T=function(e,t){D(e,t,{get:function(){return function(e,t){var r=P(e);return r.view[u](t*a+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var o=P(e);r&&(n=(n=G(n))<0?0:n>255?255:255&n),o.view[d](t*a+o.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};q?s&&(v=t((function(e,t,r,n){return l(e,E),U(_(t)?ee(t)?void 0!==n?new h(t,g(r,a),n):void 0!==r?new h(t,g(r,a)):new h(t):J(t)?Q(v,t):i(N,v,t):new h(m(t)),e,v)})),R&&R(v,z),S(C(h),(function(e){e in v||p(v,e,h[e])})),v.prototype=E):(v=t((function(e,t,r,n){l(e,E);var o,s,c,u=0,d=0;if(_(t)){if(!ee(t))return J(t)?Q(v,t):i(N,v,t);o=t,d=g(r,a);var p=t.byteLength;if(void 0===n){if(p%a)throw B(Y);if((s=p-d)<0)throw B(Y)}else if((s=f(n)*a)+d>p)throw B(Y);c=s/a}else c=m(t),o=new H(s=c*a);for(x(e,{buffer:o,byteOffset:d,byteLength:s,length:c,view:new W(o)});u<c;)T(e,u++)})),R&&R(v,z),E=v.prototype=I(V)),E.constructor!==v&&p(E,"constructor",v),L(E).TypedArrayConstructor=v,K&&p(E,K,c);var O=v!=h;y[c]=v,n({global:!0,constructor:!0,forced:O,sham:!q},y),Z in v||p(v,Z,a),Z in E||p(E,Z,a),b(c)}):e.exports=function(){}},3832:function(e,t,r){var n=r(7854),o=r(7293),i=r(7072),a=r(260).NATIVE_ARRAY_BUFFER_VIEWS,s=n.ArrayBuffer,c=n.Int8Array;e.exports=!a||!o((function(){c(1)}))||!o((function(){new c(-1)}))||!i((function(e){new c,new c(null),new c(1.5),new c(e)}),!0)||o((function(){return 1!==new c(new s(2),1,void 0).length}))},3074:function(e,t,r){var n=r(7745),o=r(6304);e.exports=function(e,t){return n(o(e),t)}},7321:function(e,t,r){var n=r(9974),o=r(6916),i=r(9483),a=r(7908),s=r(6244),c=r(4121),u=r(1246),l=r(7659),d=r(4067),p=r(260).aTypedArrayConstructor,h=r(4599);e.exports=function(e){var t,r,f,m,g,v,E,y,_=i(this),T=a(e),I=arguments.length,O=I>1?arguments[1]:void 0,R=void 0!==O,C=u(T);if(C&&!l(C))for(y=(E=c(T,C)).next,T=[];!(v=o(y,E)).done;)T.push(v.value);for(R&&I>2&&(O=n(O,arguments[2])),r=s(T),f=new(p(_))(r),m=d(f),t=0;r>t;t++)g=R?O(T[t],t):T[t],f[t]=m?h(g):+g;return f}},6304:function(e,t,r){var n=r(260),o=r(6707),i=n.aTypedArrayConstructor,a=n.getTypedArrayConstructor;e.exports=function(e){return i(o(e,a(e)))}},9711:function(e,t,r){var n=r(1702),o=0,i=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},5143:function(e,t,r){var n=r(7293),o=r(5112),i=r(9781),a=r(1913),s=o("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),a&&!e.toJSON||!t.size&&(a||!i)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host}))},3307:function(e,t,r){var n=r(6293);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(e,t,r){var n=r(9781),o=r(7293);e.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8053:function(e){var t=TypeError;e.exports=function(e,r){if(e<r)throw t("Not enough arguments");return e}},4811:function(e,t,r){var n=r(7854),o=r(614),i=n.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},6800:function(e,t,r){var n=r(857),o=r(2597),i=r(6061),a=r(3070).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},6061:function(e,t,r){var n=r(5112);t.f=n},5112:function(e,t,r){var n=r(7854),o=r(2309),i=r(2597),a=r(9711),s=r(6293),c=r(3307),u=n.Symbol,l=o("wks"),d=c?u.for||u:u&&u.withoutSetter||a;e.exports=function(e){return i(l,e)||(l[e]=s&&i(u,e)?u[e]:d("Symbol."+e)),l[e]}},1361:function(e){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},9575:function(e,t,r){"use strict";var n=r(2109),o=r(1470),i=r(7293),a=r(3331),s=r(9670),c=r(1400),u=r(7466),l=r(6707),d=a.ArrayBuffer,p=a.DataView,h=p.prototype,f=o(d.prototype.slice),m=o(h.getUint8),g=o(h.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:i((function(){return!new d(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(f&&void 0===t)return f(s(this),e);for(var r=s(this).byteLength,n=c(e,r),o=c(void 0===t?r:t,r),i=new(l(this,d))(u(o-n)),a=new p(this),h=new p(i),v=0;n<o;)g(h,v++,m(a,n++));return i}})},2222:function(e,t,r){"use strict";var n=r(2109),o=r(7293),i=r(3157),a=r(111),s=r(7908),c=r(6244),u=r(7207),l=r(6135),d=r(5417),p=r(1194),h=r(5112),f=r(7392),m=h("isConcatSpreadable"),g=f>=51||!o((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),v=function(e){if(!a(e))return!1;var t=e[m];return void 0!==t?!!t:i(e)};n({target:"Array",proto:!0,arity:1,forced:!g||!p("concat")},{concat:function(e){var t,r,n,o,i,a=s(this),p=d(a,0),h=0;for(t=-1,n=arguments.length;t<n;t++)if(v(i=-1===t?a:arguments[t]))for(o=c(i),u(h+o),r=0;r<o;r++,h++)r in i&&l(p,h,i[r]);else u(h+1),l(p,h++,i);return p.length=h,p}})},7327:function(e,t,r){"use strict";var n=r(2109),o=r(2092).filter;n({target:"Array",proto:!0,forced:!r(1194)("filter")},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},4553:function(e,t,r){"use strict";var n=r(2109),o=r(2092).findIndex,i=r(1223),a="findIndex",s=!0;a in[]&&Array(1)[a]((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{findIndex:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i(a)},9826:function(e,t,r){"use strict";var n=r(2109),o=r(2092).find,i=r(1223),a="find",s=!0;a in[]&&Array(1)[a]((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i(a)},9554:function(e,t,r){"use strict";var n=r(2109),o=r(8533);n({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},1038:function(e,t,r){var n=r(2109),o=r(8457);n({target:"Array",stat:!0,forced:!r(7072)((function(e){Array.from(e)}))},{from:o})},6699:function(e,t,r){"use strict";var n=r(2109),o=r(1318).includes,i=r(7293),a=r(1223);n({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},2772:function(e,t,r){"use strict";var n=r(2109),o=r(1470),i=r(1318).indexOf,a=r(9341),s=o([].indexOf),c=!!s&&1/s([1],1,-0)<0;n({target:"Array",proto:!0,forced:c||!a("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return c?s(this,e,t)||0:i(this,e,t)}})},9753:function(e,t,r){r(2109)({target:"Array",stat:!0},{isArray:r(3157)})},6992:function(e,t,r){"use strict";var n=r(5656),o=r(1223),i=r(7497),a=r(9909),s=r(3070).f,c=r(1656),u=r(6178),l=r(1913),d=r(9781),p="Array Iterator",h=a.set,f=a.getterFor(p);e.exports=c(Array,"Array",(function(e,t){h(this,{type:p,target:n(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,u(void 0,!0)):u("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values");var m=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!l&&d&&"values"!==m.name)try{s(m,"name",{value:"values"})}catch(e){}},9600:function(e,t,r){"use strict";var n=r(2109),o=r(1702),i=r(8361),a=r(5656),s=r(9341),c=o([].join);n({target:"Array",proto:!0,forced:i!=Object||!s("join",",")},{join:function(e){return c(a(this),void 0===e?",":e)}})},4986:function(e,t,r){var n=r(2109),o=r(6583);n({target:"Array",proto:!0,forced:o!==[].lastIndexOf},{lastIndexOf:o})},1249:function(e,t,r){"use strict";var n=r(2109),o=r(2092).map;n({target:"Array",proto:!0,forced:!r(1194)("map")},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},5827:function(e,t,r){"use strict";var n=r(2109),o=r(3671).left,i=r(9341),a=r(7392);n({target:"Array",proto:!0,forced:!r(5268)&&a>79&&a<83||!i("reduce")},{reduce:function(e){var t=arguments.length;return o(this,e,t,t>1?arguments[1]:void 0)}})},5069:function(e,t,r){"use strict";var n=r(2109),o=r(1702),i=r(3157),a=o([].reverse),s=[1,2];n({target:"Array",proto:!0,forced:String(s)===String(s.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},7042:function(e,t,r){"use strict";var n=r(2109),o=r(3157),i=r(4411),a=r(111),s=r(1400),c=r(6244),u=r(5656),l=r(6135),d=r(5112),p=r(1194),h=r(206),f=p("slice"),m=d("species"),g=Array,v=Math.max;n({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var r,n,d,p=u(this),f=c(p),E=s(e,f),y=s(void 0===t?f:t,f);if(o(p)&&(r=p.constructor,(i(r)&&(r===g||o(r.prototype))||a(r)&&null===(r=r[m]))&&(r=void 0),r===g||void 0===r))return h(p,E,y);for(n=new(void 0===r?g:r)(v(y-E,0)),d=0;E<y;E++,d++)E in p&&l(n,d,p[E]);return n.length=d,n}})},5212:function(e,t,r){"use strict";var n=r(2109),o=r(2092).some;n({target:"Array",proto:!0,forced:!r(9341)("some")},{some:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},561:function(e,t,r){"use strict";var n=r(2109),o=r(7908),i=r(1400),a=r(9303),s=r(6244),c=r(3658),u=r(7207),l=r(5417),d=r(6135),p=r(5117),h=r(1194)("splice"),f=Math.max,m=Math.min;n({target:"Array",proto:!0,forced:!h},{splice:function(e,t){var r,n,h,g,v,E,y=o(this),_=s(y),T=i(e,_),I=arguments.length;for(0===I?r=n=0:1===I?(r=0,n=_-T):(r=I-2,n=m(f(a(t),0),_-T)),u(_+r-n),h=l(y,n),g=0;g<n;g++)(v=T+g)in y&&d(h,g,y[v]);if(h.length=n,r<n){for(g=T;g<_-n;g++)E=g+r,(v=g+n)in y?y[E]=y[v]:p(y,E);for(g=_;g>_-n+r;g--)p(y,g-1)}else if(r>n)for(g=_-n;g>T;g--)E=g+r-1,(v=g+n-1)in y?y[E]=y[v]:p(y,E);for(g=0;g<r;g++)y[g+T]=arguments[g+2];return c(y,_-n+r),h}})},3843:function(e,t,r){var n=r(2109),o=r(1702),i=Date,a=o(i.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return a(new i)}})},3710:function(e,t,r){var n=r(1702),o=r(8052),i=Date.prototype,a="Invalid Date",s="toString",c=n(i[s]),u=n(i.getTime);String(new Date(NaN))!=a&&o(i,s,(function(){var e=u(this);return e==e?c(this):a}))},4812:function(e,t,r){var n=r(2109),o=r(7065);n({target:"Function",proto:!0,forced:Function.bind!==o},{bind:o})},8309:function(e,t,r){var n=r(9781),o=r(6530).EXISTS,i=r(1702),a=r(7045),s=Function.prototype,c=i(s.toString),u=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=i(u.exec);n&&!o&&a(s,"name",{configurable:!0,get:function(){try{return l(u,c(this))[1]}catch(e){return""}}})},8862:function(e,t,r){var n=r(2109),o=r(5005),i=r(2104),a=r(6916),s=r(1702),c=r(7293),u=r(614),l=r(2190),d=r(206),p=r(8044),h=r(6293),f=String,m=o("JSON","stringify"),g=s(/./.exec),v=s("".charAt),E=s("".charCodeAt),y=s("".replace),_=s(1..toString),T=/[\uD800-\uDFFF]/g,I=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,R=!h||c((function(){var e=o("Symbol")();return"[null]"!=m([e])||"{}"!=m({a:e})||"{}"!=m(Object(e))})),C=c((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),N=function(e,t){var r=d(arguments),n=p(t);if(u(n)||void 0!==e&&!l(e))return r[1]=function(e,t){if(u(n)&&(t=a(n,this,f(e),t)),!l(t))return t},i(m,null,r)},S=function(e,t,r){var n=v(r,t-1),o=v(r,t+1);return g(I,e)&&!g(O,o)||g(O,e)&&!g(I,n)?"\\u"+_(E(e,0),16):e};m&&n({target:"JSON",stat:!0,arity:3,forced:R||C},{stringify:function(e,t,r){var n=d(arguments),o=i(R?N:m,null,n);return C&&"string"==typeof o?y(o,T,S):o}})},9098:function(e,t,r){"use strict";r(7710)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(5631))},1532:function(e,t,r){r(9098)},9653:function(e,t,r){"use strict";var n=r(2109),o=r(1913),i=r(9781),a=r(7854),s=r(857),c=r(1702),u=r(4705),l=r(2597),d=r(9587),p=r(7976),h=r(2190),f=r(7593),m=r(7293),g=r(8006).f,v=r(1236).f,E=r(3070).f,y=r(863),_=r(3111).trim,T="Number",I=a[T],O=s[T],R=I.prototype,C=a.TypeError,N=c("".slice),S=c("".charCodeAt),b=u(T,!I(" 0o1")||!I("0b1")||I("+0x1")),A=function(e){var t,r=arguments.length<1?0:I(function(e){var t=f(e,"number");return"bigint"==typeof t?t:function(e){var t,r,n,o,i,a,s,c,u=f(e,"number");if(h(u))throw C("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=_(u),43===(t=S(u,0))||45===t){if(88===(r=S(u,2))||120===r)return NaN}else if(48===t){switch(S(u,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+u}for(a=(i=N(u,2)).length,s=0;s<a;s++)if((c=S(i,s))<48||c>o)return NaN;return parseInt(i,n)}return+u}(t)}(e));return p(R,t=this)&&m((function(){y(t)}))?d(Object(r),this,A):r};A.prototype=R,b&&!o&&(R.constructor=A),n({global:!0,constructor:!0,wrap:!0,forced:b},{Number:A});var M=function(e,t){for(var r,n=i?g(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;n.length>o;o++)l(t,r=n[o])&&!l(e,r)&&E(e,r,v(t,r))};o&&O&&M(s[T],O),(b||o)&&M(s[T],I)},3161:function(e,t,r){r(2109)({target:"Number",stat:!0},{isInteger:r(5988)})},4048:function(e,t,r){r(2109)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},6977:function(e,t,r){"use strict";var n=r(2109),o=r(1702),i=r(9303),a=r(863),s=r(8415),c=r(7293),u=RangeError,l=String,d=Math.floor,p=o(s),h=o("".slice),f=o(1..toFixed),m=function(e,t,r){return 0===t?r:t%2==1?m(e,t-1,r*e):m(e*e,t/2,r)},g=function(e,t,r){for(var n=-1,o=r;++n<6;)o+=t*e[n],e[n]=o%1e7,o=d(o/1e7)},v=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=d(n/t),n=n%t*1e7},E=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=l(e[t]);r=""===r?n:r+p("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:c((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!c((function(){f({})}))},{toFixed:function(e){var t,r,n,o,s=a(this),c=i(e),d=[0,0,0,0,0,0],f="",y="0";if(c<0||c>20)throw u("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return l(s);if(s<0&&(f="-",s=-s),s>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(s*m(2,69,1))-69)<0?s*m(2,-t,1):s/m(2,t,1),r*=4503599627370496,(t=52-t)>0){for(g(d,0,r),n=c;n>=7;)g(d,1e7,0),n-=7;for(g(d,m(10,n,1),0),n=t-1;n>=23;)v(d,1<<23),n-=23;v(d,1<<n),g(d,1,1),v(d,2),y=E(d)}else g(d,0,r),g(d,1<<-t,0),y=E(d)+p("0",c);return c>0?f+((o=y.length)<=c?"0."+p("0",c-o)+y:h(y,0,o-c)+"."+h(y,o-c)):f+y}})},9601:function(e,t,r){var n=r(2109),o=r(1574);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},9070:function(e,t,r){var n=r(2109),o=r(9781),i=r(3070).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!o},{defineProperty:i})},9720:function(e,t,r){var n=r(2109),o=r(4699).entries;n({target:"Object",stat:!0},{entries:function(e){return o(e)}})},9660:function(e,t,r){var n=r(2109),o=r(6293),i=r(7293),a=r(5181),s=r(7908);n({target:"Object",stat:!0,forced:!o||i((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(s(e)):[]}})},7941:function(e,t,r){var n=r(2109),o=r(7908),i=r(1956);n({target:"Object",stat:!0,forced:r(7293)((function(){i(1)}))},{keys:function(e){return i(o(e))}})},1539:function(e,t,r){var n=r(1694),o=r(8052),i=r(288);n||o(Object.prototype,"toString",i,{unsafe:!0})},821:function(e,t,r){"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(8523),s=r(2534),c=r(408);n({target:"Promise",stat:!0,forced:r(612)},{all:function(e){var t=this,r=a.f(t),n=r.resolve,u=r.reject,l=s((function(){var r=i(t.resolve),a=[],s=0,l=1;c(e,(function(e){var i=s++,c=!1;l++,o(r,t,e).then((function(e){c||(c=!0,a[i]=e,--l||n(a))}),u)})),--l||n(a)}));return l.error&&u(l.value),r.promise}})},4164:function(e,t,r){"use strict";var n=r(2109),o=r(1913),i=r(3702).CONSTRUCTOR,a=r(2492),s=r(5005),c=r(614),u=r(8052),l=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(e){return this.then(void 0,e)}}),!o&&c(a)){var d=s("Promise").prototype.catch;l.catch!==d&&u(l,"catch",d,{unsafe:!0})}},3401:function(e,t,r){"use strict";var n,o,i,a=r(2109),s=r(1913),c=r(5268),u=r(7854),l=r(6916),d=r(8052),p=r(7674),h=r(8003),f=r(6340),m=r(9662),g=r(614),v=r(111),E=r(5787),y=r(6707),_=r(261).set,T=r(5948),I=r(842),O=r(2534),R=r(8572),C=r(9909),N=r(2492),S=r(3702),b=r(8523),A="Promise",M=S.CONSTRUCTOR,w=S.REJECTION_EVENT,k=S.SUBCLASSING,U=C.getterFor(A),P=C.set,x=N&&N.prototype,L=N,D=x,j=u.TypeError,G=u.document,B=u.process,H=b.f,F=H,W=!!(G&&G.createEvent&&u.dispatchEvent),q="unhandledrejection",K=function(e){var t;return!(!v(e)||!g(t=e.then))&&t},z=function(e,t){var r,n,o,i=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,d=e.domain;try{s?(a||(2===t.rejection&&Y(t),t.rejection=1),!0===s?r=i:(d&&d.enter(),r=s(i),d&&(d.exit(),o=!0)),r===e.promise?u(j("Promise-chain cycle")):(n=K(r))?l(n,r,c,u):c(r)):u(i)}catch(e){d&&!o&&d.exit(),u(e)}},V=function(e,t){e.notified||(e.notified=!0,T((function(){for(var r,n=e.reactions;r=n.get();)z(r,e);e.notified=!1,t&&!e.rejection&&J(e)})))},X=function(e,t,r){var n,o;W?((n=G.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),u.dispatchEvent(n)):n={promise:t,reason:r},!w&&(o=u["on"+e])?o(n):e===q&&I("Unhandled promise rejection",r)},J=function(e){l(_,u,(function(){var t,r=e.facade,n=e.value;if(Z(e)&&(t=O((function(){c?B.emit("unhandledRejection",n,r):X(q,r,n)})),e.rejection=c||Z(e)?2:1,t.error))throw t.value}))},Z=function(e){return 1!==e.rejection&&!e.parent},Y=function(e){l(_,u,(function(){var t=e.facade;c?B.emit("rejectionHandled",t):X("rejectionhandled",t,e.value)}))},Q=function(e,t,r){return function(n){e(t,n,r)}},$=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,V(e,!0))},ee=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw j("Promise can't be resolved itself");var n=K(t);n?T((function(){var r={done:!1};try{l(n,t,Q(ee,r,e),Q($,r,e))}catch(t){$(r,t,e)}})):(e.value=t,e.state=1,V(e,!1))}catch(t){$({done:!1},t,e)}}};if(M&&(D=(L=function(e){E(this,D),m(e),l(n,this);var t=U(this);try{e(Q(ee,t),Q($,t))}catch(e){$(t,e)}}).prototype,(n=function(e){P(this,{type:A,done:!1,notified:!1,parent:!1,reactions:new R,rejection:!1,state:0,value:void 0})}).prototype=d(D,"then",(function(e,t){var r=U(this),n=H(y(this,L));return r.parent=!0,n.ok=!g(e)||e,n.fail=g(t)&&t,n.domain=c?B.domain:void 0,0==r.state?r.reactions.add(n):T((function(){z(n,r)})),n.promise})),o=function(){var e=new n,t=U(e);this.promise=e,this.resolve=Q(ee,t),this.reject=Q($,t)},b.f=H=function(e){return e===L||void 0===e?new o(e):F(e)},!s&&g(N)&&x!==Object.prototype)){i=x.then,k||d(x,"then",(function(e,t){var r=this;return new L((function(e,t){l(i,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete x.constructor}catch(e){}p&&p(x,D)}a({global:!0,constructor:!0,wrap:!0,forced:M},{Promise:L}),h(L,A,!1,!0),f(A)},8674:function(e,t,r){r(3401),r(821),r(4164),r(6027),r(683),r(6294)},6027:function(e,t,r){"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(8523),s=r(2534),c=r(408);n({target:"Promise",stat:!0,forced:r(612)},{race:function(e){var t=this,r=a.f(t),n=r.reject,u=s((function(){var a=i(t.resolve);c(e,(function(e){o(a,t,e).then(r.resolve,n)}))}));return u.error&&n(u.value),r.promise}})},683:function(e,t,r){"use strict";var n=r(2109),o=r(6916),i=r(8523);n({target:"Promise",stat:!0,forced:r(3702).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return o(t.reject,void 0,e),t.promise}})},6294:function(e,t,r){"use strict";var n=r(2109),o=r(5005),i=r(1913),a=r(2492),s=r(3702).CONSTRUCTOR,c=r(9478),u=o("Promise"),l=i&&!s;n({target:"Promise",stat:!0,forced:i||s},{resolve:function(e){return c(l&&this===u?a:this,e)}})},4916:function(e,t,r){"use strict";var n=r(2109),o=r(2261);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},9714:function(e,t,r){"use strict";var n=r(6530).PROPER,o=r(8052),i=r(9670),a=r(1340),s=r(7293),c=r(4706),u="toString",l=RegExp.prototype[u],d=s((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),p=n&&l.name!=u;(d||p)&&o(RegExp.prototype,u,(function(){var e=i(this);return"/"+a(e.source)+"/"+a(c(e))}),{unsafe:!0})},2023:function(e,t,r){"use strict";var n=r(2109),o=r(1702),i=r(3929),a=r(4488),s=r(1340),c=r(4964),u=o("".indexOf);n({target:"String",proto:!0,forced:!c("includes")},{includes:function(e){return!!~u(s(a(this)),s(i(e)),arguments.length>1?arguments[1]:void 0)}})},8783:function(e,t,r){"use strict";var n=r(8710).charAt,o=r(1340),i=r(9909),a=r(1656),s=r(6178),c="String Iterator",u=i.set,l=i.getterFor(c);a(String,"String",(function(e){u(this,{type:c,string:o(e),index:0})}),(function(){var e,t=l(this),r=t.string,o=t.index;return o>=r.length?s(void 0,!0):(e=n(r,o),t.index+=e.length,s(e,!1))}))},3123:function(e,t,r){"use strict";var n=r(2104),o=r(6916),i=r(1702),a=r(7007),s=r(9670),c=r(8554),u=r(7850),l=r(4488),d=r(6707),p=r(1530),h=r(7466),f=r(1340),m=r(8173),g=r(1589),v=r(7651),E=r(2261),y=r(2999),_=r(7293),T=y.UNSUPPORTED_Y,I=4294967295,O=Math.min,R=[].push,C=i(/./.exec),N=i(R),S=i("".slice),b=!_((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));a("split",(function(e,t,r){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var i=f(l(this)),a=void 0===r?I:r>>>0;if(0===a)return[];if(void 0===e)return[i];if(!u(e))return o(t,i,e,a);for(var s,c,d,p=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),m=0,v=new RegExp(e.source,h+"g");(s=o(E,v,i))&&!((c=v.lastIndex)>m&&(N(p,S(i,m,s.index)),s.length>1&&s.index<i.length&&n(R,p,g(s,1)),d=s[0].length,m=c,p.length>=a));)v.lastIndex===s.index&&v.lastIndex++;return m===i.length?!d&&C(v,"")||N(p,""):N(p,S(i,m)),p.length>a?g(p,0,a):p}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:o(t,this,e,r)}:t,[function(t,r){var n=l(this),a=c(t)?void 0:m(t,e);return a?o(a,t,n,r):o(i,f(n),t,r)},function(e,n){var o=s(this),a=f(e),c=r(i,o,a,n,i!==t);if(c.done)return c.value;var u=d(o,RegExp),l=o.unicode,m=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(T?"g":"y"),g=new u(T?"^(?:"+o.source+")":o,m),E=void 0===n?I:n>>>0;if(0===E)return[];if(0===a.length)return null===v(g,a)?[a]:[];for(var y=0,_=0,R=[];_<a.length;){g.lastIndex=T?0:_;var C,b=v(g,T?S(a,_):a);if(null===b||(C=O(h(g.lastIndex+(T?_:0)),a.length))===y)_=p(a,_,l);else{if(N(R,S(a,y,_)),R.length===E)return R;for(var A=1;A<=b.length-1;A++)if(N(R,b[A]),R.length===E)return R;_=y=C}}return N(R,S(a,y)),R}]}),!b,T)},6755:function(e,t,r){"use strict";var n,o=r(2109),i=r(1470),a=r(1236).f,s=r(7466),c=r(1340),u=r(3929),l=r(4488),d=r(4964),p=r(1913),h=i("".startsWith),f=i("".slice),m=Math.min,g=d("startsWith");o({target:"String",proto:!0,forced:!(!p&&!g&&(n=a(String.prototype,"startsWith"),n&&!n.writable)||g)},{startsWith:function(e){var t=c(l(this));u(e);var r=s(m(arguments.length>1?arguments[1]:void 0,t.length)),n=c(e);return h?h(t,n,r):f(t,r,r+n.length)===n}})},4032:function(e,t,r){"use strict";var n=r(2109),o=r(7854),i=r(6916),a=r(1702),s=r(1913),c=r(9781),u=r(6293),l=r(7293),d=r(2597),p=r(7976),h=r(9670),f=r(5656),m=r(4948),g=r(1340),v=r(9114),E=r(30),y=r(1956),_=r(8006),T=r(1156),I=r(5181),O=r(1236),R=r(3070),C=r(6048),N=r(5296),S=r(8052),b=r(7045),A=r(2309),M=r(6200),w=r(3501),k=r(9711),U=r(5112),P=r(6061),x=r(6800),L=r(6532),D=r(8003),j=r(9909),G=r(2092).forEach,B=M("hidden"),H="Symbol",F="prototype",W=j.set,q=j.getterFor(H),K=Object[F],z=o.Symbol,V=z&&z[F],X=o.TypeError,J=o.QObject,Z=O.f,Y=R.f,Q=T.f,$=N.f,ee=a([].push),te=A("symbols"),re=A("op-symbols"),ne=A("wks"),oe=!J||!J[F]||!J[F].findChild,ie=c&&l((function(){return 7!=E(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Z(K,t);n&&delete K[t],Y(e,t,r),n&&e!==K&&Y(K,t,n)}:Y,ae=function(e,t){var r=te[e]=E(V);return W(r,{type:H,tag:e,description:t}),c||(r.description=t),r},se=function(e,t,r){e===K&&se(re,t,r),h(e);var n=m(t);return h(r),d(te,n)?(r.enumerable?(d(e,B)&&e[B][n]&&(e[B][n]=!1),r=E(r,{enumerable:v(0,!1)})):(d(e,B)||Y(e,B,v(1,{})),e[B][n]=!0),ie(e,n,r)):Y(e,n,r)},ce=function(e,t){h(e);var r=f(t),n=y(r).concat(pe(r));return G(n,(function(t){c&&!i(ue,r,t)||se(e,t,r[t])})),e},ue=function(e){var t=m(e),r=i($,this,t);return!(this===K&&d(te,t)&&!d(re,t))&&(!(r||!d(this,t)||!d(te,t)||d(this,B)&&this[B][t])||r)},le=function(e,t){var r=f(e),n=m(t);if(r!==K||!d(te,n)||d(re,n)){var o=Z(r,n);return!o||!d(te,n)||d(r,B)&&r[B][n]||(o.enumerable=!0),o}},de=function(e){var t=Q(f(e)),r=[];return G(t,(function(e){d(te,e)||d(w,e)||ee(r,e)})),r},pe=function(e){var t=e===K,r=Q(t?re:f(e)),n=[];return G(r,(function(e){!d(te,e)||t&&!d(K,e)||ee(n,te[e])})),n};u||(z=function(){if(p(V,this))throw X("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,t=k(e),r=function(e){this===K&&i(r,re,e),d(this,B)&&d(this[B],t)&&(this[B][t]=!1),ie(this,t,v(1,e))};return c&&oe&&ie(K,t,{configurable:!0,set:r}),ae(t,e)},S(V=z[F],"toString",(function(){return q(this).tag})),S(z,"withoutSetter",(function(e){return ae(k(e),e)})),N.f=ue,R.f=se,C.f=ce,O.f=le,_.f=T.f=de,I.f=pe,P.f=function(e){return ae(U(e),e)},c&&(b(V,"description",{configurable:!0,get:function(){return q(this).description}}),s||S(K,"propertyIsEnumerable",ue,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!u,sham:!u},{Symbol:z}),G(y(ne),(function(e){x(e)})),n({target:H,stat:!0,forced:!u},{useSetter:function(){oe=!0},useSimple:function(){oe=!1}}),n({target:"Object",stat:!0,forced:!u,sham:!c},{create:function(e,t){return void 0===t?E(e):ce(E(e),t)},defineProperty:se,defineProperties:ce,getOwnPropertyDescriptor:le}),n({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:de}),L(),D(z,H),w[B]=!0},1817:function(e,t,r){"use strict";var n=r(2109),o=r(9781),i=r(7854),a=r(1702),s=r(2597),c=r(614),u=r(7976),l=r(1340),d=r(7045),p=r(9920),h=i.Symbol,f=h&&h.prototype;if(o&&c(h)&&(!("description"in f)||void 0!==h().description)){var m={},g=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),t=u(f,this)?new h(e):void 0===e?h():h(e);return""===e&&(m[t]=!0),t};p(g,h),g.prototype=f,f.constructor=g;var v="Symbol(test)"==String(h("test")),E=a(f.valueOf),y=a(f.toString),_=/^Symbol\((.*)\)[^)]+$/,T=a("".replace),I=a("".slice);d(f,"description",{configurable:!0,get:function(){var e=E(this);if(s(m,e))return"";var t=y(e),r=v?I(t,7,-1):T(t,_,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:g})}},763:function(e,t,r){var n=r(2109),o=r(5005),i=r(2597),a=r(1340),s=r(2309),c=r(2015),u=s("string-to-symbol-registry"),l=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{for:function(e){var t=a(e);if(i(u,t))return u[t];var r=o("Symbol")(t);return u[t]=r,l[r]=t,r}})},2165:function(e,t,r){r(6800)("iterator")},2526:function(e,t,r){r(4032),r(763),r(6620),r(8862),r(9660)},6620:function(e,t,r){var n=r(2109),o=r(2597),i=r(2190),a=r(6330),s=r(2309),c=r(2015),u=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{keyFor:function(e){if(!i(e))throw TypeError(a(e)+" is not a symbol");if(o(u,e))return u[e]}})},2990:function(e,t,r){"use strict";var n=r(1702),o=r(260),i=n(r(1048)),a=o.aTypedArray;(0,o.exportTypedArrayMethod)("copyWithin",(function(e,t){return i(a(this),e,t,arguments.length>2?arguments[2]:void 0)}))},8927:function(e,t,r){"use strict";var n=r(260),o=r(2092).every,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},3105:function(e,t,r){"use strict";var n=r(260),o=r(1285),i=r(4599),a=r(648),s=r(6916),c=r(1702),u=r(7293),l=n.aTypedArray,d=n.exportTypedArrayMethod,p=c("".slice);d("fill",(function(e){var t=arguments.length;l(this);var r="Big"===p(a(this),0,3)?i(e):+e;return s(o,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),u((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))},5035:function(e,t,r){"use strict";var n=r(260),o=r(2092).filter,i=r(3074),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",(function(e){var t=o(a(this),e,arguments.length>1?arguments[1]:void 0);return i(this,t)}))},7174:function(e,t,r){"use strict";var n=r(260),o=r(2092).findIndex,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},4345:function(e,t,r){"use strict";var n=r(260),o=r(2092).find,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},2846:function(e,t,r){"use strict";var n=r(260),o=r(2092).forEach,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(e){o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},8145:function(e,t,r){"use strict";var n=r(3832);(0,r(260).exportTypedArrayStaticMethod)("from",r(7321),n)},4731:function(e,t,r){"use strict";var n=r(260),o=r(1318).includes,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},7209:function(e,t,r){"use strict";var n=r(260),o=r(1318).indexOf,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},6319:function(e,t,r){"use strict";var n=r(7854),o=r(7293),i=r(1702),a=r(260),s=r(6992),c=r(5112)("iterator"),u=n.Uint8Array,l=i(s.values),d=i(s.keys),p=i(s.entries),h=a.aTypedArray,f=a.exportTypedArrayMethod,m=u&&u.prototype,g=!o((function(){m[c].call([1])})),v=!!m&&m.values&&m[c]===m.values&&"values"===m.values.name,E=function(){return l(h(this))};f("entries",(function(){return p(h(this))}),g),f("keys",(function(){return d(h(this))}),g),f("values",E,g||!v,{name:"values"}),f(c,E,g||!v,{name:"values"})},8867:function(e,t,r){"use strict";var n=r(260),o=r(1702),i=n.aTypedArray,a=n.exportTypedArrayMethod,s=o([].join);a("join",(function(e){return s(i(this),e)}))},7789:function(e,t,r){"use strict";var n=r(260),o=r(2104),i=r(6583),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return o(i,a(this),t>1?[e,arguments[1]]:[e])}))},3739:function(e,t,r){"use strict";var n=r(260),o=r(2092).map,i=r(6304),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("map",(function(e){return o(a(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(i(e))(t)}))}))},4483:function(e,t,r){"use strict";var n=r(260),o=r(3671).right,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},9368:function(e,t,r){"use strict";var n=r(260),o=r(3671).left,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},2056:function(e,t,r){"use strict";var n=r(260),o=n.aTypedArray,i=n.exportTypedArrayMethod,a=Math.floor;i("reverse",(function(){for(var e,t=this,r=o(t).length,n=a(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t}))},3462:function(e,t,r){"use strict";var n=r(7854),o=r(6916),i=r(260),a=r(6244),s=r(4590),c=r(7908),u=r(7293),l=n.RangeError,d=n.Int8Array,p=d&&d.prototype,h=p&&p.set,f=i.aTypedArray,m=i.exportTypedArrayMethod,g=!u((function(){var e=new Uint8ClampedArray(2);return o(h,e,{length:1,0:3},1),3!==e[1]})),v=g&&i.NATIVE_ARRAY_BUFFER_VIEWS&&u((function(){var e=new d(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));m("set",(function(e){f(this);var t=s(arguments.length>1?arguments[1]:void 0,1),r=c(e);if(g)return o(h,this,r,t);var n=this.length,i=a(r),u=0;if(i+t>n)throw l("Wrong length");for(;u<i;)this[t+u]=r[u++]}),!g||v)},678:function(e,t,r){"use strict";var n=r(260),o=r(6304),i=r(7293),a=r(206),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("slice",(function(e,t){for(var r=a(s(this),e,t),n=o(this),i=0,c=r.length,u=new n(c);c>i;)u[i]=r[i++];return u}),i((function(){new Int8Array(1).slice()})))},7462:function(e,t,r){"use strict";var n=r(260),o=r(2092).some,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},3824:function(e,t,r){"use strict";var n=r(7854),o=r(1470),i=r(7293),a=r(9662),s=r(4362),c=r(260),u=r(8886),l=r(256),d=r(7392),p=r(8008),h=c.aTypedArray,f=c.exportTypedArrayMethod,m=n.Uint16Array,g=m&&o(m.prototype.sort),v=!(!g||i((function(){g(new m(2),null)}))&&i((function(){g(new m(2),{})}))),E=!!g&&!i((function(){if(d)return d<74;if(u)return u<67;if(l)return!0;if(p)return p<602;var e,t,r=new m(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(g(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));f("sort",(function(e){return void 0!==e&&a(e),E?g(this,e):s(h(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!E||v)},5021:function(e,t,r){"use strict";var n=r(260),o=r(7466),i=r(1400),a=r(6304),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",(function(e,t){var r=s(this),n=r.length,c=i(e,n);return new(a(r))(r.buffer,r.byteOffset+c*r.BYTES_PER_ELEMENT,o((void 0===t?n:i(t,n))-c))}))},2974:function(e,t,r){"use strict";var n=r(7854),o=r(2104),i=r(260),a=r(7293),s=r(206),c=n.Int8Array,u=i.aTypedArray,l=i.exportTypedArrayMethod,d=[].toLocaleString,p=!!c&&a((function(){d.call(new c(1))}));l("toLocaleString",(function(){return o(d,p?s(u(this)):u(this),s(arguments))}),a((function(){return[1,2].toLocaleString()!=new c([1,2]).toLocaleString()}))||!a((function(){c.prototype.toLocaleString.call([1,2])})))},5016:function(e,t,r){"use strict";var n=r(260).exportTypedArrayMethod,o=r(7293),i=r(7854),a=r(1702),s=i.Uint8Array,c=s&&s.prototype||{},u=[].toString,l=a([].join);o((function(){u.call({})}))&&(u=function(){return l(this)});var d=c.toString!=u;n("toString",u,d)},2472:function(e,t,r){r(9843)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},4747:function(e,t,r){var n=r(7854),o=r(8324),i=r(8509),a=r(8533),s=r(8880),c=function(e){if(e&&e.forEach!==a)try{s(e,"forEach",a)}catch(t){e.forEach=a}};for(var u in o)o[u]&&c(n[u]&&n[u].prototype);c(i)},3948:function(e,t,r){var n=r(7854),o=r(8324),i=r(8509),a=r(6992),s=r(8880),c=r(5112),u=c("iterator"),l=c("toStringTag"),d=a.values,p=function(e,t){if(e){if(e[u]!==d)try{s(e,u,d)}catch(t){e[u]=d}if(e[l]||s(e,l,t),o[t])for(var r in a)if(e[r]!==a[r])try{s(e,r,a[r])}catch(t){e[r]=a[r]}}};for(var h in o)p(n[h]&&n[h].prototype,h);p(i,"DOMTokenList")},6815:function(e,t,r){var n=r(2109),o=r(7854),i=r(7152)(o.setInterval,!0);n({global:!0,bind:!0,forced:o.setInterval!==i},{setInterval:i})},8417:function(e,t,r){var n=r(2109),o=r(7854),i=r(7152)(o.setTimeout,!0);n({global:!0,bind:!0,forced:o.setTimeout!==i},{setTimeout:i})},2564:function(e,t,r){r(6815),r(8417)},5556:function(e,t,r){"use strict";r(6992);var n=r(2109),o=r(7854),i=r(6916),a=r(1702),s=r(9781),c=r(5143),u=r(8052),l=r(7045),d=r(9190),p=r(8003),h=r(3061),f=r(9909),m=r(5787),g=r(614),v=r(2597),E=r(9974),y=r(648),_=r(9670),T=r(111),I=r(1340),O=r(30),R=r(9114),C=r(4121),N=r(1246),S=r(8053),b=r(5112),A=r(4362),M=b("iterator"),w="URLSearchParams",k=w+"Iterator",U=f.set,P=f.getterFor(w),x=f.getterFor(k),L=Object.getOwnPropertyDescriptor,D=function(e){if(!s)return o[e];var t=L(o,e);return t&&t.value},j=D("fetch"),G=D("Request"),B=D("Headers"),H=G&&G.prototype,F=B&&B.prototype,W=o.RegExp,q=o.TypeError,K=o.decodeURIComponent,z=o.encodeURIComponent,V=a("".charAt),X=a([].join),J=a([].push),Z=a("".replace),Y=a([].shift),Q=a([].splice),$=a("".split),ee=a("".slice),te=/\+/g,re=Array(4),ne=function(e){return re[e-1]||(re[e-1]=W("((?:%[\\da-f]{2}){"+e+"})","gi"))},oe=function(e){try{return K(e)}catch(t){return e}},ie=function(e){var t=Z(e,te," "),r=4;try{return K(t)}catch(e){for(;r;)t=Z(t,ne(r--),oe);return t}},ae=/[!'()~]|%20/g,se={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ce=function(e){return se[e]},ue=function(e){return Z(z(e),ae,ce)},le=h((function(e,t){U(this,{type:k,iterator:C(P(e).entries),kind:t})}),"Iterator",(function(){var e=x(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),de=function(e){this.entries=[],this.url=null,void 0!==e&&(T(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===V(e,0)?ee(e,1):e:I(e)))};de.prototype={type:w,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,o,a,s,c,u=N(e);if(u)for(r=(t=C(e,u)).next;!(n=i(r,t)).done;){if(a=(o=C(_(n.value))).next,(s=i(a,o)).done||(c=i(a,o)).done||!i(a,o).done)throw q("Expected sequence with length 2");J(this.entries,{key:I(s.value),value:I(c.value)})}else for(var l in e)v(e,l)&&J(this.entries,{key:l,value:I(e[l])})},parseQuery:function(e){if(e)for(var t,r,n=$(e,"&"),o=0;o<n.length;)(t=n[o++]).length&&(r=$(t,"="),J(this.entries,{key:ie(Y(r)),value:ie(X(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],J(r,ue(e.key)+"="+ue(e.value));return X(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var pe=function(){m(this,he);var e=U(this,new de(arguments.length>0?arguments[0]:void 0));s||(this.length=e.entries.length)},he=pe.prototype;if(d(he,{append:function(e,t){S(arguments.length,2);var r=P(this);J(r.entries,{key:I(e),value:I(t)}),s||this.length++,r.updateURL()},delete:function(e){S(arguments.length,1);for(var t=P(this),r=t.entries,n=I(e),o=0;o<r.length;)r[o].key===n?Q(r,o,1):o++;s||(this.length=r.length),t.updateURL()},get:function(e){S(arguments.length,1);for(var t=P(this).entries,r=I(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){S(arguments.length,1);for(var t=P(this).entries,r=I(e),n=[],o=0;o<t.length;o++)t[o].key===r&&J(n,t[o].value);return n},has:function(e){S(arguments.length,1);for(var t=P(this).entries,r=I(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){S(arguments.length,1);for(var r,n=P(this),o=n.entries,i=!1,a=I(e),c=I(t),u=0;u<o.length;u++)(r=o[u]).key===a&&(i?Q(o,u--,1):(i=!0,r.value=c));i||J(o,{key:a,value:c}),s||(this.length=o.length),n.updateURL()},sort:function(){var e=P(this);A(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=P(this).entries,n=E(e,arguments.length>1?arguments[1]:void 0),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function(){return new le(this,"keys")},values:function(){return new le(this,"values")},entries:function(){return new le(this,"entries")}},{enumerable:!0}),u(he,M,he.entries,{name:"entries"}),u(he,"toString",(function(){return P(this).serialize()}),{enumerable:!0}),s&&l(he,"size",{get:function(){return P(this).entries.length},configurable:!0,enumerable:!0}),p(pe,w),n({global:!0,constructor:!0,forced:!c},{URLSearchParams:pe}),!c&&g(B)){var fe=a(F.has),me=a(F.set),ge=function(e){if(T(e)){var t,r=e.body;if(y(r)===w)return t=e.headers?new B(e.headers):new B,fe(t,"content-type")||me(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),O(e,{body:R(0,I(r)),headers:R(0,t)})}return e};if(g(j)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return j(e,arguments.length>1?ge(arguments[1]):{})}}),g(G)){var ve=function(e){return m(this,H),new G(e,arguments.length>1?ge(arguments[1]):{})};H.constructor=ve,ve.prototype=H,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ve})}}e.exports={URLSearchParams:pe,getState:P}},1637:function(e,t,r){r(5556)},8789:function(e,t,r){"use strict";r(8783);var n,o=r(2109),i=r(9781),a=r(5143),s=r(7854),c=r(9974),u=r(1702),l=r(8052),d=r(7045),p=r(5787),h=r(2597),f=r(1574),m=r(8457),g=r(1589),v=r(8710).codeAt,E=r(3197),y=r(1340),_=r(8003),T=r(8053),I=r(5556),O=r(9909),R=O.set,C=O.getterFor("URL"),N=I.URLSearchParams,S=I.getState,b=s.URL,A=s.TypeError,M=s.parseInt,w=Math.floor,k=Math.pow,U=u("".charAt),P=u(/./.exec),x=u([].join),L=u(1..toString),D=u([].pop),j=u([].push),G=u("".replace),B=u([].shift),H=u("".split),F=u("".slice),W=u("".toLowerCase),q=u([].unshift),K="Invalid scheme",z="Invalid host",V="Invalid port",X=/[a-z]/i,J=/[\d+-.a-z]/i,Z=/\d/,Y=/^0x/i,Q=/^[0-7]+$/,$=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,re=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,oe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ie=/[\t\n\r]/g,ae=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)q(t,e%256),e=w(e/256);return x(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(t=n,r=o),t}(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=L(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},se={},ce=f({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),ue=f({},ce,{"#":1,"?":1,"{":1,"}":1}),le=f({},ue,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),de=function(e,t){var r=v(e,0);return r>32&&r<127&&!h(t,e)?e:encodeURIComponent(e)},pe={ftp:21,file:null,http:80,https:443,ws:80,wss:443},he=function(e,t){var r;return 2==e.length&&P(X,U(e,0))&&(":"==(r=U(e,1))||!t&&"|"==r)},fe=function(e){var t;return e.length>1&&he(F(e,0,2))&&(2==e.length||"/"===(t=U(e,2))||"\\"===t||"?"===t||"#"===t)},me=function(e){return"."===e||"%2e"===W(e)},ge={},ve={},Ee={},ye={},_e={},Te={},Ie={},Oe={},Re={},Ce={},Ne={},Se={},be={},Ae={},Me={},we={},ke={},Ue={},Pe={},xe={},Le={},De=function(e,t,r){var n,o,i,a=y(e);if(t){if(o=this.parse(a))throw A(o);this.searchParams=null}else{if(void 0!==r&&(n=new De(r,!0)),o=this.parse(a,null,n))throw A(o);(i=S(new N)).bindURL(this),this.searchParams=i}};De.prototype={type:"URL",parse:function(e,t,r){var o,i,a,s,c,u=this,l=t||ge,d=0,p="",f=!1,v=!1,E=!1;for(e=y(e),t||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,e=G(e,ne,""),e=G(e,oe,"$1")),e=G(e,ie,""),o=m(e);d<=o.length;){switch(i=o[d],l){case ge:if(!i||!P(X,i)){if(t)return K;l=Ee;continue}p+=W(i),l=ve;break;case ve:if(i&&(P(J,i)||"+"==i||"-"==i||"."==i))p+=W(i);else{if(":"!=i){if(t)return K;p="",l=Ee,d=0;continue}if(t&&(u.isSpecial()!=h(pe,p)||"file"==p&&(u.includesCredentials()||null!==u.port)||"file"==u.scheme&&!u.host))return;if(u.scheme=p,t)return void(u.isSpecial()&&pe[u.scheme]==u.port&&(u.port=null));p="","file"==u.scheme?l=Ae:u.isSpecial()&&r&&r.scheme==u.scheme?l=ye:u.isSpecial()?l=Oe:"/"==o[d+1]?(l=_e,d++):(u.cannotBeABaseURL=!0,j(u.path,""),l=Pe)}break;case Ee:if(!r||r.cannotBeABaseURL&&"#"!=i)return K;if(r.cannotBeABaseURL&&"#"==i){u.scheme=r.scheme,u.path=g(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,l=Le;break}l="file"==r.scheme?Ae:Te;continue;case ye:if("/"!=i||"/"!=o[d+1]){l=Te;continue}l=Re,d++;break;case _e:if("/"==i){l=Ce;break}l=Ue;continue;case Te:if(u.scheme=r.scheme,i==n)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query=r.query;else if("/"==i||"\\"==i&&u.isSpecial())l=Ie;else if("?"==i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query="",l=xe;else{if("#"!=i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.path.length--,l=Ue;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query=r.query,u.fragment="",l=Le}break;case Ie:if(!u.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,l=Ue;continue}l=Ce}else l=Re;break;case Oe:if(l=Re,"/"!=i||"/"!=U(p,d+1))continue;d++;break;case Re:if("/"!=i&&"\\"!=i){l=Ce;continue}break;case Ce:if("@"==i){f&&(p="%40"+p),f=!0,a=m(p);for(var _=0;_<a.length;_++){var T=a[_];if(":"!=T||E){var I=de(T,le);E?u.password+=I:u.username+=I}else E=!0}p=""}else if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()){if(f&&""==p)return"Invalid authority";d-=m(p).length+1,p="",l=Ne}else p+=i;break;case Ne:case Se:if(t&&"file"==u.scheme){l=we;continue}if(":"!=i||v){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()){if(u.isSpecial()&&""==p)return z;if(t&&""==p&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(p))return s;if(p="",l=ke,t)return;continue}"["==i?v=!0:"]"==i&&(v=!1),p+=i}else{if(""==p)return z;if(s=u.parseHost(p))return s;if(p="",l=be,t==Se)return}break;case be:if(!P(Z,i)){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()||t){if(""!=p){var O=M(p,10);if(O>65535)return V;u.port=u.isSpecial()&&O===pe[u.scheme]?null:O,p=""}if(t)return;l=ke;continue}return V}p+=i;break;case Ae:if(u.scheme="file","/"==i||"\\"==i)l=Me;else{if(!r||"file"!=r.scheme){l=Ue;continue}if(i==n)u.host=r.host,u.path=g(r.path),u.query=r.query;else if("?"==i)u.host=r.host,u.path=g(r.path),u.query="",l=xe;else{if("#"!=i){fe(x(g(o,d),""))||(u.host=r.host,u.path=g(r.path),u.shortenPath()),l=Ue;continue}u.host=r.host,u.path=g(r.path),u.query=r.query,u.fragment="",l=Le}}break;case Me:if("/"==i||"\\"==i){l=we;break}r&&"file"==r.scheme&&!fe(x(g(o,d),""))&&(he(r.path[0],!0)?j(u.path,r.path[0]):u.host=r.host),l=Ue;continue;case we:if(i==n||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&he(p))l=Ue;else if(""==p){if(u.host="",t)return;l=ke}else{if(s=u.parseHost(p))return s;if("localhost"==u.host&&(u.host=""),t)return;p="",l=ke}continue}p+=i;break;case ke:if(u.isSpecial()){if(l=Ue,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=n&&(l=Ue,"/"!=i))continue}else u.fragment="",l=Le;else u.query="",l=xe;break;case Ue:if(i==n||"/"==i||"\\"==i&&u.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(c=W(c=p))||"%2e."===c||".%2e"===c||"%2e%2e"===c?(u.shortenPath(),"/"==i||"\\"==i&&u.isSpecial()||j(u.path,"")):me(p)?"/"==i||"\\"==i&&u.isSpecial()||j(u.path,""):("file"==u.scheme&&!u.path.length&&he(p)&&(u.host&&(u.host=""),p=U(p,0)+":"),j(u.path,p)),p="","file"==u.scheme&&(i==n||"?"==i||"#"==i))for(;u.path.length>1&&""===u.path[0];)B(u.path);"?"==i?(u.query="",l=xe):"#"==i&&(u.fragment="",l=Le)}else p+=de(i,ue);break;case Pe:"?"==i?(u.query="",l=xe):"#"==i?(u.fragment="",l=Le):i!=n&&(u.path[0]+=de(i,se));break;case xe:t||"#"!=i?i!=n&&("'"==i&&u.isSpecial()?u.query+="%27":u.query+="#"==i?"%23":de(i,se)):(u.fragment="",l=Le);break;case Le:i!=n&&(u.fragment+=de(i,ce))}d++}},parseHost:function(e){var t,r,n;if("["==U(e,0)){if("]"!=U(e,e.length-1))return z;if(t=function(e){var t,r,n,o,i,a,s,c=[0,0,0,0,0,0,0,0],u=0,l=null,d=0,p=function(){return U(e,d)};if(":"==p()){if(":"!=U(e,1))return;d+=2,l=++u}for(;p();){if(8==u)return;if(":"!=p()){for(t=r=0;r<4&&P(ee,p());)t=16*t+M(p(),16),d++,r++;if("."==p()){if(0==r)return;if(d-=r,u>6)return;for(n=0;p();){if(o=null,n>0){if(!("."==p()&&n<4))return;d++}if(!P(Z,p()))return;for(;P(Z,p());){if(i=M(p(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;d++}c[u]=256*c[u]+o,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==p()){if(d++,!p())return}else if(p())return;c[u++]=t}else{if(null!==l)return;d++,l=++u}}if(null!==l)for(a=u-l,u=7;0!=u&&a>0;)s=c[u],c[u--]=c[l+a-1],c[l+--a]=s;else if(8!=u)return;return c}(F(e,1,-1)),!t)return z;this.host=t}else if(this.isSpecial()){if(e=E(e),P(te,e))return z;if(t=function(e){var t,r,n,o,i,a,s,c=H(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(o=c[n]))return e;if(i=10,o.length>1&&"0"==U(o,0)&&(i=P(Y,o)?16:8,o=F(o,8==i?1:2)),""===o)a=0;else{if(!P(10==i?$:8==i?Q:ee,o))return e;a=M(o,i)}j(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=k(256,5-t))return null}else if(a>255)return null;for(s=D(r),n=0;n<r.length;n++)s+=r[n]*k(256,3-n);return s}(e),null===t)return z;this.host=t}else{if(P(re,e))return z;for(t="",r=m(e),n=0;n<r.length;n++)t+=de(r[n],se);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return h(pe,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&he(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,o=e.host,i=e.port,a=e.path,s=e.query,c=e.fragment,u=t+":";return null!==o?(u+="//",e.includesCredentials()&&(u+=r+(n?":"+n:"")+"@"),u+=ae(o),null!==i&&(u+=":"+i)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+x(a,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw A(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new je(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+ae(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(y(e)+":",ge)},getUsername:function(){return this.username},setUsername:function(e){var t=m(y(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=de(t[r],le)}},getPassword:function(){return this.password},setPassword:function(e){var t=m(y(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=de(t[r],le)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ae(e):ae(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ne)},getHostname:function(){var e=this.host;return null===e?"":ae(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Se)},getPort:function(){var e=this.port;return null===e?"":y(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=y(e))?this.port=null:this.parse(e,be))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+x(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,ke))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=y(e))?this.query=null:("?"==U(e,0)&&(e=F(e,1)),this.query="",this.parse(e,xe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=y(e))?("#"==U(e,0)&&(e=F(e,1)),this.fragment="",this.parse(e,Le)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var je=function(e){var t=p(this,Ge),r=T(arguments.length,1)>1?arguments[1]:void 0,n=R(t,new De(e,!1,r));i||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},Ge=je.prototype,Be=function(e,t){return{get:function(){return C(this)[e]()},set:t&&function(e){return C(this)[t](e)},configurable:!0,enumerable:!0}};if(i&&(d(Ge,"href",Be("serialize","setHref")),d(Ge,"origin",Be("getOrigin")),d(Ge,"protocol",Be("getProtocol","setProtocol")),d(Ge,"username",Be("getUsername","setUsername")),d(Ge,"password",Be("getPassword","setPassword")),d(Ge,"host",Be("getHost","setHost")),d(Ge,"hostname",Be("getHostname","setHostname")),d(Ge,"port",Be("getPort","setPort")),d(Ge,"pathname",Be("getPathname","setPathname")),d(Ge,"search",Be("getSearch","setSearch")),d(Ge,"searchParams",Be("getSearchParams")),d(Ge,"hash",Be("getHash","setHash"))),l(Ge,"toJSON",(function(){return C(this).serialize()}),{enumerable:!0}),l(Ge,"toString",(function(){return C(this).serialize()}),{enumerable:!0}),b){var He=b.createObjectURL,Fe=b.revokeObjectURL;He&&l(je,"createObjectURL",c(He,b)),Fe&&l(je,"revokeObjectURL",c(Fe,b))}_(je,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:je})},285:function(e,t,r){r(8789)},3720:function(e){e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var o={},i={};function a(e,t){var r,n,a;return t?(a=0<=(e>>>=0)&&e<256)&&(n=i[e])?n:(r=c(e,(0|e)<0?-1:0,!0),a&&(i[e]=r),r):(a=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=c(e,e<0?-1:0,!1),a&&(o[e]=r),r)}function s(e,t){if(isNaN(e))return t?v:g;if(t){if(e<0)return v;if(e>=h)return I}else{if(e<=-f)return O;if(e+1>=f)return T}return e<0?s(-e,t).neg():c(e%p|0,e/p|0,t)}function c(e,t,n){return new r(e,t,n)}r.fromInt=a,r.fromNumber=s,r.fromBits=c;var u=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var o=s(u(r,8)),i=g,a=0;a<e.length;a+=8){var c=Math.min(8,e.length-a),d=parseInt(e.substring(a,a+c),r);if(c<8){var p=s(u(r,c));i=i.mul(p).add(s(d))}else i=(i=i.mul(o)).add(s(d))}return i.unsigned=t,i}function d(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?l(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=d;var p=4294967296,h=p*p,f=h/2,m=a(1<<24),g=a(0);r.ZERO=g;var v=a(0,!0);r.UZERO=v;var E=a(1);r.ONE=E;var y=a(1,!0);r.UONE=y;var _=a(-1);r.NEG_ONE=_;var T=c(-1,2147483647,!1);r.MAX_VALUE=T;var I=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=I;var O=c(0,-2147483648,!1);r.MIN_VALUE=O;var R=r.prototype;R.toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},R.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(O)){var t=s(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var o=s(u(e,6),this.unsigned),i=this,a="";;){var c=i.div(o),l=(i.sub(c.mul(o)).toInt()>>>0).toString(e);if((i=c).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},R.isZero=function(){return 0===this.high&&0===this.low},R.eqz=R.isZero,R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return 1==(1&this.low)},R.isEven=function(){return 0==(1&this.low)},R.equals=function(e){return n(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.ne=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.le=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.ge=R.greaterThanOrEqual,R.compare=function(e){if(n(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&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},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(E)},R.neg=R.negate,R.add=function(e){n(e)||(e=d(e));var t=this.high>>>16,r=65535&this.high,o=this.low>>>16,i=65535&this.low,a=e.high>>>16,s=65535&e.high,u=e.low>>>16,l=0,p=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,p+=(h+=o+u)>>>16,l+=(p+=r+s)>>>16,l+=t+a,c((h&=65535)<<16|(f&=65535),(l&=65535)<<16|(p&=65535),this.unsigned)},R.subtract=function(e){return n(e)||(e=d(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){if(this.isZero())return g;if(n(e)||(e=d(e)),t)return c(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(O))return e.isOdd()?O:g;if(e.eq(O))return this.isOdd()?O:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,o=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,l=65535&e.high,p=e.low>>>16,h=65535&e.low,f=0,v=0,E=0,y=0;return E+=(y+=a*h)>>>16,v+=(E+=i*h)>>>16,E&=65535,v+=(E+=a*p)>>>16,f+=(v+=o*h)>>>16,v&=65535,f+=(v+=i*p)>>>16,v&=65535,f+=(v+=a*l)>>>16,f+=r*h+o*p+i*l+a*u,c((E&=65535)<<16|(y&=65535),(f&=65535)<<16|(v&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(e){if(n(e)||(e=d(e)),e.isZero())throw Error("division by zero");var r,o,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?v:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return v;if(e.gt(this.shru(1)))return y;i=v}else{if(this.eq(O))return e.eq(E)||e.eq(_)?O:e.eq(O)?E:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?E:_:(o=this.sub(e.mul(r)),i=r.add(o.div(e)));if(e.eq(O))return this.unsigned?v: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();i=g}for(o=this;o.gte(e);){r=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),l=a<=48?1:u(2,a-48),p=s(r),h=p.mul(e);h.isNegative()||h.gt(o);)h=(p=s(r-=l,this.unsigned)).mul(e);p.isZero()&&(p=E),i=i.add(p),o=o.sub(h)}return i},R.div=R.divide,R.modulo=function(e){return n(e)||(e=d(e)),t?c((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.rem=R.modulo,R.not=function(){return c(~this.low,~this.high,this.unsigned)},R.and=function(e){return n(e)||(e=d(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return n(e)||(e=d(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return n(e)||(e=d(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.shr_u=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},R.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},3281:function(e,t,r){"use strict";e.exports=r(9050)},2967:function(e){"use strict";e.exports=n;var t,r=/\/|\./;function n(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),n[e]=t}n("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),n("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),n("timestamp",{Timestamp:t}),n("empty",{Empty:{fields:{}}}),n("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),n("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),n("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),n.get=function(e){return n[e]||null}},3996:function(e,t,r){"use strict";var n=t,o=r(7025),i=r(9935);function a(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof o){e("switch(d%s){",n);for(var i=t.resolvedType.values,a=Object.keys(i),s=0;s<a.length;++s)t.repeated&&i[a[s]]===t.typeDefault&&e("default:"),e("case%j:",a[s])("case %i:",i[a[s]])("m%s=%j",n,i[a[s]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function s(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof o?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var s=t[n].resolve(),c=i.safeProp(s.name);s.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),a(r,s,n,c+"[ks[i]]")("}")("}")):s.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),a(r,s,n,c+"[i]")("}")("}")):(s.resolvedType instanceof o||r("if(d%s!=null){",c),a(r,s,n,c),s.resolvedType instanceof o||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var r=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],a=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?n:t[u].map?a:c).push(t[u]);if(n.length){for(r("if(o.arrays||o.defaults){"),u=0;u<n.length;++u)r("d%s=[]",i.safeProp(n[u].name));r("}")}if(a.length){for(r("if(o.objects||o.defaults){"),u=0;u<a.length;++u)r("d%s={}",i.safeProp(a[u].name));r("}")}if(c.length){for(r("if(o.defaults){"),u=0;u<c.length;++u){var l=c[u],d=i.safeProp(l.name);if(l.resolvedType instanceof o)r("d%s=o.enums===String?%j:%j",d,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",d)("}else")("d%s=o.longs===String?%j:%i",d,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var p="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",d,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",d,p)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",d,d)("}")}else r("d%s=%j",d,l.typeDefault)}r("}")}var h=!1;for(u=0;u<t.length;++u){l=t[u];var f=e._fieldsArray.indexOf(l);d=i.safeProp(l.name),l.map?(h||(h=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",d,d)("d%s={}",d)("for(var j=0;j<ks2.length;++j){"),s(r,l,f,d+"[ks2[j]]")("}")):l.repeated?(r("if(m%s&&m%s.length){",d,d)("d%s=[]",d)("for(var j=0;j<m%s.length;++j){",d),s(r,l,f,d+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",d,l.name),s(r,l,f,d),l.partOf&&r("if(o.oneofs)")("d%s=%j",i.safeProp(l.partOf.name),l.name)),r("}")}return r("return d")}},5305:function(e,t,r){"use strict";e.exports=function(e){var t=i.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var s=e._fieldsArray[r].resolve(),c=s.resolvedType instanceof n?"int32":s.type,u="m"+i.safeProp(s.name);t("case %i:",s.id),s.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==o.defaults[s.keyType]?t("k=%j",o.defaults[s.keyType]):t("k=null"),void 0!==o.defaults[c]?t("value=%j",o.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===o.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==o.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):s.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==o.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===o.basic[c]?t(s.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,c)):void 0===o.basic[c]?t(s.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var l=e._fieldsArray[r];l.required&&t("if(!m.hasOwnProperty(%j))",l.name)("throw util.ProtocolError(%j,{instance:m})",a(l))}return t("return m")};var n=r(7025),o=r(7063),i=r(9935);function a(e){return"missing required '"+e.name+"'"}},4928:function(e,t,r){"use strict";e.exports=function(e){for(var t,r=i.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(i.compareFieldsById),c=0;c<s.length;++c){var u=s[c].resolve(),l=e._fieldsArray.indexOf(u),d=u.resolvedType instanceof n?"int32":u.type,p=o.basic[d];t="m"+i.safeProp(u.name),u.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|o.mapKey[u.keyType],u.keyType),void 0===p?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",l,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|p,d,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==o.packed[d]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",d,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===p?a(r,u,l,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|p)>>>0,d,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===p?a(r,u,l,t):r("w.uint32(%i).%s(%s)",(u.id<<3|p)>>>0,d,t))}return r("return w")};var n=r(7025),o=r(7063),i=r(9935);function a(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},7025:function(e,t,r){"use strict";e.exports=a;var n=r(3243);((a.prototype=Object.create(n.prototype)).constructor=a).className="Enum";var o=r(9313),i=r(9935);function a(e,t,r,o,i){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=i||{},this.reserved=void 0,t)for(var a=Object.keys(t),s=0;s<a.length;++s)"number"==typeof t[a[s]]&&(this.valuesById[this.values[a[s]]=t[a[s]]]=a[s])}a.fromJSON=function(e,t){var r=new a(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},a.prototype.add=function(e,t,r){if(!i.isString(e))throw TypeError("name must be a string");if(!i.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},a.prototype.remove=function(e){if(!i.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},a.prototype.isReservedId=function(e){return o.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return o.isReservedName(this.reserved,e)}},3548:function(e,t,r){"use strict";e.exports=u;var n=r(3243);((u.prototype=Object.create(n.prototype)).constructor=u).className="Field";var o,i=r(7025),a=r(7063),s=r(9935),c=/^required|optional|repeated$/;function u(e,t,r,o,i,u,l){if(s.isObject(o)?(l=i,u=o,o=i=void 0):s.isObject(i)&&(l=u,u=i,i=void 0),n.call(this,e,u),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(r))throw TypeError("type must be a string");if(void 0!==o&&!c.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!s.isString(i))throw TypeError("extend must be a string");"proto3_optional"===o&&(o="optional"),this.rule=o&&"optional"!==o?o:void 0,this.type=r,this.id=t,this.extend=i||void 0,this.required="required"===o,this.optional=!this.required,this.repeated="repeated"===o,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&void 0!==a.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=l}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=a.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof o?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof i&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof i)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof o&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},u.d=function(e,t,r,n){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"==typeof t&&(t=s.decorateEnum(t).name),function(o,i){s.decorateType(o.constructor).add(new u(i,e,t,r,{default:n}))}},u._configure=function(e){o=e}},8836:function(e,t,r){"use strict";var n=e.exports=r(9482);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(4928),n.decoder=r(5305),n.verifier=r(4497),n.converter=r(3996),n.ReflectionObject=r(3243),n.Namespace=r(9313),n.Root=r(9424),n.Enum=r(7025),n.Type=r(7645),n.Field=r(3548),n.OneOf=r(7598),n.MapField=r(6039),n.Service=r(7513),n.Method=r(4429),n.Message=r(8368),n.wrappers=r(1667),n.types=r(7063),n.util=r(9935),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},9482:function(e,t,r){"use strict";var n=t;function o(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(1173),n.BufferWriter=r(3155),n.Reader=r(1408),n.BufferReader=r(593),n.util=r(9693),n.rpc=r(5994),n.roots=r(5054),n.configure=o,o()},9050:function(e,t,r){"use strict";var n=e.exports=r(8836);n.build="full",n.tokenize=r(626),n.parse=r(2228),n.common=r(2967),n.Root._configure(n.Type,n.parse,n.common)},6039:function(e,t,r){"use strict";e.exports=a;var n=r(3548);((a.prototype=Object.create(n.prototype)).constructor=a).className="MapField";var o=r(7063),i=r(9935);function a(e,t,r,o,a,s){if(n.call(this,e,t,o,void 0,void 0,a,s),!i.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===o.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,r){return"function"==typeof r?r=i.decorateType(r).name:r&&"object"==typeof r&&(r=i.decorateEnum(r).name),function(n,o){i.decorateType(n.constructor).add(new a(o,e,t,r))}}},8368:function(e,t,r){"use strict";e.exports=o;var n=r(9693);function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.create=function(e){return this.$type.create(e)},o.encode=function(e,t){return this.$type.encode(e,t)},o.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},o.decode=function(e){return this.$type.decode(e)},o.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},o.verify=function(e){return this.$type.verify(e)},o.fromObject=function(e){return this.$type.fromObject(e)},o.toObject=function(e,t){return this.$type.toObject(e,t)},o.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},4429:function(e,t,r){"use strict";e.exports=i;var n=r(3243);((i.prototype=Object.create(n.prototype)).constructor=i).className="Method";var o=r(9935);function i(e,t,r,i,a,s,c,u,l){if(o.isObject(a)?(c=a,a=s=void 0):o.isObject(s)&&(c=s,s=void 0),void 0!==t&&!o.isString(t))throw TypeError("type must be a string");if(!o.isString(r))throw TypeError("requestType must be a string");if(!o.isString(i))throw TypeError("responseType must be a string");n.call(this,e,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!a||void 0,this.responseType=i,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=l}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},9313:function(e,t,r){"use strict";e.exports=d;var n=r(3243);((d.prototype=Object.create(n.prototype)).constructor=d).className="Namespace";var o,i,a,s=r(3548),c=r(7598),u=r(9935);function l(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function d(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function p(e){return e._nestedArray=null,e}d.fromJSON=function(e,t){return new d(e,t.options).addJSON(t.nested)},d.arrayToJSON=l,d.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},d.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(d.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),d.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},d.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?o.fromJSON:void 0!==t.values?a.fromJSON:void 0!==t.methods?i.fromJSON:void 0!==t.id?s.fromJSON:d.fromJSON)(r[n],t));return this},d.prototype.get=function(e){return this.nested&&this.nested[e]||null},d.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof a)return this.nested[e].values;throw Error("no such enum: "+e)},d.prototype.add=function(e){if(!(e instanceof s&&void 0!==e.extend||e instanceof o||e instanceof a||e instanceof i||e instanceof d||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof d&&e instanceof d)||t instanceof o||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),p(this)},d.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),p(this)},d.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof d))throw Error("path conflicts with non-namespace objects")}else r.add(r=new d(n))}return t&&r.addJSON(t),r},d.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof d?e[t++].resolveAll():e[t++].resolve();return this.resolve()},d.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof d&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var o=0;o<this.nestedArray.length;++o)if(this._nestedArray[o]instanceof d&&(n=this._nestedArray[o].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},d.prototype.lookupType=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such type: "+e);return t},d.prototype.lookupEnum=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},d.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[o,a]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},d.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},d._configure=function(e,t,r){o=e,i=t,a=r}},3243:function(e,t,r){"use strict";e.exports=i,i.className="ReflectionObject";var n,o=r(9935);function i(e,t){if(!o.isString(e))throw TypeError("name must be a string");if(t&&!o.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(i.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),i.prototype.toJSON=function(){throw Error()},i.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},i.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},i.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},i.prototype.getOption=function(e){if(this.options)return this.options[e]},i.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},i.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var i=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var a=i[e];o.setProperty(a,r,t)}else(i={})[e]=o.setProperty({},r,t),n.push(i)}else{var s={};s[e]=t,n.push(s)}return this},i.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},i.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},i._configure=function(e){n=e}},7598:function(e,t,r){"use strict";e.exports=a;var n=r(3243);((a.prototype=Object.create(n.prototype)).constructor=a).className="OneOf";var o=r(3548),i=r(9935);function a(e,t,r,o){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=o}function s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},a.prototype.add=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,s(this),this},a.prototype.remove=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}s(this)},a.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},a.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){i.decorateType(t.constructor).add(new a(r,e)),Object.defineProperty(t,r,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}},2228:function(e,t,r){"use strict";e.exports=R,R.filename=null,R.defaults={keepCase:!1};var n=r(626),o=r(9424),i=r(7645),a=r(3548),s=r(6039),c=r(7598),u=r(7025),l=r(7513),d=r(4429),p=r(7063),h=r(9935),f=/^[1-9][0-9]*$/,m=/^-?[1-9][0-9]*$/,g=/^0[x][0-9a-fA-F]+$/,v=/^-?0[x][0-9a-fA-F]+$/,E=/^0[0-7]+$/,y=/^-?0[0-7]+$/,_=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,T=/^[a-zA-Z_][a-zA-Z_0-9]*$/,I=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,O=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function R(e,t,r){t instanceof o||(r=t,t=new o),r||(r=R.defaults);var C,N,S,b,A,M=r.preferTrailingComment||!1,w=n(e,r.alternateCommentMode||!1),k=w.next,U=w.push,P=w.peek,x=w.skip,L=w.cmnt,D=!0,j=!1,G=t,B=r.keepCase?function(e){return e}:h.camelCase;function H(e,t,r){var n=R.filename;return r||(R.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+w.line+")")}function F(){var e,t=[];do{if('"'!==(e=k())&&"'"!==e)throw H(e);t.push(k()),x(e),e=P()}while('"'===e||"'"===e);return t.join("")}function W(e){var t=k();switch(t){case"'":case'"':return U(t),F();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;switch("-"===e.charAt(0)&&(r=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(f.test(e))return r*parseInt(e,10);if(g.test(e))return r*parseInt(e,16);if(E.test(e))return r*parseInt(e,8);if(_.test(e))return r*parseFloat(e);throw H(e,"number",!0)}(t)}catch(r){if(e&&I.test(t))return t;throw H(t,"value")}}function q(e,t){var r,n;do{!t||'"'!==(r=P())&&"'"!==r?e.push([n=K(k()),x("to",!0)?K(k()):n]):e.push(F())}while(x(",",!0));x(";")}function K(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw H(e,"id");if(m.test(e))return parseInt(e,10);if(v.test(e))return parseInt(e,16);if(y.test(e))return parseInt(e,8);throw H(e,"id")}function z(){if(void 0!==C)throw H("package");if(C=k(),!I.test(C))throw H(C,"name");G=G.define(C),x(";")}function V(){var e,t=P();switch(t){case"weak":e=S||(S=[]),k();break;case"public":k();default:e=N||(N=[])}t=F(),x(";"),e.push(t)}function X(){if(x("="),b=F(),!(j="proto3"===b)&&"proto2"!==b)throw H(b,"syntax");x(";")}function J(e,t){switch(t){case"option":return Q(e,t),x(";"),!0;case"message":return function(e,t){if(!T.test(t=k()))throw H(t,"type name");var r=new i(t);Z(r,(function(e){if(!J(r,e))switch(e){case"map":!function(e){x("<");var t=k();if(void 0===p.mapKey[t])throw H(t,"type");x(",");var r=k();if(!I.test(r))throw H(r,"type");x(">");var n=k();if(!T.test(n))throw H(n,"name");x("=");var o=new s(B(n),K(k()),t,r);Z(o,(function(e){if("option"!==e)throw H(e);Q(o,e),x(";")}),(function(){te(o)})),e.add(o)}(r);break;case"required":case"repeated":Y(r,e);break;case"optional":Y(r,j?"proto3_optional":"optional");break;case"oneof":!function(e,t){if(!T.test(t=k()))throw H(t,"name");var r=new c(B(t));Z(r,(function(e){"option"===e?(Q(r,e),x(";")):(U(e),Y(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":q(r.extensions||(r.extensions=[]));break;case"reserved":q(r.reserved||(r.reserved=[]),!0);break;default:if(!j||!I.test(e))throw H(e);U(e),Y(r,"optional")}})),e.add(r)}(e,t),!0;case"enum":return function(e,t){if(!T.test(t=k()))throw H(t,"name");var r=new u(t);Z(r,(function(e){switch(e){case"option":Q(r,e),x(";");break;case"reserved":q(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!T.test(t))throw H(t,"name");x("=");var r=K(k(),!0),n={};Z(n,(function(e){if("option"!==e)throw H(e);Q(n,e),x(";")}),(function(){te(n)})),e.add(t,r,n.comment)}(r,e)}})),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!T.test(t=k()))throw H(t,"service name");var r=new l(t);Z(r,(function(e){if(!J(r,e)){if("rpc"!==e)throw H(e);!function(e,t){var r=L(),n=t;if(!T.test(t=k()))throw H(t,"name");var o,i,a,s,c=t;if(x("("),x("stream",!0)&&(i=!0),!I.test(t=k()))throw H(t);if(o=t,x(")"),x("returns"),x("("),x("stream",!0)&&(s=!0),!I.test(t=k()))throw H(t);a=t,x(")");var u=new d(c,n,o,a,i,s);u.comment=r,Z(u,(function(e){if("option"!==e)throw H(e);Q(u,e),x(";")})),e.add(u)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!I.test(t=k()))throw H(t,"reference");var r=t;Z(null,(function(t){switch(t){case"required":case"repeated":Y(e,t,r);break;case"optional":Y(e,j?"proto3_optional":"optional",r);break;default:if(!j||!I.test(t))throw H(t);U(t),Y(e,"optional",r)}}))}(e,t),!0}return!1}function Z(e,t,r){var n=w.line;if(e&&("string"!=typeof e.comment&&(e.comment=L()),e.filename=R.filename),x("{",!0)){for(var o;"}"!==(o=k());)t(o);x(";",!0)}else r&&r(),x(";"),e&&("string"!=typeof e.comment||M)&&(e.comment=L(n)||e.comment)}function Y(e,t,r){var n=k();if("group"!==n){if(!I.test(n))throw H(n,"type");var o=k();if(!T.test(o))throw H(o,"name");o=B(o),x("=");var s=new a(o,K(k()),n,t,r);if(Z(s,(function(e){if("option"!==e)throw H(e);Q(s,e),x(";")}),(function(){te(s)})),"proto3_optional"===t){var u=new c("_"+o);s.setOption("proto3_optional",!0),u.add(s),e.add(u)}else e.add(s);j||!s.repeated||void 0===p.packed[n]&&void 0!==p.basic[n]||s.setOption("packed",!1,!0)}else!function(e,t){var r=k();if(!T.test(r))throw H(r,"name");var n=h.lcFirst(r);r===n&&(r=h.ucFirst(r)),x("=");var o=K(k()),s=new i(r);s.group=!0;var c=new a(n,o,r,t);c.filename=R.filename,Z(s,(function(e){switch(e){case"option":Q(s,e),x(";");break;case"required":case"repeated":Y(s,e);break;case"optional":Y(s,j?"proto3_optional":"optional");break;default:throw H(e)}})),e.add(s).add(c)}(e,t)}function Q(e,t){var r=x("(",!0);if(!I.test(t=k()))throw H(t,"name");var n,o=t,i=o;r&&(x(")"),i=o="("+o+")",t=P(),O.test(t)&&(n=t.substr(1),o+=t,k())),x("="),function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,i,$(e,o),n)}function $(e,t){if(x("{",!0)){for(var r={};!x("}",!0);){if(!T.test(A=k()))throw H(A,"name");var n,o=A;"{"===P()?n=$(e,t+"."+A):(x(":"),"{"===P()?n=$(e,t+"."+A):(n=W(!0),ee(e,t+"."+A,n)));var i=r[o];i&&(n=[].concat(i).concat(n)),r[o]=n,x(",",!0)}return r}var a=W(!0);return ee(e,t,a),a}function ee(e,t,r){e.setOption&&e.setOption(t,r)}function te(e){if(x("[",!0)){do{Q(e,"option")}while(x(",",!0));x("]")}return e}for(;null!==(A=k());)switch(A){case"package":if(!D)throw H(A);z();break;case"import":if(!D)throw H(A);V();break;case"syntax":if(!D)throw H(A);X();break;case"option":Q(G,A),x(";");break;default:if(J(G,A)){D=!1;continue}throw H(A)}return R.filename=null,{package:C,imports:N,weakImports:S,syntax:b,root:t}}},1408:function(e,t,r){"use strict";e.exports=c;var n,o=r(9693),i=o.LongBits,a=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},d=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new n(e):l(e)})(e)}:l};function p(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw s(this,8);return new i(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=d(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){n=e,c.create=d(),n._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},593:function(e,t,r){"use strict";e.exports=i;var n=r(1408);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(9693);function i(e){n.call(this,e)}i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},9424:function(e,t,r){"use strict";e.exports=d;var n=r(9313);((d.prototype=Object.create(n.prototype)).constructor=d).className="Root";var o,i,a,s=r(3548),c=r(7025),u=r(7598),l=r(9935);function d(e){n.call(this,"",e),this.deferred=[],this.files=[]}function p(){}d.fromJSON=function(e,t){return t||(t=new d),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=l.path.resolve,d.prototype.fetch=l.fetch,d.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var o=this;if(!n)return l.asPromise(e,o,t,r);var s=n===p;function c(e,t){if(n){var r=n;if(n=null,s)throw e;r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in a)return r}return null}function d(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){i.filename=e;var n,a=i(t,o,r),d=0;if(a.imports)for(;d<a.imports.length;++d)(n=u(a.imports[d])||o.resolvePath(e,a.imports[d]))&&h(n);if(a.weakImports)for(d=0;d<a.weakImports.length;++d)(n=u(a.weakImports[d])||o.resolvePath(e,a.weakImports[d]))&&h(n,!0)}else o.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}s||f||c(null,o)}function h(e,t){if(!(o.files.indexOf(e)>-1))if(o.files.push(e),e in a)s?d(e,a[e]):(++f,setTimeout((function(){--f,d(e,a[e])})));else if(s){var r;try{r=l.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}d(e,r)}else++f,o.fetch(e,(function(r,i){--f,n&&(r?t?f||c(null,o):c(r):d(e,i))}))}var f=0;l.isString(t)&&(t=[t]);for(var m,g=0;g<t.length;++g)(m=o.resolvePath("",t[g]))&&h(m);if(s)return o;f||c(null,o)},d.prototype.loadSync=function(e,t){if(!l.isNode)throw Error("not supported");return this.load(e,t,p)},d.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return n.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function f(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new s(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.declaringField=t,t.extensionField=n,r.add(n),!0}return!1}d.prototype._handleAdd=function(e){if(e instanceof s)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof c)h.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof o)for(var t=0;t<this.deferred.length;)f(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);h.test(e.name)&&(e.parent[e.name]=e)}},d.prototype._handleRemove=function(e){if(e instanceof s){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);h.test(e.name)&&delete e.parent[e.name]}},d._configure=function(e,t,r){o=e,i=t,a=r}},5054:function(e){"use strict";e.exports={}},5994:function(e,t,r){"use strict";t.Service=r(7948)},7948:function(e,t,r){"use strict";e.exports=o;var n=r(9693);function o(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(o.prototype=Object.create(n.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,r,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,o,i);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,r){if(e)return s.emit("error",e,t),a(e);if(null!==r){if(!(r instanceof o))try{r=o[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7513:function(e,t,r){"use strict";e.exports=s;var n=r(9313);((s.prototype=Object.create(n.prototype)).constructor=s).className="Service";var o=r(4429),i=r(9935),a=r(5994);function s(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var r=new s(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),i=0;i<n.length;++i)r.add(o.fromJSON(n[i],t.methods[n[i]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},s.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return i.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},s.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},s.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof o?(this.methods[e.name]=e,e.parent=this,c(this)):n.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof o){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return n.prototype.remove.call(this,e)},s.prototype.create=function(e,t,r){for(var n,o=new a.Service(e,t,r),s=0;s<this.methodsArray.length;++s){var c=i.lcFirst((n=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");o[c]=i.codegen(["r","c"],i.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return o}},626:function(e){"use strict";e.exports=d;var t=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,n=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,o=/^ *[*/]+ */,i=/^\s*\*?\/*/,a=/\n/g,s=/\s/,c=/\\(.?)/g,u={0:"\0",r:"\r",n:"\n",t:"\t"};function l(e){return e.replace(c,(function(e,t){switch(t){case"\\":case"":return t;default:return u[t]||""}}))}function d(e,c){e=e.toString();var u=0,d=e.length,p=1,h=null,f=null,m=0,g=!1,v=!1,E=[],y=null;function _(e){return Error("illegal "+e+" (line "+p+")")}function T(t){return e.charAt(t)}function I(t,r,n){h=e.charAt(t++),m=p,g=!1,v=n;var s,u=t-(c?2:3);do{if(--u<0||"\n"===(s=e.charAt(u))){g=!0;break}}while(" "===s||"\t"===s);for(var l=e.substring(t,r).split(a),d=0;d<l.length;++d)l[d]=l[d].replace(c?i:o,"").trim();f=l.join("\n").trim()}function O(t){var r=R(t),n=e.substring(t,r);return/^\s*\/{1,2}/.test(n)}function R(e){for(var t=e;t<d&&"\n"!==T(t);)t++;return t}function C(){if(E.length>0)return E.shift();if(y)return function(){var t="'"===y?n:r;t.lastIndex=u-1;var o=t.exec(e);if(!o)throw _("string");return u=t.lastIndex,N(y),y=null,l(o[1])}();var o,i,a,h,f,m=0===u;do{if(u===d)return null;for(o=!1;s.test(a=T(u));)if("\n"===a&&(m=!0,++p),++u===d)return null;if("/"===T(u)){if(++u===d)throw _("comment");if("/"===T(u))if(c){if(h=u,f=!1,O(u)){f=!0;do{if((u=R(u))===d)break;u++}while(O(u))}else u=Math.min(d,R(u)+1);f&&I(h,u,m),p++,o=!0}else{for(f="/"===T(h=u+1);"\n"!==T(++u);)if(u===d)return null;++u,f&&I(h,u-1,m),++p,o=!0}else{if("*"!==(a=T(u)))return"/";h=u+1,f=c||"*"===T(h);do{if("\n"===a&&++p,++u===d)throw _("comment");i=a,a=T(u)}while("*"!==i||"/"!==a);++u,f&&I(h,u-2,m),o=!0}}}while(o);var g=u;if(t.lastIndex=0,!t.test(T(g++)))for(;g<d&&!t.test(T(g));)++g;var v=e.substring(u,u=g);return'"'!==v&&"'"!==v||(y=v),v}function N(e){E.push(e)}function S(){if(!E.length){var e=C();if(null===e)return null;N(e)}return E[0]}return Object.defineProperty({next:C,peek:S,push:N,skip:function(e,t){var r=S();if(r===e)return C(),!0;if(!t)throw _("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t=null;return void 0===e?m===p-1&&(c||"*"===h||g)&&(t=v?f:null):(m<e&&S(),m!==e||g||!c&&"/"!==h||(t=v?null:f)),t}},"line",{get:function(){return p}})}d.unescape=l},7645:function(e,t,r){"use strict";e.exports=E;var n=r(9313);((E.prototype=Object.create(n.prototype)).constructor=E).className="Type";var o=r(7025),i=r(7598),a=r(3548),s=r(6039),c=r(7513),u=r(8368),l=r(1408),d=r(1173),p=r(9935),h=r(4928),f=r(5305),m=r(4497),g=r(3996),v=r(1667);function E(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function y(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(E.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=p.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=p.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=E.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,p.merge(e.prototype,t)),e.$type=e.prototype.$type=this,p.merge(e,u,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:p.oneOfGetter(this._oneofsArray[r].oneof),set:p.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),E.generateConstructor=function(e){for(var t,r=p.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",p.safeProp(t.name)):t.repeated&&r("this%s=[]",p.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},E.fromJSON=function(e,t){var r=new E(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var u=Object.keys(t.fields),l=0;l<u.length;++l)r.add((void 0!==t.fields[u[l]].keyType?s.fromJSON:a.fromJSON)(u[l],t.fields[u[l]]));if(t.oneofs)for(u=Object.keys(t.oneofs),l=0;l<u.length;++l)r.add(i.fromJSON(u[l],t.oneofs[u[l]]));if(t.nested)for(u=Object.keys(t.nested),l=0;l<u.length;++l){var d=t.nested[u[l]];r.add((void 0!==d.id?a.fromJSON:void 0!==d.fields?E.fromJSON:void 0!==d.values?o.fromJSON:void 0!==d.methods?c.fromJSON:n.fromJSON)(u[l],d))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},E.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return p.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},E.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},E.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},E.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof a&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),y(this)}return e instanceof i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),y(this)):n.prototype.add.call(this,e)},E.prototype.remove=function(e){if(e instanceof a&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),y(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),y(this)}return n.prototype.remove.call(this,e)},E.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},E.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},E.prototype.create=function(e){return new this.ctor(e)},E.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=h(this)({Writer:d,types:t,util:p}),this.decode=f(this)({Reader:l,types:t,util:p}),this.verify=m(this)({types:t,util:p}),this.fromObject=g.fromObject(this)({types:t,util:p}),this.toObject=g.toObject(this)({types:t,util:p});var n=v[e];if(n){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(o),o.toObject=this.toObject,this.toObject=n.toObject.bind(o)}return this},E.prototype.encode=function(e,t){return this.setup().encode(e,t)},E.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},E.prototype.decode=function(e,t){return this.setup().decode(e,t)},E.prototype.decodeDelimited=function(e){return e instanceof l||(e=l.create(e)),this.decode(e,e.uint32())},E.prototype.verify=function(e){return this.setup().verify(e)},E.prototype.fromObject=function(e){return this.setup().fromObject(e)},E.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},E.d=function(e){return function(t){p.decorateType(t,e)}}},7063:function(e,t,r){"use strict";var n=t,o=r(9935),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function a(e,t){var r=0,n={};for(t|=0;r<e.length;)n[i[r+t]]=e[r++];return n}n.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",o.emptyArray,null]),n.long=a([0,0,0,1,1],7),n.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=a([1,5,0,0,0,5,5,0,0,0,1,1,0])},9935:function(e,t,r){"use strict";var n,o,i=e.exports=r(9693),a=r(5054);i.codegen=r(5124),i.fetch=r(9054),i.path=r(8626),i.fs=i.inquire("fs"),i.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},i.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],o=e[r++];void 0!==o&&(t[n]=o)}return t};var s=/\\/g,c=/"/g;i.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},i.safeProp=function(e){return!/^[$\w_]+$/.test(e)||i.isReserved(e)?'["'+e.replace(s,"\\\\").replace(c,'\\"')+'"]':"."+e},i.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;i.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},i.compareFieldsById=function(e,t){return e.id-t.id},i.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(i.decorateRoot.remove(e.$type),e.$type.name=t,i.decorateRoot.add(e.$type)),e.$type;n||(n=r(7645));var o=new n(t||e.name);return i.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,"$type",{value:o,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:o,enumerable:!1}),o};var l=0;i.decorateEnum=function(e){if(e.$type)return e.$type;o||(o=r(7025));var t=new o("Enum"+l++,e);return i.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},i.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var o=r.shift();if("__proto__"===o)return t;if(r.length>0)t[o]=e(t[o]||{},r,n);else{var i=t[o];i&&(n=[].concat(i).concat(n)),t[o]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(i,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(r(9424)))}})},1945:function(e,t,r){"use strict";e.exports=o;var n=r(9693);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=o.zero=new o(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new o(r,n)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(n.isString(e)){if(!n.Long)return o.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):i},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;o.fromHash=function(e){return e===a?i:new o((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},9693:function(e,t,r){"use strict";var n=t;function o(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)void 0!==e[n[o]]&&r||(e[n[o]]=t[n[o]]);return e}function i(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&o(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}n.asPromise=r(4537),n.base64=r(7419),n.EventEmitter=r(9211),n.float=r(945),n.inquire=r(7199),n.utf8=r(4997),n.pool=r(6662),n.LongBits=r(1945),n.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=o,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=i,n.ProtocolError=i("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},4497:function(e,t,r){"use strict";e.exports=function(e){var t=o.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var c=e._fieldsArray[n].resolve(),u="m"+o.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",i(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),s(t,c,"k[i]"),a(t,c,n,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",i(c,"array"))("for(var i=0;i<%s.length;++i){",u),a(t,c,n,u+"[i]")("}");else{if(c.partOf){var l=o.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",l)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",l)}a(t,c,n,u)}c.optional&&t("}")}return t("return null")};var n=r(7025),o=r(9935);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,r,o){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",o)("default:")("return%j",i(t,"enum value"));for(var a=Object.keys(t.resolvedType.values),s=0;s<a.length;++s)e("case %i:",t.resolvedType.values[a[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,o)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",o)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',o)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',o)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",o)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",i(t,"buffer"))}return e}function s(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",i(t,"boolean key"))}return e}},1667:function(e,t,r){"use strict";var n=t,o=r(8368);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(n);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof o){var a=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),a["@type"]=n,a}return this.toObject(e,t)}}},1173:function(e,t,r){"use strict";e.exports=d;var n,o=r(9693),i=o.LongBits,a=o.base64,s=o.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(d.create=function(){return new n})()}:function(){return new d}};function h(e,t,r){t[r]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function g(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}d.create=p(),d.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(d.alloc=o.pool(d.alloc,o.Array.prototype.subarray)),d.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,i.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=i.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(h,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var v=o.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var r=d.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(v,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(h,1,0)},d.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},d._configure=function(e){n=e,d.create=p(),n._configure()}},3155:function(e,t,r){"use strict";e.exports=i;var n=r(1173);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(9693);function i(){n.call(this)}function a(e,t,r){e.length<40?o.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}i._configure=function(){i.alloc=o._Buffer_allocUnsafe,i.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},i.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.amdO={},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};return function(){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:function(){return he}});var e=__webpack_require__(3281),t=__webpack_require__.n(e),r=__webpack_require__(3720),n=__webpack_require__.n(r),o=(__webpack_require__(9601),__webpack_require__(1539),__webpack_require__(8674),__webpack_require__(2526),__webpack_require__(1817),__webpack_require__(2165),__webpack_require__(6992),__webpack_require__(8783),__webpack_require__(3948),__webpack_require__(8309),__webpack_require__(3843),__webpack_require__(3710),__webpack_require__(7327),__webpack_require__(6755),__webpack_require__(1532),__webpack_require__(4812),__webpack_require__(9070),__webpack_require__(7941),__webpack_require__(2222),__webpack_require__(9575),__webpack_require__(2472),__webpack_require__(2990),__webpack_require__(8927),__webpack_require__(3105),__webpack_require__(5035),__webpack_require__(4345),__webpack_require__(7174),__webpack_require__(2846),__webpack_require__(4731),__webpack_require__(7209),__webpack_require__(6319),__webpack_require__(8867),__webpack_require__(7789),__webpack_require__(3739),__webpack_require__(9368),__webpack_require__(4483),__webpack_require__(2056),__webpack_require__(3462),__webpack_require__(678),__webpack_require__(7462),__webpack_require__(3824),__webpack_require__(5021),__webpack_require__(2974),__webpack_require__(5016),__webpack_require__(5827),__webpack_require__(2564),__webpack_require__(9653),__webpack_require__(9554),__webpack_require__(4747),__webpack_require__(6699),__webpack_require__(2023),__webpack_require__(7252)),i=__webpack_require__(4024),a=__webpack_require__(4998),s=__webpack_require__(5531),c=__webpack_require__(6424),u=__webpack_require__(7360),l=["onTextMessage","onFileMessage","onAudioMessage","onVideoMessage","onImageMessage","onLocationMessage","onCustomMessage","onCMDMessage"],d=function(){function e(e,t,r){this.handlerData={},this.handlerData={},e.addEventHandler=this.addEventHandler.bind(this),e.removeEventHandler=this.removeEventHandler.bind(this)}return e.prototype.addEventHandler=function(e,t){this.handlerData[e]=t},e.prototype.removeEventHandler=function(e){delete this.handlerData[e]},e.prototype.dispatch=function(e,t){for(var r in l.includes(e)&&t?u.kg.debug("dispatch event: "+e,{id:t.id,type:t.type,time:t.time,from:t.from,to:t.to,chatType:t.chatType}):"onMessage"===e?u.kg.debug("dispatch event: "+e,null==t?void 0:t.length):u.kg.debug("dispatch event: "+e,t||""),this.handlerData){var n=this.handlerData[r][e];n&&n(t)}},e}(),p=function(){};function h(e){this.onOpened=e.onOpened||p,this.onPresence=e.onPresence||p,this.onTextMessage=e.onTextMessage||p,this.onPictureMessage=e.onPictureMessage||p,this.onAudioMessage=e.onAudioMessage||p,this.onVideoMessage=e.onVideoMessage||p,this.onFileMessage=e.onFileMessage||p,this.onLocationMessage=e.onLocationMessage||p,this.onCmdMessage=e.onCmdMessage||p,this.onCustomMessage=e.onCustomMessage||p,this.onReceivedMessage=e.onReceivedMessage||p,this.onDeliveredMessage=e.onDeliveredMessage||p,this.onReadMessage=e.onReadMessage||p,this.onRecallMessage=e.onRecallMessage||p,this.onChannelMessage=e.onChannelMessage||p,this.onError=e.onError||p,this.onOffline=e.onOffline||p,this.onOnline=e.onOnline||p,this.onStatisticMessage=e.onStatisticMessage||p,this.onContactInvited=e.onContactInvited||p,this.onContactAgreed=e.onContactAgreed||p,this.onContactRefuse=e.onContactRefuse||p,this.onContactDeleted=e.onContactDeleted||p,this.onContactAdded=e.onContactAdded||p,this.onTokenWillExpire=e.onTokenWillExpire||p,this.onTokenExpired=e.onTokenExpired||p,this.onClosed=e.onClosed||p,this.onPresenceStatusChange=e.onPresenceStatusChange||p}__webpack_require__(2772);var f={biz:"",debug:!1,token:""},m="https://data-reporting.agora.io/report",g="https://data-reporting.sh.agoralab.co/report",v=__webpack_require__(2071),E=__webpack_require__(1595),y=function(e){var t=Number(E.C8[e]);return t===E.C8.USER_LOGIN?"MANUALLOGIN":t===E.C8.MSYNC_SENDMESSAGE?"SENDMESSAGE":t>E.C8.UNKNOWOPERATION&&t<E.C8.REST_OPERATE?"REST":t>E.C8.REST_OPERATE&&t<E.C8.MSYNC_OPERATE?"MESSAGE":t>E.C8.MSYNC_OPERATE&&t<E.C8.ROSTER_OPERATE?"ROSTER":t>E.C8.ROSTER_OPERATE&&t<E.C8.USER_OPERATE?"USER":t>E.C8.USER_OPERATE&&t<E.C8.GROUP_OPERATE?"GROUP":t>E.C8.GROUP_OPERATE&&t<E.C8.CHATROOM_OPERATE?"CHATROOM":"OPERATION"},_=function(){return(new Date).getTime()},T=function(e){return[i.iw.BAIDU,i.iw.WX,i.iw.DD,i.iw.ZFB,i.iw.TT,i.iw.QUICK_APP,i.iw.UNI].includes(e.platform)},I=function(){return e=1,t=99999,e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e;var e,t},O=__webpack_require__(4319),R={},C=(__webpack_require__(561),__webpack_require__(1249),function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}),N=1e3,S=function(){function e(e){this.eventQueue=[],this.stock=N,this.config=e,this.governor()}return e.prototype.add=function(e){this.stock<=0?console.warn("Event Report limit ".concat(N," per minute")):(this.eventQueue.push(e),this.consume(),this.stock-=1)},e.prototype.consume=function(){var e=this;0!==this.eventQueue.length&&(this.timer&&this.eventQueue.length<=10&&clearTimeout(this.timer),this.timer=setTimeout((function(){var t,r=e.eventQueue.splice(0,10),n=r.filter((function(e){return e.appId===r[0].appId})),o=r.filter((function(e){return e.appId!==r[0].appId}));(t=e.eventQueue).unshift.apply(t,o),e.batchSend(n)}),1e3))},e.prototype.governor=function(){var e=this,t=setInterval((function(){e.stock=N}),6e4);"undefined"!=typeof addEventListener&&addEventListener("beforeunload",(function(){clearInterval(t)}))},e.prototype.batchSend=function(e){var t,r;if(void 0===e&&(e=[]),0!==e.length)try{var n=e.map((function(e){e.biz,e.appId;var t=e.eventId,r=C(e,["biz","appId","eventId"]);return{eventId:Number(t),body:r}}));!function(e,t){try{var r=t.biz,n=t.appId,o=t.data,a=t.debug,s=t.onSuccess;if(!r)throw new Error("biz is not defined");R.global||(R=i.P6.getEnvInfo());var c=R;if(T(c)){var u={url:a?g:m,data:o,method:"POST",timeout:O.zj,success:function(){null==s||s()},fail:function(){},complete:function(){}},l={token:e,appid:null!=n?n:"",sendts:"".concat(Math.floor((new Date).getTime()/1e3)),biz:r,debug:"".concat(a)};if("zfb"===c.platform||"dd"===c.platform?u.headers=l:u.header=l,"dd"===c.platform)return c.global.httpRequest(u);c.global.request(u)}else{var d=new XMLHttpRequest;d.onreadystatechange=function(){2===d.readyState&&(null==s||s())},d.open("POST",a?g:m),d.setRequestHeader("Content-Type","application/json"),d.setRequestHeader("token",e),d.setRequestHeader("appid",null!=n?n:""),d.setRequestHeader("sendts","".concat(Math.floor((new Date).getTime()/1e3))),d.setRequestHeader("biz",r),d.setRequestHeader("debug","".concat(a)),d.send(JSON.stringify(o))}}catch(e){console.error(e)}}(this.config.token,{biz:null===(t=e[0])||void 0===t?void 0:t.biz,appId:null===(r=e[0])||void 0===r?void 0:r.appId,data:n,debug:this.config.debug,onSuccess:this.consume.bind(this)})}catch(e){console.error(e)}},e}(),b=function(){return b=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},b.apply(this,arguments)},A=new(function(){function e(e){this.inited=!1,this.appId="",this.biz="",this.eventQueue={},this.config=f,e&&this.init(e)}return e.prototype.init=function(e){var t;if(void 0===e&&(e={}),!e.biz||!e.token)throw new Error("Event Report: biz or token is not defined");try{this.appId=null!==(t=e.appId)&&void 0!==t?t:"",this.biz=e.biz,this.config=b(b({},f),e),this.eventQueue=new S(this.config),this.log(e),this.inited=!0}catch(e){console.error(e)}},e.prototype.updateAppId=function(e){this.appId=e},e.prototype.send=function(e,t,r){var n;if(void 0===t&&(t={}),this.inited){var o=b(b({},t),{eventId:Number(e),biz:this.biz,appId:null!==(n=null==r?void 0:r.appId)&&void 0!==n?n:this.appId});this.eventQueue.add(o),this.log(o)}else console.error("Event Report: init is not called")},e.prototype.log=function(e){try{if(this.config.debug){var t=e.payload,r=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["payload"]);console.log("%c Event Report: ".concat(this.config.biz," "),"background: #8A97FC; color: #fff"),console.table(r),t&&(console.info("payload:"),console.table(t))}}catch(e){console.error(e)}},e}()),M=function(){return M=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},M.apply(this,arguments)},w={requestName:"",subrequestid:"1",requestMethod:"GET",requestUrl:"",requestElapse:0,code:0,codeDesc:"",isLastApi:0,isSuccess:1},k=function(){function e(e){this.platform=i.P6.getEnvInfo(),this.isReportDt=e.isReport||!1,this.isCollectDt=!0,T(this.platform)&&!this.isReportDt&&(this.isCollectDt=!1),this.eventQueue=[],this.accessChannel=v.yK,this.options=function(e,t){t.platform||(t=i.P6.getEnvInfo());var r=e.org,n=e.appkey,o=e.deviceId,a=e.sdkVersion,s="undefined"!=typeof navigator?null===navigator||void 0===navigator?void 0:navigator.userAgent:"".concat(t.platform,"_mini_program");return{org:r,appkey:n,deviceId:o,sdkServiceId:"sid_".concat(i.P6.getUniqueId(),"_").concat(I()),did:s,sdkVersion:a,os:v.Wc,sdkProduct:E.aC.web}}(e,this.platform),this.sid=this.options.sdkServiceId,this.init(e)}return e.getInstance=function(t){return e.instance||(e.instance=new e(t)),e.instance},e.prototype.getServiceId=function(){return this.sid||"sid_0"},e.prototype.setIsReportDt=function(e){this.isReportDt=e,e&&this.rptEventQueue()},e.prototype.setIsCollectDt=function(e){this.isCollectDt=e,e||(this.eventQueue=[])},e.prototype.rptEventQueue=function(){var e=this;this.eventQueue.length&&this.eventQueue.forEach((function(t,r){A.send(t.eventId,t.dt),r>=e.eventQueue.length-1&&(e.eventQueue=[])}))},e.prototype.init=function(t){e.instance||(e.instance=this,A.init({biz:v.el,token:v.$x,appId:t.appkey,debug:!1}),this.reportInit())},e.prototype.updateAppKey=function(e){this.options.appkey=e,this.eventQueue.forEach((function(t){"default#appkey"===t.dt.appkey&&(t.dt.appkey=e)}))},e.prototype.reportInit=function(){if(this.isCollectDt){var e=this.options,t=e.did,r=e.os,n=e.sdkVersion,o=e.deviceId;this.reportData(v.iB.INIT,{did:t,os:r,sdkVersion:n,deviceId:o})}},e.prototype.geOperateFun=function(e){var t=this;if(!this.isCollectDt)return function(){};var r=1,n=0,o="",a=_(),s=e.uid,c=e.operationName;s&&(this.uid=s);var u={uid:this.uid,operationId:"opr_".concat(i.P6.getUniqueId(),"_").concat(I()),requestid:"req_".concat(i.P6.getUniqueId(),"_").concat(I()),operationName:c};return function(e){var s,l,d,p;if(e.data.isSuccess?(n=0,o=""):(0===e.data.code&&(e.data.code=v.Tp),n=null!==(s=e.data.code)&&void 0!==s?s:n,o=null!==(l=e.data.codeDesc)&&void 0!==l?l:o),(null===(d=e.data)||void 0===d?void 0:d.accessChannel)&&(t.accessChannel=null===(p=e.data)||void 0===p?void 0:p.accessChannel),e.isRetry?(r++,e.data.subrequestid="".concat(r)):(u.requestid="req_".concat(i.P6.getUniqueId(),"_").concat(I()),r=1),e.data.isLastApi){var h=_();e.data.requestElapse=h-a,e.data.requestMethod="",e.data.subrequestid="0",e.data.code=200===n?0:n,e.data.codeDesc=o}else e.data.requestName||(e.data.requestName=c);e.data.requestElapse||(e.data.requestElapse=_()-a),t.reportData.call(t,v.iB.API,M(M(M(M({},w),u),e.data),{accessChannel:t.accessChannel,operationType:y(c)})),e.isEndApi&&t.reportData.call(t,v.iB.API,M(M(M({},u),w),{isSuccess:e.data.isSuccess,isLastApi:1,subrequestid:"0",requestMethod:"",code:200===n?0:n,codeDesc:o,requestElapse:e.data.requestElapse,accessChannel:t.accessChannel,operationType:y(c)}))}},e.prototype.reportData=function(e,t){return r=this,n=void 0,a=function(){var r,n,o,a,s,c,u,l;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),r=_(),n=0,e!==v.iB.API?[3,2]:[4,(p=this.platform,new Promise((function(e){var t;p.platform||(p=i.P6.getEnvInfo());var r="";if(p.platform===i.iw.WEB){var n=navigator.connection;(null==n?void 0:n.type)?(null==n||n.type,r=E.td.WIFI):(null==n?void 0:n.effectiveType)&&(r=E.td[n.effectiveType.toLocaleUpperCase()]),e(r)}else p.platform===i.iw.NODE?(r=E.td.UNKNOWN,e(r)):null===(t=p.global)||void 0===t||t.getNetworkType({success:function(t){r=E.td[t.networkType.toLocaleUpperCase()],e(r)}})})))];case 1:n=d.sent(),d.label=2;case 2:return o=this.options,a=o.appkey,s=o.sdkServiceId,c=o.sdkProduct,u=M({lts:r,net:n,appkey:a,sdkServiceId:s,sdkProduct:c},t),this.isReportDt?A.send(e,u):this.isCollectDt&&this.eventQueue.push({eventId:e,dt:u}),[3,4];case 3:return l=d.sent(),console.warn(l),[3,4];case 4:return[2]}var p}))},new((o=void 0)||(o=Promise))((function(e,t){function i(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(i,s)}c((a=a.apply(r,n||[])).next())}));var r,n,o,a},e}(),U=__webpack_require__(7288),P=__webpack_require__(7479),x=__webpack_require__(2856),L=__webpack_require__(9667),D=__webpack_require__(3770),j=__webpack_require__(1735),G=__webpack_require__(7384),B=__webpack_require__(70),H=__webpack_require__(8161);function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}var W=function(){return W=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},W.apply(this,arguments)},q=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},K=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},z=i.P6.getEnvInfo(),V={CLOSED:3,CLOSING:2,CONNECTING:0,OPEN:1},X=function(){function e(t){var r,n=this;if(this.name="connection",this.appKey="",this.dnsTotal=0,this.max_cache_length=100,this._reportLogs=!1,this._reportInterval=O.XV,this._isLogging=!1,this._initWithAppId=!1,this.lastHeartbeat=Date.now(),this.isDebug=t.isDebug||!1,this.isReport=!1,this.uploadPartEnable=!0,this.isHttpDNS=void 0===t.isHttpDNS||t.isHttpDNS,this.heartBeatWait=t.heartBeatWait||O.al,this.autoReconnectNumMax=t.autoReconnectNumMax||O.ke,this.refreshDNSIntervals=this.autoReconnectNumMax<5?this.autoReconnectNumMax:5,this.delivery=t.delivery||!1,this.disconnectedReason=void 0,this.loginInfoCustomExt=void 0,this.https=i.P6.isUseHttps(t.https),this.dnsArr=["https://rs.easemob.com","https://rs.chat.agora.io","http://59.110.89.59","http://39.97.193.190","http://39.97.193.187"].filter((function(e){return e.startsWith(n.https?"https":"")})),this.dnsIndex=0,this.restHosts=[],this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.socketHost=[],this.hostTotal=0,this.times=1,this.autoReconnectNumTotal=0,this.domain="easemob.com",this.dnsTotal=this.dnsArr.length,"appKey"in t&&(this.appKey=t.appKey),"appId"in t&&(this.appId=t.appId,this._initWithAppId=!0),this.appName="",this.orgName="",this.token="",this.grantType="",this.apiUrl=t.apiUrl||"",this.url=t.url||"",this.version="4.12.1",this.deviceId=t.deviceId||"webim",this.isFixedDeviceId=null===(r=t.isFixedDeviceId)||void 0===r||r,this.osType=16,this.useOwnUploadFun=t.useOwnUploadFun||!1,this.compressType=[0],this.encryptType=[0],this.clientResource="",this.expiresIn=0,this.expirationTime=0,this.useReplacedMessageContents=t.useReplacedMessageContents||!1,this.logOut=!0,this.context={jid:{appKey:"",clientResource:"",domain:"easemob.com",name:""},userId:"",appKey:"",appId:"",status:0,restTokenData:"",appName:"",orgName:"",root:{},accessToken:""},this._msgHash={},this._msgPromiseHash={},this._queues=[],this._load_msg_cache=[],this.unMSyncSendMsgMap=new Map,this.mr_cache={},this.reconnecting=!1,this._offlineMessagePullState=a.a.SYNC_INIT,this._offlineMessagePullQueue=[],this.uniPushConfig={},this.uniPush=null,this.isRegisterPush=!1,this.pushCertificateName="",this._initWithAppId){if(this.appKey="","string"!=typeof this.appId||!this.appId)throw Error("Invalid appId: ".concat(this.appId))}else{if("string"!=typeof this.appKey||2!==this.appKey.split("#").length)throw Error("Invalid appKey: ".concat(this.appKey));this.devInfos=this.appKey.split("#"),this.orgName=this.devInfos[0],this.appName=this.devInfos[1]}this.listen=h.bind(this),this.mSync=this.usePlugin(c.ZP),this.eventHandler=this.usePlugin(d),Object.assign(e.prototype,P),Object.assign(e.prototype,x),Object.assign(e.prototype,L),Object.assign(e.prototype,D),Object.assign(e.prototype,j),Object.assign(e.prototype,G),Object.assign(e.prototype,B),this.dataReport=new k({appkey:this.appKey||"default#appkey",org:this.orgName,sdkVersion:this.version,deviceId:this.deviceId,isReport:this.isReport});var o=0,s=this;if(Object.defineProperty(i.P6,"ajaxUnconventionalErrorTimes",{set:function(e){0!==e&&(u.kg.debug("rest api request fail times: ".concat(e)),(o=e)%5==0&&s.isHttpDNS&&(u.kg.debug("refresh dns config when rest request fail."),ae.call(s,(function(){}))))},get:function(){return o}}),this.isFixedDeviceId){var l=i.P6.getLocalDeviceInfo();l&&(this.clientResource=JSON.parse(l).deviceId)}u.kg.debug("init SDK: Conn ".concat(this.version," ").concat(z.platform))}return e.prototype.usePlugin=function(e,t){if("push"!==t)return t?void(this[t]=new e(this)):new e(this);e.config&&e.emPush?(this.uniPushConfig=e.config,this.uniPush=e.emPush):u.kg.error("use push plugin failed","emPush",this.uniPush,"config",this.uniPushConfig)},e.prototype.listen=function(e){},e.prototype.addEventHandler=function(e,t){},e.prototype.removeEventHandler=function(e){},e.prototype.registerUser=function(e){return q(this,void 0,void 0,(function(){var t,r;return K(this,(function(n){switch(n.label){case 0:if(!e.username||!e.password)throw Error("Invalid parameter");n.label=1;case 1:return n.trys.push([1,5,,6]),t=this.dataReport.geOperateFun({uid:e.username,operationName:E.fI.REGISTER}),this.isHttpDNS?(this.dnsIndex=0,[4,ae.call(this,t)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[4,Z.call(this,e,{rpt:t})];case 4:return[2,n.sent()];case 5:throw r=n.sent(),e.error&&e.error(r),r;case 6:return[2]}}))}))},e.prototype.open=function(e){var t;return q(this,void 0,void 0,(function(){var r,n,a,c,l,d;return K(this,(function(p){switch(p.label){case 0:if(u.kg.debug("open",e.user,"isLogout:",this.logOut),this._isLogging)throw n=o.Z.create({type:s.E.WEBIM_CONNCTION_OPEN_ERROR,message:"Currently logging in, please wait."});if(!this.logOut)throw n=o.Z.create({type:s.E.WEBIM_USER_ALREADY_LOGIN,message:"The user has logged in."});this.retryConnectTimes=0,this._isLogging=!0,p.label=1;case 1:if(p.trys.push([1,6,7,8]),"web"===z.platform&&(r=i.P6.detectBrowser(),u.kg.debug("browser",r)),n=ne.call(this,e))throw null===(t=this.onError)||void 0===t||t.call(this,n),n;return e.accessToken&&(this.token=e.accessToken),a=W({},e),c=this.dataReport.geOperateFun({uid:e.user,operationName:E.fI.LOGIN}),this.dnsIndex=0,this.isHttpDNS?[4,ae.call(this,c)]:[3,3];case 2:p.sent(),p.label=3;case 3:return u.kg.initReport({report:this._reportLogs,reportInterval:this._reportInterval,connection:this}),[4,Q.call(this,a,{rpt:c})];case 4:return l=p.sent(),[4,te.call(this,c)];case 5:return p.sent(),u.kg.debug("grantType",this.grantType),i.P6.listenNetwork($.bind(this),ee.bind(this)),i.P6.listenBrowserVisibility((function(){u.kg.debug("visibility: true")}),(function(){u.kg.debug("visibility: false")})),[2,l];case 6:throw d=p.sent(),this._isLogging=!1,e.error&&e.error(d),u.kg.error("login failed",d),d;case 7:return u.kg.reportLog(),[7];case 8:return[2]}}))}))},e.prototype.isOpened=function(){return this.sock&&this.sock.readyState===V.OPEN||!1},e.prototype.close=function(){var e,t,r;u.kg.debug("call close"),u.kg._stopReportLogs(),this.logOut=!0,this.disconnectedReason=void 0,this.reconnecting=!1,this.context.status=s.E.STATUS_CLOSING,this.sock&&this.sock.close(),null===(e=this.unMSyncSendMsgMap)||void 0===e||e.clear(),this.stopHeartBeat(),this.rejectMessage(),this.context.status=s.E.STATUS_CLOSED,this._load_msg_cache=[],this._queues=[],this._msgHash={},this.mr_cache={},this.token="",this.context.accessToken="",this.isRegisterPush=!1,this.clearTokenTimeout(),null===(r=null===(t=null==this?void 0:this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.close(),this.connectionTimer&&clearTimeout(this.connectionTimer),this.provisionTimer&&clearTimeout(this.provisionTimer),this.probingTimer&&clearTimeout(this.probingTimer)},e.prototype.downloadAndParseCombineMessage=function(e){var t=this,r=e.url,n=e.secret;return new Promise((function(e,o){var a,c,l=i.P6.getEnvInfo(),d="web"!==l.platform&&"node"!==l.platform&&"quick_app"!==l.platform&&(null===(c=null===(a=l.global)||void 0===a?void 0:a.canIUse)||void 0===c?void 0:c.call(a,"getFileSystemManager")),p=function(r){var n=function(e){o({type:s.E.PARSE_FILE_ERROR,message:"Read file failed",data:e})},a=function(r){return q(t,void 0,void 0,(function(){var t,n,a,c,l,p,h,f,m,g,v,E,y;return K(this,(function(_){switch(_.label){case 0:for(t=d?new Uint8Array(r.data):new Uint8Array(r.target.result),n=0,a=0,c=2,l=t.subarray(n,n+c),p=i.P6.Uint8ArrayToString(l),u.kg.debug("file header:",p),a+=c,h=0,f=2;f<t.length-1;f++)f%2==1&&(h^=t[f]);if(m=t.subarray(t.length-1,t.length),u.kg.debug("checkResult:",h,m[0]===h),m[0]!==h)return[2,o({type:s.E.PARSE_FILE_ERROR,message:"File verification failed"})];if("cm"!==p)return[3,7];_.label=1;case 1:_.trys.push([1,5,,6]),g=[],v=function(){var e,r,o,i;return K(this,(function(s){switch(s.label){case 0:return n+=c,a+=c=4,e=t.subarray(n,n+c),n+=c,c=e.reduce((function(t,r,n){return t+(r<<8*(e.length-n-1))}),0),a+=c,r=t.subarray(n,n+c),o=(o=E.root.lookup("easemob.pb.Meta")).decode(r),[4,H.Z.call(E,o,0,!0,!0)];case 1:return i=s.sent(),g.push(i),[2]}}))},E=this,_.label=2;case 2:return a<t.length-1?[5,v()]:[3,4];case 3:return _.sent(),[3,2];case 4:return[2,e(g)];case 5:return y=_.sent(),o({type:s.E.PARSE_FILE_ERROR,message:"Parse file failed",data:y}),[3,6];case 6:return[3,8];case 7:return[2,o({type:s.E.PARSE_FILE_ERROR,message:"File verification failed"})];case 8:return[2]}}))}))};if(d){var c=l.global.getFileSystemManager(),p=r.tempFilePath;c.readFile({filePath:p,success:a,fail:n})}else if(r instanceof Blob){var h=new FileReader;h.readAsArrayBuffer(r),h.onerror=n,h.onload=a}},h=function(e){o({type:s.E.WEBIM_DOWNLOADFILE_ERROR,message:"Download failed, please try again",data:e})};d?l.global.downloadFile({url:r,success:p,fail:h}):i.P6.download.call(t,{url:r,headers:{Accept:"application/json"},onFileDownloadComplete:p,onFileDownloadError:h,secret:n,accessToken:t.context.accessToken})}))},e.prototype.stopHeartBeat=function(){clearInterval(this.heartBeatID)},e.prototype.clear=function(){this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.hostTotal=0},e.prototype.heartBeat=function(){},e.prototype.renewToken=function(e){var t=this;return this.isOpened()?this.getTokenExpireTimestamp(e).then((function(r){var n=r.expire_timestamp,o=Date.now();return t.expirationTime=n,t.expiresIn=n-o,t.token=e,t.context.accessToken=e,t.clearTokenTimeout(),t.tokenExpireTimeCountDown(t.expiresIn),{status:!0,token:e,expire:n}})):Promise.reject({status:!1})},e.prototype.clearTokenTimeout=function(){u.kg.info("clearTokenTimeout"),this.tokenWillExpireTimer&&clearTimeout(this.tokenWillExpireTimer),this.tokenExpiredTimer&&clearTimeout(this.tokenExpiredTimer),this.tokenWillExpireTimer=null,this.tokenExpiredTimer=null},e.prototype.tokenExpireTimeCountDown=function(e){var t=this;u.kg.info("tokenExpireTimeCountDown",e),e>Math.pow(2,31)-1&&(e=Math.pow(2,31)-1),this.tokenWillExpireTimer=setTimeout((function(){var r;t.onTokenWillExpire&&t.onTokenWillExpire(),null===(r=t.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),u.kg.info("onTokenWillExpire",Math.floor(e/2))}),e/2),this.tokenExpiredTimer=setTimeout((function(){var e;u.kg.info("onTokenExpired",0),t.onTokenExpired&&t.onTokenExpired(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),t.close()}),e)},e.prototype.compareTokenExpireTime=function(e,t){var r,n=Number(t)-Number(e);u.kg.debug("compareTokenExpireTime",n),n<=this.expiresIn/2&&n>0?(this.onTokenWillExpire&&this.onTokenWillExpire(),null===(r=this.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),u.kg.info("onTokenWillExpire",n)):n<=0&&(this.closeByTokenExpired(),u.kg.info("closeByTokenExpired",n))},e.prototype.closeByTokenExpired=function(){var e;u.kg.info("closed By TokenExpired"),this.onTokenExpired&&this.onTokenExpired(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),this.close()},e.prototype.rejectMessage=function(){var e=this,t=Object.keys(this._msgHash);if(t.length>0){var r=o.Z.create({type:s.E.MESSAGE_WEBSOCKET_DISCONNECTED,message:"websocket disconnected"});t.forEach((function(t){var n,o,i;(null===(n=e.unMSyncSendMsgMap)||void 0===n?void 0:n.has(t))||(e._msgHash[t].reject instanceof Function&&e._msgHash[t].reject(r),null===(i=null===(o=e._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.updateLocalMessage(t,{serverMsgId:t,status:U.r.FAIL}),e._msgHash[t].fail instanceof Function&&e._msgHash[t].fail(r),e._msgHash[t].messageTimer&&clearTimeout(e._msgHash[t].messageTimer),delete e._msgHash[t])}))}},e.prototype.resetConnState=function(){this.mSync.stopHeartBeat(),this.times=1,this.autoReconnectNumTotal=0,this.hostIndex=0},e.prototype.reconnect=function(e){var t,r=this;if(this.logout)return u.kg.warn("The user has already logged out when reconnecting");if(u.kg.debug("socket reconnect readyState",this.sock.readyState),(this.sock.readyState!==V.CONNECTING||e)&&(this.sock.readyState!==V.OPEN||e)){u.kg.info("reconnect: time",this.times),u.kg.info("reconnect sock.readyState: ",this.sock.readyState),!1===this.reconnecting&&(this.reconnecting=!0),null===(t=this.eventHandler)||void 0===t||t.dispatch("onReconnecting"),this.rejectMessage(),this.isHttpDNS&&(this.hostIndex<this.socketHost.length-1?this.hostIndex++:this.hostIndex=this.socketHost.length-1);var n=1e3*i.P6.getRetryDelay(this.times);u.kg.info("reconnect delay: ",n),setTimeout((function(){(r.sock.readyState!==V.OPEN||e)&&(u.kg.info("login sock.readyState: ",r.sock.readyState),r.sock.close(),re.call(r).catch((function(e){u.kg.error("reconnect websocket failed",e)})),r.times++)}),n),this.autoReconnectNumTotal++}},e.prototype.send=function(e){return Promise.resolve(null)},e.prototype.setLoginInfoCustomExt=function(e){if(u.kg.debug("setLoginInfoCustomExt","params:",e),e){if("string"!=typeof e)throw new Error("ext must be a string");if(e.length>1024)throw new Error("ext length must be less than 1024")}this.loginInfoCustomExt=e},e.prototype.onShow=function(){var e=this;u.kg.debug("execute onshow callback",this.lastHeartbeat),!this.logOut&&!this.reconnecting&&Date.now()-this.lastHeartbeat>2e3&&(u.kg.debug("send ping"),this.mSync.sendUnreadDeal(),this.probingTimer&&clearTimeout(this.probingTimer),this.probingTimer=setTimeout((function(){u.kg.error("Websocket connection timeout"),e.logOut||e.reconnecting||e.reconnect(!0)}),O.xd))},e._getSock=function(){},e}();function J(e,t){var r=t.rpt,n=t.isRetry,o=this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users",a={requestName:E.c.RESISTER,requestUrl:o},c={headers:{"Content-Type":"application/json"},url:o,dataType:"json",data:JSON.stringify({username:e.username,password:e.password,nickname:e.nickname||""})};return i.P6.ajax(c,E.fI.SDK_INTERNAL).then((function(e){var t=W(W({},e),{type:s.E.REQUEST_SUCCESS}),o=e.extraInfo,i=o.httpCode,c=o.elapse;return r({isEndApi:!0,isRetry:n,data:W(W({},{requestElapse:c,isSuccess:1,code:i}),a)}),t})).catch((function(e){var t=e.extraInfo,o=t.elapse,i=t.httpCode,s=t.errDesc;throw r({isRetry:n,data:W(W({},{requestElapse:o,isSuccess:0,code:i,codeDesc:s}),a)}),e}))}function Z(e,t){return q(this,void 0,void 0,(function(){var r,n;return K(this,(function(o){switch(o.label){case 0:r=t.rpt,o.label=1;case 1:return o.trys.push([1,3,,7]),[4,J.call(this,e,t)];case 2:return[2,o.sent()];case 3:return!((n=o.sent()).message.includes("Open registration doesn't allow")||n.message.includes("username be unique")||n.message.includes("is not legal"))&&this.isHttpDNS&&this.restIndex+1<this.restTotal?(this.restIndex++,ce.call(this),[4,Z.call(this,e,{rpt:r})]):[3,5];case 4:return[2,o.sent()];case 5:throw u.kg.error("retry signup failed",n),r({data:{isLastApi:1,isSuccess:0}}),n;case 6:return[3,7];case 7:return[2]}}))}))}function Y(e,t){var r;return q(this,void 0,void 0,(function(){var n,o,a,s,c,l,d,p,h,f=this;return K(this,(function(m){switch(m.label){case 0:if(n=ne.call(this,e))throw n;return u.kg.debug("socket readyState",null===(r=this.sock)||void 0===r?void 0:r.readyState),o=t.rpt,a=t.isRetry,oe.call(this,e),this.user=e.user,s=this.context.appName,c=this.context.orgName,l=this.apiUrl+"/"+c+"/"+s+"/token",e.accessToken?(u.kg.debug("login with accessToken"),this.grantType="accessToken",this.token=e.accessToken,this.context.accessToken=e.accessToken,this.context.restTokenData=e.accessToken,[2,{accessToken:e.accessToken}]):[3,1];case 1:return e.agoraToken?(u.kg.debug("login with agoraToken"),this.grantType="agoraToken",this.token=e.agoraToken,this.context.accessToken=e.agoraToken,this.context.restTokenData=e.agoraToken,[2,{accessToken:e.agoraToken}]):[3,2];case 2:return u.kg.debug("login with password"),this.grantType="password",d={grant_type:"password",username:e.user,password:e.pwd,timestamp:+new Date},p=JSON.stringify(d),h={headers:{"Content-Type":"application/json"},url:l,dataType:"json",data:p,version:this.version},u.kg.debug("start get token"),[4,i.P6.ajax(h,E.fI.SDK_INTERNAL).then((function(e){u.kg.debug("get token success",e),f.token=e.access_token,f.context.restTokenData=e.access_token,f.context.accessToken=e.access_token,f.expiresIn=e.expires_in;var t=e.extraInfo,r=t.httpCode,n=t.elapse,i={requestName:E.c.LOGIN_BY_PWD,requestElapse:n,requestUrl:l,isSuccess:1,code:r};return o({isRetry:a,data:i}),{accessToken:e.access_token,duration:e.expires_in}})).catch((function(e){var t=e.extraInfo,r=t.elapse,n=t.httpCode,i=t.errDesc,s={requestName:E.c.LOGIN_BY_PWD,requestElapse:r,requestUrl:l,isSuccess:0,code:n,codeDesc:i};throw o({isRetry:a,data:s}),e}))];case 3:return[2,m.sent()]}}))}))}function Q(e,t){var r;return q(this,void 0,void 0,(function(){var n,i,a;return K(this,(function(c){switch(c.label){case 0:n=t.rpt,c.label=1;case 1:return c.trys.push([1,3,,7]),[4,Y.call(this,e,t)];case 2:return[2,c.sent()];case 3:return"invalid password"!==(i=c.sent()).message&&"user not found"!==i.message&&this.isHttpDNS&&this.restIndex+1<this.restTotal?(this.restIndex++,ce.call(this),[4,Q.call(this,e,{rpt:n,isRetry:!0})]):[3,5];case 4:return[2,c.sent()];case 5:throw u.kg.error("retry login failed",i),n({data:{isLastApi:1,isSuccess:0}}),this.clear(),a=void 0,i.error&&i.error_description?(a=o.Z.create({type:s.E.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,message:i.error_description,data:i}),this.onError&&this.onError(a),a):(a=o.Z.create({type:s.E.WEBIM_CONNCTION_OPEN_ERROR,message:null!==(r=i.message)&&void 0!==r?r:"login failed",data:i}),this.onError&&this.onError(a),a);case 6:return[3,7];case 7:return[2]}}))}))}function $(){var e;u.kg.debug("online"),this.onOnline&&this.onOnline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOnline"),this.sock&&1!==this.sock.readyState&&(u.kg.debug("sock.readyState:",this.sock.readyState),this.logOut||this.reconnecting||this.reconnect())}function ee(){var e,t;u.kg.debug("offline"),null===(e=this.sock)||void 0===e||e.close(),this.onOffline&&this.onOffline(),null===(t=this.eventHandler)||void 0===t||t.dispatch("onOffline")}function te(e){var t,r,n;return q(this,void 0,void 0,(function(){var o,i,a,c;return K(this,(function(l){switch(l.label){case 0:o=(new Date).getTime(),l.label=1;case 1:return l.trys.push([1,3,,7]),[4,re.call(this,e)];case 2:return i=l.sent(),e&&e({data:{isLastApi:1,isSuccess:1,accessChannel:null===(t=this.socketHost[this.hostIndex])||void 0===t?void 0:t.channel}}),[2,i];case 3:if(a=l.sent(),u.kg.error("connect to msync failed times:",this.retryConnectTimes,a),O.bh.includes(a.type))throw e&&e({data:{isLastApi:1,isSuccess:0,accessChannel:null===(r=this.socketHost[this.hostIndex])||void 0===r?void 0:r.channel,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||a.message}}),a;return this.retryConnectTimes++,this.retryConnectTimes<O.Ge?(this.isHttpDNS&&(this.hostIndex<this.socketHost.length-1?this.hostIndex++:this.hostIndex=this.socketHost.length-1,se.call(this)),a.type===s.E.REQUEST_TIMEOUT&&"provision timeout"===a.message||(c=(new Date).getTime()-o,null==e||e({isRetry:1!==this.retryConnectTimes,data:{requestUrl:this.url,requestName:E.c.CONNECT_WEBSOCKET,isSuccess:0,code:E.dd.closed,requestElapse:c,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||"websocket close"}})),[4,te.call(this,e)]):[3,5];case 4:return l.sent(),[3,6];case 5:throw u.kg.error("connect failed three times",a),e&&e({data:{isLastApi:1,isSuccess:0,accessChannel:null===(n=this.socketHost[this.hostIndex])||void 0===n?void 0:n.channel,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||a.message}}),a;case 6:return[3,7];case 7:return[2]}}))}))}function re(e){var t=this,r=(new Date).getTime(),n="pending";return new Promise((function(a,c){var l;t._getSock?void 0===(l=t._getSock()).readyState&&(t.needSetReadyState=!0):(l=new WebSocket(t.url)).binaryType="arraybuffer",t.sock=l,t.connectionTimer&&clearTimeout(t.connectionTimer),t.connectionTimer=setTimeout((function(){t.disconnectedReason={type:s.E.REQUEST_TIMEOUT,message:"connection timeout"},l.close(),null==c||c(t.disconnectedReason)}),O.th),u.kg.debug("start connect ws"),t.connectionResolve=a,t.connectionReject=c;var d=function(){if(t.connectionTimer&&clearTimeout(t.connectionTimer),u.kg.debug("websocket onOpen"),e){var n=(new Date).getTime()-r;e({isRetry:0!==t.retryConnectTimes,data:{requestUrl:t.url,requestName:E.c.CONNECT_WEBSOCKET,isSuccess:1,code:E.dd.success,requestElapse:n}})}var a;a=t._getSock?i.P6.flow([t.mSync.generateProvision,t.mSync.base64transform])():t.mSync.generateProvision();try{t.provisionTimer&&clearTimeout(t.provisionTimer),t.provisionTimer=setTimeout((function(){u.kg.debug("provision timeout"),t.disconnectedReason=o.Z.create({type:s.E.REQUEST_TIMEOUT,message:"provision timeout"}),l.close(),null==c||c(t.disconnectedReason)}),O.Nt),l.send(a)}catch(e){var d=o.Z.create({type:s.E.SDK_RUNTIME_ERROR,message:"send message error",data:e});t.onError&&t.onError(d)}},p=function(e){t.connectionTimer&&clearTimeout(t.connectionTimer),setTimeout((function(){var r,i,a,l,d,p,h;if(u.kg.debug("websocket onClose, isLogging:",t._isLogging,e),t.needSetReadyState&&(t.sock=W(W({},t.sock),{close:t.sock.close,send:t.sock.send,readyState:V.CLOSED})),t._isLogging)return null==c||c({type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}),void(n="rejected");if("rejected"!==n)if(n="rejected",t.logOut)t.clear(),t.resetConnState(),null===(i=null===(r=null==t?void 0:t._localCache)||void 0===r?void 0:r.getInstance())||void 0===i||i.close(),t.onClosed&&t.onClosed(),null===(a=t.eventHandler)||void 0===a||a.dispatch("onDisconnected",t.disconnectedReason),null==c||c(t.disconnectedReason||{type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"});else if(t.autoReconnectNumTotal<t.autoReconnectNumMax){t.reconnect();var f={type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};t.onError&&t.onError(f),t.autoReconnectNumTotal%t.refreshDNSIntervals==0&&t.isHttpDNS&&(u.kg.debug("refresh dns config when websocket close"),ae.call(t,(function(){})))}else null===(l=t.unMSyncSendMsgMap)||void 0===l||l.clear(),t.rejectMessage(),f={type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"},t.disconnectedReason=o.Z.create({type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"reconnection failed"}),t.onError&&t.onError(f),null===(p=null===(d=null==t?void 0:t._localCache)||void 0===d?void 0:d.getInstance())||void 0===p||p.close(),t.onClosed&&t.onClosed(),null===(h=t.eventHandler)||void 0===h||h.dispatch("onDisconnected",t.disconnectedReason),t.resetConnState(),t.reconnecting=!1,null==c||c(f),u.kg.debug("reconnect fail");else u.kg.debug("reject is null")}),0)},h=function(e){var r=t.mSync,n=r.decodeMSync,o=r.distributeMSync;i.P6.flow([n,o])(e)};"web"===z.platform?(l.onopen=d,l.onclose=p,l.onmessage=h):(l.onOpen(d),l.onMessage(h),l.onClose(p),"undefined"!=typeof window&&window.WebSocket||l.onError((function(e){var r,i,a,l;if(t.connectionTimer&&clearTimeout(t.connectionTimer),u.kg.debug("websocket onerror, isLogging:",t._isLogging,e),t.sock.readyState!==V.CLOSED&&(t.sock=W(W({},t.sock),{close:t.sock.close,send:t.sock.send,readyState:V.CLOSED})),t.onError&&t.onError({type:s.E.WEBIM_CONNECTION_ERROR,message:"on socket error",data:e}),t._isLogging)return null==c||c({type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}),void(n="rejected");if("rejected"!==n){if(n="rejected",!t.logOut)if(t.autoReconnectNumTotal<t.autoReconnectNumMax)u.kg.debug("sock.onError reconnect",t.autoReconnectNumTotal,t.autoReconnectNumMax),t.reconnect(),t.autoReconnectNumTotal%t.refreshDNSIntervals==0&&t.isHttpDNS&&(u.kg.debug("refresh dns config when websocket error"),ae.call(t,(function(){})));else{var d={type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};t.disconnectedReason=o.Z.create({type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"reconnection failed"}),null===(r=t.unMSyncSendMsgMap)||void 0===r||r.clear(),t.rejectMessage(),t.onError&&t.onError(d),null===(a=null===(i=null==t?void 0:t._localCache)||void 0===i?void 0:i.getInstance())||void 0===a||a.close(),t.onClosed&&t.onClosed(),null===(l=t.eventHandler)||void 0===l||l.dispatch("onDisconnected",t.disconnectedReason),t.resetConnState(),t.reconnecting=!1,null==c||c(d),u.kg.debug("reconnect fail")}}else u.kg.debug("reject is null")})))}))}function ne(e){if("object"!==F(e)||null===e)return o.Z.create({type:s.E.WEBIM_CONNCTION_OPEN_ERROR,message:"the param is illegal"});if(!e.user||"string"!=typeof e.user){var t=o.Z.create({type:s.E.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR,message:"the user is empty or type is not string"});return u.kg.debug("open params error",t),t}return!("agoraToken"in e)||e.agoraToken&&"string"==typeof e.agoraToken?!("accessToken"in e)||e.accessToken&&"string"==typeof e.accessToken?"accessToken"in e||"agoraToken"in e||e.pwd?void 0:(t=o.Z.create({type:s.E.WEBIM_CONNCTION_OPEN_ERROR,message:"the accessToken or pwd is illegal"}),u.kg.debug("open params error",t),t):(t=o.Z.create({type:s.E.WEBIM_CONNCTION_OPEN_ERROR,message:"the accessToken is illegal"}),u.kg.debug("open params error",t),t):(t=o.Z.create({type:s.E.WEBIM_CONNCTION_OPEN_ERROR,message:"the agoraToken is illegal"}),u.kg.debug("open params error",t),console.warn("agoraToken is deprecated, please use accessToken instead"),t)}function oe(e){this.context.jid={appKey:this.appKey,name:e.user,domain:this.domain,clientResource:this.clientResource},this.context.root=this.root,this.context.userId=e.user,this.context.appKey=this.appKey,this.context.appName=this.appName,this.context.orgName=this.orgName}function ie(e){var t=this,r=e.rpt,n=e.isRetry,a=this.dnsIndex<this.dnsTotal?this.dnsIndex:0,c="".concat(this.dnsArr[a],"/easemob/server.json");u.kg.debug("call getHttpDNS: "+this.dnsIndex);var l={url:c,dataType:"json",type:"GET",data:{}};return this._initWithAppId?l.data={app_id:this.appId,sdk_version:"4.10.0",file_version:"1"}:l.data={app_key:z.platform===i.iw.WEB?encodeURIComponent(this.appKey):this.appKey},i.P6.ajax(l,E.fI.SDK_INTERNAL).then((function(e){if(!e)throw o.Z.create({type:s.E.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed"});u.kg.debug("getHttpDNS success");var i=e.rest.hosts,a=t.https?"https":"http";if(u.kg.info("httpType: "+a),t._initWithAppId){if(!e.app_key)throw(d=o.Z.create({type:s.E.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed"})).extraInfo=e.extraInfo,d;t.appKey=e.app_key,t.context.appKey=t.appKey,t.devInfos=t.appKey.split("#"),t.orgName=t.devInfos[0],t.appName=t.devInfos[1],t.dataReport.updateAppKey(t.appKey)}if(!i)throw(d=o.Z.create({type:s.E.SERVER_GET_DNSLIST_FAILED,message:"DNS hosts resolution failed",data:e.rest})).extraInfo=e.extraInfo,d;var l=i.filter((function(e){if(e.protocol===a)return e}));t.restHosts=l,t.restTotal=l.length;var d,p=e["msync-wx"].hosts;if(!p)throw(d=o.Z.create({type:s.E.SERVER_GET_DNSLIST_FAILED,message:"DNS msync-wx resolution failed",data:e["msync-wx"]})).extraInfo=e.extraInfo,d;var h=p.filter((function(e){if(e.protocol===a)return e}));if(t.socketHost=h,t.hostTotal=h.length,t.isHttpDNS&&ce.call(t),t.isHttpDNS&&se.call(t),t._reportLogs="true"===e.enableReportLogs,t._reportInterval=Number(e.reportInterval||O.XV),"true"===(null==e?void 0:e.enableDataReport)?(t.dataReport.setIsCollectDt(!0),t.dataReport.setIsReportDt(!0)):(t.dataReport.setIsReportDt(!1),t.dataReport.setIsCollectDt(!1)),"false"===(null==e?void 0:e.uploadinparts_enable)&&(t.uploadPartEnable=!1),e.extraInfo){var f=e.extraInfo,m=f.elapse,g=f.httpCode,v={requestUrl:c,requestName:E.c.GET_DNS,requestElapse:m,isSuccess:1,code:g};r&&r({isRetry:n,data:v})}})).catch((function(e){var t=e.extraInfo||{},i=t.elapse,a=t.httpCode,u=t.errDesc,l={requestUrl:c,requestName:E.c.GET_DNS,isSuccess:0,code:a,codeDesc:u,requestElapse:i};throw r&&r({isRetry:n,data:l}),o.Z.create({type:s.E.SERVER_GET_DNSLIST_FAILED,message:e.message,data:e})}))}function ae(e,t){return q(this,void 0,void 0,(function(){var r;return K(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,6]),[4,ie.call(this,{rpt:e,isRetry:t})];case 1:case 3:return[2,n.sent()];case 2:return r=n.sent(),u.kg.error("get DNS failed",r,"times:",this.dnsIndex),this.dnsIndex++,this.dnsIndex<this.dnsTotal?[4,ae.call(this,e,!0)]:[3,4];case 4:throw u.kg.error("retryRequestDNS failed"),o.Z.create({type:s.E.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed",data:r});case 5:return[3,6];case 6:return[2]}}))}))}function se(){var e=this.socketHost[this.hostIndex],t=e.domain,r=e.ip,n=e.port,o="";o=t||r,n&&"80"!==n&&"443"!==n&&(o+=":"+n),o&&(this.url="//"+o+"/websocket");var i=this.https?"wss:":"ws:";this.url=i+this.url}function ce(){var e,t;if(this.restIndex>this.restTotal)return u.kg.debug("restIndex > restTotal"),"";var r="",n=this.restHosts[this.restIndex],o=n.domain,i=n.ip,a=n.port,s=this.https?"https:":"http:";return i&&"undefined"!=typeof window&&"http:"===(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.protocol)?r=s+"//"+i+":"+a:(r=s+"//"+o,a&&"80"!==a&&"443"!==a&&(r+=":".concat(a)),"undefined"==typeof window||window.location||(r="https://"+o),"undefined"!=typeof window&&window.location&&"file:"===(null===(t=window.location)||void 0===t?void 0:t.protocol)&&(r="https://"+o)),"undefined"==typeof window&&(r=s+"//"+o),this.apiUrl=r,r}var ue=__webpack_require__(2449);t().util.Long=n(),t().configure();var le=t().Root.fromJSON({nested:{easemob:{nested:{pb:{nested:{MessageBody:{fields:{type:{type:"Type",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},contents:{rule:"repeated",type:"Content",id:4},ext:{rule:"repeated",type:"KeyValue",id:5},ackMessageId:{type:"uint64",id:6},msgConfig:{type:"MessageConfig",id:7},ackContent:{type:"string",id:8},meta:{type:"string",id:9},editMessageId:{type:"uint64",id:11}},nested:{Content:{fields:{type:{type:"Type",id:1},text:{type:"string",id:2},latitude:{type:"double",id:3},longitude:{type:"double",id:4},address:{type:"string",id:5},displayName:{type:"string",id:6},remotePath:{type:"string",id:7},secretKey:{type:"string",id:8},fileLength:{type:"int32",id:9},action:{type:"string",id:10},params:{rule:"repeated",type:"KeyValue",id:11},duration:{type:"int32",id:12},size:{type:"Size",id:13},thumbnailRemotePath:{type:"string",id:14},thumbnailSecretKey:{type:"string",id:15},thumbnailDisplayName:{type:"string",id:16},thumbnailFileLength:{type:"int32",id:17},thumbnailSize:{type:"Size",id:18},customEvent:{type:"string",id:19},customExts:{rule:"repeated",type:"KeyValue",id:20},buildingName:{type:"string",id:21},subType:{type:"SubType",id:22},title:{type:"string",id:23},summary:{type:"string",id:24},combineLevel:{type:"int32",id:25}},nested:{Type:{values:{TEXT:0,IMAGE:1,VIDEO:2,LOCATION:3,VOICE:4,FILE:5,COMMAND:6,CUSTOM:7,COMBINE:8}},Size:{fields:{width:{type:"double",id:1},height:{type:"double",id:2}}},SubType:{values:{COMBINE:0}}}},Type:{values:{NORMAL:0,CHAT:1,GROUPCHAT:2,CHATROOM:3,READ_ACK:4,DELIVER_ACK:5,RECALL:6,CHANNEL_ACK:7,EDIT:8}},MessageConfig:{fields:{allowGroupAck:{type:"bool",id:1}}}}},KeyValue:{oneofs:{value:{oneof:["varintValue","floatValue","doubleValue","stringValue"]}},fields:{key:{type:"string",id:1},type:{type:"ValueType",id:2},varintValue:{type:"int64",id:3},floatValue:{type:"float",id:4},doubleValue:{type:"double",id:5},stringValue:{type:"string",id:6}},nested:{ValueType:{values:{BOOL:1,INT:2,UINT:3,LLINT:4,FLOAT:5,DOUBLE:6,STRING:7,JSON_STRING:8}}}},JID:{fields:{appKey:{type:"string",id:1},name:{type:"string",id:2},domain:{type:"string",id:3},clientResource:{type:"string",id:4}}},ConferenceBody:{fields:{sessionId:{type:"string",id:1},operation:{type:"Operation",id:2},conferenceId:{type:"string",id:3},type:{type:"Type",id:4},content:{type:"string",id:5},network:{type:"string",id:6},version:{type:"string",id:7},identity:{type:"Identity",id:8},duration:{type:"string",id:9},peerName:{type:"string",id:10},endReason:{type:"EndReason",id:11},status:{type:"Status",id:12},isDirect:{type:"bool",id:13},controlType:{type:"StreamControlType",id:14},routeFlag:{type:"int32",id:15},routeKey:{type:"string",id:16}},nested:{Status:{fields:{errorCode:{type:"int32",id:1}}},Operation:{values:{JOIN:0,INITIATE:1,ACCEPT_INITIATE:2,ANSWER:3,TERMINATE:4,REMOVE:5,STREAM_CONTROL:6,MEDIA_REQUEST:7}},Type:{values:{VOICE:0,VIDEO:1}},Identity:{values:{CALLER:0,CALLEE:1}},EndReason:{values:{HANGUP:0,NORESPONSE:1,REJECT:2,BUSY:3,FAIL:4,UNSUPPORTED:5,OFFLINE:6}},StreamControlType:{values:{PAUSE_VOICE:0,RESUME_VOICE:1,PAUSE_VIDEO:2,RESUME_VIDEO:3}}}},MSync:{fields:{version:{type:"Version",id:1,options:{default:"MSYNC_V1"}},guid:{type:"JID",id:2},auth:{type:"string",id:3},compressAlgorimth:{type:"uint32",id:4},crypto:{type:"uint32",id:5},userAgent:{type:"string",id:6},pov:{type:"uint64",id:7},command:{type:"Command",id:8},deviceId:{type:"uint32",id:10},encryptType:{rule:"repeated",type:"EncryptType",id:11,options:{packed:!1}},encryptKey:{type:"string",id:12},payload:{type:"bytes",id:9}},nested:{Version:{values:{MSYNC_V1:0,MSYNC_V2:1}},Command:{values:{SYNC:0,UNREAD:1,NOTICE:2,PROVISION:3}}}},EncryptType:{values:{ENCRYPT_NONE:0,ENCRYPT_AES_128_CBC:1,ENCRYPT_AES_256_CBC:2}},CommSyncUL:{fields:{meta:{type:"Meta",id:1},key:{type:"uint64",id:2},queue:{type:"JID",id:3},isRoam:{type:"bool",id:4},lastFullRoamKey:{type:"uint64",id:5}}},CommSyncDL:{fields:{status:{type:"Status",id:1},metaId:{type:"uint64",id:2},serverId:{type:"uint64",id:3},metas:{rule:"repeated",type:"Meta",id:4},nextKey:{type:"uint64",id:5},queue:{type:"JID",id:6},isLast:{type:"bool",id:7},timestamp:{type:"uint64",id:8},isRoam:{type:"bool",id:9}}},CommNotice:{fields:{queue:{type:"JID",id:1}}},CommUnreadUL:{fields:{}},CommUnreadDL:{fields:{status:{type:"Status",id:1},unread:{rule:"repeated",type:"MetaQueue",id:2},timestamp:{type:"uint64",id:3}}},MetaQueue:{fields:{queue:{type:"JID",id:1},n:{type:"uint32",id:2}}},Meta:{fields:{id:{type:"uint64",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},timestamp:{type:"uint64",id:4},ns:{type:"NameSpace",id:5},payload:{type:"bytes",id:6},routetype:{type:"RouteType",id:7},ext:{rule:"repeated",type:"KeyValue",id:8},meta:{type:"bytes",id:9},directedUsers:{rule:"repeated",type:"string",id:10}},nested:{NameSpace:{values:{STATISTIC:0,CHAT:1,MUC:2,ROSTER:3,CONFERENCE:4,NOTIFY:5,QUERY:6}},RouteType:{values:{ROUTE_ALL:0,ROUTE_ONLINE:1,ROUTE_DIRECT:2}}}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},reason:{type:"string",id:2},redirectInfo:{rule:"repeated",type:"RedirectInfo",id:3}},nested:{ErrorCode:{values:{OK:0,FAIL:1,UNAUTHORIZED:2,MISSING_PARAMETER:3,WRONG_PARAMETER:4,REDIRECT:5,TOKEN_EXPIRED:6,PERMISSION_DENIED:7,NO_ROUTE:8,UNKNOWN_COMMAND:9,PB_PARSER_ERROR:10,BIND_ANOTHER_DEVICE:11,IM_FORBIDDEN:12,TOO_MANY_DEVICES:13,PLATFORM_LIMIT:14,USER_MUTED:15,ENCRYPT_DISABLE:16,ENCRYPT_ENABLE:17,DECRYPT_FAILURE:18,PERMISSION_DENIED_EXTERNAL:19}}}},RedirectInfo:{fields:{host:{type:"string",id:1},port:{type:"uint32",id:2}}},Provision:{fields:{osType:{type:"OsType",id:1},version:{type:"string",id:2},networkType:{type:"NetworkType",id:3},appSign:{type:"string",id:4},compressType:{rule:"repeated",type:"CompressType",id:5,options:{packed:!1}},encryptType:{rule:"repeated",type:"EncryptType",id:6,options:{packed:!1}},encryptKey:{type:"string",id:7},status:{type:"Status",id:8},deviceUuid:{type:"string",id:9},isManualLogin:{type:"bool",id:10},password:{type:"string",id:11},deviceName:{type:"string",id:12},resource:{type:"string",id:13},auth:{type:"string",id:14},serviceId:{type:"string",id:16},actionVersion:{type:"string",id:17},authToken:{type:"string",id:18},sessionId:{type:"string",id:20},reason:{type:"string",id:21}},nested:{OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}},CompressType:{values:{COMPRESS_NONE:0,COMPRESS_ZLIB:1}}}},MUCBody:{fields:{mucId:{type:"JID",id:1},operation:{type:"Operation",id:2},from:{type:"JID",id:3},to:{rule:"repeated",type:"JID",id:4},setting:{type:"Setting",id:5},reason:{type:"string",id:6},isChatroom:{type:"bool",id:7},status:{type:"Status",id:8},isThread:{type:"bool",id:9},mucParentId:{type:"JID",id:10},mucName:{type:"string",id:11},eventInfo:{type:"EventInfo",id:12},mucMemberCount:{type:"int32",id:13},ext:{type:"string",id:14},leaveOtherRooms:{type:"bool",id:15}},nested:{Operation:{values:{CREATE:0,DESTROY:1,JOIN:2,LEAVE:3,APPLY:4,APPLY_ACCEPT:5,APPLY_DECLINE:6,INVITE:7,INVITE_ACCEPT:8,INVITE_DECLINE:9,KICK:10,GET_BLACKLIST:11,BAN:12,ALLOW:13,UPDATE:14,BLOCK:15,UNBLOCK:16,PRESENCE:17,ABSENCE:18,DIRECT_JOINED:19,ASSIGN_OWNER:20,ADD_ADMIN:21,REMOVE_ADMIN:22,ADD_MUTE:23,REMOVE_MUTE:24,UPDATE_ANNOUNCEMENT:25,DELETE_ANNOUNCEMENT:26,UPLOAD_FILE:27,DELETE_FILE:28,ADD_USER_WHITE_LIST:29,REMOVE_USER_WHITE_LIST:30,BAN_GROUP:31,REMOVE_BAN_GROUP:32,THREAD_CREATE:33,THREAD_DESTROY:34,THREAD_JOIN:35,THREAD_LEAVE:36,THREAD_KICK:37,THREAD_UPDATE:38,THREAD_PRESENCE:39,THREAD_ABSENCE:40,DISABLE_GROUP:41,ABLE_GROUP:42,SET_METADATA:43,DELETE_METADATA:44,GROUP_MEMBER_METADATA_UPDATE:45}},Setting:{fields:{name:{type:"string",id:1},desc:{type:"string",id:2},type:{type:"Type",id:3},maxUsers:{type:"int32",id:4},owner:{type:"string",id:5}},nested:{Type:{values:{PRIVATE_OWNER_INVITE:0,PRIVATE_MEMBER_INVITE:1,PUBLIC_JOIN_APPROVAL:2,PUBLIC_JOIN_OPEN:3,PUBLIC_ANONYMOUS:4}}}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},description:{type:"string",id:2},chatroomInfo:{type:"string",id:3}},nested:{ErrorCode:{values:{OK:0,PERMISSION_DENIED:1,WRONG_PARAMETER:2,MUC_NOT_EXIST:3,USER_NOT_EXIST:4,UNKNOWN:5}}}},EventInfo:{fields:{eventType:{type:"EventType",id:1,options:{default:"EVENT_NONE"}},ext:{type:"string",id:2}},nested:{EventType:{values:{EVENT_NONE:0,CIRCLE_CHANNEL:1}}}}}},RosterBody:{fields:{operation:{type:"Operation",id:1},status:{type:"Status",id:2},from:{type:"JID",id:3},to:{rule:"repeated",type:"JID",id:4},reason:{type:"string",id:5},rosterVer:{type:"string",id:6},biDirection:{type:"bool",id:7}},nested:{Operation:{values:{GET_ROSTER:0,GET_BLACKLIST:1,ADD:2,REMOVE:3,ACCEPT:4,DECLINE:5,BAN:6,ALLOW:7,REMOTE_ACCEPT:8,REMOTE_DECLINE:9}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},description:{type:"string",id:2}},nested:{ErrorCode:{values:{OK:0,USER_NOT_EXIST:1,USER_ALREADY_FRIEND:2,USER_ALREADY_BLACKLIST:3}}}}}},StatisticsBody:{fields:{operation:{type:"Operation",id:1},os:{type:"OsType",id:2},version:{type:"string",id:3},network:{type:"NetworkType",id:4},imTime:{type:"uint32",id:5},chatTime:{type:"uint32",id:6},location:{type:"string",id:7},reason:{type:"string",id:10}},nested:{Operation:{values:{INFORMATION:0,USER_REMOVED:1,USER_LOGIN_ANOTHER_DEVICE:2,USER_KICKED_BY_CHANGE_PASSWORD:3,USER_KICKED_BY_OTHER_DEVICE:4}},OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}}}}}}}}}});X.prototype.root=le;var de=u.kg.getLogger("defaultLogger");de.setConfig({useCache:!1,maxCache:3145728,color:"",background:""}),de.enableAll(),X.prototype.getUniqueId=i.P6.getUniqueId;var pe={connection:X,message:ue.Message,utils:i.P6,logger:de,statusCode:s.E};"undefined"!=typeof window&&(window.WebIM=pe);var he=pe}(),__webpack_exports__}()}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.websdk=t():e.websdk=t()}(self,(function(){return function(){var e={4537:function(e){"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,o=2,i=!0;o<arguments.length;)r[n++]=arguments[o++];return new Promise((function(o,a){r[n]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,a(e))}}))}},7419:function(e,t){"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),o=new Array(123),i=0;i<64;)o[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r.encode=function(e,t,r){for(var o,i=null,a=[],s=0,c=0;t<r;){var u=e[t++];switch(c){case 0:a[s++]=n[u>>2],o=(3&u)<<4,c=1;break;case 1:a[s++]=n[o|u>>4],o=(15&u)<<2,c=2;break;case 2:a[s++]=n[o|u>>6],a[s++]=n[63&u],c=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=n[o],a[s++]=61,1===c&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";r.decode=function(e,t,r){for(var n,i=r,s=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&s>1)break;if(void 0===(u=o[u]))throw Error(a);switch(s){case 0:n=u,s=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,s=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,s=3;break;case 3:t[r++]=(3&n)<<6|u,s=0}}if(1===s)throw Error(a);return r-i},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},5124:function(e){"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function o(e){if("string"!=typeof e){var r=i();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var a=Object.keys(e),s=new Array(a.length+1),c=new Array(a.length),u=0;u<a.length;)s[u]=a[u],c[u]=e[a[u++]];return s[u]=r,Function.apply(null,s).apply(null,c)}return Function(r)()}for(var l=new Array(arguments.length-1),d=0;d<l.length;)l[d]=arguments[++d];if(d=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=l[d++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),d!==l.length)throw Error("parameter count mismatch");return n.push(e),o}function i(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return o.toString=i,o}e.exports=t,t.verbose=!1},9211:function(e){"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},9054:function(e,t,r){"use strict";e.exports=i;var n=r(4537),o=r(7199)("fs");function i(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&o&&o.readFile?o.readFile(e,(function(n,o){return n&&"undefined"!=typeof XMLHttpRequest?i.xhr(e,t,r):n?r(n):r(null,t.binary?o:o.toString("utf8"))})):i.xhr(e,t,r):n(i,this,e,t)}i.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var o=0;o<n.responseText.length;++o)e.push(255&n.responseText.charCodeAt(o))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},945:function(e){"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3]}function i(e,n,o){t[0]=e,n[o]=r[3],n[o+1]=r[2],n[o+2]=r[1],n[o+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?o:i,e.writeFloatBE=n?i:o,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function t(e,t,r,n){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),o=2*(n>>31)+1,i=n>>>23&255,a=8388607&n;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=a.bind(null,o),e.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3],n[o+4]=r[4],n[o+5]=r[5],n[o+6]=r[6],n[o+7]=r[7]}function i(e,n,o){t[0]=e,n[o]=r[7],n[o+1]=r[6],n[o+2]=r[5],n[o+3]=r[4],n[o+4]=r[3],n[o+5]=r[2],n[o+6]=r[1],n[o+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?o:i,e.writeDoubleBE=n?i:o,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function t(e,t,r,n,o,i){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,o,i+t),e(1/n>0?0:2147483648,o,i+r);else if(isNaN(n))e(0,o,i+t),e(2146959360,o,i+r);else if(n>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=n*Math.pow(2,-c))>>>0,o,i+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,o,i+r)}}}function a(e,t,r,n,o){var i=e(n,o+t),a=e(n,o+r),s=2*(a>>31)+1,c=a>>>20&2047,u=4294967296*(1048575&a)+i;return 2047===c?u?NaN:s*(1/0):0===c?5e-324*s*u:s*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=a.bind(null,o,0,4),e.readDoubleBE=a.bind(null,i,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:function(e,t,r){"use strict";e.exports=function(e){try{var t=r(822)(e);if(t&&(t.length||Object.keys(t).length))return t}catch(e){}return null}},822:function(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=function(){return[]},t.resolve=t,t.id=822,e.exports=t},8626:function(e,t){"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),o="";r&&(o=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):r?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return o+t.join("/")};r.resolve=function(e,t,r){return r||(t=o(t)),n(t)?t:(r||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},6662:function(e){"use strict";e.exports=function(e,t,r){var n=r||8192,o=n>>>1,i=null,a=n;return function(r){if(r<1||r>o)return e(r);a+r>n&&(i=e(n),a=0);var s=t.call(i,a,a+=r);return 7&a&&(a=1+(7|a)),s}}},4997:function(e,t){"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,o=null,i=[],a=0;t<r;)(n=e[t++])<128?i[a++]=n:n>191&&n<224?i[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(n>>10),i[a++]=56320+(1023&n)):i[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},r.write=function(e,t,r){for(var n,o,i=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(o=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&o),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-i}},4188:function(e,t,r){var n,o,i;!function(a){"use strict";if(null!=t&&"number"!=typeof t.nodeType)e.exports=a();else if(null!=r.amdO)o=[],void 0===(i="function"==typeof(n=a)?n.apply(t,o):n)||(e.exports=i);else{var s=a(),c="undefined"!=typeof self?self:$.global;"function"!=typeof c.btoa&&(c.btoa=s.btoa),"function"!=typeof c.atob&&(c.atob=s.atob)}}((function(){"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function t(e){this.message=e}return t.prototype=new Error,t.prototype.name="InvalidCharacterError",{btoa:function(r){for(var n,o,i=String(r),a=0,s=e,c="";i.charAt(0|a)||(s="=",a%1);c+=s.charAt(63&n>>8-a%1*8)){if((o=i.charCodeAt(a+=3/4))>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|o}return c},atob:function(r){var n=String(r).replace(/[=]+$/,"");if(n.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,i,a=0,s=0,c="";i=n.charAt(s++);~i&&(o=a%4?64*o+i:i,a++%4)?c+=String.fromCharCode(255&o>>(-2*a&6)):0)i=e.indexOf(i);return c}}}))},9667:function(e,t,r){"use strict";r.r(t),r.d(t,{addUsersToChatRoom:function(){return E},addUsersToChatRoomAllowlist:function(){return V},addUsersToChatRoomWhitelist:function(){return z},blockChatRoomMember:function(){return k},blockChatRoomMembers:function(){return L},chatRoomBlockMulti:function(){return x},chatRoomBlockSingle:function(){return U},createChatRoom:function(){return l},deleteChatRoomSharedFile:function(){return ie},destroyChatRoom:function(){return d},disableSendChatRoomMsg:function(){return K},enableSendChatRoomMsg:function(){return q},fetchChatRoomAnnouncement:function(){return re},fetchChatRoomSharedFileList:function(){return ae},getChatRoomAdmin:function(){return R},getChatRoomAllowlist:function(){return Q},getChatRoomAttributes:function(){return ce},getChatRoomBlacklist:function(){return F},getChatRoomBlacklistNew:function(){return H},getChatRoomBlocklist:function(){return W},getChatRoomDetails:function(){return p},getChatRoomMuteList:function(){return w},getChatRoomMuted:function(){return M},getChatRoomMutelist:function(){return P},getChatRoomSharedFilelist:function(){return se},getChatRoomWhitelist:function(){return Y},getChatRooms:function(){return u},getJoinedChatRooms:function(){return he},isChatRoomWhiteUser:function(){return $},isInChatRoomAllowlist:function(){return ee},isInChatRoomMutelist:function(){return te},joinChatRoom:function(){return y},leaveChatRoom:function(){return T},listChatRoomMember:function(){return I},listChatRoomMembers:function(){return O},modifyChatRoom:function(){return h},muteChatRoomMember:function(){return S},quitChatRoom:function(){return _},removeChatRoomAdmin:function(){return N},removeChatRoomAllowlistMember:function(){return Z},removeChatRoomAttribute:function(){return pe},removeChatRoomAttributes:function(){return de},removeChatRoomBlockMulti:function(){return B},removeChatRoomBlockSingle:function(){return D},removeChatRoomMember:function(){return m},removeChatRoomMembers:function(){return v},removeChatRoomWhitelistMember:function(){return J},removeMultiChatRoomMember:function(){return g},removeMuteChatRoomMember:function(){return b},removeSingleChatRoomMember:function(){return f},rmUsersFromChatRoomWhitelist:function(){return X},setChatRoomAdmin:function(){return C},setChatRoomAttribute:function(){return le},setChatRoomAttributes:function(){return ue},unblockChatRoomMember:function(){return j},unblockChatRoomMembers:function(){return G},unmuteChatRoomMember:function(){return A},updateChatRoomAnnouncement:function(){return ne},uploadChatRoomSharedFile:function(){return oe}}),r(1539),r(8674),r(8309),r(2526),r(1817),r(2222),r(9753),r(9600),r(1249),r(4916),r(3123),r(2165),r(6992),r(8783),r(3948);var n=r(5531),o=r(4024),i=r(3246),a=r(7360),s=r(1595);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e){var t=this;if("number"!=typeof e.pagenum||"number"!=typeof e.pagesize)throw Error("Invalid parameter");var r=i.XZ.call(this).error;if(r)return Promise.reject(r);var c={pagenum:e.pagenum||1,pagesize:e.pagesize||20},u=this.context,l=u.orgName,d=u.appName,p=u.accessToken,h={url:this.apiUrl+"/"+l+"/"+d+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+p},data:c,success:function(t){"function"==typeof e.success&&e.success(t)},error:function(r){r.error&&r.error_description&&t.onError&&t.onError({type:n.E.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:r.error_description,data:r}),"function"==typeof e.error&&e.error(r)}};return a.kg.debug("Call getChatRooms",e),o.hj.call(this,h,s.fI.GET_CHATROOM_LIST)}function l(e){if("string"!=typeof e.name)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r={name:e.name,description:e.description,maxusers:e.maxusers,owner:this.user,members:e.members},n=this.context,c=n.orgName,u=n.appName,l=n.accessToken,d=n.jid,p={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/chatrooms?resource=").concat(d.clientResource),dataType:"json",type:"POST",data:JSON.stringify(r),headers:{Authorization:"Bearer "+(e.token||l),"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call createChatRoom",e),o.hj.call(this,p,s.fI.CREATE_CHATROOM)}function d(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(e.chatRoomId,"?resource=").concat(l.clientResource,"&version=v3"),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+(e.token||u)},success:e.success,error:e.error};return a.kg.debug("Call destroyChatRoom",e),o.hj.call(this,d,s.fI.DESTROY_CHATROOM)}function p(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getChatRoomDetails",e),o.hj.call(this,l,s.fI.GET_CHATROOM_DETAIL)}function h(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={groupname:e.chatRoomName,description:e.description,maxusers:e.maxusers},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"?resource=").concat(l.clientResource),type:"PUT",data:JSON.stringify(p),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call modifyChatRoom",e),o.hj.call(this,h,s.fI.MODIFY_CHATROOM)}function f(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||"string"!=typeof e.username)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeChatRoomMember",e),o.hj.call(this,h,s.fI.REMOVE_CHATROOM_MEMBER)}var m=f;function g(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=e.chatRoomId,n=e.users.join(","),c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.jid,h={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatrooms/").concat(r,"/users/").concat(n,"?resource=").concat(p.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+d,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeChatRoomMembers",e),o.hj.call(this,h,s.fI.MULTI_REMOVE_CHATROOM_MEMBER)}var v=g;function E(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=e.chatRoomId,n={usernames:e.users},c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.jid,h={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatrooms/").concat(r,"/users?resource=").concat(p.clientResource),type:"POST",data:JSON.stringify(n),dataType:"json",headers:{Authorization:"Bearer "+d,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call addUsersToChatRoom",e),o.hj.call(this,h,s.fI.ADD_USERS_TO_CHATROOM)}function y(e){var t=e.roomId,r=e.message,o=void 0===r?"":r,s=e.ext,c=void 0===s?"":s,u=e.leaveOtherRooms,l=void 0!==u&&u,d=e.success,p=e.error;if("string"!=typeof t||""===t)throw Error("Invalid parameter roomId");if("string"!=typeof c)throw Error("Invalid parameter ext");if("boolean"!=typeof l)throw Error("Invalid parameter leaveOtherRooms");var h=i.XZ.call(this).error;return h?Promise.reject(h):(a.kg.debug("Call joinChatRoom",e),this.logOut?Promise.reject({type:n.E.WEBIM_CONNECTION_CLOSED,message:"not login"}):this.mSync.handleChatRoom({roomId:t,ext:c,leaveOtherRooms:l,message:o,success:d,errorCb:p},"join"))}function _(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");var t=i.XZ.call(this).error;return t?Promise.reject(t):(a.kg.debug("Call leaveChatRoom",e),this.logOut?Promise.reject({type:n.E.WEBIM_CONNECTION_CLOSED,message:"not login"}):this.mSync.handleChatRoom(e,"leave"))}var T=_;function I(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r={pagenum:e.pageNum,pagesize:e.pageSize},n=this.context,c=n.orgName,u=n.appName,l=n.accessToken,d={url:this.apiUrl+"/"+c+"/"+u+"/chatrooms/"+e.chatRoomId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call listChatRoomMembers",e),o.hj.call(this,d,s.fI.LIST_CHATROOM_MEMBERS)}var O=I;function R(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.chatRoomId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+l+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getChatRoomAdmin",e),o.hj.call(this,d,s.fI.GET_CHATROOM_ADMIN)}function C(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={newadmin:e.username},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/admin?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call setChatRoomAdmin",e),o.hj.call(this,h,s.fI.SET_CHATROOM_ADMIN)}function N(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/admin/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeChatRoomAdmin",e),o.hj.call(this,h,s.fI.REMOVE_CHATROOM_ADMIN)}function S(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={usernames:[e.username],mute_duration:e.muteDuration},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/mute?resource=").concat(l.clientResource),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},data:JSON.stringify(p),success:e.success,error:e.error};return a.kg.debug("Call muteChatRoomMember",e),o.hj.call(this,h,s.fI.MUTE_CHATROOM_MEMBER)}function b(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/mute/").concat(p,"?resource=").concat(l.clientResource),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call unmuteChatRoomMember",e),o.hj.call(this,h,s.fI.REMOVE_MUTE_CHATROOM_MEMBER)}var A=b;function M(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.chatRoomId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+l+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getChatRoomMutelist",e),o.hj.call(this,d,s.fI.GET_MUTE_CHATROOM_MEMBERS)}var w=M,P=M;function U(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call blockChatRoomMember",e),o.hj.call(this,h,s.fI.SET_CHATROOM_MEMBER_TO_BLACK)}var k=U;function x(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={usernames:e.usernames},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/blocks/users?resource=").concat(l.clientResource),data:JSON.stringify(p),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Chat blockChatRoomMembers:",h),o.hj.call(this,h,s.fI.MULTI_SET_CHATROOM_MEMBER_TO_BLACK)}var L=x;function D(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call unblockChatRoomMember",e),o.hj.call(this,h,s.fI.REMOVE_CHATROOM_MEMBER_BLACK)}var j=D;function B(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p=e.usernames.join(","),h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call unblockChatRoomMembers",e),o.hj.call(this,h,s.fI.MULTI_REMOVE_CHATROOM_MEMBER_BLACK)}var G=B;function H(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.chatRoomId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+l+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getChatRoomBlocklist",e),o.hj.call(this,d,s.fI.GET_CHATROOM_BLOCK_MEMBERS)}var F=H,W=H;function K(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/ban?resource=").concat(l.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call disableSendChatRoomMsg",e),o.hj.call(this,p,s.fI.DISABLED_CHATROOM_SEND_MSG)}function q(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/ban?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call enableSendChatRoomMsg",e),o.hj.call(this,p,s.fI.ENABLE_CHATROOM_SEND_MSG)}function z(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={usernames:e.users},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/white/users?resource=").concat(l.clientResource),type:"POST",data:JSON.stringify(p),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call addUsersToChatRoomWhitelist",e),o.hj.call(this,h,s.fI.ADD_USERS_TO_CHATROOM)}var V=z;function X(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.chatRoomId,p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/white/users/").concat(e.userName,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeChatRoomAllowlistMember",e),o.hj.call(this,p,s.fI.REMOVE_CHATROOM_WHITE_USERS)}var J=X,Z=X;function Y(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.chatRoomId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+l+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getChatRoomAllowlist",e),o.hj.call(this,d,s.fI.GET_CHATROOM_WHITE_USERS)}var Q=Y;function $(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.chatRoomId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatrooms/"+l+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call isInChatRoomAllowlist",e),o.hj.call(this,d,s.fI.CHECK_CHATROOM_WHITE_USER)}var ee=$;function te(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,s=r.appName,c=r.accessToken,u=r.userId,l={url:this.apiUrl+"/"+n+"/"+s+"/sdk/chatrooms/"+e.chatRoomId+"/mute/"+u,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+c}};return a.kg.debug("Call isInChatRoomMutelist",e),o.hj.call(this,l).then((function(e){return{type:e.type,data:e.data}}))}function re(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.roomId,d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(l,"/announcement"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call fetchChatRoomAnnouncement",e),o.hj.call(this,d,s.fI.GET_CHATROOM_ANN)}function ne(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.roomId,p={announcement:e.announcement},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/announcement?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call updateChatRoomAnnouncement:",e),o.hj.call(this,h,s.fI.UPDATE_CHATROOM_ANN)}function oe(e){var t;if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("object"!==c(e.file))throw Error('Invalid parameter: "file"');var r=i.XZ.call(this).error;if(r)return null===(t=e.onFileUploadError)||void 0===t?void 0:t.call(e,r);var n=this.context,u=n.orgName,l=n.appName,d=n.accessToken,p=n.jid,h=e.roomId;o.cT.call(this,{uploadUrl:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatrooms/").concat(h,"/share_files?resource=").concat(p.clientResource),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:d,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey,to:h,chatType:"chatRoom"},s.fI.UPLOAD_CHATROOM_FILE),a.kg.debug("Call uploadChatRoomSharedFile",e)}function ie(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "fileId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.roomId,p=e.fileId,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(d,"/share_files/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call deleteChatRoomSharedFile",e),o.hj.call(this,h,s.fI.DELETE_CHATROOM_FILE)}function ae(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.roomId,d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatrooms/").concat(l,"/share_files"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json",accept:"application/json"},success:e.success,error:e.error};return a.kg.debug("Call fetchChatRoomSharedFileList",e),o.hj.call(this,d,s.fI.GET_CHATROOM_FILES)}var se=ae;function ce(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if(e.attributeKeys&&!Array.isArray(e.attributeKeys))throw Error('"Invalid parameter attributeKeys": '+e.attributeKeys);var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=(r.jid,e.chatRoomId),d={keys:e.attributeKeys},p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/metadata/chatroom/").concat(l),type:"POST",dataType:"json",data:JSON.stringify(d),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}};return a.kg.debug("Call getChatRoomAttributes:",e),o.hj.call(this,p,s.fI.GET_CHATROOM_ATTR).then((function(e){return{data:e.data,type:e.type}}))}function ue(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("object"!==c(e.attributes))throw Error("Invalid parameter attributes: "+e.attributes);var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,u=r.appName,l=r.accessToken,d=r.userId,p=e.chatRoomId,h=e.attributes,f=e.autoDelete,m=void 0===f||f,g=e.isForced?"/forced":"",v={metaData:h,autoDelete:m?"DELETE":"NO_DELETE"},E={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(u,"/metadata/chatroom/").concat(p,"/user/").concat(d)+g,type:"PUT",dataType:"json",data:JSON.stringify(v),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"}};return a.kg.debug("Call setChatRoomAttributes:",e),o.hj.call(this,E,s.fI.SET_CHATROOM_ATTR).then((function(e){return(0,i._W)(e)}))}function le(e){var t;if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("string"!=typeof e.attributeKey||""===e.attributeKey)throw Error("Invalid parameter attributeKey: "+e.attributeKey);if("string"!=typeof e.attributeValue||""===e.attributeValue)throw Error("Invalid parameter attributeValue: "+e.attributeValue);var r=i.XZ.call(this).error;if(r)return Promise.reject(r);var n=this.context,c=n.orgName,u=n.appName,l=n.accessToken,d=n.userId,p=e.chatRoomId,h=e.attributeKey,f=e.attributeValue,m=e.autoDelete,g=void 0===m||m,v=e.isForced?"/forced":"",E={metaData:(t={},t[h]=f,t),autoDelete:g?"DELETE":"NO_DELETE"},y={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/metadata/chatroom/").concat(p,"/user/").concat(d)+v,type:"PUT",dataType:"json",data:JSON.stringify(E),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"}};return a.kg.debug("Call setChatRoomAttribute:",e),o.hj.call(this,y,s.fI.SET_CHATROOM_ATTR).then((function(e){var t=(0,i.H7)(e);if(t)throw t}))}function de(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if(!Array.isArray(e.attributeKeys))throw Error('"Invalid parameter attributes": '+e.attributeKeys);var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.userId,d=e.chatRoomId,p=e.attributeKeys,h=e.isForced?"/forced":"",f={keys:p},m={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/metadata/chatroom/").concat(d,"/user/").concat(l)+h,type:"DELETE",dataType:"json",data:JSON.stringify(f),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}};return a.kg.debug("Call removeChatRoomAttributes:",e),o.hj.call(this,m,s.fI.DELETE_CHATROOM_ATTR).then((function(e){return(0,i._W)(e)}))}function pe(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("string"!=typeof e.attributeKey||""===e.attributeKey)throw Error('"Invalid parameter attributeKey": '+e.attributeKey);var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.userId,d=e.chatRoomId,p=e.attributeKey,h=e.isForced?"/forced":"",f={keys:[p]},m={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/metadata/chatroom/").concat(d,"/user/").concat(l)+h,type:"DELETE",dataType:"json",data:JSON.stringify(f),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}};return a.kg.debug("Call removeChatRoomAttribute:",e),o.hj.call(this,m,s.fI.DELETE_CHATROOM_ATTR).then((function(e){var t=(0,i.H7)(e);if(t)throw t}))}function he(e){var t=this,r=e||{},n=r.pageNum,c=r.pageSize;if(isNaN(n)||n<=0)throw Error("Invalid parameter pageNum:".concat(n));if(isNaN(c)||c<=0)throw Error("Invalid parameter pageSize:".concat(c));var u=i.XZ.call(this).error;if(u)return Promise.reject(u);var l={pagenum:n,pagesize:c,detail:!0},d=this.context,p=d.orgName,h=d.appName,f=d.accessToken,m={url:"".concat(this.apiUrl,"/").concat(p,"/").concat(h,"/users/").concat(this.user,"/joined_chatrooms"),dataType:"json",type:"GET",data:l,headers:{Authorization:"Bearer "+f,"Content-Type":"application/json"}};return a.kg.debug("Call getJoinedChatRooms",e),o.hj.call(this,m,s.fI.GET_USER_JOINED_CHATROOM).then((function(e){var r=(e.data||[]).map((function(e){var r=e.id,n=e.title,o=e.owner,i=e.created,a=e.description,s=e.max_users;return{id:r,name:n,owner:o.split("".concat(t.appKey,"_"))[1],created:i,description:a,maxusers:s}}));return{type:e.type,data:r}}))}},4363:function(e,t,r){"use strict";r.d(t,{U:function(){return s},w:function(){return c}}),r(9601),r(2772),r(1249);var n=r(7360),o=r(8161),i=r(4024),a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)},s={chat:"singleChat",chatroom:"chatRoom",groupchat:"groupChat",singleChat:"singleChat",chatRoom:"chatRoom",groupChat:"groupChat"};function c(e,t){var r,c,u,l=t||{},d=l.formatCustomExts,p=void 0===d||d,h=l.formatChatType,f=void 0!==h&&h,m=e.id,g=e.payload,v=e.timestamp,E=e.to,y=g.bodies&&g.bodies.length>0?g.bodies[0]:{},_={},T={},I=g.type?g.type:E.indexOf("@conference.easemob.com")>-1?"groupChat":"singleChat";I="chat"===I?"singleChat":I,f&&g.type&&(I=s[g.type]);var O="";switch(y.type){case"txt":Object.prototype.hasOwnProperty.call(y,"subType")&&"sub_combine"===y.subType?(O=o.t6.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"combine",chatType:I,to:g.to,from:g.from,ext:g.ext,time:v,title:y.title||"",summary:y.summary||"",url:O||"",secret:y.secret||"",file_length:y.file_length||0,filename:y.filename||"",compatibleText:y.msg,combineLevel:y.combineLevel||0}):_={id:m,type:"txt",chatType:I,msg:y.msg||"",to:g.to||"",from:g.from,time:v,ext:g.ext};break;case"img":O=this.useOwnUploadFun?null==y?void 0:y.url:o.t6.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"img",chatType:I,to:g.to,from:g.from,time:v,ext:g.ext,width:(null===(r=y.size)||void 0===r?void 0:r.width)||0,height:(null===(c=y.size)||void 0===c?void 0:c.height)||0,thumb:this.useOwnUploadFun?"":"".concat(O,"&thumbnail=true"),thumb_secret:y.secret,secret:y.secret||"",url:O||"",file_length:y.file_length||0,file:{},isGif:"sub_gif"===y.subType};break;case"video":O=this.useOwnUploadFun?null==y?void 0:y.url:o.t6.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"video",chatType:I,from:g.from,to:g.to,thumb:i.P6.formatAttachUrl.call(this,y.thumb),thumb_secret:y.thumb_secret||"",url:O||"",secret:y.secret||"",filename:y.filename,length:y.length||0,file:{},file_length:y.file_length||0,filetype:g.ext.file_type||"",ext:g.ext,time:v};break;case"loc":_={id:m,type:"loc",chatType:I,from:g.from,to:g.to,buildingName:y.buildingName||"",addr:y.addr,lat:y.lat,lng:y.lng,ext:g.ext,time:v};break;case"audio":O=this.useOwnUploadFun?null==y?void 0:y.url:o.t6.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"audio",chatType:I,from:g.from,to:g.to,secret:y.secret||"",ext:g.ext,time:v,url:O||"",file:{},filename:y.filename,length:y.length||0,file_length:y.file_length||0,filetype:g.ext.file_type||""};break;case"file":O=this.useOwnUploadFun?null==y?void 0:y.url:o.t6.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"file",chatType:I,from:g.from,to:g.to,ext:g.ext,time:v,url:O||"",secret:y.secret||"",file:{},filename:y.filename||"",file_length:y.file_length||0,filetype:g.ext.file_type||""};break;case"cmd":_={id:m,type:"cmd",chatType:I,from:g.from,to:g.to,ext:g.ext,time:v,action:y.action||""};break;case"custom":var R=y.customExts||{};p&&y.customExts&&(R={},y.customExts.map((function(e){R=a(a({},R),e)}))),_={id:m,type:"custom",chatType:I,from:g.from,to:g.to,ext:g.ext,time:v,customEvent:y.customEvent||"",customExts:R};break;case"combine":O=o.t6.call(this,{remotePath:null==y?void 0:y.url,secret:null==y?void 0:y.secret}),_={id:m,type:"combine",chatType:I,msg:y.msg||"",to:g.to||"",from:g.from,time:v,ext:g.ext,title:y.title||"",summary:y.summary||"",url:O||"",compatibleText:y.text,combineLevel:y.combineLevel||0,secret:y.secret||"",filename:y.filename||"",file_length:y.file_length||0};break;default:n.kg.error("unexpected message: ".concat(e))}if(g.msgConfig&&(T.msgConfig=g.msgConfig),null==g?void 0:g.meta){var C=g.meta;C.thread&&(T.chatThread={messageId:C.thread.msg_parent_id,parentId:C.thread.muc_parent_id,chatThreadName:C.thread.thread_name}),C.reaction&&(T.reactions=C.reaction),C.translations&&(T.translations=C.translations)}var N=null===(u=null==g?void 0:g.meta)||void 0===u?void 0:u.edit_msg;if(N){var S=N.edit_time,b=N.operator,A=N.count;_.modifiedInfo={operationTime:S,operatorId:b,operationCount:A}}return a(a({},_),T)}},2856:function(e,t,r){"use strict";r.r(t),r.d(t,{acceptGroupInvite:function(){return W},acceptGroupJoinRequest:function(){return B},addUsersToGroupAllowlist:function(){return ve},addUsersToGroupWhitelist:function(){return ge},agreeInviteIntoGroup:function(){return F},agreeJoinGroup:function(){return j},blockGroup:function(){return f},blockGroupMember:function(){return oe},blockGroupMembers:function(){return ae},blockGroupMessages:function(){return m},changeGroupOwner:function(){return T},changeOwner:function(){return _},createGroup:function(){return p},createGroupNew:function(){return d},createGroupVNext:function(){return h},deleteGroupSharedFile:function(){return we},destroyGroup:function(){return P},disableSendGroupMsg:function(){return fe},dissolveGroup:function(){return w},downloadGroupSharedFile:function(){return ke},enableSendGroupMsg:function(){return me},fetchGroupAnnouncement:function(){return be},fetchGroupSharedFileList:function(){return Pe},getGroup:function(){return E},getGroupAdmin:function(){return N},getGroupAllowlist:function(){return Ie},getGroupBlacklist:function(){return pe},getGroupBlacklistNew:function(){return de},getGroupBlocklist:function(){return he},getGroupInfo:function(){return I},getGroupMemberAttributes:function(){return Le},getGroupMembersAttributes:function(){return De},getGroupMsgReadUser:function(){return Se},getGroupMuteList:function(){return te},getGroupMutelist:function(){return re},getGroupSharedFilelist:function(){return Ue},getGroupWhitelist:function(){return Te},getJoinedGroups:function(){return y},getMuted:function(){return ee},getPublicGroups:function(){return v},groupBlockMulti:function(){return ie},groupBlockSingle:function(){return ne},inviteToGroup:function(){return x},inviteUsersToGroup:function(){return L},isGroupWhiteUser:function(){return Oe},isInGroupAllowlist:function(){return Ce},isInGroupMutelist:function(){return Ne},isInGroupWhiteList:function(){return Re},joinGroup:function(){return D},leaveGroup:function(){return k},listGroupMember:function(){return R},listGroupMembers:function(){return C},listGroups:function(){return g},modifyGroup:function(){return O},mute:function(){return Z},muteGroupMember:function(){return Y},quitGroup:function(){return U},rejectGroupInvite:function(){return q},rejectGroupJoinRequest:function(){return H},rejectInviteIntoGroup:function(){return K},rejectJoinGroup:function(){return G},removeAdmin:function(){return A},removeGroupAdmin:function(){return M},removeGroupAllowlistMember:function(){return _e},removeGroupBlockMulti:function(){return ue},removeGroupBlockSingle:function(){return se},removeGroupMember:function(){return V},removeGroupMembers:function(){return J},removeGroupWhitelistMember:function(){return ye},removeMultiGroupMember:function(){return X},removeMute:function(){return Q},removeSingleGroupMember:function(){return z},rmUsersFromGroupWhitelist:function(){return Ee},setAdmin:function(){return S},setGroupAdmin:function(){return b},setGroupMemberAttributes:function(){return xe},unblockGroupMember:function(){return ce},unblockGroupMembers:function(){return le},unmuteGroupMember:function(){return $},updateGroupAnnouncement:function(){return Ae},uploadGroupSharedFile:function(){return Me}}),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(2222),r(6699),r(2023),r(9554),r(4747),r(8309),r(9753),r(9600);var n=r(5531),o=r(4024),i=r(3246),a=r(7360),s=r(1595);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}var u=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},l=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function d(e){if(!e||!e.data)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups?resource=").concat(l.clientResource),dataType:"json",type:"POST",data:JSON.stringify({owner:this.user,groupname:e.data.groupname,avatar:e.data.avatar,desc:e.data.desc,members:e.data.members,public:e.data.public,approval:e.data.approval,allowinvites:e.data.allowinvites,invite_need_confirm:e.data.inviteNeedConfirm,maxusers:e.data.maxusers,custom:e.data.ext}),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:function(t){e.success&&e.success(t)},error:e.error};return a.kg.debug("Call createGroup:",e),o.hj.call(this,d,s.fI.CREATE_GROUP)}var p=d;function h(e){var t,r,c,u,l,d,p,h,f;if(!e)throw Error("Invalid parameter");var m=i.XZ.call(this).error;if(m)return Promise.reject(m);var g=this.context,v=g.orgName,E=g.appName,y=g.accessToken,_=g.jid,T={url:"".concat(this.apiUrl,"/").concat(v,"/").concat(E,"/chatgroups?resource=").concat(_.clientResource),dataType:"json",type:"POST",data:JSON.stringify({owner:this.user,groupname:null!==(t=e.groupName)&&void 0!==t?t:"",avatar:null!==(r=e.avatar)&&void 0!==r?r:"",desc:null!==(c=e.description)&&void 0!==c?c:"",members:e.members,public:null!==(u=e.isPublic)&&void 0!==u&&u,approval:null!==(l=e.needApprovalToJoin)&&void 0!==l&&l,allowinvites:null===(d=e.allowMemberToInvite)||void 0===d||d,invite_need_confirm:null!==(p=e.inviteNeedConfirm)&&void 0!==p&&p,maxusers:null!==(h=e.maxMemberCount)&&void 0!==h?h:200,custom:null!==(f=e.extension)&&void 0!==f?f:""}),headers:{Authorization:"Bearer "+y,"Content-Type":"application/json"}};return a.kg.debug("Call createGroupVNext:",e),o.hj.call(this,T,s.fI.CREATE_GROUP).then((function(e){return{type:n.E.REQUEST_SUCCESS,data:{groupId:e.data.groupid}}}))}function f(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");var r=i.XZ.call(this).error;if(r)return Promise.reject(r);var n=this.context,c=n.orgName,u=n.appName,l=n.accessToken,d=n.jid,p={entities:[(t={},t["notification_ignore_"+e.groupId]=!0,t)]},h={type:"PUT",url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(this.user,"?resource=").concat(d.clientResource),data:JSON.stringify(p),dataType:"json",headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call blockGroupMessages",e),o.hj.call(this,h,s.fI.BLOCK_GROUP)}var m=f;function g(e){if("number"!=typeof e.limit)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l={limit:e.limit,cursor:e.cursor};e.cursor||delete l.cursor;var d={url:this.apiUrl+"/"+n+"/"+c+"/publicchatgroups",type:"GET",dataType:"json",data:l,headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call listGroups",e),o.hj.call(this,d,s.fI.LIST_GROUP)}var v=g;function E(e){var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l={url:this.apiUrl+"/"+n+"/"+c+"/users/"+this.user+"/joined_chatgroups",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return a.kg.debug("Call getJoinedGroups",e),o.hj.call(this,l,s.fI.GET_USER_GROUP)}function y(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.needAffiliations||e.needRole?"/chatgroups/user/".concat(this.user,"?pagenum=").concat(e.pageNum,"&pagesize=").concat(e.pageSize,"&needAffiliations=").concat(e.needAffiliations,"&needRole=").concat(e.needRole):"/users/".concat(this.user,"/joined_chatgroups?pagenum=").concat(e.pageNum,"&pagesize=").concat(e.pageSize),d={url:this.apiUrl+"/"+n+"/"+c+l,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return a.kg.debug("Call getGroup",e),o.hj.call(this,d,s.fI.GET_USER_GROUP).then((function(e){var t=e.uri,r=e.entities,n=[];return t.includes("joined_chatgroups")||(r.forEach((function(e){var t={affiliationsCount:e.affiliations_count,groupName:e.name,groupId:e.groupId,role:e.permission,disabled:e.disabled,approval:e.membersonly,allowInvites:e.allowinvites,description:e.description,maxUsers:e.maxusers,public:e.public};n.push(t)})),e.entities=n),e}))}function _(e){if("string"!=typeof e.groupId||"string"!=typeof e.newOwner)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r={newowner:e.newOwner},n=this.context,c=n.orgName,u=n.appName,l=n.accessToken,d=n.jid,p={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/chatgroups/").concat(e.groupId,"?resource=").concat(d.clientResource),type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},data:JSON.stringify(r),success:e.success,error:e.error};return a.kg.debug("Call changeOwner",e),o.hj.call(this,p,s.fI.CHANGE_OWNER)}var T=_;function I(e){if("string"!=typeof e.groupId&&!Array.isArray(e.groupId))throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l={url:this.apiUrl+"/"+n+"/"+c+"/chatgroups/"+e.groupId+"?joined_time=true",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getGroupInfo",e),o.hj.call(this,l,s.fI.GET_GROUP_INFO)}function O(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={groupname:e.groupName,avatar:e.avatar,description:e.description,custom:e.ext},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"?resource=").concat(l.clientResource),type:"PUT",data:JSON.stringify(p),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call modifyGroup",e),o.hj.call(this,h,s.fI.MODIFY_GROUP)}function R(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r={pagenum:e.pageNum,pagesize:e.pageSize},n=this.context,c=n.orgName,u=n.appName,l=n.accessToken,d={url:this.apiUrl+"/"+c+"/"+u+"/chatgroups/"+e.groupId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call listGroupMember",e),o.hj.call(this,d,s.fI.LIST_GROUP_MEMBER)}var C=R;function N(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatgroups/"+l+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getGroupAdmin",e),o.hj.call(this,d,s.fI.GET_GROUP_ADMIN)}function S(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={newadmin:e.username},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/admin?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call setGroupAdmin",e),o.hj.call(this,h,s.fI.SET_GROUP_ADMIN)}var b=S;function A(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/admin/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeAdmin",e),o.hj.call(this,h,s.fI.REMOVE_GROUP_ADMIN)}var M=A;function w(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"?version=v3&resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call destroyGroup",e),o.hj.call(this,p,s.fI.DISSOLVE_GROUP)}var P=w;function U(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/quit?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call quitGroup",e),o.hj.call(this,p,s.fI.QUIT_GROUP)}var k=U;function x(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=e.groupId,n={usernames:e.users},c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.jid,h={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatgroups/").concat(r,"/invite?resource=").concat(p.clientResource),type:"POST",data:JSON.stringify(n),dataType:"json",headers:{Authorization:"Bearer "+d,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call inviteUsersToGroup",e),o.hj.call(this,h,s.fI.INVITE_TO_GROUP)}var L=x;function D(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(e.groupId,"/apply?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify({message:e.message||""}),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call joinGroup",e),o.hj.call(this,d,s.fI.JOIN_GROUP)}function j(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={applicant:e.applicant,verifyResult:!0,reason:"no clue"},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/apply_verify?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call agreeJoinGroup",e),o.hj.call(this,h,s.fI.AGREE_JOIN_GROUP)}var B=j;function G(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={applicant:e.applicant,verifyResult:!1,reason:e.reason||""},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/apply_verify?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call rejectGroupJoinRequest",e),o.hj.call(this,h,s.fI.REJECT_JOIN_GROUP)}var H=G;function F(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={invitee:e.invitee,verifyResult:!0},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/invite_verify?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call acceptGroupInvite",e),o.hj.call(this,h,s.fI.AGREE_INVITE_GROUP)}var W=F;function K(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={invitee:e.invitee,verifyResult:!1},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/invite_verify?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call rejectGroupInvite",e),o.hj.call(this,h,s.fI.REJECT_INVITE_GROUP)}var q=K;function z(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=e.groupId,n=e.username,c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.jid,h={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatgroups/").concat(r,"/users/").concat(n,"?resource=").concat(p.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+d,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeGroupMember",e),o.hj.call(this,h,s.fI.REMOVE_GROUP_MEMBER)}var V=z;function X(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.users.join(","),h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeGroupMembers",e),o.hj.call(this,h,s.fI.MULTI_REMOVE_GROUP_MEMBER)}var J=X;function Z(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!(Array.isArray(e.username)||"string"==typeof e.username&&""!==e.username))throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={usernames:"string"==typeof e.username?[e.username]:e.username,mute_duration:e.muteDuration},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/mute?resource=").concat(l.clientResource),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},data:JSON.stringify(p),success:e.success,error:e.error};return a.kg.debug("Call muteGroupMember",e),o.hj.call(this,h,s.fI.MUTE_GROUP_MEMBER)}var Y=Z;function Q(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!(Array.isArray(e.username)||"string"==typeof e.username&&""!==e.username))throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/mute/").concat(p,"?resource=").concat(l.clientResource),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call unmuteGroupMember",e),o.hj.call(this,h,s.fI.UNMUTE_GROUP_MEMBER)}var $=Q;function ee(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatgroups/"+l+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getGroupMuteList",e),o.hj.call(this,d,s.fI.GET_GROUP_MUTE_LIST)}var te=ee,re=ee;function ne(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call blockGroupMember",e),o.hj.call(this,h,s.fI.BLOCK_GROUP_MEMBER)}var oe=ne;function ie(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={usernames:e.usernames},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/blocks/users?resource=").concat(l.clientResource),data:JSON.stringify(p),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call blockGroupMembers",e),o.hj.call(this,h,s.fI.BLOCK_GROUP_MEMBERS)}var ae=ie;function se(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.username,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call unblockGroupMember",e),o.hj.call(this,h,s.fI.UNBLOCK_GROUP_MEMBER)}var ce=se;function ue(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.usernames.join(","),h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/blocks/users/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call unblockGroupMembers",e),o.hj.call(this,h,s.fI.UNBLOCK_GROUP_MEMBERS)}var le=ue;function de(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatgroups/"+l+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getGroupBlacklist",e),o.hj.call(this,d,s.fI.GET_GROUP_BLACK_LIST)}var pe=de,he=de;function fe(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/ban?resource=").concat(l.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call disableSendGroupMsg",e),o.hj.call(this,p,s.fI.DISABLED_SEND_GROUP_MSG)}function me(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/ban?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call enableSendGroupMsg",e),o.hj.call(this,p,s.fI.ENABLE_SEND_GROUP_MSG)}function ge(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={usernames:e.users},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/white/users?resource=").concat(l.clientResource),type:"POST",data:JSON.stringify(p),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call addUsersToGroupWhitelist",e),o.hj.call(this,h,s.fI.ADD_USERS_TO_GROUP_WHITE)}var ve=ge;function Ee(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/white/users/").concat(e.userName,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call removeGroupAllowlistMember",e),o.hj.call(this,p,s.fI.REMOVE_GROUP_WHITE_MEMBER)}var ye=Ee,_e=Ee;function Te(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatgroups/"+l+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getGroupAllowlist",e),o.hj.call(this,d,s.fI.GET_GROUP_WHITE_LIST)}var Ie=Te;function Oe(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:this.apiUrl+"/"+n+"/"+c+"/chatgroups/"+l+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call isInGroupAllowlist",e),o.hj.call(this,d,s.fI.IS_IN_GROUP_WHITE_LIST)}var Re=Oe,Ce=Oe;function Ne(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,s=r.appName,c=r.accessToken,u=r.userId,l={url:this.apiUrl+"/"+n+"/"+s+"/sdk/chatgroups/"+e.groupId+"/mute/"+u,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+c}};return a.kg.debug("Call isInGroupMutelist",e),o.hj.call(this,l).then((function(e){return{type:e.type,data:e.data}}))}function Se(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.msgId||""===e.msgId)throw Error('Invalid parameter: "msgId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l={url:this.apiUrl+"/"+n+"/"+c+"/chatgroups/"+e.groupId+"/acks/"+e.msgId,dataType:"json",type:"GET",data:{limit:500,key:void 0},headers:{Authorization:"Bearer "+u},success:e.success,error:e.error};return a.kg.debug("Call getGroupMsgReadUser",e),o.hj.call(this,l,s.fI.GET_GROUP_MSG_READ_USER)}function be(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.groupId,d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(l,"/announcement"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call fetchGroupAnnouncement",e),o.hj.call(this,d,s.fI.GET_GROUP_ANN)}function Ae(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p={announcement:e.announcement},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/announcement?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call updateGroupAnnouncement",e),o.hj.call(this,h,s.fI.UPDATE_GROUP_ANN)}function Me(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("object"!==c(e.file))throw Error('Invalid parameter: "file"');var r=i.XZ.call(this).error;if(r)return null===(t=e.onFileUploadError)||void 0===t?void 0:t.call(e,r);var n=this.context,u=n.orgName,l=n.appName,d=n.accessToken,p=n.jid,h=e.groupId;o.cT.call(this,{uploadUrl:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/chatgroups/").concat(h,"/share_files?resource=").concat(p.clientResource),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:d,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey,to:h,chatType:"groupChat"},s.fI.UPLOAD_GROUP_FILE),a.kg.debug("Call uploadGroupSharedFile",e)}function we(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "file"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=r.jid,d=e.groupId,p=e.fileId,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(d,"/share_files/").concat(p,"?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call deleteGroupSharedFile",e),o.hj.call(this,h,s.fI.DELETE_GROUP_FILE)}function Pe(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=i.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,c=r.appName,u=r.accessToken,l=e.pageNum||1,d=e.pageSize||10,p=e.groupId,h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(c,"/chatgroups/").concat(p,"/share_files?pagenum=").concat(l,"&pagesize=").concat(d),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return a.kg.debug("Call getGroupSharedFilelist",e),o.hj.call(this,h,s.fI.GET_GROUP_FILE_LIST)}var Ue=Pe;function ke(e){var t=this.context,r=t.orgName,n=t.appName,i=t.accessToken,c=this.apiUrl,u=e.groupId,l=e.fileId;o.LR.call(this,{url:"".concat(c,"/").concat(r,"/").concat(n,"/chatgroups/").concat(u,"/share_files/").concat(l),onFileDownloadComplete:e.onFileDownloadComplete,onFileDownloadError:e.onFileDownloadError,accessToken:i,id:l,secret:e.secret},s.fI.DOWN_GROUP_FILE),a.kg.debug("Call downloadGroupSharedFile",e)}function xe(e){return u(this,void 0,void 0,(function(){var t,r,n,u,d,p,h,f,m,g,v;return l(this,(function(l){switch(l.label){case 0:if(t=e.groupId,r=e.userId,n=e.memberAttributes,"string"!=typeof t||""===t)throw Error('Invalid parameter: "groupId"');if("string"!=typeof r||""===r)throw Error('Invalid parameter: "userId"');if("object"!==c(n))throw Error('Invalid parameter: "memberAttributes"');return(u=i.XZ.call(this).error)?[2,Promise.reject(u)]:(d=this.context,p=d.orgName,h=d.appName,f=d.accessToken,m=d.jid,g={metaData:n},v={url:"".concat(this.apiUrl,"/").concat(p,"/").concat(h,"/sdk/metadata/chatgroup/").concat(t,"/user/").concat(r,"?resource=").concat(m.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(g),headers:{Authorization:"Bearer "+f,"Content-Type":"application/json"}},a.kg.debug("Call setGroupMemberAttributes",e),[4,o.hj.call(this,v,s.fI.SET_GROUP_MEMBER_ATTRS)]);case 1:return l.sent(),[2]}}))}))}function Le(e){var t=e.groupId,r=e.userId;return De.call(this,{groupId:t,userIds:[r]}).then((function(e){var t;return{type:e.type,data:null===(t=e.data)||void 0===t?void 0:t[r]}}))}function De(e){var t=e.groupId,r=e.userIds,n=e.keys,c=void 0===n?[]:n;if("string"!=typeof t||""===t)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(r)||(null==r?void 0:r.length)<=0)throw Error('Invalid parameter: "userIds"');if(!Array.isArray(c))throw Error('Invalid parameter: "keys"');var u=i.XZ.call(this).error;if(u)return Promise.reject(u);var l=this.context,d=l.orgName,p=l.appName,h=l.accessToken,f={targets:r,properties:c},m={url:"".concat(this.apiUrl,"/").concat(d,"/").concat(p,"/sdk/metadata/chatgroup/").concat(t,"/get"),type:"POST",dataType:"json",data:JSON.stringify(f),headers:{Authorization:"Bearer "+h,"Content-Type":"application/json"}};return a.kg.debug("Call getGroupMembersAttributes",e),o.hj.call(this,m,s.fI.GET_GROUP_MEMBER_ATTR).then((function(e){return{type:e.type,data:(null==e?void 0:e.data)||{}}}))}},7479:function(e,t,r){"use strict";r.r(t),r.d(t,{acceptContactInvite:function(){return K},acceptInvitation:function(){return W},addContact:function(){return G},addConversationMark:function(){return ge},addReaction:function(){return te},addToBlackList:function(){return V},addUsersToBlacklist:function(){return X},addUsersToBlocklist:function(){return J},declineContactInvite:function(){return z},declineInvitation:function(){return q},deleteAllMessagesAndConversations:function(){return _e},deleteContact:function(){return F},deleteConversation:function(){return w},deleteReaction:function(){return re},deleteSession:function(){return M},fetchHistoryMessages:function(){return D},fetchUserInfoById:function(){return k},getAllContacts:function(){return he},getBlacklist:function(){return T},getBlocklist:function(){return I},getContacts:function(){return R},getContactsWithCursor:function(){return fe},getConversationlist:function(){return b},getHistoryMessages:function(){return B},getReactionDetail:function(){return ie},getReactionList:function(){return ne},getReactionlist:function(){return oe},getRoster:function(){return O},getSelfIdsOnOtherPlatform:function(){return ye},getServerConversations:function(){return ce},getServerConversationsByFilter:function(){return Ee},getServerPinnedConversations:function(){return le},getServerPinnedMessages:function(){return Re},getSessionList:function(){return S},getTokenExpireTimestamp:function(){return L},modifyMessage:function(){return ee},pinConversation:function(){return de},pinMessage:function(){return Ie},recallMessage:function(){return $},removeConversationMark:function(){return ve},removeFromBlackList:function(){return Z},removeHistoryMessages:function(){return se},removeRoster:function(){return H},removeUserFromBlackList:function(){return Y},removeUserFromBlocklist:function(){return Q},reportMessage:function(){return ae},setContactRemark:function(){return pe},unbindPushToken:function(){return Ce},unpinMessage:function(){return Oe},updateCurrentUserNick:function(){return x},updateOwnUserInfo:function(){return P},updateUserInfo:function(){return U},uploadPushToken:function(){return N},uploadToken:function(){return C}}),r(9601),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(9554),r(4747),r(2222),r(7941),r(6699),r(3710),r(9714),r(9600),r(5069),r(561),r(9753),r(8309),r(1249),r(7327);var n=r(3246),o=r(5531),i=r(7252),a=r(4024),s=r(9937),c=r(8161),u=r(4188),l=r.n(u),d=r(7360),p=r(1595),h=r(4363),f=r(7288),m=r(9743),g=r(6801),v=function(){return v=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},v.apply(this,arguments)},E=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},y=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},_={singleChat:"chat",chatRoom:"chatroom",groupChat:"groupchat"};function T(e){var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c={url:this.apiUrl+"/"+o+"/"+i+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},success:function(t){var r={};t.data.forEach((function(e){r[e]={name:e}})),"function"==typeof(null==e?void 0:e.success)&&e.success(t)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return d.kg.debug("Call getBlocklist"),a.hj.call(this,c,p.fI.GET_BLACK_LIST)}var I=T,O=R;function R(e){var t=this,r=n.XZ.call(this).error;if(r)return Promise.reject(r);var o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+c},success:function(r){var n=[];r.data.forEach((function(e){n.push({name:e,subscription:"both",jid:t.context.jid})})),"function"==typeof(null==e?void 0:e.success)&&e.success(n)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return d.kg.debug("Call getContacts"),a.hj.call(this,u,p.fI.GET_CONTACTS)}function C(e){return d.kg.debug("Call uploadPushToken"),g.r.call(this,e)}var N=C;function S(e){var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/user_channels"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return d.kg.debug("Call getSessionList"),a.hj.call(this,c,p.fI.GET_SESSION_LIST)}function b(e){var t=this,r=n.XZ.call(this).error;if(r)return Promise.reject(r);var o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u=!!(e&&"number"==typeof e.pageNum&&"number"==typeof e.pageSize&&e.pageNum>0&&e.pageSize>0),l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/users/").concat(this.user,"/user_channels").concat(u?"/page":""),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return u&&(l.data={pageNum:e.pageNum,pageSize:e.pageSize}),d.kg.debug("Call getConversationlist"),a.hj.call(this,l,p.fI.GET_SESSION_LIST).then((function(e){return A.call(t,e)}))}function A(e){var t=this,r=e.data.channel_infos;return null==r||r.forEach((function(e){e.meta&&"{}"!==JSON.stringify(e.meta)?(e.meta.payload=JSON.parse(e.meta.payload),e.lastMessage=h.w.call(t,e.meta,{formatCustomExts:!1})):e.lastMessage=e.meta,delete e.meta})),e}function M(e){if(e&&"string"!=typeof e.channel)throw Error("Invalid parameter channel: ".concat(e.channel));if(e&&"singleChat"!==e.chatType&&"groupChat"!==e.chatType)throw Error("Invalid parameter chatType: ".concat(e.chatType));if(e&&"boolean"!=typeof e.deleteRoam)throw Error("Invalid parameter deleteRoam: ".concat(e.deleteRoam));var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r,o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u=o.jid;r="singleChat"===e.chatType?"chat":"groupChat";var l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/user/").concat(this.user,"/user_channel?resource=").concat(u.clientResource),dataType:"json",type:"DELETE",data:JSON.stringify({channel:e.channel,type:r,delete_roam:e.deleteRoam}),headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"},success:e.success,error:e.error};return d.kg.debug("Call deleteSession",e),a.hj.call(this,l,p.fI.DELETE_SESSION)}var w=M;function P(e,t){var r=n.XZ.call(this).error;if(r)return Promise.reject(r);var o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u=["nickname","avatarurl","mail","phone","gender","sign","birth","ext"],l={},h=a.P6.getEnvInfo();if("wx"===h.platform||"qq"===h.platform)if("string"==typeof e&&void 0!==t){if(!u.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");l[e]=t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");u.forEach((function(t){u.includes(t)&&void 0!==e[t]&&(l[t]=e[t])}))}else if("string"==typeof e){if(!u.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");l=e+"="+t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");var f=[];u.forEach((function(t){if(u.includes(t)&&void 0!==e[t]){var r=encodeURIComponent(t),n=encodeURIComponent(e[t]);f.push(r+"="+n)}})),l=f.join("&")}var m={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/metadata/user/").concat(this.user),type:"PUT",data:l,dataType:"json",headers:{Authorization:"Bearer "+c,"Content-Type":"application/x-www-form-urlencoded"}};return d.kg.debug("Call updateOwnUserInfo",e),a.hj.call(this,m,p.fI.UPDATE_USER_INFO)}var U=P;function k(e,t){var r=n.XZ.call(this).error;if(r)return Promise.reject(r);var o,i=this.context,s=i.orgName,c=i.appName,u=i.accessToken,l=[];if("string"==typeof e)l=[e];else{if("[object Array]"!==Object.prototype.toString.call(e))throw new Error("illegal params");l=e}o="string"==typeof t?[t]:t&&"[object Array]"===Object.prototype.toString.call(t)?t:["nickname","avatarurl","mail","phone","gender","sign","birth","ext"];var h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/metadata/user/get"),type:"POST",data:JSON.stringify({targets:l,properties:o}),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}};return d.kg.debug("Call fetchUserInfoById",e),a.hj.call(this,h,p.fI.GET_USER_INFO)}function x(e){var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user),type:"PUT",dataType:"json",data:JSON.stringify({nickname:e}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return d.kg.debug("Call updateCurrentUserNick",e),a.hj.call(this,c)}function L(e){if("string"!=typeof e||""===e)throw Error('Invalid parameter: "token"');var t=this.context,r=t.orgName,n=t.appName,o={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/sdk/users/").concat(this.user,"/token/expires"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return d.kg.debug("Call getTokenExpireTimestamp",e),a.hj.call(this,o,p.fI.SDK_INTERNAL)}function D(e){var t=this;return new Promise((function(r,o){if(!e.queue)throw Error('Invalid parameter: "specified"');var i=n.XZ.call(t).error;if(i)return Promise.reject(i);(function e(t){var n=this,i=t.count||20;j.call(this,{count:i,isGroup:!!t.isGroup,queue:t.queue,start:t.start,format:t.format,success:function(o){if(o.msgs.length>=i||o.is_last){var a=o.msgs.splice(0,i).reverse();t.success&&t.success(a),r(a)}else e.call(n,v(v({},t),{start:null}))},fail:function(e){o(e),t.fail&&t.fail(e)}})}).call(t,e),d.kg.debug("Call fetchHistoryMessages",e)}))}function j(e){var t=this,r=e.queue,n=this.mr_cache[r]||(this.mr_cache[r]={msgs:[]}),s=this.context.userId,u=e.start||-1,d=e.count||20;if(n.msgs.length>=d||n.is_last)"function"==typeof e.success&&e.success(n);else{n&&n.next_key&&(u=n.next_key),e.start&&(u=e.start);var h={queue:r+(e.isGroup?"@conference.easemob.com":"@easemob.com"),start:u,end:-1},f=this.context,m=f.orgName,g=f.appName,v={url:"".concat(this.apiUrl,"/").concat(m,"/").concat(g,"/users/").concat(s,"/messageroaming"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(h),success:function(r){return E(t,void 0,void 0,(function(){var t,o,i,a,s,u,d=this;return y(this,(function(p){switch(p.label){case 0:if(t=null==r?void 0:r.data,!r.data.msgs)return"function"==typeof e.success&&e.success(n),n.is_last=!0,n.next_key="",[2];o=t.msgs,i=o.length,n.is_last=t.is_last,n.next_key=t.next_key,a=function(t){return E(d,void 0,void 0,(function(){var r,n,o,i,a;return y(this,(function(s){switch(s.label){case 0:for(r=[],t=l().atob(t),n=0,o=t.length;n<o;++n)r.push(t.charCodeAt(n));return i=(i=this.context.root.lookup("easemob.pb.Meta")).decode(r),a={errorCode:0,reason:""},1!==i.ns?[3,2]:[4,c.ZP.call(this,i,a,!0,e.format)];case 1:return[2,s.sent()];case 2:return[2]}}))}))},s=0,p.label=1;case 1:return s<i?[4,a(o[s].msg)]:[3,4];case 2:(u=p.sent())&&n.msgs.push(u),p.label=3;case 3:return s++,[3,1];case 4:return"function"==typeof e.success&&e.success(n),[2]}}))}))},error:function(e){if(e.error&&e.error_description){var r=i.Z.create({type:o.E.WEBIM_CONNCTION_AJAX_ERROR,message:"fetch history messages error",data:e});t.onError&&t.onError(r)}}};a.hj.call(this,v,p.fI.GET_HISTORY_MSG).catch((function(t){"function"==typeof e.fail&&e.fail(t)}))}}function B(e){var t=this;return new Promise((function(r,o){var i=e.targetId,s=e.cursor,u=void 0===s?-1:s,p=e.pageSize,h=void 0===p?20:p,f=e.chatType,m=e.searchDirection,g=e.searchOptions,v=void 0===g?{}:g,_=v.msgTypes,T=void 0===_?[]:_,I=v.startTime,O=void 0===I?null:I,R=v.endTime,C=void 0===R?null:R,N=v.from,S=void 0===N?null:N;if("string"!=typeof i||""===i)throw Error('"Invalid parameter": "targetId"');if(S&&"string"!=typeof S)throw Error('"Invalid parameter": "searchOptions.from"');if(T&&!Array.isArray(T))throw Error('"Invalid parameter": "searchOptions.msgTypes"');if(O&&"number"!=typeof O)throw Error('"Invalid parameter": "searchOptions.startTime"');if(C&&"number"!=typeof O)throw Error('"Invalid parameter": "searchOptions.endTime"');var b=n.XZ.call(t).error;if(b)return Promise.reject(b);var A=t.context,M=A.orgName,w=A.appName,P=A.userId,U="singleChat"===e.chatType?"@easemob.com":"@conference.easemob.com",k={queue:"".concat(i).concat(U),start:u,pull_number:h,is_positive:"down"===m,msgType:T.join(",")||"",end:-1,startTime:O,endTime:C,userId:"singleChat"===f?null:S},x={url:"".concat(t.apiUrl,"/").concat(M,"/").concat(w,"/users/").concat(P,"/messageroaming"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+t.token,"Content-Type":"application/json"},data:JSON.stringify(k),success:function(n){return E(t,void 0,void 0,(function(){var t,o,i,a,s,u,d,p,h=this;return y(this,(function(f){switch(f.label){case 0:t=null==n?void 0:n.data,o=t.msgs||[],i=function(e){return E(h,void 0,void 0,(function(){var t,r,n,o,i;return y(this,(function(a){switch(a.label){case 0:for(t=[],e=l().atob(e),r=0,n=e.length;r<n;++r)t.push(e.charCodeAt(r));return o=(o=this.context.root.lookup("easemob.pb.Meta")).decode(t),i={errorCode:0,reason:""},1!==o.ns?[3,2]:[4,c.ZP.call(this,o,i,!0,!0)];case 1:return[2,a.sent()];case 2:return[2]}}))}))},a=[],s=0,f.label=1;case 1:return s<o.length?[4,i(o[s].msg)]:[3,4];case 2:(u=f.sent())&&a.push(u),f.label=3;case 3:return s++,[3,1];case 4:return t.msgs=a,d={cursor:t.next_key,messages:a,isLast:t.is_last},null===(p=e.success)||void 0===p||p.call(e,d),r(d),[2]}}))}))},error:e.fail};a.hj.call(t,x).catch((function(e){o(e)})),d.kg.debug("Call getHistoryMessages",e)}))}function G(e,t){return E(this,void 0,void 0,(function(){var r,o,i,s,c,u,l;return y(this,(function(h){switch(h.label){case 0:if(r=n.XZ.call(this).error)return[2,Promise.reject(r)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return d.kg.debug("Call addContact",e,t),o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u=o.jid,l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/users/").concat(this.user,"/contacts/apply?resource=").concat(u.clientResource),type:"POST",dataType:"json",data:JSON.stringify({usernames:[e],reason:t}),headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}},[4,a.hj.call(this,l,p.fI.ROSTER_ADD)];case 1:return h.sent(),[2]}}))}))}var H=F;function F(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u;return y(this,(function(l){switch(l.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return d.kg.debug("Call deleteContact",e),r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=r.jid,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/contacts/users/").concat(e,"?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,u,p.fI.ROSTER_REMOVE)];case 1:return l.sent(),[2]}}))}))}function W(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u;return y(this,(function(l){switch(l.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return d.kg.debug("Call acceptInvitation",e),r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=r.jid,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/contacts/accept/users/").concat(e,"?resource=").concat(c.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,u,p.fI.ROSTER_ACCEPT)];case 1:return l.sent(),[2]}}))}))}var K=W;function q(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u;return y(this,(function(l){switch(l.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return d.kg.debug("Call declineInvitation",e),r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=r.jid,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/contacts/decline/users/").concat(e,"?resource=").concat(c.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,u,p.fI.ROSTER_DECLINE)];case 1:return l.sent(),[2]}}))}))}var z=q;function V(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,h;return y(this,(function(f){switch(f.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if(r=e.name,o=[],"string"==typeof r){if(""===r)throw Error('"Invalid parameter": "name"');o=[r]}else{if(!Array.isArray(r))throw Error('"Invalid parameter": "name"');o=r}return d.kg.debug("Call addToBlockList",e),i=this.context,s=i.orgName,c=i.appName,u=i.accessToken,l=i.jid,h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/sdk/user/").concat(this.user,"/blocks?resource=").concat(l.clientResource),type:"POST",dataType:"json",data:JSON.stringify({usernames:o}),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}},[4,a.hj.call(this,h,p.fI.ROSTER_BAN).then((function(e){return{type:e.type,data:{userIds:(null==e?void 0:e.data)||[]}}}))];case 1:return[2,f.sent()]}}))}))}var X=V,J=V;function Z(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,h;return y(this,(function(f){switch(f.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if(r=e.name,o=[],"string"==typeof r){if(""===r)throw Error('"Invalid parameter": "name"');o=[r]}else{if(!Array.isArray(r))throw Error('"Invalid parameter": "name"');o=r}return d.kg.debug("Call removeFromBlockList",e),i=this.context,s=i.orgName,c=i.appName,u=i.accessToken,l=i.jid,h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/sdk/user/").concat(this.user,"/blocks?resource=").concat(l.clientResource),type:"DELETE",dataType:"json",data:JSON.stringify({usernames:o}),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}},[4,a.hj.call(this,h,p.fI.ROSTER_ALLOW)];case 1:return f.sent(),[2]}}))}))}var Y=Z,Q=Z;function $(e){var t=this,r=(null==e?void 0:e.ext)||"";if("string"!=typeof r)throw Error('"Invalid parameter": "ext"',r);var n=this.getUniqueId(),o={id:n,to:e.to};this._msgHash[n]=v({},o);var i="";void 0!==e.chatType?i=e.chatType:void 0!==e.type&&(i="chat"===e.type?"singleChat":e.type);var a={id:n,type:"recall",chatType:i,ackId:e.mid,to:e.to,isChatThread:e.isChatThread||!1,metaExt:r,success:function(r){return E(t,void 0,void 0,(function(){var t,n,o,a,s,c,u,l,d;return y(this,(function(p){switch(p.label){case 0:return p.trys.push([0,5,,6]),"singleChat"!==i&&"groupChat"!==i?[3,4]:[4,null===(o=null===(n=this._localCache)||void 0===n?void 0:n.getInstance())||void 0===o?void 0:o.removeMsgByServerMsgId(e.mid)];case 1:return p.sent(),[4,null===(s=null===(a=this._localCache)||void 0===a?void 0:a.getInstance())||void 0===s?void 0:s.getConversationLastMessage(e.to,i)];case 2:return t=p.sent(),[4,null===(u=null===(c=this._localCache)||void 0===c?void 0:c.getInstance())||void 0===u?void 0:u.updateLocalConversation((0,m.MQ)({conversationId:e.to,conversationType:i}),{lastMessageId:null==t?void 0:t.serverMsgId})];case 3:p.sent(),p.label=4;case 4:return null===(l=null==e?void 0:e.success)||void 0===l||l.call(e,r),[3,6];case 5:return p.sent(),null===(d=null==e?void 0:e.success)||void 0===d||d.call(e,r),[3,6];case 6:return[2]}}))}))},fail:e.fail};return d.kg.debug("Call recallMessage",e),this.mSync.send(a,this)}function ee(e){var t=e||{},r=t.messageId,n=t.modifiedMessage;if(d.kg.debug("Call modifyMessage",r,n),""===r)throw Error('Invalid parameter: "messageId"');return this.mSync.send(v({editMessageId:r},n))}function te(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,d;return y(this,(function(p){switch(p.label){case 0:if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: ".concat(e.reaction));return(t=n.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=e.reaction,u=e.messageId,l={msgId:u,message:c},d={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/reaction/user/").concat(this.user),type:"POST",data:JSON.stringify(l),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,d)]);case 1:return p.sent(),[2]}}))}))}function re(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l;return y(this,(function(d){switch(d.label){case 0:if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reactionId: ".concat(e.reaction));return(t=n.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=e.messageId,u=e.reaction,l={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/reaction/user/").concat(this.user,"?msgId=").concat(c,"&message=").concat(u),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,l)]);case 1:return d.sent(),[2]}}))}))}function ne(e){if("string"!=typeof e.chatType||!e.chatType)throw Error("Invalid parameter chatType: ".concat(e.chatType));if(!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=e.chatType,u=e.messageId,l={msgIdList:"string"==typeof u?[u]:u,msgType:"singleChat"===c?"chat":"groupchat",groupId:e.groupId||null},d={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/reaction/user/").concat(this.user),type:"GET",data:l,dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return a.hj.call(this,d).then((function(e){var t=e.data;return null==t||t.forEach((function(e){null==e||e.reactionList.forEach((function(e){e.isAddedBySelf=e.state,delete e.state,delete e.reactionId}))})),e}))}var oe=ne;function ie(e){if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: ".concat(e.reaction));if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=e.cursor,u=e.pageSize,l={msgId:e.messageId,message:e.reaction,currentPage:c||null,pageSize:u||20},d={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/reaction/user/").concat(this.user,"/detail"),type:"GET",data:l,dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return a.hj.call(this,d).then((function(e){return e.data.isAddedBySelf=e.data.state,delete e.data.state,delete e.data.reactionId,e}))}function ae(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,d,p,h;return y(this,(function(f){switch(f.label){case 0:if("string"!=typeof e.reportType||!e.reportType)throw Error("Invalid parameter reportType: ".concat(e.reportType));if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.reportReason||!e.reportReason)throw Error("Invalid parameter messageId: ".concat(e.reportReason));return(t=n.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,o=r.orgName,i=r.appName,s=r.accessToken,c=e.reportType,u=e.reportReason,l=e.messageId,d={username:this.user,reportType:c,reportReason:u},p="".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/user/").concat(this.user,"/moderation/report/message/").concat(l),h={url:p,type:"POST",data:JSON.stringify(d),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,a.hj.call(this,h)]);case 1:return f.sent(),[2]}}))}))}function se(e){var t;return E(this,void 0,void 0,(function(){var r,o,i,s,c,u,l,p,h;return y(this,(function(f){switch(f.label){case 0:if("string"!=typeof e.targetId||""===e.targetId)throw Error('"Invalid parameter targetId": '+e.targetId);if(!["singleChat","groupChat","chatRoom"].includes(e.chatType))throw Error('"Invalid parameter chatType": '+e.chatType);if(e.beforeTimeStamp&&("number"!=typeof e.beforeTimeStamp||e.beforeTimeStamp<0||(null===(t=e.beforeTimeStamp)||void 0===t?void 0:t.toString().length)>18))throw Error('"Invalid parameter beforeTimeStamp": '+e.beforeTimeStamp);if(e.messageIds&&!(Array.isArray(e.messageIds)&&e.messageIds.length>0&&e.messageIds.length<=20))throw Error('"Invalid parameter messageIds": '+e.messageIds);if(!e.messageIds&&!e.beforeTimeStamp)throw Error("messageIds or beforeTimeStamp field is required.");return(r=n.XZ.call(this).error)?[2,Promise.reject(r)]:(o=this.context,i=o.orgName,s=o.appName,c=o.userId,u="singleChat"===e.chatType?"userId":"groupId",l="singleChat"===e.chatType?"chat":"group",p=e.messageIds?"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/sdk/message/roaming/").concat(l,"/user/").concat(c,"?").concat(u,"=").concat(e.targetId,"&msgIdList=").concat(e.messageIds,"&resource=").concat(this.clientResource):"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/sdk/message/roaming/").concat(l,"/user/").concat(c,"/time?").concat(u,"=").concat(e.targetId,"&delTime=").concat(e.beforeTimeStamp,"&&resource=").concat(this.clientResource),h={url:p,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}},d.kg.debug("Call removeHistoryMessages",e),[4,a.hj.call(this,h)]);case 1:return f.sent(),[2]}}))}))}function ce(e){var t=this,r=n.XZ.call(this).error;if(r)return Promise.reject(r);if((null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));var o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/sdk/user/").concat(this.user,"/user_channels/list?"),type:"GET",dataType:"json",data:{limit:(null==e?void 0:e.pageSize)||20,cursor:(null==e?void 0:e.cursor)||"",need_mark:!0},headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}};return d.kg.debug("Call getServerConversations",e),new Promise((function(e,r){a.hj.call(t,u,p.fI.GET_SESSION_LIST).then((function(r){return E(t,void 0,void 0,(function(){var t,n,o=this;return y(this,(function(i){switch(i.label){case 0:return t=ue.call(this,r),this._localCache?(n=t.data.conversations.map((function(e){return E(o,void 0,void 0,(function(){var t,r,n,o;return y(this,(function(i){switch(i.label){case 0:return[4,null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r?void 0:r.storeMessage(e.lastMessage,f.r.SUCCESS,!0)];case 1:return i.sent(),[4,null===(o=null===(n=this._localCache)||void 0===n?void 0:n.getInstance())||void 0===o?void 0:o.updateLocalConversation((0,m.MQ)({conversationId:e.conversationId,conversationType:e.conversationType}),{unReadCount:e.unReadCount})];case 2:return i.sent(),[2]}}))}))})),[4,Promise.all(n)]):[3,2];case 1:i.sent(),i.label=2;case 2:return e(t),[2]}}))}))})).catch((function(e){r(e)}))}))}function ue(e){var t=this,r=e.data,n=r.cursor,o=r.channel_infos,i=[];null==o||o.forEach((function(e){var r=null;(null==e?void 0:e.meta)&&"{}"!==JSON.stringify(e.meta)&&(e.meta.payload=JSON.parse(e.meta.payload),"delivery"!==(r=h.w.call(t,e.meta)).type&&"read"!==r.type&&"channel"!==r.type&&(r.chatType=h.U[r.chatType]));var n={conversationId:e.session_to,conversationType:"chat"===e.session_type?"singleChat":"groupChat",isPinned:e.is_top,pinnedTime:e.is_top?e.update_top_status_time:0,unReadCount:e.unread_num,lastMessage:r};e.marks&&(n.marks=e.marks.map((function(e){return s.Z[e]}))),i.push(n)}));var a={conversations:i,cursor:n||""};return{type:e.type,data:a}}function le(e){var t=this,r=n.XZ.call(this).error;if(r)return Promise.reject(r);if((null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));var o=this.context,i=o.orgName,s=o.appName,c=o.accessToken,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(s,"/sdk/user/").concat(this.user,"/user_channels/list?"),type:"GET",dataType:"json",data:{limit:(null==e?void 0:e.pageSize)||20,cursor:(null==e?void 0:e.cursor)||"",is_top:!0,need_mark:!0},headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}};return d.kg.debug("Call getServerPinnedConversations",e),a.hj.call(this,u,p.fI.GET_SESSION_LIST).then((function(e){return ue.call(t,e)}))}function de(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,h,f,m,g,v,E;return y(this,(function(y){if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if(r=e.conversationId,o=e.conversationType,i=e.isPinned,s="singleChat"===o?"chat":"groupChat","string"!=typeof r||""===r)throw Error("Invalid parameter conversationId: ".concat(r));if(!["singleChat","groupChat"].includes(o))throw Error("Invalid parameter conversationType: ".concat(o));if("boolean"!=typeof i)throw Error("Invalid parameter isPinned: ".concat(i));return c=this.context,u=c.orgName,l=c.appName,h=c.accessToken,f=c.jid,m={type:s,to:r},g=i?"":"type=".concat(s,"&to=").concat(r,"&"),v="".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/sdk/user/").concat(this.user,"/user_channel/top?").concat(g,"resource=").concat(f.clientResource),E={url:v,type:i?"POST":"DELETE",dataType:"json",headers:{Authorization:"Bearer "+h,"Content-Type":"application/json"}},i&&(E.data=JSON.stringify(m)),d.kg.debug("Call pinConversation",e),[2,a.hj.call(this,E,p.fI.PIN_CONVERSATION).then((function(e){var t=e.type,r=e.data;return{type:t,data:{isPinned:r.is_top||!1,pinnedTime:r.is_top?r.update_top_status_time:0}}}))]}))}))}function pe(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,h,f;return y(this,(function(m){switch(m.label){case 0:if(t=e.userId,r=e.remark,o=n.XZ.call(this).error)return[2,Promise.reject(o)];if("string"!=typeof t||""===t)throw Error('Invalid parameter: "userId"');if("string"!=typeof r)throw Error('Invalid parameter: "remark"');return d.kg.debug("Call setContactRemark",e),i=this.context,s=i.orgName,c=i.appName,u=i.accessToken,l=i.jid,h="".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(this.context.userId,"/contacts/users/").concat(t,"?resource=").concat(l.clientResource),f={url:h,type:"PUT",data:JSON.stringify({remark:r}),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}},[4,a.hj.call(this,f,p.fI.ROSTER_SET_CONTACT_REMARK)];case 1:return m.sent(),[2]}}))}))}function he(){var e=n.XZ.call(this).error;if(e)return Promise.reject(e);var t=this.context,r=t.orgName,o=t.appName,i=t.accessToken,s={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(o,"/users/").concat(this.user,"/contacts/users?needReturnRemark=true"),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i}};return d.kg.debug("Call getAllContacts"),a.hj.call(this,s,p.fI.ROSTER_GET_ALL_CONTACTS_REMARKS).then((function(e){var t=((null==e?void 0:e.entities)||[]).map((function(e){return{userId:e.username,remark:e.remark}}));return{type:e.type,data:t}}))}function fe(e){var t=n.XZ.call(this).error;if(t)return Promise.reject(t);d.kg.debug("Call getContactsWithCursor",e);var r=e||{},o=r.pageSize,i=void 0===o?20:o,s=r.cursor,c=void 0===s?"":s;if(i&&"number"!=typeof i)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));var u=this.context,l=u.orgName,h=u.appName,f=u.accessToken,m={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(h,"/users/").concat(this.user,"/contacts?needReturnRemark=true&limit=").concat(i,"&cursor=").concat(c),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+f}};return a.hj.call(this,m,p.fI.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE).then((function(e){var t,r,n=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.contacts)||[],o=(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.cursor)||"",i=n.map((function(e){return{userId:e.username,remark:e.remark}}));return{type:e.type,data:{cursor:o,contacts:i}}}))}function me(e){return E(this,void 0,void 0,(function(){var t,r,o,i,c,u,l,f,m,g,v,E,T,I,O;return y(this,(function(y){switch(y.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if(d.kg.debug("Call markConversation",e),o=(r=e||{}).conversations,i=void 0===o?[]:o,c=r.mark,u=r.isMarked,!Array.isArray(i))throw Error("Invalid parameter conversations");if(l=i.map((function(e){if(!e.conversationId||!["singleChat","groupChat"].includes(e.conversationType))throw Error("Invalid parameter conversations");return{to:e.conversationId,type:_[e.conversationType]}})),"boolean"!=typeof u)throw Error("Invalid parameter isMarked: ".concat(u));if("number"!=typeof c)throw Error("Invalid parameter mark: ".concat(c));return f=this.context,m=f.orgName,g=f.appName,v=f.accessToken,E=f.userId,T=f.jid,I={mark:s.Z[c],targets:l},O={url:"".concat(this.apiUrl,"/").concat(m,"/").concat(g,"/sdk/user/").concat(E,"/user_channels/mark?resource=").concat(T.clientResource),dataType:"json",data:JSON.stringify(I),type:u?"Post":"Delete",headers:{Authorization:"Bearer "+v}},[4,a.hj.call(this,O,p.fI.MARK_CONVERSATION).then((function(e){var t,r=(null===(t=e.data)||void 0===t?void 0:t.ignore)||[];r&&Array.isArray(r)&&r.length>0&&d.kg.debug("markConversation has ignored conversations",r.map((function(e){return{conversationId:e.to,conversationType:h.U[e.type]}})))}))];case 1:return y.sent(),[2]}}))}))}function ge(e){return E(this,void 0,void 0,(function(){var t,r;return y(this,(function(n){return d.kg.debug("Call addConversationMark",e),t=e.conversations,r=e.mark,[2,me.call(this,{conversations:t,mark:r,isMarked:!0})]}))}))}function ve(e){return E(this,void 0,void 0,(function(){var t,r;return y(this,(function(n){return d.kg.debug("Call removeConversationMark",e),t=e.conversations,r=e.mark,[2,me.call(this,{conversations:t,mark:r,isMarked:!1})]}))}))}function Ee(e){var t,r,o=this,i=n.XZ.call(this).error;if(i)return Promise.reject(i);if(d.kg.debug("Call getServerConversationsByFilter",e),(null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));if("number"!=typeof(null===(t=null==e?void 0:e.filter)||void 0===t?void 0:t.mark))throw Error("Invalid parameter mark: ".concat(null===(r=null==e?void 0:e.filter)||void 0===r?void 0:r.mark));var c=this.context,u=c.orgName,l=c.appName,h=c.accessToken,f="".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/sdk/user/").concat(this.user,"/user_channels/mark/search?"),m=e.pageSize,g=e.cursor,v=((null==e?void 0:e.filter)||{}).mark,E={url:f,type:"GET",dataType:"json",data:{limit:m||10,cursor:g||"",need_mark:!0,mark:s.Z[v]},headers:{Authorization:"Bearer "+h,"Content-Type":"application/json"}};return a.hj.call(this,E,p.fI.GET_SESSION_LIST).then((function(e){return ue.call(o,e)}))}function ye(){var e=n.XZ.call(this).error;if(e)return Promise.reject(e);d.kg.debug("Call getSelfIdsOnOtherPlatform");var t=this.context,r=t.orgName,o=t.appName,i=t.accessToken,s=t.userId,c=t.jid,u={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(o,"/users/").concat(s,"/resources"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return a.hj.call(this,u,p.fI.USER_LOGGEDIN_OTHER_PLATFORM).then((function(e){var t,r=null===(t=e.data)||void 0===t?void 0:t.filter((function(e){return e.res!==c.clientResource})),n=null==r?void 0:r.map((function(e){return"".concat(s,"/").concat(e.res)}));return{type:e.type,data:n}}))}function _e(){var e,t,r,o,i,s;return E(this,void 0,void 0,(function(){var c,u,l,h,f,m,g,v,E;return y(this,(function(y){switch(y.label){case 0:return(c=n.XZ.call(this).error)?[2,Promise.reject(c)]:(d.kg.debug("Call deleteAllMessagesAndConversations"),u=this.context,l=u.orgName,h=u.appName,f=u.accessToken,m=u.userId,g=u.jid,v="".concat(this.apiUrl,"/").concat(l,"/").concat(h,"/sdk/message/roaming/user/").concat(m,"/delete/all?resource=").concat(g.clientResource),E={url:v,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+f,"Content-Type":"application/json"}},[4,a.hj.call(this,E,p.fI.REST_DELETE_MESSAGES_CONVERSATIONS)]);case 1:return y.sent(),null===(t=null===(e=this._localCache)||void 0===e?void 0:e.getInstance())||void 0===t||t.clearConversationMap(),[4,null===(o=null===(r=this._localCache)||void 0===r?void 0:r.getInstance())||void 0===o?void 0:o.clearStoreData("conversationList")];case 2:return y.sent(),[4,null===(s=null===(i=this._localCache)||void 0===i?void 0:i.getInstance())||void 0===s?void 0:s.clearStoreData("message")];case 3:return y.sent(),[2]}}))}))}function Te(e){return E(this,void 0,void 0,(function(){var t,r,o,i,s,c,u,l,h,f,m,g,v,E,T;return y(this,(function(y){switch(y.label){case 0:if(t=n.XZ.call(this).error)return[2,Promise.reject(t)];if(d.kg.debug("Call setMessagePinStatus",e),o=(r=e||{}).conversationId,i=void 0===o?"":o,s=r.conversationType,c=r.messageId,u=r.isPinned,"string"!=typeof i||""===i)throw Error("Invalid parameter conversationId");if("string"!=typeof c||""===c)throw Error("Invalid parameter messageId");if("boolean"!=typeof u)throw Error("Invalid parameter isPinned");return l=this.context,h=l.orgName,f=l.appName,m=l.accessToken,g=l.userId,v=l.jid,E={to:i,type:_[s],pin_msg_id:c},T={url:"".concat(this.apiUrl,"/").concat(h,"/").concat(f,"/sdk/user/").concat(g,"/user_channel/pin?resource=").concat(v.clientResource),dataType:"json",data:JSON.stringify(E),type:u?"Post":"Delete",headers:{Authorization:"Bearer "+m}},[4,a.hj.call(this,T,p.fI.REST_PIN_MESSAGE)];case 1:return y.sent(),[2]}}))}))}function Ie(e){return E(this,void 0,void 0,(function(){var t,r,n,o;return y(this,(function(i){return d.kg.debug("Call pinMessage",e),r=(t=e||{}).conversationType,n=t.conversationId,o=t.messageId,[2,Te.call(this,{conversationId:n,conversationType:r,messageId:o,isPinned:!0})]}))}))}function Oe(e){return E(this,void 0,void 0,(function(){var t,r,n,o;return y(this,(function(i){return d.kg.debug("Call unpinMessage",e),r=(t=e||{}).conversationType,n=t.conversationId,o=t.messageId,[2,Te.call(this,{conversationId:n,conversationType:r,messageId:o,isPinned:!1})]}))}))}function Re(e){var t=this,r=n.XZ.call(this).error;if(r)return Promise.reject(r);d.kg.debug("Call getServerPinnedMessages",e);var o=e.conversationId,i=e.conversationType,s=e.pageSize,c=e.cursor;if("string"!=typeof o||""===o)throw Error("Invalid parameter conversationId");if(s&&"number"!=typeof s)throw Error("Invalid parameter pageSize: ".concat(s));if(c&&"string"!=typeof c)throw Error("Invalid parameter cursor: ".concat(c));var u=this.context,l=u.orgName,f=u.appName,m=u.accessToken,g={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(f,"/sdk/user/").concat(this.user,"/user_channel/pin"),type:"GET",dataType:"json",data:{to:o,type:_[i],limit:s||10,cursor:c||""},headers:{Authorization:"Bearer "+m,"Content-Type":"application/json"}};return a.hj.call(this,g,p.fI.GET_SESSION_LIST).then((function(e){return{type:0,data:{list:e.data.msg_infos.map((function(e){e.message.payload=JSON.parse(e.message.payload);var r=e.message,n=e.pin_opt_at,o=e.pin_operator;return{message:h.w.call(t,r,{formatChatType:!0}),pinTime:n,operatorId:o}})),cursor:e.data.cursor||""}}}))}function Ce(){var e=this;d.kg.debug("Call unbindPushToken");var t={deviceId:this.clientResource,deviceToken:"",notifierName:this.pushCertificateName};return g.r.call(this,t).then((function(t){return e.isRegisterPush=!1,t}))}},3770:function(e,t,r){"use strict";r.r(t),r.d(t,{getPresenceStatus:function(){return h},getSubscribedPresenceList:function(){return d},getSubscribedPresencelist:function(){return p},publishPresence:function(){return c},subscribePresence:function(){return u},unsubscribePresence:function(){return l}}),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(2222),r(9753);var n=r(4024),o=r(3246),i=r(7360),a=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},s=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function c(e){return a(this,void 0,void 0,(function(){var t,r,a,c,u,l,d,p,h;return s(this,(function(s){switch(s.label){case 0:if("string"!=typeof e.description)throw Error('Invalid parameter: "description"');return(t=o.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,a=r.accessToken,c=r.orgName,u=r.appName,l=r.userId,d=this.context.jid.clientResource,p={ext:e.description},h={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(l,"/presence/").concat(d,"/1"),type:"POST",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error},i.kg.debug("Call publishPresence:",e),[4,n.hj.call(this,h)]);case 1:return s.sent(),[2]}}))}))}function u(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if("number"!=typeof e.expiry)throw Error('Invalid parameter: "expiry"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.orgName,s=r.appName,c=r.userId,u=r.accessToken,l={usernames:e.usernames},d={url:"".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/users/").concat(c,"/presence/").concat(e.expiry),type:"POST",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call subscribePresence:",e),n.hj.call(this,d).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}function l(e){return a(this,void 0,void 0,(function(){var t,r,a,c,u,l,d;return s(this,(function(s){switch(s.label){case 0:if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');return(t=o.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,a=r.orgName,c=r.appName,u=r.userId,l=r.accessToken,d={url:"".concat(this.apiUrl,"/").concat(a,"/").concat(c,"/users/").concat(u,"/presence"),type:"DELETE",dataType:"json",data:JSON.stringify(e.usernames),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error},i.kg.debug("Call unsubscribePresence:",e),[4,n.hj.call(this,d)]);case 1:return s.sent(),[2]}}))}))}function d(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.orgName,s=r.appName,c=r.userId,u=r.accessToken,l={url:"".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/users/").concat(c,"/presence/sublist?pageNum=").concat(e.pageNum,"&pageSize=").concat(e.pageSize),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getSubscribedPresenceList:",e),n.hj.call(this,l).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}var p=d;function h(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r={usernames:e.usernames},a=this.context,s=a.orgName,c=a.appName,u=a.userId,l=a.accessToken,d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/presence"),type:"POST",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getPresenceStatus:",e),n.hj.call(this,d).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}},6801:function(e,t,r){"use strict";r.d(t,{r:function(){return s}}),r(1539),r(8674),r(2222),r(4812);var n=r(3246),o=r(4024),i=r(7360),a=r(1595);function s(e){if("string"!=typeof e.deviceId||""===e.deviceId)throw Error('Invalid parameter: "deviceId"');var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,s=r.orgName,c=r.appName,u=r.accessToken,l={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(this.user),type:"PUT",data:JSON.stringify({device_id:e.deviceId,device_token:e.deviceToken,notifier_name:e.notifierName}),dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"},success:e.success,error:e.error};i.kg.debug("Call uploadPushTokenToServer",e);var d=o.hj.bind(this,l,a.fI.UPLOAD_PUSH_TOKEN);return o.P6.retryPromise(d).then((function(e){var t=e.entities[0]||{};return{type:e.type,data:t}}))}},1735:function(e,t,r){"use strict";r.r(t),r.d(t,{clearRemindTypeForConversation:function(){return u},getPushPerformLanguage:function(){return h},getSilentModeForAll:function(){return s},getSilentModeForConversation:function(){return l},getSilentModeForConversations:function(){return d},getSilentModeRemindTypeConversations:function(){return f},setPushPerformLanguage:function(){return p},setSilentModeForAll:function(){return a},setSilentModeForConversation:function(){return c}}),r(7941),r(1539),r(8674),r(2222),r(9753),r(9554),r(4747),r(9600),r(1249);var n=r(4024),o=r(3246),i=r(7360);function a(e){if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var t=e.options.paramType;if("number"!=typeof t||t<0||t>2)throw Error('Invalid parameter: "options of paramType"');if(0===t){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===t){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===t){var r=e.options,a=r.startTime,s=r.endTime;if(!(a instanceof Object&&Object.keys(a).length))throw Error('Invalid parameter: "options of startTime"');if(!a.hours||"number"!=typeof a.hours||!a.minutes||"number"!=typeof a.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(s instanceof Object&&Object.keys(s).length))throw Error('Invalid parameter: "options of endTime"');if(!s.hours||"number"!=typeof s.hours||!s.minutes||"number"!=typeof s.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var c=o.XZ.call(this).error;if(c)return Promise.reject(c);var u=this.context,l=u.accessToken,d=u.orgName,p=u.appName,h=u.userId,f=u.jid,m={};switch(t){case 0:m={type:e.options.remindType};break;case 1:m={ignoreDuration:e.options.duration};break;case 2:var g=e.options;a=g.startTime,s=g.endTime,m={ignoreInterval:"".concat(a.hours,":").concat(a.minutes,"-").concat(s.hours,":").concat(s.minutes)}}var v={url:"".concat(this.apiUrl,"/").concat(d,"/").concat(p,"/users/").concat(h,"/notification/user/").concat(h,"?resource=").concat(f.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(m),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call setSilentModeForAll:",e),n.hj.call(this,v)}function s(e){var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/user/").concat(u),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return i.kg.debug("Call getSilentModeForAll:",e),n.hj.call(this,l)}function c(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var t=e.options.paramType;if("number"!=typeof t||t<0||t>2)throw Error('Invalid parameter: "options of paramType"');if(0===t){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===t){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===t){var r=e.options,a=r.startTime,s=r.endTime;if(!(a instanceof Object&&Object.keys(a).length))throw Error('Invalid parameter: "options of startTime"');if(!a.hours||"number"!=typeof a.hours||!a.minutes||"number"!=typeof a.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(s instanceof Object&&Object.keys(s).length))throw Error('Invalid parameter: "options of endTime"');if(!s.hours||"number"!=typeof s.hours||!s.minutes||"number"!=typeof s.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var c=o.XZ.call(this).error;if(c)return Promise.reject(c);var u=this.context,l=u.accessToken,d=u.orgName,p=u.appName,h=u.userId,f=u.jid,m="chatgroup",g={};switch(t){case 0:g={type:e.options.remindType};break;case 1:g={ignoreDuration:e.options.duration};break;case 2:var v=e.options;a=v.startTime,s=v.endTime,g={ignoreInterval:"".concat(a.hours,":").concat(a.minutes,"-").concat(s.hours,":").concat(s.minutes)}}"singleChat"===e.type&&(m="user");var E={url:"".concat(this.apiUrl,"/").concat(d,"/").concat(p,"/users/").concat(h,"/notification/").concat(m,"/").concat(e.conversationId,"?resource=").concat(f.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(g),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call setSilentModeForConversation:",e),n.hj.call(this,E)}function u(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l=r.jid,d="chatgroup";"singleChat"===e.type&&(d="user");var p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/").concat(d,"/").concat(e.conversationId,"?resource=").concat(l.clientResource),type:"PUT",dataType:"json",data:JSON.stringify({type:"DEFAULT"}),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call clearRemindTypeForConversation:",e),n.hj.call(this,p)}function l(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l="chatgroup";"singleChat"===e.type&&(l="user");var d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/").concat(l,"/").concat(e.conversationId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getSilentModeForConversation:",e),n.hj.call(this,d)}function d(e){if(!Array.isArray(e.conversationList))throw Error('Invalid parameter: "conversationList"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l=[],d=[];e.conversationList.forEach((function(e){"singleChat"===e.type?l.push(e.id):d.push(e.id)}));var p=l.length?l.join(","):"",h=d.length?d.join(","):"",f={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification?user=").concat(p,"&group=").concat(h),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call getSilentModeForConversations:",e),n.hj.call(this,f)}function p(e){if("string"!=typeof e.language||!e.language)throw Error('Invalid parameter: "language"');var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r={translationLanguage:e.language},a=this.context,s=a.accessToken,c=a.orgName,u=a.appName,l=a.userId,d={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(l,"/notification/language"),type:"PUT",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return i.kg.debug("Call setPushPerformLanguage:",e),n.hj.call(this,d)}function h(e){var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/language"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return i.kg.debug("Call getPushPerformLanguage:",e),n.hj.call(this,l)}function f(e){var t=o.XZ.call(this).error;if(t)return Promise.reject(t);if("number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageSize"');var r=this.context,a=r.accessToken,s=r.orgName,c=r.appName,u=r.userId,l={limit:e.pageSize||10,cursor:e.cursor};e.cursor||delete l.cursor;var d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/mute/type"),type:"GET",dataType:"json",data:l,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return i.kg.debug("Call getSilentModeRemindTypeConversations:",e),n.hj.call(this,d).then((function(e){return e.data?{data:{conversations:e.data.map((function(e){return"user"in e?{conversationId:e.user,type:"singleChat",remindType:e.value}:{conversationId:e.group,type:"groupChat",remindType:e.value}})),cursor:e.cursor},type:e.type}:e}))}},7384:function(e,t,r){"use strict";r.r(t),r.d(t,{changeChatThreadName:function(){return p},createChatThread:function(){return c},destroyChatThread:function(){return d},getChatThreadDetail:function(){return y},getChatThreadLastMessage:function(){return v},getChatThreadMembers:function(){return h},getChatThreads:function(){return g},getJoinedChatThreads:function(){return m},joinChatThread:function(){return u},leaveChatThread:function(){return l},removeChatThreadMember:function(){return f}}),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(8309),r(2222),r(9554),r(4747),r(9753);var n=r(4024),o=r(3246),i=r(4363),a=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},s=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function c(e){if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: ".concat(e.name));if("string"!=typeof e.messageId||""===e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: ".concat(e.parentId));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c=r.jid,u={name:e.name,msg_id:e.messageId,group_id:e.parentId,owner:this.user},l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread?resource=").concat(c.clientResource),type:"POST",dataType:"json",data:JSON.stringify(u),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,l).then((function(e){var t=e.data.thread_id;return e.data={chatThreadId:t},e}))}function u(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c=r.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"/user/").concat(this.user,"/join?resource=").concat(c.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,u).then((function(e){var t=e.data.detail;return t.messageId=t.msgId,t.parentId=t.groupId,delete t.msgId,delete t.groupId,e}))}function l(e){return a(this,void 0,void 0,(function(){var t,r,i,a,c,u,l;return s(this,(function(s){switch(s.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));return(t=o.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,i=r.orgName,a=r.appName,c=r.accessToken,u=r.jid,l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"/user/").concat(this.user,"/quit?resource=").concat(u.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}},[4,n.hj.call(this,l)]);case 1:return s.sent(),[2]}}))}))}function d(e){return a(this,void 0,void 0,(function(){var t,r,i,a,c,u,l;return s(this,(function(s){switch(s.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));return(t=o.XZ.call(this).error)?[2,Promise.reject(t)]:(r=this.context,i=r.orgName,a=r.appName,c=r.accessToken,u=r.jid,l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"?resource=").concat(u.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}},[4,n.hj.call(this,l)]);case 1:return s.sent(),[2]}}))}))}function p(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: ".concat(e.name));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c=r.jid,u={name:e.name},l={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"?resource=").concat(c.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(u),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,l)}function h(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c={limit:e.pageSize||20,cursor:e.cursor||""},u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"/users"),type:"GET",dataType:"json",data:c,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,u)}function f(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if("string"!=typeof e.username||""===e.username)throw Error("Invalid parameter username: ".concat(e.username));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c=r.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId,"/users/").concat(e.username,"?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,u)}function m(e){var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c={limit:e.pageSize||20,cursor:e.cursor||""},u={url:e.parentId?"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/threads/chatgroups/").concat(e.parentId,"/user/").concat(this.user):"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/threads/user/").concat(this.user),type:"GET",dataType:"json",data:c,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,u).then((function(e){var t=e.entities;return null==t||t.forEach((function(e){e.parentId=e.groupId,e.messageId=e.msgId,delete e.groupId,delete e.msgId})),e}))}function g(e){if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: ".concat(e.parentId));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c={cursor:e.cursor||"",limit:e.pageSize||20},u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/threads/chatgroups/").concat(e.parentId),type:"GET",dataType:"json",data:c,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,u).then((function(e){var t=e.entities;return null==t||t.forEach((function(e){e.parentId=e.groupId,e.messageId=e.msgId,delete e.groupId,delete e.msgId})),e}))}function v(e){var t=this;if(!Array.isArray(e.chatThreadIds))throw Error("Invalid parameter chatThreadIds: ".concat(e.chatThreadIds));var r=o.XZ.call(this).error;if(r)return Promise.reject(r);var i=this.context,a=i.orgName,s=i.appName,c=i.accessToken,u={threadIds:e.chatThreadIds},l={url:"".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/thread/message"),type:"POST",dataType:"json",data:JSON.stringify(u),headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}};return n.hj.call(this,l).then((function(e){return E.call(t,e)}))}function E(e){var t=this,r=e.entities;return null==r||r.forEach((function(e){e.chatThreadId=e.thread_id,e.last_message&&"{}"!==JSON.stringify(e.last_message)?e.lastMessage=i.w.call(t,e.last_message):e.lastMessage=e.last_message,delete e.thread_id,delete e.last_message})),e}function y(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=o.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,i=r.orgName,a=r.appName,s=r.accessToken,c={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/thread/").concat(e.chatThreadId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return n.hj.call(this,c).then((function(e){return e.data.affiliationsCount=e.data.affiliations_count,e.data.messageId=e.data.msgId,e.data.parentId=e.data.groupId,delete e.data.affiliations_count,delete e.data.msgId,delete e.data.groupId,e}))}},70:function(e,t,r){"use strict";r.r(t),r.d(t,{getSupportedLanguages:function(){return a},translateMessage:function(){return s}}),r(1539),r(8674),r(2222),r(9753);var n=r(3246),o=r(7360),i=r(4024);function a(){var e=n.XZ.call(this).error;if(e)return Promise.reject(e);var t=this.context,r=t.orgName,a=t.appName,s=t.accessToken,c={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(a,"/users/").concat(this.user,"/translate/support/language"),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s}};return o.kg.debug("Call getSupportedLanguages"),i.hj.call(this,c)}function s(e){if("string"!=typeof e.text||""===e.text)throw Error('Invalid parameter: "text"');if(!Array.isArray(e.languages))throw Error('Invalid parameter: "language"');var t=n.XZ.call(this).error;if(t)return Promise.reject(t);var r=this.context,a=r.orgName,s=r.appName,c=r.accessToken,u="".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/users/").concat(this.user,"/translate"),l={text:e.text,to:e.languages},d={url:u,dataType:"json",type:"POST",data:JSON.stringify(l),headers:{Authorization:"Bearer "+c}};return o.kg.debug("Call translateMessage"),i.hj.call(this,d)}},3246:function(e,t,r){"use strict";r.d(t,{H7:function(){return l},XZ:function(){return c},_W:function(){return u}}),r(7941),r(9554),r(1539),r(4747),r(6699),r(2023);var n=r(5531),o=r(7252),i=r(7360);function a(){var e=this.context.appName,t=this.context.orgName;return!(!e||!t)||(this.onError&&this.onError({type:n.E.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function s(){var e,t=this.context.accessToken;if(!t){var r=o.Z.create({type:n.E.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return i.kg.debug("token not assign error",t),this.onError&&this.onError(r),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",r),!1}return!0}function c(){if(this._initWithAppId){if(!a.call(this))return{error:o.Z.create({type:n.E.WEBIM_CONNECTION_CLOSED,message:"not login"})};if(!s.call(this))return{error:o.Z.create({type:n.E.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"})}}else if(!a.call(this)||!s.call(this))return{error:o.Z.create({type:n.E.REST_PARAMS_STATUS,message:"appkey or token error"})};return{}}function u(e){var t=e.data,r=e.type;return{data:{status:Object.keys(t.errorKeys).length>0?"fail":"success",errorKeys:t.errorKeys,successKeys:t.successKeys},type:r}}function l(e){var t=e.data,r=void 0;return Object.keys(t.errorKeys).length>0&&Object.keys(t.errorKeys).forEach((function(e){var i=t.errorKeys[e];r=i.includes("is not part of you")?o.Z.create({type:n.E.NO_PERMISSION,message:i}):i.includes("size of metadata for this single chatroom exceeds the user defined limit")||i.includes("total size of chatroom metadata for this app exceeds the user defined limit")||i.includes("is exceeding maximum limit")?o.Z.create({type:n.E.MAX_LIMIT,message:i}):i.includes("is not Legal")?o.Z.create({type:n.E.REQUEST_PARAMETER_ERROR,message:i}):i.includes("Failed to update userMetadata. Concurrent updates not allowed")?o.Z.create({type:n.E.OPERATION_NOT_ALLOWED,message:i}):o.Z.create({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,message:i})})),r}},4319:function(e,t,r){"use strict";r.d(t,{Ge:function(){return h},Gf:function(){return i},Nt:function(){return c},XV:function(){return l},al:function(){return d},bh:function(){return f},ke:function(){return p},th:function(){return s},xd:function(){return u},xz:function(){return o},zj:function(){return a}});var n=r(5531),o=15e3,i=15e3,a=3e5,s=1e4,c=1e4,u=8e3,l=3e5,d=3e4,p=5,h=3,f=[n.E.MAX_LIMIT,n.E.WEBIM_TOKEN_EXPIRED,n.E.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,n.E.USER_NOT_FOUND,n.E.WEBIM_CONNCTION_AUTH_ERROR,n.E.REQUEST_PARAMETER_ERROR,n.E.WEBIM_CONNCTION_AUTH_ERROR,n.E.WEBIM_SERVER_SERVING_DISABLED]},2071:function(e,t,r){"use strict";r.d(t,{$x:function(){return s},F3:function(){return c},TJ:function(){return o},Tp:function(){return d},Wc:function(){return n},el:function(){return i},iB:function(){return u},iO:function(){return a},yK:function(){return l}}),r(6992),r(1532),r(1539),r(8783),r(3948);var n=7,o=new Map,i="im",a=new Map,s="32f24ab2ddb74f508aa9286c356cec84",c=1e3,u={INIT:9674,API:9675},l="direct",d=-1},1595:function(e,t,r){"use strict";var n,o,i,a,s,c;r.d(t,{C8:function(){return n},aC:function(){return c},c:function(){return i},dd:function(){return s},fI:function(){return o},td:function(){return a}}),function(e){e[e.UNKNOWOPERATION=-1]="UNKNOWOPERATION",e[e.REST_GET_SESSION_LIST=1]="REST_GET_SESSION_LIST",e[e.REST_DEL_SESSION=2]="REST_DEL_SESSION",e[e.REST_GET_HISTORY_MESSAGE=3]="REST_GET_HISTORY_MESSAGE",e[e.REST_PIN_CONVERSATION=4]="REST_PIN_CONVERSATION",e[e.REST_MARK_CONVERSATION=5]="REST_MARK_CONVERSATION",e[e.REST_UPLOAD_FILE_IN_PARTS=6]="REST_UPLOAD_FILE_IN_PARTS",e[e.REST_DELETE_MESSAGES_CONVERSATIONS=7]="REST_DELETE_MESSAGES_CONVERSATIONS",e[e.REST_PIN_MESSAGE=8]="REST_PIN_MESSAGE",e[e.REST_FETCH_PINMESSAGES=9]="REST_FETCH_PINMESSAGES",e[e.REST_OPERATE=100]="REST_OPERATE",e[e.MSYNC_SENDMESSAGE=101]="MSYNC_SENDMESSAGE",e[e.MSYNC_RECALLMESSAGE=102]="MSYNC_RECALLMESSAGE",e[e.MSYNC_MODIFYMESSAGE=103]="MSYNC_MODIFYMESSAGE",e[e.MSYNC_OPERATE=200]="MSYNC_OPERATE",e[e.ROSTER_ADD=201]="ROSTER_ADD",e[e.ROSTER_REMOVE=202]="ROSTER_REMOVE",e[e.ROSTER_ACCEPT=203]="ROSTER_ACCEPT",e[e.ROSTER_DECLINE=204]="ROSTER_DECLINE",e[e.ROSTER_BAN=205]="ROSTER_BAN",e[e.ROSTER_ALLOW=206]="ROSTER_ALLOW",e[e.ROSTER_BLACKLIST=207]="ROSTER_BLACKLIST",e[e.ROSTER_CONTACTS=208]="ROSTER_CONTACTS",e[e.ROSTER_GET_ALL_CONTACTS_REMARKS=209]="ROSTER_GET_ALL_CONTACTS_REMARKS",e[e.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE=210]="ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE",e[e.ROSTER_SET_CONTACT_REMARK=211]="ROSTER_SET_CONTACT_REMARK",e[e.ROSTER_OPERATE=300]="ROSTER_OPERATE",e[e.USER_LOGIN=301]="USER_LOGIN",e[e.USER_CREATE=302]="USER_CREATE",e[e.USER_UPDATE_USERINFO=303]="USER_UPDATE_USERINFO",e[e.USER_FETCH_USERINFO=304]="USER_FETCH_USERINFO",e[e.USER_UPDATE_NICK=305]="USER_UPDATE_NICK",e[e.USER_UPLOAD_PUSH_TOKEN=306]="USER_UPLOAD_PUSH_TOKEN",e[e.USER_LOGGEDIN_OTHER_PLATFORM=307]="USER_LOGGEDIN_OTHER_PLATFORM",e[e.USER_OPERATE=400]="USER_OPERATE",e[e.GROUP_CREATEGROUP=401]="GROUP_CREATEGROUP",e[e.GROUP_BLOCK_MESSAGE=402]="GROUP_BLOCK_MESSAGE",e[e.GROUP_FETCH_PUBLICGROUPS_WITHCURSOR=403]="GROUP_FETCH_PUBLICGROUPS_WITHCURSOR",e[e.GROUP_FETCH_USERS_GROUP=404]="GROUP_FETCH_USERS_GROUP",e[e.GROUP_CHANGE_OWNER=405]="GROUP_CHANGE_OWNER",e[e.GROUP_FETCH_SPECIFICATION=406]="GROUP_FETCH_SPECIFICATION",e[e.GROUP_CHANGE_GROUPATTRIBUTE=407]="GROUP_CHANGE_GROUPATTRIBUTE",e[e.GROUP_FETCH_MEMEBERS=408]="GROUP_FETCH_MEMEBERS",e[e.GROUP_GET_ADMIN=409]="GROUP_GET_ADMIN",e[e.GROUP_SET_ADMIN=410]="GROUP_SET_ADMIN",e[e.GROUP_REMOVE_ADMIN=411]="GROUP_REMOVE_ADMIN",e[e.GROUP_DESTOTYGROUP=412]="GROUP_DESTOTYGROUP",e[e.GROUP_LEAVEGROUP=413]="GROUP_LEAVEGROUP",e[e.GROUP_INVITE_TO_GROUP=414]="GROUP_INVITE_TO_GROUP",e[e.GROUP_JOIN_PUBLICGROUP=415]="GROUP_JOIN_PUBLICGROUP",e[e.GROUP_ACCEPT_JOINPUBLICGROUPAPPL=416]="GROUP_ACCEPT_JOINPUBLICGROUPAPPL",e[e.GROUP_DECLINE_JOINPUBLICGROUPAPPL=417]="GROUP_DECLINE_JOINPUBLICGROUPAPPL",e[e.GROUP_ACCEPT_INVITATION=418]="GROUP_ACCEPT_INVITATION",e[e.GROUP_DECLINE_INVITATION=419]="GROUP_DECLINE_INVITATION",e[e.GROUP_REMOVE_MEMBER=420]="GROUP_REMOVE_MEMBER",e[e.GROUP_REMOVE_MEMBERS=421]="GROUP_REMOVE_MEMBERS",e[e.GROUP_MUTE_MEMBERS=422]="GROUP_MUTE_MEMBERS",e[e.GROUP_UNMUTE_MEMBERS=423]="GROUP_UNMUTE_MEMBERS",e[e.GROUP_FETCH_MUTES=424]="GROUP_FETCH_MUTES",e[e.GROUP_BLOCK_MEMBER=425]="GROUP_BLOCK_MEMBER",e[e.GROUP_BLOCK_MEMBERS=426]="GROUP_BLOCK_MEMBERS",e[e.GROUP_UNBLOCK_MEMBER=427]="GROUP_UNBLOCK_MEMBER",e[e.GROUP_UNBLOCK_MEMBERS=428]="GROUP_UNBLOCK_MEMBERS",e[e.GROUP_GET_BLOCK_LIST=429]="GROUP_GET_BLOCK_LIST",e[e.GROUP_MUTE_ALLMEMBERS=430]="GROUP_MUTE_ALLMEMBERS",e[e.GROUP_UNMUTE_ALLMEMBERS=431]="GROUP_UNMUTE_ALLMEMBERS",e[e.GROUP_ADD_WHITELIST=432]="GROUP_ADD_WHITELIST",e[e.GROUP_REMOVE_WHITELIST=433]="GROUP_REMOVE_WHITELIST",e[e.GROUP_FETCH_WHITELIST=434]="GROUP_FETCH_WHITELIST",e[e.GROUP_IS_IN_WHITELIST=435]="GROUP_IS_IN_WHITELIST",e[e.GROUP_GET_READ_USERS=436]="GROUP_GET_READ_USERS",e[e.GROUP_FETCH_ANNOUNCEMENT=437]="GROUP_FETCH_ANNOUNCEMENT",e[e.GROUP_UPDATE_ANNOUNCEMENT=438]="GROUP_UPDATE_ANNOUNCEMENT",e[e.GROUP_UPLOAD_SHAREDFILE=439]="GROUP_UPLOAD_SHAREDFILE",e[e.GROUP_DELETE_SHAREDFILE=440]="GROUP_DELETE_SHAREDFILE",e[e.GROUP_FETCH_SHAREDFILE=441]="GROUP_FETCH_SHAREDFILE",e[e.GROUP_DOWNLOAD_SHAREDFILE=442]="GROUP_DOWNLOAD_SHAREDFILE",e[e.GROUP_MEMBER_SET_META_DATA=443]="GROUP_MEMBER_SET_META_DATA",e[e.GROUP_MEMBER_FETCH_META_DATA=444]="GROUP_MEMBER_FETCH_META_DATA",e[e.GROUP_OPERATE=500]="GROUP_OPERATE",e[e.CHATROOM_FETCH_CHATROOMSWITHPAGE=501]="CHATROOM_FETCH_CHATROOMSWITHPAGE",e[e.CHATROOM_CREATECHATROOM=502]="CHATROOM_CREATECHATROOM",e[e.CHATROOM_DESTORYCHATROOM=503]="CHATROOM_DESTORYCHATROOM",e[e.CHATROOM_FETCH_SPECIFICATION=504]="CHATROOM_FETCH_SPECIFICATION",e[e.CHATROOM_CHANGE_ATTRIBUTE=505]="CHATROOM_CHANGE_ATTRIBUTE",e[e.CHATROOM_REMOVE_MEMBER=506]="CHATROOM_REMOVE_MEMBER",e[e.CHATROOM_REMOVE_MEMBERS=507]="CHATROOM_REMOVE_MEMBERS",e[e.CHATROOM_ADD_MEMBERS=508]="CHATROOM_ADD_MEMBERS",e[e.CHATROOM_JOINCAHTROOM=509]="CHATROOM_JOINCAHTROOM",e[e.CHATROOM_LEAVECAHTROOM=510]="CHATROOM_LEAVECAHTROOM",e[e.CHATROOM_FETCH_MEMBERS=511]="CHATROOM_FETCH_MEMBERS",e[e.CHATROOM_GET_ADMIN=512]="CHATROOM_GET_ADMIN",e[e.CHATROOM_SET_ADMIN=513]="CHATROOM_SET_ADMIN",e[e.CHATROOM_REMOVE_ADMIN=514]="CHATROOM_REMOVE_ADMIN",e[e.CHATROOM_MUTE_USER=515]="CHATROOM_MUTE_USER",e[e.CHATROOM_UNMUTE_USER=516]="CHATROOM_UNMUTE_USER",e[e.CHATROOM_FETCH_MUTES=517]="CHATROOM_FETCH_MUTES",e[e.CHATROOM_BLOCK_USER=518]="CHATROOM_BLOCK_USER",e[e.CHATROOM_BLOCK_USERS=519]="CHATROOM_BLOCK_USERS",e[e.CHATROOM_UNBLOCK_USER=520]="CHATROOM_UNBLOCK_USER",e[e.CHATROOM_UNBLOCK_USERS=521]="CHATROOM_UNBLOCK_USERS",e[e.CHATROOM_FETCH_BANS=522]="CHATROOM_FETCH_BANS",e[e.CHATROOM_MUTE_ALLMEMEBERS=523]="CHATROOM_MUTE_ALLMEMEBERS",e[e.CHATROOM_UNMUTE_ALLMEMEBERS=524]="CHATROOM_UNMUTE_ALLMEMEBERS",e[e.CHATROOM_ADD_WHITELIST=525]="CHATROOM_ADD_WHITELIST",e[e.CHATROOM_REMOVE_WHITELIST=526]="CHATROOM_REMOVE_WHITELIST",e[e.CHATROOM_FETCH_WHITELIST=527]="CHATROOM_FETCH_WHITELIST",e[e.CHATROOM_FETCH_MEMBERIN_WHITELIST=528]="CHATROOM_FETCH_MEMBERIN_WHITELIST",e[e.CHATROOM_FETCH_ANNOUNCEMENT=529]="CHATROOM_FETCH_ANNOUNCEMENT",e[e.CHATROOM_UPDATE_ANNOUNCEMENT=530]="CHATROOM_UPDATE_ANNOUNCEMENT",e[e.CHATROOM_REMOVE_SHARE_FILE=531]="CHATROOM_REMOVE_SHARE_FILE",e[e.CHATROOM_GET_SHARE_FILE_LIST=532]="CHATROOM_GET_SHARE_FILE_LIST",e[e.CHATROOM_UPLOAD_FILE=533]="CHATROOM_UPLOAD_FILE",e[e.CHATROOM_SET_META_DATA=534]="CHATROOM_SET_META_DATA",e[e.CHATROOM_DELETE_META_DATA=535]="CHATROOM_DELETE_META_DATA",e[e.CHATROOM_FETCH_META_DATA=536]="CHATROOM_FETCH_META_DATA",e[e.CHATROOM_FETCH_USER_JOINED_CHATROOM=537]="CHATROOM_FETCH_USER_JOINED_CHATROOM",e[e.CHATROOM_OPERATE=600]="CHATROOM_OPERATE"}(n||(n={})),function(e){e.SDK_INTERNAL="SDK_INTERNAL",e.LOGIN="USER_LOGIN",e.REGISTER="USER_CREATE",e.GET_CHATROOM_LIST="CHATROOM_FETCH_CHATROOMSWITHPAGE",e.CREATE_CHATROOM="CHATROOM_CREATECHATROOM",e.DESTROY_CHATROOM="CHATROOM_DESTORYCHATROOM",e.GET_CHATROOM_DETAIL="CHATROOM_FETCH_SPECIFICATION",e.MODIFY_CHATROOM="CHATROOM_CHANGE_ATTRIBUTE",e.REMOVE_CHATROOM_MEMBER="CHATROOM_REMOVE_MEMBER",e.MULTI_REMOVE_CHATROOM_MEMBER="CHATROOM_REMOVE_MEMBERS",e.ADD_USERS_TO_CHATROOM="CHATROOM_ADD_MEMBERS",e.JOIN_CHATROOM="CHATROOM_JOINCAHTROOM",e.QUIT_CHATROOM="CHATROOM_LEAVECAHTROOM",e.LIST_CHATROOM_MEMBERS="CHATROOM_FETCH_MEMBERS",e.GET_CHATROOM_ADMIN="CHATROOM_GET_ADMIN",e.SET_CHATROOM_ADMIN="CHATROOM_SET_ADMIN",e.REMOVE_CHATROOM_ADMIN="CHATROOM_REMOVE_ADMIN",e.MUTE_CHATROOM_MEMBER="CHATROOM_MUTE_USER",e.REMOVE_MUTE_CHATROOM_MEMBER="CHATROOM_UNMUTE_USER",e.GET_MUTE_CHATROOM_MEMBERS="CHATROOM_FETCH_MUTES",e.SET_CHATROOM_MEMBER_TO_BLACK="CHATROOM_BLOCK_USER",e.MULTI_SET_CHATROOM_MEMBER_TO_BLACK="CHATROOM_BLOCK_USERS",e.REMOVE_CHATROOM_MEMBER_BLACK="CHATROOM_UNBLOCK_USER",e.MULTI_REMOVE_CHATROOM_MEMBER_BLACK="CHATROOM_UNBLOCK_USERS",e.GET_CHATROOM_BLOCK_MEMBERS="CHATROOM_FETCH_BANS",e.DISABLED_CHATROOM_SEND_MSG="CHATROOM_MUTE_ALLMEMEBERS",e.ENABLE_CHATROOM_SEND_MSG="CHATROOM_UNMUTE_ALLMEMEBERS",e.ADD_CHATROOM_WHITE_USERS="CHATROOM_ADD_WHITELIST",e.REMOVE_CHATROOM_WHITE_USERS="CHATROOM_REMOVE_WHITELIST",e.GET_CHATROOM_WHITE_USERS="CHATROOM_FETCH_WHITELIST",e.CHECK_CHATROOM_WHITE_USER="CHATROOM_FETCH_MEMBERIN_WHITELIST",e.GET_CHATROOM_ANN="CHATROOM_FETCH_ANNOUNCEMENT",e.UPDATE_CHATROOM_ANN="CHATROOM_UPDATE_ANNOUNCEMENT",e.DELETE_CHATROOM_FILE="CHATROOM_REMOVE_SHARE_FILE",e.GET_CHATROOM_FILES="CHATROOM_GET_SHARE_FILE_LIST",e.UPLOAD_CHATROOM_FILE="CHATROOM_UPLOAD_FILE",e.SET_CHATROOM_ATTR="CHATROOM_SET_META_DATA",e.DELETE_CHATROOM_ATTR="CHATROOM_DELETE_META_DATA",e.GET_CHATROOM_ATTR="CHATROOM_FETCH_META_DATA",e.GET_USER_JOINED_CHATROOM="CHATROOM_FETCH_USER_JOINED_CHATROOM",e.CREATE_GROUP="GROUP_CREATEGROUP",e.BLOCK_GROUP="GROUP_BLOCK_MESSAGE",e.LIST_GROUP="GROUP_FETCH_PUBLICGROUPS_WITHCURSOR",e.GET_USER_GROUP="GROUP_FETCH_USERS_GROUP",e.CHANGE_OWNER="GROUP_CHANGE_OWNER",e.GET_GROUP_INFO="GROUP_FETCH_SPECIFICATION",e.MODIFY_GROUP="GROUP_CHANGE_GROUPATTRIBUTE",e.LIST_GROUP_MEMBER="GROUP_FETCH_MEMEBERS",e.GET_GROUP_ADMIN="GROUP_GET_ADMIN",e.SET_GROUP_ADMIN="GROUP_SET_ADMIN",e.REMOVE_GROUP_ADMIN="GROUP_REMOVE_ADMIN",e.DISSOLVE_GROUP="GROUP_DESTOTYGROUP",e.QUIT_GROUP="GROUP_LEAVEGROUP",e.INVITE_TO_GROUP="GROUP_INVITE_TO_GROUP",e.JOIN_GROUP="GROUP_JOIN_PUBLICGROUP",e.AGREE_JOIN_GROUP="GROUP_ACCEPT_JOINPUBLICGROUPAPPL",e.REJECT_JOIN_GROUP="GROUP_DECLINE_JOINPUBLICGROUPAPPL",e.AGREE_INVITE_GROUP="GROUP_ACCEPT_INVITATION",e.REJECT_INVITE_GROUP="GROUP_DECLINE_INVITATION",e.REMOVE_GROUP_MEMBER="GROUP_REMOVE_MEMBER",e.MULTI_REMOVE_GROUP_MEMBER="GROUP_REMOVE_MEMBERS",e.MUTE_GROUP_MEMBER="GROUP_MUTE_MEMBERS",e.UNMUTE_GROUP_MEMBER="GROUP_UNMUTE_MEMBERS",e.GET_GROUP_MUTE_LIST="GROUP_FETCH_MUTES",e.BLOCK_GROUP_MEMBER="GROUP_BLOCK_MEMBER",e.BLOCK_GROUP_MEMBERS="GROUP_BLOCK_MEMBERS",e.UNBLOCK_GROUP_MEMBER="GROUP_UNBLOCK_MEMBER",e.UNBLOCK_GROUP_MEMBERS="GROUP_UNBLOCK_MEMBERS",e.GET_GROUP_BLACK_LIST="GROUP_GET_BLOCK_LIST",e.DISABLED_SEND_GROUP_MSG="GROUP_MUTE_ALLMEMBERS",e.ENABLE_SEND_GROUP_MSG="GROUP_UNMUTE_ALLMEMBERS",e.ADD_USERS_TO_GROUP_WHITE="GROUP_ADD_WHITELIST",e.REMOVE_GROUP_WHITE_MEMBER="GROUP_REMOVE_WHITELIST",e.GET_GROUP_WHITE_LIST="GROUP_FETCH_WHITELIST",e.IS_IN_GROUP_WHITE_LIST="GROUP_IS_IN_WHITELIST",e.GET_GROUP_MSG_READ_USER="GROUP_GET_READ_USERS",e.GET_GROUP_ANN="GROUP_FETCH_ANNOUNCEMENT",e.UPDATE_GROUP_ANN="GROUP_UPDATE_ANNOUNCEMENT",e.UPLOAD_GROUP_FILE="GROUP_UPLOAD_SHAREDFILE",e.DELETE_GROUP_FILE="GROUP_DELETE_SHAREDFILE",e.GET_GROUP_FILE_LIST="GROUP_FETCH_SHAREDFILE",e.DOWN_GROUP_FILE="GROUP_DOWNLOAD_SHAREDFILE",e.SET_GROUP_MEMBER_ATTRS="GROUP_MEMBER_SET_META_DATA",e.GET_GROUP_MEMBER_ATTR="GROUP_MEMBER_FETCH_META_DATA",e.GET_SESSION_LIST="REST_GET_SESSION_LIST",e.DELETE_SESSION="REST_DEL_SESSION",e.GET_HISTORY_MSG="REST_GET_HISTORY_MESSAGE",e.PIN_CONVERSATION="REST_PIN_CONVERSATION",e.REST_UPLOAD_FILE_IN_PARTS="REST_UPLOAD_FILE_IN_PARTS",e.REST_DELETE_MESSAGES_CONVERSATIONS="REST_DELETE_MESSAGES_CONVERSATIONS",e.MARK_CONVERSATION="REST_MARK_CONVERSATION",e.REST_FETCH_PINMESSAGES="REST_FETCH_PINMESSAGES",e.REST_PIN_MESSAGE="REST_PIN_MESSAGE",e.UPDATE_USER_INFO="USER_UPDATE_USERINFO",e.GET_USER_INFO="USER_FETCH_USERINFO",e.UPDATE_USER_NICK="USER_UPDATE_NICK",e.UPLOAD_PUSH_TOKEN="USER_UPLOAD_PUSH_TOKEN",e.USER_LOGGEDIN_OTHER_PLATFORM="USER_LOGGEDIN_OTHER_PLATFORM",e.GET_BLACK_LIST="ROSTER_BLACKLIST",e.GET_CONTACTS="ROSTER_CONTACTS",e.ROSTER_GET_ALL_CONTACTS_REMARKS="ROSTER_GET_ALL_CONTACTS_REMARKS",e.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE="ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE",e.ROSTER_SET_CONTACT_REMARK="ROSTER_SET_CONTACT_REMARK",e.ROSTER_ADD="ROSTER_ADD",e.ROSTER_REMOVE="ROSTER_REMOVE",e.ROSTER_ACCEPT="ROSTER_ACCEPT",e.ROSTER_DECLINE="ROSTER_DECLINE",e.ROSTER_BAN="ROSTER_BAN",e.ROSTER_ALLOW="ROSTER_ALLOW",e.SEND_MSG="MSYNC_SENDMESSAGE",e.UPLOAD_MSG_ATTACH="UPLOAD_MSG_ATTACH",e.SEND_RECALL_MSG="MSYNC_RECALLMESSAGE",e.MODIFY_MESSAGE="MSYNC_MODIFYMESSAGE"}(o||(o={})),function(e){e.GET_DNS="REST_DNSLIST",e.LOGIN_BY_AGORA_TOKEN="LOGIN_BY_AGORA_TOKEN",e.LOGIN_BY_PWD="LOGIN_BY_PWD",e.RESISTER="REGISTER",e.REST_INIT_UPLOAD_TASK_IN_PARTS="REST_INIT_UPLOAD_TASK_IN_PARTS",e.REST_UPLOAD_PART="REST_UPLOAD_PART",e.REST_COMPLETE_UPLOAD_PART="REST_COMPLETE_UPLOAD_PART",e.REST_ABORT_UPLOAD_PART="REST_ABORT_UPLOAD_PART",e.CONNECT_WEBSOCKET="CONNECT_WEBSOCKET"}(i||(i={})),function(e){e[e["5G"]=7]="5G",e[e["4G"]=7]="4G",e[e["3G"]=7]="3G",e[e["2G"]=7]="2G",e[e["SLOW-2G"]=7]="SLOW-2G",e[e.WIFI=2]="WIFI",e[e.LAN=1]="LAN",e[e.DISCONNECTED=0]="DISCONNECTED",e[e.NONE=0]="NONE",e[e.UNKNOWN=-1]="UNKNOWN",e[e["WEBIM UNABLE TO GET"]=-2]="WEBIM UNABLE TO GET"}(a||(a={})),function(e){e[e.success=200]="success",e[e.failed=500]="failed",e[e.disconnect=-1]="disconnect",e[e.closed=401]="closed",e[e.notFound=404]="notFound",e[e.reachLimit=429]="reachLimit"}(s||(s={})),function(e){e[e.web=0]="web",e[e.native=1]="native"}(c||(c={}))},6424:function(e,t,r){"use strict";r.d(t,{K5:function(){return L},gA:function(){return x},ZP:function(){return Ce}}),r(9601),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(7042),r(2222),r(3710),r(7941),r(9714),r(3843),r(8309),r(2772),r(5212),r(7327),r(5827),r(9826),r(4553),r(561),r(9653),r(1038),r(2564),r(9575),r(2472),r(2990),r(8927),r(3105),r(5035),r(4345),r(7174),r(2846),r(4731),r(7209),r(6319),r(8867),r(7789),r(3739),r(9368),r(4483),r(2056),r(3462),r(678),r(7462),r(3824),r(5021),r(2974),r(5016),r(6699),r(2023),r(3161),r(4048),r(9753),r(9554),r(4747),r(285),r(1637),r(8145),r(1249),r(4812);var n=r(4188),o=r.n(n),i=r(3720),a=r.n(i),s=r(5531),c=r(8161),u=r(7360),l=["public","members_only","allow_user_invites","invite_need_confirm"],d={name:"name",title:"name",description:"description",public:"public",members_only:"approval",allow_user_invites:"allowInvites",max_users:"maxUsers",invite_need_confirm:"inviteNeedConfirm",custom:"ext",last_modified:"lastModified",avatar:"avatar"};function p(e,t){var r,n,o,i,a,s,c=this,u=this.context,p=u.userId,h=u.jid,f=t.from.name===p&&h.clientResource!==t.from.clientResource;return t.isThread?(o={id:t.mucId.name,name:t.mucName,operation:"",parentId:t.mucParentId.name,operator:t.from.name,userName:t.to.length?t.to[0].name:""},i={chatThreadId:t.mucId.name,chatThreadName:t.mucName,operation:"",parentId:t.mucParentId.name}):(n={type:"",owner:t.from.name,gid:t.mucId.name,from:t.from.name,fromJid:t.from,to:t.to.length?t.to[0].name:"",toJid:t.to,chatroom:t.isChatroom,status:t.status},a={operation:"",id:t.mucId.name,from:t.from.name},t.isChatroom&&(null===(r=null==t?void 0:t.eventInfo)||void 0===r?void 0:r.ext)&&(s=JSON.parse(t.eventInfo.ext))),({45:function(){var e,r,n;a.operation="memberAttributesUpdate";var o=JSON.parse(null===(e=null==t?void 0:t.eventInfo)||void 0===e?void 0:e.ext)||{};a.attributes=o.properties||{},a.userId=o.username||"",f?null===(r=c.eventHandler)||void 0===r||r.dispatch("onMultiDeviceEvent",a):null===(n=c.eventHandler)||void 0===n||n.dispatch("onGroupEvent",a)},44:function(){var e;a.operation="removeChatRoomAttributes",a.attributes=s.result.successKeys,s.result.successKeys.length>0&&(null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a))},43:function(){var e;a.operation="updateChatRoomAttributes";var t={};s.result.successKeys.forEach((function(e){t[e]=s.properties[e]})),a.attributes=t,s.result.successKeys.length>0&&(null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a))},42:function(){},41:function(){},40:function(){},39:function(){},38:function(){var e;i.operation="chatThreadNameUpdate",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},37:function(){var e;o.operation="userRemove",null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatThreadChange",o)},36:function(){var e;i.operation="chatThreadLeave",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},35:function(){var e;i.operation="chatThreadJoin",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},34:function(){var e;i.operation="chatThreadDestroy",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},33:function(){var e;i.operation="chatThreadCreate",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},32:function(){var e,r,o,i;n.type=t.isChatroom?"rmChatRoomMute":"rmGroupMute",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="unmuteAllMembers",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},31:function(){var e,r,o,i;n.type=t.isChatroom?"muteChatRoom":"muteGroup",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="muteAllMembers",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},30:function(){var e,r,o,i;n.type=t.isChatroom?"rmUserFromChatRoomWhiteList":"rmUserFromGroupWhiteList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeAllowlistMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},29:function(){var e,r,o,i;n.type=t.isChatroom?"addUserToChatRoomWhiteList":"addUserToGroupWhiteList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="addUserToAllowlist",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},28:function(){var e,r,o,i;n.type="deleteFile",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="deleteFile",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},27:function(){var e,r,o,i;n.type="uploadFile",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="uploadFile",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},26:function(){var e,r,o,i;n.type="deleteAnnouncement",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="deleteAnnouncement",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},25:function(){var e,r,o,i;n.type="updateAnnouncement",n.announcement=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="updateAnnouncement",a.announcement=t.reason,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},24:function(){var e,r,o,i;n.type="removeMute",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="unmuteMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},23:function(){var e,r,o,i;if(n.type="addMute",c.onPresence&&c.onPresence(n),t.ext&&"string"==typeof t.ext){var s=JSON.parse(t.ext);s.user_mute_time&&(n.muteTimestamp=s.user_mute_time,a.muteTimestamp=s.user_mute_time)}t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="muteMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},22:function(){var e,r,o,i;n.type="removeAdmin",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeAdmin",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},21:function(){var e,r,o,i;n.type="addAdmin",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="setAdmin",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},20:function(){var e,r,o,i;n.type="changeOwner",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="changeOwner",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},19:function(){var e,r,o,i;n.type="direct_joined",n.groupName=t.mucName,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="directJoined",a.name=t.mucName,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},18:function(){var e,r,o,i;n.type=t.isChatroom?"leaveChatRoom":"leaveGroup",c.onPresence&&c.onPresence(n);var s=t.mucMemberCount;s&&(a.memberCount=s),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="memberAbsence",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},17:function(){var e,r,o,i;t.isChatroom&&t.ext&&(a.ext=t.ext,n.ext=t.ext),n.type=t.isChatroom?"memberJoinChatRoomSuccess":"memberJoinPublicGroupSuccess",c.onPresence&&c.onPresence(n);var s=t.mucMemberCount;t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="memberPresence",s&&(a.memberCount=s),t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},16:function(){var e,r;n.type="unblock",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},15:function(){var e,r;n.type="block",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},14:function(){var e,r,o,i,s,u=t.isChatroom;if(!u){var p=JSON.parse((null===(e=null==t?void 0:t.eventInfo)||void 0===e?void 0:e.ext)||"{}",(function(e,t){return"last_modified"===e?Number(t):l.includes(e)?"true"===t||!0===t:t}));a.detail=n.detail={},Object.keys(p).forEach((function(e){var t=d[e];if(t){var r=p[e];a.detail&&(a.detail[t]=r),n.detail&&(n.detail[t]=r)}}))}n.type="update",c.onPresence&&c.onPresence(n),u?null===(r=c.eventHandler)||void 0===r||r.dispatch("onChatroomChange",n):null===(o=c.eventHandler)||void 0===o||o.dispatch("onGroupChange",n),a.operation="updateInfo",u?null===(i=c.eventHandler)||void 0===i||i.dispatch("onChatroomEvent",a):null===(s=c.eventHandler)||void 0===s||s.dispatch("onGroupEvent",a)},13:function(){var e,r,o,i;n.type="allow",n.reason=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),t.reason&&(a.reason=t.reason),a.operation="unblockMember",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},12:function(){var e,r;n.type="ban",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},11:function(){var e,r;n.type="getBlackList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},10:function(){var e,r,o,i;n.type="removedFromGroup",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeMember",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},9:function(){var e,r,o,i;n.type="invite_decline",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="rejectInvite",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},8:function(){var e,r,o,i;n.type="invite_accept",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="acceptInvite",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},7:function(){var e,r,o,i;n.type="invite",n.kicked=n.to,n.groupName=t.mucName,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="inviteToJoin",a.name=t.mucName,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},6:function(){var e,r,o,i;n.type="joinPublicGroupDeclined",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="joinPublicGroupDeclined",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):(a.userId=t.to.length?t.to[0].name:"",null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a))},5:function(){var e,r,o,i;n.type="joinPublicGroupSuccess",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="acceptRequest",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},4:function(){var e,r,o,i;n.type="joinGroupNotifications",n.reason=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),t.reason&&(a.reason=t.reason),a.operation="requestToJoin",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},3:function(){var e,r;n.type="leave",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},2:function(){var e,r;n.type="join",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},1:function(){var e,r,o,i;n.type="deleteGroupChat",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="destroy",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},0:function(){var e,r;a.operation="create",t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupEvent",a)}}[e]||function(){console.error("No match operation ".concat(e))})()}var h=function(e){var t=this.root.lookup("easemob.pb.MUCBody").decode(e.payload),r=t.operation;u.kg.debug("onMucMessage",t),p.call(this,r,t)},f={handleRosterMsg:function(e){var t,r,n,o,i,a,s=this.root.lookup("easemob.pb.RosterBody").decode(e.payload),c={type:"",to:s.to[0].name,from:s.from.name,status:s.reason};switch(s.operation){case 2:c.type="subscribe",this.onContactInvited&&this.onContactInvited(c),null===(t=this.eventHandler)||void 0===t||t.dispatch("onContactInvited",c);break;case 3:c.type="unsubscribed",this.onContactDeleted&&this.onContactDeleted(c),null===(r=this.eventHandler)||void 0===r||r.dispatch("onContactDeleted",c);break;case 4:c.type="subscribed",this.onContactAdded&&this.onContactAdded(c),null===(n=this.eventHandler)||void 0===n||n.dispatch("onContactAdded",c);break;case 5:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(o=this.eventHandler)||void 0===o||o.dispatch("onContactRefuse",c);break;case 6:case 7:break;case 8:c.type="subscribed",this.onContactAgreed&&this.onContactAgreed(c),null===(i=this.eventHandler)||void 0===i||i.dispatch("onContactAgreed",c);break;case 9:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(a=this.eventHandler)||void 0===a||a.dispatch("onContactRefuse",c);break;default:u.kg.error("handleRosterMsg:",s)}this.onPresence&&c.type&&this.onPresence(c)}},m=r(7252),g=function(e){var t,r,n,o,i,a,c=this.root.lookup("easemob.pb.StatisticsBody").decode(e.payload),l=c.operation,d=c.reason;switch(l){case 0:this.onStatisticMessage&&this.onStatisticMessage(c),null===(t=this.eventHandler)||void 0===t||t.dispatch("onStatisticMessage",c);break;case 1:a=m.Z.create({type:s.E.WEBIM_CONNCTION_USER_REMOVED,message:"user has been removed"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(r=this.eventHandler)||void 0===r||r.dispatch("onError",a);break;case 2:a=m.Z.create({type:s.E.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE,message:"the user is already logged on another device"}),d&&(a.data={loginInfoCustomExt:c.reason}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(n=this.eventHandler)||void 0===n||n.dispatch("onError",a);break;case 3:a=m.Z.create({type:s.E.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD,message:"the user was kicked by changing password"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",a);break;case 4:a=m.Z.create({type:s.E.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE,message:"the user was kicked by other device"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(i=this.eventHandler)||void 0===i||i.dispatch("onError",a);break;default:u.kg.error("handleStatisticsMsg:",c)}},v=(r(9720),r(4024)),E=r(4363),y=r(9937);function _(e){var t,r=[],n=[],o=e.data;o&&o.values&&o.values.forEach((function(e){Object.entries(e.status).forEach((function(e){n.push({device:e[0],status:Number(e[1])})})),r.push({userId:e.uid,lastTime:Number(e.last_time),expire:Number(e.expiry),ext:e.ext,statusDetails:n})})),this.onPresenceStatusChange&&this.onPresenceStatusChange(r),null===(t=this.eventHandler)||void 0===t||t.dispatch("onPresenceStatusChange",r)}function T(e){var t=this;e.data.forEach((function(e){var r,n={from:e.from,to:e.to,chatType:"chat"===e.channel_type?"singleChat":"groupChat",messageId:e.messageId,reactions:e.reactions,ts:e.ts};null===(r=t.eventHandler)||void 0===r||r.dispatch("onReactionChange",n)}))}function I(e){var t,r,n,o;if(e.data){var i=e.data,a={id:i.id||"",name:i.name||"",parentId:i.muc_parent_id||"",messageId:i.msg_parent_id||"",timestamp:i.timestamp||0,operator:i.from||"",operation:""};switch(i.operation){case"create":a.operation="create",a.createTimestamp=a.timestamp,a.messageCount=0,null===(t=this.eventHandler)||void 0===t||t.dispatch("onChatThreadChange",a);break;case"update_msg":a.operation="update",a.messageCount=i.message_count,i.last_message&&"{}"!==JSON.stringify(i.last_message)?a.lastMessage=E.w.call(this,i.last_message):"{}"===JSON.stringify(i.last_message)&&(a.lastMessage={}),null===(r=this.eventHandler)||void 0===r||r.dispatch("onChatThreadChange",a);break;case"update":a.operation="update",a.messageCount=i.message_count,null===(n=this.eventHandler)||void 0===n||n.dispatch("onChatThreadChange",a);break;case"delete":a.operation="destroy",null===(o=this.eventHandler)||void 0===o||o.dispatch("onChatThreadChange",a)}}}function O(e){var t,r=e.data;if(r.resource!==this.clientResource){var n={operation:"deleteRoaming",conversationId:r.to,chatType:"chat"===r.chatType?"singleChat":"groupChat",resource:r.resource};null===(t=this.eventHandler)||void 0===t||t.dispatch("onMultiDeviceEvent",n)}}function R(e){var t,r,n=e.data,o="";if(this.clientResource!==n.res||n.from!==this.user){switch(n.op){case"del":o="deleteConversation";break;case"top":o="pinnedConversation";break;case"not_top":o="unpinnedConversation";break;case"mark":o="markConversation";break;case"mark_delete":o="unMarkConversation";break;case"pin":o="pin";break;case"pin_delete":o="unpin";break;default:return void u.kg.error("unexpected conversation op:",n.op)}if("pin"!==o&&"unpin"!==o){var i={operation:o,conversationId:n.id,conversationType:"chat"===n.type?"singleChat":"groupChat",timestamp:n.ts};"markConversation"!==i.operation&&"unMarkConversation"!==i.operation||n.ext&&(i.conversationMark=y.Z[n.ext]),null===(r=this.eventHandler)||void 0===r||r.dispatch("onMultiDeviceEvent",i)}else{var a=n.ext,s=n.from,c=n.id,l=n.type,d=n.ts,p={messageId:a||"",conversationId:"chat"===l?s:c,conversationType:E.U[l],operation:o,operatorId:s,time:d};null===(t=this.eventHandler)||void 0===t||t.dispatch("onMessagePinEvent",p)}}}function C(e){var t,r=this;null===(t=e.values)||void 0===t||t.forEach((function(e){var t,n,o,i,a;if(e.operator_resource!==r.clientResource)if("ignoreInterval"in e.data){var s={operation:"setSilentModeForUser",resource:e.operator_resource,data:e.data};null===(t=r.eventHandler)||void 0===t||t.dispatch("onMultiDeviceEvent",s)}else"group"in e?(s={operation:0===Object.keys(null!==(n=e.data)&&void 0!==n?n:{}).length?"removeSilentModeForConversation":"setSilentModeForConversation",resource:e.operator_resource,conversationId:e.group,type:"groupChat",data:e.data},null===(o=r.eventHandler)||void 0===o||o.dispatch("onMultiDeviceEvent",s)):(s={operation:0===Object.keys(null!==(i=e.data)&&void 0!==i?i:{}).length?"removeSilentModeForConversation":"setSilentModeForConversation",resource:e.operator_resource,conversationId:e.user,type:"singleChat",data:e.data},null===(a=r.eventHandler)||void 0===a||a.dispatch("onMultiDeviceEvent",s))}))}var N=function(e){var t=v.P6.parseNotify(e.payload);switch(t.type){case"presence":_.call(this,t);break;case"reaction":T.call(this,t);break;case"thread":I.call(this,t);break;case"roaming_delete":O.call(this,t);break;case"conv":R.call(this,t);break;case"user_notification_mute":C.call(this,t);break;default:u.kg.error("unexpected notify type: ".concat(t.type))}},S=r(7288),b=r(9743),A=r(4998),M=r(6801),w=r(2071),P=r(1595),U=r(4319);function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}var x,L,D,j,B=function(){return B=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},B.apply(this,arguments)},G=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},H=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e[e.NORMAL=0]="NORMAL",e[e.SINGLECHAT=1]="SINGLECHAT",e[e.GROUPCHAT=2]="GROUPCHAT",e[e.CHATROOM=3]="CHATROOM",e[e.READ_ACK=4]="READ_ACK",e[e.DELIVER_ACK=5]="DELIVER_ACK",e[e.RECALL=6]="RECALL",e[e.CHANNEL_ACK=7]="CHANNEL_ACK",e[e.EDIT=8]="EDIT"}(x||(x={})),function(e){e[e.BODY=1]="BODY",e[e.BODY_AND_EXT=2]="BODY_AND_EXT"}(L||(L={})),function(e){e[e.APNs=0]="APNs",e[e.FCM=1]="FCM",e[e.HMSPUSH=2]="HMSPUSH",e[e.MIPUSH=3]="MIPUSH",e[e.MEIZUPUSH=4]="MEIZUPUSH",e[e.VIVOPUSH=5]="VIVOPUSH",e[e.OPPOPUSH=6]="OPPOPUSH",e[e.HONORPUSH=7]="HONORPUSH"}(D||(D={})),function(e){e[e.OK=0]="OK",e[e.FAIL=1]="FAIL",e[e.UNAUTHORIZED=2]="UNAUTHORIZED",e[e.MISSING_PARAMETER=3]="MISSING_PARAMETER",e[e.WRONG_PARAMETER=4]="WRONG_PARAMETER",e[e.REDIRECT=5]="REDIRECT",e[e.TOKEN_EXPIRED=6]="TOKEN_EXPIRED",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.NO_ROUTE=8]="NO_ROUTE",e[e.UNKNOWN_COMMAND=9]="UNKNOWN_COMMAND",e[e.PB_PARSER_ERROR=10]="PB_PARSER_ERROR",e[e.BIND_ANOTHER_DEVICE=11]="BIND_ANOTHER_DEVICE",e[e.IM_FORBIDDEN=12]="IM_FORBIDDEN",e[e.TOO_MANY_DEVICES=13]="TOO_MANY_DEVICES",e[e.PLATFORM_LIMIT=14]="PLATFORM_LIMIT",e[e.USER_MUTED=15]="USER_MUTED",e[e.ENCRYPT_DISABLE=16]="ENCRYPT_DISABLE",e[e.ENCRYPT_ENABLE=17]="ENCRYPT_ENABLE",e[e.DECRYPT_FAILURE=18]="DECRYPT_FAILURE",e[e.PERMISSION_DENIED_EXTERNAL=19]="PERMISSION_DENIED_EXTERNAL"}(j||(j={}));var F=["txt","img","video","audio","file","loc","custom","cmd","combine"],W=v.P6.getEnvInfo();function K(){var e,t,r,n,o="webim",i="",a="",s=[],c=(new Date).valueOf(),l=v.P6.getDevicePlatform(W);if(this.isFixedDeviceId){var d=v.P6.getLocalDeviceInfo();if(d){var p=JSON.parse(d);o=p.deviceId,i=p.deviceName,a=p.deviceUuid,void 0!==this.customOSPlatform&&(i=this.deviceId,o="custom".concat(this.customOSPlatform,"_").concat(a))}else"webim"===this.deviceId?(a="".concat(l,"_").concat(c.toString()),o="".concat(this.deviceId,"_").concat(a),i=this.deviceId,void 0!==this.customOSPlatform&&(o="custom".concat(this.customOSPlatform,"_").concat(a))):(o=i=a="webim_".concat(l,"_").concat(this.deviceId),void 0!==this.customOSPlatform&&(a="".concat(l,"_").concat(c.toString()),i=this.deviceId,o="custom".concat(this.customOSPlatform,"_").concat(a))),v.P6.setLocalDeviceInfo(JSON.stringify({deviceId:o,deviceName:i,deviceUuid:a}))}else"webim"===this.deviceId?(a="random_".concat(l,"_").concat(c.toString()),o="".concat(this.deviceId,"_").concat(a),i=this.deviceId):o=i=a="webim_".concat(l,"_").concat(this.deviceId),void 0!==this.customOSPlatform&&(a="random_".concat(l,"_").concat(c.toString()),i=this.deviceId,o="custom".concat(this.customOSPlatform,"_").concat(a));this.context.jid&&(this.context.jid.clientResource=o);var h=this.root.lookup("easemob.pb.Provision"),f=h.decode(s);void 0!==this.customOSPlatform&&(f.osCustomValue=this.customOSPlatform,this.osType=5),f.compressType=this.compressType,f.encryptType=this.encryptType,f.osType=this.osType,f.version=this.version,f.deviceName=i,f.resource=o,f.deviceUuid=a,f.authToken='{"token":"$t$'+this.token+'"}',f.sessionId=Date.now().toString()+":",this.loginInfoCustomExt&&(f.reason=this.loginInfoCustomExt),u.kg.debug("provision info",{version:this.version,resource:o,isFixedDeviceId:this.isFixedDeviceId,loginInfoCustomExt:!!this.loginInfoCustomExt,token:(null===(t=null===(e=this.token)||void 0===e?void 0:e.slice)||void 0===t?void 0:t.call(e,0,10))+"...",userId:null===(n=null===(r=this.context)||void 0===r?void 0:r.jid)||void 0===n?void 0:n.name}),f.actionVersion="v5.0",f=h.encode(f).finish();var m=this.root.lookup("easemob.pb.MSync"),g=m.decode(s);return g.version=this.version,g.guid=this.context.jid,g.auth="$t$"+this.token,g.command=3,g.deviceId=i,g.serviceId=this.dataReport.getServiceId(),g.encryptType=this.encryptType,g.payload=f,m.encode(g).finish()}function q(e,t){var r=this,n=v.P6.getEnvInfo();if("zfb"===n.platform||"dd"===n.platform){for(var i="",a=0;a<e.length;a++)i+=String.fromCharCode(e[a]);return{data:i=o().btoa(i),isBuffer:!1,complete:function(){},fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||(u.kg.debug("send message fail and reconnect"),r.reconnecting||r.reconnect()),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}var s=e;return{data:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||r.reconnecting||r.reconnect(),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}function z(e,t){var r;return G(this,void 0,void 0,(function(){var n,o,i,s,l,d;return H(this,(function(p){switch(p.label){case 0:for(u.kg.debug("distributeMeta, metas length: ",e.length),n=[],o=function(r){var o=e[r],s=new(a())(o.id.low,o.id.high,o.id.unsigned).toString(),l=o.from.name,d=o.to?o.to.name:"",p=!!o.to&&-1!==o.to.domain.indexOf("conference");if(i._load_msg_cache.some((function(e){return e.msgId===s})))return"continue";switch(i._load_msg_cache.length<=i.max_cache_length||i._load_msg_cache.shift(),i._load_msg_cache.push({msgId:s,from:l,to:d,isGroup:p}),o.ns){case 0:g.call(i,o);break;case 1:n.push(c.ZP.call(i,o,t,!1,!0,!0));break;case 2:h.call(i,o);break;case 3:f.handleRosterMsg.call(i,o);break;case 4:i.registerConfrIQHandler&&i.registerConfrIQHandler(o,t,i);break;case 5:N.call(i,o);break;default:u.kg.error("distributeMeta",o)}},i=this,s=0;s<e.length;s++)o(s);return[4,Promise.all(n)];case 1:return l=p.sent(),(d=l.filter((function(e){return e&&"cmd"!==e.type}))).length>0&&(null===(r=this.eventHandler)||void 0===r||r.dispatch("onMessage",d)),[2]}}))}))}function V(e,t){z.call(this,e,t)}function X(e){var t;this._offlineMessagePullState===A.a.SYNC_INIT&&(this._offlineMessagePullState=A.a.SYNC_START,this._offlineMessagePullQueue=e.unread.reduce((function(e,t){return e.find((function(e){return e.name===t.queue.name}))||e.push(t.queue),e}),[]),null===(t=this.eventHandler)||void 0===t||t.dispatch("onOfflineMessageSyncStart"))}function J(e){var t;if(this._offlineMessagePullState===A.a.SYNC_START){var r=this._offlineMessagePullQueue.findIndex((function(t){return t.name===e.queue.name}));r>-1&&this._offlineMessagePullQueue.splice(r,1),0===this._offlineMessagePullQueue.length&&(this._offlineMessagePullState=A.a.SYNC_FINISH,null===(t=this.eventHandler)||void 0===t||t.dispatch("onOfflineMessageSyncFinish"))}}function Z(e){var t=this.root.lookup("easemob.pb.CommUnreadDL");t=t.decode(e.payload);var r=new(a())(t.timestamp.low,t.timestamp.high,t.timestamp.unsigned).toString();if(this.expirationTime&&this.compareTokenExpireTime(Number(r),this.expirationTime),0===t.unread.length)ae.call(this);else{X.call(this,t),u.kg.debug("pull unread message",t.unread);for(var n=0;n<t.unread.length;n++)$.call(this,t.unread[n].queue)}ae.call(this)}function Y(){var e=[],t=this.root.lookup("easemob.pb.StatisticsBody"),r=t.decode(e);r.operation=0,r=t.encode(r).finish();var n=this.root.lookup("easemob.pb.Meta").decode(e);n.id=(new Date).valueOf(),n.ns=0,n.payload=r;var o=this.root.lookup("easemob.pb.CommSyncUL"),i=o.decode(e);i.meta=n,i=o.encode(i).finish();var a=this.root.lookup("easemob.pb.MSync"),s=a.decode(e);return s.version=this.version,s.encryptType=[0],s.command=0,s.payload=i,a.encode(s).finish()}function Q(e){var t=[],r=this.root.lookup("easemob.pb.CommSyncUL"),n=r.decode(t);n.queue=e,n=r.encode(n).finish();var o=this.root.lookup("easemob.pb.MSync"),i=o.decode(t);return i.version=this.version,i.encryptType=this.encryptType,i.command=0,i.payload=n,o.encode(i).finish()}function $(e){u.kg.debug("sendBackqueue",e);var t=Q.call(this,e);Re.call(this,t)}function ee(e,t){var r=[],n=this.root.lookup("easemob.pb.CommSyncUL"),o=n.decode(r);o.queue=t,o.key=new(a())(e.low,e.high,e.unsigned).toString(),o=n.encode(o).finish();var i=this.root.lookup("easemob.pb.MSync"),s=i.decode(r);return s.version=this.version,s.encryptType=this.encryptType,s.command=0,s.payload=o,i.encode(s).finish()}function te(){var e=this;this.uniPush&&!1===this.isRegisterPush&&(this.isRegisterPush=!0,this.uniPush.onRegister((function(t){u.kg.debug("push token onRegister",t);var r=e.uniPushConfig||{},n=r.APNsCertificateName,o=void 0===n?"":n,i=r.HMSCertificateName,a=void 0===i?"":i,s=r.HONORCertificateName,c=void 0===s?"":s,l=r.MEIZUCertificateName,d=void 0===l?"":l,p=r.MICertificateName,h=void 0===p?"":p,f=r.OPPOCertificateName,m=void 0===f?"":f,g=r.VIVOCertificateName,v=void 0===g?"":g,E=r.FCMCertificateName,y=void 0===E?"":E;switch(t.push_type){case D.APNs:e.pushCertificateName=o;break;case D.FCM:e.pushCertificateName=y;break;case D.HMSPUSH:e.pushCertificateName=a;break;case D.HONORPUSH:e.pushCertificateName=c;break;case D.MEIZUPUSH:e.pushCertificateName=d;break;case D.MIPUSH:e.pushCertificateName=h;break;case D.OPPOPUSH:e.pushCertificateName=m;break;case D.VIVOPUSH:e.pushCertificateName=v;break;default:u.kg.error("unexpected push type",t.push_type)}e.pushCertificateName&&t.push_token&&M.r.call(e,{deviceId:e.clientResource,deviceToken:t.push_token,notifierName:e.pushCertificateName}).then((function(){u.kg.debug("uploadPushToken success")})).catch((function(e){u.kg.debug("uploadPushToken failed",e)}))})))}function re(){var e;this._offlineMessagePullState=A.a.SYNC_INIT,this._offlineMessagePullQueue=[],this.times=1,this.autoReconnectNumTotal=0,this.onOpened&&this.onOpened(),te.call(this),null===(e=this.eventHandler)||void 0===e||e.dispatch("onConnected"),ie.call(this),ce.call(this),se.call(this),ae.call(this)}function ne(e,t){u.kg.debug("sendLastSession",e);var r=ee.call(this,e,t);Re.call(this,r)}function oe(e){var t,r,n,o,i,a,c,l,d,p,h,f,g,v,E=this,y=this.root.lookup("easemob.pb.Provision").decode(e.payload);if(this.context.jid&&(this.context.jid.clientResource=y.resource),this.clientResource=y.resource,this.provisionTimer&&clearTimeout(this.provisionTimer),u.kg.debug("receiveProvisionResult",y.status),this._isLogging=!1,y.status.errorCode===j.OK){if(this.disconnectedReason=void 0,y.authToken){var _=JSON.parse(y.authToken).expires_in;if(!this.tokenExpiredTimer&&!this.tokenWillExpireTimer){var T=Date.now();this.expirationTime=_;var I=this.expirationTime-T;this.expiresIn=I<0?0:I,this.tokenExpireTimeCountDown(this.expiresIn)}}this.reconnecting=!1,this.logOut=!1,this.needSetReadyState&&(this.sock=B(B({},this.sock),{close:this.sock.close,send:this.sock.send,readyState:1})),this._localCache?(null===(t=this._localCache)||void 0===t?void 0:t.getInstance())?re.call(this):this._localCache&&new this._localCache({user:this.user,dbName:"cache_".concat(Math.abs((0,b.un)(this.appKey||this.appId)),"_").concat(this.user),version:2,onInit:function(){return G(E,void 0,void 0,(function(){return H(this,(function(e){return u.kg.debug("localCache init success"),re.call(this),[2]}))}))}}):re.call(this),null===(r=this.connectionResolve)||void 0===r||r.call(this)}else{var O=void 0,R=y.status,C=R.reason,N=R.errorCode;switch(u.kg.debug("provision errorCode: ",N),u.kg.debug("provision reason: ",C),N){case j.FAIL:O="Sorry, user register limit"===C?m.Z.create({type:s.E.MAX_LIMIT,message:"Sorry, the number of user registrations limit has been reached"}):"Sorry, user register rate limit"===C?m.Z.create({type:s.E.MAX_LIMIT,message:"Sorry, user register rate limit"}):"Sorry, token expired"===C?m.Z.create({type:s.E.WEBIM_TOKEN_EXPIRED,message:"Sorry, token expired"}):"Sorry, token or password does not match login info"===C?m.Z.create({type:s.E.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"INVALID_TOKEN"}):"Sorry, user not found"===C?m.Z.create({type:s.E.USER_NOT_FOUND,message:"User not found"}):m.Z.create({type:s.E.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(n=this.connectionReject)||void 0===n||n.call(this,O),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",O);break;case j.WRONG_PARAMETER:O=m.Z.create({type:s.E.REQUEST_PARAMETER_ERROR,message:"Invalid parameter"}),null===(i=this.connectionReject)||void 0===i||i.call(this,O),null===(a=this.eventHandler)||void 0===a||a.dispatch("onError",O);break;case j.UNAUTHORIZED:O=m.Z.create({type:s.E.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(c=this.connectionReject)||void 0===c||c.call(this,O),null===(l=this.eventHandler)||void 0===l||l.dispatch("onError",O);break;case j.IM_FORBIDDEN:O=m.Z.create({type:s.E.WEBIM_SERVER_SERVING_DISABLED,message:"Server serving disabled."}),null===(d=this.connectionReject)||void 0===d||d.call(this,O),null===(p=this.eventHandler)||void 0===p||p.dispatch("onError",O);break;case j.PERMISSION_DENIED:O="Sorry, the app month live count limit"===C?m.Z.create({type:s.E.MAX_LIMIT,message:"Sorry, the monthly active user limit for this app has been reached"}):"Sorry, the app day live count limit"===C?m.Z.create({type:s.E.MAX_LIMIT,message:"Sorry, the daily active user limit for this app has been reached"}):"Sorry, the app online count limit"===C?m.Z.create({type:s.E.MAX_LIMIT,message:"Sorry, the maximum number limit of online users for this app has been reached"}):m.Z.create({type:s.E.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(h=this.connectionReject)||void 0===h||h.call(this,O),null===(f=this.eventHandler)||void 0===f||f.dispatch("onError",O);break;default:O=m.Z.create({type:s.E.WEBIM_CONNCTION_AUTH_ERROR,message:C}),null===(g=this.connectionReject)||void 0===g||g.call(this,O),null===(v=this.eventHandler)||void 0===v||v.dispatch("onError",O)}this.disconnectedReason=O}}function ie(){var e,t;if((null===(e=this.unMSyncSendMsgMap)||void 0===e?void 0:e.size)>0){for(var r=Array.from(this.unMSyncSendMsgMap.keys()),n=0;n<r.length;n++){var o=this.unMSyncSendMsgMap.get(r[n]);Re.call(this,o,r[n])}null===(t=this.unMSyncSendMsgMap)||void 0===t||t.clear()}}function ae(){var e=Y.call(this);Re.call(this,e)}function se(){u.kg.debug("sendUnreadDeal");var e=le.call(this);Re.call(this,e)}function ce(){var e=this;ue.call(this),this.heartBeatID=setInterval((function(){(Date.now()-e.lastHeartbeat)/1e3>=30&&(u.kg.debug("send heart beat"),se.call(e),e.lastHeartbeat=Date.now())}),this.heartBeatWait)}function ue(){clearInterval(this.heartBeatID)}function le(){var e=this.root.lookup("easemob.pb.MSync"),t=e.decode([]);return t.version=this.version,t.encryptType=this.encryptType,t.command=1,e.encode(t).finish()}function de(e,t){return e.some((function(e){return e.name===t.name}))}function pe(e){var t=this.root.lookup("easemob.pb.CommNotice").decode(e.payload),r=de(this._queues,t.queue);u.kg.debug("receive notice",t.queue,this._queues),r||this.clientResource===t.queue.clientResource&&t.queue.name===this.context.userId||(this._queues.push(t.queue),1===this._queues.length&&$.call(this,t.queue))}function he(e){return G(this,void 0,void 0,(function(){var t,r,n,i,a,s,c,u;return H(this,(function(l){if(t=v.P6.getEnvInfo(),r=this.root.lookup("easemob.pb.MSync"),"miniCore"===this.name||"web"===t.platform){try{i=new Uint8Array(e.data),n=r.decode(i)}catch(e){throw new Error("decode message fail.")}return[2,n]}if("zfb"===t.platform||"dd"===t.platform){for(a=o().atob(e.data),s=[],c=0,u=a.length;c<u;++c)s.push(a.charCodeAt(c));return[2,r.decode(s)]}try{n=r.decode(e.data)}catch(e){throw new Error("decode message fail.")}return[2,n]}))}))}function fe(e){var t=this;this.lastHeartbeat=Date.now(),this.probingTimer&&clearTimeout(this.probingTimer),e.then((function(e){if(e)switch(e.command){case 0:me.call(t,e);break;case 1:Z.call(t,e);break;case 2:pe.call(t,e);break;case 3:oe.call(t,e);break;default:u.kg.error("unexpected msync command: ".concat(e.command))}else u.kg.error("unexpected msync result: ".concat(e))}))}function me(e){var t,r,n,o,i,l,d,p,h,f,g,E,y,_,T,I,O,R,C,N,b,A,M,U,k,x,L,D,j,F,W,K,q,z,X,Z,Y,Q,ee,te,re,oe,ie,ae,se,ce;return G(this,void 0,void 0,(function(){var G,ue,le,de,pe,he,fe,me,ge,ve,Ee,ye,_e,Te,Ie,Oe,Re,Ce,Ne,Se,be,Ae,Me,we,Pe,Ue,ke,xe,Le,De,je,Be,Ge,He,Fe,We,Ke,qe,ze,Ve,Xe,Je,Ze,Ye,Qe,$e=this;return H(this,(function(H){switch(H.label){case 0:if(G=(G=this.root.lookup("easemob.pb.CommSyncDL")).decode(e.payload),ue=new(a())(G.serverId.low,G.serverId.high,G.serverId.unsigned).toString(),le=new(a())(G.metaId.low,G.metaId.high,G.metaId.unsigned).toString(),!(Number(le)>0))return[3,23];if(clearTimeout(null===(t=this._msgHash[le])||void 0===t?void 0:t.messageTimer),!G.status)return[3,22];if(0!==G.status.errorCode)return[3,21];if(null==(de=this._msgHash[le])?void 0:de.isHandleChatroom){try{if(pe="join"===(null===(r=this._msgHash[le])||void 0===r?void 0:r.operation)){he={};try{G.metas.length>0&&(fe=this.root.lookup("easemob.pb.MUCBody"),me=fe.decode(G.metas[0].payload),(ge=JSON.parse(me.status.chatroomInfo||"{}")[this.user])&&(he={isAllMembersMuted:ge.is_all_mute,createTimestamp:ge.create_timestamp,isInAllowlist:ge.is_in_white_list,memberCount:ge.member_count,muteExpireTimestamp:ge.mute_duration?ge.mute_duration:-1}))}catch(e){u.kg.error("decode chat room info error",e)}(null===(n=this._msgHash[le])||void 0===n?void 0:n.resolve)instanceof Function&&this._msgHash[le].resolve({type:0,data:{action:"apply",id:this._msgHash[le].roomId,result:!0,user:this.context.userId,info:he}}),(null===(o=this._msgHash[le])||void 0===o?void 0:o.success)instanceof Function&&this._msgHash[le].success({type:0,data:{action:"apply",id:this._msgHash[le].roomId,result:!0,user:this.context.userId,info:he}})}(null===(i=this._msgHash[le])||void 0===i?void 0:i.resolve)instanceof Function&&!pe&&this._msgHash[le].resolve({type:0,data:{result:!0}}),(null===(l=this._msgHash[le])||void 0===l?void 0:l.success)instanceof Function&&!pe&&this._msgHash[le].success({type:0,data:{result:!0}}),w.iO.has(le)&&(ve=w.iO.get(le),ze=ve.rpt,Ve=ve.requestName,ze({isEndApi:!0,data:{isSuccess:1,requestName:Ve,requestMethod:"WEBSOCKET",requestUrl:this.url,code:P.dd.success}}),w.iO.delete(le))}catch(e){w.iO.has(le)&&(Ee=w.iO.get(le),ze=Ee.rpt,Ve=Ee.requestName,ze({isEndApi:!0,data:{isSuccess:0,requestName:Ve,requestMethod:"WEBSOCKET",requestUrl:this.url,code:P.dd.failed,codeDesc:"when executing success function error"}}),w.iO.delete(le)),Je=m.Z.create({type:s.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e}),this.onError&&this.onError(Je),null===(d=this.eventHandler)||void 0===d||d.dispatch("onError",Je)}delete this._msgHash[le]}return!de||de.isHandleChatroom?[3,20]:(ye=null,_e="",Te=0,Ie="",Oe=null,this._msgHash[le].thirdMessage?(this._msgHash[le].thirdMessage.id=G.serverId,this._msgHash[le].thirdMessage.timestamp=G.timestamp,[4,c.ZP.call(this,this._msgHash[le].thirdMessage,G.status,!0,!0)]):[3,2]);case 1:Oe=H.sent(),H.label=2;case 2:if(0===G.metas.length)return[3,13];H.label=3;case 3:switch(H.trys.push([3,12,,13]),Re=G.metas[0],Ce=G.status,Re.ns){case 1:return[3,4];case 5:return[3,9]}return[3,10];case 4:return this.useReplacedMessageContents?[4,c.ZP.call(this,Re,Ce,!0,!0)]:[3,8];case 5:return Oe=H.sent(),[4,null===(h=null===(p=this._localCache)||void 0===p?void 0:p.getInstance())||void 0===h?void 0:h.getMessageByServerMsgId(le)];case 6:return(Ne=H.sent())?[4,null===(g=null===(f=this._localCache)||void 0===f?void 0:f.getInstance())||void 0===g?void 0:g.putMessageToDB(B(B(B({},Ne),Oe),{id:le}))]:[3,8];case 7:H.sent(),H.label=8;case 8:return[3,11];case 9:return(Se=v.P6.parseNotify(G.metas[0].payload)).edit_msg&&(be=Se.edit_msg,Ae=be.count,Me=be.operator,we=be.edit_time,Pe=be.sender,Ue=be.send_time,ke=be.chat_type,ye={operationTime:we,operatorId:Me,operationCount:Ae},_e=Pe,Te=Number(Ue),Ie=c.UR[ke]),[3,11];case 10:return u.kg.error("decode local meta error",Re),[3,11];case 11:return[3,13];case 12:return xe=H.sent(),Je=m.Z.create({type:s.E.WEBIM_LOAD_MSG_ERROR,message:"decode local meta message error",data:xe}),this.onError&&this.onError(Je),null===(E=this.eventHandler)||void 0===E||E.dispatch("onError",Je),[3,13];case 13:w.TJ.has(le)&&(w.TJ.get(le).rpt({isEndApi:!0,data:{isSuccess:1,requestMethod:"WEBSOCKET",requestUrl:this.url,code:P.dd.success,msgId:ue}}),w.TJ.delete(le)),H.label=14;case 14:return H.trys.push([14,18,,19]),Le={localMsgId:le,serverMsgId:ue},ye&&(De=this._msgHash[le],je=De.editMessageId,Be=De.ext,Ge=De.customExts,He=De.customEvent,Oe.modifiedInfo=ye,Oe.from=_e,Oe.time=Number(Te),Oe.chatType=Ie,Oe.id=je,null===(T=null===(_=null===(y=this._localCache)||void 0===y?void 0:y.getInstance())||void 0===_?void 0:_.getMessageByServerMsgId(je))||void 0===T||T.then((function(e){var t,r,n,o,i,a;e&&("txt"===e.type?null===(r=null===(t=$e._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.putMessageToDB(B(B({},e),{msg:Oe.msg,modifiedInfo:Oe.modifiedInfo,translations:Oe.translations,ext:Be?Oe.ext:e.ext})):"custom"===e.type?null===(o=null===(n=$e._localCache)||void 0===n?void 0:n.getInstance())||void 0===o||o.putMessageToDB(B(B({},e),{ext:Be?Oe.ext:e.ext,customExts:Ge,customEvent:He,modifiedInfo:Oe.modifiedInfo})):null===(a=null===(i=$e._localCache)||void 0===i?void 0:i.getInstance())||void 0===a||a.putMessageToDB(B(B({},e),{ext:Be?Oe.ext:e.ext,modifiedInfo:Oe.modifiedInfo})))}))),Oe&&(ye?("txt"===Oe.type&&(Le.message=Oe),Le.modifiedInfo=ye):Le.message=Oe),[4,null===(O=null===(I=this._localCache)||void 0===I?void 0:I.getInstance())||void 0===O?void 0:O.updateLocalMessage(le,{serverMsgId:ue,status:S.r.SUCCESS})];case 15:return H.sent(),(null===(R=this._msgHash[le])||void 0===R?void 0:R.success)instanceof Function?[4,this._msgHash[le].success(le,ue)]:[3,17];case 16:H.sent(),H.label=17;case 17:return(null===(C=this._msgHash[le])||void 0===C?void 0:C.resolve)instanceof Function&&this._msgHash[le].resolve(Le),[3,19];case 18:return Fe=H.sent(),Je=m.Z.create({type:s.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:Fe}),this.onError&&this.onError(Je),null===(N=this.eventHandler)||void 0===N||N.dispatch("onError",Je),[3,19];case 19:this.onReceivedMessage&&this.onReceivedMessage({id:le,mid:ue,to:this._msgHash[le].to,time:0}),null===(b=this.eventHandler)||void 0===b||b.dispatch("onReceivedMessage",{id:le,mid:ue,to:this._msgHash[le].to}),delete this._msgHash[le],H.label=20;case 20:return[3,22];case 21:if(15===G.status.errorCode)(null===(A=this._msgHash[le])||void 0===A?void 0:A.fail)instanceof Function&&this._msgHash[le].fail({type:s.E.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject({type:s.E.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"}),null===(U=null===(M=this._localCache)||void 0===M?void 0:M.getInstance())||void 0===U||U.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL});else if(1===G.status.errorCode){switch(We=void 0,G.status.reason){case"blocked":We=s.E.PERMISSION_DENIED;break;case"group not found":We=s.E.GROUP_NOT_EXIST;break;case"not in group or chatroom":We=s.E.GROUP_NOT_JOINED;break;case"exceed recall time limit":We=s.E.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":We=s.E.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":We=s.E.SERVICE_NOT_ALLOW_MESSAGING;break;case"nonroster":We=s.E.USER_NOT_FRIEND,G.status.reason="not contact";break;case"group is disabled":We=s.E.GROUP_IS_DISABLED,G.status.reason="group is disabled";break;case"limit directed users":We=s.E.MAX_LIMIT;break;case"Sorry, edit limit reached":We=s.E.MAX_LIMIT,G.status.reason="Modify message limit reached";break;case"Sorry, message does not exist":We=s.E.MODIFY_MESSAGE_NOT_EXIST,G.status.reason="The message does not exist.";break;case"Sorry, You do not have permission":We=s.E.PERMISSION_DENIED,G.status.reason="You do not have the modified permission.";break;case"Sorry, format is incorrect":We=s.E.MODIFY_MESSAGE_FORMAT_ERROR,G.status.reason="The modify messaged format error.";break;case"Sorry, edit is not available":We=s.E.SERVICE_NOT_ENABLED,G.status.reason="The message modify function is not activated.";break;case"Sorry, edit fail":We=s.E.MODIFY_MESSAGE_FAILED,G.status.reason="Modify message failed.";break;default:G.status.reason.includes("grpID")&&G.status.reason.includes("does not exist!")?(We=s.E.CHATROOM_NOT_EXIST,G.status.reason="The chat room dose not exist."):G.status.reason.includes("username")&&G.status.reason.includes("doesn't exist!")?We=s.E.USER_NOT_FOUND:"group member list is full!"===G.status.reason?We=s.E.CHATROOM_MEMBERS_FULL:G.status.reason.includes("can not join this group")&&G.status.reason.includes("is in the blacklist")?(We=s.E.PERMISSION_DENIED,G.status.reason="permission denied"):"can not operate this group, reason: group is disabled"===G.status.reason?We=s.E.GROUP_IS_DISABLED:G.status.reason.includes("moderation")?We=s.E.MESSAGE_MODERATION_BLOCKED:G.status.reason.includes("group ID illegal, please check it")?(We=s.E.REQUEST_PARAMETER_ERROR,G.status.reason="Invalid parameter"):We=G.status.reason.includes("has create too many chatrooms")||G.status.reason.includes("has joined too many chatrooms")?s.E.MAX_LIMIT:G.status.reason.includes("auto create failed")?s.E.SERVER_BUSY:s.E.SERVER_UNKNOWN_ERROR}this._msgHash[le]&&((null===(k=this._msgHash[le])||void 0===k?void 0:k.isHandleChatroom)?(Xe=m.Z.create({type:We,message:G.status.reason||"",data:""}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].error instanceof Function&&this._msgHash[le].error(Xe),w.iO.has(le)&&(Ke=P.dd.failed,We===s.E.CHATROOM_NOT_EXIST?Ke=P.dd.notFound:We===s.E.CHATROOM_MEMBERS_FULL&&(Ke=P.dd.reachLimit),qe=w.iO.get(le),ze=qe.rpt,Ve=qe.requestName,ze({isEndApi:!0,data:{isSuccess:0,requestName:Ve,requestMethod:"WEBSOCKET",requestUrl:this.url,code:Ke,codeDesc:G.status.reason}}),w.iO.delete(le))):(Xe=m.Z.create({type:We,message:G.status.reason||"",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail({type:We,reason:G.status.reason?G.status.reason:"",data:{id:le,mid:ue}}),null===(L=null===(x=this._localCache)||void 0===x?void 0:x.getInstance())||void 0===L||L.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL})),delete this._msgHash[le])}else if(7===G.status.errorCode)"sensitive words"===G.status.reason&&this._msgHash[le]?(Xe=m.Z.create({type:s.E.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"sensitive words",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail({type:s.E.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:le,mid:ue,reason:"sensitive words"}}),null===(j=null===(D=this._localCache)||void 0===D?void 0:D.getInstance())||void 0===j||j.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL})):"blocked by mod_antispam"===G.status.reason&&this._msgHash[le]?(Xe=m.Z.create({type:s.E.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"blocked by mod_antispam",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail({type:s.E.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:le,mid:ue,reason:"blocked by mod_antispam"}}),null===(W=null===(F=this._localCache)||void 0===F?void 0:F.getInstance())||void 0===W||W.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL})):"user is mute"===G.status.reason&&this._msgHash[le]?(Xe=m.Z.create({type:s.E.USER_MUTED_BY_ADMIN,message:"user is mute",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail(Xe),null===(q=null===(K=this._localCache)||void 0===K?void 0:K.getInstance())||void 0===q||q.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL})):"traffic limit"===G.status.reason&&this._msgHash[le]?(Xe=m.Z.create({type:s.E.MESSAGE_CURRENT_LIMITING,message:"traffic limit",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail(Xe),null===(X=null===(z=this._localCache)||void 0===z?void 0:z.getInstance())||void 0===X||X.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL})):"Sorry, data is too large"===G.status.reason&&this._msgHash[le]&&(Xe=m.Z.create({type:s.E.MESSAGE_SIZE_LIMIT,message:"Sorry, data is too large",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail(Xe),null===(Y=null===(Z=this._localCache)||void 0===Z?void 0:Z.getInstance())||void 0===Y||Y.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL}));else if(19===G.status.errorCode)this._msgHash[le]&&(w.TJ.has(le)&&(w.TJ.get(le).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.E.MESSAGE_EXTERNAL_LOGIC_BLOCKED,codeDesc:G.status.reason||"",msgId:ue}}),w.TJ.delete(le)),Xe=m.Z.create({type:s.E.MESSAGE_EXTERNAL_LOGIC_BLOCKED,message:G.status.reason||"",data:{id:le,mid:ue}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail({type:s.E.MESSAGE_EXTERNAL_LOGIC_BLOCKED,data:{id:le,mid:ue,reason:G.status.reason}}),null===(ee=null===(Q=this._localCache)||void 0===Q?void 0:Q.getInstance())||void 0===ee||ee.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL}));else if(this._msgHash[le]){w.TJ.has(le)&&(w.TJ.get(le).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.E.WEBIM_LOAD_MSG_ERROR,codeDesc:(null===(te=G.status)||void 0===te?void 0:te.reason)||"",msgId:ue}}),w.TJ.delete(le));try{Xe=m.Z.create({type:s.E.WEBIM_LOAD_MSG_ERROR,message:(null===(re=G.status)||void 0===re?void 0:re.reason)||"",data:{id:le,mid:ue,reason:G.status&&G.status.reason}}),this._msgHash[le].reject instanceof Function&&this._msgHash[le].reject(Xe),null===(ie=null===(oe=this._localCache)||void 0===oe?void 0:oe.getInstance())||void 0===ie||ie.updateLocalMessage(le,{serverMsgId:ue,status:S.r.FAIL}),this._msgHash[le].fail instanceof Function&&this._msgHash[le].fail({type:s.E.WEBIM_LOAD_MSG_ERROR,data:{errorCode:G.status&&G.status.errorCode,reason:G.status&&G.status.reason}})}catch(e){Je=m.Z.create({type:s.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e}),this.onError&&this.onError(Je),null===(ae=this.eventHandler)||void 0===ae||ae.dispatch("onError",Je)}delete this._msgHash[le]}else w.TJ.has(le)&&(w.TJ.get(le).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,codeDesc:"on message error",msgId:ue}}),w.TJ.delete(le)),Je=m.Z.create({type:s.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"on message error"}),this.onError&&this.onError(Je),null===(se=this.eventHandler)||void 0===se||se.dispatch("onError",Je);H.label=22;case 22:return[2];case 23:if(G.metas&&0!==G.metas.length)try{V.call(this,G.metas,G.status)}catch(e){Je=m.Z.create({type:s.E.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e}),u.kg.error("decode message error",e),this.onError&&this.onError(Je),null===(ce=this.eventHandler)||void 0===ce||ce.dispatch("onError",Je)}finally{G.isLast?(u.kg.debug("metas & CommSyncDLMessage.isLast",G.isLast),Ze=-1,this._queues.some((function(e,t){return e.name===G.name&&(Ze=t,!0)}))&&Ze>0&&this._queues.splice(Ze,1),this._queues.length>0&&$.call(this,this._queues[0]),J.call(this,G)):G.nextKey&&(Qe=new(a())(G.nextKey.low,G.nextKey.high,G.nextKey.unsigned).toString(),u.kg.debug("nexKey:",Qe,"this.nextKey:",this.nexKey),Qe!==this.nexKey&&(this.nexKey=Qe,ne.call(this,G.nextKey,G.queue)))}else G.isLast?(u.kg.debug("CommSyncDLMessage.isLast",G.isLast),Ye=-1,this._queues.some((function(e,t){return e.name===G.queue.name&&(Ye=t,!0)}))&&this._queues.splice(Ye,1),this._queues.length>0&&$.call(this,this._queues[0]),J.call(this,G)):G.nextKey&&(Qe=new(a())(G.nextKey.low,G.nextKey.high,G.nextKey.unsigned).toString(),u.kg.debug("nexKey:",Qe,"this.nextKey:",this.nexKey),Qe!==this.nexKey&&(this.nexKey=Qe,ne.call(this,G.nextKey,G.queue)));return[2]}}))}))}function ge(e){var t=[],r=this.root.lookup("easemob.pb.KeyValue"),n=[];for(var o in e){var i=r.decode(t);if(i.key=o,void 0!==e[o]){if("object"===k(e[o]))i.type=8,i.stringValue=JSON.stringify(e[o]);else if("string"==typeof e[o])i.type=7,i.stringValue=e[o];else if("boolean"==typeof e[o])i.type=1,i.varintValue=!0===e[o]?1:0;else if(Number.isInteger(e[o]))i.type=2,i.varintValue=e[o];else if("bigint"==typeof e[o]||"symbol"===k(e[o])||"function"==typeof e[o]||Number.isNaN(e[o]))i.type=7,i.stringValue=e[o].toString();else{if("number"!=typeof e[o]||Number.isInteger(e[o]))continue;i.type=6,i.doubleValue=e[o]}n.push(i)}}return n}function ve(e){var t,r,n,o=[];if(this.root){var i,c=this.root.lookup("easemob.pb.MessageBody.Content").decode(o);switch(i=!e.group&&"groupchat"!==(null===(t=null==e?void 0:e.chatType)||void 0===t?void 0:t.toLowerCase())||e.roomType?e.group&&e.roomType||"chatroom"===(null===(r=null==e?void 0:e.chatType)||void 0===r?void 0:r.toLowerCase())?"chatRoom":"singleChat":"groupChat",e.type){case"txt":c.type=0,c.text=e.msg;break;case"img":c.type=1,e.body?(c.displayName=e.body.filename,c.remotePath=e.body.url,c.secretKey=e.body.secret,c.fileLength=e.body.file_length,c.size=e.body.size,c.thumbnailDisplayName=e.body.filename):e.file?(c.displayName=e.file.filename,c.remotePath=e.file.url,c.secretKey=e.file.secret,c.fileLength=e.file.file_length,c.size=e.file.size,c.thumbnailDisplayName=e.file.filename):(c.displayName=e.filename,c.remotePath=e.url,c.secretKey=e.secret,c.fileLength=e.file_length,c.size=e.size,c.thumbnailDisplayName=e.filename),e.isBuildCombinedMsg&&(c.remotePath=e.url,c.secretKey=e.secret,c.size={height:e.height,width:e.width}),e.isGif&&(c.subType=1);break;case"video":c.type=2,e.body?(c.displayName=e.body.filename,c.remotePath=e.body.url,c.secretKey=e.body.secret,c.fileLength=e.body.file_length,c.duration=e.body.length,c.thumbnailDisplayName=e.body.filename,c.thumbnailRemotePath=this.useOwnUploadFun?"":"".concat(e.body.url,"?vframe=true"),c.thumbnailSecretKey=this.useOwnUploadFun?"":e.body.secret):e.isBuildCombinedMsg&&(c.displayName=e.filename,c.remotePath=e.url,c.secretKey=e.secret,c.fileLength=e.file_length,c.duration=e.length,c.thumbnailDisplayName=e.filename,c.thumbnailRemotePath=e.thumb,c.thumbnailSecretKey=e.thumb_secret);break;case"loc":c.type=3,c.latitude=e.lat,c.longitude=e.lng,c.address=e.addr,c.buildingName=e.buildingName,c.latitude=e.lat;break;case"audio":c.type=4,e.body?(c.displayName=e.body.filename,c.remotePath=e.body.url,c.secretKey=e.body.secret,c.fileLength=e.body.file_length,c.duration=e.body.length,c.thumbnailDisplayName=e.body.filename):e.isBuildCombinedMsg&&(c.displayName=e.filename,c.remotePath=e.url,c.secretKey=e.secret,c.fileLength=e.file_length,c.duration=e.length,c.thumbnailDisplayName=e.filename);break;case"file":c.type=5,e.body?(c.displayName=e.body.filename,c.remotePath=e.body.url,c.secretKey=e.body.secret,c.fileLength=e.body.file_length,c.thumbnailDisplayName=e.body.filename):e.isBuildCombinedMsg&&(c.displayName=e.filename,c.remotePath=e.url,c.secretKey=e.secret,c.fileLength=e.file_length,c.thumbnailDisplayName=e.filename);break;case"cmd":c.type=6,c.action=e.action;break;case"custom":c.type=7,c.customEvent=e.customEvent,c.customExts=ge.call(this,e.customExts);break;case"combine":c.type=0,c.subType=0,c.text=e.compatibleText,c.displayName=e.filename,c.remotePath=e.url,c.secretKey=e.secret,c.fileLength=e.file_length,c.title=e.title,c.summary=e.summary,c.combineLevel=e.combineLevel}var u=[];e.ext&&(u=ge.call(this,e.ext));var l=this.root.lookup("easemob.pb.MessageBody"),d=l.decode(o),p=e.from||this.context.jid.name;d.from={name:e.isBuildCombinedMsg?p:this.context.jid.name};var h=e.to.indexOf("/"),f=h>-1?e.to.substring(0,h):e.to;if(d.to={name:f},"channel"===e.type)d.type=x.CHANNEL_ACK;else if("recall"===e.type)d.type=x.RECALL,d.ackMessageId=e.ackId;else if("delivery"===e.type)d.type=x.DELIVER_ACK,d.ackMessageId=e.ackId;else if("read"===e.type)d.type=x.READ_ACK,d.ackMessageId=e.ackId,"groupChat"===i&&(d.msgConfig={allowGroupAck:!0},d.ackContent=e.ackContent);else if("chatRoom"===i)d.type=x.CHATROOM;else if("groupChat"===i){if(d.type=x.GROUPCHAT,e.msgConfig){var m=e.msgConfig.allowGroupAck;d.msgConfig={allowGroupAck:!!m}}}else"singleChat"===i&&(d.type=x.SINGLECHAT);e.editMessageId&&(d.type=x.EDIT,d.editMessageId=e.editMessageId,d.editScope=L.BODY,e.ext&&(d.editScope=L.BODY_AND_EXT)),d.contents=[c],d.ext=u;var g=function(e){var t={};return"translations"in e&&(t.translations=e.translations),"isChatThread"in e&&e.isChatThread&&(t.thread={}),Object.keys(t).length>0?JSON.stringify(t):""}(e);g&&(d.meta=g),d=l.encode(d).finish();var v=this.root.lookup("easemob.pb.Meta"),E=v.decode(o);E.id=e.id;var y="easemob.com";if("chatRoom"!==i&&"groupChat"!==i||(y="conference.easemob.com"),E.to={appKey:this.appKey,name:f,domain:y},h>-1&&(E.to.clientResource=e.to.substring(h+1,e.to.length)),"chatRoom"===i&&(E.ext=ge.call(this,function(e){return{chatroom_msg_tag:"high"===e.priority?0:"low"===e.priority?2:1}}(e))),"recall"===e.type&&e.metaExt&&(E.ext=ge.call(this,{recallMessageExtensionInfo:e.metaExt})),E.ns=1,E.payload=d,E.routetype=e.deliverOnlineOnly?1:0,"singleChat"!==i&&Array.isArray(e.receiverList)&&(null===(n=e.receiverList)||void 0===n?void 0:n.length)>0&&(E.directedUsers=e.receiverList,E.routetype=2),e.isBuildCombinedMsg)return E.timestamp=a().fromValue(e.time),v.encode(E).finish();var _=this.root.lookup("easemob.pb.CommSyncUL"),T=_.decode(o);T.meta=E,!e.isPing&&ye.call(this,e,E),T=_.encode(T).finish();var I=this.root.lookup("easemob.pb.MSync"),O=I.decode(o);return O.version=this.version,O.encryptType=this.encryptType,O.command=0,O.payload=T,I.encode(O).finish()}e.fail&&e.fail({type:s.E.WEBIM_CONNCTION_CLIENT_OFFLINE,message:"Not logged in"})}function Ee(e){var t,r,n=this,o=B({},e);if(o.editMessageId){var i=ve.call(this,o);Re.call(this,i)}else{if(e.file)return o.accessToken=this.token,o.appKey=this.appKey,o.apiUrl=this.apiUrl,o.body&&o.body.url?ve.call(this,o):o.isGif&&"image/gif"!==o.file.data.type?void this._msgHash[o.id].reject({type:s.E.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"The file type is not gif."}):new Promise((function(t,r){var i=o.onFileUploadComplete;o.onFileUploadComplete=function(t){var r,a,c,u,l,d,p;if(t.entities){if(t.entities[0]["file-metadata"]){var h=t.entities[0]["file-metadata"]["content-length"];o.file_length=h,o.filetype=t.entities[0]["file-metadata"]["content-type"],h>204800&&(o.thumbnail=!0)}var f="".concat(n.apiUrl,"/").concat(n.orgName,"/").concat(n.appName,"/chatfiles/").concat(t.entities[0].uuid);o.body={type:o.type||"file",secret:t.entities[0]["share-secret"],filename:o.file.filename||o.filename,url:f,length:o.length||0,filetype:o.filetype||o.file.filetype,file_length:(null===(c=null===(a=o.file)||void 0===a?void 0:a.data)||void 0===c?void 0:c.size)||0,size:{width:o.width||0,height:o.height||0}},o.file.url=t.uri,e.secret=t.entities[0]["share-secret"],t.url=e.url="".concat(f,"?em-redirect=true&share-secret=").concat(t.entities[0]["share-secret"]),e.file_length=o.file_length=(null===(l=null===(u=o.file)||void 0===u?void 0:u.data)||void 0===l?void 0:l.size)||0,"img"===o.type&&(e.thumb="".concat(e.url,"&thumbnail=true"),t.thumb="".concat(t.url,"&thumbnail=true")),"video"===o.type&&(e.thumb="".concat(e.url,"&vframe=true"),e.thumb_secret=t.entities[0]["share-secret"],t.thumb="".concat(t.url,"&vframe=true")),i instanceof Function&&i(t,o.id);var m=ve.call(n,o);w.TJ.size<=w.F3&&w.TJ.set(o.id,{rpt:n.dataReport.geOperateFun({operationName:P.fI.SEND_MSG})}),null===(p=null===(d=n._localCache)||void 0===d?void 0:d.getInstance())||void 0===p||p.storeMessage(e,S.r.INPROGRESS),Re.call(n,m)}else null===(r=n._msgHash[o.id])||void 0===r||r.reject({type:s.E.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the file",data:t})},o.onFileUploadError=function(e){var t;o.onFileUploadError instanceof Function&&o.onFileUploadError(e),null===(t=n._msgHash[o.id])||void 0===t||t.reject({type:s.E.WEBIM_UPLOADFILE_ERROR,message:e.message||"Failed to upload the file",data:e})},v.P6.uploadFile.call(n,o,P.fI.UPLOAD_MSG_ATTACH)}));if("combine"===e.type){o.accessToken=this.token,o.appKey=this.appKey,o.apiUrl=this.apiUrl;var a=o.onFileUploadComplete,c=o.onFileUploadError;return new Promise((function(t,r){var i,l,d,p;if((null===(i=e.messageList)||void 0===i?void 0:i.length)>300||0===(null===(l=e.messageList)||void 0===l?void 0:l.length))return n._msgHash[o.id].reject({type:s.E.MAX_LIMIT,message:"The number of combined messages exceeded the limit."});var h=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}([],e.messageList,!0),f=0;if(h.forEach((function(e){(null==e?void 0:e.combineLevel)>f&&(f=null==e?void 0:e.combineLevel)})),o.combineLevel=f+1,o.combineLevel>10)return n._msgHash[o.id].reject({type:s.E.MAX_LIMIT,message:"The level of the merged message exceeded the limit."});var m=_e.call(n,h),g=function(t,r){var i,s,c,u,l,d,p="".concat(n.apiUrl,"/").concat(n.orgName,"/").concat(n.appName,"/chatfiles/").concat(t.entities[0].uuid),h=null===(i=t.entities[0])||void 0===i?void 0:i["share-secret"],f="".concat(p,"?em-redirect=true");h&&(f="".concat(f,"&share-secret=").concat(h)),a instanceof Function&&a({url:f,secret:h}),e.url=f,e.secret=h,o.url=f,o.secret=t.entities[0]["share-secret"],o.filename=(null===(s=o.file)||void 0===s?void 0:s.filename)||(null==r?void 0:r.fileName),o.file_length=(null===(u=null===(c=o.file)||void 0===c?void 0:c.data)||void 0===u?void 0:u.size)||(null==r?void 0:r.fileLength)||0,null===(d=null===(l=n._localCache)||void 0===l?void 0:l.getInstance())||void 0===d||d.storeMessage(e,S.r.INPROGRESS);var m=ve.call(n,o);Re.call(n,m)},E=v.P6.getEnvInfo();if("web"!==E.platform&&"node"!==E.platform&&"quick_app"!==E.platform&&(null===(p=null===(d=E.global)||void 0===d?void 0:d.canIUse)||void 0===p?void 0:p.call(d,"getFileSystemManager"))){var y=E.global.getFileSystemManager(),_="".concat(n.apiUrl,"/").concat(n.orgName,"/").concat(n.appName,"/chatfiles");y.writeFile({filePath:"".concat(E.global.env.USER_DATA_PATH,"/combine"),data:m.buffer,encoding:"binary",success:function(e){E.global.uploadFile({url:_,filePath:"".concat(E.global.env.USER_DATA_PATH,"/combine"),name:"file",header:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+o.accessToken},success:function(e){if(200===e.statusCode){u.kg.debug("upload success",e);var t=JSON.parse(e.data);g(t,{fileName:"combine",fileLength:m.length})}else u.kg.debug("upload fail"),o.onFileUploadError instanceof Function&&o.onFileUploadError(e),this._msgHash[o.id].reject({type:s.E.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})},fail:function(t){u.kg.debug("upload fail"),o.onFileUploadError instanceof Function&&o.onFileUploadError(e),this._msgHash[o.id].reject({type:s.E.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:t})}})},fail:function(e){u.kg.debug("write file fail",e),this._msgHash[o.id].reject({type:s.E.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})}})}else{var T=new File([m],"combine",{type:"application/octet-stream"}),I={url:URL.createObjectURL(T),filename:o.id,data:T};o.file=I,o.onFileUploadComplete=function(e){g(e)},o.onFileUploadError=function(e){c instanceof Function&&c(e),n._msgHash[o.id].reject({type:s.E.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})},v.P6.uploadFile.call(n,o,P.fI.UPLOAD_MSG_ATTACH)}}))}"img"===e.type&&(o.body||(o.body=B(B({},o),{size:{width:o.width||0,height:o.height||0}}))),null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.storeMessage(e,S.r.INPROGRESS),i=ve.call(this,o),Re.call(this,i)}}function ye(e,t){if(e.editMessageId)return t.ignoreCallback=!0,void(this._msgHash[e.id].thirdMessage=t);F.includes(e.type)&&(this._msgHash[e.id].thirdMessage=t)}function _e(e){for(var t=Uint8Array.from("cm",(function(e){return e.charCodeAt(0)})),r=0;r<e.length;r++){for(var n=e[r],o=B(B({},n),{isBuildCombinedMsg:!0}),i=this.mSync.encodeChatMsg.call(this,o),a=i.length,s=new Uint8Array(4),c=0;c<4;c++)s[c]=a>>8*(3-c)&255;u.kg.debug("message length:",s);var l=new Uint8Array(t.length+s.length+i.length);l.set(t),l.set(s,t.length),l.set(i,t.length+s.length),t=l}var d=new Uint8Array(t.length+1),p=0;for(r=2;r<t.length;r++)r%2==1&&(p^=t[r]);return d.set(t),u.kg.debug("checkResult:",p),d[t.length]=p,d}function Te(e,t,r){var n=[],o=this.root.lookup("easemob.pb.MUCBody"),i=e.roomId,a=e.ext,s=void 0===a?"":a,c=e.leaveOtherRooms,u=void 0!==c&&c,l=o.decode(n);l.mucId={appKey:this.appKey,name:i,domain:"conference.easemob.com"},l.operation="join"===r?2:3,l.from={name:this.context.userId},l.isChatroom=!0,"join"===r&&(l.ext=s,l.leaveOtherRooms=u),l=o.encode(l).finish();var d=this.root.lookup("easemob.pb.Meta").decode(n);d.id=t,d.from={appKey:this.appKey,name:this.context.userId,domain:"easemob.com",client_resource:this.context.jid.clientResource},d.to={domain:"easemob.com"},d.ns=2,d.payload=l;var p=this.root.lookup("easemob.pb.CommSyncUL"),h=p.decode(n);h.meta=d,h=p.encode(h).finish();var f=this.root.lookup("easemob.pb.MSync"),m=f.decode(n);return m.version=this.version,m.encryptType=this.encryptType,m.command=0,m.payload=h,f.encode(m).finish()}function Ie(e,t){var r=v.P6.getUniqueId(),n=Te.call(this,e,r,t),o="join"===t?P.fI.JOIN_CHATROOM:P.fI.QUIT_CHATROOM,i=this.dataReport.geOperateFun({operationName:o});return w.iO.size<=w.F3&&w.iO.set(r,{rpt:i,requestName:o}),Re.call(this,B(B({},e),{isHandleChatroom:!0,joinMsg:n,id:r,operation:t}),r)}function Oe(e){var t=this;return new Promise((function(r,n){var o,i,a,c,l,d;if(u.kg.debug("call send"),t.logOut)return u.kg.debug("send message failed",s.E.WEBIM_CONNECTION_CLOSED),n({type:s.E.WEBIM_CONNECTION_CLOSED,message:"not login"});if(!e.id||"string"!=typeof e.id||""===e.id)return n({type:s.E.MESSAGE_PARAMETER_ERROR,message:'Missing required parameter: "id"'});if(!e.to||"string"!=typeof e.to||""===e.to)return n({type:s.E.MESSAGE_PARAMETER_ERROR,message:'Missing required parameter: "to"'});var p="file"===e.type||"img"===e.type||"audio"===e.type||"video"===e.type,h="delivery"===e.type||"read"===e.type||"channel"===e.type,f="cmd"===e.type,m="recall"===e.type,g=null==e?void 0:e.editMessageId,v=!(h||m||f||g);if(e.id){if(!p&&!h||p&&t.useOwnUploadFun){var E="recall"===e.type?P.fI.SEND_RECALL_MSG:P.fI.SEND_MSG;g&&(E=P.fI.MODIFY_MESSAGE),w.TJ.size<=w.F3&&w.TJ.set(e.id,{rpt:t.dataReport.geOperateFun({operationName:E})})}v&&(null===(i=null===(o=t._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.storeMessage(e,S.r.CREATE)),t._msgHash[e.id]=B(B({},e),{resolve:r,reject:n})}if(p||"combine"===e.type)return Ee.call(t,e);if("txt"===e.type&&(null===(a=e.msgConfig)||void 0===a?void 0:a.languages)&&Array.isArray(null===(c=e.msgConfig)||void 0===c?void 0:c.languages)&&e.msgConfig.languages.length>0){var y=t.translateMessage||t.translation.translateMessage;if(!y)throw new Error("there is no method to translate message");y.call(t,{text:e.msg,languages:e.msgConfig.languages}).then((function(r){var n,o,i,a=null===(n=r.data[0])||void 0===n?void 0:n.translations;a=a.map((function(e){return{code:e.to,text:e.text}})),e.translations=a,t._msgHash[e.id].translations=a,null===(i=null===(o=t._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.storeMessage(e,S.r.INPROGRESS);var s=ve.call(t,e);Re.call(t,s,e.id)})).catch((function(e){n(e)}))}else{v&&(null===(d=null===(l=t._localCache)||void 0===l?void 0:l.getInstance())||void 0===d||d.storeMessage(e,S.r.INPROGRESS));var _=ve.call(t,e);Re.call(t,_,e.id)}}))}function Re(e,t){var r,n=this;if(e.isHandleChatroom){if(!this.isOpened()){var o={data:"",type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};if(w.iO.has(e.id)){var i=w.iO.get(e.id);(0,i.rpt)({isEndApi:!0,data:{isSuccess:0,requestName:i.requestName,requestMethod:"WEBSOCKET",requestUrl:this.url,code:P.dd.disconnect,codeDesc:"websocket has been disconnected"}}),w.iO.delete(e.id)}return Promise.reject(o)}return new Promise((function(r,o){var i;n._msgHash[e.id]=B(B({},e),{resolve:r,reject:o});var a=v.P6.getEnvInfo();i="miniCore"===n.name||"web"===a.platform?e.joinMsg:q.call(n,e.joinMsg,t);var c=t&&setTimeout((function(){var t,r,o;if(n._msgHash[e.id]){var i={type:s.E.REQUEST_TIMEOUT,message:"request timeout"};null===(r=(t=n._msgHash[e.id]).reject)||void 0===r||r.call(t,i),clearTimeout(null===(o=n._msgHash[e.id])||void 0===o?void 0:o.messageTimer),delete n._msgHash[e.id],n.reconnecting||n.reconnect(!0)}}),U.xz);n._msgHash[e.id].messageTimer=c,n.sock.send(i)}))}if(!this.isOpened())return null===(r=this.unMSyncSendMsgMap)||void 0===r||r.set(t,e),!this.logOut&&this.autoReconnectNumTotal<this.autoReconnectNumMax&&(u.kg.debug("need to reconnect",this.autoReconnectNumTotal,this.autoReconnectNumMax),this.offLineSendConnecting=!0,this.reconnecting||this.reconnect()),void(this.onError&&this.onError({type:s.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}));var a,c=t&&setTimeout((function(){var e,r,o;if(n._msgHash[null!=t?t:""]){var i={type:s.E.MESSAGE_SEND_TIMEOUT,message:"send message timeout"};null===(r=(e=n._msgHash[null!=t?t:""]).reject)||void 0===r||r.call(e,i),clearTimeout(null===(o=n._msgHash[null!=t?t:""])||void 0===o?void 0:o.messageTimer),delete n._msgHash[null!=t?t:""],n.reconnecting||n.reconnect(!0)}}),U.xz);this._msgHash[null!=t?t:""]&&(this._msgHash[null!=t?t:""].messageTimer=c);var l=v.P6.getEnvInfo();a="miniCore"===this.name||"web"===l.platform?e:q.call(this,e,t),this.sock.send(a)}var Ce=function(e,t){return e.send=Oe,e.sendMsg=Oe,u.kg.debug("init Msync by ".concat(e.name)),{generateProvision:K.bind(e),base64transform:q.bind(e),distributeMeta:z.bind(e),decodeMeta:V.bind(e),decodeUnreadDL:Z.bind(e),_rebuild:Y.bind(e),_lastsession:ee.bind(e),receiveProvision:oe.bind(e),isInQueue:de.bind(e),decodeNotice:pe.bind(e),decodeMSync:he.bind(e),distributeMSync:fe.bind(e),encodeChatMsg:ve.bind(e),upLoadFile:Ee.bind(e),send:Oe.bind(e),stopHeartBeat:ue.bind(e),handleChatRoom:Ie.bind(e),sendUnreadDeal:se.bind(e)}}},7252:function(e,t){"use strict";var r=function(){function e(e){this.type=e.type,this.message=e.message,this.data=e.data}return e.create=function(t){return new e(t)},e}();t.Z=r},8161:function(e,t,r){"use strict";r.d(t,{UR:function(){return n},t6:function(){return E}}),r(9601),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(7941),r(3710),r(9714),r(9653),r(6699),r(2023),r(2222),r(8309),r(9554),r(4747);var n,o=r(3720),i=r.n(o),a=r(4363),s=r(4024),c=r(6424),u=r(9743),l=r(7360),d=r(2449),p=r(7288),h=function(){return h=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},h.apply(this,arguments)},f=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},m=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e["chat:user"]="singleChat",e["chat:group"]="groupChat",e["chat:room"]="chatRoom"}(n||(n={}));var g={0:"TEXT",1:"IMAGE",2:"VIDEO",3:"LOCATION",4:"VOICE",5:"FILE",6:"COMMAND",7:"CUSTOM",8:"COMBINE"};function v(e){for(var t={},r=0;r<e.length;r++)if(8===e[r].type)t[e[r].key]=JSON.parse(e[r].stringValue);else if(7===e[r].type)t[e[r].key]=e[r].stringValue;else if(6===e[r].type)t[e[r].key]=e[r].doubleValue;else if(5===e[r].type)t[e[r].key]=e[r].floatValue;else if(1===e[r].type){var n=e[r].varintValue,o=new(i())(n.low,n.high,n.unsigned).toString();t[e[r].key]=0!==Number(o)}else 2!==e[r].type&&3!==e[r].type&&4!==e[r].type||(n=e[r].varintValue,o=new(i())(n.low,n.high,n.unsigned).toString(),t[e[r].key]=Number(o));return t}function E(e){var t="";return e.remotePath&&(t=s.P6.formatAttachUrl.call(this,e.remotePath),e.remotePath.includes("?em-redirect")||(t="".concat(t,"?em-redirect=true"),e.secretKey&&(t="".concat(t,"&share-secret=").concat(e.secretKey)))),t}function y(e,t){var r,n,o=t.from&&t.from.name;if(o===this.context.userId){var i=null===(r=null==e?void 0:e.from)||void 0===r?void 0:r.clientResource;o===(null===(n=null==t?void 0:t.to)||void 0===n?void 0:n.name)&&i&&i!==this.clientResource&&(o="".concat(o,"/").concat(i))}return o}function _(e,t){var r,n=t.to&&t.to.name;return(null===(r=null==e?void 0:e.to)||void 0===r?void 0:r.clientResource)&&(n="".concat(n,"/").concat(e.to.clientResource)),n}function T(e){var t,r,n,o,i,c,u,d,h,y,_,T,I,O,R,C,N,S,b,A,M,w,P,U,k,x,L;return f(this,void 0,void 0,(function(){var f,D,j,B,G,H,F,W,K,q,z,V,X,J,Z,Y,Q,$,ee,te,re,ne,oe,ie,ae,se,ce,ue,le,de,pe,he,fe,me,ge,ve,Ee,ye,_e,Te,Ie,Oe,Re,Ce,Ne,Se,be,Ae,Me,we;return m(this,(function(m){switch(m.label){case 0:switch(f=e.status,D=e.thirdMessage,j=e.msgBody,B=e.msgId,G=e.type,H=e.from,F=e.to,W=e.time,K=e.onlineState,q=e.chatType,z=e.ignoreCallback,V=e.priority,X=e.format,J=e.broadcast,Z=void 0!==J&&J,Y=e.isContentReplaced,Q=void 0!==Y&&Y,$={},ee={},te=f.errorCode>0,re=f.errorCode,ne=f.reason,oe={},ie=[],ae=[],se={},ce=null,ue=null,de=!1,pe=!1,D.ext&&(oe=v(D.ext)),D.meta&&"string"==typeof D.meta&&((he=JSON.parse(D.meta)).reaction&&(ie=he.reaction).forEach((function(e){e.isAddedBySelf=e.state,delete e.state})),he.translations&&(ae=he.translations),he.edit_msg&&(fe=he.edit_msg,me=fe.count,ge=fe.operator,ve=fe.edit_time,se={operationTime:ve,operatorId:ge,operationCount:me}),he.thread&&"{}"!==JSON.stringify(he.thread)&&(ce={messageId:he.thread.msg_parent_id,parentId:he.thread.muc_parent_id,chatThreadName:he.thread.thread_name}),he.thread_overview&&"{}"!==JSON.stringify(he.thread_overview)&&(ue={id:he.thread_overview.id,parentId:he.thread_overview.muc_parent_id,name:he.thread_overview.name,lastMessage:he.thread_overview.last_message&&"{}"!==JSON.stringify(he.thread_overview.last_message)?a.w.call(this,he.thread_overview.last_message):null,createTimestamp:he.thread_overview.create_timestamp,updateTimestamp:he.thread_overview.update_timestamp,messageCount:he.thread_overview.message_count||0}),he.isDelivered&&(de=!0),he.isRead&&(pe=!0)),j.type){case 0:return[3,1];case 1:return[3,7];case 2:return[3,10];case 3:return[3,13];case 4:return[3,16];case 5:return[3,19];case 6:return[3,22];case 7:return[3,23];case 8:return[3,26]}return[3,27];case 1:return Object.prototype.hasOwnProperty.call(j,"subType")&&0===j.subType?(le=E.call(this,j),Ee={id:B,type:"combine",chatType:q,to:F,from:H,ext:oe,time:Number(W),onlineState:K,title:j.title||"",summary:j.summary||"",url:le||"",secret:j.secretKey||"",file_length:j.fileLength||0,filename:j.displayName||"",compatibleText:j.text,combineLevel:j.combineLevel||0},$.msgConfig&&(Ee.msgConfig=$.msgConfig),ie.length>0&&(Ee.reactions=ie),ce&&(Ee.chatThread=ce),ue&&(Ee.chatThreadOverview=ue),"chatRoom"===q&&(Ee.priority=V,Ee.broadcast=Z),se.operationCount>0&&(Ee.modifiedInfo=se),Q&&(Ee.isContentReplaced=Q),pe&&(Ee.isRead=!0),de&&(Ee.isDelivered=!0),ee=Ee,z?[3,3]:[4,null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r?void 0:r.storeMessage(Ee,p.r.SUCCESS)]):[3,4];case 2:m.sent(),null===(n=this.eventHandler)||void 0===n||n.dispatch("onCombineMessage",Ee),m.label=3;case 3:return[3,28];case 4:return!($={id:B,type:G,contentsType:g[j.type],from:H,to:F,data:j.text,ext:oe,sourceMsg:j.text,time:W,msgConfig:D.msgConfig,onlineState:K}).msgConfig&&delete D.msgConfig,$.error=te,$.errorText=ne,$.errorCode=re,!z&&this.onTextMessage&&this.onTextMessage($),ye={id:B,type:"txt",chatType:q,msg:j.text,to:F,from:H,ext:oe,time:Number(W),onlineState:K},$.msgConfig&&(ye.msgConfig=$.msgConfig),ie.length>0&&(ye.reactions=ie),ce&&(ye.chatThread=ce),ue&&(ye.chatThreadOverview=ue),ae.length>0&&(ye.translations=ae),se.operationCount>0&&(ye.modifiedInfo=se),"chatRoom"===q&&(ye.priority=V,ye.broadcast=Z),Q&&(ye.isContentReplaced=Q),pe&&(ye.isRead=!0),de&&(ye.isDelivered=!0),ee=ye,z?[3,6]:[4,null===(i=null===(o=this._localCache)||void 0===o?void 0:o.getInstance())||void 0===i?void 0:i.storeMessage(ye,p.r.SUCCESS)];case 5:m.sent(),null===(c=this.eventHandler)||void 0===c||c.dispatch("onTextMessage",ye),m.label=6;case 6:return[3,28];case 7:return _e=(null===(u=null==j?void 0:j.size)||void 0===u?void 0:u.width)||0,Te=(null===(d=null==j?void 0:j.size)||void 0===d?void 0:d.height)||0,le=this.useOwnUploadFun?j.remotePath:E.call(this,j),!($={id:B,type:G,contentsType:g[j.type],from:H,to:F,url:le,secret:j.secretKey,filename:j.displayName,thumb:this.useOwnUploadFun?"":"".concat(le,"&thumbnail=true"),thumb_secret:j.secretKey,file_length:j.fileLength||"",width:_e,height:Te,filetype:j.filetype||"",accessToken:this.token,ext:oe,time:W,msgConfig:D.msgConfig,onlineState:K}).delay&&delete $.delay,!$.msgConfig&&delete D.msgConfig,$.error=te,$.errorText=ne,$.errorCode=re,!z&&this.onPictureMessage&&this.onPictureMessage($),Ie={id:B,type:"img",chatType:q,from:H,to:F,url:le||"",width:_e,height:Te,secret:j.secretKey||"",thumb:this.useOwnUploadFun?"":"".concat(le,"&thumbnail=true"),thumb_secret:j.secretKey,file_length:j.fileLength||0,ext:oe,time:Number(W),onlineState:K},$.msgConfig&&(Ie.msgConfig=$.msgConfig),ie.length>0&&(Ie.reactions=ie),ce&&(Ie.chatThread=ce),ue&&(Ie.chatThreadOverview=ue),"chatRoom"===q&&(Ie.priority=V,Ie.broadcast=Z),se.operationCount>0&&(Ie.modifiedInfo=se),Q&&(Ie.isContentReplaced=Q),pe&&(Ie.isRead=!0),de&&(Ie.isDelivered=!0),Object.prototype.hasOwnProperty.call(j,"subType")&&1===j.subType&&(Ie.isGif=!0),ee=Ie,z?[3,9]:[4,null===(y=null===(h=this._localCache)||void 0===h?void 0:h.getInstance())||void 0===y?void 0:y.storeMessage(Ie,p.r.SUCCESS)];case 8:m.sent(),null===(_=this.eventHandler)||void 0===_||_.dispatch("onImageMessage",Ie),m.label=9;case 9:return[3,28];case 10:return le=this.useOwnUploadFun?j.remotePath:E.call(this,j),!($={id:B,type:G,contentsType:g[j.type],from:H,to:F,url:le,secret:j.secretKey,filename:j.displayName,length:j.duration||"",file_length:j.fileLength||"",filetype:j.filetype||"",accessToken:this.token||"",ext:oe,time:W,msgConfig:D.msgConfig,onlineState:K}).delay&&delete $.delay,!$.msgConfig&&delete D.msgConfig,$.error=te,$.errorText=ne,$.errorCode=re,!z&&this.onVideoMessage&&this.onVideoMessage($),Oe={id:B,type:"video",chatType:q,from:H,to:F,url:le,secret:j.secretKey,thumb:s.P6.formatAttachUrl.call(this,j.thumbnailRemotePath),thumb_secret:j.thumbnailSecretKey,filename:j.displayName,length:j.duration||0,file:{},file_length:j.fileLength||0,filetype:j.filetype||"",accessToken:this.token||"",ext:oe,time:Number(W),onlineState:K},$.msgConfig&&(Oe.msgConfig=$.msgConfig),ie.length>0&&(Oe.reactions=ie),ce&&(Oe.chatThread=ce),ue&&(Oe.chatThreadOverview=ue),"chatRoom"===q&&(Oe.priority=V,Oe.broadcast=Z),se.operationCount>0&&(Oe.modifiedInfo=se),Q&&(Oe.isContentReplaced=Q),pe&&(Oe.isRead=!0),de&&(Oe.isDelivered=!0),ee=Oe,z?[3,12]:[4,null===(I=null===(T=this._localCache)||void 0===T?void 0:T.getInstance())||void 0===I?void 0:I.storeMessage(Oe,p.r.SUCCESS)];case 11:m.sent(),null===(O=this.eventHandler)||void 0===O||O.dispatch("onVideoMessage",Oe),m.label=12;case 12:return[3,28];case 13:return!($={id:B,type:G,contentsType:g[j.type],from:H,to:F,addr:j.address,buildingName:j.buildingName,lat:j.latitude,lng:j.longitude,ext:oe,time:W,msgConfig:D.msgConfig,onlineState:K}).delay&&delete $.delay,!$.msgConfig&&delete D.msgConfig,$.error=te,$.errorText=ne,$.errorCode=re,!z&&this.onLocationMessage&&this.onLocationMessage($),Re={id:B,type:"loc",chatType:q,from:H,to:F,buildingName:j.buildingName,addr:j.address,lat:j.latitude,lng:j.longitude,ext:oe,time:Number(W),onlineState:K},$.msgConfig&&(Re.msgConfig=$.msgConfig),ie.length>0&&(Re.reactions=ie),ce&&(Re.chatThread=ce),ue&&(Re.chatThreadOverview=ue),"chatRoom"===q&&(Re.priority=V,Re.broadcast=Z),se.operationCount>0&&(Re.modifiedInfo=se),Q&&(Re.isContentReplaced=Q),pe&&(Re.isRead=!0),de&&(Re.isDelivered=!0),ee=Re,z?[3,15]:[4,null===(C=null===(R=this._localCache)||void 0===R?void 0:R.getInstance())||void 0===C?void 0:C.storeMessage(Re,p.r.SUCCESS)];case 14:m.sent(),null===(N=this.eventHandler)||void 0===N||N.dispatch("onLocationMessage",Re),m.label=15;case 15:return[3,28];case 16:return le=this.useOwnUploadFun?j.remotePath:E.call(this,j),!($={id:B,type:G,contentsType:g[j.type],from:H,to:F,url:le,secret:j.secretKey,filename:j.displayName,file_length:j.fileLength||"",accessToken:this.token||"",ext:oe,length:j.duration,time:W,msgConfig:D.msgConfig,onlineState:K}).delay&&delete $.delay,!$.msgConfig&&delete D.msgConfig,$.error=te,$.errorText=ne,$.errorCode=re,!z&&this.onAudioMessage&&this.onAudioMessage($),Ce={id:B,type:"audio",chatType:q,from:H,to:F,url:le,secret:j.secretKey,file:{},filename:j.displayName,length:j.duration||0,file_length:j.fileLength||0,filetype:j.filetype||"",accessToken:this.token||"",ext:oe,time:Number(W),onlineState:K},$.msgConfig&&(Ce.msgConfig=$.msgConfig),ie.length>0&&(Ce.reactions=ie),ce&&(Ce.chatThread=ce),ue&&(Ce.chatThreadOverview=ue),"chatRoom"===q&&(Ce.priority=V,Ce.broadcast=Z),se.operationCount>0&&(Ce.modifiedInfo=se),Q&&(Ce.isContentReplaced=Q),pe&&(Ce.isRead=!0),de&&(Ce.isDelivered=!0),ee=Ce,z?[3,18]:[4,null===(b=null===(S=this._localCache)||void 0===S?void 0:S.getInstance())||void 0===b?void 0:b.storeMessage(Ce,p.r.SUCCESS)];case 17:m.sent(),null===(A=this.eventHandler)||void 0===A||A.dispatch("onAudioMessage",Ce),m.label=18;case 18:return[3,28];case 19:return le=this.useOwnUploadFun?j.remotePath:E.call(this,j),!($={id:B,type:G,contentsType:g[j.type],from:H,to:F,url:le,secret:j.secretKey,filename:j.displayName,file_length:j.fileLength,accessToken:this.token||"",ext:oe,time:W,msgConfig:D.msgConfig,onlineState:K}).delay&&delete $.delay,!$.msgConfig&&delete D.msgConfig,$.error=te,$.errorText=ne,$.errorCode=re,!z&&this.onFileMessage&&this.onFileMessage($),Ne={id:B,type:"file",chatType:q,from:H,to:F,url:le,secret:j.secretKey,file:{},filename:j.displayName,length:j.duration||0,file_length:j.fileLength||0,filetype:j.filetype||"",accessToken:this.token||"",ext:oe,time:Number(W),onlineState:K},$.msgConfig&&(Ne.msgConfig=$.msgConfig),ie.length>0&&(Ne.reactions=ie),ce&&(Ne.chatThread=ce),ue&&(Ne.chatThreadOverview=ue),"chatRoom"===q&&(Ne.priority=V,Ne.broadcast=Z),se.operationCount>0&&(Ne.modifiedInfo=se),Q&&(Ne.isContentReplaced=Q),pe&&(Ne.isRead=!0),de&&(Ne.isDelivered=!0),ee=Ne,z?[3,21]:[4,null===(w=null===(M=this._localCache)||void 0===M?void 0:M.getInstance())||void 0===w?void 0:w.storeMessage(Ne,p.r.SUCCESS)];case 20:m.sent(),null===(P=this.eventHandler)||void 0===P||P.dispatch("onFileMessage",Ne),m.label=21;case 21:return[3,28];case 22:return!($={id:B,type:G,contentsType:g[j.type],from:H,to:F,action:j.action,ext:oe,time:W,msgConfig:D.msgConfig,onlineState:K}).msgConfig&&delete D.msgConfig,$.error=te,$.errorText=ne,$.errorCode=re,!z&&this.onCmdMessage&&this.onCmdMessage($),Se={id:B,type:"cmd",chatType:q,from:H,to:F,action:j.action,ext:oe,time:Number(W),onlineState:K},$.msgConfig&&(Se.msgConfig=$.msgConfig),ie.length>0&&(Se.reactions=ie),ce&&(Se.chatThread=ce),ue&&(Se.chatThreadOverview=ue),"chatRoom"===q&&(Se.priority=V,Se.broadcast=Z),se.operationCount>0&&(Se.modifiedInfo=se),Q&&(Se.isContentReplaced=Q),pe&&(Se.isRead=!0),de&&(Se.isDelivered=!0),ee=Se,z||null===(U=this.eventHandler)||void 0===U||U.dispatch("onCmdMessage",Se),[3,28];case 23:return be={},Ae={},D.contents[0].customExts&&(be=v(D.contents[0].customExts)),D.contents[0].params&&(Ae=v(D.contents[0].params)),$={id:B,type:G,contentsType:g[j.type],from:H,to:F,customEvent:j.customEvent,params:Ae,customExts:be,ext:oe,time:W,onlineState:K},!z&&this.onCustomMessage&&this.onCustomMessage($),Me={id:B,type:"custom",chatType:q,from:H,to:F,customEvent:j.customEvent,params:Ae,customExts:be,ext:oe,time:Number(W),onlineState:K},$.msgConfig&&(Me.msgConfig=$.msgConfig),ie.length>0&&(Me.reactions=ie),ce&&(Me.chatThread=ce),ue&&(Me.chatThreadOverview=ue),se.operationCount>0&&(Me.modifiedInfo=se),"chatRoom"===q&&(Me.priority=V,Me.broadcast=Z),Q&&(Me.isContentReplaced=Q),pe&&(Me.isRead=!0),de&&(Me.isDelivered=!0),ee=Me,z?[3,25]:[4,null===(x=null===(k=this._localCache)||void 0===k?void 0:k.getInstance())||void 0===x?void 0:x.storeMessage(Me,p.r.SUCCESS)];case 24:m.sent(),null===(L=this.eventHandler)||void 0===L||L.dispatch("onCustomMessage",Me),m.label=25;case 25:return[3,28];case 26:return le=E.call(this,j),we={id:B,type:"combine",chatType:q,to:F,from:H,ext:oe,time:Number(W),onlineState:K,title:j.title||"",summary:j.summary||"",url:le||"",secret:j.secretKey||"",file_length:j.fileLength||0,filename:j.displayName||"",compatibleText:j.text,combineLevel:j.combineLevel||0},$.msgConfig&&(we.msgConfig=$.msgConfig),ie.length>0&&(we.reactions=ie),ce&&(we.chatThread=ce),ue&&(we.chatThreadOverview=ue),"chatRoom"===q&&(we.priority=V,we.broadcast=Z),se.operationCount>0&&(we.modifiedInfo=se),Q&&(we.isContentReplaced=Q),pe&&(we.isRead=!0),de&&(we.isDelivered=!0),ee=we,!z&&this.eventHandler&&this.eventHandler.dispatch("onCombineMessage",we),[3,28];case 27:return l.kg.error("Unknow message type, message:",j),[3,28];case 28:return X?[2,ee]:[2,$]}}))}))}function I(e,t,r){if(this.delivery&&e!==t){var n=this.getUniqueId(),o=new d.Message("delivery",n);o.set({ackId:r,to:e}),l.kg.debug("send delivery ack"),this.send(o.body)}}t.ZP=function(e,t,r,o,a){var d,p,g,E,O,R,C,N,S,b,A,M,w,P,U,k,x,L,D,j,B,G,H,F,W,K,q,z;return f(this,void 0,void 0,(function(){var f,V,X,J,Z,Y,Q,$,ee,te,re,ne,oe,ie,ae,se,ce,ue,le,de,pe,he,fe,me,ge,ve,Ee,ye,_e,Te,Ie,Oe,Re,Ce,Ne,Se,be,Ae,Me,we,Pe,Ue;return m(this,(function(m){switch(m.label){case 0:if(f=new(i())(e.timestamp.low,e.timestamp.high,e.timestamp.unsigned).toString(),V=this.root.lookup("easemob.pb.MessageBody"),X=V.decode(e.payload),J=3,Z=!1,Y=new(i())(e.id.low,e.id.high,e.id.unsigned).toString(),a&&e.from&&e.from.name===this.context.userId&&e.from.clientResource===this.clientResource&&X.type===c.gA.CHATROOM)return[2,l.kg.debug("Discard your own chat room message:",Y)];if(e.meta&&e.meta.length){if(Q=s.P6.parseNotify(e.meta),$=Q.is_online,ee=Q.callback_replace,this.useReplacedMessageContents&&ee&&(Z=!0),$||0===$)switch($){case 0:J=0;break;case 1:J=1;break;default:J=2}}else J=3;switch(te=X.ackMessageId?new(i())(X.ackMessageId.low,X.ackMessageId.high,X.ackMessageId.unsigned).toString():"",re="",ne=y.call(this,e,X),oe=_.call(this,e,X),l.kg.debug("meta thirdMessage:",{metaId:Y,metaNs:e.ns,type:X.type,from:ne,to:oe,contentType:null===(p=null===(d=X.contents)||void 0===d?void 0:d[0])||void 0===p?void 0:p.type,contentLen:null===(g=X.contents)||void 0===g?void 0:g.length}),X.type){case c.gA.SINGLECHAT:return[3,1];case c.gA.GROUPCHAT:return[3,2];case c.gA.CHATROOM:return[3,3];case c.gA.READ_ACK:return[3,4];case c.gA.DELIVER_ACK:return[3,5];case c.gA.RECALL:return[3,6];case c.gA.CHANNEL_ACK:return[3,15];case c.gA.EDIT:return[3,16]}return[3,20];case 1:return re="chat","agoraToken"===this.grantType&&(re="singleChat"),this.delivery&&!r&&ne!==this.context.userId&&I.call(this,ne,oe,Y),[3,21];case 2:return re="groupchat","agoraToken"===this.grantType&&(re="groupChat"),[3,21];case 3:return re="chatroom","agoraToken"===this.grantType&&(re="chatRoom"),J=1,[3,21];case 4:return re="read_ack",ie=void 0,X.ext[0]&&JSON.parse(X.ext[0].stringValue)?(ie={id:Y,type:"read",from:ne,to:oe,mid:te,groupReadCount:X.ext[0]&&JSON.parse(X.ext[0].stringValue),ackContent:X.ackContent,onlineState:J},this.onReadMessage&&this.onReadMessage(ie),null===(E=this.eventHandler)||void 0===E||E.dispatch("onReadMessage",ie),[2]):(ie={id:Y,type:"read",from:ne,to:oe,mid:te,onlineState:J},this.onReadMessage&&this.onReadMessage(ie),null===(O=this.eventHandler)||void 0===O||O.dispatch("onReadMessage",ie),[2]);case 5:return re="deliver_ack",this.onDeliveredMessage&&this.onDeliveredMessage({id:Y,type:"delivery",from:ne,to:oe,mid:te,onlineState:J}),ae={id:Y,type:"delivery",from:ne,to:oe,mid:te,onlineState:J},null===(R=this.eventHandler)||void 0===R||R.dispatch("onDeliveredMessage",ae),[2];case 6:return re="recall",se="",e.ext&&(se=(null===(C=v(e.ext))||void 0===C?void 0:C.recallMessageExtensionInfo)||""),ce={id:Y,from:ne||"admin",to:oe,mid:te,ext:se,onlineState:J},ue=oe===this.user?ne:oe,[4,null===(S=null===(N=this._localCache)||void 0===N?void 0:N.getInstance())||void 0===S?void 0:S.getMessageByServerMsgId(ce.mid)];case 7:return(le=m.sent())?[4,null===(A=null===(b=this._localCache)||void 0===b?void 0:b.getInstance())||void 0===A?void 0:A.removeMsgByServerMsgId(ce.mid)]:[3,9];case 8:m.sent(),m.label=9;case 9:return"singleChat"!==(null==le?void 0:le.chatType)&&"groupChat"!==(null==le?void 0:le.chatType)?[3,14]:(de=(null==le?void 0:le.from)===this.user||""===(null==le?void 0:le.from),[4,null===(w=null===(M=this._localCache)||void 0===M?void 0:M.getInstance())||void 0===w?void 0:w.getConversationLastMessage(ue,le.chatType)]);case 10:return pe=m.sent(),[4,null===(U=null===(P=this._localCache)||void 0===P?void 0:P.getInstance())||void 0===U?void 0:U.getConversationBySessionId((0,u.MQ)({conversationId:ue,conversationType:le.chatType}))];case 11:return(he=m.sent())?[4,null===(x=null===(k=this._localCache)||void 0===k?void 0:k.getInstance())||void 0===x?void 0:x.updateLocalConversation((0,u.MQ)({conversationId:ue,conversationType:le.chatType}),{lastMessageId:null==pe?void 0:pe.serverMsgId,unReadCount:(0,u.E7)({conversation:he,isRecallSelfMsg:de,recalledMsgTime:le.time})})]:[3,13];case 12:m.sent(),m.label=13;case 13:m.label=14;case 14:return this.onRecallMessage&&this.onRecallMessage(ce),null===(L=this.eventHandler)||void 0===L||L.dispatch("onRecallMessage",ce),[2];case 15:return this.onChannelMessage&&this.onChannelMessage({id:Y,type:"channel",chatType:"singleChat",from:ne,to:oe,time:Number(f),onlineState:J}),fe={id:Y,type:"channel",chatType:"singleChat",from:ne,to:oe,time:Number(f),onlineState:J},null===(D=this.eventHandler)||void 0===D||D.dispatch("onChannelMessage",fe),[2];case 16:return me={errorCode:0,reason:""},ge="",ve=0,Ee="",X.meta&&"string"==typeof X.meta&&(ye=JSON.parse(X.meta)).edit_msg&&(_e=ye.edit_msg,Te=_e.sender,Ie=_e.send_time,Oe=_e.chat_type,ge=Te,ve=Ie,Ee=n[Oe]),Re=X.editMessageId&&new(i())(X.editMessageId.low,X.editMessageId.high,X.editMessageId.unsigned).toString(),Ce=X.editScope,[4,T.call(this,{status:me,thirdMessage:X,msgBody:X.contents[0],msgId:Re,type:re,from:ge,to:oe,time:ve,onlineState:J,ignoreCallback:!0,format:!0,isContentReplaced:Z})];case 17:return(Ne=m.sent()).chatType=Ee,e.ignoreCallback?[2,Ne]:Ne?[4,null===(B=null===(j=this._localCache)||void 0===j?void 0:j.getInstance())||void 0===B?void 0:B.getMessageByServerMsgId(Ne.id)]:[3,19];case 18:(Se=m.sent())&&(be=Se.ext||{},(Ce===c.K5.BODY_AND_EXT||Object.keys(Ne.ext||{}).length>0)&&(be=Ne.ext),"txt"===Ne.type&&"txt"===Se.type?null===(H=null===(G=this._localCache)||void 0===G?void 0:G.getInstance())||void 0===H||H.putMessageToDB(h(h({},Se),{msg:Ne.msg,modifiedInfo:Ne.modifiedInfo,translations:Ne.translations,ext:be})):"custom"===Ne.type&&"custom"===Se.type?null===(W=null===(F=this._localCache)||void 0===F?void 0:F.getInstance())||void 0===W||W.putMessageToDB(h(h({},Se),{ext:be,customExts:Ne.customExts,customEvent:Ne.customEvent,modifiedInfo:Ne.modifiedInfo})):null===(q=null===(K=this._localCache)||void 0===K?void 0:K.getInstance())||void 0===q||q.putMessageToDB(h(h({},Se),{ext:be,modifiedInfo:Ne.modifiedInfo}))),m.label=19;case 19:return null===(z=this.eventHandler)||void 0===z||z.dispatch("onModifiedMessage",Ne),[2];case 20:return l.kg.error("unexpected message type: ".concat(X.type)),[2];case 21:Ae="normal",we=!1,"chat"===re.toLowerCase()||"singleChat"===re?Me="singleChat":"groupchat"===re.toLowerCase()||"groupChat"===re?Me="groupChat":(Me="chatRoom",J=1,e.ext&&(Pe=v(e.ext),we=!!(null==Pe?void 0:Pe.is_broadcast),Ae=0===Pe.chatroom_msg_tag?"high":2===Pe.chatroom_msg_tag?"low":"normal")),Ue=0,m.label=22;case 22:return Ue<X.contents.length?[4,T.call(this,{status:t,thirdMessage:X,msgBody:X.contents[Ue],msgId:Y,type:re,from:ne,to:oe,time:f,onlineState:J,chatType:Me,ignoreCallback:r,priority:Ae,format:o,broadcast:we,isContentReplaced:Z})]:[3,25];case 23:return[2,m.sent()];case 24:return Ue++,[3,22];case 25:return[2]}}))}))}},7288:function(e,t,r){"use strict";var n;r.d(t,{r:function(){return n}}),function(e){e[e.CREATE=0]="CREATE",e[e.FAIL=1]="FAIL",e[e.INPROGRESS=2]="INPROGRESS",e[e.SUCCESS=3]="SUCCESS"}(n||(n={}))},9743:function(e,t,r){"use strict";r.d(t,{E7:function(){return o},MQ:function(){return n},un:function(){return i}}),r(2222);var n=function(e){return"".concat(e.conversationType,"-").concat(e.conversationId)},o=function(e){var t=e.isRecallSelfMsg,r=e.conversation,n=e.recalledMsgTime,o=r.unReadCount,i=void 0===o?0:o,a=r.unreadCountClearTimestamp;return t||(void 0===a?0:a)>n?i:i&&i>0?i-1:0},i=function(e){var t,r=0;if(0===e.length)return r;for(t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return r}},7360:function(e,t,r){"use strict";function n(){console.log&&(console.log.apply?console.log.apply(console,Array.prototype.slice.call(arguments)):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}r.d(t,{kg:function(){return m}}),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(7042),r(2222),r(8309),r(9600),r(3843),r(3710),r(2564),r(285),r(1637),r(4812),r(9554),r(2772),r(4916);var o="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=r(4024);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var s,c=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},u=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},l=function(){},d={};!function(e){e[e.TRACE=0]="TRACE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(s||(s={}));var p=function(){function e(e,t,r){this.name=e||"defaultLogger",this.currentLevel=0,this.useCookiePersist=!1,this.storageLogLevelKey="loglevel",this.levels=s,this.consoleLogVisibility=!0,this.logMethods=["trace","debug","info","warn","error"],this.methodFactory=r||this.defaultMethodFactory,this.report=!1;var n=this._getPersistedLevel();null==n&&(n=null===t?"WARN":t),this.logs=[],this.reportLogs=[],this.reportInterval=3e5,this.timer=null,this.config={useCache:!1,maxCache:3145728,color:"",background:""},this.logBytes=0,this.setLevel(n,!1,"")}return e.prototype.reportLog=function(){var e,t,r;return c(this,void 0,void 0,(function(){var n,o,a,s,c,l,d,p;return u(this,(function(u){switch(u.label){case 0:if(0===(null===(e=this.reportLogs)||void 0===e?void 0:e.length))return[2];for(n=2097152,o=this.reportLogs.join("\n")+"\n",a=o.length,s=[];a>n;)s.push(o.substring(0,n)),a-=n,o=o.substring(n);s.push(o),c=0,l=s,u.label=1;case 1:if(!(c<l.length))return[3,8];if(d=l[c],this.reportLogs=[],!(null===(r=null===(t=this.connection)||void 0===t?void 0:t.context)||void 0===r?void 0:r.accessToken))return[2];u.label=2;case 2:return u.trys.push([2,4,,5]),[4,this.reportData(d)];case 3:return"ok"!==(null==(p=u.sent())?void 0:p.status)&&this.reportLogs.unshift(d),[3,5];case 4:return u.sent(),this.reportLogs.unshift(d),[3,5];case 5:return[4,i.P6.delay(3e3)];case 6:u.sent(),u.label=7;case 7:return c++,[3,1];case 8:return[2]}}))}))},e.prototype.reportData=function(e){var t,r=this;if(this.connection){var n=this.connection.context||{},o=n.orgName,a=n.appName,s=n.accessToken,c=n.userId;if(o&&a){var u={url:"".concat(null===(t=this.connection)||void 0===t?void 0:t.apiUrl,"/").concat(o,"/").concat(a,"/sdk/users/").concat(c,"/client/logs"),type:"POST",data:JSON.stringify({resource:this.connection.clientResource||"random_".concat(Date.now()),logContent:e}),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return i.hj.call(this.connection,u).then((function(e){return r.log("report log success",e),e})).catch((function(e){r.error("report log error",e)}))}}else this.error("report log error","connection is null")},e.prototype._regularlyReportLogs=function(){var e,t=this;this.timer&&clearInterval(this.timer),(null!==(e=this.reportInterval)&&void 0!==e?e:0)<6e4&&(this.reportInterval=6e4),this.timer=setInterval((function(){t.reportLog()}),this.reportInterval||3e5)},e.prototype._stopReportLogs=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.reportLog()];case 1:return e.sent(),[3,3];case 2:return e.sent(),this.error("report log error when stopping upload"),[3,3];case 3:return this.reportLogs=[],clearInterval(this.timer),[2]}}))}))},e.prototype.setConfig=function(e){this.config=e},e.prototype.getLevel=function(){return this.currentLevel},e.prototype.setLevel=function(e,t,r){if("string"==typeof e&&(e=s[e]),void 0===e&&(e=0),!("number"==typeof e&&e>=0&&e<=this.levels.SILENT))throw Error("log.setLevel() called with invalid level: "+e);if(this.currentLevel=e,!1!==t&&this._persistLevel(e),this.replaceLoggingMethods(e,r||""),"undefined"==typeof console&&e<s.SILENT)throw Error("No console available for logging")},e.prototype.setDefaultLevel=function(e){this._getPersistedLevel()||this.setLevel(e,!1,"")},e.prototype.enableAll=function(e){this.setLevel(this.levels.TRACE,!0,"")},e.prototype.disableAll=function(e){this.setLevel(this.levels.SILENT,!0,"")},e.prototype.getLogs=function(){return this.logs},e.prototype.download=function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var e=this.getLogs().join("\n"),t=new Blob([e],{type:"text/plain;charset=UTF-8"}),r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.setAttribute("download","sdklog"),document.body.appendChild(n),n.click()}},e.prototype.setConsoleLogVisibility=function(e){this.consoleLogVisibility=e},e.prototype._bindMethod=function(e,t,r){var n=this,o=e[t],i=this.getTime();if(r)return this._cacheLog;if("function"==typeof o.bind)return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=n.getTime();n.consoleLogVisibility&&o.call.apply(o,function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}([e,"".concat(a," IM SDK [").concat("log"===t?"debug":t,"]: ")],r,!1)),n.onLog&&n.onLog({time:a,level:"log"===t?"debug":t,logs:r}),n._cacheReportLogs.apply(n,r)};try{return Function.prototype.bind.call(o,e,"".concat(i," IM SDK [").concat("log"===t?"debug":t,"]: "))}catch(t){return function(){return Function.prototype.apply.apply(o,[e,arguments])}}},e.prototype.getTime=function(){var e=new Date;return e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()},e.prototype._cacheLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(new Date).toLocaleString()+": ",n="";e.forEach((function(e){"object"===a(e)?n+=JSON.stringify(e)+" ":n+=e+" "})),this._cacheLogCall(r+n),this._cacheReportLogs.apply(this,e)},e.prototype._cacheLogCall=function(e){var t=e.length,r=this.logBytes+t,n=this.config.maxCache;if(!(t>=n)){if(r<n)this.logBytes+=t;else for(var o=r-n,i=0;i<o;){var a=this.logs.shift();void 0!==a&&(i+=a.length)}this.logs.push(e)}},e.prototype._cacheReportLogs=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.report){var r=(new Date).toLocaleString()+": ",n="";e.forEach((function(e){"object"===a(e)?n+=JSON.stringify(e)+" ":n+=e+" "})),this.reportLogs.push(r+n)}},e.prototype._getPersistedLevel=function(){var e;if("undefined"==typeof window)return 5;if("undefined"===(e=window&&window.localStorage&&window.localStorage[this.storageLogLevelKey])){var t=window.document.cookie,r=t.indexOf(encodeURIComponent(this.storageLogLevelKey));-1!==r&&(e=/^([^;]+)/.exec(t.slice(r))[1])}return e||5},e.prototype._persistLevel=function(e){var t=this.logMethods[e]||"SILENT";if("undefined"!=typeof window){if(window.localStorage)try{window.localStorage[this.storageLogLevelKey]=t}catch(e){console.log(e)}this.useCookiePersist&&(window.document.cookie=encodeURIComponent(this.storageLogLevelKey)+"="+t+";")}},e.prototype.replaceLoggingMethods=function(e,t){for(var r=this,n=0;n<this.logMethods.length;n++){var o=this.logMethods[n];this[o]=n<e?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r.report&&r._cacheReportLogs.apply(r,e)}:this.methodFactory(o,e,t)}this.log=this.debug},e.prototype.defaultMethodFactory=function(e,t,r){return this.realMethod(e)||this.enableLoggingWhenConsoleArrives.apply(this,[e,t,r])},e.prototype.realMethod=function(e){return"debug"===e&&(e="log"),"undefined"!=typeof console&&("trace"===e&&o?n:void 0!==console[e]?this._bindMethod(console,e,this.config.useCache):void 0!==console.log?this._bindMethod(console,"log",this.config.useCache):l)},e.prototype.enableLoggingWhenConsoleArrives=function(e,t,r){return function(){"undefined"!=typeof console&&(this.replaceLoggingMethods.call(this,t,r),this[e].apply(this,arguments))}.bind(this)},e}(),h=new p;h.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");return this};var f="undefined"!=typeof window?window.log:void 0;h.noConflict=function(){return"undefined"!=typeof window&&window.log===h&&(window.log=f),h},h.getLoggers=function(){return d},h.initReport=function(e){var t=e.report,r=e.reportInterval,n=e.connection;h.report=t,h.reportInterval=r,h.connection=n,t&&h._regularlyReportLogs()};var m=h},2449:function(e,t,r){"use strict";r.d(t,{Message:function(){return g}});var n=r(4024),o=function(){function e(e){var t=e.id;this.id=t,this.type=e.type}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.id,type:"read",to:e.to,from:e.from||"",chatType:e.chatType}},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType,ackId:e.id,type:"read",to:e.to,from:e.from||"",ackContent:e.ackContent,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),i=function(){function e(e){this.id=e.id,this.type=e.type}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.ackId,type:"delivery",to:e.to,from:e.from||""}},e.create=function(e){return{id:n.P6.getUniqueId(),ackId:e.ackId,type:"delivery",to:e.to,from:e.from||"",isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),a=(r(3843),r(3710),function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"channel",to:e.to,from:e.from||"",time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),type:"channel",chatType:e.chatType||"singleChat",to:e.to,from:e.from||"",time:Date.now(),isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}()),s=(r(9753),function(){function e(e){var t=e.type,r=e.id||n.P6.getUniqueId();this.id=r,this.type=t,this.value=""}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"txt",to:e.to,msg:e.msg,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),isChatThread:e.isChatThread},this.value=e.msg},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){var t,r;return(null===(t=e.msgConfig)||void 0===t?void 0:t.languages)&&Array.isArray(null===(r=e.msgConfig)||void 0===r?void 0:r.languages),{type:"txt",id:n.P6.getUniqueId(),msg:e.msg,to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}()),c=function(){function e(e){var t=e.type,r=e.id;this.id=r||n.P6.getUniqueId(),this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"cmd",to:e.to,action:e.action,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),type:"cmd",to:e.to,from:e.from||"",chatType:e.chatType||"singleChat",action:e.action,time:Date.now(),ext:e.ext,msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),u=function(){function e(e){var t=e.type,r=e.id||n.P6.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),l=function(){function e(e){var t=e.type,r=e.id;this.id=r||n.P6.getUniqueId(),this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),d=function(){function e(e){var t=e.type,r=e.id||n.P6.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&n.P6.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"img",file:e.file,width:e.width,height:e.height,to:e.to,from:e.from||"",roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType,type:"img",url:e.url,width:e.width,height:e.height,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,file_length:e.file_length,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,thumbnailWidth:e.thumbnailWidth,thumbnailHeight:e.thumbnailHeight,isGif:e.isGif}},e}(),p=function(){function e(e){var t=e.type,r=e.id||n.P6.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&n.P6.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"audio",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType,type:"audio",filename:e.filename,length:e.length,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,file_length:e.file_length,msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),h=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&n.P6.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),apiUrl:e.apiUrl,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),f=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&n.P6.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:n.P6.getUniqueId(),chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,file_length:e.file_length,to:e.to,from:e.from||"",ext:e.ext,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),m=function(){function e(e){var t=e.type,r=e.id||n.P6.getUniqueId();this.id=r,this.type=t,this.value=""}return e.create=function(e){return{type:"combine",id:n.P6.getUniqueId(),to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,compatibleText:e.compatibleText,title:e.title,summary:e.summary,messageList:e.messageList,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete}},e}(),g=function(){function e(t,r){return this.type=t,this.id=r||n.P6.getUniqueId(),e.createOldMsg({type:t,id:this.id})}return e.createOldMsg=function(e){switch(e.type){case"read":return new o({type:"read",id:e.id});case"delivery":return new i({type:"delivery",id:e.id});case"channel":return new a({type:"channel",id:e.id});case"txt":return new s({type:"txt",id:e.id});case"cmd":return new c({type:"cmd",id:e.id});case"custom":return new u({type:"custom",id:e.id});case"loc":return new l({type:"loc",id:e.id});case"img":return new d({type:"img",id:e.id});case"audio":return new p({type:"audio",id:e.id});case"video":return new h({type:"video",id:e.id});case"file":return new f({type:"file",id:e.id})}},e.create=function(e){return"txt"!==(t=e).type||"version"in t?function(e){return"img"===e.type&&!("version"in e)}(e)?d.create(e):function(e){return"cmd"===e.type&&!("version"in e)}(e)?c.create(e):function(e){return"file"===e.type&&!("version"in e)}(e)?f.create(e):function(e){return"audio"===e.type&&!("version"in e)}(e)?p.create(e):function(e){return"video"===e.type&&!("version"in e)}(e)?h.create(e):function(e){return"custom"===e.type&&!("version"in e)}(e)?u.create(e):function(e){return"loc"===e.type&&!("version"in e)}(e)?l.create(e):function(e){return"channel"===e.type&&!("version"in e)}(e)?a.create(e):function(e){return"delivery"===e.type&&!("version"in e)}(e)?i.create(e):function(e){return"read"===e.type&&!("version"in e)}(e)?o.create(e):function(e){return"combine"===e.type&&!("version"in e)}(e)?m.create(e):{}:s.create(e);var t},e.prototype.set=function(e){},e.getFileUrl=n.P6.getFileUrl,e.download=n.P6.download,e.parseDownloadResponse=n.P6.parseDownloadResponse,e}()},5531:function(e,t,r){"use strict";var n;r.d(t,{E:function(){return n}}),function(e){e[e.REQUEST_SUCCESS=0]="REQUEST_SUCCESS",e[e.REQUEST_TIMEOUT=-1]="REQUEST_TIMEOUT",e[e.REQUEST_UNKNOWN=-2]="REQUEST_UNKNOWN",e[e.REQUEST_PARAMETER_ERROR=-3]="REQUEST_PARAMETER_ERROR",e[e.REQUEST_ABORT=-4]="REQUEST_ABORT",e[e.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR=0]="WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_OPEN_ERROR=1]="WEBIM_CONNCTION_OPEN_ERROR",e[e.WEBIM_CONNCTION_AUTH_ERROR=2]="WEBIM_CONNCTION_AUTH_ERROR",e[e.WEBIM_CONNCTION_OPEN_USERGRID_ERROR=3]="WEBIM_CONNCTION_OPEN_USERGRID_ERROR",e[e.WEBIM_CONNCTION_ATTACH_ERROR=4]="WEBIM_CONNCTION_ATTACH_ERROR",e[e.WEBIM_CONNCTION_ATTACH_USERGRID_ERROR=5]="WEBIM_CONNCTION_ATTACH_USERGRID_ERROR",e[e.WEBIM_CONNCTION_REOPEN_ERROR=6]="WEBIM_CONNCTION_REOPEN_ERROR",e[e.WEBIM_CONNCTION_SERVER_CLOSE_ERROR=7]="WEBIM_CONNCTION_SERVER_CLOSE_ERROR",e[e.WEBIM_CONNCTION_SERVER_ERROR=8]="WEBIM_CONNCTION_SERVER_ERROR",e[e.WEBIM_CONNCTION_IQ_ERROR=9]="WEBIM_CONNCTION_IQ_ERROR",e[e.WEBIM_CONNCTION_PING_ERROR=10]="WEBIM_CONNCTION_PING_ERROR",e[e.WEBIM_CONNCTION_NOTIFYVERSION_ERROR=11]="WEBIM_CONNCTION_NOTIFYVERSION_ERROR",e[e.WEBIM_CONNCTION_GETROSTER_ERROR=12]="WEBIM_CONNCTION_GETROSTER_ERROR",e[e.WEBIM_CONNCTION_CROSSDOMAIN_ERROR=13]="WEBIM_CONNCTION_CROSSDOMAIN_ERROR",e[e.WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES=14]="WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES",e[e.WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR=15]="WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR",e[e.WEBIM_CONNCTION_DISCONNECTED=16]="WEBIM_CONNCTION_DISCONNECTED",e[e.WEBIM_CONNCTION_AJAX_ERROR=17]="WEBIM_CONNCTION_AJAX_ERROR",e[e.WEBIM_CONNCTION_JOINROOM_ERROR=18]="WEBIM_CONNCTION_JOINROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOM_ERROR=19]="WEBIM_CONNCTION_GETROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOMINFO_ERROR=20]="WEBIM_CONNCTION_GETROOMINFO_ERROR",e[e.WEBIM_CONNCTION_GETROOMMEMBER_ERROR=21]="WEBIM_CONNCTION_GETROOMMEMBER_ERROR",e[e.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR=22]="WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR",e[e.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR=23]="WEBIM_CONNCTION_LOAD_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR=24]="WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_JOINCHATROOM_ERROR=25]="WEBIM_CONNCTION_JOINCHATROOM_ERROR",e[e.WEBIM_CONNCTION_QUITCHATROOM_ERROR=26]="WEBIM_CONNCTION_QUITCHATROOM_ERROR",e[e.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR=27]="WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR=28]="WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR=29]="WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR=30]="WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_CALLBACK_INNER_ERROR=31]="WEBIM_CONNCTION_CALLBACK_INNER_ERROR",e[e.WEBIM_CONNCTION_CLIENT_OFFLINE=32]="WEBIM_CONNCTION_CLIENT_OFFLINE",e[e.WEBIM_CONNCTION_CLIENT_LOGOUT=33]="WEBIM_CONNCTION_CLIENT_LOGOUT",e[e.WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR=34]="WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR",e[e.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP=35]="WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP=36]="WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP=37]="WEBIM_CONNECTION_ACCEPT_JOIN_GROUP",e[e.WEBIM_CONNECTION_DECLINE_JOIN_GROUP=38]="WEBIM_CONNECTION_DECLINE_JOIN_GROUP",e[e.WEBIM_CONNECTION_CLOSED=39]="WEBIM_CONNECTION_CLOSED",e[e.WEBIM_CONNECTION_ERROR=40]="WEBIM_CONNECTION_ERROR",e[e.MAX_LIMIT=50]="MAX_LIMIT",e[e.MESSAGE_NOT_FOUND=51]="MESSAGE_NOT_FOUND",e[e.NO_PERMISSION=52]="NO_PERMISSION",e[e.OPERATION_UNSUPPORTED=53]="OPERATION_UNSUPPORTED",e[e.OPERATION_NOT_ALLOWED=54]="OPERATION_NOT_ALLOWED",e[e.WEBIM_TOKEN_EXPIRED=56]="WEBIM_TOKEN_EXPIRED",e[e.WEBIM_SERVER_SERVING_DISABLED=57]="WEBIM_SERVER_SERVING_DISABLED",e[e.WEBIM_UPLOADFILE_BROWSER_ERROR=100]="WEBIM_UPLOADFILE_BROWSER_ERROR",e[e.WEBIM_UPLOADFILE_ERROR=101]="WEBIM_UPLOADFILE_ERROR",e[e.WEBIM_UPLOADFILE_NO_LOGIN=102]="WEBIM_UPLOADFILE_NO_LOGIN",e[e.WEBIM_UPLOADFILE_NO_FILE=103]="WEBIM_UPLOADFILE_NO_FILE",e[e.WEBIM_DOWNLOADFILE_ERROR=200]="WEBIM_DOWNLOADFILE_ERROR",e[e.WEBIM_DOWNLOADFILE_NO_LOGIN=201]="WEBIM_DOWNLOADFILE_NO_LOGIN",e[e.WEBIM_DOWNLOADFILE_BROWSER_ERROR=202]="WEBIM_DOWNLOADFILE_BROWSER_ERROR",e[e.PARSE_FILE_ERROR=203]="PARSE_FILE_ERROR",e[e.USER_NOT_FOUND=204]="USER_NOT_FOUND",e[e.MESSAGE_PARAMETER_ERROR=205]="MESSAGE_PARAMETER_ERROR",e[e.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE=206]="WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE",e[e.WEBIM_CONNCTION_USER_REMOVED=207]="WEBIM_CONNCTION_USER_REMOVED",e[e.WEBIM_USER_ALREADY_LOGIN=208]="WEBIM_USER_ALREADY_LOGIN",e[e.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD=216]="WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD",e[e.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE=217]="WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE",e[e.USER_MUTED_BY_ADMIN=219]="USER_MUTED_BY_ADMIN",e[e.USER_NOT_FRIEND=221]="USER_NOT_FRIEND",e[e.WEBIM_DOWNLOADFILE_ERROR_NO_PERMISSION=222]="WEBIM_DOWNLOADFILE_ERROR_NO_PERMISSION",e[e.WEBIM_DOWNLOADFILE_ERROR_EXPIRED=223]="WEBIM_DOWNLOADFILE_ERROR_EXPIRED",e[e.WEBIM_MESSAGE_REC_TEXT=300]="WEBIM_MESSAGE_REC_TEXT",e[e.WEBIM_MESSAGE_REC_TEXT_ERROR=301]="WEBIM_MESSAGE_REC_TEXT_ERROR",e[e.WEBIM_MESSAGE_REC_EMOTION=302]="WEBIM_MESSAGE_REC_EMOTION",e[e.WEBIM_MESSAGE_REC_PHOTO=303]="WEBIM_MESSAGE_REC_PHOTO",e[e.SERVER_GET_DNSLIST_FAILED=304]="SERVER_GET_DNSLIST_FAILED",e[e.WEBIM_MESSAGE_REC_AUDIO_FILE=305]="WEBIM_MESSAGE_REC_AUDIO_FILE",e[e.WEBIM_MESSAGE_REC_VEDIO=306]="WEBIM_MESSAGE_REC_VEDIO",e[e.WEBIM_MESSAGE_REC_VEDIO_FILE=307]="WEBIM_MESSAGE_REC_VEDIO_FILE",e[e.WEBIM_MESSAGE_REC_FILE=308]="WEBIM_MESSAGE_REC_FILE",e[e.WEBIM_MESSAGE_SED_TEXT=309]="WEBIM_MESSAGE_SED_TEXT",e[e.WEBIM_MESSAGE_SED_EMOTION=310]="WEBIM_MESSAGE_SED_EMOTION",e[e.WEBIM_MESSAGE_SED_PHOTO=311]="WEBIM_MESSAGE_SED_PHOTO",e[e.WEBIM_MESSAGE_SED_AUDIO=312]="WEBIM_MESSAGE_SED_AUDIO",e[e.WEBIM_MESSAGE_SED_AUDIO_FILE=313]="WEBIM_MESSAGE_SED_AUDIO_FILE",e[e.WEBIM_MESSAGE_SED_VEDIO=314]="WEBIM_MESSAGE_SED_VEDIO",e[e.WEBIM_MESSAGE_SED_VEDIO_FILE=315]="WEBIM_MESSAGE_SED_VEDIO_FILE",e[e.WEBIM_MESSAGE_SED_FILE=316]="WEBIM_MESSAGE_SED_FILE",e[e.WEBIM_MESSAGE_SED_ERROR=317]="WEBIM_MESSAGE_SED_ERROR",e[e.STATUS_INIT=400]="STATUS_INIT",e[e.STATUS_DOLOGIN_USERGRID=401]="STATUS_DOLOGIN_USERGRID",e[e.STATUS_DOLOGIN_IM=402]="STATUS_DOLOGIN_IM",e[e.STATUS_OPENED=403]="STATUS_OPENED",e[e.STATUS_CLOSING=404]="STATUS_CLOSING",e[e.STATUS_CLOSED=405]="STATUS_CLOSED",e[e.STATUS_ERROR=406]="STATUS_ERROR",e[e.SERVER_BUSY=500]="SERVER_BUSY",e[e.MESSAGE_INCLUDE_ILLEGAL_CONTENT=501]="MESSAGE_INCLUDE_ILLEGAL_CONTENT",e[e.MESSAGE_EXTERNAL_LOGIC_BLOCKED=502]="MESSAGE_EXTERNAL_LOGIC_BLOCKED",e[e.SERVER_UNKNOWN_ERROR=503]="SERVER_UNKNOWN_ERROR",e[e.MESSAGE_RECALL_TIME_LIMIT=504]="MESSAGE_RECALL_TIME_LIMIT",e[e.SERVICE_NOT_ENABLED=505]="SERVICE_NOT_ENABLED",e[e.SERVICE_NOT_ALLOW_MESSAGING=506]="SERVICE_NOT_ALLOW_MESSAGING",e[e.SERVICE_NOT_ALLOW_MESSAGING_MUTE=507]="SERVICE_NOT_ALLOW_MESSAGING_MUTE",e[e.MESSAGE_MODERATION_BLOCKED=508]="MESSAGE_MODERATION_BLOCKED",e[e.MESSAGE_CURRENT_LIMITING=509]="MESSAGE_CURRENT_LIMITING",e[e.MESSAGE_WEBSOCKET_DISCONNECTED=510]="MESSAGE_WEBSOCKET_DISCONNECTED",e[e.MESSAGE_SIZE_LIMIT=511]="MESSAGE_SIZE_LIMIT",e[e.MESSAGE_SEND_TIMEOUT=512]="MESSAGE_SEND_TIMEOUT",e[e.GROUP_NOT_EXIST=605]="GROUP_NOT_EXIST",e[e.GROUP_NOT_JOINED=602]="GROUP_NOT_JOINED",e[e.GROUP_MEMBERS_FULL=606]="GROUP_MEMBERS_FULL",e[e.PERMISSION_DENIED=603]="PERMISSION_DENIED",e[e.WEBIM_LOAD_MSG_ERROR=604]="WEBIM_LOAD_MSG_ERROR",e[e.GROUP_ALREADY_JOINED=601]="GROUP_ALREADY_JOINED",e[e.GROUP_MEMBERS_LIMIT=607]="GROUP_MEMBERS_LIMIT",e[e.GROUP_IS_DISABLED=608]="GROUP_IS_DISABLED",e[e.GROUP_MEMBER_ATTRIBUTES_SET_FAILED=609]="GROUP_MEMBER_ATTRIBUTES_SET_FAILED",e[e.REST_PARAMS_STATUS=700]="REST_PARAMS_STATUS",e[e.CHATROOM_NOT_JOINED=702]="CHATROOM_NOT_JOINED",e[e.CHATROOM_MEMBERS_FULL=704]="CHATROOM_MEMBERS_FULL",e[e.CHATROOM_NOT_EXIST=705]="CHATROOM_NOT_EXIST",e[e.LOCAL_DB_OPERATION_FAILED=800]="LOCAL_DB_OPERATION_FAILED",e[e.SDK_RUNTIME_ERROR=999]="SDK_RUNTIME_ERROR",e[e.PRESENCE_PARAM_EXCEED=1100]="PRESENCE_PARAM_EXCEED",e[e.REACTION_ALREADY_ADDED=1101]="REACTION_ALREADY_ADDED",e[e.REACTION_CREATING=1102]="REACTION_CREATING",e[e.REACTION_OPERATION_IS_ILLEGAL=1103]="REACTION_OPERATION_IS_ILLEGAL",e[e.TRANSLATION_NOT_VALID=1200]="TRANSLATION_NOT_VALID",e[e.TRANSLATION_TEXT_TOO_LONG=1201]="TRANSLATION_TEXT_TOO_LONG",e[e.TRANSLATION_FAILED=1204]="TRANSLATION_FAILED",e[e.THREAD_NOT_EXIST=1300]="THREAD_NOT_EXIST",e[e.THREAD_ALREADY_EXIST=1301]="THREAD_ALREADY_EXIST",e[e.MODIFY_MESSAGE_NOT_EXIST=1302]="MODIFY_MESSAGE_NOT_EXIST",e[e.MODIFY_MESSAGE_FORMAT_ERROR=1303]="MODIFY_MESSAGE_FORMAT_ERROR",e[e.MODIFY_MESSAGE_FAILED=1304]="MODIFY_MESSAGE_FAILED",e[e.CONVERSATION_NOT_EXIST=1400]="CONVERSATION_NOT_EXIST"}(n||(n={}))},4998:function(e,t,r){"use strict";var n;r.d(t,{a:function(){return n}}),r(7252),function(e){e[e.SYNC_INIT=0]="SYNC_INIT",e[e.SYNC_START=1]="SYNC_START",e[e.SYNC_FINISH=2]="SYNC_FINISH"}(n||(n={}))},9937:function(e,t,r){"use strict";var n;r.d(t,{Z:function(){return n}}),function(e){e[e.mark_0=0]="mark_0",e[e.mark_1=1]="mark_1",e[e.mark_2=2]="mark_2",e[e.mark_3=3]="mark_3",e[e.mark_4=4]="mark_4",e[e.mark_5=5]="mark_5",e[e.mark_6=6]="mark_6",e[e.mark_7=7]="mark_7",e[e.mark_8=8]="mark_8",e[e.mark_9=9]="mark_9",e[e.mark_10=10]="mark_10",e[e.mark_11=11]="mark_11",e[e.mark_12=12]="mark_12",e[e.mark_13=13]="mark_13",e[e.mark_14=14]="mark_14",e[e.mark_15=15]="mark_15",e[e.mark_16=16]="mark_16",e[e.mark_17=17]="mark_17",e[e.mark_18=18]="mark_18",e[e.mark_19=19]="mark_19"}(n||(n={}))},4024:function(e,t,r){"use strict";r.d(t,{PU:function(){return R},iw:function(){return A},hj:function(){return C},LR:function(){return x},cT:function(){return k},P6:function(){return j}}),r(9601),r(1539),r(8674),r(3710),r(7941),r(2564),r(6699),r(7042),r(2772),r(9714),r(9653),r(6992),r(8783),r(3948),r(285),r(1637),r(8309),r(4986),r(2222),r(4916),r(6977);var n=r(5531),o=(r(2023),function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)}),i=function(e,t,r,i){var a,s,c,u,l,d,p,h,f,m,g,v,E,y,_,T,I,O,R,C,N,S,b,A,M,w,P,U,k=e.response;k&&"string"==typeof k&&(k=JSON.parse(k));var x=e.status,L={elapse:i,httpCode:x,errDesc:null==k?void 0:k.error_description};if(400===x){if(40002===k.error_code)return void t({type:n.E.THREAD_ALREADY_EXIST,message:null==k?void 0:k.error_description,extraInfo:L});if(40009===k.error_code)return void t({type:n.E.OPERATION_UNSUPPORTED,message:null==k?void 0:k.error_description,extraInfo:L});if(60005===k.error_code)return void t({type:n.E.GROUP_MEMBER_ATTRIBUTES_SET_FAILED,message:(null==k?void 0:k.desc)||(null==k?void 0:k.error_description),extraInfo:L});if(60010===k.error_code)return void((null===(a=null==k?void 0:k.error_description)||void 0===a?void 0:a.includes("exceeds chatgroup user metadata single value limit"))?t({type:n.E.MAX_LIMIT,message:(null==k?void 0:k.desc)||k.error_description,extraInfo:L}):t({type:n.E.NO_PERMISSION,message:(null==k?void 0:k.desc)||k.error_description,extraInfo:L}));if(60011===k.error_code)return void t({type:n.E.CHATROOM_NOT_JOINED,message:null==k?void 0:k.desc,extraInfo:L});if(14403===k.error_code)return void t({type:n.E.WEBIM_UPLOADFILE_ERROR,message:null==k?void 0:k.error_description,data:k,extraInfo:L});if(60006===k.error_code||60007===k.error_code||60009===k.error_code||60012===k.error_code)return void t({type:n.E.MAX_LIMIT,message:(null==k?void 0:k.desc)||(null==k?void 0:k.error_description),extraInfo:L});if(91104===k.error_code)return void t({type:n.E.NO_PERMISSION,message:null==k?void 0:k.error_description,extraInfo:L});if(null===(s=k.error_description)||void 0===s?void 0:s.includes("are not members of this group"))return(null===(c=e.responseURL)||void 0===c?void 0:c.includes("chatgroups"))?t({type:n.E.GROUP_NOT_JOINED,data:e.response||e.responseText,message:k.error_description,extraInfo:L}):t({type:n.E.CHATROOM_NOT_JOINED,data:e.response||e.responseText,message:k.error_description,extraInfo:L}),void r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,message:null==k?void 0:k.error_description,data:e.responseText,extraInfo:L});if("the app not open presence"===(null==k?void 0:k.result))return void t({type:n.E.SERVICE_NOT_ENABLED,message:null==k?void 0:k.result,extraInfo:L});if(null===(u=null==k?void 0:k.error_description)||void 0===u?void 0:u.includes("remark length must less"))return void t({type:n.E.MAX_LIMIT,message:null==k?void 0:k.error_description,extraInfo:L});switch(null==k?void 0:k.error_description){case"the user is already operation this message":t({type:n.E.REACTION_ALREADY_ADDED,message:null==k?void 0:k.error_description,extraInfo:L});break;case"The quantity has exceeded the limit!":t({type:n.E.MAX_LIMIT,message:null==k?void 0:k.error_description,extraInfo:L});break;case"The user not in this group!":t({type:n.E.GROUP_NOT_JOINED,message:null==k?void 0:k.error_description,extraInfo:L});break;case"the user operation is illegal!":t({type:n.E.REACTION_OPERATION_IS_ILLEGAL,message:null==k?void 0:k.error_description,extraInfo:L});break;case"this appKey is not open reaction service!":case"this appKey not open message roaming":t({type:n.E.SERVICE_NOT_ENABLED,message:null==k?void 0:k.error_description,extraInfo:L});break;case"this message is creating reaction, please try again.":t({type:n.E.REACTION_CREATING,message:null==k?void 0:k.error_description,extraInfo:L});break;case"groupId can not be null!":t({type:n.E.GROUP_NOT_EXIST,message:null==k?void 0:k.error_description,extraInfo:L});break;case"The input text is too long.":t({type:n.E.TRANSLATION_TEXT_TOO_LONG,message:null==k?void 0:k.error_description,extraInfo:L});break;case"The target language is not valid.":t({type:n.E.TRANSLATION_NOT_VALID,message:null==k?void 0:k.error_description,extraInfo:L});break;case"report failed, get message by id failed":t({type:n.E.MESSAGE_NOT_FOUND,message:null==k?void 0:k.error_description,extraInfo:L});break;case"ext is too big ":t({type:n.E.PRESENCE_PARAM_EXCEED,message:null==k?void 0:k.error_description,extraInfo:L});break;case"Request body not readable.Please check content type is correct!":case"param mark must be not empty, please check!":case"param mark illegal, please check it!":case"param pin_msg_id illegal, please check it!":t({type:n.E.REQUEST_PARAMETER_ERROR,message:null==k?void 0:k.error_description,extraInfo:L});break;case"updateRemark | they are not friends, please add as a friend first.":t({type:n.E.USER_NOT_FRIEND,message:null==k?void 0:k.error_description,extraInfo:L});break;default:t({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,message:null==k?void 0:k.error_description,data:e.responseText,extraInfo:L}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,message:null==k?void 0:k.error_description,data:e.responseText,extraInfo:L})}}else if(401===x)40001===k.error_code||60001===k.error_code||"Unable to authenticate (OAuth)"===k.error_description?t({type:n.E.NO_PERMISSION,message:null==k?void 0:k.error_description,extraInfo:L}):(r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:L}),t({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:L}));else if(403===x)4e4===k.error_code||60004===k.error_code||15002===k.error_code?t({type:n.E.SERVICE_NOT_ENABLED,message:null==k?void 0:k.error_description,extraInfo:L}):40003===k.error_code||40004===k.error_code?t({type:n.E.THREAD_ALREADY_EXIST,message:null==k?void 0:k.error_description,extraInfo:L}):40005===k.error_code||40007===k.error_code||91002===k.error_code?t({type:n.E.MAX_LIMIT,message:null==k?void 0:k.error_description,extraInfo:L}):60002===k.error_code?t({type:n.E.PERMISSION_DENIED,message:null==k?void 0:k.error_description,extraInfo:L}):91101===k.error_code?t({type:n.E.MAX_LIMIT,message:null==k?void 0:k.error_description,extraInfo:L}):91102===k.error_code&&t({type:n.E.REQUEST_PARAMETER_ERROR,message:k.error_description,extraInfo:L}),"group member list is full!"===k.error_description?(null===(l=e.responseURL)||void 0===l?void 0:l.includes("chatgroups"))?t({type:n.E.GROUP_MEMBERS_FULL,data:e.response||e.responseText,message:k.error_description,extraInfo:L}):t({type:n.E.CHATROOM_MEMBERS_FULL,data:e.response||e.responseText,message:k.error_description,extraInfo:L}):(null===(d=k.error_description)||void 0===d?void 0:d.includes("invite users to join group failed"))&&(null===(p=k.error_description)||void 0===p?void 0:p.includes("already in group"))?(null===(h=e.responseURL)||void 0===h?void 0:h.includes("chatgroups"))&&t({type:n.E.GROUP_ALREADY_JOINED,data:e.response||e.responseText,message:k.error_description,extraInfo:L}):(null===(f=k.error_description)||void 0===f?void 0:f.includes("are not members of this group"))?(null===(m=e.responseURL)||void 0===m?void 0:m.includes("chatgroups"))?t({type:n.E.GROUP_NOT_JOINED,data:e.response||e.responseText,message:k.error_description,extraInfo:L}):t({type:n.E.CHATROOM_NOT_JOINED,data:e.response||e.responseText,message:k.error_description,extraInfo:L}):(null===(g=k.error_description)||void 0===g?void 0:g.includes("service not open!"))||(null===(v=k.error_description)||void 0===v?void 0:v.includes("message report not open"))||(null===(E=k.error_description)||void 0===E?void 0:E.includes("messageroaming function not open"))?t({type:n.E.SERVICE_NOT_ENABLED,data:e.response||e.responseText,message:k.error_description,extraInfo:L}):(null===(y=k.error_description)||void 0===y?void 0:y.includes("members size is greater than max user size !"))?t({type:n.E.GROUP_MEMBERS_LIMIT,data:e.response||e.responseText,message:k.error_description,extraInfo:L}):(null===(_=k.error_description)||void 0===_?void 0:_.includes("can not operate this group, reason: group is disabled"))?t({type:n.E.GROUP_IS_DISABLED,data:e.response||e.responseText,message:k.error_description,extraInfo:L}):(null===(T=k.error_description)||void 0===T?void 0:T.includes("Invitee's contact max count"))||(null===(I=k.error_description)||void 0===I?void 0:I.includes("Inviter's contact max count"))?t({type:n.E.MAX_LIMIT,data:e.response||e.responseText,message:k.error_description,extraInfo:L}):t({type:n.E.PERMISSION_DENIED,data:e.response||e.responseText,message:"permission denied",extraInfo:o(o({},L),{errDesc:"permission denied"})}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:L});else if(404===x)40011===k.error_code?t({type:n.E.THREAD_NOT_EXIST,message:null==k?void 0:k.error_description,extraInfo:L}):40012===k.error_code?t({type:n.E.NO_PERMISSION,message:null==k?void 0:k.error_description,extraInfo:L}):60003===k.error_code||20004===k.error_code?t({type:n.E.GROUP_NOT_JOINED,message:null==k?void 0:k.error_description,extraInfo:L}):91001===k.error_code&&t({type:n.E.CONVERSATION_NOT_EXIST,message:null==k?void 0:k.error_description,extraInfo:L}),(null===(O=k.error_description)||void 0===O?void 0:O.includes("do not find this group"))||(null===(R=k.error_description)||void 0===R?void 0:R.includes("does not exist"))?(null===(C=e.responseURL)||void 0===C?void 0:C.includes("chatgroups"))?t({type:n.E.GROUP_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:o(o({},L),{errDesc:"The chat room dose not exist."})}):t({type:n.E.CHATROOM_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:o(o({},L),{errDesc:"The chat room dose not exist."})}):(null===(N=k.error_description)||void 0===N?void 0:N.includes("username"))&&(null===(S=k.error_description)||void 0===S?void 0:S.includes("doesn't exist!'"))||(null===(b=k.error_description)||void 0===b?void 0:b.includes("user not found"))||(null===(A=k.error_description)||void 0===A?void 0:A.includes("Service resource not found"))&&"UserNotFoundException"===(null==k?void 0:k.exception)?t({type:n.E.USER_NOT_FOUND,data:e.response||e.responseText,message:k.error_description,extraInfo:L}):(null===(M=k.error_description)||void 0===M?void 0:M.includes("user session pin message not exist"))?t({type:n.E.MESSAGE_NOT_FOUND,message:k.error_description,extraInfo:L}):t({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:L}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:L});else if(406===x)90004===k.error_code&&t({type:n.E.OPERATION_NOT_ALLOWED,message:null==k?void 0:k.error_description,extraInfo:L});else if(429===x||503===x){if(null===(w=k.error_description)||void 0===w?void 0:w.includes("The request has reached the maximum limit"))return void t({type:n.E.MAX_LIMIT,message:e.responseText,extraInfo:L});if(null===(P=k.error_description)||void 0===P?void 0:P.includes("upload client logs reached limit"))return void t({type:n.E.MAX_LIMIT,message:e.responseText});t({type:n.E.SERVER_BUSY,data:e.response||e.responseText,message:"Server is busy.",extraInfo:o(o({},L),{errDesc:"Server is busy."})}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"Server is busy.",extraInfo:o(o({},L),{errDesc:"Server is busy."})})}else if(500===x){if(40006===k.error_code||40008===k.error_code||40010===k.error_code)return void t({type:n.E.SERVER_UNKNOWN_ERROR,message:null==k?void 0:k.error_description,extraInfo:L});if(90005===k.error_code||99999===k.error_code)return void t({type:n.E.REQUEST_UNKNOWN,message:null==k?void 0:k.error_description,extraInfo:L});if(null===(U=k.error_description)||void 0===U?void 0:U.includes("translte failed!"))return void t({type:n.E.TRANSLATION_FAILED,message:e.responseText,extraInfo:L});t({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:L}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:L})}else t({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:o(o({},L),{errDesc:"ajax error"})}),r({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:o(o({},L),{errDesc:"ajax error"})})},a=r(1595),s=r(2071),c=r(7360),u=5242880,l=5242880,d={size:0},p={singleChat:"CHAT",groupChat:"GROUP",chatRoom:"ROOM"},h=(r(2526),r(1817),r(2165),r(5827),r(4553),r(561),r(4319)),f=function(){return f=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},f.apply(this,arguments)};function m(){var e=this.context,t=e.orgName,r=e.appName,n=e.accessToken,o={url:"".concat(this.apiUrl,"/").concat(t,"/").concat(r,"/sdk/chatfiles/part-upload"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+n}};return c.kg.debug("Call multipartInit"),C.call(this,o,a.fI.SDK_INTERNAL).then((function(e){var t=e.entities[0];return{data:{fileMaxSize:t.file_upper_limit,partMinSize:t.part_lower_limit,uuid:t.uuid},extraInfo:e.extraInfo,type:e.type}}))}function g(e){var t=this;return new Promise((function(r,o){var i,a,s=(new Date).getTime(),u=t.context,l=u.orgName,d=u.appName,p=u.accessToken,m=e.uuid,g=e.partNumber,v=e.part,E=e.onProgress,y="".concat(t.apiUrl,"/").concat(l,"/").concat(d,"/sdk/chatfiles/part-upload/").concat(m),_=new XMLHttpRequest;c.kg.debug("Call multipartUpload"),_.upload&&(null===(a=(i=_.upload).addEventListener)||void 0===a||a.call(i,"progress",(function(e){null==E||E(e)}),!1)),_.addEventListener("abort",(function(){o({type:n.E.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:_,extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"Request Abort",url:y}})}),!1),_.addEventListener("error",(function(){o({type:n.E.WEBIM_UPLOADFILE_ERROR,data:_,extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"request error",url:y}})}),!1),_.addEventListener("load",(function(){try{var e=JSON.parse(_.responseText);if(200!==_.status)return o({type:n.E.WEBIM_UPLOADFILE_ERROR,data:e,extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"part upload failed",url:y}}),!1;try{r(f(f({},e),{extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,url:y}}))}catch(e){o({type:n.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e,extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"part upload failed",url:y}})}}catch(e){o({type:n.E.WEBIM_UPLOADFILE_ERROR,data:_.responseText,extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"part upload failed",url:y}})}}),!1),_.addEventListener("timeout",(function(){o({type:n.E.REQUEST_TIMEOUT,message:"request timeout",extraInfo:{elapse:(new Date).getTime()-s,httpCode:_.status||-1,errDesc:"request timeout",url:y}})}),!1);var T=new FormData;T.append("part_file",v),T.append("part_number",g),_.timeout=h.zj,_.open("PUT",y),_.setRequestHeader("restrict-access","true"),_.setRequestHeader("Accept","*/*"),_.setRequestHeader("Authorization","Bearer "+p),_.send(T)}))}function v(e){var t=e.uuid,r=e.thumbnailHeight,n=e.thumbnailWidth,o=e.conversationInfo,i=o.conversationId,s=o.conversationType,u=p[s],l=this.context,d=l.orgName,h=l.appName,f=l.accessToken,m="".concat(this.apiUrl,"/").concat(d,"/").concat(h,"/sdk/chatfiles/part-upload/").concat(t,"?restrict-access=true&chat-type=").concat(u,"&chat-target=").concat(i);n&&(m+="&thumbnail-width=".concat(n)),r&&(m+="&thumbnail-height=".concat(r));var g={url:m,dataType:"json",type:"POST",headers:{Authorization:"Bearer "+f}};return c.kg.debug("Call multipartComplete"),C.call(this,g,a.fI.SDK_INTERNAL)}function E(e){var t=e.uuid,r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/sdk/chatfiles/part-upload/").concat(t),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i}};return c.kg.debug("Call multipartAbort"),C.call(this,s,a.fI.SDK_INTERNAL)}var y=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},_=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},T=function(){function e(e,t){var r=this;this.handleUploadProgress=function(e,t){var n,o;if(e.total){r.progressArr[t]=e.loaded;var i=r.progressArr.reduce((function(e,t){return e+t}),0);null===(o=(n=r.options).onFileUploadProgress)||void 0===o||o.call(n,{isTrusted:e.isTrusted,type:e.type,loaded:i>r.file.size?r.file.size:i,total:r.file.size,lengthComputable:e.lengthComputable})}},this.uuid="",this.pool=[],this.progressArr=[],this.connection=e,this.options=t,this.partSize=u,this.file=t.file,this.init(),this.rpt=this.connection.dataReport.geOperateFun({operationName:a.fI.REST_UPLOAD_FILE_IN_PARTS})}return e.prototype.init=function(){var e,t,r,o;return y(this,void 0,void 0,(function(){var i,s,l,p,h,f,g,v,E,y,T,I,O,R,C;return _(this,(function(_){switch(_.label){case 0:return _.trys.push([0,4,,6]),[4,m.call(this.connection)];case 1:return i=_.sent(),s=i.data||{},l=s.fileMaxSize,p=void 0===l?0:l,h=s.partMinSize,f=void 0===h?u:h,g=s.uuid,v=void 0===g?"":g,E=i.extraInfo,I=E.elapse,O=E.httpCode,C=E.url,this.partSize=f,this.uuid=v,d.size=f,c.kg.debug("multipartInit success","uuid: ".concat(v),"fileMaxSize: ".concat(p),"partMinSize: ".concat(f)),this.file.size>p?[4,this.multipartAbort()]:[3,3];case 2:return _.sent(),null===(t=(e=this.options).onFileUploadError)||void 0===t||t.call(e,{code:n.E.WEBIM_UPLOADFILE_ERROR,message:"The file size exceeds the maximum limit"}),[2];case 3:return this.rpt({data:{requestUrl:C,requestName:a.c.REST_INIT_UPLOAD_TASK_IN_PARTS,requestElapse:I,requestMethod:"POST",isSuccess:1,code:O}}),this.upload(),[3,6];case 4:return y=_.sent(),T=(null==y?void 0:y.extraInfo)||{},I=T.elapse,O=T.httpCode,R=T.errDesc,C=T.url,this.rpt({data:{requestUrl:C,requestName:a.c.REST_INIT_UPLOAD_TASK_IN_PARTS,requestElapse:I,requestMethod:"POST",isSuccess:0,codeDesc:R,code:O}}),[4,this.multipartAbort()];case 5:return _.sent(),null===(o=null===(r=this.options)||void 0===r?void 0:r.onInitFail)||void 0===o||o.call(r),[3,6];case 6:return[2]}}))}))},e.prototype.upload=function(){var e,t,r;return y(this,void 0,void 0,(function(){var n,o,i,s,c,u,l=this;return _(this,(function(d){switch(d.label){case 0:(new FileReader).readAsArrayBuffer(this.file),n=this.file.size,o=Math.ceil(n/this.partSize),d.label=1;case 1:d.trys.push([1,7,,9]),i=function(t){var r,o,i,c;return _(this,(function(u){switch(u.label){case 0:return r=t*s.partSize,o=Math.min(n,r+s.partSize),i=null===(e=s.file)||void 0===e?void 0:e.slice(r,o),(c=g.call(s.connection,{uuid:s.uuid,partNumber:"".concat(t+1),part:i,onProgress:function(e){l.handleUploadProgress(e,t)}})).then((function(e){var t=(null==e?void 0:e.extraInfo)||{},r=t.elapse,n=t.httpCode,o=t.url;l.rpt({data:{requestUrl:o,requestName:a.c.REST_UPLOAD_PART,requestElapse:r,isSuccess:1,requestMethod:"PUT",code:n}}),l.handleTask(c)})),c.catch((function(e){var t=(null==e?void 0:e.extraInfo)||{},r=t.elapse,n=t.httpCode,o=t.url,i=t.errDesc;l.rpt({data:{requestUrl:o,requestName:a.c.REST_UPLOAD_PART,requestElapse:r,isSuccess:0,requestMethod:"PUT",code:n,codeDesc:i}}),delete e.extraInfo})),s.pool.push(c),4!==s.pool.length?[3,2]:[4,Promise.race(s.pool)];case 1:u.sent(),u.label=2;case 2:return[2]}}))},s=this,c=0,d.label=2;case 2:return c<o?[5,i(c)]:[3,5];case 3:d.sent(),d.label=4;case 4:return c++,[3,2];case 5:return[4,Promise.all(this.pool)];case 6:return d.sent(),this.multipartComplete(),[3,9];case 7:return u=d.sent(),[4,this.multipartAbort()];case 8:return d.sent(),this.rpt({data:{isLastApi:1,isSuccess:0}}),null===(r=(t=this.options).onFileUploadError)||void 0===r||r.call(t,u),[3,9];case 9:return[2]}}))}))},e.prototype.multipartComplete=function(){var e,t,r,n;return y(this,void 0,void 0,(function(){var o,i,s,c,u,l,d,p,h,f,m;return _(this,(function(g){switch(g.label){case 0:return g.trys.push([0,2,,3]),o=this.options.thumbnailInfo||{},i=o.width,s=o.height,[4,v.call(this.connection,{uuid:this.uuid,thumbnailHeight:s,thumbnailWidth:i,conversationInfo:this.options.conversationInfo})];case 1:return c=g.sent(),u=(null==c?void 0:c.extraInfo)||{},p=u.elapse,h=u.httpCode,m=u.url,this.rpt({data:{requestUrl:m,requestName:a.c.REST_COMPLETE_UPLOAD_PART,requestElapse:p,requestMethod:"POST",isSuccess:1,code:h}}),this.rpt({data:{isLastApi:1,isSuccess:1}}),null===(t=(e=this.options).onFileUploadComplete)||void 0===t||t.call(e,c),[3,3];case 2:return l=g.sent(),d=(null==l?void 0:l.extraInfo)||{},p=d.elapse,h=d.httpCode,f=d.errDesc,m=d.url,this.rpt({data:{requestUrl:m,requestName:a.c.REST_COMPLETE_UPLOAD_PART,requestElapse:p,requestMethod:"POST",isSuccess:0,codeDesc:f,code:h}}),this.rpt({data:{isLastApi:1,isSuccess:0}}),null===(n=(r=this.options).onFileUploadError)||void 0===n||n.call(r,l),[3,3];case 3:return[2]}}))}))},e.prototype.multipartAbort=function(){return y(this,void 0,void 0,(function(){var e,t,r,n,o,i,s,c;return _(this,(function(u){switch(u.label){case 0:if(!this.uuid)return[2];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,E.call(this.connection,{uuid:this.uuid})];case 2:return e=u.sent(),t=(null==e?void 0:e.extraInfo)||{},o=t.elapse,i=t.httpCode,c=t.url,this.rpt({data:{requestUrl:c,requestName:a.c.REST_ABORT_UPLOAD_PART,requestElapse:o,requestMethod:"DELETE",isSuccess:1,code:i}}),[3,4];case 3:return r=u.sent(),n=(null==r?void 0:r.extraInfo)||{},o=n.elapse,i=n.httpCode,s=n.errDesc,c=n.url,this.rpt({data:{requestUrl:c,requestName:a.c.REST_ABORT_UPLOAD_PART,requestElapse:o,requestMethod:"DELETE",isSuccess:0,codeDesc:s,code:i}}),[3,4];case 4:return[2]}}))}))},e.prototype.handleTask=function(e){var t=this.pool.findIndex((function(t){return t===e}));this.pool.splice(t,1)},e}(),I=function(e){var t,r,o=this,i=(new Date).getTime(),s=e.apiUrl,c=e.orgName,u=e.appName,l=e.operateName,d=e.accessToken,f=e.conversationInfo,m=f.conversationType,g=f.conversationId,v=p[m],E=e.uploadUrl||"".concat(s,"/").concat(c,"/").concat(u,"/chatfiles?chat-type=").concat(v,"&chat-target=").concat(g),y=function(t){var r=(new Date).getTime()-i;o.dataReport&&l&&[a.fI.UPLOAD_MSG_ATTACH,a.fI.UPLOAD_CHATROOM_FILE,a.fI.UPLOAD_GROUP_FILE].includes(l)&&o.dataReport.geOperateFun({operationName:l})({isEndApi:!0,data:{isSuccess:0,requestMethod:"POST",requestName:l,requestElapse:r,requestUrl:E,code:(null==T?void 0:T.status)||0,codeDesc:"upload file error"}}),e.onFileUploadError&&e.onFileUploadError(t)};function _(e){y({type:n.E.WEBIM_UPLOADFILE_ERROR,data:T})}var T=new XMLHttpRequest;T.upload&&(null===(r=(t=T.upload).addEventListener)||void 0===r||r.call(t,"progress",e.onFileUploadProgress||R,!1)),T.addEventListener("abort",e.onFileUploadCanceled||R,!1),T.addEventListener("error",_,!1),T.addEventListener("load",(function(t){try{var r=JSON.parse(T.responseText);if(400===T.status)return y({type:n.E.WEBIM_UPLOADFILE_ERROR,data:r}),!1;try{!function(t){var r=(new Date).getTime()-i;o.dataReport&&l&&[a.fI.UPLOAD_MSG_ATTACH,a.fI.UPLOAD_CHATROOM_FILE,a.fI.UPLOAD_GROUP_FILE].includes(l)&&o.dataReport.geOperateFun({operationName:l})({isEndApi:!0,data:{isSuccess:(null==t?void 0:t.error)?0:1,requestMethod:"POST",requestName:l,requestElapse:r,requestUrl:E,code:T.status,codeDesc:(null==t?void 0:t.error_description)||""}}),e.onFileUploadComplete&&e.onFileUploadComplete(t)}(r)}catch(t){y({type:n.E.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){y({type:n.E.WEBIM_UPLOADFILE_ERROR,data:T.responseText})}}),!1),T.addEventListener("timeout",_,!1),T.timeout=h.zj,T.open("POST",E),T.setRequestHeader("restrict-access","true"),T.setRequestHeader("Accept","*/*"),T.setRequestHeader("Authorization","Bearer "+d);var I=new FormData;I.append("file",e.file.data),e.thumbnailWidth&&I.append("thumbnail-width",e.thumbnailWidth+""),e.thumbnailHeight&&I.append("thumbnail-height",e.thumbnailHeight+""),T.send(I)},O=function(){return O=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},O.apply(this,arguments)},R=function(){};function C(e,t){var r,o=this;return P().platform===A.WEB?new Promise((function(t,o){var a=e.dataType||"text",s=e.success||R,u=e.error||R,l=new XMLHttpRequest;l.timeout=h.Gf;var d=!1;l.ontimeout=function(){c.kg.warn("request timeout"),d=!0;var e={type:n.E.REQUEST_TIMEOUT,message:"Request Timeout",errorType:"timeout_error",xhr:l};u(e),o(e)},l.onerror=function(){o({type:n.E.REQUEST_UNKNOWN,message:"Request Unknow Error",errorType:"onerror",xhr:l})},l.onabort=function(){o({type:n.E.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:l})},l.onreadystatechange=function(){if(4===l.readyState){var e=(new Date).getTime()-r,p=l.status||0,h={elapse:e,httpCode:p};if(200===p){j.ajaxUnconventionalErrorTimes=0;try{switch(a){case"text":return s(l.responseText),void t(l.responseText);case"json":var f=JSON.parse(l.responseText);return f.extraInfo=h,s(f),void t(f);case"xml":return l.responseXML&&l.responseXML.documentElement?(s(l.responseXML.documentElement),void t(l.responseXML.documentElement)):(u({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}),void o({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}));default:u({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"Invalid dataType"}),o({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"Invalid dataType"})}return t(l.response||l.responseText),void s(l.response||l.responseText,l)}catch(e){o(e)}return}0===p?setTimeout((function(){c.kg.debug("request timeout:",d),!d&&i(l,o,u,e)}),0):([400,401,403,404,429,500,503].includes(p)||(c.kg.debug("rest api request fail status:",p),j.ajaxUnconventionalErrorTimes++),i(l,o,u,e))}0===l.readyState&&(u({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"Request not initialized"}),o({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,data:l.responseText,message:"Request not initialized"}))},e.responseType&&l.responseType&&(l.responseType=e.responseType),e.mimeType&&l.overrideMimeType(e.mimeType);var p=e.type||"POST",f=e.data||null,m="";if("get"===p.toLowerCase()&&f){for(var g in f)f.hasOwnProperty(g)&&(m+=g+"="+f[g]+"&");m=m?m.slice(0,-1):m,e.url+=(e.url.indexOf("?")>0?"&":"?")+(m?m+"&":m)+"_v="+(new Date).getTime(),f=null,m=""}r=(new Date).getTime(),l.open(p,e.url);var v=e.headers||{};for(var E in v["Content-Type"]||(v["Content-Type"]="application/json"),v)v.hasOwnProperty(E)&&l.setRequestHeader(E,v[E]);l.send(f)})).then((function(r){return o.dataReport&&t&&t!==a.fI.SDK_INTERNAL&&o.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:O({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},L(r.extraInfo))}),t===a.fI.SDK_INTERNAL&&(r.extraInfo.url=e.url),t!==a.fI.SDK_INTERNAL&&delete r.extraInfo,"Object"===N(r)?O(O({},r),{type:n.E.REQUEST_SUCCESS}):{data:r,type:n.E.REQUEST_SUCCESS}})).catch((function(n){var i,s;if(o.dataReport&&t&&t!==a.fI.SDK_INTERNAL&&o.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:O({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},L(n.extraInfo))}),t===a.fI.SDK_INTERNAL)if(n.extraInfo)n.extraInfo.url=e.url;else{var c={elapse:(new Date).getTime()-r,httpCode:null!==(s=null===(i=n.xhr)||void 0===i?void 0:i.status)&&void 0!==s?s:0,url:e.url};n.extraInfo=c}throw t!==a.fI.SDK_INTERNAL&&delete n.extraInfo,n})):S.call(this,e,t)}function N(e){return Object.prototype.toString.call(e).slice(8,-1)}function S(e,t){var r=this;return new Promise((function(r,o){var i=e.success||R,a=e.error||R,u=e.type||"POST",l=e.data||null,d="",p=(new Date).getTime(),f=j.getEnvInfo();if("get"===u.toLowerCase()&&l){for(var m in l)l.hasOwnProperty(m)&&(d+=m+"="+l[m]+"&");d=d?d.slice(0,-1):d,e.url+=(e.url.indexOf("?")>0?"&":"?")+(d?d+"&":d)+"_v="+(new Date).getTime(),l=null,d=""}var g={url:e.url,data:e.data,method:u,headers:{},timeout:h.Gf,success:function(e){var n,s,u,l,d,h={elapse:(new Date).getTime()-p,httpCode:Number((null===(n=e.statusCode)||void 0===n?void 0:n.toString())||(null===(s=e.status)||void 0===s?void 0:s.toString())),errDesc:(null===(u=null==e?void 0:e.data)||void 0===u?void 0:u.error_description)||""};if("200"===(null===(l=e.statusCode)||void 0===l?void 0:l.toString())||"200"===(null===(d=e.status)||void 0===d?void 0:d.toString())){e.data.extraInfo=h;var f=e.data;i(f),r(f)}else e.extraInfo=h,a(f=e),o(f),c.kg.debug(t,"reject reason: ",f)},complete:function(){},fail:function(e){var r={elapse:(new Date).getTime()-p,httpCode:s.Tp,errDesc:"request:fail"};if(e.extraInfo=r,e.data={error:"request:fail",error_description:"request:fail"},"request:fail timeout"===e.errMsg)return o({type:n.E.REQUEST_TIMEOUT,message:"Request Timeout",extraInfo:r}),void a({type:n.E.REQUEST_TIMEOUT,message:"Request Timeout",extraInfo:r});a(e),o(e),c.kg.error(t,"fail reason:",e)}};if("zfb"===f.platform||"dd"===f.platform?g.headers=e.headers:g.header=e.headers,"dd"===f.platform)return dd.httpRequest(g);f.global.request(g)})).then((function(o){return r.dataReport&&t&&t!==a.fI.SDK_INTERNAL&&r.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:O({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},L(o.extraInfo))}),t!==a.fI.SDK_INTERNAL&&delete o.extraInfo,"Object"===N(o)?O(O({},o),{type:n.E.REQUEST_SUCCESS}):{data:o,type:n.E.REQUEST_SUCCESS}})).catch((function(n){r.dataReport&&t&&t!==a.fI.SDK_INTERNAL&&r.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:O({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},L(n.extraInfo))}),t!==a.fI.SDK_INTERNAL&&delete n.extraInfo;var o=JSON.stringify(n.data||{}),s=O(O({},n),{status:n.statusCode||n.status||0,response:o,responseText:o});i(s,(function(e){throw O(O({},n),{message:e.message,type:e.type})}),R,0)}))}function b(e,t){var r;return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(!e)return r;r=t?e.apply(t,n):e.apply(void 0,n),e=null}}var A,M=b((function(e,t){var r=P();if(r.platform!==A.WEB){var n=r.global,o=function(r){r.isConnected?e():t()};n.offNetworkStatusChange&&n.offNetworkStatusChange(o),n.onNetworkStatusChange&&n.onNetworkStatusChange(o)}else"undefined"!=typeof addEventListener&&(window.addEventListener("online",e),window.addEventListener("offline",t))})),w=b((function(e,t){var r,n,o=P();if(o.platform===A.WEB)document&&document.addEventListener("visibilitychange",(function(){document.hidden?null==t||t():null==e||e()}),!1);else{var i=o.global;i.onAppShow&&(null===(r=i.onAppShow)||void 0===r||r.call(i,e)),i.onAppHide&&(null===(n=i.onAppHide)||void 0===n||n.call(i,t))}}));function P(){return"undefined"!=typeof swan&&U(swan)?{platform:A.BAIDU,global:swan}:"undefined"!=typeof tt&&U(tt)?{platform:A.TT,global:tt}:"undefined"!=typeof dd&&U(dd)?{platform:A.DD,global:dd}:"undefined"!=typeof my&&U(my)?{platform:A.ZFB,global:my}:"undefined"!=typeof wx&&U(wx)||"undefined"!=typeof wx&&"function"==typeof wx.createCanvas?{platform:A.WX,global:wx}:"undefined"!=typeof qq&&U(qq)?{platform:A.QQ,global:qq}:"undefined"!=typeof uni&&U(uni)?{platform:A.UNI,global:uni}:"undefined"!=typeof window&&window.WebSocket?{platform:A.WEB,global:window}:{platform:A.NODE,global:r.g||{}}}function U(e){for(var t=["canIUse","getSystemInfo"],r=0,n=t.length;r<n;r++)if(!e[t[r]])return!1;return!0}function k(e,t){var r,o,i,a=this,s=e.accessToken,c=e.appKey,u=null===(o=null===(r=null==e?void 0:e.file)||void 0===r?void 0:r.data)||void 0===o?void 0:o.size,p=[],h="",f="";if(s)if(c&&(p=c.split("#"),h=p[0],f=p[1]),h||f)if(u<=0)e.onFileUploadError&&e.onFileUploadError({type:n.E.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"});else if(e.uploadUrl)I.call(this,O(O({},e),{orgName:h,appName:f,operateName:t,conversationInfo:{conversationId:e.to,conversationType:e.chatType}}));else{var m=d.size||l;this.uploadPartEnable&&u>1.5*m?new T(this,{file:null===(i=null==e?void 0:e.file)||void 0===i?void 0:i.data,onFileUploadProgress:e.onFileUploadProgress||R,onFileUploadComplete:e.onFileUploadComplete||R,onFileUploadError:e.onFileUploadError||R,onFileUploadCanceled:e.onFileUploadCanceled||R,conversationInfo:{conversationId:e.to,conversationType:e.chatType},onInitFail:function(){I.call(a,O(O({},e),{orgName:h,appName:f,operateName:t,conversationInfo:{conversationId:e.to,conversationType:e.chatType}}))},thumbnailInfo:{width:e.thumbnailWidth,height:e.thumbnailHeight}}):I.call(this,O(O({},e),{orgName:h,appName:f,operateName:t,conversationInfo:{conversationId:e.to,conversationType:e.chatType}}))}else e.onFileUploadError&&e.onFileUploadError({type:n.E.WEBIM_UPLOADFILE_ERROR,message:this._initWithAppId?"appId illegal":"AppKey illegal"});else e.onFileUploadError&&e.onFileUploadError({type:n.E.WEBIM_UPLOADFILE_NO_LOGIN,message:"AccessToken cannot be empty"})}function x(e,t){var r;e.onFileDownloadComplete=e.onFileDownloadComplete||R,e.onFileDownloadError=e.onFileDownloadError||R;var o=(new Date).getTime(),i=new XMLHttpRequest,s=this;i.addEventListener("load",(function(){var r,u=(new Date).getTime()-o;s.dataReport&&t&&t===a.fI.DOWN_GROUP_FILE&&s.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:200===i.status?1:0,requestMethod:e.method||"GET",requestName:t,requestElapse:u,requestUrl:null==e?void 0:e.url,code:i.status,codeDesc:200===i.status?"":"download file error"}}),200===i.status?e.onFileDownloadComplete&&e.onFileDownloadComplete(i.response):403===i.status||404===i.status?((r=new FileReader).addEventListener("loadend",(function(t){var r;try{var o=JSON.parse(null===(r=t.target)||void 0===r?void 0:r.result);c.kg.error("download file failed","status:".concat(i.status),o),403===i.status?"chatfile no permission"===o.error_description?e.onFileDownloadError&&e.onFileDownloadError({type:n.E.WEBIM_DOWNLOADFILE_ERROR_NO_PERMISSION,id:e.id,xhr:i}):e.onFileDownloadError&&e.onFileDownloadError({type:n.E.PERMISSION_DENIED,id:e.id,xhr:i}):404===i.status&&("file_expired"===o.error?e.onFileDownloadError&&e.onFileDownloadError({type:n.E.WEBIM_DOWNLOADFILE_ERROR_EXPIRED,id:e.id,xhr:i}):e.onFileDownloadError&&e.onFileDownloadError({type:n.E.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:i}))}catch(t){c.kg.error("Error parsing download error response:",t),e.onFileDownloadError&&e.onFileDownloadError({type:n.E.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:i})}})),r.readAsText(i.response)):500===i.status?(c.kg.error("download file failed","status:".concat(i.status),"type:".concat(n.E.SERVER_UNKNOWN_ERROR)),e.onFileDownloadError&&e.onFileDownloadError({type:n.E.SERVER_UNKNOWN_ERROR,id:e.id,xhr:i})):(c.kg.error("download file failed","status:".concat(i.status),"type:".concat(n.E.WEBIM_DOWNLOADFILE_ERROR)),e.onFileDownloadError&&e.onFileDownloadError({type:n.E.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:i}))}),!1),i.addEventListener("error",(function(r){var c=(new Date).getTime()-o;s.dataReport&&t&&t===a.fI.DOWN_GROUP_FILE&&s.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:0,requestMethod:e.method||"GET",requestName:t,requestElapse:c,requestUrl:null==e?void 0:e.url,code:(null==i?void 0:i.status)||0,codeDesc:"download file error"}}),e.onFileDownloadError&&e.onFileDownloadError({type:n.E.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:i})}),!1);var u=e.method||"GET",l=e.responseType||"blob",d=e.mimeType||"text/plain; charset=x-user-defined";i.open(u,e.url),"undefined"!=typeof Blob?i.responseType=l:i.overrideMimeType(d);var p={"X-Requested-With":"XMLHttpRequest","share-secret":e.secret,Authorization:"Bearer "+(null===(r=null==this?void 0:this.context)||void 0===r?void 0:r.accessToken)},h=e.headers||{};for(var f in h)p[f]=h[f];for(var f in p)p[f]&&i.setRequestHeader(f,p[f]);i.send(null)}function L(e){void 0===e&&(e={});var t=e.elapse,r=void 0===t?0:t,n=e.httpCode,o=void 0===n?0:n,i=e.errDesc;return{requestElapse:r,code:o,codeDesc:void 0===i?"":i}}!function(e){e.WEB="web",e.WX="wx",e.QQ="qq",e.ZFB="zfb",e.DD="dd",e.TT="tt",e.BAIDU="baidu",e.QUICK_APP="quick_app",e.UNI="uni",e.NODE="node"}(A||(A={}));var D="localDeviceInfo",j={autoIncrement:0,ajaxUnconventionalErrorTimes:0,isUseHttps:function(e){var t;return"boolean"==typeof e?e:!("undefined"!=typeof window)||"https:"===(null===(t=window.location)||void 0===t?void 0:t.protocol)},getRetryDelay:function(e){return e<=5?Number((Math.random()+1).toFixed(2)):e>5&&e<20?Math.floor(4*Math.random())+3:Math.floor(6*Math.random())+5},ajax:C,getUniqueId:function(){this.autoIncrement?this.autoIncrement++:this.autoIncrement=1;var e=new Date,t=new Date(2010,1,1);return(e.getTime()-t.getTime()+this.autoIncrement).toString()},getFileUrl:function(e){var t={url:"",filename:"",filetype:"",data:{}},r="string"==typeof e?document.getElementById(e):e;if(window.URL.createObjectURL){if(!r.files)throw Error("this is not HTMLInputElement");var n=r.files;if(n.length>0){var o=n.item(0);t.data=o,t.url=window.URL.createObjectURL(o),t.filename=(null==o?void 0:o.name)||""}}else{if("string"!=typeof e)throw Error("in IE fileInputId must be string");o=document.getElementById(e).value,t.url=o;var i=o.lastIndexOf("/"),a=o.lastIndexOf("\\"),s=Math.max(i,a);t.filename=s<0?o:o.substring(s+1)}var c=t.filename.lastIndexOf(".");return-1!==c&&(t.filetype=t.filename.substring(c+1).toLowerCase()),t},uploadFile:k,flow:function(e){for(var t=e.length,r=t;r--;)if("function"!=typeof e[r])throw new TypeError("Expected a function");return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var o=0,i=t?e[o].apply(this,r):r[0];++o<t;)i=e[o].call(this,i);return i}},listenNetwork:M,listenBrowserVisibility:w,getEnvInfo:P,wxRequest:S,parseDownloadResponse:function(e){if(!window||!window.URL)throw Error("parseDownloadResponse can be used in broswer only");return e&&e.type&&"application/json"===e.type||0>Object.prototype.toString.call(e).indexOf("Blob")?this.url+"?token=":window.URL.createObjectURL(e)},download:x,parseNotify:function(e){for(var t="",r=0;r<e.length;r++)t+="%"+e[r].toString(16);return JSON.parse(decodeURIComponent(t))},getExtraData:L,retryPromise:function(e,t,r){return new Promise((function(n,o){!function t(i){e().then(n).catch((function(e){i>0?setTimeout((function(){t(i-1)}),r||1e3):o(e)}))}(t||3)}))},formatAttachUrl:function(e){return e&&"string"==typeof e?"".concat(this.apiUrl).concat(e.slice(e.indexOf("/",9))):""},Uint8ArrayToString:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},getLocalDeviceInfo:function(){return function(e){var t,r=j.getEnvInfo(),n=r.platform,o="";n!==A.NODE&&n!==A.QUICK_APP||(o="");try{n===A.WEB?o=localStorage.getItem(e)||"":n===A.WX||n===A.QQ||n===A.TT||n===A.BAIDU||n===A.UNI?o=r.global.getStorageSync(e)||"":n!==A.ZFB&&n!==A.DD||(o=(null===(t=r.global.getStorageSync({key:e}))||void 0===t?void 0:t.data)||"")}catch(t){c.kg.debug("get local ".concat(e," failed: "),t)}return c.kg.debug("".concat(e," "),o),o}(D)},setLocalDeviceInfo:function(e){!function(e,t){var r=j.getEnvInfo(),n=r.platform;if(n!==A.NODE&&n!==A.QUICK_APP)if(n===A.WEB)try{localStorage.setItem(e,t)}catch(t){c.kg.error("set local ".concat(e," failed: "),t)}else r.global.setStorage({key:e,data:t,success:function(t){c.kg.debug("set local ".concat(e," success: "),t)},fail:function(t){c.kg.error("set local ".concat(e," failed: "),t)}})}(D,e)},detectBrowser:function(){if("undefined"==typeof navigator)return"unknown";var e=navigator.userAgent;return/MicroMessenger/i.test(e)?"WeChat":/QQBrowser/i.test(e)?"QQ":!/Chrome/i.test(e)||/Edg/i.test(e)||/OPR/i.test(e)?!/Safari/i.test(e)||/Chrome/i.test(e)||/CriOS/i.test(e)?/Firefox/i.test(e)?"Firefox":/MSIE/i.test(e)||/Trident/i.test(e)?"IE":/Edg/i.test(e)?"Edge":"unknown":"Safari":"Chrome"},getDevicePlatform:function(e){return e.platform===A.WX&&"undefined"!=typeof uni&&U(uni)?A.UNI:e.platform},delay:function(e){return new Promise((function(t){return setTimeout(t,e)}))}}},9662:function(e,t,r){var n=r(614),o=r(6330),i=TypeError;e.exports=function(e){if(n(e))return e;throw i(o(e)+" is not a function")}},9483:function(e,t,r){var n=r(4411),o=r(6330),i=TypeError;e.exports=function(e){if(n(e))return e;throw i(o(e)+" is not a constructor")}},6077:function(e,t,r){var n=r(614),o=String,i=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw i("Can't set "+o(e)+" as a prototype")}},1223:function(e,t,r){var n=r(5112),o=r(30),i=r(3070).f,a=n("unscopables"),s=Array.prototype;null==s[a]&&i(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},1530:function(e,t,r){"use strict";var n=r(8710).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},5787:function(e,t,r){var n=r(7976),o=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw o("Incorrect invocation")}},9670:function(e,t,r){var n=r(111),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw i(o(e)+" is not an object")}},3013:function(e){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7556:function(e,t,r){var n=r(7293);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},260:function(e,t,r){"use strict";var n,o,i,a=r(3013),s=r(9781),c=r(7854),u=r(614),l=r(111),d=r(2597),p=r(648),h=r(6330),f=r(8880),m=r(8052),g=r(7045),v=r(7976),E=r(9518),y=r(7674),_=r(5112),T=r(9711),I=r(9909),O=I.enforce,R=I.get,C=c.Int8Array,N=C&&C.prototype,S=c.Uint8ClampedArray,b=S&&S.prototype,A=C&&E(C),M=N&&E(N),w=Object.prototype,P=c.TypeError,U=_("toStringTag"),k=T("TYPED_ARRAY_TAG"),x="TypedArrayConstructor",L=a&&!!y&&"Opera"!==p(c.opera),D=!1,j={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},B={BigInt64Array:8,BigUint64Array:8},G=function(e){var t=E(e);if(l(t)){var r=R(t);return r&&d(r,x)?r[x]:G(t)}},H=function(e){if(!l(e))return!1;var t=p(e);return d(j,t)||d(B,t)};for(n in j)(i=(o=c[n])&&o.prototype)?O(i)[x]=o:L=!1;for(n in B)(i=(o=c[n])&&o.prototype)&&(O(i)[x]=o);if((!L||!u(A)||A===Function.prototype)&&(A=function(){throw P("Incorrect invocation")},L))for(n in j)c[n]&&y(c[n],A);if((!L||!M||M===w)&&(M=A.prototype,L))for(n in j)c[n]&&y(c[n].prototype,M);if(L&&E(b)!==M&&y(b,M),s&&!d(M,U))for(n in D=!0,g(M,U,{configurable:!0,get:function(){return l(this)?this[k]:void 0}}),j)c[n]&&f(c[n],k,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:D&&k,aTypedArray:function(e){if(H(e))return e;throw P("Target is not a typed array")},aTypedArrayConstructor:function(e){if(u(e)&&(!y||v(A,e)))return e;throw P(h(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(s){if(r)for(var o in j){var i=c[o];if(i&&d(i.prototype,e))try{delete i.prototype[e]}catch(r){try{i.prototype[e]=t}catch(e){}}}M[e]&&!r||m(M,e,r?t:L&&N[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,o;if(s){if(y){if(r)for(n in j)if((o=c[n])&&d(o,e))try{delete o[e]}catch(e){}if(A[e]&&!r)return;try{return m(A,e,r?t:L&&A[e]||t)}catch(e){}}for(n in j)!(o=c[n])||o[e]&&!r||m(o,e,t)}},getTypedArrayConstructor:G,isView:function(e){if(!l(e))return!1;var t=p(e);return"DataView"===t||d(j,t)||d(B,t)},isTypedArray:H,TypedArray:A,TypedArrayPrototype:M}},3331:function(e,t,r){"use strict";var n=r(7854),o=r(1702),i=r(9781),a=r(3013),s=r(6530),c=r(8880),u=r(7045),l=r(9190),d=r(7293),p=r(5787),h=r(9303),f=r(7466),m=r(7067),g=r(1179),v=r(9518),E=r(7674),y=r(8006).f,_=r(1285),T=r(1589),I=r(8003),O=r(9909),R=s.PROPER,C=s.CONFIGURABLE,N="ArrayBuffer",S="DataView",b="prototype",A="Wrong index",M=O.getterFor(N),w=O.getterFor(S),P=O.set,U=n[N],k=U,x=k&&k[b],L=n[S],D=L&&L[b],j=Object.prototype,B=n.Array,G=n.RangeError,H=o(_),F=o([].reverse),W=g.pack,K=g.unpack,q=function(e){return[255&e]},z=function(e){return[255&e,e>>8&255]},V=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},X=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},J=function(e){return W(e,23,4)},Z=function(e){return W(e,52,8)},Y=function(e,t,r){u(e[b],t,{configurable:!0,get:function(){return r(this)[t]}})},Q=function(e,t,r,n){var o=m(r),i=w(e);if(o+t>i.byteLength)throw G(A);var a=i.bytes,s=o+i.byteOffset,c=T(a,s,s+t);return n?c:F(c)},$=function(e,t,r,n,o,i){var a=m(r),s=w(e);if(a+t>s.byteLength)throw G(A);for(var c=s.bytes,u=a+s.byteOffset,l=n(+o),d=0;d<t;d++)c[u+d]=l[i?d:t-d-1]};if(a){var ee=R&&U.name!==N;if(d((function(){U(1)}))&&d((function(){new U(-1)}))&&!d((function(){return new U,new U(1.5),new U(NaN),1!=U.length||ee&&!C})))ee&&C&&c(U,"name",N);else{(k=function(e){return p(this,x),new U(m(e))})[b]=x;for(var te,re=y(U),ne=0;re.length>ne;)(te=re[ne++])in k||c(k,te,U[te]);x.constructor=k}E&&v(D)!==j&&E(D,j);var oe=new L(new k(2)),ie=o(D.setInt8);oe.setInt8(0,2147483648),oe.setInt8(1,2147483649),!oe.getInt8(0)&&oe.getInt8(1)||l(D,{setInt8:function(e,t){ie(this,e,t<<24>>24)},setUint8:function(e,t){ie(this,e,t<<24>>24)}},{unsafe:!0})}else x=(k=function(e){p(this,x);var t=m(e);P(this,{type:N,bytes:H(B(t),0),byteLength:t}),i||(this.byteLength=t,this.detached=!1)})[b],D=(L=function(e,t,r){p(this,D),p(e,x);var n=M(e),o=n.byteLength,a=h(t);if(a<0||a>o)throw G("Wrong offset");if(a+(r=void 0===r?o-a:f(r))>o)throw G("Wrong length");P(this,{type:S,buffer:e,byteLength:r,byteOffset:a,bytes:n.bytes}),i||(this.buffer=e,this.byteLength=r,this.byteOffset=a)})[b],i&&(Y(k,"byteLength",M),Y(L,"buffer",w),Y(L,"byteLength",w),Y(L,"byteOffset",w)),l(D,{getInt8:function(e){return Q(this,1,e)[0]<<24>>24},getUint8:function(e){return Q(this,1,e)[0]},getInt16:function(e){var t=Q(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Q(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return X(Q(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return X(Q(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return K(Q(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return K(Q(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){$(this,1,e,q,t)},setUint8:function(e,t){$(this,1,e,q,t)},setInt16:function(e,t){$(this,2,e,z,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){$(this,2,e,z,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){$(this,4,e,V,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){$(this,4,e,V,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){$(this,4,e,J,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){$(this,8,e,Z,t,arguments.length>2?arguments[2]:void 0)}});I(k,N),I(L,S),e.exports={ArrayBuffer:k,DataView:L}},1048:function(e,t,r){"use strict";var n=r(7908),o=r(1400),i=r(6244),a=r(5117),s=Math.min;e.exports=[].copyWithin||function(e,t){var r=n(this),c=i(r),u=o(e,c),l=o(t,c),d=arguments.length>2?arguments[2]:void 0,p=s((void 0===d?c:o(d,c))-l,c-u),h=1;for(l<u&&u<l+p&&(h=-1,l+=p-1,u+=p-1);p-- >0;)l in r?r[u]=r[l]:a(r,u),u+=h,l+=h;return r}},1285:function(e,t,r){"use strict";var n=r(7908),o=r(1400),i=r(6244);e.exports=function(e){for(var t=n(this),r=i(t),a=arguments.length,s=o(a>1?arguments[1]:void 0,r),c=a>2?arguments[2]:void 0,u=void 0===c?r:o(c,r);u>s;)t[s++]=e;return t}},8533:function(e,t,r){"use strict";var n=r(2092).forEach,o=r(9341)("forEach");e.exports=o?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},7745:function(e,t,r){var n=r(6244);e.exports=function(e,t){for(var r=0,o=n(t),i=new e(o);o>r;)i[r]=t[r++];return i}},8457:function(e,t,r){"use strict";var n=r(9974),o=r(6916),i=r(7908),a=r(3411),s=r(7659),c=r(4411),u=r(6244),l=r(6135),d=r(4121),p=r(1246),h=Array;e.exports=function(e){var t=i(e),r=c(this),f=arguments.length,m=f>1?arguments[1]:void 0,g=void 0!==m;g&&(m=n(m,f>2?arguments[2]:void 0));var v,E,y,_,T,I,O=p(t),R=0;if(!O||this===h&&s(O))for(v=u(t),E=r?new this(v):h(v);v>R;R++)I=g?m(t[R],R):t[R],l(E,R,I);else for(T=(_=d(t,O)).next,E=r?new this:[];!(y=o(T,_)).done;R++)I=g?a(_,m,[y.value,R],!0):y.value,l(E,R,I);return E.length=R,E}},1318:function(e,t,r){var n=r(5656),o=r(1400),i=r(6244),a=function(e){return function(t,r,a){var s,c=n(t),u=i(c),l=o(a,u);if(e&&r!=r){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},2092:function(e,t,r){var n=r(9974),o=r(1702),i=r(8361),a=r(7908),s=r(6244),c=r(5417),u=o([].push),l=function(e){var t=1==e,r=2==e,o=3==e,l=4==e,d=6==e,p=7==e,h=5==e||d;return function(f,m,g,v){for(var E,y,_=a(f),T=i(_),I=n(m,g),O=s(T),R=0,C=v||c,N=t?C(f,O):r||p?C(f,0):void 0;O>R;R++)if((h||R in T)&&(y=I(E=T[R],R,_),e))if(t)N[R]=y;else if(y)switch(e){case 3:return!0;case 5:return E;case 6:return R;case 2:u(N,E)}else switch(e){case 4:return!1;case 7:u(N,E)}return d?-1:o||l?l:N}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},6583:function(e,t,r){"use strict";var n=r(2104),o=r(5656),i=r(9303),a=r(6244),s=r(9341),c=Math.min,u=[].lastIndexOf,l=!!u&&1/[1].lastIndexOf(1,-0)<0,d=s("lastIndexOf"),p=l||!d;e.exports=p?function(e){if(l)return n(u,this,arguments)||0;var t=o(this),r=a(t),s=r-1;for(arguments.length>1&&(s=c(s,i(arguments[1]))),s<0&&(s=r+s);s>=0;s--)if(s in t&&t[s]===e)return s||0;return-1}:u},1194:function(e,t,r){var n=r(7293),o=r(5112),i=r(7392),a=o("species");e.exports=function(e){return i>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:function(e,t,r){"use strict";var n=r(7293);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){return 1},1)}))}},3671:function(e,t,r){var n=r(9662),o=r(7908),i=r(8361),a=r(6244),s=TypeError,c=function(e){return function(t,r,c,u){n(r);var l=o(t),d=i(l),p=a(l),h=e?p-1:0,f=e?-1:1;if(c<2)for(;;){if(h in d){u=d[h],h+=f;break}if(h+=f,e?h<0:p<=h)throw s("Reduce of empty array with no initial value")}for(;e?h>=0:p>h;h+=f)h in d&&(u=r(u,d[h],h,l));return u}};e.exports={left:c(!1),right:c(!0)}},3658:function(e,t,r){"use strict";var n=r(9781),o=r(3157),i=TypeError,a=Object.getOwnPropertyDescriptor,s=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(o(e)&&!a(e,"length").writable)throw i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},1589:function(e,t,r){var n=r(1400),o=r(6244),i=r(6135),a=Array,s=Math.max;e.exports=function(e,t,r){for(var c=o(e),u=n(t,c),l=n(void 0===r?c:r,c),d=a(s(l-u,0)),p=0;u<l;u++,p++)i(d,p,e[u]);return d.length=p,d}},206:function(e,t,r){var n=r(1702);e.exports=n([].slice)},4362:function(e,t,r){var n=r(1589),o=Math.floor,i=function(e,t){var r=e.length,c=o(r/2);return r<8?a(e,t):s(e,i(n(e,0,c),t),i(n(e,c),t),t)},a=function(e,t){for(var r,n,o=e.length,i=1;i<o;){for(n=i,r=e[i];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==i++&&(e[n]=r)}return e},s=function(e,t,r,n){for(var o=t.length,i=r.length,a=0,s=0;a<o||s<i;)e[a+s]=a<o&&s<i?n(t[a],r[s])<=0?t[a++]:r[s++]:a<o?t[a++]:r[s++];return e};e.exports=i},7475:function(e,t,r){var n=r(3157),o=r(4411),i=r(111),a=r(5112)("species"),s=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(o(t)&&(t===s||n(t.prototype))||i(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?s:t}},5417:function(e,t,r){var n=r(7475);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},3411:function(e,t,r){var n=r(9670),o=r(9212);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){o(e,"throw",t)}}},7072:function(e,t,r){var n=r(5112)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},4326:function(e,t,r){var n=r(1702),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},648:function(e,t,r){var n=r(1694),o=r(614),i=r(4326),a=r(5112)("toStringTag"),s=Object,c="Arguments"==i(function(){return arguments}());e.exports=n?i:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?r:c?i(t):"Object"==(n=i(t))&&o(t.callee)?"Arguments":n}},5631:function(e,t,r){"use strict";var n=r(30),o=r(7045),i=r(9190),a=r(9974),s=r(5787),c=r(8554),u=r(408),l=r(1656),d=r(6178),p=r(6340),h=r(9781),f=r(2423).fastKey,m=r(9909),g=m.set,v=m.getterFor;e.exports={getConstructor:function(e,t,r,l){var d=e((function(e,o){s(e,p),g(e,{type:t,index:n(null),first:void 0,last:void 0,size:0}),h||(e.size=0),c(o)||u(o,e[l],{that:e,AS_ENTRIES:r})})),p=d.prototype,m=v(t),E=function(e,t,r){var n,o,i=m(e),a=y(e,t);return a?a.value=r:(i.last=a={index:o=f(t,!0),key:t,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=a),n&&(n.next=a),h?i.size++:e.size++,"F"!==o&&(i.index[o]=a)),e},y=function(e,t){var r,n=m(e),o=f(t);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==t)return r};return i(p,{clear:function(){for(var e=m(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,h?e.size=0:this.size=0},delete:function(e){var t=this,r=m(t),n=y(t,e);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first==n&&(r.first=o),r.last==n&&(r.last=i),h?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=m(this),n=a(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!y(this,e)}}),i(p,r?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return E(this,0===e?0:e,t)}}:{add:function(e){return E(this,e=0===e?0:e,e)}}),h&&o(p,"size",{configurable:!0,get:function(){return m(this).size}}),d},setStrong:function(e,t,r){var n=t+" Iterator",o=v(t),i=v(n);l(e,t,(function(e,t){g(this,{type:n,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?d("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1):(e.target=void 0,d(void 0,!0))}),r?"entries":"values",!r,!0),p(t)}}},7710:function(e,t,r){"use strict";var n=r(2109),o=r(7854),i=r(1702),a=r(4705),s=r(8052),c=r(2423),u=r(408),l=r(5787),d=r(614),p=r(8554),h=r(111),f=r(7293),m=r(7072),g=r(8003),v=r(9587);e.exports=function(e,t,r){var E=-1!==e.indexOf("Map"),y=-1!==e.indexOf("Weak"),_=E?"set":"add",T=o[e],I=T&&T.prototype,O=T,R={},C=function(e){var t=i(I[e]);s(I,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(y&&!h(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return y&&!h(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(y&&!h(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(a(e,!d(T)||!(y||I.forEach&&!f((function(){(new T).entries().next()})))))O=r.getConstructor(t,e,E,_),c.enable();else if(a(e,!0)){var N=new O,S=N[_](y?{}:-0,1)!=N,b=f((function(){N.has(1)})),A=m((function(e){new T(e)})),M=!y&&f((function(){for(var e=new T,t=5;t--;)e[_](t,t);return!e.has(-0)}));A||((O=t((function(e,t){l(e,I);var r=v(new T,e,O);return p(t)||u(t,r[_],{that:r,AS_ENTRIES:E}),r}))).prototype=I,I.constructor=O),(b||M)&&(C("delete"),C("has"),E&&C("get")),(M||S)&&C(_),y&&I.clear&&delete I.clear}return R[e]=O,n({global:!0,constructor:!0,forced:O!=T},R),g(O,e),y||r.setStrong(O,e,E),O}},9920:function(e,t,r){var n=r(2597),o=r(3887),i=r(1236),a=r(3070);e.exports=function(e,t,r){for(var s=o(t),c=a.f,u=i.f,l=0;l<s.length;l++){var d=s[l];n(e,d)||r&&n(r,d)||c(e,d,u(t,d))}}},4964:function(e,t,r){var n=r(5112)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},8544:function(e,t,r){var n=r(7293);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},6178:function(e){e.exports=function(e,t){return{value:e,done:t}}},8880:function(e,t,r){var n=r(9781),o=r(3070),i=r(9114);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},9114:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6135:function(e,t,r){"use strict";var n=r(4948),o=r(3070),i=r(9114);e.exports=function(e,t,r){var a=n(t);a in e?o.f(e,a,i(0,r)):e[a]=r}},7045:function(e,t,r){var n=r(6339),o=r(3070);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),o.f(e,t,r)}},8052:function(e,t,r){var n=r(614),o=r(3070),i=r(6339),a=r(3072);e.exports=function(e,t,r,s){s||(s={});var c=s.enumerable,u=void 0!==s.name?s.name:t;if(n(r)&&i(r,u,s),s.global)c?e[t]=r:a(t,r);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=r:o.f(e,t,{value:r,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},9190:function(e,t,r){var n=r(8052);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},3072:function(e,t,r){var n=r(7854),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},5117:function(e,t,r){"use strict";var n=r(6330),o=TypeError;e.exports=function(e,t){if(!delete e[t])throw o("Cannot delete property "+n(t)+" of "+n(e))}},9781:function(e,t,r){var n=r(7293);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4154:function(e){var t="object"==typeof document&&document.all,r=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:r}},317:function(e,t,r){var n=r(7854),o=r(111),i=n.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},7207:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},8324:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:function(e,t,r){var n=r(317)("span").classList,o=n&&n.constructor&&n.constructor.prototype;e.exports=o===Object.prototype?void 0:o},8886:function(e,t,r){var n=r(8113).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},7871:function(e,t,r){var n=r(3823),o=r(5268);e.exports=!n&&!o&&"object"==typeof window&&"object"==typeof document},9363:function(e){e.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},3823:function(e){e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},256:function(e,t,r){var n=r(8113);e.exports=/MSIE|Trident/.test(n)},1528:function(e,t,r){var n=r(8113);e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},6833:function(e,t,r){var n=r(8113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},5268:function(e,t,r){var n=r(4326);e.exports="undefined"!=typeof process&&"process"==n(process)},1036:function(e,t,r){var n=r(8113);e.exports=/web0s(?!.*chrome)/i.test(n)},8113:function(e){e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7392:function(e,t,r){var n,o,i=r(7854),a=r(8113),s=i.process,c=i.Deno,u=s&&s.versions||c&&c.version,l=u&&u.v8;l&&(o=(n=l.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),e.exports=o},8008:function(e,t,r){var n=r(8113).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(e,t,r){var n=r(7854),o=r(1236).f,i=r(8880),a=r(8052),s=r(3072),c=r(9920),u=r(4705);e.exports=function(e,t){var r,l,d,p,h,f=e.target,m=e.global,g=e.stat;if(r=m?n:g?n[f]||s(f,{}):(n[f]||{}).prototype)for(l in t){if(p=t[l],d=e.dontCallGetSet?(h=o(r,l))&&h.value:r[l],!u(m?l:f+(g?".":"#")+l,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),a(r,l,p,e)}}},7293:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},7007:function(e,t,r){"use strict";r(4916);var n=r(1470),o=r(8052),i=r(2261),a=r(7293),s=r(5112),c=r(8880),u=s("species"),l=RegExp.prototype;e.exports=function(e,t,r,d){var p=s(e),h=!a((function(){var t={};return t[p]=function(){return 7},7!=""[e](t)})),f=h&&!a((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[u]=function(){return r},r.flags="",r[p]=/./[p]),r.exec=function(){return t=!0,null},r[p](""),!t}));if(!h||!f||r){var m=n(/./[p]),g=t(p,""[e],(function(e,t,r,o,a){var s=n(e),c=t.exec;return c===i||c===l.exec?h&&!a?{done:!0,value:m(t,r,o)}:{done:!0,value:s(r,t,o)}:{done:!1}}));o(String.prototype,e,g[0]),o(l,p,g[1])}d&&c(l[p],"sham",!0)}},6677:function(e,t,r){var n=r(7293);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},2104:function(e,t,r){var n=r(4374),o=Function.prototype,i=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},9974:function(e,t,r){var n=r(1470),o=r(9662),i=r(4374),a=n(n.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},4374:function(e,t,r){var n=r(7293);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},7065:function(e,t,r){"use strict";var n=r(1702),o=r(9662),i=r(111),a=r(2597),s=r(206),c=r(4374),u=Function,l=n([].concat),d=n([].join),p={};e.exports=c?u.bind:function(e){var t=o(this),r=t.prototype,n=s(arguments,1),c=function(){var r=l(n,s(arguments));return this instanceof c?function(e,t,r){if(!a(p,t)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";p[t]=u("C,a","return new C("+d(n,",")+")")}return p[t](e,r)}(t,r.length,r):t.apply(e,r)};return i(r)&&(c.prototype=r),c}},6916:function(e,t,r){var n=r(4374),o=Function.prototype.call;e.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},6530:function(e,t,r){var n=r(9781),o=r(2597),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,u=s&&(!n||n&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},5668:function(e,t,r){var n=r(1702),o=r(9662);e.exports=function(e,t,r){try{return n(o(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},1470:function(e,t,r){var n=r(4326),o=r(1702);e.exports=function(e){if("Function"===n(e))return o(e)}},1702:function(e,t,r){var n=r(4374),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);e.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}},5005:function(e,t,r){var n=r(7854),o=r(614);e.exports=function(e,t){return arguments.length<2?(r=n[e],o(r)?r:void 0):n[e]&&n[e][t];var r}},1246:function(e,t,r){var n=r(648),o=r(8173),i=r(8554),a=r(7497),s=r(5112)("iterator");e.exports=function(e){if(!i(e))return o(e,s)||o(e,"@@iterator")||a[n(e)]}},4121:function(e,t,r){var n=r(6916),o=r(9662),i=r(9670),a=r(6330),s=r(1246),c=TypeError;e.exports=function(e,t){var r=arguments.length<2?s(e):t;if(o(r))return i(n(r,e));throw c(a(e)+" is not iterable")}},8044:function(e,t,r){var n=r(1702),o=r(3157),i=r(614),a=r(4326),s=r(1340),c=n([].push);e.exports=function(e){if(i(e))return e;if(o(e)){for(var t=e.length,r=[],n=0;n<t;n++){var u=e[n];"string"==typeof u?c(r,u):"number"!=typeof u&&"Number"!=a(u)&&"String"!=a(u)||c(r,s(u))}var l=r.length,d=!0;return function(e,t){if(d)return d=!1,t;if(o(this))return t;for(var n=0;n<l;n++)if(r[n]===e)return t}}}},8173:function(e,t,r){var n=r(9662),o=r(8554);e.exports=function(e,t){var r=e[t];return o(r)?void 0:n(r)}},7854:function(e,t,r){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||this||Function("return this")()},2597:function(e,t,r){var n=r(1702),o=r(7908),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},3501:function(e){e.exports={}},842:function(e){e.exports=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}}},490:function(e,t,r){var n=r(5005);e.exports=n("document","documentElement")},4664:function(e,t,r){var n=r(9781),o=r(7293),i=r(317);e.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},1179:function(e){var t=Array,r=Math.abs,n=Math.pow,o=Math.floor,i=Math.log,a=Math.LN2;e.exports={pack:function(e,s,c){var u,l,d,p=t(c),h=8*c-s-1,f=(1<<h)-1,m=f>>1,g=23===s?n(2,-24)-n(2,-77):0,v=e<0||0===e&&1/e<0?1:0,E=0;for((e=r(e))!=e||e===1/0?(l=e!=e?1:0,u=f):(u=o(i(e)/a),e*(d=n(2,-u))<1&&(u--,d*=2),(e+=u+m>=1?g/d:g*n(2,1-m))*d>=2&&(u++,d/=2),u+m>=f?(l=0,u=f):u+m>=1?(l=(e*d-1)*n(2,s),u+=m):(l=e*n(2,m-1)*n(2,s),u=0));s>=8;)p[E++]=255&l,l/=256,s-=8;for(u=u<<s|l,h+=s;h>0;)p[E++]=255&u,u/=256,h-=8;return p[--E]|=128*v,p},unpack:function(e,t){var r,o=e.length,i=8*o-t-1,a=(1<<i)-1,s=a>>1,c=i-7,u=o-1,l=e[u--],d=127&l;for(l>>=7;c>0;)d=256*d+e[u--],c-=8;for(r=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)r=256*r+e[u--],c-=8;if(0===d)d=1-s;else{if(d===a)return r?NaN:l?-1/0:1/0;r+=n(2,t),d-=s}return(l?-1:1)*r*n(2,d-t)}}},8361:function(e,t,r){var n=r(1702),o=r(7293),i=r(4326),a=Object,s=n("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?s(e,""):a(e)}:a},9587:function(e,t,r){var n=r(614),o=r(111),i=r(7674);e.exports=function(e,t,r){var a,s;return i&&n(a=t.constructor)&&a!==r&&o(s=a.prototype)&&s!==r.prototype&&i(e,s),e}},2788:function(e,t,r){var n=r(1702),o=r(614),i=r(5465),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},2423:function(e,t,r){var n=r(2109),o=r(1702),i=r(3501),a=r(111),s=r(2597),c=r(3070).f,u=r(8006),l=r(1156),d=r(2050),p=r(9711),h=r(6677),f=!1,m=p("meta"),g=0,v=function(e){c(e,m,{value:{objectID:"O"+g++,weakData:{}}})},E=e.exports={enable:function(){E.enable=function(){},f=!0;var e=u.f,t=o([].splice),r={};r[m]=1,e(r).length&&(u.f=function(r){for(var n=e(r),o=0,i=n.length;o<i;o++)if(n[o]===m){t(n,o,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,m)){if(!d(e))return"F";if(!t)return"E";v(e)}return e[m].objectID},getWeakData:function(e,t){if(!s(e,m)){if(!d(e))return!0;if(!t)return!1;v(e)}return e[m].weakData},onFreeze:function(e){return h&&f&&d(e)&&!s(e,m)&&v(e),e}};i[m]=!0},9909:function(e,t,r){var n,o,i,a=r(4811),s=r(7854),c=r(111),u=r(8880),l=r(2597),d=r(5465),p=r(6200),h=r(3501),f="Object already initialized",m=s.TypeError,g=s.WeakMap;if(a||d.state){var v=d.state||(d.state=new g);v.get=v.get,v.has=v.has,v.set=v.set,n=function(e,t){if(v.has(e))throw m(f);return t.facade=e,v.set(e,t),t},o=function(e){return v.get(e)||{}},i=function(e){return v.has(e)}}else{var E=p("state");h[E]=!0,n=function(e,t){if(l(e,E))throw m(f);return t.facade=e,u(e,E,t),t},o=function(e){return l(e,E)?e[E]:{}},i=function(e){return l(e,E)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=o(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return r}}}},7659:function(e,t,r){var n=r(5112),o=r(7497),i=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},3157:function(e,t,r){var n=r(4326);e.exports=Array.isArray||function(e){return"Array"==n(e)}},4067:function(e,t,r){var n=r(648);e.exports=function(e){var t=n(e);return"BigInt64Array"==t||"BigUint64Array"==t}},614:function(e,t,r){var n=r(4154),o=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===o}:function(e){return"function"==typeof e}},4411:function(e,t,r){var n=r(1702),o=r(7293),i=r(614),a=r(648),s=r(5005),c=r(2788),u=function(){},l=[],d=s("Reflect","construct"),p=/^\s*(?:class|function)\b/,h=n(p.exec),f=!p.exec(u),m=function(e){if(!i(e))return!1;try{return d(u,l,e),!0}catch(e){return!1}},g=function(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!h(p,c(e))}catch(e){return!0}};g.sham=!0,e.exports=!d||o((function(){var e;return m(m.call)||!m(Object)||!m((function(){e=!0}))||e}))?g:m},4705:function(e,t,r){var n=r(7293),o=r(614),i=/#|\.prototype\./,a=function(e,t){var r=c[s(e)];return r==l||r!=u&&(o(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=a.data={},u=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},5988:function(e,t,r){var n=r(111),o=Math.floor;e.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&o(e)===e}},8554:function(e){e.exports=function(e){return null==e}},111:function(e,t,r){var n=r(614),o=r(4154),i=o.all;e.exports=o.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===i}:function(e){return"object"==typeof e?null!==e:n(e)}},1913:function(e){e.exports=!1},7850:function(e,t,r){var n=r(111),o=r(4326),i=r(5112)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},2190:function(e,t,r){var n=r(5005),o=r(614),i=r(7976),a=r(3307),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return o(t)&&i(t.prototype,s(e))}},408:function(e,t,r){var n=r(9974),o=r(6916),i=r(9670),a=r(6330),s=r(7659),c=r(6244),u=r(7976),l=r(4121),d=r(1246),p=r(9212),h=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,r){var g,v,E,y,_,T,I,O=r&&r.that,R=!(!r||!r.AS_ENTRIES),C=!(!r||!r.IS_RECORD),N=!(!r||!r.IS_ITERATOR),S=!(!r||!r.INTERRUPTED),b=n(t,O),A=function(e){return g&&p(g,"normal",e),new f(!0,e)},M=function(e){return R?(i(e),S?b(e[0],e[1],A):b(e[0],e[1])):S?b(e,A):b(e)};if(C)g=e.iterator;else if(N)g=e;else{if(!(v=d(e)))throw h(a(e)+" is not iterable");if(s(v)){for(E=0,y=c(e);y>E;E++)if((_=M(e[E]))&&u(m,_))return _;return new f(!1)}g=l(e,v)}for(T=C?e.next:g.next;!(I=o(T,g)).done;){try{_=M(I.value)}catch(e){p(g,"throw",e)}if("object"==typeof _&&_&&u(m,_))return _}return new f(!1)}},9212:function(e,t,r){var n=r(6916),o=r(9670),i=r(8173);e.exports=function(e,t,r){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw r;if(s)throw a;return o(a),r}},3061:function(e,t,r){"use strict";var n=r(3383).IteratorPrototype,o=r(30),i=r(9114),a=r(8003),s=r(7497),c=function(){return this};e.exports=function(e,t,r,u){var l=t+" Iterator";return e.prototype=o(n,{next:i(+!u,r)}),a(e,l,!1,!0),s[l]=c,e}},1656:function(e,t,r){"use strict";var n=r(2109),o=r(6916),i=r(1913),a=r(6530),s=r(614),c=r(3061),u=r(9518),l=r(7674),d=r(8003),p=r(8880),h=r(8052),f=r(5112),m=r(7497),g=r(3383),v=a.PROPER,E=a.CONFIGURABLE,y=g.IteratorPrototype,_=g.BUGGY_SAFARI_ITERATORS,T=f("iterator"),I="keys",O="values",R="entries",C=function(){return this};e.exports=function(e,t,r,a,f,g,N){c(r,t,a);var S,b,A,M=function(e){if(e===f&&x)return x;if(!_&&e in U)return U[e];switch(e){case I:case O:case R:return function(){return new r(this,e)}}return function(){return new r(this)}},w=t+" Iterator",P=!1,U=e.prototype,k=U[T]||U["@@iterator"]||f&&U[f],x=!_&&k||M(f),L="Array"==t&&U.entries||k;if(L&&(S=u(L.call(new e)))!==Object.prototype&&S.next&&(i||u(S)===y||(l?l(S,y):s(S[T])||h(S,T,C)),d(S,w,!0,!0),i&&(m[w]=C)),v&&f==O&&k&&k.name!==O&&(!i&&E?p(U,"name",O):(P=!0,x=function(){return o(k,this)})),f)if(b={values:M(O),keys:g?x:M(I),entries:M(R)},N)for(A in b)(_||P||!(A in U))&&h(U,A,b[A]);else n({target:t,proto:!0,forced:_||P},b);return i&&!N||U[T]===x||h(U,T,x,{name:f}),m[t]=x,b}},3383:function(e,t,r){"use strict";var n,o,i,a=r(7293),s=r(614),c=r(111),u=r(30),l=r(9518),d=r(8052),p=r(5112),h=r(1913),f=p("iterator"),m=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(n=o):m=!0),!c(n)||a((function(){var e={};return n[f].call(e)!==e}))?n={}:h&&(n=u(n)),s(n[f])||d(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},7497:function(e){e.exports={}},6244:function(e,t,r){var n=r(7466);e.exports=function(e){return n(e.length)}},6339:function(e,t,r){var n=r(1702),o=r(7293),i=r(614),a=r(2597),s=r(9781),c=r(6530).CONFIGURABLE,u=r(2788),l=r(9909),d=l.enforce,p=l.get,h=String,f=Object.defineProperty,m=n("".slice),g=n("".replace),v=n([].join),E=s&&!o((function(){return 8!==f((function(){}),"length",{value:8}).length})),y=String(String).split("String"),_=e.exports=function(e,t,r){"Symbol("===m(h(t),0,7)&&(t="["+g(h(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!a(e,"name")||c&&e.name!==t)&&(s?f(e,"name",{value:t,configurable:!0}):e.name=t),E&&r&&a(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=d(e);return a(n,"source")||(n.source=v(y,"string"==typeof t?t:"")),e};Function.prototype.toString=_((function(){return i(this)&&p(this).source||u(this)}),"toString")},4758:function(e){var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},5948:function(e,t,r){var n,o,i,a,s,c=r(7854),u=r(9974),l=r(1236).f,d=r(261).set,p=r(8572),h=r(6833),f=r(1528),m=r(1036),g=r(5268),v=c.MutationObserver||c.WebKitMutationObserver,E=c.document,y=c.process,_=c.Promise,T=l(c,"queueMicrotask"),I=T&&T.value;if(!I){var O=new p,R=function(){var e,t;for(g&&(e=y.domain)&&e.exit();t=O.get();)try{t()}catch(e){throw O.head&&n(),e}e&&e.enter()};h||g||m||!v||!E?!f&&_&&_.resolve?((a=_.resolve(void 0)).constructor=_,s=u(a.then,a),n=function(){s(R)}):g?n=function(){y.nextTick(R)}:(d=u(d,c),n=function(){d(R)}):(o=!0,i=E.createTextNode(""),new v(R).observe(i,{characterData:!0}),n=function(){i.data=o=!o}),I=function(e){O.head||n(),O.add(e)}}e.exports=I},8523:function(e,t,r){"use strict";var n=r(9662),o=TypeError,i=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw o("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new i(e)}},3929:function(e,t,r){var n=r(7850),o=TypeError;e.exports=function(e){if(n(e))throw o("The method doesn't accept regular expressions");return e}},1574:function(e,t,r){"use strict";var n=r(9781),o=r(1702),i=r(6916),a=r(7293),s=r(1956),c=r(5181),u=r(5296),l=r(7908),d=r(8361),p=Object.assign,h=Object.defineProperty,f=o([].concat);e.exports=!p||a((function(){if(n&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),o="abcdefghijklmnopqrst";return e[r]=7,o.split("").forEach((function(e){t[e]=e})),7!=p({},e)[r]||s(p({},t)).join("")!=o}))?function(e,t){for(var r=l(e),o=arguments.length,a=1,p=c.f,h=u.f;o>a;)for(var m,g=d(arguments[a++]),v=p?f(s(g),p(g)):s(g),E=v.length,y=0;E>y;)m=v[y++],n&&!i(h,g,m)||(r[m]=g[m]);return r}:p},30:function(e,t,r){var n,o=r(9670),i=r(6048),a=r(748),s=r(3501),c=r(490),u=r(317),l=r(6200),d="prototype",p="script",h=l("IE_PROTO"),f=function(){},m=function(e){return"<"+p+">"+e+"</"+p+">"},g=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;v="undefined"!=typeof document?document.domain&&n?g(n):(t=u("iframe"),r="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):g(n);for(var o=a.length;o--;)delete v[d][a[o]];return v()};s[h]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[d]=o(e),r=new f,f[d]=null,r[h]=e):r=v(),void 0===t?r:i.f(r,t)}},6048:function(e,t,r){var n=r(9781),o=r(3353),i=r(3070),a=r(9670),s=r(5656),c=r(1956);t.f=n&&!o?Object.defineProperties:function(e,t){a(e);for(var r,n=s(t),o=c(t),u=o.length,l=0;u>l;)i.f(e,r=o[l++],n[r]);return e}},3070:function(e,t,r){var n=r(9781),o=r(4664),i=r(3353),a=r(9670),s=r(4948),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",h="writable";t.f=n?i?function(e,t,r){if(a(e),t=s(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&h in r&&!r[h]){var n=l(e,t);n&&n[h]&&(e[t]=r.value,r={configurable:p in r?r[p]:n[p],enumerable:d in r?r[d]:n[d],writable:!1})}return u(e,t,r)}:u:function(e,t,r){if(a(e),t=s(t),a(r),o)try{return u(e,t,r)}catch(e){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},1236:function(e,t,r){var n=r(9781),o=r(6916),i=r(5296),a=r(9114),s=r(5656),c=r(4948),u=r(2597),l=r(4664),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=s(e),t=c(t),l)try{return d(e,t)}catch(e){}if(u(e,t))return a(!o(i.f,e,t),e[t])}},1156:function(e,t,r){var n=r(4326),o=r(5656),i=r(8006).f,a=r(1589),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"==n(e)?function(e){try{return i(e)}catch(e){return a(s)}}(e):i(o(e))}},8006:function(e,t,r){var n=r(6324),o=r(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},5181:function(e,t){t.f=Object.getOwnPropertySymbols},9518:function(e,t,r){var n=r(2597),o=r(614),i=r(7908),a=r(6200),s=r(8544),c=a("IE_PROTO"),u=Object,l=u.prototype;e.exports=s?u.getPrototypeOf:function(e){var t=i(e);if(n(t,c))return t[c];var r=t.constructor;return o(r)&&t instanceof r?r.prototype:t instanceof u?l:null}},2050:function(e,t,r){var n=r(7293),o=r(111),i=r(4326),a=r(7556),s=Object.isExtensible,c=n((function(){s(1)}));e.exports=c||a?function(e){return!!o(e)&&(!a||"ArrayBuffer"!=i(e))&&(!s||s(e))}:s},7976:function(e,t,r){var n=r(1702);e.exports=n({}.isPrototypeOf)},6324:function(e,t,r){var n=r(1702),o=r(2597),i=r(5656),a=r(1318).indexOf,s=r(3501),c=n([].push);e.exports=function(e,t){var r,n=i(e),u=0,l=[];for(r in n)!o(s,r)&&o(n,r)&&c(l,r);for(;t.length>u;)o(n,r=t[u++])&&(~a(l,r)||c(l,r));return l}},1956:function(e,t,r){var n=r(6324),o=r(748);e.exports=Object.keys||function(e){return n(e,o)}},5296:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},7674:function(e,t,r){var n=r(5668),o=r(9670),i=r(6077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return o(r),i(n),t?e(r,n):r.__proto__=n,r}}():void 0)},4699:function(e,t,r){var n=r(9781),o=r(1702),i=r(1956),a=r(5656),s=o(r(5296).f),c=o([].push),u=function(e){return function(t){for(var r,o=a(t),u=i(o),l=u.length,d=0,p=[];l>d;)r=u[d++],n&&!s(o,r)||c(p,e?[r,o[r]]:o[r]);return p}};e.exports={entries:u(!0),values:u(!1)}},288:function(e,t,r){"use strict";var n=r(1694),o=r(648);e.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},2140:function(e,t,r){var n=r(6916),o=r(614),i=r(111),a=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&o(r=e.toString)&&!i(s=n(r,e)))return s;if(o(r=e.valueOf)&&!i(s=n(r,e)))return s;if("string"!==t&&o(r=e.toString)&&!i(s=n(r,e)))return s;throw a("Can't convert object to primitive value")}},3887:function(e,t,r){var n=r(5005),o=r(1702),i=r(8006),a=r(5181),s=r(9670),c=o([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),r=a.f;return r?c(t,r(e)):t}},857:function(e,t,r){var n=r(7854);e.exports=n},2534:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},3702:function(e,t,r){var n=r(7854),o=r(2492),i=r(614),a=r(4705),s=r(2788),c=r(5112),u=r(7871),l=r(3823),d=r(1913),p=r(7392),h=o&&o.prototype,f=c("species"),m=!1,g=i(n.PromiseRejectionEvent),v=a("Promise",(function(){var e=s(o),t=e!==String(o);if(!t&&66===p)return!0;if(d&&(!h.catch||!h.finally))return!0;if(!p||p<51||!/native code/.test(e)){var r=new o((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[f]=n,!(m=r.then((function(){}))instanceof n))return!0}return!t&&(u||l)&&!g}));e.exports={CONSTRUCTOR:v,REJECTION_EVENT:g,SUBCLASSING:m}},2492:function(e,t,r){var n=r(7854);e.exports=n.Promise},9478:function(e,t,r){var n=r(9670),o=r(111),i=r(8523);e.exports=function(e,t){if(n(e),o(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},612:function(e,t,r){var n=r(2492),o=r(7072),i=r(3702).CONSTRUCTOR;e.exports=i||!o((function(e){n.all(e).then(void 0,(function(){}))}))},8572:function(e){var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},7651:function(e,t,r){var n=r(6916),o=r(9670),i=r(614),a=r(4326),s=r(2261),c=TypeError;e.exports=function(e,t){var r=e.exec;if(i(r)){var u=n(r,e,t);return null!==u&&o(u),u}if("RegExp"===a(e))return n(s,e,t);throw c("RegExp#exec called on incompatible receiver")}},2261:function(e,t,r){"use strict";var n,o,i=r(6916),a=r(1702),s=r(1340),c=r(7066),u=r(2999),l=r(2309),d=r(30),p=r(9909).get,h=r(9441),f=r(7168),m=l("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,v=g,E=a("".charAt),y=a("".indexOf),_=a("".replace),T=a("".slice),I=(o=/b*/g,i(g,n=/a/,"a"),i(g,o,"a"),0!==n.lastIndex||0!==o.lastIndex),O=u.BROKEN_CARET,R=void 0!==/()??/.exec("")[1];(I||R||O||h||f)&&(v=function(e){var t,r,n,o,a,u,l,h=this,f=p(h),C=s(e),N=f.raw;if(N)return N.lastIndex=h.lastIndex,t=i(v,N,C),h.lastIndex=N.lastIndex,t;var S=f.groups,b=O&&h.sticky,A=i(c,h),M=h.source,w=0,P=C;if(b&&(A=_(A,"y",""),-1===y(A,"g")&&(A+="g"),P=T(C,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==E(C,h.lastIndex-1))&&(M="(?: "+M+")",P=" "+P,w++),r=new RegExp("^(?:"+M+")",A)),R&&(r=new RegExp("^"+M+"$(?!\\s)",A)),I&&(n=h.lastIndex),o=i(g,b?r:h,P),b?o?(o.input=T(o.input,w),o[0]=T(o[0],w),o.index=h.lastIndex,h.lastIndex+=o[0].length):h.lastIndex=0:I&&o&&(h.lastIndex=h.global?o.index+o[0].length:n),R&&o&&o.length>1&&i(m,o[0],r,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(o[a]=void 0)})),o&&S)for(o.groups=u=d(null),a=0;a<S.length;a++)u[(l=S[a])[0]]=o[l[1]];return o}),e.exports=v},7066:function(e,t,r){"use strict";var n=r(9670);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},4706:function(e,t,r){var n=r(6916),o=r(2597),i=r(7976),a=r(7066),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||o(e,"flags")||!i(s,e)?t:n(a,e)}},2999:function(e,t,r){var n=r(7293),o=r(7854).RegExp,i=n((function(){var e=o("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),a=i||n((function(){return!o("a","y").sticky})),s=i||n((function(){var e=o("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:i}},9441:function(e,t,r){var n=r(7293),o=r(7854).RegExp;e.exports=n((function(){var e=o(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},7168:function(e,t,r){var n=r(7293),o=r(7854).RegExp;e.exports=n((function(){var e=o("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},4488:function(e,t,r){var n=r(8554),o=TypeError;e.exports=function(e){if(n(e))throw o("Can't call method on "+e);return e}},7152:function(e,t,r){"use strict";var n,o=r(7854),i=r(2104),a=r(614),s=r(9363),c=r(8113),u=r(206),l=r(8053),d=o.Function,p=/MSIE .\./.test(c)||s&&((n=o.Bun.version.split(".")).length<3||0==n[0]&&(n[1]<3||3==n[1]&&0==n[2]));e.exports=function(e,t){var r=t?2:1;return p?function(n,o){var s=l(arguments.length,1)>r,c=a(n)?n:d(n),p=s?u(arguments,r):[],h=s?function(){i(c,this,p)}:c;return t?e(h,o):e(h)}:e}},6340:function(e,t,r){"use strict";var n=r(5005),o=r(7045),i=r(5112),a=r(9781),s=i("species");e.exports=function(e){var t=n(e);a&&t&&!t[s]&&o(t,s,{configurable:!0,get:function(){return this}})}},8003:function(e,t,r){var n=r(3070).f,o=r(2597),i=r(5112)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!o(e,i)&&n(e,i,{configurable:!0,value:t})}},6200:function(e,t,r){var n=r(2309),o=r(9711),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},5465:function(e,t,r){var n=r(7854),o=r(3072),i="__core-js_shared__",a=n[i]||o(i,{});e.exports=a},2309:function(e,t,r){var n=r(1913),o=r(5465);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:function(e,t,r){var n=r(9670),o=r(9483),i=r(8554),a=r(5112)("species");e.exports=function(e,t){var r,s=n(e).constructor;return void 0===s||i(r=n(s)[a])?t:o(r)}},8710:function(e,t,r){var n=r(1702),o=r(9303),i=r(1340),a=r(4488),s=n("".charAt),c=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,r){var n,l,d=i(a(t)),p=o(r),h=d.length;return p<0||p>=h?e?"":void 0:(n=c(d,p))<55296||n>56319||p+1===h||(l=c(d,p+1))<56320||l>57343?e?s(d,p):n:e?u(d,p,p+2):l-56320+(n-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},3197:function(e,t,r){var n=r(1702),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",c=RangeError,u=n(a.exec),l=Math.floor,d=String.fromCharCode,p=n("".charCodeAt),h=n([].join),f=n([].push),m=n("".replace),g=n("".split),v=n("".toLowerCase),E=function(e){return e+22+75*(e<26)},y=function(e,t,r){var n=0;for(e=r?l(e/700):e>>1,e+=l(e/t);e>455;)e=l(e/35),n+=36;return l(n+36*e/(e+38))},_=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=p(e,r++);if(o>=55296&&o<=56319&&r<n){var i=p(e,r++);56320==(64512&i)?f(t,((1023&o)<<10)+(1023&i)+65536):(f(t,o),r--)}else f(t,o)}return t}(e);var r,n,i=e.length,a=128,u=0,m=72;for(r=0;r<e.length;r++)(n=e[r])<128&&f(t,d(n));var g=t.length,v=g;for(g&&f(t,"-");v<i;){var _=o;for(r=0;r<e.length;r++)(n=e[r])>=a&&n<_&&(_=n);var T=v+1;if(_-a>l((o-u)/T))throw c(s);for(u+=(_-a)*T,a=_,r=0;r<e.length;r++){if((n=e[r])<a&&++u>o)throw c(s);if(n==a){for(var I=u,O=36;;){var R=O<=m?1:O>=m+26?26:O-m;if(I<R)break;var C=I-R,N=36-R;f(t,d(E(R+C%N))),I=l(C/N),O+=36}f(t,d(E(I))),m=y(u,T,v==g),u=0,v++}}u++,a++}return h(t,"")};e.exports=function(e){var t,r,n=[],o=g(m(v(e),a,"."),".");for(t=0;t<o.length;t++)r=o[t],f(n,u(i,r)?"xn--"+_(r):r);return h(n,".")}},8415:function(e,t,r){"use strict";var n=r(9303),o=r(1340),i=r(4488),a=RangeError;e.exports=function(e){var t=o(i(this)),r="",s=n(e);if(s<0||s==1/0)throw a("Wrong number of repetitions");for(;s>0;(s>>>=1)&&(t+=t))1&s&&(r+=t);return r}},3111:function(e,t,r){var n=r(1702),o=r(4488),i=r(1340),a=r(1361),s=n("".replace),c=RegExp("^["+a+"]+"),u=RegExp("(^|[^"+a+"])["+a+"]+$"),l=function(e){return function(t){var r=i(o(t));return 1&e&&(r=s(r,c,"")),2&e&&(r=s(r,u,"$1")),r}};e.exports={start:l(1),end:l(2),trim:l(3)}},6293:function(e,t,r){var n=r(7392),o=r(7293),i=r(7854).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},6532:function(e,t,r){var n=r(6916),o=r(5005),i=r(5112),a=r(8052);e.exports=function(){var e=o("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,s=i("toPrimitive");t&&!t[s]&&a(t,s,(function(e){return n(r,this)}),{arity:1})}},2015:function(e,t,r){var n=r(6293);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},261:function(e,t,r){var n,o,i,a,s=r(7854),c=r(2104),u=r(9974),l=r(614),d=r(2597),p=r(7293),h=r(490),f=r(206),m=r(317),g=r(8053),v=r(6833),E=r(5268),y=s.setImmediate,_=s.clearImmediate,T=s.process,I=s.Dispatch,O=s.Function,R=s.MessageChannel,C=s.String,N=0,S={},b="onreadystatechange";p((function(){n=s.location}));var A=function(e){if(d(S,e)){var t=S[e];delete S[e],t()}},M=function(e){return function(){A(e)}},w=function(e){A(e.data)},P=function(e){s.postMessage(C(e),n.protocol+"//"+n.host)};y&&_||(y=function(e){g(arguments.length,1);var t=l(e)?e:O(e),r=f(arguments,1);return S[++N]=function(){c(t,void 0,r)},o(N),N},_=function(e){delete S[e]},E?o=function(e){T.nextTick(M(e))}:I&&I.now?o=function(e){I.now(M(e))}:R&&!v?(a=(i=new R).port2,i.port1.onmessage=w,o=u(a.postMessage,a)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!p(P)?(o=P,s.addEventListener("message",w,!1)):o=b in m("script")?function(e){h.appendChild(m("script"))[b]=function(){h.removeChild(this),A(e)}}:function(e){setTimeout(M(e),0)}),e.exports={set:y,clear:_}},863:function(e,t,r){var n=r(1702);e.exports=n(1..valueOf)},1400:function(e,t,r){var n=r(9303),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},4599:function(e,t,r){var n=r(7593),o=TypeError;e.exports=function(e){var t=n(e,"number");if("number"==typeof t)throw o("Can't convert number to bigint");return BigInt(t)}},7067:function(e,t,r){var n=r(9303),o=r(7466),i=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=n(e),r=o(t);if(t!==r)throw i("Wrong length or index");return r}},5656:function(e,t,r){var n=r(8361),o=r(4488);e.exports=function(e){return n(o(e))}},9303:function(e,t,r){var n=r(4758);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},7466:function(e,t,r){var n=r(9303),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},7908:function(e,t,r){var n=r(4488),o=Object;e.exports=function(e){return o(n(e))}},4590:function(e,t,r){var n=r(3002),o=RangeError;e.exports=function(e,t){var r=n(e);if(r%t)throw o("Wrong offset");return r}},3002:function(e,t,r){var n=r(9303),o=RangeError;e.exports=function(e){var t=n(e);if(t<0)throw o("The argument can't be less than 0");return t}},7593:function(e,t,r){var n=r(6916),o=r(111),i=r(2190),a=r(8173),s=r(2140),c=r(5112),u=TypeError,l=c("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var r,c=a(e,l);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!o(r)||i(r))return r;throw u("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},4948:function(e,t,r){var n=r(7593),o=r(2190);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},1694:function(e,t,r){var n={};n[r(5112)("toStringTag")]="z",e.exports="[object z]"===String(n)},1340:function(e,t,r){var n=r(648),o=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},6330:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},9843:function(e,t,r){"use strict";var n=r(2109),o=r(7854),i=r(6916),a=r(9781),s=r(3832),c=r(260),u=r(3331),l=r(5787),d=r(9114),p=r(8880),h=r(5988),f=r(7466),m=r(7067),g=r(4590),v=r(4948),E=r(2597),y=r(648),_=r(111),T=r(2190),I=r(30),O=r(7976),R=r(7674),C=r(8006).f,N=r(7321),S=r(2092).forEach,b=r(6340),A=r(7045),M=r(3070),w=r(1236),P=r(9909),U=r(9587),k=P.get,x=P.set,L=P.enforce,D=M.f,j=w.f,B=Math.round,G=o.RangeError,H=u.ArrayBuffer,F=H.prototype,W=u.DataView,K=c.NATIVE_ARRAY_BUFFER_VIEWS,q=c.TYPED_ARRAY_TAG,z=c.TypedArray,V=c.TypedArrayPrototype,X=c.aTypedArrayConstructor,J=c.isTypedArray,Z="BYTES_PER_ELEMENT",Y="Wrong length",Q=function(e,t){X(e);for(var r=0,n=t.length,o=new e(n);n>r;)o[r]=t[r++];return o},$=function(e,t){A(e,t,{configurable:!0,get:function(){return k(this)[t]}})},ee=function(e){var t;return O(F,e)||"ArrayBuffer"==(t=y(e))||"SharedArrayBuffer"==t},te=function(e,t){return J(e)&&!T(t)&&t in e&&h(+t)&&t>=0},re=function(e,t){return t=v(t),te(e,t)?d(2,e[t]):j(e,t)},ne=function(e,t,r){return t=v(t),!(te(e,t)&&_(r)&&E(r,"value"))||E(r,"get")||E(r,"set")||r.configurable||E(r,"writable")&&!r.writable||E(r,"enumerable")&&!r.enumerable?D(e,t,r):(e[t]=r.value,e)};a?(K||(w.f=re,M.f=ne,$(V,"buffer"),$(V,"byteOffset"),$(V,"byteLength"),$(V,"length")),n({target:"Object",stat:!0,forced:!K},{getOwnPropertyDescriptor:re,defineProperty:ne}),e.exports=function(e,t,r){var a=e.match(/\d+/)[0]/8,c=e+(r?"Clamped":"")+"Array",u="get"+e,d="set"+e,h=o[c],v=h,E=v&&v.prototype,y={},T=function(e,t){D(e,t,{get:function(){return function(e,t){var r=k(e);return r.view[u](t*a+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var o=k(e);r&&(n=(n=B(n))<0?0:n>255?255:255&n),o.view[d](t*a+o.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};K?s&&(v=t((function(e,t,r,n){return l(e,E),U(_(t)?ee(t)?void 0!==n?new h(t,g(r,a),n):void 0!==r?new h(t,g(r,a)):new h(t):J(t)?Q(v,t):i(N,v,t):new h(m(t)),e,v)})),R&&R(v,z),S(C(h),(function(e){e in v||p(v,e,h[e])})),v.prototype=E):(v=t((function(e,t,r,n){l(e,E);var o,s,c,u=0,d=0;if(_(t)){if(!ee(t))return J(t)?Q(v,t):i(N,v,t);o=t,d=g(r,a);var p=t.byteLength;if(void 0===n){if(p%a)throw G(Y);if((s=p-d)<0)throw G(Y)}else if((s=f(n)*a)+d>p)throw G(Y);c=s/a}else c=m(t),o=new H(s=c*a);for(x(e,{buffer:o,byteOffset:d,byteLength:s,length:c,view:new W(o)});u<c;)T(e,u++)})),R&&R(v,z),E=v.prototype=I(V)),E.constructor!==v&&p(E,"constructor",v),L(E).TypedArrayConstructor=v,q&&p(E,q,c);var O=v!=h;y[c]=v,n({global:!0,constructor:!0,forced:O,sham:!K},y),Z in v||p(v,Z,a),Z in E||p(E,Z,a),b(c)}):e.exports=function(){}},3832:function(e,t,r){var n=r(7854),o=r(7293),i=r(7072),a=r(260).NATIVE_ARRAY_BUFFER_VIEWS,s=n.ArrayBuffer,c=n.Int8Array;e.exports=!a||!o((function(){c(1)}))||!o((function(){new c(-1)}))||!i((function(e){new c,new c(null),new c(1.5),new c(e)}),!0)||o((function(){return 1!==new c(new s(2),1,void 0).length}))},3074:function(e,t,r){var n=r(7745),o=r(6304);e.exports=function(e,t){return n(o(e),t)}},7321:function(e,t,r){var n=r(9974),o=r(6916),i=r(9483),a=r(7908),s=r(6244),c=r(4121),u=r(1246),l=r(7659),d=r(4067),p=r(260).aTypedArrayConstructor,h=r(4599);e.exports=function(e){var t,r,f,m,g,v,E,y,_=i(this),T=a(e),I=arguments.length,O=I>1?arguments[1]:void 0,R=void 0!==O,C=u(T);if(C&&!l(C))for(y=(E=c(T,C)).next,T=[];!(v=o(y,E)).done;)T.push(v.value);for(R&&I>2&&(O=n(O,arguments[2])),r=s(T),f=new(p(_))(r),m=d(f),t=0;r>t;t++)g=R?O(T[t],t):T[t],f[t]=m?h(g):+g;return f}},6304:function(e,t,r){var n=r(260),o=r(6707),i=n.aTypedArrayConstructor,a=n.getTypedArrayConstructor;e.exports=function(e){return i(o(e,a(e)))}},9711:function(e,t,r){var n=r(1702),o=0,i=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},5143:function(e,t,r){var n=r(7293),o=r(5112),i=r(9781),a=r(1913),s=o("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),a&&!e.toJSON||!t.size&&(a||!i)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host}))},3307:function(e,t,r){var n=r(6293);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(e,t,r){var n=r(9781),o=r(7293);e.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8053:function(e){var t=TypeError;e.exports=function(e,r){if(e<r)throw t("Not enough arguments");return e}},4811:function(e,t,r){var n=r(7854),o=r(614),i=n.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},6800:function(e,t,r){var n=r(857),o=r(2597),i=r(6061),a=r(3070).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},6061:function(e,t,r){var n=r(5112);t.f=n},5112:function(e,t,r){var n=r(7854),o=r(2309),i=r(2597),a=r(9711),s=r(6293),c=r(3307),u=n.Symbol,l=o("wks"),d=c?u.for||u:u&&u.withoutSetter||a;e.exports=function(e){return i(l,e)||(l[e]=s&&i(u,e)?u[e]:d("Symbol."+e)),l[e]}},1361:function(e){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},9575:function(e,t,r){"use strict";var n=r(2109),o=r(1470),i=r(7293),a=r(3331),s=r(9670),c=r(1400),u=r(7466),l=r(6707),d=a.ArrayBuffer,p=a.DataView,h=p.prototype,f=o(d.prototype.slice),m=o(h.getUint8),g=o(h.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:i((function(){return!new d(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(f&&void 0===t)return f(s(this),e);for(var r=s(this).byteLength,n=c(e,r),o=c(void 0===t?r:t,r),i=new(l(this,d))(u(o-n)),a=new p(this),h=new p(i),v=0;n<o;)g(h,v++,m(a,n++));return i}})},2222:function(e,t,r){"use strict";var n=r(2109),o=r(7293),i=r(3157),a=r(111),s=r(7908),c=r(6244),u=r(7207),l=r(6135),d=r(5417),p=r(1194),h=r(5112),f=r(7392),m=h("isConcatSpreadable"),g=f>=51||!o((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),v=function(e){if(!a(e))return!1;var t=e[m];return void 0!==t?!!t:i(e)};n({target:"Array",proto:!0,arity:1,forced:!g||!p("concat")},{concat:function(e){var t,r,n,o,i,a=s(this),p=d(a,0),h=0;for(t=-1,n=arguments.length;t<n;t++)if(v(i=-1===t?a:arguments[t]))for(o=c(i),u(h+o),r=0;r<o;r++,h++)r in i&&l(p,h,i[r]);else u(h+1),l(p,h++,i);return p.length=h,p}})},7327:function(e,t,r){"use strict";var n=r(2109),o=r(2092).filter;n({target:"Array",proto:!0,forced:!r(1194)("filter")},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},4553:function(e,t,r){"use strict";var n=r(2109),o=r(2092).findIndex,i=r(1223),a="findIndex",s=!0;a in[]&&Array(1)[a]((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{findIndex:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i(a)},9826:function(e,t,r){"use strict";var n=r(2109),o=r(2092).find,i=r(1223),a="find",s=!0;a in[]&&Array(1)[a]((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i(a)},9554:function(e,t,r){"use strict";var n=r(2109),o=r(8533);n({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},1038:function(e,t,r){var n=r(2109),o=r(8457);n({target:"Array",stat:!0,forced:!r(7072)((function(e){Array.from(e)}))},{from:o})},6699:function(e,t,r){"use strict";var n=r(2109),o=r(1318).includes,i=r(7293),a=r(1223);n({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},2772:function(e,t,r){"use strict";var n=r(2109),o=r(1470),i=r(1318).indexOf,a=r(9341),s=o([].indexOf),c=!!s&&1/s([1],1,-0)<0;n({target:"Array",proto:!0,forced:c||!a("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return c?s(this,e,t)||0:i(this,e,t)}})},9753:function(e,t,r){r(2109)({target:"Array",stat:!0},{isArray:r(3157)})},6992:function(e,t,r){"use strict";var n=r(5656),o=r(1223),i=r(7497),a=r(9909),s=r(3070).f,c=r(1656),u=r(6178),l=r(1913),d=r(9781),p="Array Iterator",h=a.set,f=a.getterFor(p);e.exports=c(Array,"Array",(function(e,t){h(this,{type:p,target:n(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,u(void 0,!0)):u("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values");var m=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!l&&d&&"values"!==m.name)try{s(m,"name",{value:"values"})}catch(e){}},9600:function(e,t,r){"use strict";var n=r(2109),o=r(1702),i=r(8361),a=r(5656),s=r(9341),c=o([].join);n({target:"Array",proto:!0,forced:i!=Object||!s("join",",")},{join:function(e){return c(a(this),void 0===e?",":e)}})},4986:function(e,t,r){var n=r(2109),o=r(6583);n({target:"Array",proto:!0,forced:o!==[].lastIndexOf},{lastIndexOf:o})},1249:function(e,t,r){"use strict";var n=r(2109),o=r(2092).map;n({target:"Array",proto:!0,forced:!r(1194)("map")},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},5827:function(e,t,r){"use strict";var n=r(2109),o=r(3671).left,i=r(9341),a=r(7392);n({target:"Array",proto:!0,forced:!r(5268)&&a>79&&a<83||!i("reduce")},{reduce:function(e){var t=arguments.length;return o(this,e,t,t>1?arguments[1]:void 0)}})},5069:function(e,t,r){"use strict";var n=r(2109),o=r(1702),i=r(3157),a=o([].reverse),s=[1,2];n({target:"Array",proto:!0,forced:String(s)===String(s.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},7042:function(e,t,r){"use strict";var n=r(2109),o=r(3157),i=r(4411),a=r(111),s=r(1400),c=r(6244),u=r(5656),l=r(6135),d=r(5112),p=r(1194),h=r(206),f=p("slice"),m=d("species"),g=Array,v=Math.max;n({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var r,n,d,p=u(this),f=c(p),E=s(e,f),y=s(void 0===t?f:t,f);if(o(p)&&(r=p.constructor,(i(r)&&(r===g||o(r.prototype))||a(r)&&null===(r=r[m]))&&(r=void 0),r===g||void 0===r))return h(p,E,y);for(n=new(void 0===r?g:r)(v(y-E,0)),d=0;E<y;E++,d++)E in p&&l(n,d,p[E]);return n.length=d,n}})},5212:function(e,t,r){"use strict";var n=r(2109),o=r(2092).some;n({target:"Array",proto:!0,forced:!r(9341)("some")},{some:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},561:function(e,t,r){"use strict";var n=r(2109),o=r(7908),i=r(1400),a=r(9303),s=r(6244),c=r(3658),u=r(7207),l=r(5417),d=r(6135),p=r(5117),h=r(1194)("splice"),f=Math.max,m=Math.min;n({target:"Array",proto:!0,forced:!h},{splice:function(e,t){var r,n,h,g,v,E,y=o(this),_=s(y),T=i(e,_),I=arguments.length;for(0===I?r=n=0:1===I?(r=0,n=_-T):(r=I-2,n=m(f(a(t),0),_-T)),u(_+r-n),h=l(y,n),g=0;g<n;g++)(v=T+g)in y&&d(h,g,y[v]);if(h.length=n,r<n){for(g=T;g<_-n;g++)E=g+r,(v=g+n)in y?y[E]=y[v]:p(y,E);for(g=_;g>_-n+r;g--)p(y,g-1)}else if(r>n)for(g=_-n;g>T;g--)E=g+r-1,(v=g+n-1)in y?y[E]=y[v]:p(y,E);for(g=0;g<r;g++)y[g+T]=arguments[g+2];return c(y,_-n+r),h}})},3843:function(e,t,r){var n=r(2109),o=r(1702),i=Date,a=o(i.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return a(new i)}})},3710:function(e,t,r){var n=r(1702),o=r(8052),i=Date.prototype,a="Invalid Date",s="toString",c=n(i[s]),u=n(i.getTime);String(new Date(NaN))!=a&&o(i,s,(function(){var e=u(this);return e==e?c(this):a}))},4812:function(e,t,r){var n=r(2109),o=r(7065);n({target:"Function",proto:!0,forced:Function.bind!==o},{bind:o})},8309:function(e,t,r){var n=r(9781),o=r(6530).EXISTS,i=r(1702),a=r(7045),s=Function.prototype,c=i(s.toString),u=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=i(u.exec);n&&!o&&a(s,"name",{configurable:!0,get:function(){try{return l(u,c(this))[1]}catch(e){return""}}})},8862:function(e,t,r){var n=r(2109),o=r(5005),i=r(2104),a=r(6916),s=r(1702),c=r(7293),u=r(614),l=r(2190),d=r(206),p=r(8044),h=r(6293),f=String,m=o("JSON","stringify"),g=s(/./.exec),v=s("".charAt),E=s("".charCodeAt),y=s("".replace),_=s(1..toString),T=/[\uD800-\uDFFF]/g,I=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,R=!h||c((function(){var e=o("Symbol")();return"[null]"!=m([e])||"{}"!=m({a:e})||"{}"!=m(Object(e))})),C=c((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),N=function(e,t){var r=d(arguments),n=p(t);if(u(n)||void 0!==e&&!l(e))return r[1]=function(e,t){if(u(n)&&(t=a(n,this,f(e),t)),!l(t))return t},i(m,null,r)},S=function(e,t,r){var n=v(r,t-1),o=v(r,t+1);return g(I,e)&&!g(O,o)||g(O,e)&&!g(I,n)?"\\u"+_(E(e,0),16):e};m&&n({target:"JSON",stat:!0,arity:3,forced:R||C},{stringify:function(e,t,r){var n=d(arguments),o=i(R?N:m,null,n);return C&&"string"==typeof o?y(o,T,S):o}})},9098:function(e,t,r){"use strict";r(7710)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(5631))},1532:function(e,t,r){r(9098)},9653:function(e,t,r){"use strict";var n=r(2109),o=r(1913),i=r(9781),a=r(7854),s=r(857),c=r(1702),u=r(4705),l=r(2597),d=r(9587),p=r(7976),h=r(2190),f=r(7593),m=r(7293),g=r(8006).f,v=r(1236).f,E=r(3070).f,y=r(863),_=r(3111).trim,T="Number",I=a[T],O=s[T],R=I.prototype,C=a.TypeError,N=c("".slice),S=c("".charCodeAt),b=u(T,!I(" 0o1")||!I("0b1")||I("+0x1")),A=function(e){var t,r=arguments.length<1?0:I(function(e){var t=f(e,"number");return"bigint"==typeof t?t:function(e){var t,r,n,o,i,a,s,c,u=f(e,"number");if(h(u))throw C("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=_(u),43===(t=S(u,0))||45===t){if(88===(r=S(u,2))||120===r)return NaN}else if(48===t){switch(S(u,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+u}for(a=(i=N(u,2)).length,s=0;s<a;s++)if((c=S(i,s))<48||c>o)return NaN;return parseInt(i,n)}return+u}(t)}(e));return p(R,t=this)&&m((function(){y(t)}))?d(Object(r),this,A):r};A.prototype=R,b&&!o&&(R.constructor=A),n({global:!0,constructor:!0,wrap:!0,forced:b},{Number:A});var M=function(e,t){for(var r,n=i?g(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;n.length>o;o++)l(t,r=n[o])&&!l(e,r)&&E(e,r,v(t,r))};o&&O&&M(s[T],O),(b||o)&&M(s[T],I)},3161:function(e,t,r){r(2109)({target:"Number",stat:!0},{isInteger:r(5988)})},4048:function(e,t,r){r(2109)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},6977:function(e,t,r){"use strict";var n=r(2109),o=r(1702),i=r(9303),a=r(863),s=r(8415),c=r(7293),u=RangeError,l=String,d=Math.floor,p=o(s),h=o("".slice),f=o(1..toFixed),m=function(e,t,r){return 0===t?r:t%2==1?m(e,t-1,r*e):m(e*e,t/2,r)},g=function(e,t,r){for(var n=-1,o=r;++n<6;)o+=t*e[n],e[n]=o%1e7,o=d(o/1e7)},v=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=d(n/t),n=n%t*1e7},E=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=l(e[t]);r=""===r?n:r+p("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:c((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!c((function(){f({})}))},{toFixed:function(e){var t,r,n,o,s=a(this),c=i(e),d=[0,0,0,0,0,0],f="",y="0";if(c<0||c>20)throw u("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return l(s);if(s<0&&(f="-",s=-s),s>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(s*m(2,69,1))-69)<0?s*m(2,-t,1):s/m(2,t,1),r*=4503599627370496,(t=52-t)>0){for(g(d,0,r),n=c;n>=7;)g(d,1e7,0),n-=7;for(g(d,m(10,n,1),0),n=t-1;n>=23;)v(d,1<<23),n-=23;v(d,1<<n),g(d,1,1),v(d,2),y=E(d)}else g(d,0,r),g(d,1<<-t,0),y=E(d)+p("0",c);return c>0?f+((o=y.length)<=c?"0."+p("0",c-o)+y:h(y,0,o-c)+"."+h(y,o-c)):f+y}})},9601:function(e,t,r){var n=r(2109),o=r(1574);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},9070:function(e,t,r){var n=r(2109),o=r(9781),i=r(3070).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!o},{defineProperty:i})},9720:function(e,t,r){var n=r(2109),o=r(4699).entries;n({target:"Object",stat:!0},{entries:function(e){return o(e)}})},9660:function(e,t,r){var n=r(2109),o=r(6293),i=r(7293),a=r(5181),s=r(7908);n({target:"Object",stat:!0,forced:!o||i((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(s(e)):[]}})},7941:function(e,t,r){var n=r(2109),o=r(7908),i=r(1956);n({target:"Object",stat:!0,forced:r(7293)((function(){i(1)}))},{keys:function(e){return i(o(e))}})},1539:function(e,t,r){var n=r(1694),o=r(8052),i=r(288);n||o(Object.prototype,"toString",i,{unsafe:!0})},821:function(e,t,r){"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(8523),s=r(2534),c=r(408);n({target:"Promise",stat:!0,forced:r(612)},{all:function(e){var t=this,r=a.f(t),n=r.resolve,u=r.reject,l=s((function(){var r=i(t.resolve),a=[],s=0,l=1;c(e,(function(e){var i=s++,c=!1;l++,o(r,t,e).then((function(e){c||(c=!0,a[i]=e,--l||n(a))}),u)})),--l||n(a)}));return l.error&&u(l.value),r.promise}})},4164:function(e,t,r){"use strict";var n=r(2109),o=r(1913),i=r(3702).CONSTRUCTOR,a=r(2492),s=r(5005),c=r(614),u=r(8052),l=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(e){return this.then(void 0,e)}}),!o&&c(a)){var d=s("Promise").prototype.catch;l.catch!==d&&u(l,"catch",d,{unsafe:!0})}},3401:function(e,t,r){"use strict";var n,o,i,a=r(2109),s=r(1913),c=r(5268),u=r(7854),l=r(6916),d=r(8052),p=r(7674),h=r(8003),f=r(6340),m=r(9662),g=r(614),v=r(111),E=r(5787),y=r(6707),_=r(261).set,T=r(5948),I=r(842),O=r(2534),R=r(8572),C=r(9909),N=r(2492),S=r(3702),b=r(8523),A="Promise",M=S.CONSTRUCTOR,w=S.REJECTION_EVENT,P=S.SUBCLASSING,U=C.getterFor(A),k=C.set,x=N&&N.prototype,L=N,D=x,j=u.TypeError,B=u.document,G=u.process,H=b.f,F=H,W=!!(B&&B.createEvent&&u.dispatchEvent),K="unhandledrejection",q=function(e){var t;return!(!v(e)||!g(t=e.then))&&t},z=function(e,t){var r,n,o,i=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,d=e.domain;try{s?(a||(2===t.rejection&&Y(t),t.rejection=1),!0===s?r=i:(d&&d.enter(),r=s(i),d&&(d.exit(),o=!0)),r===e.promise?u(j("Promise-chain cycle")):(n=q(r))?l(n,r,c,u):c(r)):u(i)}catch(e){d&&!o&&d.exit(),u(e)}},V=function(e,t){e.notified||(e.notified=!0,T((function(){for(var r,n=e.reactions;r=n.get();)z(r,e);e.notified=!1,t&&!e.rejection&&J(e)})))},X=function(e,t,r){var n,o;W?((n=B.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),u.dispatchEvent(n)):n={promise:t,reason:r},!w&&(o=u["on"+e])?o(n):e===K&&I("Unhandled promise rejection",r)},J=function(e){l(_,u,(function(){var t,r=e.facade,n=e.value;if(Z(e)&&(t=O((function(){c?G.emit("unhandledRejection",n,r):X(K,r,n)})),e.rejection=c||Z(e)?2:1,t.error))throw t.value}))},Z=function(e){return 1!==e.rejection&&!e.parent},Y=function(e){l(_,u,(function(){var t=e.facade;c?G.emit("rejectionHandled",t):X("rejectionhandled",t,e.value)}))},Q=function(e,t,r){return function(n){e(t,n,r)}},$=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,V(e,!0))},ee=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw j("Promise can't be resolved itself");var n=q(t);n?T((function(){var r={done:!1};try{l(n,t,Q(ee,r,e),Q($,r,e))}catch(t){$(r,t,e)}})):(e.value=t,e.state=1,V(e,!1))}catch(t){$({done:!1},t,e)}}};if(M&&(D=(L=function(e){E(this,D),m(e),l(n,this);var t=U(this);try{e(Q(ee,t),Q($,t))}catch(e){$(t,e)}}).prototype,(n=function(e){k(this,{type:A,done:!1,notified:!1,parent:!1,reactions:new R,rejection:!1,state:0,value:void 0})}).prototype=d(D,"then",(function(e,t){var r=U(this),n=H(y(this,L));return r.parent=!0,n.ok=!g(e)||e,n.fail=g(t)&&t,n.domain=c?G.domain:void 0,0==r.state?r.reactions.add(n):T((function(){z(n,r)})),n.promise})),o=function(){var e=new n,t=U(e);this.promise=e,this.resolve=Q(ee,t),this.reject=Q($,t)},b.f=H=function(e){return e===L||void 0===e?new o(e):F(e)},!s&&g(N)&&x!==Object.prototype)){i=x.then,P||d(x,"then",(function(e,t){var r=this;return new L((function(e,t){l(i,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete x.constructor}catch(e){}p&&p(x,D)}a({global:!0,constructor:!0,wrap:!0,forced:M},{Promise:L}),h(L,A,!1,!0),f(A)},8674:function(e,t,r){r(3401),r(821),r(4164),r(6027),r(683),r(6294)},6027:function(e,t,r){"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(8523),s=r(2534),c=r(408);n({target:"Promise",stat:!0,forced:r(612)},{race:function(e){var t=this,r=a.f(t),n=r.reject,u=s((function(){var a=i(t.resolve);c(e,(function(e){o(a,t,e).then(r.resolve,n)}))}));return u.error&&n(u.value),r.promise}})},683:function(e,t,r){"use strict";var n=r(2109),o=r(6916),i=r(8523);n({target:"Promise",stat:!0,forced:r(3702).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return o(t.reject,void 0,e),t.promise}})},6294:function(e,t,r){"use strict";var n=r(2109),o=r(5005),i=r(1913),a=r(2492),s=r(3702).CONSTRUCTOR,c=r(9478),u=o("Promise"),l=i&&!s;n({target:"Promise",stat:!0,forced:i||s},{resolve:function(e){return c(l&&this===u?a:this,e)}})},4916:function(e,t,r){"use strict";var n=r(2109),o=r(2261);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},9714:function(e,t,r){"use strict";var n=r(6530).PROPER,o=r(8052),i=r(9670),a=r(1340),s=r(7293),c=r(4706),u="toString",l=RegExp.prototype[u],d=s((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),p=n&&l.name!=u;(d||p)&&o(RegExp.prototype,u,(function(){var e=i(this);return"/"+a(e.source)+"/"+a(c(e))}),{unsafe:!0})},2023:function(e,t,r){"use strict";var n=r(2109),o=r(1702),i=r(3929),a=r(4488),s=r(1340),c=r(4964),u=o("".indexOf);n({target:"String",proto:!0,forced:!c("includes")},{includes:function(e){return!!~u(s(a(this)),s(i(e)),arguments.length>1?arguments[1]:void 0)}})},8783:function(e,t,r){"use strict";var n=r(8710).charAt,o=r(1340),i=r(9909),a=r(1656),s=r(6178),c="String Iterator",u=i.set,l=i.getterFor(c);a(String,"String",(function(e){u(this,{type:c,string:o(e),index:0})}),(function(){var e,t=l(this),r=t.string,o=t.index;return o>=r.length?s(void 0,!0):(e=n(r,o),t.index+=e.length,s(e,!1))}))},3123:function(e,t,r){"use strict";var n=r(2104),o=r(6916),i=r(1702),a=r(7007),s=r(9670),c=r(8554),u=r(7850),l=r(4488),d=r(6707),p=r(1530),h=r(7466),f=r(1340),m=r(8173),g=r(1589),v=r(7651),E=r(2261),y=r(2999),_=r(7293),T=y.UNSUPPORTED_Y,I=4294967295,O=Math.min,R=[].push,C=i(/./.exec),N=i(R),S=i("".slice),b=!_((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));a("split",(function(e,t,r){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var i=f(l(this)),a=void 0===r?I:r>>>0;if(0===a)return[];if(void 0===e)return[i];if(!u(e))return o(t,i,e,a);for(var s,c,d,p=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),m=0,v=new RegExp(e.source,h+"g");(s=o(E,v,i))&&!((c=v.lastIndex)>m&&(N(p,S(i,m,s.index)),s.length>1&&s.index<i.length&&n(R,p,g(s,1)),d=s[0].length,m=c,p.length>=a));)v.lastIndex===s.index&&v.lastIndex++;return m===i.length?!d&&C(v,"")||N(p,""):N(p,S(i,m)),p.length>a?g(p,0,a):p}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:o(t,this,e,r)}:t,[function(t,r){var n=l(this),a=c(t)?void 0:m(t,e);return a?o(a,t,n,r):o(i,f(n),t,r)},function(e,n){var o=s(this),a=f(e),c=r(i,o,a,n,i!==t);if(c.done)return c.value;var u=d(o,RegExp),l=o.unicode,m=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(T?"g":"y"),g=new u(T?"^(?:"+o.source+")":o,m),E=void 0===n?I:n>>>0;if(0===E)return[];if(0===a.length)return null===v(g,a)?[a]:[];for(var y=0,_=0,R=[];_<a.length;){g.lastIndex=T?0:_;var C,b=v(g,T?S(a,_):a);if(null===b||(C=O(h(g.lastIndex+(T?_:0)),a.length))===y)_=p(a,_,l);else{if(N(R,S(a,y,_)),R.length===E)return R;for(var A=1;A<=b.length-1;A++)if(N(R,b[A]),R.length===E)return R;_=y=C}}return N(R,S(a,y)),R}]}),!b,T)},6755:function(e,t,r){"use strict";var n,o=r(2109),i=r(1470),a=r(1236).f,s=r(7466),c=r(1340),u=r(3929),l=r(4488),d=r(4964),p=r(1913),h=i("".startsWith),f=i("".slice),m=Math.min,g=d("startsWith");o({target:"String",proto:!0,forced:!(!p&&!g&&(n=a(String.prototype,"startsWith"),n&&!n.writable)||g)},{startsWith:function(e){var t=c(l(this));u(e);var r=s(m(arguments.length>1?arguments[1]:void 0,t.length)),n=c(e);return h?h(t,n,r):f(t,r,r+n.length)===n}})},4032:function(e,t,r){"use strict";var n=r(2109),o=r(7854),i=r(6916),a=r(1702),s=r(1913),c=r(9781),u=r(6293),l=r(7293),d=r(2597),p=r(7976),h=r(9670),f=r(5656),m=r(4948),g=r(1340),v=r(9114),E=r(30),y=r(1956),_=r(8006),T=r(1156),I=r(5181),O=r(1236),R=r(3070),C=r(6048),N=r(5296),S=r(8052),b=r(7045),A=r(2309),M=r(6200),w=r(3501),P=r(9711),U=r(5112),k=r(6061),x=r(6800),L=r(6532),D=r(8003),j=r(9909),B=r(2092).forEach,G=M("hidden"),H="Symbol",F="prototype",W=j.set,K=j.getterFor(H),q=Object[F],z=o.Symbol,V=z&&z[F],X=o.TypeError,J=o.QObject,Z=O.f,Y=R.f,Q=T.f,$=N.f,ee=a([].push),te=A("symbols"),re=A("op-symbols"),ne=A("wks"),oe=!J||!J[F]||!J[F].findChild,ie=c&&l((function(){return 7!=E(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Z(q,t);n&&delete q[t],Y(e,t,r),n&&e!==q&&Y(q,t,n)}:Y,ae=function(e,t){var r=te[e]=E(V);return W(r,{type:H,tag:e,description:t}),c||(r.description=t),r},se=function(e,t,r){e===q&&se(re,t,r),h(e);var n=m(t);return h(r),d(te,n)?(r.enumerable?(d(e,G)&&e[G][n]&&(e[G][n]=!1),r=E(r,{enumerable:v(0,!1)})):(d(e,G)||Y(e,G,v(1,{})),e[G][n]=!0),ie(e,n,r)):Y(e,n,r)},ce=function(e,t){h(e);var r=f(t),n=y(r).concat(pe(r));return B(n,(function(t){c&&!i(ue,r,t)||se(e,t,r[t])})),e},ue=function(e){var t=m(e),r=i($,this,t);return!(this===q&&d(te,t)&&!d(re,t))&&(!(r||!d(this,t)||!d(te,t)||d(this,G)&&this[G][t])||r)},le=function(e,t){var r=f(e),n=m(t);if(r!==q||!d(te,n)||d(re,n)){var o=Z(r,n);return!o||!d(te,n)||d(r,G)&&r[G][n]||(o.enumerable=!0),o}},de=function(e){var t=Q(f(e)),r=[];return B(t,(function(e){d(te,e)||d(w,e)||ee(r,e)})),r},pe=function(e){var t=e===q,r=Q(t?re:f(e)),n=[];return B(r,(function(e){!d(te,e)||t&&!d(q,e)||ee(n,te[e])})),n};u||(z=function(){if(p(V,this))throw X("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,t=P(e),r=function(e){this===q&&i(r,re,e),d(this,G)&&d(this[G],t)&&(this[G][t]=!1),ie(this,t,v(1,e))};return c&&oe&&ie(q,t,{configurable:!0,set:r}),ae(t,e)},S(V=z[F],"toString",(function(){return K(this).tag})),S(z,"withoutSetter",(function(e){return ae(P(e),e)})),N.f=ue,R.f=se,C.f=ce,O.f=le,_.f=T.f=de,I.f=pe,k.f=function(e){return ae(U(e),e)},c&&(b(V,"description",{configurable:!0,get:function(){return K(this).description}}),s||S(q,"propertyIsEnumerable",ue,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!u,sham:!u},{Symbol:z}),B(y(ne),(function(e){x(e)})),n({target:H,stat:!0,forced:!u},{useSetter:function(){oe=!0},useSimple:function(){oe=!1}}),n({target:"Object",stat:!0,forced:!u,sham:!c},{create:function(e,t){return void 0===t?E(e):ce(E(e),t)},defineProperty:se,defineProperties:ce,getOwnPropertyDescriptor:le}),n({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:de}),L(),D(z,H),w[G]=!0},1817:function(e,t,r){"use strict";var n=r(2109),o=r(9781),i=r(7854),a=r(1702),s=r(2597),c=r(614),u=r(7976),l=r(1340),d=r(7045),p=r(9920),h=i.Symbol,f=h&&h.prototype;if(o&&c(h)&&(!("description"in f)||void 0!==h().description)){var m={},g=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),t=u(f,this)?new h(e):void 0===e?h():h(e);return""===e&&(m[t]=!0),t};p(g,h),g.prototype=f,f.constructor=g;var v="Symbol(test)"==String(h("test")),E=a(f.valueOf),y=a(f.toString),_=/^Symbol\((.*)\)[^)]+$/,T=a("".replace),I=a("".slice);d(f,"description",{configurable:!0,get:function(){var e=E(this);if(s(m,e))return"";var t=y(e),r=v?I(t,7,-1):T(t,_,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:g})}},763:function(e,t,r){var n=r(2109),o=r(5005),i=r(2597),a=r(1340),s=r(2309),c=r(2015),u=s("string-to-symbol-registry"),l=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{for:function(e){var t=a(e);if(i(u,t))return u[t];var r=o("Symbol")(t);return u[t]=r,l[r]=t,r}})},2165:function(e,t,r){r(6800)("iterator")},2526:function(e,t,r){r(4032),r(763),r(6620),r(8862),r(9660)},6620:function(e,t,r){var n=r(2109),o=r(2597),i=r(2190),a=r(6330),s=r(2309),c=r(2015),u=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{keyFor:function(e){if(!i(e))throw TypeError(a(e)+" is not a symbol");if(o(u,e))return u[e]}})},2990:function(e,t,r){"use strict";var n=r(1702),o=r(260),i=n(r(1048)),a=o.aTypedArray;(0,o.exportTypedArrayMethod)("copyWithin",(function(e,t){return i(a(this),e,t,arguments.length>2?arguments[2]:void 0)}))},8927:function(e,t,r){"use strict";var n=r(260),o=r(2092).every,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},3105:function(e,t,r){"use strict";var n=r(260),o=r(1285),i=r(4599),a=r(648),s=r(6916),c=r(1702),u=r(7293),l=n.aTypedArray,d=n.exportTypedArrayMethod,p=c("".slice);d("fill",(function(e){var t=arguments.length;l(this);var r="Big"===p(a(this),0,3)?i(e):+e;return s(o,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),u((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))},5035:function(e,t,r){"use strict";var n=r(260),o=r(2092).filter,i=r(3074),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",(function(e){var t=o(a(this),e,arguments.length>1?arguments[1]:void 0);return i(this,t)}))},7174:function(e,t,r){"use strict";var n=r(260),o=r(2092).findIndex,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},4345:function(e,t,r){"use strict";var n=r(260),o=r(2092).find,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},2846:function(e,t,r){"use strict";var n=r(260),o=r(2092).forEach,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(e){o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},8145:function(e,t,r){"use strict";var n=r(3832);(0,r(260).exportTypedArrayStaticMethod)("from",r(7321),n)},4731:function(e,t,r){"use strict";var n=r(260),o=r(1318).includes,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},7209:function(e,t,r){"use strict";var n=r(260),o=r(1318).indexOf,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},6319:function(e,t,r){"use strict";var n=r(7854),o=r(7293),i=r(1702),a=r(260),s=r(6992),c=r(5112)("iterator"),u=n.Uint8Array,l=i(s.values),d=i(s.keys),p=i(s.entries),h=a.aTypedArray,f=a.exportTypedArrayMethod,m=u&&u.prototype,g=!o((function(){m[c].call([1])})),v=!!m&&m.values&&m[c]===m.values&&"values"===m.values.name,E=function(){return l(h(this))};f("entries",(function(){return p(h(this))}),g),f("keys",(function(){return d(h(this))}),g),f("values",E,g||!v,{name:"values"}),f(c,E,g||!v,{name:"values"})},8867:function(e,t,r){"use strict";var n=r(260),o=r(1702),i=n.aTypedArray,a=n.exportTypedArrayMethod,s=o([].join);a("join",(function(e){return s(i(this),e)}))},7789:function(e,t,r){"use strict";var n=r(260),o=r(2104),i=r(6583),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return o(i,a(this),t>1?[e,arguments[1]]:[e])}))},3739:function(e,t,r){"use strict";var n=r(260),o=r(2092).map,i=r(6304),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("map",(function(e){return o(a(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(i(e))(t)}))}))},4483:function(e,t,r){"use strict";var n=r(260),o=r(3671).right,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},9368:function(e,t,r){"use strict";var n=r(260),o=r(3671).left,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},2056:function(e,t,r){"use strict";var n=r(260),o=n.aTypedArray,i=n.exportTypedArrayMethod,a=Math.floor;i("reverse",(function(){for(var e,t=this,r=o(t).length,n=a(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t}))},3462:function(e,t,r){"use strict";var n=r(7854),o=r(6916),i=r(260),a=r(6244),s=r(4590),c=r(7908),u=r(7293),l=n.RangeError,d=n.Int8Array,p=d&&d.prototype,h=p&&p.set,f=i.aTypedArray,m=i.exportTypedArrayMethod,g=!u((function(){var e=new Uint8ClampedArray(2);return o(h,e,{length:1,0:3},1),3!==e[1]})),v=g&&i.NATIVE_ARRAY_BUFFER_VIEWS&&u((function(){var e=new d(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));m("set",(function(e){f(this);var t=s(arguments.length>1?arguments[1]:void 0,1),r=c(e);if(g)return o(h,this,r,t);var n=this.length,i=a(r),u=0;if(i+t>n)throw l("Wrong length");for(;u<i;)this[t+u]=r[u++]}),!g||v)},678:function(e,t,r){"use strict";var n=r(260),o=r(6304),i=r(7293),a=r(206),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("slice",(function(e,t){for(var r=a(s(this),e,t),n=o(this),i=0,c=r.length,u=new n(c);c>i;)u[i]=r[i++];return u}),i((function(){new Int8Array(1).slice()})))},7462:function(e,t,r){"use strict";var n=r(260),o=r(2092).some,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},3824:function(e,t,r){"use strict";var n=r(7854),o=r(1470),i=r(7293),a=r(9662),s=r(4362),c=r(260),u=r(8886),l=r(256),d=r(7392),p=r(8008),h=c.aTypedArray,f=c.exportTypedArrayMethod,m=n.Uint16Array,g=m&&o(m.prototype.sort),v=!(!g||i((function(){g(new m(2),null)}))&&i((function(){g(new m(2),{})}))),E=!!g&&!i((function(){if(d)return d<74;if(u)return u<67;if(l)return!0;if(p)return p<602;var e,t,r=new m(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(g(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));f("sort",(function(e){return void 0!==e&&a(e),E?g(this,e):s(h(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!E||v)},5021:function(e,t,r){"use strict";var n=r(260),o=r(7466),i=r(1400),a=r(6304),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",(function(e,t){var r=s(this),n=r.length,c=i(e,n);return new(a(r))(r.buffer,r.byteOffset+c*r.BYTES_PER_ELEMENT,o((void 0===t?n:i(t,n))-c))}))},2974:function(e,t,r){"use strict";var n=r(7854),o=r(2104),i=r(260),a=r(7293),s=r(206),c=n.Int8Array,u=i.aTypedArray,l=i.exportTypedArrayMethod,d=[].toLocaleString,p=!!c&&a((function(){d.call(new c(1))}));l("toLocaleString",(function(){return o(d,p?s(u(this)):u(this),s(arguments))}),a((function(){return[1,2].toLocaleString()!=new c([1,2]).toLocaleString()}))||!a((function(){c.prototype.toLocaleString.call([1,2])})))},5016:function(e,t,r){"use strict";var n=r(260).exportTypedArrayMethod,o=r(7293),i=r(7854),a=r(1702),s=i.Uint8Array,c=s&&s.prototype||{},u=[].toString,l=a([].join);o((function(){u.call({})}))&&(u=function(){return l(this)});var d=c.toString!=u;n("toString",u,d)},2472:function(e,t,r){r(9843)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},4747:function(e,t,r){var n=r(7854),o=r(8324),i=r(8509),a=r(8533),s=r(8880),c=function(e){if(e&&e.forEach!==a)try{s(e,"forEach",a)}catch(t){e.forEach=a}};for(var u in o)o[u]&&c(n[u]&&n[u].prototype);c(i)},3948:function(e,t,r){var n=r(7854),o=r(8324),i=r(8509),a=r(6992),s=r(8880),c=r(5112),u=c("iterator"),l=c("toStringTag"),d=a.values,p=function(e,t){if(e){if(e[u]!==d)try{s(e,u,d)}catch(t){e[u]=d}if(e[l]||s(e,l,t),o[t])for(var r in a)if(e[r]!==a[r])try{s(e,r,a[r])}catch(t){e[r]=a[r]}}};for(var h in o)p(n[h]&&n[h].prototype,h);p(i,"DOMTokenList")},6815:function(e,t,r){var n=r(2109),o=r(7854),i=r(7152)(o.setInterval,!0);n({global:!0,bind:!0,forced:o.setInterval!==i},{setInterval:i})},8417:function(e,t,r){var n=r(2109),o=r(7854),i=r(7152)(o.setTimeout,!0);n({global:!0,bind:!0,forced:o.setTimeout!==i},{setTimeout:i})},2564:function(e,t,r){r(6815),r(8417)},5556:function(e,t,r){"use strict";r(6992);var n=r(2109),o=r(7854),i=r(6916),a=r(1702),s=r(9781),c=r(5143),u=r(8052),l=r(7045),d=r(9190),p=r(8003),h=r(3061),f=r(9909),m=r(5787),g=r(614),v=r(2597),E=r(9974),y=r(648),_=r(9670),T=r(111),I=r(1340),O=r(30),R=r(9114),C=r(4121),N=r(1246),S=r(8053),b=r(5112),A=r(4362),M=b("iterator"),w="URLSearchParams",P=w+"Iterator",U=f.set,k=f.getterFor(w),x=f.getterFor(P),L=Object.getOwnPropertyDescriptor,D=function(e){if(!s)return o[e];var t=L(o,e);return t&&t.value},j=D("fetch"),B=D("Request"),G=D("Headers"),H=B&&B.prototype,F=G&&G.prototype,W=o.RegExp,K=o.TypeError,q=o.decodeURIComponent,z=o.encodeURIComponent,V=a("".charAt),X=a([].join),J=a([].push),Z=a("".replace),Y=a([].shift),Q=a([].splice),$=a("".split),ee=a("".slice),te=/\+/g,re=Array(4),ne=function(e){return re[e-1]||(re[e-1]=W("((?:%[\\da-f]{2}){"+e+"})","gi"))},oe=function(e){try{return q(e)}catch(t){return e}},ie=function(e){var t=Z(e,te," "),r=4;try{return q(t)}catch(e){for(;r;)t=Z(t,ne(r--),oe);return t}},ae=/[!'()~]|%20/g,se={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ce=function(e){return se[e]},ue=function(e){return Z(z(e),ae,ce)},le=h((function(e,t){U(this,{type:P,iterator:C(k(e).entries),kind:t})}),"Iterator",(function(){var e=x(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),de=function(e){this.entries=[],this.url=null,void 0!==e&&(T(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===V(e,0)?ee(e,1):e:I(e)))};de.prototype={type:w,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,o,a,s,c,u=N(e);if(u)for(r=(t=C(e,u)).next;!(n=i(r,t)).done;){if(a=(o=C(_(n.value))).next,(s=i(a,o)).done||(c=i(a,o)).done||!i(a,o).done)throw K("Expected sequence with length 2");J(this.entries,{key:I(s.value),value:I(c.value)})}else for(var l in e)v(e,l)&&J(this.entries,{key:l,value:I(e[l])})},parseQuery:function(e){if(e)for(var t,r,n=$(e,"&"),o=0;o<n.length;)(t=n[o++]).length&&(r=$(t,"="),J(this.entries,{key:ie(Y(r)),value:ie(X(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],J(r,ue(e.key)+"="+ue(e.value));return X(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var pe=function(){m(this,he);var e=U(this,new de(arguments.length>0?arguments[0]:void 0));s||(this.length=e.entries.length)},he=pe.prototype;if(d(he,{append:function(e,t){S(arguments.length,2);var r=k(this);J(r.entries,{key:I(e),value:I(t)}),s||this.length++,r.updateURL()},delete:function(e){S(arguments.length,1);for(var t=k(this),r=t.entries,n=I(e),o=0;o<r.length;)r[o].key===n?Q(r,o,1):o++;s||(this.length=r.length),t.updateURL()},get:function(e){S(arguments.length,1);for(var t=k(this).entries,r=I(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){S(arguments.length,1);for(var t=k(this).entries,r=I(e),n=[],o=0;o<t.length;o++)t[o].key===r&&J(n,t[o].value);return n},has:function(e){S(arguments.length,1);for(var t=k(this).entries,r=I(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){S(arguments.length,1);for(var r,n=k(this),o=n.entries,i=!1,a=I(e),c=I(t),u=0;u<o.length;u++)(r=o[u]).key===a&&(i?Q(o,u--,1):(i=!0,r.value=c));i||J(o,{key:a,value:c}),s||(this.length=o.length),n.updateURL()},sort:function(){var e=k(this);A(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=k(this).entries,n=E(e,arguments.length>1?arguments[1]:void 0),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function(){return new le(this,"keys")},values:function(){return new le(this,"values")},entries:function(){return new le(this,"entries")}},{enumerable:!0}),u(he,M,he.entries,{name:"entries"}),u(he,"toString",(function(){return k(this).serialize()}),{enumerable:!0}),s&&l(he,"size",{get:function(){return k(this).entries.length},configurable:!0,enumerable:!0}),p(pe,w),n({global:!0,constructor:!0,forced:!c},{URLSearchParams:pe}),!c&&g(G)){var fe=a(F.has),me=a(F.set),ge=function(e){if(T(e)){var t,r=e.body;if(y(r)===w)return t=e.headers?new G(e.headers):new G,fe(t,"content-type")||me(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),O(e,{body:R(0,I(r)),headers:R(0,t)})}return e};if(g(j)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return j(e,arguments.length>1?ge(arguments[1]):{})}}),g(B)){var ve=function(e){return m(this,H),new B(e,arguments.length>1?ge(arguments[1]):{})};H.constructor=ve,ve.prototype=H,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ve})}}e.exports={URLSearchParams:pe,getState:k}},1637:function(e,t,r){r(5556)},8789:function(e,t,r){"use strict";r(8783);var n,o=r(2109),i=r(9781),a=r(5143),s=r(7854),c=r(9974),u=r(1702),l=r(8052),d=r(7045),p=r(5787),h=r(2597),f=r(1574),m=r(8457),g=r(1589),v=r(8710).codeAt,E=r(3197),y=r(1340),_=r(8003),T=r(8053),I=r(5556),O=r(9909),R=O.set,C=O.getterFor("URL"),N=I.URLSearchParams,S=I.getState,b=s.URL,A=s.TypeError,M=s.parseInt,w=Math.floor,P=Math.pow,U=u("".charAt),k=u(/./.exec),x=u([].join),L=u(1..toString),D=u([].pop),j=u([].push),B=u("".replace),G=u([].shift),H=u("".split),F=u("".slice),W=u("".toLowerCase),K=u([].unshift),q="Invalid scheme",z="Invalid host",V="Invalid port",X=/[a-z]/i,J=/[\d+-.a-z]/i,Z=/\d/,Y=/^0x/i,Q=/^[0-7]+$/,$=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,re=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,oe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ie=/[\t\n\r]/g,ae=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)K(t,e%256),e=w(e/256);return x(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(t=n,r=o),t}(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=L(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},se={},ce=f({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),ue=f({},ce,{"#":1,"?":1,"{":1,"}":1}),le=f({},ue,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),de=function(e,t){var r=v(e,0);return r>32&&r<127&&!h(t,e)?e:encodeURIComponent(e)},pe={ftp:21,file:null,http:80,https:443,ws:80,wss:443},he=function(e,t){var r;return 2==e.length&&k(X,U(e,0))&&(":"==(r=U(e,1))||!t&&"|"==r)},fe=function(e){var t;return e.length>1&&he(F(e,0,2))&&(2==e.length||"/"===(t=U(e,2))||"\\"===t||"?"===t||"#"===t)},me=function(e){return"."===e||"%2e"===W(e)},ge={},ve={},Ee={},ye={},_e={},Te={},Ie={},Oe={},Re={},Ce={},Ne={},Se={},be={},Ae={},Me={},we={},Pe={},Ue={},ke={},xe={},Le={},De=function(e,t,r){var n,o,i,a=y(e);if(t){if(o=this.parse(a))throw A(o);this.searchParams=null}else{if(void 0!==r&&(n=new De(r,!0)),o=this.parse(a,null,n))throw A(o);(i=S(new N)).bindURL(this),this.searchParams=i}};De.prototype={type:"URL",parse:function(e,t,r){var o,i,a,s,c,u=this,l=t||ge,d=0,p="",f=!1,v=!1,E=!1;for(e=y(e),t||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,e=B(e,ne,""),e=B(e,oe,"$1")),e=B(e,ie,""),o=m(e);d<=o.length;){switch(i=o[d],l){case ge:if(!i||!k(X,i)){if(t)return q;l=Ee;continue}p+=W(i),l=ve;break;case ve:if(i&&(k(J,i)||"+"==i||"-"==i||"."==i))p+=W(i);else{if(":"!=i){if(t)return q;p="",l=Ee,d=0;continue}if(t&&(u.isSpecial()!=h(pe,p)||"file"==p&&(u.includesCredentials()||null!==u.port)||"file"==u.scheme&&!u.host))return;if(u.scheme=p,t)return void(u.isSpecial()&&pe[u.scheme]==u.port&&(u.port=null));p="","file"==u.scheme?l=Ae:u.isSpecial()&&r&&r.scheme==u.scheme?l=ye:u.isSpecial()?l=Oe:"/"==o[d+1]?(l=_e,d++):(u.cannotBeABaseURL=!0,j(u.path,""),l=ke)}break;case Ee:if(!r||r.cannotBeABaseURL&&"#"!=i)return q;if(r.cannotBeABaseURL&&"#"==i){u.scheme=r.scheme,u.path=g(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,l=Le;break}l="file"==r.scheme?Ae:Te;continue;case ye:if("/"!=i||"/"!=o[d+1]){l=Te;continue}l=Re,d++;break;case _e:if("/"==i){l=Ce;break}l=Ue;continue;case Te:if(u.scheme=r.scheme,i==n)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query=r.query;else if("/"==i||"\\"==i&&u.isSpecial())l=Ie;else if("?"==i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query="",l=xe;else{if("#"!=i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.path.length--,l=Ue;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query=r.query,u.fragment="",l=Le}break;case Ie:if(!u.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,l=Ue;continue}l=Ce}else l=Re;break;case Oe:if(l=Re,"/"!=i||"/"!=U(p,d+1))continue;d++;break;case Re:if("/"!=i&&"\\"!=i){l=Ce;continue}break;case Ce:if("@"==i){f&&(p="%40"+p),f=!0,a=m(p);for(var _=0;_<a.length;_++){var T=a[_];if(":"!=T||E){var I=de(T,le);E?u.password+=I:u.username+=I}else E=!0}p=""}else if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()){if(f&&""==p)return"Invalid authority";d-=m(p).length+1,p="",l=Ne}else p+=i;break;case Ne:case Se:if(t&&"file"==u.scheme){l=we;continue}if(":"!=i||v){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()){if(u.isSpecial()&&""==p)return z;if(t&&""==p&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(p))return s;if(p="",l=Pe,t)return;continue}"["==i?v=!0:"]"==i&&(v=!1),p+=i}else{if(""==p)return z;if(s=u.parseHost(p))return s;if(p="",l=be,t==Se)return}break;case be:if(!k(Z,i)){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()||t){if(""!=p){var O=M(p,10);if(O>65535)return V;u.port=u.isSpecial()&&O===pe[u.scheme]?null:O,p=""}if(t)return;l=Pe;continue}return V}p+=i;break;case Ae:if(u.scheme="file","/"==i||"\\"==i)l=Me;else{if(!r||"file"!=r.scheme){l=Ue;continue}if(i==n)u.host=r.host,u.path=g(r.path),u.query=r.query;else if("?"==i)u.host=r.host,u.path=g(r.path),u.query="",l=xe;else{if("#"!=i){fe(x(g(o,d),""))||(u.host=r.host,u.path=g(r.path),u.shortenPath()),l=Ue;continue}u.host=r.host,u.path=g(r.path),u.query=r.query,u.fragment="",l=Le}}break;case Me:if("/"==i||"\\"==i){l=we;break}r&&"file"==r.scheme&&!fe(x(g(o,d),""))&&(he(r.path[0],!0)?j(u.path,r.path[0]):u.host=r.host),l=Ue;continue;case we:if(i==n||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&he(p))l=Ue;else if(""==p){if(u.host="",t)return;l=Pe}else{if(s=u.parseHost(p))return s;if("localhost"==u.host&&(u.host=""),t)return;p="",l=Pe}continue}p+=i;break;case Pe:if(u.isSpecial()){if(l=Ue,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=n&&(l=Ue,"/"!=i))continue}else u.fragment="",l=Le;else u.query="",l=xe;break;case Ue:if(i==n||"/"==i||"\\"==i&&u.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(c=W(c=p))||"%2e."===c||".%2e"===c||"%2e%2e"===c?(u.shortenPath(),"/"==i||"\\"==i&&u.isSpecial()||j(u.path,"")):me(p)?"/"==i||"\\"==i&&u.isSpecial()||j(u.path,""):("file"==u.scheme&&!u.path.length&&he(p)&&(u.host&&(u.host=""),p=U(p,0)+":"),j(u.path,p)),p="","file"==u.scheme&&(i==n||"?"==i||"#"==i))for(;u.path.length>1&&""===u.path[0];)G(u.path);"?"==i?(u.query="",l=xe):"#"==i&&(u.fragment="",l=Le)}else p+=de(i,ue);break;case ke:"?"==i?(u.query="",l=xe):"#"==i?(u.fragment="",l=Le):i!=n&&(u.path[0]+=de(i,se));break;case xe:t||"#"!=i?i!=n&&("'"==i&&u.isSpecial()?u.query+="%27":u.query+="#"==i?"%23":de(i,se)):(u.fragment="",l=Le);break;case Le:i!=n&&(u.fragment+=de(i,ce))}d++}},parseHost:function(e){var t,r,n;if("["==U(e,0)){if("]"!=U(e,e.length-1))return z;if(t=function(e){var t,r,n,o,i,a,s,c=[0,0,0,0,0,0,0,0],u=0,l=null,d=0,p=function(){return U(e,d)};if(":"==p()){if(":"!=U(e,1))return;d+=2,l=++u}for(;p();){if(8==u)return;if(":"!=p()){for(t=r=0;r<4&&k(ee,p());)t=16*t+M(p(),16),d++,r++;if("."==p()){if(0==r)return;if(d-=r,u>6)return;for(n=0;p();){if(o=null,n>0){if(!("."==p()&&n<4))return;d++}if(!k(Z,p()))return;for(;k(Z,p());){if(i=M(p(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;d++}c[u]=256*c[u]+o,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==p()){if(d++,!p())return}else if(p())return;c[u++]=t}else{if(null!==l)return;d++,l=++u}}if(null!==l)for(a=u-l,u=7;0!=u&&a>0;)s=c[u],c[u--]=c[l+a-1],c[l+--a]=s;else if(8!=u)return;return c}(F(e,1,-1)),!t)return z;this.host=t}else if(this.isSpecial()){if(e=E(e),k(te,e))return z;if(t=function(e){var t,r,n,o,i,a,s,c=H(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(o=c[n]))return e;if(i=10,o.length>1&&"0"==U(o,0)&&(i=k(Y,o)?16:8,o=F(o,8==i?1:2)),""===o)a=0;else{if(!k(10==i?$:8==i?Q:ee,o))return e;a=M(o,i)}j(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=P(256,5-t))return null}else if(a>255)return null;for(s=D(r),n=0;n<r.length;n++)s+=r[n]*P(256,3-n);return s}(e),null===t)return z;this.host=t}else{if(k(re,e))return z;for(t="",r=m(e),n=0;n<r.length;n++)t+=de(r[n],se);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return h(pe,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&he(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,o=e.host,i=e.port,a=e.path,s=e.query,c=e.fragment,u=t+":";return null!==o?(u+="//",e.includesCredentials()&&(u+=r+(n?":"+n:"")+"@"),u+=ae(o),null!==i&&(u+=":"+i)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+x(a,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw A(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new je(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+ae(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(y(e)+":",ge)},getUsername:function(){return this.username},setUsername:function(e){var t=m(y(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=de(t[r],le)}},getPassword:function(){return this.password},setPassword:function(e){var t=m(y(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=de(t[r],le)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ae(e):ae(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ne)},getHostname:function(){var e=this.host;return null===e?"":ae(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Se)},getPort:function(){var e=this.port;return null===e?"":y(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=y(e))?this.port=null:this.parse(e,be))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+x(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Pe))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=y(e))?this.query=null:("?"==U(e,0)&&(e=F(e,1)),this.query="",this.parse(e,xe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=y(e))?("#"==U(e,0)&&(e=F(e,1)),this.fragment="",this.parse(e,Le)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var je=function(e){var t=p(this,Be),r=T(arguments.length,1)>1?arguments[1]:void 0,n=R(t,new De(e,!1,r));i||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},Be=je.prototype,Ge=function(e,t){return{get:function(){return C(this)[e]()},set:t&&function(e){return C(this)[t](e)},configurable:!0,enumerable:!0}};if(i&&(d(Be,"href",Ge("serialize","setHref")),d(Be,"origin",Ge("getOrigin")),d(Be,"protocol",Ge("getProtocol","setProtocol")),d(Be,"username",Ge("getUsername","setUsername")),d(Be,"password",Ge("getPassword","setPassword")),d(Be,"host",Ge("getHost","setHost")),d(Be,"hostname",Ge("getHostname","setHostname")),d(Be,"port",Ge("getPort","setPort")),d(Be,"pathname",Ge("getPathname","setPathname")),d(Be,"search",Ge("getSearch","setSearch")),d(Be,"searchParams",Ge("getSearchParams")),d(Be,"hash",Ge("getHash","setHash"))),l(Be,"toJSON",(function(){return C(this).serialize()}),{enumerable:!0}),l(Be,"toString",(function(){return C(this).serialize()}),{enumerable:!0}),b){var He=b.createObjectURL,Fe=b.revokeObjectURL;He&&l(je,"createObjectURL",c(He,b)),Fe&&l(je,"revokeObjectURL",c(Fe,b))}_(je,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:je})},285:function(e,t,r){r(8789)},3720:function(e){e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var o={},i={};function a(e,t){var r,n,a;return t?(a=0<=(e>>>=0)&&e<256)&&(n=i[e])?n:(r=c(e,(0|e)<0?-1:0,!0),a&&(i[e]=r),r):(a=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=c(e,e<0?-1:0,!1),a&&(o[e]=r),r)}function s(e,t){if(isNaN(e))return t?v:g;if(t){if(e<0)return v;if(e>=h)return I}else{if(e<=-f)return O;if(e+1>=f)return T}return e<0?s(-e,t).neg():c(e%p|0,e/p|0,t)}function c(e,t,n){return new r(e,t,n)}r.fromInt=a,r.fromNumber=s,r.fromBits=c;var u=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var o=s(u(r,8)),i=g,a=0;a<e.length;a+=8){var c=Math.min(8,e.length-a),d=parseInt(e.substring(a,a+c),r);if(c<8){var p=s(u(r,c));i=i.mul(p).add(s(d))}else i=(i=i.mul(o)).add(s(d))}return i.unsigned=t,i}function d(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?l(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=d;var p=4294967296,h=p*p,f=h/2,m=a(1<<24),g=a(0);r.ZERO=g;var v=a(0,!0);r.UZERO=v;var E=a(1);r.ONE=E;var y=a(1,!0);r.UONE=y;var _=a(-1);r.NEG_ONE=_;var T=c(-1,2147483647,!1);r.MAX_VALUE=T;var I=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=I;var O=c(0,-2147483648,!1);r.MIN_VALUE=O;var R=r.prototype;R.toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},R.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(O)){var t=s(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var o=s(u(e,6),this.unsigned),i=this,a="";;){var c=i.div(o),l=(i.sub(c.mul(o)).toInt()>>>0).toString(e);if((i=c).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},R.isZero=function(){return 0===this.high&&0===this.low},R.eqz=R.isZero,R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return!(1&~this.low)},R.isEven=function(){return!(1&this.low)},R.equals=function(e){return n(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.ne=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.le=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.ge=R.greaterThanOrEqual,R.compare=function(e){if(n(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&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},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(E)},R.neg=R.negate,R.add=function(e){n(e)||(e=d(e));var t=this.high>>>16,r=65535&this.high,o=this.low>>>16,i=65535&this.low,a=e.high>>>16,s=65535&e.high,u=e.low>>>16,l=0,p=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,p+=(h+=o+u)>>>16,l+=(p+=r+s)>>>16,l+=t+a,c((h&=65535)<<16|(f&=65535),(l&=65535)<<16|(p&=65535),this.unsigned)},R.subtract=function(e){return n(e)||(e=d(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){if(this.isZero())return g;if(n(e)||(e=d(e)),t)return c(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(O))return e.isOdd()?O:g;if(e.eq(O))return this.isOdd()?O:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,o=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,l=65535&e.high,p=e.low>>>16,h=65535&e.low,f=0,v=0,E=0,y=0;return E+=(y+=a*h)>>>16,v+=(E+=i*h)>>>16,E&=65535,v+=(E+=a*p)>>>16,f+=(v+=o*h)>>>16,v&=65535,f+=(v+=i*p)>>>16,v&=65535,f+=(v+=a*l)>>>16,f+=r*h+o*p+i*l+a*u,c((E&=65535)<<16|(y&=65535),(f&=65535)<<16|(v&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(e){if(n(e)||(e=d(e)),e.isZero())throw Error("division by zero");var r,o,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?v:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return v;if(e.gt(this.shru(1)))return y;i=v}else{if(this.eq(O))return e.eq(E)||e.eq(_)?O:e.eq(O)?E:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?E:_:(o=this.sub(e.mul(r)),i=r.add(o.div(e)));if(e.eq(O))return this.unsigned?v: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();i=g}for(o=this;o.gte(e);){r=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),l=a<=48?1:u(2,a-48),p=s(r),h=p.mul(e);h.isNegative()||h.gt(o);)h=(p=s(r-=l,this.unsigned)).mul(e);p.isZero()&&(p=E),i=i.add(p),o=o.sub(h)}return i},R.div=R.divide,R.modulo=function(e){return n(e)||(e=d(e)),t?c((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.rem=R.modulo,R.not=function(){return c(~this.low,~this.high,this.unsigned)},R.and=function(e){return n(e)||(e=d(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return n(e)||(e=d(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return n(e)||(e=d(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.shr_u=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},R.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},3281:function(e,t,r){"use strict";e.exports=r(9050)},2967:function(e){"use strict";e.exports=n;var t,r=/\/|\./;function n(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),n[e]=t}n("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),n("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),n("timestamp",{Timestamp:t}),n("empty",{Empty:{fields:{}}}),n("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),n("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),n("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),n.get=function(e){return n[e]||null}},3996:function(e,t,r){"use strict";var n=t,o=r(7025),i=r(9935);function a(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof o){e("switch(d%s){",n);for(var i=t.resolvedType.values,a=Object.keys(i),s=0;s<a.length;++s)t.repeated&&i[a[s]]===t.typeDefault&&e("default:"),e("case%j:",a[s])("case %i:",i[a[s]])("m%s=%j",n,i[a[s]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function s(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof o?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var s=t[n].resolve(),c=i.safeProp(s.name);s.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),a(r,s,n,c+"[ks[i]]")("}")("}")):s.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),a(r,s,n,c+"[i]")("}")("}")):(s.resolvedType instanceof o||r("if(d%s!=null){",c),a(r,s,n,c),s.resolvedType instanceof o||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var r=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],a=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?n:t[u].map?a:c).push(t[u]);if(n.length){for(r("if(o.arrays||o.defaults){"),u=0;u<n.length;++u)r("d%s=[]",i.safeProp(n[u].name));r("}")}if(a.length){for(r("if(o.objects||o.defaults){"),u=0;u<a.length;++u)r("d%s={}",i.safeProp(a[u].name));r("}")}if(c.length){for(r("if(o.defaults){"),u=0;u<c.length;++u){var l=c[u],d=i.safeProp(l.name);if(l.resolvedType instanceof o)r("d%s=o.enums===String?%j:%j",d,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",d)("}else")("d%s=o.longs===String?%j:%i",d,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var p="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",d,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",d,p)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",d,d)("}")}else r("d%s=%j",d,l.typeDefault)}r("}")}var h=!1;for(u=0;u<t.length;++u){l=t[u];var f=e._fieldsArray.indexOf(l);d=i.safeProp(l.name),l.map?(h||(h=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",d,d)("d%s={}",d)("for(var j=0;j<ks2.length;++j){"),s(r,l,f,d+"[ks2[j]]")("}")):l.repeated?(r("if(m%s&&m%s.length){",d,d)("d%s=[]",d)("for(var j=0;j<m%s.length;++j){",d),s(r,l,f,d+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",d,l.name),s(r,l,f,d),l.partOf&&r("if(o.oneofs)")("d%s=%j",i.safeProp(l.partOf.name),l.name)),r("}")}return r("return d")}},5305:function(e,t,r){"use strict";e.exports=function(e){var t=i.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var s=e._fieldsArray[r].resolve(),c=s.resolvedType instanceof n?"int32":s.type,u="m"+i.safeProp(s.name);t("case %i:",s.id),s.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==o.defaults[s.keyType]?t("k=%j",o.defaults[s.keyType]):t("k=null"),void 0!==o.defaults[c]?t("value=%j",o.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===o.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==o.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):s.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==o.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===o.basic[c]?t(s.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,c)):void 0===o.basic[c]?t(s.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var l=e._fieldsArray[r];l.required&&t("if(!m.hasOwnProperty(%j))",l.name)("throw util.ProtocolError(%j,{instance:m})",a(l))}return t("return m")};var n=r(7025),o=r(7063),i=r(9935);function a(e){return"missing required '"+e.name+"'"}},4928:function(e,t,r){"use strict";e.exports=function(e){for(var t,r=i.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(i.compareFieldsById),c=0;c<s.length;++c){var u=s[c].resolve(),l=e._fieldsArray.indexOf(u),d=u.resolvedType instanceof n?"int32":u.type,p=o.basic[d];t="m"+i.safeProp(u.name),u.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|o.mapKey[u.keyType],u.keyType),void 0===p?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",l,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|p,d,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==o.packed[d]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",d,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===p?a(r,u,l,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|p)>>>0,d,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===p?a(r,u,l,t):r("w.uint32(%i).%s(%s)",(u.id<<3|p)>>>0,d,t))}return r("return w")};var n=r(7025),o=r(7063),i=r(9935);function a(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},7025:function(e,t,r){"use strict";e.exports=a;var n=r(3243);((a.prototype=Object.create(n.prototype)).constructor=a).className="Enum";var o=r(9313),i=r(9935);function a(e,t,r,o,i){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=i||{},this.reserved=void 0,t)for(var a=Object.keys(t),s=0;s<a.length;++s)"number"==typeof t[a[s]]&&(this.valuesById[this.values[a[s]]=t[a[s]]]=a[s])}a.fromJSON=function(e,t){var r=new a(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},a.prototype.add=function(e,t,r){if(!i.isString(e))throw TypeError("name must be a string");if(!i.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},a.prototype.remove=function(e){if(!i.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},a.prototype.isReservedId=function(e){return o.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return o.isReservedName(this.reserved,e)}},3548:function(e,t,r){"use strict";e.exports=u;var n=r(3243);((u.prototype=Object.create(n.prototype)).constructor=u).className="Field";var o,i=r(7025),a=r(7063),s=r(9935),c=/^required|optional|repeated$/;function u(e,t,r,o,i,u,l){if(s.isObject(o)?(l=i,u=o,o=i=void 0):s.isObject(i)&&(l=u,u=i,i=void 0),n.call(this,e,u),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(r))throw TypeError("type must be a string");if(void 0!==o&&!c.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!s.isString(i))throw TypeError("extend must be a string");"proto3_optional"===o&&(o="optional"),this.rule=o&&"optional"!==o?o:void 0,this.type=r,this.id=t,this.extend=i||void 0,this.required="required"===o,this.optional=!this.required,this.repeated="repeated"===o,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&void 0!==a.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=l}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=a.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof o?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof i&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof i)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof o&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},u.d=function(e,t,r,n){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"==typeof t&&(t=s.decorateEnum(t).name),function(o,i){s.decorateType(o.constructor).add(new u(i,e,t,r,{default:n}))}},u._configure=function(e){o=e}},8836:function(e,t,r){"use strict";var n=e.exports=r(9482);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(4928),n.decoder=r(5305),n.verifier=r(4497),n.converter=r(3996),n.ReflectionObject=r(3243),n.Namespace=r(9313),n.Root=r(9424),n.Enum=r(7025),n.Type=r(7645),n.Field=r(3548),n.OneOf=r(7598),n.MapField=r(6039),n.Service=r(7513),n.Method=r(4429),n.Message=r(8368),n.wrappers=r(1667),n.types=r(7063),n.util=r(9935),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},9482:function(e,t,r){"use strict";var n=t;function o(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(1173),n.BufferWriter=r(3155),n.Reader=r(1408),n.BufferReader=r(593),n.util=r(9693),n.rpc=r(5994),n.roots=r(5054),n.configure=o,o()},9050:function(e,t,r){"use strict";var n=e.exports=r(8836);n.build="full",n.tokenize=r(626),n.parse=r(2228),n.common=r(2967),n.Root._configure(n.Type,n.parse,n.common)},6039:function(e,t,r){"use strict";e.exports=a;var n=r(3548);((a.prototype=Object.create(n.prototype)).constructor=a).className="MapField";var o=r(7063),i=r(9935);function a(e,t,r,o,a,s){if(n.call(this,e,t,o,void 0,void 0,a,s),!i.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===o.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,r){return"function"==typeof r?r=i.decorateType(r).name:r&&"object"==typeof r&&(r=i.decorateEnum(r).name),function(n,o){i.decorateType(n.constructor).add(new a(o,e,t,r))}}},8368:function(e,t,r){"use strict";e.exports=o;var n=r(9693);function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.create=function(e){return this.$type.create(e)},o.encode=function(e,t){return this.$type.encode(e,t)},o.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},o.decode=function(e){return this.$type.decode(e)},o.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},o.verify=function(e){return this.$type.verify(e)},o.fromObject=function(e){return this.$type.fromObject(e)},o.toObject=function(e,t){return this.$type.toObject(e,t)},o.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},4429:function(e,t,r){"use strict";e.exports=i;var n=r(3243);((i.prototype=Object.create(n.prototype)).constructor=i).className="Method";var o=r(9935);function i(e,t,r,i,a,s,c,u,l){if(o.isObject(a)?(c=a,a=s=void 0):o.isObject(s)&&(c=s,s=void 0),void 0!==t&&!o.isString(t))throw TypeError("type must be a string");if(!o.isString(r))throw TypeError("requestType must be a string");if(!o.isString(i))throw TypeError("responseType must be a string");n.call(this,e,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!a||void 0,this.responseType=i,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=l}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},9313:function(e,t,r){"use strict";e.exports=d;var n=r(3243);((d.prototype=Object.create(n.prototype)).constructor=d).className="Namespace";var o,i,a,s=r(3548),c=r(7598),u=r(9935);function l(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function d(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function p(e){return e._nestedArray=null,e}d.fromJSON=function(e,t){return new d(e,t.options).addJSON(t.nested)},d.arrayToJSON=l,d.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},d.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(d.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),d.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},d.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?o.fromJSON:void 0!==t.values?a.fromJSON:void 0!==t.methods?i.fromJSON:void 0!==t.id?s.fromJSON:d.fromJSON)(r[n],t));return this},d.prototype.get=function(e){return this.nested&&this.nested[e]||null},d.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof a)return this.nested[e].values;throw Error("no such enum: "+e)},d.prototype.add=function(e){if(!(e instanceof s&&void 0!==e.extend||e instanceof o||e instanceof a||e instanceof i||e instanceof d||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof d&&e instanceof d)||t instanceof o||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),p(this)},d.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),p(this)},d.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof d))throw Error("path conflicts with non-namespace objects")}else r.add(r=new d(n))}return t&&r.addJSON(t),r},d.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof d?e[t++].resolveAll():e[t++].resolve();return this.resolve()},d.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof d&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var o=0;o<this.nestedArray.length;++o)if(this._nestedArray[o]instanceof d&&(n=this._nestedArray[o].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},d.prototype.lookupType=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such type: "+e);return t},d.prototype.lookupEnum=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},d.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[o,a]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},d.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},d._configure=function(e,t,r){o=e,i=t,a=r}},3243:function(e,t,r){"use strict";e.exports=i,i.className="ReflectionObject";var n,o=r(9935);function i(e,t){if(!o.isString(e))throw TypeError("name must be a string");if(t&&!o.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(i.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),i.prototype.toJSON=function(){throw Error()},i.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},i.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},i.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},i.prototype.getOption=function(e){if(this.options)return this.options[e]},i.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},i.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var i=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var a=i[e];o.setProperty(a,r,t)}else(i={})[e]=o.setProperty({},r,t),n.push(i)}else{var s={};s[e]=t,n.push(s)}return this},i.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},i.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},i._configure=function(e){n=e}},7598:function(e,t,r){"use strict";e.exports=a;var n=r(3243);((a.prototype=Object.create(n.prototype)).constructor=a).className="OneOf";var o=r(3548),i=r(9935);function a(e,t,r,o){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=o}function s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},a.prototype.add=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,s(this),this},a.prototype.remove=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}s(this)},a.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},a.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){i.decorateType(t.constructor).add(new a(r,e)),Object.defineProperty(t,r,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}},2228:function(e,t,r){"use strict";e.exports=R,R.filename=null,R.defaults={keepCase:!1};var n=r(626),o=r(9424),i=r(7645),a=r(3548),s=r(6039),c=r(7598),u=r(7025),l=r(7513),d=r(4429),p=r(7063),h=r(9935),f=/^[1-9][0-9]*$/,m=/^-?[1-9][0-9]*$/,g=/^0[x][0-9a-fA-F]+$/,v=/^-?0[x][0-9a-fA-F]+$/,E=/^0[0-7]+$/,y=/^-?0[0-7]+$/,_=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,T=/^[a-zA-Z_][a-zA-Z_0-9]*$/,I=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,O=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function R(e,t,r){t instanceof o||(r=t,t=new o),r||(r=R.defaults);var C,N,S,b,A,M=r.preferTrailingComment||!1,w=n(e,r.alternateCommentMode||!1),P=w.next,U=w.push,k=w.peek,x=w.skip,L=w.cmnt,D=!0,j=!1,B=t,G=r.keepCase?function(e){return e}:h.camelCase;function H(e,t,r){var n=R.filename;return r||(R.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+w.line+")")}function F(){var e,t=[];do{if('"'!==(e=P())&&"'"!==e)throw H(e);t.push(P()),x(e),e=k()}while('"'===e||"'"===e);return t.join("")}function W(e){var t=P();switch(t){case"'":case'"':return U(t),F();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e){var t=1;switch("-"===e.charAt(0)&&(t=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return t*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(f.test(e))return t*parseInt(e,10);if(g.test(e))return t*parseInt(e,16);if(E.test(e))return t*parseInt(e,8);if(_.test(e))return t*parseFloat(e);throw H(e,"number",!0)}(t)}catch(r){if(e&&I.test(t))return t;throw H(t,"value")}}function K(e,t){var r,n;do{!t||'"'!==(r=k())&&"'"!==r?e.push([n=q(P()),x("to",!0)?q(P()):n]):e.push(F())}while(x(",",!0));x(";")}function q(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw H(e,"id");if(m.test(e))return parseInt(e,10);if(v.test(e))return parseInt(e,16);if(y.test(e))return parseInt(e,8);throw H(e,"id")}function z(){if(void 0!==C)throw H("package");if(C=P(),!I.test(C))throw H(C,"name");B=B.define(C),x(";")}function V(){var e,t=k();switch(t){case"weak":e=S||(S=[]),P();break;case"public":P();default:e=N||(N=[])}t=F(),x(";"),e.push(t)}function X(){if(x("="),b=F(),!(j="proto3"===b)&&"proto2"!==b)throw H(b,"syntax");x(";")}function J(e,t){switch(t){case"option":return Q(e,t),x(";"),!0;case"message":return function(e,t){if(!T.test(t=P()))throw H(t,"type name");var r=new i(t);Z(r,(function(e){if(!J(r,e))switch(e){case"map":!function(e){x("<");var t=P();if(void 0===p.mapKey[t])throw H(t,"type");x(",");var r=P();if(!I.test(r))throw H(r,"type");x(">");var n=P();if(!T.test(n))throw H(n,"name");x("=");var o=new s(G(n),q(P()),t,r);Z(o,(function(e){if("option"!==e)throw H(e);Q(o,e),x(";")}),(function(){te(o)})),e.add(o)}(r);break;case"required":case"repeated":Y(r,e);break;case"optional":Y(r,j?"proto3_optional":"optional");break;case"oneof":!function(e,t){if(!T.test(t=P()))throw H(t,"name");var r=new c(G(t));Z(r,(function(e){"option"===e?(Q(r,e),x(";")):(U(e),Y(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":K(r.extensions||(r.extensions=[]));break;case"reserved":K(r.reserved||(r.reserved=[]),!0);break;default:if(!j||!I.test(e))throw H(e);U(e),Y(r,"optional")}})),e.add(r)}(e,t),!0;case"enum":return function(e,t){if(!T.test(t=P()))throw H(t,"name");var r=new u(t);Z(r,(function(e){switch(e){case"option":Q(r,e),x(";");break;case"reserved":K(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!T.test(t))throw H(t,"name");x("=");var r=q(P(),!0),n={};Z(n,(function(e){if("option"!==e)throw H(e);Q(n,e),x(";")}),(function(){te(n)})),e.add(t,r,n.comment)}(r,e)}})),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!T.test(t=P()))throw H(t,"service name");var r=new l(t);Z(r,(function(e){if(!J(r,e)){if("rpc"!==e)throw H(e);!function(e,t){var r=L(),n=t;if(!T.test(t=P()))throw H(t,"name");var o,i,a,s,c=t;if(x("("),x("stream",!0)&&(i=!0),!I.test(t=P()))throw H(t);if(o=t,x(")"),x("returns"),x("("),x("stream",!0)&&(s=!0),!I.test(t=P()))throw H(t);a=t,x(")");var u=new d(c,n,o,a,i,s);u.comment=r,Z(u,(function(e){if("option"!==e)throw H(e);Q(u,e),x(";")})),e.add(u)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!I.test(t=P()))throw H(t,"reference");var r=t;Z(null,(function(t){switch(t){case"required":case"repeated":Y(e,t,r);break;case"optional":Y(e,j?"proto3_optional":"optional",r);break;default:if(!j||!I.test(t))throw H(t);U(t),Y(e,"optional",r)}}))}(e,t),!0}return!1}function Z(e,t,r){var n=w.line;if(e&&("string"!=typeof e.comment&&(e.comment=L()),e.filename=R.filename),x("{",!0)){for(var o;"}"!==(o=P());)t(o);x(";",!0)}else r&&r(),x(";"),e&&("string"!=typeof e.comment||M)&&(e.comment=L(n)||e.comment)}function Y(e,t,r){var n=P();if("group"!==n){if(!I.test(n))throw H(n,"type");var o=P();if(!T.test(o))throw H(o,"name");o=G(o),x("=");var s=new a(o,q(P()),n,t,r);if(Z(s,(function(e){if("option"!==e)throw H(e);Q(s,e),x(";")}),(function(){te(s)})),"proto3_optional"===t){var u=new c("_"+o);s.setOption("proto3_optional",!0),u.add(s),e.add(u)}else e.add(s);j||!s.repeated||void 0===p.packed[n]&&void 0!==p.basic[n]||s.setOption("packed",!1,!0)}else!function(e,t){var r=P();if(!T.test(r))throw H(r,"name");var n=h.lcFirst(r);r===n&&(r=h.ucFirst(r)),x("=");var o=q(P()),s=new i(r);s.group=!0;var c=new a(n,o,r,t);c.filename=R.filename,Z(s,(function(e){switch(e){case"option":Q(s,e),x(";");break;case"required":case"repeated":Y(s,e);break;case"optional":Y(s,j?"proto3_optional":"optional");break;default:throw H(e)}})),e.add(s).add(c)}(e,t)}function Q(e,t){var r=x("(",!0);if(!I.test(t=P()))throw H(t,"name");var n,o=t,i=o;r&&(x(")"),i=o="("+o+")",t=k(),O.test(t)&&(n=t.substr(1),o+=t,P())),x("="),function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,i,$(e,o),n)}function $(e,t){if(x("{",!0)){for(var r={};!x("}",!0);){if(!T.test(A=P()))throw H(A,"name");var n,o=A;"{"===k()?n=$(e,t+"."+A):(x(":"),"{"===k()?n=$(e,t+"."+A):(n=W(!0),ee(e,t+"."+A,n)));var i=r[o];i&&(n=[].concat(i).concat(n)),r[o]=n,x(",",!0)}return r}var a=W(!0);return ee(e,t,a),a}function ee(e,t,r){e.setOption&&e.setOption(t,r)}function te(e){if(x("[",!0)){do{Q(e,"option")}while(x(",",!0));x("]")}return e}for(;null!==(A=P());)switch(A){case"package":if(!D)throw H(A);z();break;case"import":if(!D)throw H(A);V();break;case"syntax":if(!D)throw H(A);X();break;case"option":Q(B,A),x(";");break;default:if(J(B,A)){D=!1;continue}throw H(A)}return R.filename=null,{package:C,imports:N,weakImports:S,syntax:b,root:t}}},1408:function(e,t,r){"use strict";e.exports=c;var n,o=r(9693),i=o.LongBits,a=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},d=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new n(e):l(e)})(e)}:l};function p(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw s(this,8);return new i(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=d(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){n=e,c.create=d(),n._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},593:function(e,t,r){"use strict";e.exports=i;var n=r(1408);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(9693);function i(e){n.call(this,e)}i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},9424:function(e,t,r){"use strict";e.exports=d;var n=r(9313);((d.prototype=Object.create(n.prototype)).constructor=d).className="Root";var o,i,a,s=r(3548),c=r(7025),u=r(7598),l=r(9935);function d(e){n.call(this,"",e),this.deferred=[],this.files=[]}function p(){}d.fromJSON=function(e,t){return t||(t=new d),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=l.path.resolve,d.prototype.fetch=l.fetch,d.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var o=this;if(!n)return l.asPromise(e,o,t,r);var s=n===p;function c(e,t){if(n){var r=n;if(n=null,s)throw e;r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in a)return r}return null}function d(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){i.filename=e;var n,a=i(t,o,r),d=0;if(a.imports)for(;d<a.imports.length;++d)(n=u(a.imports[d])||o.resolvePath(e,a.imports[d]))&&h(n);if(a.weakImports)for(d=0;d<a.weakImports.length;++d)(n=u(a.weakImports[d])||o.resolvePath(e,a.weakImports[d]))&&h(n,!0)}else o.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}s||f||c(null,o)}function h(e,t){if(!(o.files.indexOf(e)>-1))if(o.files.push(e),e in a)s?d(e,a[e]):(++f,setTimeout((function(){--f,d(e,a[e])})));else if(s){var r;try{r=l.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}d(e,r)}else++f,o.fetch(e,(function(r,i){--f,n&&(r?t?f||c(null,o):c(r):d(e,i))}))}var f=0;l.isString(t)&&(t=[t]);for(var m,g=0;g<t.length;++g)(m=o.resolvePath("",t[g]))&&h(m);if(s)return o;f||c(null,o)},d.prototype.loadSync=function(e,t){if(!l.isNode)throw Error("not supported");return this.load(e,t,p)},d.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return n.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function f(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new s(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.declaringField=t,t.extensionField=n,r.add(n),!0}return!1}d.prototype._handleAdd=function(e){if(e instanceof s)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof c)h.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof o)for(var t=0;t<this.deferred.length;)f(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);h.test(e.name)&&(e.parent[e.name]=e)}},d.prototype._handleRemove=function(e){if(e instanceof s){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);h.test(e.name)&&delete e.parent[e.name]}},d._configure=function(e,t,r){o=e,i=t,a=r}},5054:function(e){"use strict";e.exports={}},5994:function(e,t,r){"use strict";t.Service=r(7948)},7948:function(e,t,r){"use strict";e.exports=o;var n=r(9693);function o(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(o.prototype=Object.create(n.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,r,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,o,i);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,r){if(e)return s.emit("error",e,t),a(e);if(null!==r){if(!(r instanceof o))try{r=o[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7513:function(e,t,r){"use strict";e.exports=s;var n=r(9313);((s.prototype=Object.create(n.prototype)).constructor=s).className="Service";var o=r(4429),i=r(9935),a=r(5994);function s(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var r=new s(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),i=0;i<n.length;++i)r.add(o.fromJSON(n[i],t.methods[n[i]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},s.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return i.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},s.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},s.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof o?(this.methods[e.name]=e,e.parent=this,c(this)):n.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof o){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return n.prototype.remove.call(this,e)},s.prototype.create=function(e,t,r){for(var n,o=new a.Service(e,t,r),s=0;s<this.methodsArray.length;++s){var c=i.lcFirst((n=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");o[c]=i.codegen(["r","c"],i.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return o}},626:function(e){"use strict";e.exports=d;var t=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,n=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,o=/^ *[*/]+ */,i=/^\s*\*?\/*/,a=/\n/g,s=/\s/,c=/\\(.?)/g,u={0:"\0",r:"\r",n:"\n",t:"\t"};function l(e){return e.replace(c,(function(e,t){switch(t){case"\\":case"":return t;default:return u[t]||""}}))}function d(e,c){e=e.toString();var u=0,d=e.length,p=1,h=null,f=null,m=0,g=!1,v=!1,E=[],y=null;function _(e){return Error("illegal "+e+" (line "+p+")")}function T(t){return e.charAt(t)}function I(t,r,n){h=e.charAt(t++),m=p,g=!1,v=n;var s,u=t-(c?2:3);do{if(--u<0||"\n"===(s=e.charAt(u))){g=!0;break}}while(" "===s||"\t"===s);for(var l=e.substring(t,r).split(a),d=0;d<l.length;++d)l[d]=l[d].replace(c?i:o,"").trim();f=l.join("\n").trim()}function O(t){var r=R(t),n=e.substring(t,r);return/^\s*\/{1,2}/.test(n)}function R(e){for(var t=e;t<d&&"\n"!==T(t);)t++;return t}function C(){if(E.length>0)return E.shift();if(y)return function(){var t="'"===y?n:r;t.lastIndex=u-1;var o=t.exec(e);if(!o)throw _("string");return u=t.lastIndex,N(y),y=null,l(o[1])}();var o,i,a,h,f,m=0===u;do{if(u===d)return null;for(o=!1;s.test(a=T(u));)if("\n"===a&&(m=!0,++p),++u===d)return null;if("/"===T(u)){if(++u===d)throw _("comment");if("/"===T(u))if(c){if(h=u,f=!1,O(u)){f=!0;do{if((u=R(u))===d)break;u++}while(O(u))}else u=Math.min(d,R(u)+1);f&&I(h,u,m),p++,o=!0}else{for(f="/"===T(h=u+1);"\n"!==T(++u);)if(u===d)return null;++u,f&&I(h,u-1,m),++p,o=!0}else{if("*"!==(a=T(u)))return"/";h=u+1,f=c||"*"===T(h);do{if("\n"===a&&++p,++u===d)throw _("comment");i=a,a=T(u)}while("*"!==i||"/"!==a);++u,f&&I(h,u-2,m),o=!0}}}while(o);var g=u;if(t.lastIndex=0,!t.test(T(g++)))for(;g<d&&!t.test(T(g));)++g;var v=e.substring(u,u=g);return'"'!==v&&"'"!==v||(y=v),v}function N(e){E.push(e)}function S(){if(!E.length){var e=C();if(null===e)return null;N(e)}return E[0]}return Object.defineProperty({next:C,peek:S,push:N,skip:function(e,t){var r=S();if(r===e)return C(),!0;if(!t)throw _("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t=null;return void 0===e?m===p-1&&(c||"*"===h||g)&&(t=v?f:null):(m<e&&S(),m!==e||g||!c&&"/"!==h||(t=v?null:f)),t}},"line",{get:function(){return p}})}d.unescape=l},7645:function(e,t,r){"use strict";e.exports=E;var n=r(9313);((E.prototype=Object.create(n.prototype)).constructor=E).className="Type";var o=r(7025),i=r(7598),a=r(3548),s=r(6039),c=r(7513),u=r(8368),l=r(1408),d=r(1173),p=r(9935),h=r(4928),f=r(5305),m=r(4497),g=r(3996),v=r(1667);function E(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function y(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(E.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=p.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=p.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=E.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,p.merge(e.prototype,t)),e.$type=e.prototype.$type=this,p.merge(e,u,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:p.oneOfGetter(this._oneofsArray[r].oneof),set:p.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),E.generateConstructor=function(e){for(var t,r=p.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",p.safeProp(t.name)):t.repeated&&r("this%s=[]",p.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},E.fromJSON=function(e,t){var r=new E(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var u=Object.keys(t.fields),l=0;l<u.length;++l)r.add((void 0!==t.fields[u[l]].keyType?s.fromJSON:a.fromJSON)(u[l],t.fields[u[l]]));if(t.oneofs)for(u=Object.keys(t.oneofs),l=0;l<u.length;++l)r.add(i.fromJSON(u[l],t.oneofs[u[l]]));if(t.nested)for(u=Object.keys(t.nested),l=0;l<u.length;++l){var d=t.nested[u[l]];r.add((void 0!==d.id?a.fromJSON:void 0!==d.fields?E.fromJSON:void 0!==d.values?o.fromJSON:void 0!==d.methods?c.fromJSON:n.fromJSON)(u[l],d))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},E.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return p.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},E.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},E.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},E.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof a&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),y(this)}return e instanceof i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),y(this)):n.prototype.add.call(this,e)},E.prototype.remove=function(e){if(e instanceof a&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),y(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),y(this)}return n.prototype.remove.call(this,e)},E.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},E.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},E.prototype.create=function(e){return new this.ctor(e)},E.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=h(this)({Writer:d,types:t,util:p}),this.decode=f(this)({Reader:l,types:t,util:p}),this.verify=m(this)({types:t,util:p}),this.fromObject=g.fromObject(this)({types:t,util:p}),this.toObject=g.toObject(this)({types:t,util:p});var n=v[e];if(n){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(o),o.toObject=this.toObject,this.toObject=n.toObject.bind(o)}return this},E.prototype.encode=function(e,t){return this.setup().encode(e,t)},E.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},E.prototype.decode=function(e,t){return this.setup().decode(e,t)},E.prototype.decodeDelimited=function(e){return e instanceof l||(e=l.create(e)),this.decode(e,e.uint32())},E.prototype.verify=function(e){return this.setup().verify(e)},E.prototype.fromObject=function(e){return this.setup().fromObject(e)},E.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},E.d=function(e){return function(t){p.decorateType(t,e)}}},7063:function(e,t,r){"use strict";var n=t,o=r(9935),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function a(e,t){var r=0,n={};for(t|=0;r<e.length;)n[i[r+t]]=e[r++];return n}n.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",o.emptyArray,null]),n.long=a([0,0,0,1,1],7),n.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=a([1,5,0,0,0,5,5,0,0,0,1,1,0])},9935:function(e,t,r){"use strict";var n,o,i=e.exports=r(9693),a=r(5054);i.codegen=r(5124),i.fetch=r(9054),i.path=r(8626),i.fs=i.inquire("fs"),i.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},i.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],o=e[r++];void 0!==o&&(t[n]=o)}return t};var s=/\\/g,c=/"/g;i.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},i.safeProp=function(e){return!/^[$\w_]+$/.test(e)||i.isReserved(e)?'["'+e.replace(s,"\\\\").replace(c,'\\"')+'"]':"."+e},i.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;i.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},i.compareFieldsById=function(e,t){return e.id-t.id},i.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(i.decorateRoot.remove(e.$type),e.$type.name=t,i.decorateRoot.add(e.$type)),e.$type;n||(n=r(7645));var o=new n(t||e.name);return i.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,"$type",{value:o,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:o,enumerable:!1}),o};var l=0;i.decorateEnum=function(e){if(e.$type)return e.$type;o||(o=r(7025));var t=new o("Enum"+l++,e);return i.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},i.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var o=r.shift();if("__proto__"===o)return t;if(r.length>0)t[o]=e(t[o]||{},r,n);else{var i=t[o];i&&(n=[].concat(i).concat(n)),t[o]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(i,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(r(9424)))}})},1945:function(e,t,r){"use strict";e.exports=o;var n=r(9693);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=o.zero=new o(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new o(r,n)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(n.isString(e)){if(!n.Long)return o.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):i},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;o.fromHash=function(e){return e===a?i:new o((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},9693:function(e,t,r){"use strict";var n=t;function o(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)void 0!==e[n[o]]&&r||(e[n[o]]=t[n[o]]);return e}function i(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&o(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}n.asPromise=r(4537),n.base64=r(7419),n.EventEmitter=r(9211),n.float=r(945),n.inquire=r(7199),n.utf8=r(4997),n.pool=r(6662),n.LongBits=r(1945),n.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=o,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=i,n.ProtocolError=i("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},4497:function(e,t,r){"use strict";e.exports=function(e){var t=o.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var c=e._fieldsArray[n].resolve(),u="m"+o.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",i(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),s(t,c,"k[i]"),a(t,c,n,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",i(c,"array"))("for(var i=0;i<%s.length;++i){",u),a(t,c,n,u+"[i]")("}");else{if(c.partOf){var l=o.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",l)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",l)}a(t,c,n,u)}c.optional&&t("}")}return t("return null")};var n=r(7025),o=r(9935);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,r,o){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",o)("default:")("return%j",i(t,"enum value"));for(var a=Object.keys(t.resolvedType.values),s=0;s<a.length;++s)e("case %i:",t.resolvedType.values[a[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,o)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",o)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',o)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',o)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",o)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",i(t,"buffer"))}return e}function s(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",i(t,"boolean key"))}return e}},1667:function(e,t,r){"use strict";var n=t,o=r(8368);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(n);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof o){var a=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),a["@type"]=n,a}return this.toObject(e,t)}}},1173:function(e,t,r){"use strict";e.exports=d;var n,o=r(9693),i=o.LongBits,a=o.base64,s=o.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(d.create=function(){return new n})()}:function(){return new d}};function h(e,t,r){t[r]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function g(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}d.create=p(),d.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(d.alloc=o.pool(d.alloc,o.Array.prototype.subarray)),d.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,i.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=i.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(h,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var v=o.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var r=d.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(v,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(h,1,0)},d.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},d._configure=function(e){n=e,d.create=p(),n._configure()}},3155:function(e,t,r){"use strict";e.exports=i;var n=r(1173);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(9693);function i(){n.call(this)}function a(e,t,r){e.length<40?o.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}i._configure=function(){i.alloc=o._Buffer_allocUnsafe,i.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},i.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.amdO={},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{default:function(){return fe}});var e=r(3281),t=r.n(e),o=r(3720),i=r.n(o),a=(r(9601),r(1539),r(8674),r(2526),r(1817),r(2165),r(6992),r(8783),r(3948),r(8309),r(3843),r(3710),r(7327),r(6755),r(1532),r(4812),r(9070),r(7941),r(2222),r(9575),r(2472),r(2990),r(8927),r(3105),r(5035),r(4345),r(7174),r(2846),r(4731),r(7209),r(6319),r(8867),r(7789),r(3739),r(9368),r(4483),r(2056),r(3462),r(678),r(7462),r(3824),r(5021),r(2974),r(5016),r(5827),r(2564),r(9653),r(9554),r(4747),r(6699),r(2023),r(7252)),s=r(4024),c=r(4998),u=r(5531),l=r(6424),d=r(7360),p=["onTextMessage","onFileMessage","onAudioMessage","onVideoMessage","onImageMessage","onLocationMessage","onCustomMessage","onCMDMessage"],h=function(){function e(e,t,r){this.handlerData={},this.handlerData={},e.addEventHandler=this.addEventHandler.bind(this),e.removeEventHandler=this.removeEventHandler.bind(this)}return e.prototype.addEventHandler=function(e,t){this.handlerData[e]=t},e.prototype.removeEventHandler=function(e){delete this.handlerData[e]},e.prototype.dispatch=function(e,t){for(var r in p.includes(e)&&t?d.kg.debug("dispatch event: "+e,{id:t.id,type:t.type,time:t.time,from:t.from,to:t.to,chatType:t.chatType}):"onMessage"===e?d.kg.debug("dispatch event: "+e,null==t?void 0:t.length):d.kg.debug("dispatch event: "+e,t||""),this.handlerData){var n=this.handlerData[r][e];n&&n(t)}},e}(),f=function(){};function m(e){this.onOpened=e.onOpened||f,this.onPresence=e.onPresence||f,this.onTextMessage=e.onTextMessage||f,this.onPictureMessage=e.onPictureMessage||f,this.onAudioMessage=e.onAudioMessage||f,this.onVideoMessage=e.onVideoMessage||f,this.onFileMessage=e.onFileMessage||f,this.onLocationMessage=e.onLocationMessage||f,this.onCmdMessage=e.onCmdMessage||f,this.onCustomMessage=e.onCustomMessage||f,this.onReceivedMessage=e.onReceivedMessage||f,this.onDeliveredMessage=e.onDeliveredMessage||f,this.onReadMessage=e.onReadMessage||f,this.onRecallMessage=e.onRecallMessage||f,this.onChannelMessage=e.onChannelMessage||f,this.onError=e.onError||f,this.onOffline=e.onOffline||f,this.onOnline=e.onOnline||f,this.onStatisticMessage=e.onStatisticMessage||f,this.onContactInvited=e.onContactInvited||f,this.onContactAgreed=e.onContactAgreed||f,this.onContactRefuse=e.onContactRefuse||f,this.onContactDeleted=e.onContactDeleted||f,this.onContactAdded=e.onContactAdded||f,this.onTokenWillExpire=e.onTokenWillExpire||f,this.onTokenExpired=e.onTokenExpired||f,this.onClosed=e.onClosed||f,this.onPresenceStatusChange=e.onPresenceStatusChange||f}r(2772);var g={biz:"",debug:!1,token:""},v="https://data-reporting.agora.io/report",E="https://data-reporting.sh.agoralab.co/report",y=r(2071),_=r(1595),T=function(e){var t=Number(_.C8[e]);return t===_.C8.USER_LOGIN?"MANUALLOGIN":t===_.C8.MSYNC_SENDMESSAGE?"SENDMESSAGE":t>_.C8.UNKNOWOPERATION&&t<_.C8.REST_OPERATE?"REST":t>_.C8.REST_OPERATE&&t<_.C8.MSYNC_OPERATE?"MESSAGE":t>_.C8.MSYNC_OPERATE&&t<_.C8.ROSTER_OPERATE?"ROSTER":t>_.C8.ROSTER_OPERATE&&t<_.C8.USER_OPERATE?"USER":t>_.C8.USER_OPERATE&&t<_.C8.GROUP_OPERATE?"GROUP":t>_.C8.GROUP_OPERATE&&t<_.C8.CHATROOM_OPERATE?"CHATROOM":"OPERATION"},I=function(){return(new Date).getTime()},O=function(e){return[s.iw.BAIDU,s.iw.WX,s.iw.DD,s.iw.ZFB,s.iw.TT,s.iw.QUICK_APP,s.iw.UNI].includes(e.platform)},R=function(){return e=1,t=99999,e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e;var e,t},C=r(4319),N={},S=(r(561),r(1249),function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}),b=1e3,A=function(){function e(e){this.eventQueue=[],this.stock=b,this.config=e,this.governor()}return e.prototype.add=function(e){this.stock<=0?console.warn("Event Report limit ".concat(b," per minute")):(this.eventQueue.push(e),this.consume(),this.stock-=1)},e.prototype.consume=function(){var e=this;0!==this.eventQueue.length&&(this.timer&&this.eventQueue.length<=10&&clearTimeout(this.timer),this.timer=setTimeout((function(){var t,r=e.eventQueue.splice(0,10),n=r.filter((function(e){return e.appId===r[0].appId})),o=r.filter((function(e){return e.appId!==r[0].appId}));(t=e.eventQueue).unshift.apply(t,o),e.batchSend(n)}),1e3))},e.prototype.governor=function(){var e=this,t=setInterval((function(){e.stock=b}),6e4);"undefined"!=typeof addEventListener&&addEventListener("beforeunload",(function(){clearInterval(t)}))},e.prototype.batchSend=function(e){var t,r;if(void 0===e&&(e=[]),0!==e.length)try{var n=e.map((function(e){e.biz,e.appId;var t=e.eventId,r=S(e,["biz","appId","eventId"]);return{eventId:Number(t),body:r}}));!function(e,t){try{var r=t.biz,n=t.appId,o=t.data,i=t.debug,a=t.onSuccess;if(!r)throw new Error("biz is not defined");N.global||(N=s.P6.getEnvInfo());var c=N;if(O(c)){var u={url:i?E:v,data:o,method:"POST",timeout:C.zj,success:function(){null==a||a()},fail:function(){},complete:function(){}},l={token:e,appid:null!=n?n:"",sendts:"".concat(Math.floor((new Date).getTime()/1e3)),biz:r,debug:"".concat(i)};if("zfb"===c.platform||"dd"===c.platform?u.headers=l:u.header=l,"dd"===c.platform)return c.global.httpRequest(u);c.global.request(u)}else{var d=new XMLHttpRequest;d.onreadystatechange=function(){2===d.readyState&&(null==a||a())},d.open("POST",i?E:v),d.setRequestHeader("Content-Type","application/json"),d.setRequestHeader("token",e),d.setRequestHeader("appid",null!=n?n:""),d.setRequestHeader("sendts","".concat(Math.floor((new Date).getTime()/1e3))),d.setRequestHeader("biz",r),d.setRequestHeader("debug","".concat(i)),d.send(JSON.stringify(o))}}catch(e){console.error(e)}}(this.config.token,{biz:null===(t=e[0])||void 0===t?void 0:t.biz,appId:null===(r=e[0])||void 0===r?void 0:r.appId,data:n,debug:this.config.debug,onSuccess:this.consume.bind(this)})}catch(e){console.error(e)}},e}(),M=function(){return M=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},M.apply(this,arguments)},w=new(function(){function e(e){this.inited=!1,this.appId="",this.biz="",this.eventQueue={},this.config=g,e&&this.init(e)}return e.prototype.init=function(e){var t;if(void 0===e&&(e={}),!e.biz||!e.token)throw new Error("Event Report: biz or token is not defined");try{this.appId=null!==(t=e.appId)&&void 0!==t?t:"",this.biz=e.biz,this.config=M(M({},g),e),this.eventQueue=new A(this.config),this.log(e),this.inited=!0}catch(e){console.error(e)}},e.prototype.updateAppId=function(e){this.appId=e},e.prototype.send=function(e,t,r){var n;if(void 0===t&&(t={}),this.inited){var o=M(M({},t),{eventId:Number(e),biz:this.biz,appId:null!==(n=null==r?void 0:r.appId)&&void 0!==n?n:this.appId});this.eventQueue.add(o),this.log(o)}else console.error("Event Report: init is not called")},e.prototype.log=function(e){try{if(this.config.debug){var t=e.payload,r=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["payload"]);console.log("%c Event Report: ".concat(this.config.biz," "),"background: #8A97FC; color: #fff"),console.table(r),t&&(console.info("payload:"),console.table(t))}}catch(e){console.error(e)}},e}()),P=function(){return P=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},P.apply(this,arguments)},U={requestName:"",subrequestid:"1",requestMethod:"GET",requestUrl:"",requestElapse:0,code:0,codeDesc:"",isLastApi:0,isSuccess:1},k=function(){function e(e){this.platform=s.P6.getEnvInfo(),this.isReportDt=e.isReport||!1,this.isCollectDt=!0,O(this.platform)&&!this.isReportDt&&(this.isCollectDt=!1),this.eventQueue=[],this.accessChannel=y.yK,this.options=function(e,t){t.platform||(t=s.P6.getEnvInfo());var r=e.org,n=e.appkey,o=e.deviceId,i=e.sdkVersion,a="undefined"!=typeof navigator?null===navigator||void 0===navigator?void 0:navigator.userAgent:"".concat(t.platform,"_mini_program");return{org:r,appkey:n,deviceId:o,sdkServiceId:"sid_".concat(s.P6.getUniqueId(),"_").concat(R()),did:a,sdkVersion:i,os:y.Wc,sdkProduct:_.aC.web}}(e,this.platform),this.sid=this.options.sdkServiceId,this.init(e)}return e.getInstance=function(t){return e.instance||(e.instance=new e(t)),e.instance},e.prototype.getServiceId=function(){return this.sid||"sid_0"},e.prototype.setIsReportDt=function(e){this.isReportDt=e,e&&this.rptEventQueue()},e.prototype.setIsCollectDt=function(e){this.isCollectDt=e,e||(this.eventQueue=[])},e.prototype.rptEventQueue=function(){var e=this;this.eventQueue.length&&this.eventQueue.forEach((function(t,r){w.send(t.eventId,t.dt),r>=e.eventQueue.length-1&&(e.eventQueue=[])}))},e.prototype.init=function(t){e.instance||(e.instance=this,w.init({biz:y.el,token:y.$x,appId:t.appkey,debug:!1}),this.reportInit())},e.prototype.updateAppKey=function(e){this.options.appkey=e,this.eventQueue.forEach((function(t){"default#appkey"===t.dt.appkey&&(t.dt.appkey=e)}))},e.prototype.reportInit=function(){if(this.isCollectDt){var e=this.options,t=e.did,r=e.os,n=e.sdkVersion,o=e.deviceId;this.reportData(y.iB.INIT,{did:t,os:r,sdkVersion:n,deviceId:o})}},e.prototype.geOperateFun=function(e){var t=this;if(!this.isCollectDt)return function(){};var r=1,n=0,o="",i=I(),a=e.uid,c=e.operationName;a&&(this.uid=a);var u={uid:this.uid,operationId:"opr_".concat(s.P6.getUniqueId(),"_").concat(R()),requestid:"req_".concat(s.P6.getUniqueId(),"_").concat(R()),operationName:c};return function(e){var a,l,d,p;if(e.data.isSuccess?(n=0,o=""):(0===e.data.code&&(e.data.code=y.Tp),n=null!==(a=e.data.code)&&void 0!==a?a:n,o=null!==(l=e.data.codeDesc)&&void 0!==l?l:o),(null===(d=e.data)||void 0===d?void 0:d.accessChannel)&&(t.accessChannel=null===(p=e.data)||void 0===p?void 0:p.accessChannel),e.isRetry?(r++,e.data.subrequestid="".concat(r)):(u.requestid="req_".concat(s.P6.getUniqueId(),"_").concat(R()),r=1),e.data.isLastApi){var h=I();e.data.requestElapse=h-i,e.data.requestMethod="",e.data.subrequestid="0",e.data.code=200===n?0:n,e.data.codeDesc=o}else e.data.requestName||(e.data.requestName=c);e.data.requestElapse||(e.data.requestElapse=I()-i),t.reportData.call(t,y.iB.API,P(P(P(P({},U),u),e.data),{accessChannel:t.accessChannel,operationType:T(c)})),e.isEndApi&&t.reportData.call(t,y.iB.API,P(P(P({},u),U),{isSuccess:e.data.isSuccess,isLastApi:1,subrequestid:"0",requestMethod:"",code:200===n?0:n,codeDesc:o,requestElapse:e.data.requestElapse,accessChannel:t.accessChannel,operationType:T(c)}))}},e.prototype.reportData=function(e,t){return r=this,n=void 0,i=function(){var r,n,o,i,a,c,u,l;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),r=I(),n=0,e!==y.iB.API?[3,2]:[4,(p=this.platform,new Promise((function(e){var t;p.platform||(p=s.P6.getEnvInfo());var r="";if(p.platform===s.iw.WEB){var n=navigator.connection;(null==n?void 0:n.type)?(null==n||n.type,r=_.td.WIFI):(null==n?void 0:n.effectiveType)&&(r=_.td[n.effectiveType.toLocaleUpperCase()]),e(r)}else p.platform===s.iw.NODE?(r=_.td.UNKNOWN,e(r)):null===(t=p.global)||void 0===t||t.getNetworkType({success:function(t){r=_.td[t.networkType.toLocaleUpperCase()],e(r)}})})))];case 1:n=d.sent(),d.label=2;case 2:return o=this.options,i=o.appkey,a=o.sdkServiceId,c=o.sdkProduct,u=P({lts:r,net:n,appkey:i,sdkServiceId:a,sdkProduct:c},t),this.isReportDt?w.send(e,u):this.isCollectDt&&this.eventQueue.push({eventId:e,dt:u}),[3,4];case 3:return l=d.sent(),console.warn(l),[3,4];case 4:return[2]}var p}))},new((o=void 0)||(o=Promise))((function(e,t){function a(e){try{c(i.next(e))}catch(e){t(e)}}function s(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(a,s)}c((i=i.apply(r,n||[])).next())}));var r,n,o,i},e}(),x=r(7288),L=r(7479),D=r(2856),j=r(9667),B=r(3770),G=r(1735),H=r(7384),F=r(70),W=r(8161);function K(e){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K(e)}var q=function(){return q=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},q.apply(this,arguments)},z=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},V=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},X=s.P6.getEnvInfo(),J=function(){function e(t){var r,n=this;if(this.name="connection",this.appKey="",this.dnsTotal=0,this.max_cache_length=100,this._reportLogs=!1,this._reportInterval=C.XV,this._isLogging=!1,this._initWithAppId=!1,this.lastHeartbeat=Date.now(),this.isDebug=t.isDebug||!1,this.isReport=!1,this.uploadPartEnable=!0,this.isHttpDNS=void 0===t.isHttpDNS||t.isHttpDNS,this.heartBeatWait=t.heartBeatWait||C.al,this.autoReconnectNumMax=t.autoReconnectNumMax||C.ke,this.refreshDNSIntervals=this.autoReconnectNumMax<5?this.autoReconnectNumMax:5,this.delivery=t.delivery||!1,this.disconnectedReason=void 0,this.loginInfoCustomExt=void 0,this.https=s.P6.isUseHttps(t.https),this.dnsArr=["https://rs.easemob.com","https://rs.chat.agora.io","http://59.110.89.59","http://39.97.193.190","http://39.97.193.187"].filter((function(e){return e.startsWith(n.https?"https":"")})),this.dnsIndex=0,this.restHosts=[],this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.socketHost=[],this.hostTotal=0,this.times=1,this.autoReconnectNumTotal=0,this.domain="easemob.com",this.dnsTotal=this.dnsArr.length,"appKey"in t&&(this.appKey=t.appKey),"appId"in t&&(this.appId=t.appId,this._initWithAppId=!0),this.appName="",this.orgName="",this.token="",this.grantType="",this.apiUrl=t.apiUrl||"",this.url=t.url||"",this.version="4.14.0",this.deviceId=t.deviceId||"webim",this.isFixedDeviceId=null===(r=t.isFixedDeviceId)||void 0===r||r,this.osType=16,this.useOwnUploadFun=t.useOwnUploadFun||!1,this.compressType=[0],this.encryptType=[0],this.clientResource="",this.expiresIn=0,this.expirationTime=0,this.useReplacedMessageContents=t.useReplacedMessageContents||!1,this.logOut=!0,this.context={jid:{appKey:"",clientResource:"",domain:"easemob.com",name:""},userId:"",appKey:"",appId:"",status:0,restTokenData:"",appName:"",orgName:"",root:{},accessToken:""},this._msgHash={},this._msgPromiseHash={},this._queues=[],this._load_msg_cache=[],this.unMSyncSendMsgMap=new Map,this.mr_cache={},this.reconnecting=!1,this._offlineMessagePullState=c.a.SYNC_INIT,this._offlineMessagePullQueue=[],this.uniPushConfig={},this.uniPush=null,this.isRegisterPush=!1,this.pushCertificateName="",void 0!==t.customOSPlatform){if("number"!=typeof t.customOSPlatform||t.customOSPlatform<1||t.customOSPlatform>100)throw Error("Invalid customOSPlatform: ".concat(t.customOSPlatform));this.customOSPlatform=t.customOSPlatform,this.deviceId=t.customDeviceName||this.deviceId}if(this._initWithAppId){if(this.appKey="","string"!=typeof this.appId||!this.appId)throw Error("Invalid appId: ".concat(this.appId))}else{if("string"!=typeof this.appKey||2!==this.appKey.split("#").length)throw Error("Invalid appKey: ".concat(this.appKey));this.devInfos=this.appKey.split("#"),this.orgName=this.devInfos[0],this.appName=this.devInfos[1]}this.listen=m.bind(this),this.mSync=this.usePlugin(l.ZP),this.eventHandler=this.usePlugin(h),Object.assign(e.prototype,L),Object.assign(e.prototype,D),Object.assign(e.prototype,j),Object.assign(e.prototype,B),Object.assign(e.prototype,G),Object.assign(e.prototype,H),Object.assign(e.prototype,F),this.dataReport=new k({appkey:this.appKey||"default#appkey",org:this.orgName,sdkVersion:this.version,deviceId:this.deviceId,isReport:this.isReport});var o=0,i=this;if(Object.defineProperty(s.P6,"ajaxUnconventionalErrorTimes",{set:function(e){0!==e&&(d.kg.debug("rest api request fail times: ".concat(e)),(o=e)%5==0&&i.isHttpDNS&&(d.kg.debug("refresh dns config when rest request fail."),se.call(i,(function(){})).catch((function(e){d.kg.error("refresh dns config error",e)}))))},get:function(){return o}}),this.isFixedDeviceId){var a=s.P6.getLocalDeviceInfo();a&&(this.clientResource=JSON.parse(a).deviceId)}d.kg.debug("init SDK: Conn ".concat(this.version," ").concat(X.platform))}return e.prototype.usePlugin=function(e,t){if("push"!==t)return t?void(this[t]=new e(this)):new e(this);e.config&&e.emPush?(this.uniPushConfig=e.config,this.uniPush=e.emPush):d.kg.error("use push plugin failed","emPush",this.uniPush,"config",this.uniPushConfig)},e.prototype.listen=function(e){},e.prototype.addEventHandler=function(e,t){},e.prototype.removeEventHandler=function(e){},e.prototype.registerUser=function(e){return z(this,void 0,void 0,(function(){var t,r;return V(this,(function(n){switch(n.label){case 0:if(!e.username||!e.password)throw Error("Invalid parameter");n.label=1;case 1:return n.trys.push([1,5,,6]),t=this.dataReport.geOperateFun({uid:e.username,operationName:_.fI.REGISTER}),this.isHttpDNS?(this.dnsIndex=0,[4,se.call(this,t)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[4,Y.call(this,e,{rpt:t})];case 4:return[2,n.sent()];case 5:throw r=n.sent(),e.error&&e.error(r),r;case 6:return[2]}}))}))},e.prototype.open=function(e){var t;return z(this,void 0,void 0,(function(){var r,n,o,i,c,l;return V(this,(function(p){switch(p.label){case 0:if(d.kg.debug("open",e.user,"isLogout:",this.logOut),this._isLogging)throw n=a.Z.create({type:u.E.WEBIM_CONNCTION_OPEN_ERROR,message:"Currently logging in, please wait."});if(!this.logOut)throw n=a.Z.create({type:u.E.WEBIM_USER_ALREADY_LOGIN,message:"The user has logged in."});this.retryConnectTimes=0,this._isLogging=!0,p.label=1;case 1:if(p.trys.push([1,6,7,8]),"web"===X.platform&&(r=s.P6.detectBrowser(),d.kg.debug("browser",r)),n=oe.call(this,e))throw null===(t=this.onError)||void 0===t||t.call(this,n),n;return e.accessToken&&(this.token=e.accessToken),o=q({},e),i=this.dataReport.geOperateFun({uid:e.user,operationName:_.fI.LOGIN}),this.dnsIndex=0,this.isHttpDNS?[4,se.call(this,i)]:[3,3];case 2:p.sent(),p.label=3;case 3:return d.kg.initReport({report:this._reportLogs,reportInterval:this._reportInterval,connection:this}),[4,$.call(this,o,{rpt:i})];case 4:return c=p.sent(),[4,re.call(this,i)];case 5:return p.sent(),d.kg.debug("grantType",this.grantType),s.P6.listenNetwork(ee.bind(this),te.bind(this)),s.P6.listenBrowserVisibility((function(){d.kg.debug("visibility: true")}),(function(){d.kg.debug("visibility: false")})),[2,c];case 6:throw l=p.sent(),this._isLogging=!1,e.error&&e.error(l),d.kg.error("login failed",l),l;case 7:return d.kg.reportLog(),[7];case 8:return[2]}}))}))},e.prototype.isOpened=function(){return this.sock&&1===this.sock.readyState||!1},e.prototype.close=function(){var e,t,r;d.kg.debug("call close"),d.kg._stopReportLogs(),this.logOut=!0,this.disconnectedReason=void 0,this.reconnecting=!1,this.context.status=u.E.STATUS_CLOSING,this.sock&&this.sock.close(),null===(e=this.unMSyncSendMsgMap)||void 0===e||e.clear(),this.stopHeartBeat(),this.rejectMessage(),this.context.status=u.E.STATUS_CLOSED,this._load_msg_cache=[],this._queues=[],this._msgHash={},this.mr_cache={},this.token="",this.context.accessToken="",this.isRegisterPush=!1,this.clearTokenTimeout(),null===(r=null===(t=null==this?void 0:this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.close(),this.connectionTimer&&clearTimeout(this.connectionTimer),this.provisionTimer&&clearTimeout(this.provisionTimer),this.probingTimer&&clearTimeout(this.probingTimer)},e.prototype.downloadAndParseCombineMessage=function(e){var t=this,r=e.url,n=e.secret;return new Promise((function(e,o){var i,a,c=s.P6.getEnvInfo(),l="web"!==c.platform&&"node"!==c.platform&&"quick_app"!==c.platform&&(null===(a=null===(i=c.global)||void 0===i?void 0:i.canIUse)||void 0===a?void 0:a.call(i,"getFileSystemManager")),p=function(r){var n=function(e){o({type:u.E.PARSE_FILE_ERROR,message:"Read file failed",data:e})},i=function(r){return z(t,void 0,void 0,(function(){var t,n,i,a,c,p,h,f,m,g,v,E,y;return V(this,(function(_){switch(_.label){case 0:for(t=l?new Uint8Array(r.data):new Uint8Array(r.target.result),n=0,i=0,a=2,c=t.subarray(n,n+a),p=s.P6.Uint8ArrayToString(c),d.kg.debug("file header:",p),i+=a,h=0,f=2;f<t.length-1;f++)f%2==1&&(h^=t[f]);if(m=t.subarray(t.length-1,t.length),d.kg.debug("checkResult:",h,m[0]===h),m[0]!==h)return[2,o({type:u.E.PARSE_FILE_ERROR,message:"File verification failed"})];if("cm"!==p)return[3,7];_.label=1;case 1:_.trys.push([1,5,,6]),g=[],v=function(){var e,r,o,s;return V(this,(function(c){switch(c.label){case 0:return n+=a,i+=a=4,e=t.subarray(n,n+a),n+=a,a=e.reduce((function(t,r,n){return t+(r<<8*(e.length-n-1))}),0),i+=a,r=t.subarray(n,n+a),o=(o=E.root.lookup("easemob.pb.Meta")).decode(r),[4,W.ZP.call(E,o,0,!0,!0)];case 1:return s=c.sent(),g.push(s),[2]}}))},E=this,_.label=2;case 2:return i<t.length-1?[5,v()]:[3,4];case 3:return _.sent(),[3,2];case 4:return[2,e(g)];case 5:return y=_.sent(),o({type:u.E.PARSE_FILE_ERROR,message:"Parse file failed",data:y}),[3,6];case 6:return[3,8];case 7:return[2,o({type:u.E.PARSE_FILE_ERROR,message:"File verification failed"})];case 8:return[2]}}))}))};if(l){var a=c.global.getFileSystemManager(),p=r.tempFilePath;a.readFile({filePath:p,success:i,fail:n})}else if(r instanceof Blob){var h=new FileReader;h.readAsArrayBuffer(r),h.onerror=n,h.onload=i}},h=function(e){o({type:u.E.WEBIM_DOWNLOADFILE_ERROR,message:"Download failed, please try again",data:e})};l?c.global.downloadFile({url:r,success:p,fail:h}):s.P6.download.call(t,{url:r,headers:{Accept:"application/json"},onFileDownloadComplete:p,onFileDownloadError:h,secret:n,accessToken:t.context.accessToken})}))},e.prototype.stopHeartBeat=function(){clearInterval(this.heartBeatID)},e.prototype.clear=function(){this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.hostTotal=0},e.prototype.heartBeat=function(){},e.prototype.renewToken=function(e){var t=this,r=this.isOpened();return d.kg.debug("isOpened",r),r?this.getTokenExpireTimestamp(e).then((function(r){var n=r.expire_timestamp,o=Date.now();return t.expirationTime=n,t.expiresIn=n-o,t.token=e,t.context.accessToken=e,t.clearTokenTimeout(),t.tokenExpireTimeCountDown(t.expiresIn),{status:!0,token:e,expire:n}})):Promise.reject({status:!1})},e.prototype.clearTokenTimeout=function(){d.kg.info("clearTokenTimeout"),this.tokenWillExpireTimer&&clearTimeout(this.tokenWillExpireTimer),this.tokenExpiredTimer&&clearTimeout(this.tokenExpiredTimer),this.tokenWillExpireTimer=null,this.tokenExpiredTimer=null},e.prototype.tokenExpireTimeCountDown=function(e){var t=this;d.kg.info("tokenExpireTimeCountDown",e),e>Math.pow(2,31)-1&&(e=Math.pow(2,31)-1),this.tokenWillExpireTimer=setTimeout((function(){var r;t.onTokenWillExpire&&t.onTokenWillExpire(),null===(r=t.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),d.kg.info("onTokenWillExpire",Math.floor(e/2))}),e/2),this.tokenExpiredTimer=setTimeout((function(){var e;d.kg.info("onTokenExpired",0),t.onTokenExpired&&t.onTokenExpired(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),t.close()}),e)},e.prototype.compareTokenExpireTime=function(e,t){var r,n=Number(t)-Number(e);d.kg.debug("compareTokenExpireTime",n),n<=this.expiresIn/2&&n>0?(this.onTokenWillExpire&&this.onTokenWillExpire(),null===(r=this.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),d.kg.info("onTokenWillExpire",n)):n<=0&&(this.closeByTokenExpired(),d.kg.info("closeByTokenExpired",n))},e.prototype.closeByTokenExpired=function(){var e;d.kg.info("closed By TokenExpired"),this.onTokenExpired&&this.onTokenExpired(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),this.close()},e.prototype.rejectMessage=function(){var e=this,t=Object.keys(this._msgHash);if(t.length>0){var r=a.Z.create({type:u.E.MESSAGE_WEBSOCKET_DISCONNECTED,message:"websocket disconnected"});t.forEach((function(t){var n,o,i;(null===(n=e.unMSyncSendMsgMap)||void 0===n?void 0:n.has(t))||(e._msgHash[t].reject instanceof Function&&e._msgHash[t].reject(r),null===(i=null===(o=e._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.updateLocalMessage(t,{serverMsgId:t,status:x.r.FAIL}),e._msgHash[t].fail instanceof Function&&e._msgHash[t].fail(r),e._msgHash[t].messageTimer&&clearTimeout(e._msgHash[t].messageTimer),delete e._msgHash[t])}))}},e.prototype.resetConnState=function(){this.mSync.stopHeartBeat(),this.times=1,this.autoReconnectNumTotal=0,this.hostIndex=0},e.prototype.reconnect=function(e){var t,r=this;if(this.logout)return d.kg.warn("The user has already logged out when reconnecting");if(d.kg.debug("socket reconnect readyState",this.sock.readyState),(0!==this.sock.readyState||e)&&(1!==this.sock.readyState||e)){d.kg.info("reconnect: time",this.times),d.kg.info("reconnect sock.readyState: ",this.sock.readyState),!1===this.reconnecting&&(this.reconnecting=!0),null===(t=this.eventHandler)||void 0===t||t.dispatch("onReconnecting"),this.rejectMessage(),this.isHttpDNS&&(this.hostIndex<this.socketHost.length-1?this.hostIndex++:this.hostIndex=this.socketHost.length-1);var n=1e3*s.P6.getRetryDelay(this.times);d.kg.info("reconnect delay: ",n),setTimeout((function(){(1!==r.sock.readyState||e)&&(d.kg.info("login sock.readyState: ",r.sock.readyState),r.sock.close(),ne.call(r).catch((function(e){d.kg.error("reconnect websocket failed",e)})),r.times++)}),n),this.autoReconnectNumTotal++}},e.prototype.send=function(e){return Promise.resolve(null)},e.prototype.setLoginInfoCustomExt=function(e){if(d.kg.debug("setLoginInfoCustomExt","params:",e),e){if("string"!=typeof e)throw new Error("ext must be a string");if(e.length>1024)throw new Error("ext length must be less than 1024")}this.loginInfoCustomExt=e},e.prototype.onShow=function(){var e=this;d.kg.debug("execute onshow callback",this.lastHeartbeat),!this.logOut&&!this.reconnecting&&Date.now()-this.lastHeartbeat>2e3&&(d.kg.debug("send ping"),this.mSync.sendUnreadDeal(),this.probingTimer&&clearTimeout(this.probingTimer),this.probingTimer=setTimeout((function(){d.kg.error("Websocket connection timeout"),e.logOut||e.reconnecting||e.reconnect(!0)}),C.xd))},e._getSock=function(){},e}();function Z(e,t){var r=t.rpt,n=t.isRetry,o=this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users",i={requestName:_.c.RESISTER,requestUrl:o},a={headers:{"Content-Type":"application/json"},url:o,dataType:"json",data:JSON.stringify({username:e.username,password:e.password,nickname:e.nickname||""})};return s.P6.ajax(a,_.fI.SDK_INTERNAL).then((function(e){var t=q(q({},e),{type:u.E.REQUEST_SUCCESS}),o=e.extraInfo,a=o.httpCode,s=o.elapse;return r({isEndApi:!0,isRetry:n,data:q(q({},{requestElapse:s,isSuccess:1,code:a}),i)}),t})).catch((function(e){var t=e.extraInfo,o=t.elapse,a=t.httpCode,s=t.errDesc;throw r({isRetry:n,data:q(q({},{requestElapse:o,isSuccess:0,code:a,codeDesc:s}),i)}),e}))}function Y(e,t){return z(this,void 0,void 0,(function(){var r,n;return V(this,(function(o){switch(o.label){case 0:r=t.rpt,o.label=1;case 1:return o.trys.push([1,3,,7]),[4,Z.call(this,e,t)];case 2:return[2,o.sent()];case 3:return!((n=o.sent()).message.includes("Open registration doesn't allow")||n.message.includes("username be unique")||n.message.includes("is not legal"))&&this.isHttpDNS&&this.restIndex+1<this.restTotal?(this.restIndex++,ue.call(this),[4,Y.call(this,e,{rpt:r})]):[3,5];case 4:return[2,o.sent()];case 5:throw d.kg.error("retry signup failed",n),r({data:{isLastApi:1,isSuccess:0}}),n;case 6:return[3,7];case 7:return[2]}}))}))}function Q(e,t){var r;return z(this,void 0,void 0,(function(){var n,o,i,a,c,u,l,p,h,f=this;return V(this,(function(m){switch(m.label){case 0:if(n=oe.call(this,e))throw n;return d.kg.debug("socket readyState",null===(r=this.sock)||void 0===r?void 0:r.readyState),o=t.rpt,i=t.isRetry,ie.call(this,e),this.user=e.user,a=this.context.appName,c=this.context.orgName,u=this.apiUrl+"/"+c+"/"+a+"/token",e.accessToken?(d.kg.debug("login with accessToken"),this.grantType="accessToken",this.token=e.accessToken,this.context.accessToken=e.accessToken,this.context.restTokenData=e.accessToken,[2,{accessToken:e.accessToken}]):[3,1];case 1:return e.agoraToken?(d.kg.debug("login with agoraToken"),this.grantType="agoraToken",this.token=e.agoraToken,this.context.accessToken=e.agoraToken,this.context.restTokenData=e.agoraToken,[2,{accessToken:e.agoraToken}]):[3,2];case 2:return d.kg.debug("login with password"),this.grantType="password",l={grant_type:"password",username:e.user,password:e.pwd,timestamp:+new Date},p=JSON.stringify(l),h={headers:{"Content-Type":"application/json"},url:u,dataType:"json",data:p,version:this.version},d.kg.debug("start get token"),[4,s.P6.ajax(h,_.fI.SDK_INTERNAL).then((function(e){d.kg.debug("get token success",e),f.token=e.access_token,f.context.restTokenData=e.access_token,f.context.accessToken=e.access_token,f.expiresIn=e.expires_in;var t=e.extraInfo,r=t.httpCode,n=t.elapse,a={requestName:_.c.LOGIN_BY_PWD,requestElapse:n,requestUrl:u,isSuccess:1,code:r};return o({isRetry:i,data:a}),{accessToken:e.access_token,duration:e.expires_in}})).catch((function(e){var t=e.extraInfo,r=t.elapse,n=t.httpCode,a=t.errDesc,s={requestName:_.c.LOGIN_BY_PWD,requestElapse:r,requestUrl:u,isSuccess:0,code:n,codeDesc:a};throw o({isRetry:i,data:s}),e}))];case 3:return[2,m.sent()]}}))}))}function $(e,t){var r;return z(this,void 0,void 0,(function(){var n,o,i;return V(this,(function(s){switch(s.label){case 0:n=t.rpt,s.label=1;case 1:return s.trys.push([1,3,,7]),[4,Q.call(this,e,t)];case 2:return[2,s.sent()];case 3:return"invalid password"!==(o=s.sent()).message&&"user not found"!==o.message&&this.isHttpDNS&&this.restIndex+1<this.restTotal?(this.restIndex++,ue.call(this),[4,$.call(this,e,{rpt:n,isRetry:!0})]):[3,5];case 4:return[2,s.sent()];case 5:throw d.kg.error("retry login failed",o),n({data:{isLastApi:1,isSuccess:0}}),this.clear(),i=void 0,o.error&&o.error_description?(i=a.Z.create({type:u.E.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,message:o.error_description,data:o}),this.onError&&this.onError(i),i):(i=a.Z.create({type:u.E.WEBIM_CONNCTION_OPEN_ERROR,message:null!==(r=o.message)&&void 0!==r?r:"login failed",data:o}),this.onError&&this.onError(i),i);case 6:return[3,7];case 7:return[2]}}))}))}function ee(){var e;d.kg.debug("online"),this.onOnline&&this.onOnline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOnline"),this.sock&&1!==this.sock.readyState&&(d.kg.debug("sock.readyState:",this.sock.readyState),this.logOut||this.reconnecting||this.reconnect())}function te(){var e,t;d.kg.debug("offline"),null===(e=this.sock)||void 0===e||e.close(),this.onOffline&&this.onOffline(),null===(t=this.eventHandler)||void 0===t||t.dispatch("onOffline")}function re(e){var t,r,n;return z(this,void 0,void 0,(function(){var o,i,a,s;return V(this,(function(c){switch(c.label){case 0:o=(new Date).getTime(),c.label=1;case 1:return c.trys.push([1,3,,7]),[4,ne.call(this,e)];case 2:return i=c.sent(),e&&e({data:{isLastApi:1,isSuccess:1,accessChannel:null===(t=this.socketHost[this.hostIndex])||void 0===t?void 0:t.channel}}),[2,i];case 3:if(a=c.sent(),d.kg.error("connect to msync failed times:",this.retryConnectTimes,a),C.bh.includes(a.type))throw e&&e({data:{isLastApi:1,isSuccess:0,accessChannel:null===(r=this.socketHost[this.hostIndex])||void 0===r?void 0:r.channel,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||a.message}}),a;return this.retryConnectTimes++,this.retryConnectTimes<C.Ge?(this.isHttpDNS&&(this.hostIndex<this.socketHost.length-1?this.hostIndex++:this.hostIndex=this.socketHost.length-1,ce.call(this)),a.type===u.E.REQUEST_TIMEOUT&&"provision timeout"===a.message||(s=(new Date).getTime()-o,null==e||e({isRetry:1!==this.retryConnectTimes,data:{requestUrl:this.url,requestName:_.c.CONNECT_WEBSOCKET,isSuccess:0,code:_.dd.closed,requestElapse:s,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||"websocket close"}})),[4,re.call(this,e)]):[3,5];case 4:return c.sent(),[3,6];case 5:throw d.kg.error("connect failed three times",a),e&&e({data:{isLastApi:1,isSuccess:0,accessChannel:null===(n=this.socketHost[this.hostIndex])||void 0===n?void 0:n.channel,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||a.message}}),a;case 6:return[3,7];case 7:return[2]}}))}))}function ne(e){var t=this,r=(new Date).getTime(),n="pending";return new Promise((function(o,i){var c;t._getSock?void 0===(c=t._getSock()).readyState&&(t.needSetReadyState=!0):(c=new WebSocket(t.url)).binaryType="arraybuffer",t.sock=c,t.connectionTimer&&clearTimeout(t.connectionTimer),t.connectionTimer=setTimeout((function(){t.disconnectedReason={type:u.E.REQUEST_TIMEOUT,message:"connection timeout"},c.close(),null==i||i(t.disconnectedReason)}),C.th),d.kg.debug("start connect ws"),t.connectionResolve=o,t.connectionReject=i;var l=function(){if(t.connectionTimer&&clearTimeout(t.connectionTimer),d.kg.debug("websocket onOpen"),e){var n=(new Date).getTime()-r;e({isRetry:0!==t.retryConnectTimes,data:{requestUrl:t.url,requestName:_.c.CONNECT_WEBSOCKET,isSuccess:1,code:_.dd.success,requestElapse:n}})}var o;o=t._getSock?s.P6.flow([t.mSync.generateProvision,t.mSync.base64transform])():t.mSync.generateProvision();try{t.provisionTimer&&clearTimeout(t.provisionTimer),t.provisionTimer=setTimeout((function(){d.kg.debug("provision timeout"),t.disconnectedReason=a.Z.create({type:u.E.REQUEST_TIMEOUT,message:"provision timeout"}),c.close(),null==i||i(t.disconnectedReason)}),C.Nt),c.send(o)}catch(e){var l=a.Z.create({type:u.E.SDK_RUNTIME_ERROR,message:"send message error",data:e});t.onError&&t.onError(l)}},p=function(e){t.connectionTimer&&clearTimeout(t.connectionTimer),setTimeout((function(){var r,o,s,c,l,p,h;if(d.kg.debug("websocket onClose, isLogging:",t._isLogging,e),t.needSetReadyState&&(t.sock=q(q({},t.sock),{close:t.sock.close,send:t.sock.send,readyState:3})),t._isLogging)return null==i||i({type:u.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}),void(n="rejected");if("rejected"!==n)if(n="rejected",t.logOut)t.clear(),t.resetConnState(),null===(o=null===(r=null==t?void 0:t._localCache)||void 0===r?void 0:r.getInstance())||void 0===o||o.close(),t.onClosed&&t.onClosed(),null===(s=t.eventHandler)||void 0===s||s.dispatch("onDisconnected",t.disconnectedReason),null==i||i(t.disconnectedReason||{type:u.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"});else if(t.autoReconnectNumTotal<t.autoReconnectNumMax){t.reconnect();var f={type:u.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};t.onError&&t.onError(f),t.autoReconnectNumTotal%t.refreshDNSIntervals==0&&t.isHttpDNS&&(d.kg.debug("refresh dns config when websocket close"),se.call(t,(function(){})).catch((function(e){d.kg.error("refresh dns config failed",e)})))}else null===(c=t.unMSyncSendMsgMap)||void 0===c||c.clear(),t.rejectMessage(),f={type:u.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"},t.disconnectedReason=a.Z.create({type:u.E.WEBIM_CONNCTION_DISCONNECTED,message:"reconnection failed"}),t.onError&&t.onError(f),null===(p=null===(l=null==t?void 0:t._localCache)||void 0===l?void 0:l.getInstance())||void 0===p||p.close(),t.onClosed&&t.onClosed(),null===(h=t.eventHandler)||void 0===h||h.dispatch("onDisconnected",t.disconnectedReason),t.resetConnState(),t.reconnecting=!1,null==i||i(f),d.kg.debug("reconnect fail");else d.kg.debug("reject is null")}),0)},h=function(e){var r=t.mSync,n=r.decodeMSync,o=r.distributeMSync;s.P6.flow([n,o])(e)};"web"===X.platform?(c.onopen=l,c.onclose=p,c.onmessage=h):(c.onOpen(l),c.onMessage(h),c.onClose(p),"undefined"!=typeof window&&window.WebSocket||c.onError((function(e){var r,o,s,c;if(t.connectionTimer&&clearTimeout(t.connectionTimer),d.kg.debug("websocket onerror, isLogging:",t._isLogging,e),3!==t.sock.readyState&&(t.sock=q(q({},t.sock),{close:t.sock.close,send:t.sock.send,readyState:3})),t.onError&&t.onError({type:u.E.WEBIM_CONNECTION_ERROR,message:"on socket error",data:e}),t._isLogging)return null==i||i({type:u.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}),void(n="rejected");if("rejected"!==n){if(n="rejected",!t.logOut)if(t.autoReconnectNumTotal<t.autoReconnectNumMax)d.kg.debug("sock.onError reconnect",t.autoReconnectNumTotal,t.autoReconnectNumMax),t.reconnect(),t.autoReconnectNumTotal%t.refreshDNSIntervals==0&&t.isHttpDNS&&(d.kg.debug("refresh dns config when websocket error"),se.call(t,(function(){})).catch((function(e){d.kg.error("refresh dns config failed",e)})));else{var l={type:u.E.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};t.disconnectedReason=a.Z.create({type:u.E.WEBIM_CONNCTION_DISCONNECTED,message:"reconnection failed"}),null===(r=t.unMSyncSendMsgMap)||void 0===r||r.clear(),t.rejectMessage(),t.onError&&t.onError(l),null===(s=null===(o=null==t?void 0:t._localCache)||void 0===o?void 0:o.getInstance())||void 0===s||s.close(),t.onClosed&&t.onClosed(),null===(c=t.eventHandler)||void 0===c||c.dispatch("onDisconnected",t.disconnectedReason),t.resetConnState(),t.reconnecting=!1,null==i||i(l),d.kg.debug("reconnect fail")}}else d.kg.debug("reject is null")})))}))}function oe(e){if("object"!==K(e)||null===e)return a.Z.create({type:u.E.WEBIM_CONNCTION_OPEN_ERROR,message:"the param is illegal"});if(!e.user||"string"!=typeof e.user){var t=a.Z.create({type:u.E.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR,message:"the user is empty or type is not string"});return d.kg.debug("open params error",t),t}return!("agoraToken"in e)||e.agoraToken&&"string"==typeof e.agoraToken?!("accessToken"in e)||e.accessToken&&"string"==typeof e.accessToken?"accessToken"in e||"agoraToken"in e||e.pwd?void 0:(t=a.Z.create({type:u.E.WEBIM_CONNCTION_OPEN_ERROR,message:"the accessToken or pwd is illegal"}),d.kg.debug("open params error",t),t):(t=a.Z.create({type:u.E.WEBIM_CONNCTION_OPEN_ERROR,message:"the accessToken is illegal"}),d.kg.debug("open params error",t),t):(t=a.Z.create({type:u.E.WEBIM_CONNCTION_OPEN_ERROR,message:"the agoraToken is illegal"}),d.kg.debug("open params error",t),console.warn("agoraToken is deprecated, please use accessToken instead"),t)}function ie(e){this.context.jid={appKey:this.appKey,name:e.user,domain:this.domain,clientResource:this.clientResource},this.context.root=this.root,this.context.userId=e.user,this.context.appKey=this.appKey,this.context.appName=this.appName,this.context.orgName=this.orgName}function ae(e){var t=this,r=e.rpt,n=e.isRetry,o=this.dnsIndex<this.dnsTotal?this.dnsIndex:0,i="".concat(this.dnsArr[o],"/easemob/server.json");d.kg.debug("call getHttpDNS: "+this.dnsIndex);var c={url:i,dataType:"json",type:"GET",data:{}};return this._initWithAppId?c.data={app_id:this.appId,sdk_version:"4.10.0",file_version:"1"}:c.data={app_key:X.platform===s.iw.WEB?encodeURIComponent(this.appKey):this.appKey},s.P6.ajax(c,_.fI.SDK_INTERNAL).then((function(e){if(!e)throw a.Z.create({type:u.E.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed"});d.kg.debug("getHttpDNS success");var o=e.rest.hosts,s=t.https?"https":"http";if(d.kg.info("httpType: "+s),t._initWithAppId){if(!e.app_key)throw(l=a.Z.create({type:u.E.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed"})).extraInfo=e.extraInfo,l;t.appKey=e.app_key,t.context.appKey=t.appKey,t.devInfos=t.appKey.split("#"),t.orgName=t.devInfos[0],t.appName=t.devInfos[1],t.dataReport.updateAppKey(t.appKey)}if(!o)throw(l=a.Z.create({type:u.E.SERVER_GET_DNSLIST_FAILED,message:"DNS hosts resolution failed",data:e.rest})).extraInfo=e.extraInfo,l;var c=o.filter((function(e){if(e.protocol===s)return e}));t.restHosts=c,t.restTotal=c.length;var l,p=e["msync-wx"].hosts;if(!p)throw(l=a.Z.create({type:u.E.SERVER_GET_DNSLIST_FAILED,message:"DNS msync-wx resolution failed",data:e["msync-wx"]})).extraInfo=e.extraInfo,l;var h=p.filter((function(e){if(e.protocol===s)return e}));if(t.socketHost=h,t.hostTotal=h.length,t.isHttpDNS&&ue.call(t),t.isHttpDNS&&ce.call(t),t._reportLogs="true"===e.enableReportLogs,t._reportInterval=Number(e.reportInterval||C.XV),"true"===(null==e?void 0:e.enableDataReport)?(t.dataReport.setIsCollectDt(!0),t.dataReport.setIsReportDt(!0)):(t.dataReport.setIsReportDt(!1),t.dataReport.setIsCollectDt(!1)),"false"===(null==e?void 0:e.uploadinparts_enable)&&(t.uploadPartEnable=!1),e.extraInfo){var f=e.extraInfo,m=f.elapse,g=f.httpCode,v={requestUrl:i,requestName:_.c.GET_DNS,requestElapse:m,isSuccess:1,code:g};r&&r({isRetry:n,data:v})}})).catch((function(e){var t=e.extraInfo||{},o=t.elapse,s=t.httpCode,c=t.errDesc,l={requestUrl:i,requestName:_.c.GET_DNS,isSuccess:0,code:s,codeDesc:c,requestElapse:o};throw r&&r({isRetry:n,data:l}),a.Z.create({type:u.E.SERVER_GET_DNSLIST_FAILED,message:e.message,data:e})}))}function se(e,t){return z(this,void 0,void 0,(function(){var r;return V(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,6]),[4,ae.call(this,{rpt:e,isRetry:t})];case 1:case 3:return[2,n.sent()];case 2:return r=n.sent(),d.kg.error("get DNS failed",r,"times:",this.dnsIndex),this.dnsIndex++,this.dnsIndex<this.dnsTotal?[4,se.call(this,e,!0)]:[3,4];case 4:throw d.kg.error("retryRequestDNS failed"),a.Z.create({type:u.E.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed",data:r});case 5:return[3,6];case 6:return[2]}}))}))}function ce(){var e=this.socketHost[this.hostIndex],t=e.domain,r=e.ip,n=e.port,o="";o=t||r,n&&"80"!==n&&"443"!==n&&(o+=":"+n),o&&(this.url="//"+o+"/websocket");var i=this.https?"wss:":"ws:";this.url=i+this.url}function ue(){var e,t;if(this.restIndex>this.restTotal)return d.kg.debug("restIndex > restTotal"),"";var r="",n=this.restHosts[this.restIndex],o=n.domain,i=n.ip,a=n.port,s=this.https?"https:":"http:";return i&&"undefined"!=typeof window&&"http:"===(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.protocol)?r=s+"//"+i+":"+a:(r=s+"//"+o,a&&"80"!==a&&"443"!==a&&(r+=":".concat(a)),"undefined"==typeof window||window.location||(r="https://"+o),"undefined"!=typeof window&&window.location&&"file:"===(null===(t=window.location)||void 0===t?void 0:t.protocol)&&(r="https://"+o)),"undefined"==typeof window&&(r=s+"//"+o),this.apiUrl=r,r}var le=r(2449);t().util.Long=i(),t().configure();var de=t().Root.fromJSON({nested:{easemob:{nested:{pb:{nested:{MessageBody:{fields:{type:{type:"Type",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},contents:{rule:"repeated",type:"Content",id:4},ext:{rule:"repeated",type:"KeyValue",id:5},ackMessageId:{type:"uint64",id:6},msgConfig:{type:"MessageConfig",id:7},ackContent:{type:"string",id:8},meta:{type:"string",id:9},editMessageId:{type:"uint64",id:11},editScope:{type:"EditScope",id:12}},nested:{Content:{fields:{type:{type:"Type",id:1},text:{type:"string",id:2},latitude:{type:"double",id:3},longitude:{type:"double",id:4},address:{type:"string",id:5},displayName:{type:"string",id:6},remotePath:{type:"string",id:7},secretKey:{type:"string",id:8},fileLength:{type:"int32",id:9},action:{type:"string",id:10},params:{rule:"repeated",type:"KeyValue",id:11},duration:{type:"int32",id:12},size:{type:"Size",id:13},thumbnailRemotePath:{type:"string",id:14},thumbnailSecretKey:{type:"string",id:15},thumbnailDisplayName:{type:"string",id:16},thumbnailFileLength:{type:"int32",id:17},thumbnailSize:{type:"Size",id:18},customEvent:{type:"string",id:19},customExts:{rule:"repeated",type:"KeyValue",id:20},buildingName:{type:"string",id:21},subType:{type:"SubType",id:22},title:{type:"string",id:23},summary:{type:"string",id:24},combineLevel:{type:"int32",id:25}},nested:{Type:{values:{TEXT:0,IMAGE:1,VIDEO:2,LOCATION:3,VOICE:4,FILE:5,COMMAND:6,CUSTOM:7,COMBINE:8}},Size:{fields:{width:{type:"double",id:1},height:{type:"double",id:2}}},SubType:{values:{COMBINE:0,GIF:1}}}},Type:{values:{NORMAL:0,CHAT:1,GROUPCHAT:2,CHATROOM:3,READ_ACK:4,DELIVER_ACK:5,RECALL:6,CHANNEL_ACK:7,EDIT:8}},EditScope:{values:{BODY:1,BODY_AND_EXT:2}},MessageConfig:{fields:{allowGroupAck:{type:"bool",id:1}}}}},KeyValue:{oneofs:{value:{oneof:["varintValue","floatValue","doubleValue","stringValue"]}},fields:{key:{type:"string",id:1},type:{type:"ValueType",id:2},varintValue:{type:"int64",id:3},floatValue:{type:"float",id:4},doubleValue:{type:"double",id:5},stringValue:{type:"string",id:6}},nested:{ValueType:{values:{BOOL:1,INT:2,UINT:3,LLINT:4,FLOAT:5,DOUBLE:6,STRING:7,JSON_STRING:8}}}},JID:{fields:{appKey:{type:"string",id:1},name:{type:"string",id:2},domain:{type:"string",id:3},clientResource:{type:"string",id:4}}},ConferenceBody:{fields:{sessionId:{type:"string",id:1},operation:{type:"Operation",id:2},conferenceId:{type:"string",id:3},type:{type:"Type",id:4},content:{type:"string",id:5},network:{type:"string",id:6},version:{type:"string",id:7},identity:{type:"Identity",id:8},duration:{type:"string",id:9},peerName:{type:"string",id:10},endReason:{type:"EndReason",id:11},status:{type:"Status",id:12},isDirect:{type:"bool",id:13},controlType:{type:"StreamControlType",id:14},routeFlag:{type:"int32",id:15},routeKey:{type:"string",id:16}},nested:{Status:{fields:{errorCode:{type:"int32",id:1}}},Operation:{values:{JOIN:0,INITIATE:1,ACCEPT_INITIATE:2,ANSWER:3,TERMINATE:4,REMOVE:5,STREAM_CONTROL:6,MEDIA_REQUEST:7}},Type:{values:{VOICE:0,VIDEO:1}},Identity:{values:{CALLER:0,CALLEE:1}},EndReason:{values:{HANGUP:0,NORESPONSE:1,REJECT:2,BUSY:3,FAIL:4,UNSUPPORTED:5,OFFLINE:6}},StreamControlType:{values:{PAUSE_VOICE:0,RESUME_VOICE:1,PAUSE_VIDEO:2,RESUME_VIDEO:3}}}},MSync:{fields:{version:{type:"Version",id:1,options:{default:"MSYNC_V1"}},guid:{type:"JID",id:2},auth:{type:"string",id:3},compressAlgorimth:{type:"uint32",id:4},crypto:{type:"uint32",id:5},userAgent:{type:"string",id:6},pov:{type:"uint64",id:7},command:{type:"Command",id:8},deviceId:{type:"uint32",id:10},encryptType:{rule:"repeated",type:"EncryptType",id:11,options:{packed:!1}},encryptKey:{type:"string",id:12},payload:{type:"bytes",id:9}},nested:{Version:{values:{MSYNC_V1:0,MSYNC_V2:1}},Command:{values:{SYNC:0,UNREAD:1,NOTICE:2,PROVISION:3}}}},EncryptType:{values:{ENCRYPT_NONE:0,ENCRYPT_AES_128_CBC:1,ENCRYPT_AES_256_CBC:2}},CommSyncUL:{fields:{meta:{type:"Meta",id:1},key:{type:"uint64",id:2},queue:{type:"JID",id:3},isRoam:{type:"bool",id:4},lastFullRoamKey:{type:"uint64",id:5}}},CommSyncDL:{fields:{status:{type:"Status",id:1},metaId:{type:"uint64",id:2},serverId:{type:"uint64",id:3},metas:{rule:"repeated",type:"Meta",id:4},nextKey:{type:"uint64",id:5},queue:{type:"JID",id:6},isLast:{type:"bool",id:7},timestamp:{type:"uint64",id:8},isRoam:{type:"bool",id:9}}},CommNotice:{fields:{queue:{type:"JID",id:1}}},CommUnreadUL:{fields:{}},CommUnreadDL:{fields:{status:{type:"Status",id:1},unread:{rule:"repeated",type:"MetaQueue",id:2},timestamp:{type:"uint64",id:3}}},MetaQueue:{fields:{queue:{type:"JID",id:1},n:{type:"uint32",id:2}}},Meta:{fields:{id:{type:"uint64",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},timestamp:{type:"uint64",id:4},ns:{type:"NameSpace",id:5},payload:{type:"bytes",id:6},routetype:{type:"RouteType",id:7},ext:{rule:"repeated",type:"KeyValue",id:8},meta:{type:"bytes",id:9},directedUsers:{rule:"repeated",type:"string",id:10}},nested:{NameSpace:{values:{STATISTIC:0,CHAT:1,MUC:2,ROSTER:3,CONFERENCE:4,NOTIFY:5,QUERY:6}},RouteType:{values:{ROUTE_ALL:0,ROUTE_ONLINE:1,ROUTE_DIRECT:2}}}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},reason:{type:"string",id:2},redirectInfo:{rule:"repeated",type:"RedirectInfo",id:3}},nested:{ErrorCode:{values:{OK:0,FAIL:1,UNAUTHORIZED:2,MISSING_PARAMETER:3,WRONG_PARAMETER:4,REDIRECT:5,TOKEN_EXPIRED:6,PERMISSION_DENIED:7,NO_ROUTE:8,UNKNOWN_COMMAND:9,PB_PARSER_ERROR:10,BIND_ANOTHER_DEVICE:11,IM_FORBIDDEN:12,TOO_MANY_DEVICES:13,PLATFORM_LIMIT:14,USER_MUTED:15,ENCRYPT_DISABLE:16,ENCRYPT_ENABLE:17,DECRYPT_FAILURE:18,PERMISSION_DENIED_EXTERNAL:19}}}},RedirectInfo:{fields:{host:{type:"string",id:1},port:{type:"uint32",id:2}}},Provision:{fields:{osType:{type:"OsType",id:1},version:{type:"string",id:2},networkType:{type:"NetworkType",id:3},appSign:{type:"string",id:4},compressType:{rule:"repeated",type:"CompressType",id:5,options:{packed:!1}},encryptType:{rule:"repeated",type:"EncryptType",id:6,options:{packed:!1}},encryptKey:{type:"string",id:7},status:{type:"Status",id:8},deviceUuid:{type:"string",id:9},isManualLogin:{type:"bool",id:10},password:{type:"string",id:11},deviceName:{type:"string",id:12},resource:{type:"string",id:13},auth:{type:"string",id:14},serviceId:{type:"string",id:16},actionVersion:{type:"string",id:17},authToken:{type:"string",id:18},osCustomValue:{type:"uint32",id:19},sessionId:{type:"string",id:20},reason:{type:"string",id:21}},nested:{OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_CUSTOM:5,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}},CompressType:{values:{COMPRESS_NONE:0,COMPRESS_ZLIB:1}}}},MUCBody:{fields:{mucId:{type:"JID",id:1},operation:{type:"Operation",id:2},from:{type:"JID",id:3},to:{rule:"repeated",type:"JID",id:4},setting:{type:"Setting",id:5},reason:{type:"string",id:6},isChatroom:{type:"bool",id:7},status:{type:"Status",id:8},isThread:{type:"bool",id:9},mucParentId:{type:"JID",id:10},mucName:{type:"string",id:11},eventInfo:{type:"EventInfo",id:12},mucMemberCount:{type:"int32",id:13},ext:{type:"string",id:14},leaveOtherRooms:{type:"bool",id:15}},nested:{Operation:{values:{CREATE:0,DESTROY:1,JOIN:2,LEAVE:3,APPLY:4,APPLY_ACCEPT:5,APPLY_DECLINE:6,INVITE:7,INVITE_ACCEPT:8,INVITE_DECLINE:9,KICK:10,GET_BLACKLIST:11,BAN:12,ALLOW:13,UPDATE:14,BLOCK:15,UNBLOCK:16,PRESENCE:17,ABSENCE:18,DIRECT_JOINED:19,ASSIGN_OWNER:20,ADD_ADMIN:21,REMOVE_ADMIN:22,ADD_MUTE:23,REMOVE_MUTE:24,UPDATE_ANNOUNCEMENT:25,DELETE_ANNOUNCEMENT:26,UPLOAD_FILE:27,DELETE_FILE:28,ADD_USER_WHITE_LIST:29,REMOVE_USER_WHITE_LIST:30,BAN_GROUP:31,REMOVE_BAN_GROUP:32,THREAD_CREATE:33,THREAD_DESTROY:34,THREAD_JOIN:35,THREAD_LEAVE:36,THREAD_KICK:37,THREAD_UPDATE:38,THREAD_PRESENCE:39,THREAD_ABSENCE:40,DISABLE_GROUP:41,ABLE_GROUP:42,SET_METADATA:43,DELETE_METADATA:44,GROUP_MEMBER_METADATA_UPDATE:45}},Setting:{fields:{name:{type:"string",id:1},desc:{type:"string",id:2},type:{type:"Type",id:3},maxUsers:{type:"int32",id:4},owner:{type:"string",id:5}},nested:{Type:{values:{PRIVATE_OWNER_INVITE:0,PRIVATE_MEMBER_INVITE:1,PUBLIC_JOIN_APPROVAL:2,PUBLIC_JOIN_OPEN:3,PUBLIC_ANONYMOUS:4}}}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},description:{type:"string",id:2},chatroomInfo:{type:"string",id:3}},nested:{ErrorCode:{values:{OK:0,PERMISSION_DENIED:1,WRONG_PARAMETER:2,MUC_NOT_EXIST:3,USER_NOT_EXIST:4,UNKNOWN:5}}}},EventInfo:{fields:{eventType:{type:"EventType",id:1,options:{default:"EVENT_NONE"}},ext:{type:"string",id:2}},nested:{EventType:{values:{EVENT_NONE:0,CIRCLE_CHANNEL:1}}}}}},RosterBody:{fields:{operation:{type:"Operation",id:1},status:{type:"Status",id:2},from:{type:"JID",id:3},to:{rule:"repeated",type:"JID",id:4},reason:{type:"string",id:5},rosterVer:{type:"string",id:6},biDirection:{type:"bool",id:7}},nested:{Operation:{values:{GET_ROSTER:0,GET_BLACKLIST:1,ADD:2,REMOVE:3,ACCEPT:4,DECLINE:5,BAN:6,ALLOW:7,REMOTE_ACCEPT:8,REMOTE_DECLINE:9}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},description:{type:"string",id:2}},nested:{ErrorCode:{values:{OK:0,USER_NOT_EXIST:1,USER_ALREADY_FRIEND:2,USER_ALREADY_BLACKLIST:3}}}}}},StatisticsBody:{fields:{operation:{type:"Operation",id:1},os:{type:"OsType",id:2},version:{type:"string",id:3},network:{type:"NetworkType",id:4},imTime:{type:"uint32",id:5},chatTime:{type:"uint32",id:6},location:{type:"string",id:7},reason:{type:"string",id:10}},nested:{Operation:{values:{INFORMATION:0,USER_REMOVED:1,USER_LOGIN_ANOTHER_DEVICE:2,USER_KICKED_BY_CHANGE_PASSWORD:3,USER_KICKED_BY_OTHER_DEVICE:4}},OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_CUSTOM:5,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}}}}}}}}}});J.prototype.root=de;var pe=d.kg.getLogger("defaultLogger");pe.setConfig({useCache:!1,maxCache:3145728,color:"",background:""}),pe.enableAll(),J.prototype.getUniqueId=s.P6.getUniqueId;var he={connection:J,message:le.Message,utils:s.P6,logger:pe,statusCode:u.E};"undefined"!=typeof window&&(window.WebIM=he);var fe=he}(),n}()}));
|