12 |
- !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()}(this,(function(){return(()=>{var e={4188:(e,t,r)=>{var o,n,i;!function(s){"use strict";if(null!=t&&"number"!=typeof t.nodeType)e.exports=s();else if(null!=r.amdO)n=[],void 0===(i="function"==typeof(o=s)?o.apply(t,n):o)||(e.exports=i);else{var a=s(),u="undefined"!=typeof self?self:$.global;"function"!=typeof u.btoa&&(u.btoa=a.btoa),"function"!=typeof u.atob&&(u.atob=a.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 o,n,i=String(r),s=0,a=e,u="";i.charAt(0|s)||(a="=",s%1);u+=a.charAt(63&o>>8-s%1*8)){if((n=i.charCodeAt(s+=3/4))>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return u},atob:function(r){var o=String(r).replace(/[=]+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,s=0,a=0,u="";i=o.charAt(a++);~i&&(n=s%4?64*n+i:i,s++%4)?u+=String.fromCharCode(255&n>>(-2*s&6)):0)i=e.indexOf(i);return u}}}))},3720: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 o(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=o;var n={},i={};function s(e,t){var r,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=i[e])?o:(r=u(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(o=n[e])?o:(r=u(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e))return t?E:g;if(t){if(e<0)return E;if(e>=h)return O}else{if(e<=-f)return R;if(e+1>=f)return v}return e<0?a(-e,t).neg():u(e%d|0,e/d|0,t)}function u(e,t,o){return new r(e,t,o)}r.fromInt=s,r.fromNumber=a,r.fromBits=u;var c=Math.pow;function p(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 o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return p(e.substring(1),t,r).neg();for(var n=a(c(r,8)),i=g,s=0;s<e.length;s+=8){var u=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+u),r);if(u<8){var d=a(c(r,u));i=i.mul(d).add(a(l))}else i=(i=i.mul(n)).add(a(l))}return i.unsigned=t,i}function l(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?p(e,t):u(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=p,r.fromValue=l;var d=4294967296,h=d*d,f=h/2,m=s(1<<24),g=s(0);r.ZERO=g;var E=s(0,!0);r.UZERO=E;var y=s(1);r.ONE=y;var T=s(1,!0);r.UONE=T;var _=s(-1);r.NEG_ONE=_;var v=u(-1,2147483647,!1);r.MAX_VALUE=v;var O=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=O;var R=u(0,-2147483648,!1);r.MIN_VALUE=R;var I=r.prototype;I.toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},I.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(R)){var t=a(e),r=this.div(t),o=r.mul(t).sub(this);return r.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=a(c(e,6),this.unsigned),i=this,s="";;){var u=i.div(n),p=(i.sub(u.mul(n)).toInt()>>>0).toString(e);if((i=u).isZero())return p+s;for(;p.length<6;)p="0"+p;s=""+p+s}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){if(this.isNegative())return this.eq(R)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},I.isZero=function(){return 0===this.high&&0===this.low},I.eqz=I.isZero,I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return 1==(1&this.low)},I.isEven=function(){return 0==(1&this.low)},I.equals=function(e){return o(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.ne=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.le=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.ge=I.greaterThanOrEqual,I.compare=function(e){if(o(e)||(e=l(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},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(R)?R:this.not().add(y)},I.neg=I.negate,I.add=function(e){o(e)||(e=l(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,c=e.low>>>16,p=0,d=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,d+=(h+=n+c)>>>16,p+=(d+=r+a)>>>16,p+=t+s,u((h&=65535)<<16|(f&=65535),(p&=65535)<<16|(d&=65535),this.unsigned)},I.subtract=function(e){return o(e)||(e=l(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){if(this.isZero())return g;if(o(e)||(e=l(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(R))return e.isOdd()?R:g;if(e.eq(R))return this.isOdd()?R: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 a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,c=e.high>>>16,p=65535&e.high,d=e.low>>>16,h=65535&e.low,f=0,E=0,y=0,T=0;return y+=(T+=s*h)>>>16,E+=(y+=i*h)>>>16,y&=65535,E+=(y+=s*d)>>>16,f+=(E+=n*h)>>>16,E&=65535,f+=(E+=i*d)>>>16,E&=65535,f+=(E+=s*p)>>>16,f+=r*h+n*d+i*p+s*c,u((y&=65535)<<16|(T&=65535),(f&=65535)<<16|(E&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(e){if(o(e)||(e=l(e)),e.isZero())throw Error("division by zero");var r,n,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((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?E:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return E;if(e.gt(this.shru(1)))return T;i=E}else{if(this.eq(R))return e.eq(y)||e.eq(_)?R:e.eq(R)?y:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?y:_:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(R))return this.unsigned?E: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(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),p=s<=48?1:c(2,s-48),d=a(r),h=d.mul(e);h.isNegative()||h.gt(n);)h=(d=a(r-=p,this.unsigned)).mul(e);d.isZero()&&(d=y),i=i.add(d),n=n.sub(h)}return i},I.div=I.divide,I.modulo=function(e){return o(e)||(e=l(e)),t?u((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))},I.mod=I.modulo,I.rem=I.modulo,I.not=function(){return u(~this.low,~this.high,this.unsigned)},I.and=function(e){return o(e)||(e=l(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return o(e)||(e=l(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return o(e)||(e=l(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){if(o(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.shr_u=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},I.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,o){return o?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)}},7969: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],o=0;o<r.length;)r[o].fn===t?r.splice(o,1):++o;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],o=1;o<arguments.length;)r.push(arguments[o++]);for(o=0;o<t.length;)t[o].fn.apply(t[o++].ctx,r)}return this}},6728:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),o=0,n=2,i=!0;n<arguments.length;)r[o++]=arguments[n++];return new Promise((function(n,s){r[o]=function(e){if(i)if(i=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];n.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,s(e))}}))}},5889:e=>{"use strict";var t=e.exports;t.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 r=new Array(64),o=new Array(123),n=0;n<64;)o[r[n]=n<26?n+65:n<52?n+71:n<62?n-4:n-59|43]=n++;t.encode=function(e,t,o){for(var n,i=null,s=[],a=0,u=0;t<o;){var c=e[t++];switch(u){case 0:s[a++]=r[c>>2],n=(3&c)<<4,u=1;break;case 1:s[a++]=r[n|c>>4],n=(15&c)<<2,u=2;break;case 2:s[a++]=r[n|c>>6],s[a++]=r[63&c],u=0}a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0)}return u&&(s[a++]=r[n],s[a++]=61,1===u&&(s[a++]=61)),i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var i="invalid encoding";t.decode=function(e,t,r){for(var n,s=r,a=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&a>1)break;if(void 0===(c=o[c]))throw Error(i);switch(a){case 0:n=c,a=1;break;case 1:t[r++]=n<<2|(48&c)>>4,n=c,a=2;break;case 2:t[r++]=(15&n)<<4|(60&c)>>2,n=c,a=3;break;case 3:t[r++]=(3&n)<<6|c,a=0}}if(1===a)throw Error(i);return r-s},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},3072:e=>{e.exports=o;var t,r=/\/|\./;function o(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),o[e]=t}o("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),o("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),o("timestamp",{Timestamp:t}),o("empty",{Empty:{fields:{}}}),o("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}}}}),o("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}}}}),o("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),o.get=function(e){return o[e]||null}},525:(e,t,r)=>{var o,n,i=e.exports;function s(e,t,r,i){var s=i.m,a=i.d,u=i.types,c=i.ksi,p=void 0!==c;if(e.resolvedType)if(e.resolvedType instanceof o){for(var l=p?a[r][c]:a[r],d=e.resolvedType.values,h=Object.keys(d),f=0;f<h.length;f++)if(!(e.repeated&&d[h[f]]===e.typeDefault||h[f]!=l&&d[h[f]]!=l)){p?s[r][c]=d[h[f]]:s[r]=d[h[f]];break}}else{if("object"!=typeof(p?a[r][c]:a[r]))throw TypeError(e.fullName+": object expected");p?s[r][c]=u[t].fromObject(a[r][c]):s[r]=u[t].fromObject(a[r])}else{var m=!1;switch(e.type){case"double":case"float":p?s[r][c]=Number(a[r][c]):s[r]=Number(a[r]);break;case"uint32":case"fixed32":p?s[r][c]=a[r][c]>>>0:s[r]=a[r]>>>0;break;case"int32":case"sint32":case"sfixed32":p?s[r][c]=0|a[r][c]:s[r]=0|a[r];break;case"uint64":m=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":n.Long?p?s[r][c]=n.Long.fromValue(a[r][c]).unsigned=m:s[r]=n.Long.fromValue(a[r]).unsigned=m:"string"==typeof(p?a[r][c]:a[r])?p?s[r][c]=parseInt(a[r][c],10):s[r]=parseInt(a[r],10):"number"==typeof(p?a[r][c]:a[r])?p?s[r][c]=a[r][c]:s[r]=a[r]:"object"==typeof(p?a[r][c]:a[r])&&(p?s[r][c]=new n.LongBits(a[r][c].low>>>0,a[r][c].high>>>0).toNumber(m):s[r]=new n.LongBits(a[r].low>>>0,a[r].high>>>0).toNumber(m));break;case"bytes":"string"==typeof(p?a[r][c]:a[r])?p?n.base64.decode(a[r][c],s[r][c]=n.newBuffer(n.base64.length(a[r][c])),0):n.base64.decode(a[r],s[r]=n.newBuffer(n.base64.length(a[r])),0):(p?a[r][c]:a[r]).length&&(p?s[r][c]=a[r][c]:s[r]=a[r]);break;case"string":p?s[r][c]=String(a[r][c]):s[r]=String(a[r]);break;case"bool":p?s[r][c]=Boolean(a[r][c]):s[r]=Boolean(a[r])}}}function a(e,t,r,i){var s=i.m,a=i.d,u=i.types,c=i.ksi,p=i.o,l=void 0!==c;if(e.resolvedType)e.resolvedType instanceof o?l?a[r][c]=p.enums===String?u[t].values[s[r][c]]:s[r][c]:a[r]=p.enums===String?u[t].values[s[r]]:s[r]:l?a[r][c]=u[t].toObject(s[r][c],p):a[r]=u[t].toObject(s[r],p);else{var d=!1;switch(e.type){case"double":case"float":l?a[r][c]=p.json&&!isFinite(s[r][c])?String(s[r][c]):s[r][c]:a[r]=p.json&&!isFinite(s[r])?String(s[r]):s[r];break;case"uint64":d=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":"number"==typeof s[r][c]?l?a[r][c]=p.longs===String?String(s[r][c]):s[r][c]:a[r]=p.longs===String?String(s[r]):s[r]:l?a[r][c]=p.longs===String?n.Long.prototype.toString.call(s[r][c]):p.longs===Number?new n.LongBits(s[r][c].low>>>0,s[r][c].high>>>0).toNumber(d):s[r][c]:a[r]=p.longs===String?n.Long.prototype.toString.call(s[r]):p.longs===Number?new n.LongBits(s[r].low>>>0,s[r].high>>>0).toNumber(d):s[r];break;case"bytes":l?a[r][c]=p.bytes===String?n.base64.encode(s[r][c],0,s[r][c].length):p.bytes===Array?Array.prototype.slice.call(s[r][c]):s[r][c]:a[r]=p.bytes===String?n.base64.encode(s[r],0,s[r].length):p.bytes===Array?Array.prototype.slice.call(s[r]):s[r];break;default:l?a[r][c]=s[r][c]:a[r]=s[r]}}}i._configure=function(){o=r(582),n=r(8278)},i.fromObject=function(e){var t=e.fieldsArray;return function(e){return function(r){if(r instanceof this.ctor)return r;if(!t.length)return new this.ctor;for(var i=new this.ctor,a=0;a<t.length;++a){var u,c=t[a].resolve(),p=c.name;if(c.map){if(r[p]){if("object"!=typeof r[p])throw TypeError(c.fullName+": object expected");i[p]={}}var l=Object.keys(r[p]);for(u=0;u<l.length;++u)s(c,a,p,n.merge(n.copy(e),{m:i,d:r,ksi:l[u]}))}else if(c.repeated){if(r[p]){if(!Array.isArray(r[p]))throw TypeError(c.fullName+": array expected");for(i[p]=[],u=0;u<r[p].length;++u)s(c,a,p,n.merge(n.copy(e),{m:i,d:r,ksi:u}))}}else(c.resolvedType instanceof o||null!=r[p])&&s(c,a,p,n.merge(n.copy(e),{m:i,d:r}))}return i}}},i.toObject=function(e){var t=e.fieldsArray.slice().sort(n.compareFieldsById);return function(r){return t.length?function(i,s){s=s||{};for(var u,c,p={},l=[],d=[],h=[],f=0;f<t.length;++f)t[f].partOf||(t[f].resolve().repeated?l:t[f].map?d:h).push(t[f]);if(l.length&&(s.arrays||s.defaults))for(f=0;f<l.length;++f)p[l[f].name]=[];if(d.length&&(s.objects||s.defaults))for(f=0;f<d.length;++f)p[d[f].name]={};if(h.length&&s.defaults)for(f=0;f<h.length;++f)if(c=(u=h[f]).name,u.resolvedType instanceof o)p[c]=s.enums=String?u.resolvedType.valuesById[u.typeDefault]:u.typeDefault;else if(u.long)if(n.Long){var m=new n.Long(u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned);p[c]=s.longs===String?m.toString():s.longs===Number?m.toNumber():m}else p[c]=s.longs===String?u.typeDefault.toString():u.typeDefault.toNumber();else u.bytes?p[c]=s.bytes===String?String.fromCharCode.apply(String,u.typeDefault):Array.prototype.slice.call(u.typeDefault).join("*..*").split("*..*"):p[c]=u.typeDefault;var g=!1;for(f=0;f<t.length;++f){c=(u=t[f]).name;var E,y,T=e._fieldsArray.indexOf(u);if(u.map){if(g||(g=!0),i[c]&&(E=Object.keys(i[c]).length))for(p[c]={},y=0;y<E.length;++y)a(u,T,c,n.merge(n.copy(r),{m:i,d:p,ksi:E[y],o:s}))}else if(u.repeated){if(i[c]&&i[c].length)for(p[c]=[],y=0;y<i[c].length;++y)a(u,T,c,n.merge(n.copy(r),{m:i,d:p,ksi:y,o:s}))}else null!=i[c]&&i.hasOwnProperty(c)&&a(u,T,c,n.merge(n.copy(r),{m:i,d:p,o:s})),u.partOf&&s.oneofs&&(p[u.partOf.name]=c)}return p}:function(){return{}}}}},3888:(e,t,r)=>{var o,n,i;function s(e){return"missing required '"+e.name+"'"}function a(e){return function(t){var r=t.Reader,a=t.types,u=t.util;return function(t,c){t instanceof r||(t=r.create(t));for(var p,l=void 0===c?t.len:t.pos+c,d=new this.ctor;t.pos<l;){var h=t.uint32();if(e.group&&4==(7&h))break;for(var f=h>>>3,m=0,g=!1;m<e.fieldsArray.length;++m){var E=e._fieldsArray[m].resolve(),y=E.name,T=E.resolvedType instanceof o?"int32":E.type;if(f==E.id){if(g=!0,E.map)t.skip().pos++,d[y]===u.emptyObject&&(d[y]={}),p=t[E.keyType](),t.pos++,null!=n.long[E.keyType]?null==n.basic[T]?d[y]["object"==typeof p?u.longToHash(p):p]=a[m].decode(t,t.uint32()):d[y]["object"==typeof p?u.longToHash(p):p]=t[T]():null==n.basic[T]?d[y]=a[m].decode(t,t.uint32()):d[y]=t[T]();else if(E.repeated)if(d[y]&&d[y].length||(d[y]=[]),null!=n.packed[T]&&2==(7&h))for(var _=t.uint32()+t.pos;t.pos<_;)d[y].push(t[T]());else null==n.basic[T]?E.resolvedType.group?d[y].push(a[m].decode(t)):d[y].push(a[m].decode(t,t.uint32())):d[y].push(t[T]());else null==n.basic[T]?E.resolvedType.group?d[y]=a[m].decode(t):d[y]=a[m].decode(t,t.uint32()):d[y]=t[T]();break}}g||(console.log("t",h),t.skipType(7&h))}for(m=0;m<e._fieldsArray.length;++m){var v=e._fieldsArray[m];if(v.required&&!d.hasOwnProperty(v.name))throw i.ProtocolError(s(v),{instance:d})}return d}}}e.exports=a,a._configure=function(){o=r(582),n=r(4696),i=r(8278)}},9929:(e,t,r)=>{var o,n;function i(e){return function(t){var r=t.Writer,i=t.types,s=t.util;return function(t,a){a=a||r.create();for(var u=e.fieldsArray.slice().sort(s.compareFieldsById),c=0;c<u.length;c++){var p=u[c],l=e._fieldsArray.indexOf(p),d=p.resolvedType instanceof o?"uint32":p.type,h=n.basic[d],f=t[p.name];if(p.resolvedType instanceof o&&"string"==typeof f&&(f=i[l].values[f]),p.map){if(null!=f&&t.hasOwnProperty(p.name))for(var m=Object.keys(f),g=0;g<m.length;++g)a.uint32((p.id<<3|2)>>>0).fork().uint32(8|n.mapKey[p.keyType])[p.keyType](m[g]),void 0===h?i[l].encode(f[m[g]],a.uint32(18).fork()).ldelim().ldelim():a.uint32(16|h)[d](f[m[g]]).ldelim()}else if(p.repeated){if(f&&f.length)if(p.packed&&void 0!==n.packed[d]){a.uint32((p.id<<3|2)>>>0).fork();for(var E=0;E<f.length;E++)a[d](f[E]);a.ldelim()}else for(var y=0;y<f.length;y++)void 0===h?p.resolvedType.group?i[l].encode(f[y],a.uint32((p.id<<3|3)>>>0)).uint32((p.id<<3|4)>>>0):i[l].encode(f[y],a.uint32((p.id<<3|2)>>>0).fork()).ldelim():a.uint32((p.id<<3|h)>>>0)[d](f[y])}else(!p.optional||null!=f&&t.hasOwnProperty(p.name))&&(p.optional||null!=f&&t.hasOwnProperty(p.name)||console.warn("注意啦!!!很大概率会报错 类型:",t.$type?t.$type.name:"不晓得","没有设置对应的属性:",p.name,"检查是不是proto文件属性设置为了required"),void 0===h?p.resolvedType.group?i[l].encode(f,a.uint32((p.id<<3|3)>>>0)).uint32((p.id<<3|4)>>>0):i[l].encode(f,a.uint32((p.id<<3|2)>>>0).fork()).ldelim():a.uint32((p.id<<3|h)>>>0)[d](f))}return a}}}e.exports=i,i._configure=function(){o=r(582),n=r(4696)}},582:(e,t,r)=>{e.exports=i;var o=r(5998);((i.prototype=Object.create(o.prototype)).constructor=i).className="Enum";var n=r(2476);function i(e,t,r,n,i){if(o.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=n,this.comments=i||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a<s.length;++a)"number"==typeof t[s[a]]&&(this.valuesById[this.values[s[a]]=t[s[a]]]=s[a])}i.fromJSON=function(e,t){var r=new i(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return util.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])},i.prototype.add=function(e,t,r){if(!util.isString(e))throw TypeError("name must be a string");if(!util.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},i.prototype.remove=function(e){if(!util.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},i.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},i.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)}},9286:(e,t,r)=>{e.exports=c;var o,n,i,s,a=r(5998);((c.prototype=Object.create(a.prototype)).constructor=c).className="Field";var u=/^required|optional|repeated$/;function c(e,t,r,o,s,c,p){if(i.isObject(o)?(p=s,c=o,o=s=void 0):i.isObject(s)&&(p=c,c=s,s=void 0),a.call(this,e,c),!i.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!i.isString(r))throw TypeError("type must be a string");if(void 0!==o&&!u.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==s&&!i.isString(s))throw TypeError("extend must be a string");this.rule=o&&"optional"!==o?o:void 0,this.type=r,this.id=t,this.extend=s||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=!!i.Long&&void 0!==n.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=p}c.fromJSON=function(e,t){return new c(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(c.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),c.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),a.prototype.setOption.call(this,e,t,r)},c.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.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])},c.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=n.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof s?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 o&&"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 o)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=i.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;i.utf8.write(this.typeDefault,e=i.newBuffer(i.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=i.emptyObject:this.repeated?this.defaultValue=i.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof s&&(this.parent.ctor.prototype[this.name]=this.defaultValue),a.prototype.resolve.call(this)},c.d=function(e,t,r,o){return"function"==typeof t?t=i.decorateType(t).name:t&&"object"==typeof t&&(t=i.decorateEnum(t).name),function(n,s){i.decorateType(n.constructor).add(new c(s,e,t,r,{default:o}))}},c._configure=function(){s=r(192),o=r(582),n=r(4696),i=r(8278)}},1283:e=>{function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),o=128===r[3];function n(e,o,n){t[0]=e,o[n]=r[0],o[n+1]=r[1],o[n+2]=r[2],o[n+3]=r[3]}function i(e,o,n){t[0]=e,o[n]=r[3],o[n+1]=r[2],o[n+2]=r[1],o[n+3]=r[0]}function s(e,o){return r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],r[3]=e[o+3],t[0]}function a(e,o){return r[3]=e[o],r[2]=e[o+1],r[1]=e[o+2],r[0]=e[o+3],t[0]}e.writeFloatLE=o?n:i,e.writeFloatBE=o?i:n,e.readFloatLE=o?s:a,e.readFloatBE=o?a:s}():function(){function t(e,t,r,o){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,o);else if(isNaN(t))e(2143289344,r,o);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,o);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,o);else{var i=Math.floor(Math.log(t)/Math.LN2);e((n<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,o)}}function s(e,t,r){var o=e(t,r),n=2*(o>>31)+1,i=o>>>23&255,s=8388607&o;return 255===i?s?NaN:n*(1/0):0===i?1401298464324817e-60*n*s:n*Math.pow(2,i-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,o),e.readFloatLE=s.bind(null,n),e.readFloatBE=s.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),o=128===r[7];function n(e,o,n){t[0]=e,o[n]=r[0],o[n+1]=r[1],o[n+2]=r[2],o[n+3]=r[3],o[n+4]=r[4],o[n+5]=r[5],o[n+6]=r[6],o[n+7]=r[7]}function i(e,o,n){t[0]=e,o[n]=r[7],o[n+1]=r[6],o[n+2]=r[5],o[n+3]=r[4],o[n+4]=r[3],o[n+5]=r[2],o[n+6]=r[1],o[n+7]=r[0]}function s(e,o){return r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],r[3]=e[o+3],r[4]=e[o+4],r[5]=e[o+5],r[6]=e[o+6],r[7]=e[o+7],t[0]}function a(e,o){return r[7]=e[o],r[6]=e[o+1],r[5]=e[o+2],r[4]=e[o+3],r[3]=e[o+4],r[2]=e[o+5],r[1]=e[o+6],r[0]=e[o+7],t[0]}e.writeDoubleLE=o?n:i,e.writeDoubleBE=o?i:n,e.readDoubleLE=o?s:a,e.readDoubleBE=o?a:s}():function(){function t(e,t,r,o,n,i){var s=o<0?1:0;if(s&&(o=-o),0===o)e(0,n,i+t),e(1/o>0?0:2147483648,n,i+r);else if(isNaN(o))e(0,n,i+t),e(2146959360,n,i+r);else if(o>17976931348623157e292)e(0,n,i+t),e((s<<31|2146435072)>>>0,n,i+r);else{var a;if(o<22250738585072014e-324)e((a=o/5e-324)>>>0,n,i+t),e((s<<31|a/4294967296)>>>0,n,i+r);else{var u=Math.floor(Math.log(o)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(a=o*Math.pow(2,-u))>>>0,n,i+t),e((s<<31|u+1023<<20|1048576*a&1048575)>>>0,n,i+r)}}}function s(e,t,r,o,n){var i=e(o,n+t),s=e(o,n+r),a=2*(s>>31)+1,u=s>>>20&2047,c=4294967296*(1048575&s)+i;return 2047===u?c?NaN:a*(1/0):0===u?5e-324*a*c:a*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,o,4,0),e.readDoubleLE=s.bind(null,n,0,4),e.readDoubleBE=s.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 o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(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)},4939: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 o(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=o;var n={},i={};function s(e,t){var r,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=i[e])?o:(r=u(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(o=n[e])?o:(r=u(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e))return t?E:g;if(t){if(e<0)return E;if(e>=h)return O}else{if(e<=-f)return R;if(e+1>=f)return v}return e<0?a(-e,t).neg():u(e%d|0,e/d|0,t)}function u(e,t,o){return new r(e,t,o)}r.fromInt=s,r.fromNumber=a,r.fromBits=u;var c=Math.pow;function p(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 o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return p(e.substring(1),t,r).neg();for(var n=a(c(r,8)),i=g,s=0;s<e.length;s+=8){var u=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+u),r);if(u<8){var d=a(c(r,u));i=i.mul(d).add(a(l))}else i=(i=i.mul(n)).add(a(l))}return i.unsigned=t,i}function l(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?p(e,t):u(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=p,r.fromValue=l;var d=4294967296,h=d*d,f=h/2,m=s(1<<24),g=s(0);r.ZERO=g;var E=s(0,!0);r.UZERO=E;var y=s(1);r.ONE=y;var T=s(1,!0);r.UONE=T;var _=s(-1);r.NEG_ONE=_;var v=u(-1,2147483647,!1);r.MAX_VALUE=v;var O=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=O;var R=u(0,-2147483648,!1);r.MIN_VALUE=R;var I=r.prototype;I.toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},I.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(R)){var t=a(e),r=this.div(t),o=r.mul(t).sub(this);return r.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=a(c(e,6),this.unsigned),i=this,s="";;){var u=i.div(n),p=(i.sub(u.mul(n)).toInt()>>>0).toString(e);if((i=u).isZero())return p+s;for(;p.length<6;)p="0"+p;s=""+p+s}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){if(this.isNegative())return this.eq(R)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},I.isZero=function(){return 0===this.high&&0===this.low},I.eqz=I.isZero,I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return 1==(1&this.low)},I.isEven=function(){return 0==(1&this.low)},I.equals=function(e){return o(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.ne=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.le=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.ge=I.greaterThanOrEqual,I.compare=function(e){if(o(e)||(e=l(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},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(R)?R:this.not().add(y)},I.neg=I.negate,I.add=function(e){o(e)||(e=l(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,c=e.low>>>16,p=0,d=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,d+=(h+=n+c)>>>16,p+=(d+=r+a)>>>16,p+=t+s,u((h&=65535)<<16|(f&=65535),(p&=65535)<<16|(d&=65535),this.unsigned)},I.subtract=function(e){return o(e)||(e=l(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){if(this.isZero())return g;if(o(e)||(e=l(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(R))return e.isOdd()?R:g;if(e.eq(R))return this.isOdd()?R: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 a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,c=e.high>>>16,p=65535&e.high,d=e.low>>>16,h=65535&e.low,f=0,E=0,y=0,T=0;return y+=(T+=s*h)>>>16,E+=(y+=i*h)>>>16,y&=65535,E+=(y+=s*d)>>>16,f+=(E+=n*h)>>>16,E&=65535,f+=(E+=i*d)>>>16,E&=65535,f+=(E+=s*p)>>>16,f+=r*h+n*d+i*p+s*c,u((y&=65535)<<16|(T&=65535),(f&=65535)<<16|(E&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(e){if(o(e)||(e=l(e)),e.isZero())throw Error("division by zero");var r,n,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((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?E:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return E;if(e.gt(this.shru(1)))return T;i=E}else{if(this.eq(R))return e.eq(y)||e.eq(_)?R:e.eq(R)?y:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?y:_:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(R))return this.unsigned?E: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(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),p=s<=48?1:c(2,s-48),d=a(r),h=d.mul(e);h.isNegative()||h.gt(n);)h=(d=a(r-=p,this.unsigned)).mul(e);d.isZero()&&(d=y),i=i.add(d),n=n.sub(h)}return i},I.div=I.divide,I.modulo=function(e){return o(e)||(e=l(e)),t?u((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))},I.mod=I.modulo,I.rem=I.modulo,I.not=function(){return u(~this.low,~this.high,this.unsigned)},I.and=function(e){return o(e)||(e=l(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return o(e)||(e=l(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return o(e)||(e=l(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){if(o(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.shr_u=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},I.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,o){return o?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)}},8365:(e,t,r)=>{e.exports=n;var o=r(8278);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=n.zero=new n(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var s=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var r=e>>>0,o=(e-r)/4294967296>>>0;return t&&(o=~o>>>0,r=~r>>>0,++r>4294967295&&(r=0,++o>4294967295&&(o=0))),new n(r,o)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if("string"==typeof e||e instanceof String){if(!o.Long)return n.fromNumber(parseInt(e,10));e=o.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):i},n.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},n.prototype.toLong=function(e){return o.Long?new o.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;n.fromHash=function(e){return e===s?i:new n((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},n.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)},n.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},n.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},n.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}},1435:(e,t,r)=>{e.exports=s;var o,n,i=r(9286);function s(e,t,r,o,s,a){if(i.call(this,e,t,o,void 0,void 0,s,a),!n.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}((s.prototype=Object.create(i.prototype)).constructor=s).className="MapField",s.fromJSON=function(e,t){return new s(e,t.id,t.keyType,t.type,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===o.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return i.prototype.resolve.call(this)},s.d=function(e,t,r){return"function"==typeof r?r=n.decorateType(r).name:r&&"object"==typeof r&&(r=n.decorateEnum(r).name),function(o,i){n.decorateType(o.constructor).add(new s(i,e,t,r))}},s._configure=function(){o=r(4696),n=r(8278)}},339:(e,t,r)=>{"use strict";var o;function n(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}e.exports=n,n.create=function(e){return this.$type.create(e)},n.encode=function(e,t){return arguments.length?1==arguments.length?this.$type.encode(arguments[0]):this.$type.encode(arguments[0],arguments[1]):this.$type.encode(this)},n.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},n.decode=function(e){return this.$type.decode(e)},n.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},n.verify=function(e){return this.$type.verify(e)},n.fromObject=function(e){return this.$type.fromObject(e)},n.toObject=function(e,t){return e=e||this,this.$type.toObject(e,t)},n.prototype.toJSON=function(){return this.$type.toObject(this,o.toJSONOptions)},n.set=function(e,t){n[e]=t},n.get=function(e){return n[e]},n._configure=function(){o=r(8278)}},484:(e,t,r)=>{"use strict";e.exports=i;var o,n=r(5998);function i(e,t,r,i,s,a,u,c){if(o.isObject(s)?(u=s,s=a=void 0):o.isObject(a)&&(u=a,a=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,u),this.type=t||"rpc",this.requestType=r,this.requestStream=!!s||void 0,this.responseType=i,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=c}((i.prototype=Object.create(n.prototype)).constructor=i).className="Method",i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment)},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])},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))},i._configure=function(){o=r(8278)}},2476:(e,t,r)=>{e.exports=p;var o,n,i,s,a,u=r(5998);function c(e,t){if(e&&e.length){for(var r={},o=0;o<e.length;++o)r[e[o].name]=e[o].toJSON(t);return r}}function p(e,t){u.call(this,e,t),this.nested=void 0,this._nestedArray=null}function l(e){return e._nestedArray=null,e}((p.prototype=Object.create(u.prototype)).constructor=p).className="Namespace",p.fromJSON=function(e,t){return new p(e,t.options).addJSON(t.nested)},p.arrayToJSON=c,p.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},p.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(p.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=i.toArray(this.nested))}}),p.prototype.toJSON=function(e){return i.toObject(["options",this.options,"nested",c(this.nestedArray,e)])},p.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),i=0;i<r.length;++i)t=e[r[i]],this.add((void 0!==t.fields?s.fromJSON:void 0!==t.values?o.fromJSON:void 0!==t.methods?a.fromJSON:void 0!==t.id?n.fromJSON:p.fromJSON)(r[i],t));return this},p.prototype.get=function(e){return this.nested&&this.nested[e]||null},p.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof o)return this.nested[e].values;throw Error("no such enum: "+e)},p.prototype.add=function(e){if(!(e instanceof n&&void 0!==e.extend||e instanceof s||e instanceof o||e instanceof a||e instanceof p))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof p&&e instanceof p)||t instanceof s||t instanceof a)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,i=0;i<r.length;++i)e.add(r[i]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),l(this)},p.prototype.remove=function(e){if(!(e instanceof u))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),l(this)},p.prototype.define=function(e,t){if(i.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 o=e.shift();if(r.nested&&r.nested[o]){if(!((r=r.nested[o])instanceof p))throw Error("path conflicts with non-namespace objects")}else r.add(r=new p(o))}return t&&r.addJSON(t),r},p.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof p?e[t++].resolveAll():e[t++].resolve();return this.resolve()},p.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),i.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 o=this.get(e[0]);if(o){if(1===e.length){if(!t||t.indexOf(o.constructor)>-1)return o}else if(o instanceof p&&(o=o.lookup(e.slice(1),t,!0)))return o}else for(var n=0;n<this.nestedArray.length;++n)if(this._nestedArray[n]instanceof p&&(o=this._nestedArray[n].lookup(e,t,!0)))return o;return null===this.parent||r?null:this.parent.lookup(e,t)},p.prototype.lookupType=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such type: "+e);return t},p.prototype.lookupEnum=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},p.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[s,o]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},p.prototype.lookupService=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},p._configure=function(){o=r(582),n=r(9286),i=r(8278),s=r(192),a=r(9447)}},5998:(e,t,r)=>{"use strict";var o,n;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.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}e.exports=i,i.className="ReflectionObject",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.setOptions=function(e,t){if(e)for(var r=Object.keys(e),o=0;o<r.length;++o)this.setOption(r[o],e[r[o]],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=r(4685),o=r(8278)}},9735:(e,t,r)=>{e.exports=s;var o,n,i=r(5998);function s(e,t,r,o){if(Array.isArray(t)||(r=t,t=void 0),i.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 a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}((s.prototype=Object.create(i.prototype)).constructor=s).className="OneOf",s.fromJSON=function(e,t){return new s(e,t.oneof,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.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,a(this),this},s.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},s.prototype.onAdd=function(e){i.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))}a(this)},s.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);i.prototype.onRemove.call(this,e)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){n.decorateType(t.constructor).add(new s(r,e)),Object.defineProperty(t,r,{get:n.oneOfGetter(e),set:n.oneOfSetter(e)})}},s._configure=function(){o=r(9286),n=r(8278)}},7845:(e,t,r)=>{"use strict";var o,n,i,s,a,u,c,p,l,d,h;e.exports=I,I.filename=null,I.defaults={keepCase:!1};var f=/^[1-9][0-9]*$/,m=/^-?[1-9][0-9]*$/,g=/^0[x][0-9a-fA-F]+$/,E=/^-?0[x][0-9a-fA-F]+$/,y=/^0[0-7]+$/,T=/^-?0[0-7]+$/,_=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,v=/^[a-zA-Z_][a-zA-Z_0-9]*$/,O=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,R=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/;function I(e,t,r){t instanceof n||(r=t,t=new n),r||(r=I.defaults);var S,N,C,A,M,b=o(e,r.alternateCommentMode||!1),U=b.next,w=b.push,k=b.peek,P=b.skip,L=b.cmnt,x=!0,D=!1,G=t,B=r.keepCase?function(e){return e}:h.camelCase;function j(e,t,r){var o=I.filename;return r||(I.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(o?o+", ":"")+"line "+b.line+")")}function H(){var e,t=[];do{if('"'!==(e=U())&&"'"!==e)throw j(e);t.push(U()),P(e),e=k()}while('"'===e||"'"===e);return t.join("")}function F(e){var t=U();switch(t){case"'":case'"':return w(t),H();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(y.test(e))return r*parseInt(e,8);if(_.test(e))return r*parseFloat(e);throw j(e,"number",!0)}(t)}catch(r){if(e&&O.test(t))return t;throw j(t,"value")}}function W(e,t){var r,o;do{!t||'"'!==(r=k())&&"'"!==r?e.push([o=q(U()),P("to",!0)?q(U()):o]):e.push(H())}while(P(",",!0));P(";")}function q(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw j(e,"id");if(m.test(e))return parseInt(e,10);if(E.test(e))return parseInt(e,16);if(T.test(e))return parseInt(e,8);throw j(e,"id")}function K(){if(void 0!==S)throw j("package");if(S=U(),!O.test(S))throw j(S,"name");G=G.define(S),P(";")}function V(){var e,t=k();switch(t){case"weak":e=C||(C=[]),U();break;case"public":U();default:e=N||(N=[])}t=H(),P(";"),e.push(t)}function z(){if(P("="),A=H(),!(D="proto3"===A)&&"proto2"!==A)throw j(A,"syntax");P(";")}function J(e,t){switch(t){case"option":return Q(e,t),P(";"),!0;case"message":return function(e,t){if(!v.test(t=U()))throw j(t,"type name");var r=new i(t);X(r,(function(e){if(!J(r,e))switch(e){case"map":!function(e){P("<");var t=U();if(void 0===d.mapKey[t])throw j(t,"type");P(",");var r=U();if(!O.test(r))throw j(r,"type");P(">");var o=U();if(!v.test(o))throw j(o,"name");P("=");var n=new a(B(o),q(U()),t,r);X(n,(function(e){if("option"!==e)throw j(e);Q(n,e),P(";")}),(function(){ee(n)})),e.add(n)}(r);break;case"required":case"optional":case"repeated":Y(r,e);break;case"oneof":!function(e,t){if(!v.test(t=U()))throw j(t,"name");var r=new u(B(t));X(r,(function(e){"option"===e?(Q(r,e),P(";")):(w(e),Y(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":W(r.extensions||(r.extensions=[]));break;case"reserved":W(r.reserved||(r.reserved=[]),!0);break;default:if(!D||!O.test(e))throw j(e);w(e),Y(r,"optional")}})),e.add(r)}(e,t),!0;case"enum":return function(e,t){if(!v.test(t=U()))throw j(t,"name");var r=new c(t);X(r,(function(e){switch(e){case"option":Q(r,e),P(";");break;case"reserved":W(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!v.test(t))throw j(t,"name");P("=");var r=q(U(),!0),o={};X(o,(function(e){if("option"!==e)throw j(e);Q(o,e),P(";")}),(function(){ee(o)})),e.add(t,r,o.comment)}(r,e)}})),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!v.test(t=U()))throw j(t,"service name");var r=new p(t);X(r,(function(e){if(!J(r,e)){if("rpc"!==e)throw j(e);!function(e,t){var r=t;if(!v.test(t=U()))throw j(t,"name");var o,n,i,s,a=t;if(P("("),P("stream",!0)&&(n=!0),!O.test(t=U()))throw j(t);if(o=t,P(")"),P("returns"),P("("),P("stream",!0)&&(s=!0),!O.test(t=U()))throw j(t);i=t,P(")");var u=new l(a,r,o,i,n,s);X(u,(function(e){if("option"!==e)throw j(e);Q(u,e),P(";")})),e.add(u)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!O.test(t=U()))throw j(t,"reference");var r=t;X(null,(function(t){switch(t){case"required":case"repeated":case"optional":Y(e,t,r);break;default:if(!D||!O.test(t))throw j(t);w(t),Y(e,"optional",r)}}))}(e,t),!0}return!1}function X(e,t,r){var o=b.line;if(e&&(e.comment=L(),e.filename=I.filename),P("{",!0)){for(var n;"}"!==(n=U());)t(n);P(";",!0)}else r&&r(),P(";"),e&&"string"!=typeof e.comment&&(e.comment=L(o))}function Y(e,t,r){var o=U();if("group"!==o){if(!O.test(o))throw j(o,"type");var n=U();if(!v.test(n))throw j(n,"name");n=B(n),P("=");var a=new s(n,q(U()),o,t,r);X(a,(function(e){if("option"!==e)throw j(e);Q(a,e),P(";")}),(function(){ee(a)})),e.add(a),D||!a.repeated||void 0===d.packed[o]&&void 0!==d.basic[o]||a.setOption("packed",!1,!0)}else!function(e,t){var r=U();if(!v.test(r))throw j(r,"name");var o=h.lcFirst(r);r===o&&(r=h.ucFirst(r)),P("=");var n=q(U()),a=new i(r);a.group=!0;var u=new s(o,n,r,t);u.filename=I.filename,X(a,(function(e){switch(e){case"option":Q(a,e),P(";");break;case"required":case"optional":case"repeated":Y(a,e);break;default:throw j(e)}})),e.add(a).add(u)}(e,t)}function Q(e,t){var r=P("(",!0);if(!O.test(t=U()))throw j(t,"name");var o=t;r&&(P(")"),o="("+o+")",t=k(),R.test(t)&&(o+=t,U())),P("="),$(e,o)}function $(e,t){if(P("{",!0))do{if(!v.test(M=U()))throw j(M,"name");"{"===k()?$(e,t+"."+M):(P(":"),"{"===k()?$(e,t+"."+M):Z(e,t+"."+M,F(!0)))}while(!P("}",!0));else Z(e,t,F(!0))}function Z(e,t,r){e.setOption&&e.setOption(t,r)}function ee(e){if(P("[",!0)){do{Q(e,"option")}while(P(",",!0));P("]")}return e}for(;null!==(M=U());)switch(M){case"package":if(!x)throw j(M);K();break;case"import":if(!x)throw j(M);V();break;case"syntax":if(!x)throw j(M);z();break;case"option":if(!x)throw j(M);Q(G,M),P(";");break;default:if(J(G,M)){x=!1;continue}throw j(M)}return I.filename=null,{package:S,imports:N,weakImports:C,syntax:A,root:t}}I._configure=function(){o=r(8869),n=r(4685),i=r(192),s=r(9286),a=r(1435),u=r(9735),c=r(582),p=r(9447),l=r(484),d=r(4696),h=r(8278)}},1444:e=>{var t=e.exports,r=t.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=t.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),o=r(e),n="";o&&(n=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):o?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return n+t.join("/")};t.resolve=function(e,t,n){return n||(t=o(t)),r(t)?t:(n||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},8997:e=>{e.exports=function(e,t,r){var o=r||8192,n=o>>>1,i=null,s=o;return function(r){if(r<1||r>n)return e(r);s+r>o&&(i=e(o),s=0);var a=t.call(i,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},8494:(e,t,r)=>{e.exports=a;var o,n,i=r(8278);function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function a(e){this.buf=e,this.pos=0,this.len=e.length}var u,c="undefined"!=typeof Uint8Array?function(e){return e instanceof Uint8Array||Array.isArray(e)?new a(e):("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer&&console.warn(""),new a(new Uint8Array(e)))}:function(e){if(Array.isArray(e))return new a(e)};function p(){var e=new o(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 l(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw s(this,8);return new o(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}a.create=i.Buffer?function(e){return(a.create=function(e){return i.Buffer.isBuffer(e)?new(void 0)(e):c(e)})(e)}:c,a.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,a.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}),a.prototype.int32=function(){return 0|this.uint32()},a.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},a.prototype.bool=function(){return 0!==this.uint32()},a.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return l(this.buf,this.pos+=4)},a.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|l(this.buf,this.pos+=4)},a.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},a.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},a.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)},a.prototype.string=function(){var e=this.bytes();return n.read(e,0,e.length)},a.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},a.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},a._configure=function(){o=r(8365),n=r(1498);var e=i.Long?"toLong":"toNumber";i.merge(a.prototype,{int64:function(){return p.call(this)[e](!1)},uint64:function(){return p.call(this)[e](!0)},sint64:function(){return p.call(this).zzDecode()[e](!1)},fixed64:function(){return d.call(this)[e](!0)},sfixed64:function(){return d.call(this)[e](!1)}})}},4685:(e,t,r)=>{e.exports=l;var o=r(2476);((l.prototype=Object.create(o.prototype)).constructor=l).className="Root";var n,i,s,a=r(9286),u=r(582),c=r(9735),p=r(8278);function l(e){o.call(this,"",e),this.deferred=[],this.files=[],this.names=[]}function d(){}l.fromJSON=function(e,t){return e="string"==typeof e?JSON.parse(e):e,t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},l.prototype.resolvePath=p.path.resolve,l.prototype.parseFromPbString=function e(t,r,o){"function"==typeof r&&(o=r,r=void 0);var n=this;if(!o)return p.asPromise(e,n,t,r);var a=null;if("string"==typeof t)a=JSON.parse(t);else{if("object"!=typeof t)return void console.log("pb格式转化失败");a=t}function u(e,t){if(o){var r=o;o=null,r(e,t)}}function c(e,t){try{if(p.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),p.isString(t)){i.filename=e;var o,s=i(t,n,r),a=0;if(s.imports)for(;a<s.imports.length;++a)l(o=s.imports[a]);if(s.weakImports){for(a=0;a<s.weakImports.length;++a)o=s.weakImports[a];l(o)}}else n.setOptions(t.options).addJSON(t.nested)}catch(e){u(e)}u(null,n)}function l(e){n.names.indexOf(e)>-1||(n.names.push(e),e in s&&c(e,s[e]))}c(a.name,a.pbJsonStr)},l.prototype.load=function e(t,r,o){"function"==typeof r&&(o=r,r=void 0);var n=this;if(!o)return p.asPromise(e,n,t,r);var a=o===d;function u(e,t){if(o){var r=o;if(o=null,a)throw e;r(e,t)}}function c(e,t){try{if(p.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),p.isString(t)){i.filename=e;var o,s=i(t,n,r),c=0;if(s.imports)for(;c<s.imports.length;++c)(o=n.resolvePath(e,s.imports[c]))&&l(o);if(s.weakImports)for(c=0;c<s.weakImports.length;++c)(o=n.resolvePath(e,s.weakImports[c]))&&l(o,!0)}else n.setOptions(t.options).addJSON(t.nested)}catch(e){u(e)}a||h||u(null,n)}function l(e,t){var r=e.lastIndexOf("google/protobuf/");if(r>-1){var i=e.substring(r);i in s&&(e=i)}if(!(n.files.indexOf(e)>-1))if(n.files.push(e),e in s)a?c(e,s[e]):(++h,setTimeout((function(){--h,c(e,s[e])})));else if(a){var l;try{l=p.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||u(e))}c(e,l)}else++h,p.fetch(e,(function(r,i){--h,o&&(r?t?h||u(null,n):u(r):c(e,i))}))}var h=0;p.isString(t)&&(t=[t]);for(var f,m=0;m<t.length;++m)(f=n.resolvePath("",t[m]))&&l(f);if(a)return n;h||u(null,n)},l.prototype.loadSync=function(e,t){if(!p.isNode)throw Error("not supported");return this.load(e,t,d)},l.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 o.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function f(e,t){var r=t.parent.lookup(t.extend);if(r){var o=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return o.declaringField=t,t.extensionField=o,r.add(o),!0}return!1}l.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof u)h.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof c)){if(e instanceof n)for(var t=0;t<this.deferred.length;)f(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);h.test(e.name)&&(e.parent[e.name]=e)}},l.prototype._handleRemove=function(e){if(e instanceof a){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 u)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof o){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);h.test(e.name)&&delete e.parent[e.name]}},l._configure=function(){n=r(192),i=r(7845),s=r(3072),a=r(9286),u=r(582),c=r(9735),p=r(8278)}},889:e=>{e.exports={}},7325:(e,t,r)=>{"use strict";e.exports=n;var o=r(8278);function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");o.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(n.prototype=Object.create(o.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,r,n,i,s){if(!i)throw TypeError("request must be specified");var a=this;if(!s)return o.asPromise(e,a,t,r,n,i);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof n))try{r=n[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},9447:(e,t,r)=>{"use strict";e.exports=a;var o,n,i,s=r(2476);function a(e,t){s.call(this,e,t),this.methods={},this._methodsArray=null}function u(e){return e._methodsArray=null,e}((a.prototype=Object.create(s.prototype)).constructor=a).className="Service",a.fromJSON=function(e,t){var r=new a(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},a.prototype.toJSON=function(e){var t=s.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return n.toObject(["options",t&&t.options||void 0,"methods",s.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=n.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||s.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return s.prototype.resolve.call(this)},a.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,u(this)):s.prototype.add.call(this,e)},a.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,u(this)}return s.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var o,s=new i.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var u=n.lcFirst((o=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");s[u]=n.codegen(["r","c"],n.isReserved(u)?u+"_":u)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return s},a._configure=function(){o=r(484),n=r(8278),i=r(7325)}},8869:e=>{e.exports=l;var t=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,o=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,n=/^ *[*/]+ */,i=/^\s*\*?\/*/,s=/\n/g,a=/\s/,u=/\\(.?)/g,c={0:"\0",r:"\r",n:"\n",t:"\t"};function p(e){return e.replace(u,(function(e,t){switch(t){case"\\":case"":return t;default:return c[t]||""}}))}function l(e,u){e=e.toString();var c=0,l=e.length,d=1,h=null,f=null,m=0,g=!1,E=[],y=null;function T(e){return Error("illegal "+e+" (line "+d+")")}function _(t){return e.charAt(t)}function v(t,r){h=e.charAt(t++),m=d,g=!1;var o,a=t-(u?2:3);do{if(--a<0||"\n"===(o=e.charAt(a))){g=!0;break}}while(" "===o||"\t"===o);for(var c=e.substring(t,r).split(s),p=0;p<c.length;++p)c[p]=c[p].replace(u?i:n,"").trim();f=c.join("\n").trim()}function O(t){var r=R(t),o=e.substring(t,r);return/^\s*\/{1,2}/.test(o)}function R(e){for(var t=e;t<l&&"\n"!==_(t);)t++;return t}function I(){if(E.length>0)return E.shift();if(y)return function(){var t="'"===y?o:r;t.lastIndex=c-1;var n=t.exec(e);if(!n)throw T("string");return c=t.lastIndex,S(y),y=null,p(n[1])}();var n,i,s,h,f;do{if(c===l)return null;for(n=!1;a.test(s=_(c));)if("\n"===s&&++d,++c===l)return null;if("/"===_(c)){if(++c===l)throw T("comment");if("/"===_(c))if(u){if(h=c,f=!1,O(c)){f=!0;do{if((c=R(c))===l)break;c++}while(O(c))}else c=Math.min(l,R(c)+1);f&&v(h,c),d++,n=!0}else{for(f="/"===_(h=c+1);"\n"!==_(++c);)if(c===l)return null;++c,f&&v(h,c-1),++d,n=!0}else{if("*"!==(s=_(c)))return"/";h=c+1,f=u||"*"===_(h);do{if("\n"===s&&++d,++c===l)throw T("comment");i=s,s=_(c)}while("*"!==i||"/"!==s);++c,f&&v(h,c-2),n=!0}}}while(n);var m=c;if(t.lastIndex=0,!t.test(_(m++)))for(;m<l&&!t.test(_(m));)++m;var g=e.substring(c,c=m);return'"'!==g&&"'"!==g||(y=g),g}function S(e){E.push(e)}function N(){if(!E.length){var e=I();if(null===e)return null;S(e)}return E[0]}return Object.defineProperty({next:I,peek:N,push:S,skip:function(e,t){var r=N();if(r===e)return I(),!0;if(!t)throw T("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t=null;return void 0===e?m===d-1&&(u||"*"===h||g)&&(t=f):(m<e&&N(),m!==e||g||!u&&"/"!==h||(t=f)),t}},"line",{get:function(){return d}})}l.unescape=p},192:(e,t,r)=>{e.exports=y;var o,n,i,s,a,u,c,p,l,d,h,f,m,g,E=r(2476);function y(e,t){E.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 T(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}((y.prototype=Object.create(E.prototype)).constructor=y).className="Type",Object.defineProperties(y.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]],o=r.id;if(this._fieldsById[o])throw Error("duplicate id "+o+" in "+this);this._fieldsById[o]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=c.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=c.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=y.generateConstructor(this))},set:function(e){var t=e.prototype;t instanceof i||((e.prototype=new i).constructor=e,c.merge(e.prototype,t)),e.$type=e.prototype.$type=this,c.merge(e,i,!0),c.merge(e.prototype,i,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var o={};for(r=0;r<this.oneofsArray.length;++r){var n=this._oneofsArray[r].resolve().name,s=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=0;return{setter:function(r){if(!(e.indexOf(r)<0)){t[r]=1;for(var o=0;o<e.length;++o)e[o]!==r&&delete this[e[o]]}},getter: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]}}}(this._oneofsArray[r].oneof);o[n]={get:s.getter,set:s.setter}}r&&Object.defineProperties(e.prototype,o)}}}),y.generateConstructor=function(e){return function(t){for(var r,o=0;o<e.fieldsArray.length;o++)(r=e._fieldsArray[o]).map?this[r.name]={}:r.repeated&&(this[r.name]=[]);if(t)for(var n=Object.keys(t),i=0;i<n.length;++i)null!=t[n[i]]&&(this[n[i]]=t[n[i]])}},y.fromJSON=function(e,t){var r=new y(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var i=Object.keys(t.fields),a=0;a<i.length;++a)r.add((void 0!==t.fields[i[a]].keyType?g.fromJSON:n.fromJSON)(i[a],t.fields[i[a]]));if(t.oneofs)for(i=Object.keys(t.oneofs),a=0;a<i.length;++a)r.add(s.fromJSON(i[a],t.oneofs[i[a]]));if(t.nested)for(i=Object.keys(t.nested),a=0;a<i.length;++a){var u=t.nested[i[a]];r.add((void 0!==u.id?n.fromJSON:void 0!==u.fields?y.fromJSON:void 0!==u.values?o.fromJSON:void 0!==u.methods?h.fromJSON:E.fromJSON)(i[a],u))}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},y.prototype.toJSON=function(e){var t=E.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return{options:t&&t.options||void 0,oneofs:E.arrayToJSON(this.oneofsArray,e),fields:E.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}},y.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 E.prototype.resolveAll.call(this)},y.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},y.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof n&&void 0===e.extend){if(this._fieldsById&&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),T(this)}return e instanceof s?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),T(this)):E.prototype.add.call(this,e)},y.prototype.remove=function(e){if(e instanceof n&&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),T(this)}if(e instanceof s){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),T(this)}return E.prototype.remove.call(this,e)},y.prototype.isReservedId=function(e){return E.isReservedId(this.reserved,e)},y.prototype.isReservedName=function(e){return E.isReservedName(this.reserved,e)},y.prototype.create=function(e){return new this.ctor(e)},y.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=l(this)({Writer:a,types:t,util:c}),this.decode=d(this)({Reader:u,types:t,util:c}),this.verify=p(this)({types:t,util:c}),this.fromObject=m.fromObject(this)({types:t,util:c}),this.toObject=m.toObject(this)({types:t,util:c});var o=f[e];if(o){var n=Object.create(this);n.fromObject=this.fromObject,this.fromObject=o.fromObject.bind(n),n.toObject=this.toObject,this.toObject=o.toObject.bind(n)}return this},y.prototype.encode=function(e,t){return this.setup().encode(e,t)},y.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},y.prototype.decode=function(e,t){return this.setup().decode(e,t)},y.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},y.prototype.verify=function(e){return this.setup().verify(e)},y.prototype.fromObject=function(e){return this.setup().fromObject(e)},y.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},y.d=function(e){return function(t){c.decorateType(t,e)}},y._configure=function(){o=r(582),n=r(9286),i=r(339),s=r(9735),a=r(5244),u=r(8494),c=r(8278),p=r(5484),l=r(9929),d=r(3888),h=r(9447),f=r(7834),m=r(525),g=r(1435)}},4696:(e,t,r)=>{"use strict";var o=e.exports,n=r(8278),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function s(e,t){var r=0,o={};for(t|=0;r<e.length;)o[i[r+t]]=e[r++];return o}o.basic=s([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),o.defaults=s([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",n.emptyArray,null]),o.long=s([0,0,0,1,1],7),o.mapKey=s([0,0,0,5,5,0,0,0,1,1,0,2],2),o.packed=s([1,5,0,0,0,5,5,0,0,0,1,1,0]),o._configure=function(){n=r(8278)}},1498:e=>{"use strict";var t=e.exports;t.length=function(e){for(var t=0,r=0,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(o+1))?(++o,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return"";for(var o,n=null,i=[],s=0;t<r;)(o=e[t++])<128?i[s++]=o:o>191&&o<224?i[s++]=(31&o)<<6|63&e[t++]:o>239&&o<365?(o=((7&o)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[s++]=55296+(o>>10),i[s++]=56320+(1023&o)):i[s++]=(15&o)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,i)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,i.slice(0,s))),n.join("")):String.fromCharCode.apply(String,i.slice(0,s))},t.write=function(e,t,r){for(var o,n,i=r,s=0;s<e.length;++s)(o=e.charCodeAt(s))<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=63&o|128):55296==(64512&o)&&56320==(64512&(n=e.charCodeAt(s+1)))?(o=65536+((1023&o)<<10)+(1023&n),++s,t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=63&o|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=63&o|128);return r-i}},8278:(e,t,r)=>{var o=e.exports,n=r(889);o.LongBits=r(8365),o.Long=r(4939),o.pool=r(8997),o.float=r(1283),o.asPromise=r(6728),o.EventEmitter=r(7969),o.path=r(1444),o.base64=r(5889),o.utf8=r(1498),o.compareFieldsById=function(e,t){return e.id-t.id},o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),o=0;o<t.length;)r[o]=e[t[o++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var o=e[r++],n=e[r++];void 0!==n&&(t[o]=n)}return t},o.isString=function(e){return"string"==typeof e||e instanceof String},o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.isObject=function(e){return e&&"object"==typeof e},o.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,o.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]}},o.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},o.merge=function(e,t,r){for(var o=Object.keys(t),n=0;n<o.length;++n)void 0!==e[o[n]]&&r||(e[o[n]]=t[o[n]]);return e},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;Type||(Type=r(192));var n=new Type(t||e.name);return o.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n},o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.longToHash=function(e){return e?o.LongBits.from(e).toHash():o.LongBits.zeroHash},o.copy=function(e){if("object"!=typeof e)return e;var t={};for(var r in e)t[r]=e[r];return t},o.deepCopy=function e(t){if("object"!=typeof t)return t;var r={};for(var o in t)r[o]=e(t[o]);return r},o.ProtocolError=function(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&&merge(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},o.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},o.Buffer=null,o.newBuffer=function(e){return"number"==typeof e?new o.Array(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},o.stringToBytes=function(e){var t,r,o=[];t=e.length;for(var n=0;n<t;n++)(r=e.charCodeAt(n))>=65536&&r<=1114111?(o.push(r>>18&7|240),o.push(r>>12&63|128),o.push(r>>6&63|128),o.push(63&r|128)):r>=2048&&r<=65535?(o.push(r>>12&15|224),o.push(r>>6&63|128),o.push(63&r|128)):r>=128&&r<=2047?(o.push(r>>6&31|192),o.push(63&r|128)):o.push(255&r);return o},o.byteToString=function(e){if("string"==typeof e)return e;for(var t="",r=e,o=0;o<r.length;o++){var n=r[o].toString(2),i=n.match(/^1+?(?=0)/);if(i&&8==n.length){for(var s=i[0].length,a=r[o].toString(2).slice(7-s),u=1;u<s;u++)a+=r[u+o].toString(2).slice(2);t+=String.fromCharCode(parseInt(a,2)),o+=s-1}else t+=String.fromCharCode(r[o])}return t},o.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Object.defineProperty(o,"decorateRoot",{get:function(){return n.decorated||(n.decorated=new(r(4685)))}})},5484:(e,t,r)=>{var o,n;function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,r,s){var a=s.types;if(e.resolvedType)if(e.resolvedType instanceof o){if(Object.keys(e.resolvedType.values).indexOf(r)<0)return i(e,"enum value")}else{var u=a[t].verify(r);if(u)return e.name+"."+u}else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(!n.isInteger(r))return i(e,"integer");break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(!(n.isInteger(r)||r&&n.isInteger(r.low)&&n.isInteger(r.high)))return i(e,"integer|Long");break;case"float":case"double":if("number"!=typeof r)return i(e,"number");break;case"bool":if("boolean"!=typeof r)return i(e,"boolean");break;case"string":if(!n.isString(r))return i(e,"string");break;case"bytes":if(!(r&&"number"==typeof r.length||n.isString(r)))return i(e,"buffer")}}function a(e,t){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(!n.key32Re.test(t))return i(e,"integer key");break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(!n.key64Re.test(t))return i(e,"integer|Long key");break;case"bool":if(!n.key2Re.test(t))return i(e,"boolean key")}}function u(e){return function(t){return function(r){var o;if("object"!=typeof r||null===r)return"object expected";var u,c={};e.oneofsArray.length&&(u={});for(var p=0;p<e.fieldsArray.length;++p){var l,d=e._fieldsArray[p].resolve(),h=r[d.name];if(!d.optional||null!=h&&r.hasOwnProperty(d.name))if(d.map){if(!n.isObject(h))return i(d,"object");var f=Object.keys(h);for(l=0;l<f.length;++l){if(o=a(d,f[l]))return o;if(o=s(d,p,h[f[l]],t))return o}}else if(d.repeated){if(!Array.isArray(h))return i(d,"array");for(l=0;l<h.length;++l)if(o=s(d,p,h[l],t))return o}else{if(d.partOf){var m=d.partOf.name;if(1===c[d.partOf.name]&&1===u[m])return d.partOf.name+": multiple values";u[m]=1}if(o=s(d,p,h,t))return o}}}}}e.exports=u,u._configure=function(){o=r(582),n=r(8278)}},7834:(e,t,r)=>{var o,n=t;n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=this.lookup(e["@type"]);if(t){var r="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return this.create({type_url:"/"+r,value:t.encode(t.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){if(t&&t.json&&e.type_url&&e.value){var r=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=this.lookup(r);n&&(e=n.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof o){var i=e.$type.toObject(e,t);return i["@type"]=e.$type.fullName,i}return this.toObject(e,t)}},n._configure=function(){o=r(339)}},5244:(e,t,r)=>{e.exports=c;var o,n=r(8278),i=r(1498);function s(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function a(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function c(){this.len=0,this.head=new s(a,0,0),this.tail=this.head,this.states=null}function p(e,t,r){t[r]=255&e}function l(e,t){this.len=e,this.next=void 0,this.val=t}function d(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 h(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}c.create=n.Buffer?function(){return(c.create=function(){return new(void 0)})()}:function(){return new c},c.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(c.alloc=n.pool(c.alloc,n.Array.prototype.subarray)),c.prototype._push=function(e,t,r){return this.tail=this.tail.next=new s(e,t,r),this.len+=t,this},l.prototype=Object.create(s.prototype),l.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},c.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new l((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},c.prototype.int32=function(e){return e<0?this._push(d,10,o.fromNumber(e)):this.uint32(e)},c.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},c.prototype.uint64=function(e){var t=o.from(e);return this._push(d,t.length(),t)},c.prototype.int64=c.prototype.uint64,c.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(d,t.length(),t)},c.prototype.bool=function(e){return this._push(p,1,e?1:0)},c.prototype.fixed32=function(e){return this._push(h,4,e>>>0)},c.prototype.sfixed32=c.prototype.fixed32,c.prototype.fixed64=function(e){var t=o.from(e);return this._push(h,4,t.lo)._push(h,4,t.hi)},c.prototype.sfixed64=c.prototype.fixed64,c.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},c.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var f=n.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var o=0;o<e.length;++o)t[r+o]=e[o]};c.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(p,1,0);if(n.isString(e)){var r=c.alloc(t=i.length(e));i.write(e,r,0),e=r}return this.uint32(t)._push(f,t,e)},c.prototype.string=function(e){var t=i.length(e);return t?this.uint32(t)._push(i.write,t,e):this._push(p,1,0)},c.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new s(a,0,0),this.len=0,this},c.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 s(a,0,0),this.len=0),this},c.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},c.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},c._configure=function(){o=r(8365),r(5889),i=r(1498)}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{default:()=>ei});var e={};r.r(e),r.d(e,{acceptContactInvite:()=>jt,acceptInvitation:()=>Bt,addContact:()=>Dt,addReaction:()=>$t,addToBlackList:()=>Wt,addUsersToBlacklist:()=>qt,declineContactInvite:()=>Ft,declineInvitation:()=>Ht,deleteContact:()=>Gt,deleteReaction:()=>Zt,deleteSession:()=>Mt,fetchHistoryMessages:()=>Pt,fetchUserInfoById:()=>Ut,getBlacklist:()=>Ot,getChatToken:()=>kt,getContacts:()=>It,getConversationList:()=>At,getHistoryMessages:()=>xt,getReactionDetail:()=>tr,getReactionList:()=>er,getRoster:()=>Rt,getSessionList:()=>Ct,recallMessage:()=>Qt,removeFromBlackList:()=>Kt,removeRoster:()=>Yt,removeUserFromBlackList:()=>Vt,reportMessage:()=>rr,subscribe:()=>zt,subscribed:()=>Jt,unsubscribed:()=>Xt,updateCurrentUserNick:()=>wt,updateOwnUserInfo:()=>bt,uploadPushToken:()=>Nt,uploadToken:()=>St});var t={};r.r(t),r.d(t,{acceptGroupInvite:()=>Ur,acceptGroupJoinRequest:()=>Cr,addUsersToGroupWhitelist:()=>ro,agreeInviteIntoGroup:()=>br,agreeJoinGroup:()=>Nr,blockGroup:()=>ir,blockGroupMember:()=>Kr,blockGroupMembers:()=>zr,blockGroupMessages:()=>sr,changeGroupOwner:()=>lr,changeOwner:()=>pr,createGroup:()=>nr,createGroupNew:()=>or,deleteGroupSharedFile:()=>ho,destroyGroup:()=>vr,disableSendGroupMsg:()=>eo,dissolveGroup:()=>_r,downloadGroupSharedFile:()=>mo,enableSendGroupMsg:()=>to,fetchGroupAnnouncement:()=>co,fetchGroupSharedFileList:()=>fo,getGroup:()=>ur,getGroupAdmin:()=>gr,getGroupBlacklist:()=>Zr,getGroupBlacklistNew:()=>$r,getGroupInfo:()=>dr,getGroupMsgReadUser:()=>uo,getGroupMuteList:()=>Wr,getGroupWhitelist:()=>io,getJoinedGroups:()=>cr,getMuted:()=>Fr,groupBlockMulti:()=>Vr,groupBlockSingle:()=>qr,inviteToGroup:()=>Rr,inviteUsersToGroup:()=>Ir,isGroupWhiteUser:()=>so,isInGroupWhiteList:()=>ao,joinGroup:()=>Sr,listGroupMember:()=>fr,listGroupMembers:()=>mr,listGroups:()=>ar,modifyGroup:()=>hr,mute:()=>Gr,muteGroupMember:()=>Br,quitGroup:()=>Or,rejectGroupInvite:()=>kr,rejectGroupJoinRequest:()=>Mr,rejectInviteIntoGroup:()=>wr,rejectJoinGroup:()=>Ar,removeAdmin:()=>Tr,removeGroupBlockMulti:()=>Yr,removeGroupBlockSingle:()=>Jr,removeGroupMember:()=>Lr,removeGroupMembers:()=>Dr,removeGroupWhitelistMember:()=>no,removeMultiGroupMember:()=>xr,removeMute:()=>jr,removeSingleGroupMember:()=>Pr,rmUsersFromGroupWhitelist:()=>oo,setAdmin:()=>Er,setGroupAdmin:()=>yr,unblockGroupMember:()=>Xr,unblockGroupMembers:()=>Qr,unmuteGroupMember:()=>Hr,updateGroupAnnouncement:()=>po,uploadGroupSharedFile:()=>lo});var n={};r.r(n),r.d(n,{addUsersToChatRoom:()=>So,addUsersToChatRoomWhitelist:()=>Yo,blockChatRoomMember:()=>Bo,blockChatRoomMembers:()=>Ho,chatRoomBlockMulti:()=>jo,chatRoomBlockSingle:()=>Go,createChatRoom:()=>Eo,deleteChatRoomSharedFile:()=>nn,destroyChatRoom:()=>yo,disableSendChatRoomMsg:()=>Jo,enableSendChatRoomMsg:()=>Xo,fetchChatRoomAnnouncement:()=>tn,fetchChatRoomSharedFileList:()=>sn,getChatRoomAdmin:()=>bo,getChatRoomBlacklist:()=>zo,getChatRoomBlacklistNew:()=>Vo,getChatRoomDetails:()=>To,getChatRoomMuteList:()=>Do,getChatRoomMuted:()=>xo,getChatRoomWhitelist:()=>Zo,getChatRooms:()=>go,isChatRoomWhiteUser:()=>en,joinChatRoom:()=>No,listChatRoomMember:()=>Ao,listChatRoomMembers:()=>Mo,modifyChatRoom:()=>_o,muteChatRoomMember:()=>ko,quitChatRoom:()=>Co,removeChatRoomAdmin:()=>wo,removeChatRoomBlockMulti:()=>qo,removeChatRoomBlockSingle:()=>Fo,removeChatRoomMember:()=>Oo,removeChatRoomMembers:()=>Io,removeChatRoomWhitelistMember:()=>$o,removeMultiChatRoomMember:()=>Ro,removeMuteChatRoomMember:()=>Po,removeSingleChatRoomMember:()=>vo,rmUsersFromChatRoomWhitelist:()=>Qo,setChatRoomAdmin:()=>Uo,unblockChatRoomMember:()=>Wo,unblockChatRoomMembers:()=>Ko,unmuteChatRoomMember:()=>Lo,updateChatRoomAnnouncement:()=>rn,uploadChatRoomSharedFile:()=>on});var i={};r.r(i),r.d(i,{getPresenceStatus:()=>ln,getSubscribedPresenceList:()=>pn,publishPresence:()=>an,subscribePresence:()=>un,unsubscribePresence:()=>cn});var s={};r.r(s),r.d(s,{clearRemindTypeForConversation:()=>mn,getPushPerformLanguage:()=>Tn,getSilentModeForAll:()=>hn,getSilentModeForConversation:()=>gn,getSilentModeForConversations:()=>En,setPushPerformLanguage:()=>yn,setSilentModeForAll:()=>dn,setSilentModeForConversation:()=>fn});var a={};r.r(a),r.d(a,{changeChatThreadName:()=>Nn,createChatThread:()=>On,destroyChatThread:()=>Sn,getChatThreadDetail:()=>wn,getChatThreadLastMessage:()=>Un,getChatThreadMembers:()=>Cn,getChatThreads:()=>bn,getJoinedChatThreads:()=>Mn,joinChatThread:()=>Rn,leaveChatThread:()=>In,removeChatThreadMember:()=>An});var u={};r.r(u),r.d(u,{getSupportedLanguages:()=>kn,translateMessage:()=>Pn});var c={};function p(){c.converter._configure(),c.decoder._configure(),c.encoder._configure(),c.Field._configure(),c.MapField._configure(),c.Message._configure(),c.Namespace._configure(),c.Method._configure(),c.ReflectionObject._configure(),c.OneOf._configure(),c.parse._configure(),c.Reader._configure(),c.Root._configure(),c.Service._configure(),c.verifier._configure(),c.Type._configure(),c.types._configure(),c.wrappers._configure(),c.Writer._configure()}c.build="minimal",c.Writer=r(5244),c.encoder=r(9929),c.Reader=r(8494),c.util=r(8278),c.rpc=r(7325),c.roots=r(889),c.verifier=r(5484),c.tokenize=r(8869),c.parse=r(7845),c.common=r(3072),c.ReflectionObject=r(5998),c.Namespace=r(2476),c.Root=r(4685),c.Enum=r(582),c.Type=r(192),c.Field=r(9286),c.OneOf=r(9735),c.MapField=r(1435),c.Service=r(9447),c.Method=r(484),c.converter=r(525),c.decoder=r(3888),c.Message=r(339),c.wrappers=r(7834),c.types=r(4696),c.util=r(8278),c.configure=p,c.load=function(e,t,r){return"function"==typeof t?(r=t,t=new c.Root):t||(t=new c.Root),t.load(e,r)},c.loadSync=function(e,t){return t||(t=new c.Root),t.loadSync(e)},c.parseFromPbString=function(e,t,r){return"function"==typeof t?(r=t,t=new c.Root):t||(t=new c.Root),t.parseFromPbString(e,r)},p();const l=c;var d=r(3720),h=r.n(d);const f=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}();var m;!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.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.USER_NOT_FOUND=204]="USER_NOT_FOUND",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_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.WEBIM_MESSAGE_REC_AUDIO=304]="WEBIM_MESSAGE_REC_AUDIO",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.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.REST_PARAMS_STATUS=700]="REST_PARAMS_STATUS",e[e.CHATROOM_MEMBERS_FULL=704]="CHATROOM_MEMBERS_FULL",e[e.CHATROOM_NOT_EXIST=705]="CHATROOM_NOT_EXIST",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"}(m||(m={}));const g=m;var E=function(){return E=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},E.apply(this,arguments)};var y,T,_,v,O,R;!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_OPERATE=10]="REST_OPERATE",e[e.MSYNC_SENDMESSAGE=11]="MSYNC_SENDMESSAGE",e[e.MSYNC_RECALLMESSAGE=12]="MSYNC_RECALLMESSAGE",e[e.MSYNC_OPERATE=20]="MSYNC_OPERATE",e[e.ROSTER_ADD=21]="ROSTER_ADD",e[e.ROSTER_REMOVE=22]="ROSTER_REMOVE",e[e.ROSTER_ACCEPT=23]="ROSTER_ACCEPT",e[e.ROSTER_DECLINE=24]="ROSTER_DECLINE",e[e.ROSTER_BAN=25]="ROSTER_BAN",e[e.ROSTER_ALLOW=26]="ROSTER_ALLOW",e[e.ROSTER_BLACKLIST=27]="ROSTER_BLACKLIST",e[e.ROSTER_CONTACTS=28]="ROSTER_CONTACTS",e[e.ROSTER_OPERATE=30]="ROSTER_OPERATE",e[e.USER_LOGIN=31]="USER_LOGIN",e[e.USER_CREATE=32]="USER_CREATE",e[e.USER_UPDATE_USERINFO=33]="USER_UPDATE_USERINFO",e[e.USER_FETCH_USERINFO=34]="USER_FETCH_USERINFO",e[e.USER_UPDATE_NICK=35]="USER_UPDATE_NICK",e[e.USER_UPLOAD_PUSH_TOKEN=36]="USER_UPLOAD_PUSH_TOKEN",e[e.USER_OPERATE=40]="USER_OPERATE",e[e.GROUP_CREATEGROUP=41]="GROUP_CREATEGROUP",e[e.GROUP_BLOCK_MESSAGE=42]="GROUP_BLOCK_MESSAGE",e[e.GROUP_FETCH_PUBLICGROUPS_WITHCURSOR=43]="GROUP_FETCH_PUBLICGROUPS_WITHCURSOR",e[e.GROUP_FETCH_USERS_GROUP=44]="GROUP_FETCH_USERS_GROUP",e[e.GROUP_CHANGE_OWNER=45]="GROUP_CHANGE_OWNER",e[e.GROUP_FETCH_SPECIFICATION=46]="GROUP_FETCH_SPECIFICATION",e[e.GROUP_CHANGE_GROUPATTRIBUTE=47]="GROUP_CHANGE_GROUPATTRIBUTE",e[e.GROUP_FETCH_MEMEBERS=48]="GROUP_FETCH_MEMEBERS",e[e.GROUP_GET_ADMIN=49]="GROUP_GET_ADMIN",e[e.GROUP_SET_ADMIN=50]="GROUP_SET_ADMIN",e[e.GROUP_REMOVE_ADMIN=51]="GROUP_REMOVE_ADMIN",e[e.GROUP_DESTOTYGROUP=52]="GROUP_DESTOTYGROUP",e[e.GROUP_LEAVEGROUP=53]="GROUP_LEAVEGROUP",e[e.GROUP_INVITE_TO_GROUP=54]="GROUP_INVITE_TO_GROUP",e[e.GROUP_JOIN_PUBLICGROUP=55]="GROUP_JOIN_PUBLICGROUP",e[e.GROUP_ACCEPT_JOINPUBLICGROUPAPPL=56]="GROUP_ACCEPT_JOINPUBLICGROUPAPPL",e[e.GROUP_DECLINE_JOINPUBLICGROUPAPPL=57]="GROUP_DECLINE_JOINPUBLICGROUPAPPL",e[e.GROUP_ACCEPT_INVITATION=58]="GROUP_ACCEPT_INVITATION",e[e.GROUP_DECLINE_INVITATION=59]="GROUP_DECLINE_INVITATION",e[e.GROUP_REMOVE_MEMBER=60]="GROUP_REMOVE_MEMBER",e[e.GROUP_REMOVE_MEMBERS=61]="GROUP_REMOVE_MEMBERS",e[e.GROUP_MUTE_MEMBERS=62]="GROUP_MUTE_MEMBERS",e[e.GROUP_UNMUTE_MEMBERS=63]="GROUP_UNMUTE_MEMBERS",e[e.GROUP_FETCH_MUTES=64]="GROUP_FETCH_MUTES",e[e.GROUP_BLOCK_MEMBER=65]="GROUP_BLOCK_MEMBER",e[e.GROUP_BLOCK_MEMBERS=66]="GROUP_BLOCK_MEMBERS",e[e.GROUP_UNBLOCK_MEMBER=67]="GROUP_UNBLOCK_MEMBER",e[e.GROUP_UNBLOCK_MEMBERS=68]="GROUP_UNBLOCK_MEMBERS",e[e.GROUP_GET_BLOCK_LIST=69]="GROUP_GET_BLOCK_LIST",e[e.GROUP_MUTE_ALLMEMBERS=70]="GROUP_MUTE_ALLMEMBERS",e[e.GROUP_UNMUTE_ALLMEMBERS=71]="GROUP_UNMUTE_ALLMEMBERS",e[e.GROUP_ADD_WHITELIST=72]="GROUP_ADD_WHITELIST",e[e.GROUP_REMOVE_WHITELIST=73]="GROUP_REMOVE_WHITELIST",e[e.GROUP_FETCH_WHITELIST=74]="GROUP_FETCH_WHITELIST",e[e.GROUP_IS_IN_WHITELIST=75]="GROUP_IS_IN_WHITELIST",e[e.GROUP_GET_READ_USERS=76]="GROUP_GET_READ_USERS",e[e.GROUP_FETCH_ANNOUNCEMENT=77]="GROUP_FETCH_ANNOUNCEMENT",e[e.GROUP_UPDATE_ANNOUNCEMENT=78]="GROUP_UPDATE_ANNOUNCEMENT",e[e.GROUP_UPLOAD_SHAREDFILE=79]="GROUP_UPLOAD_SHAREDFILE",e[e.GROUP_DELETE_SHAREDFILE=80]="GROUP_DELETE_SHAREDFILE",e[e.GROUP_FETCH_SHAREDFILE=81]="GROUP_FETCH_SHAREDFILE",e[e.GROUP_DOWNLOAD_SHAREDFILE=82]="GROUP_DOWNLOAD_SHAREDFILE",e[e.GROUP_OPERATE=100]="GROUP_OPERATE",e[e.CHATROOM_FETCH_CHATROOMSWITHPAGE=101]="CHATROOM_FETCH_CHATROOMSWITHPAGE",e[e.CHATROOM_CREATECHATROOM=102]="CHATROOM_CREATECHATROOM",e[e.CHATROOM_DESTORYCHATROOM=103]="CHATROOM_DESTORYCHATROOM",e[e.CHATROOM_FETCH_SPECIFICATION=104]="CHATROOM_FETCH_SPECIFICATION",e[e.CHATROOM_CHANGE_ATTRIBUTE=105]="CHATROOM_CHANGE_ATTRIBUTE",e[e.CHATROOM_REMOVE_MEMBER=106]="CHATROOM_REMOVE_MEMBER",e[e.CHATROOM_REMOVE_MEMBERS=107]="CHATROOM_REMOVE_MEMBERS",e[e.CHATROOM_ADD_MEMBERS=108]="CHATROOM_ADD_MEMBERS",e[e.CHATROOM_JOINCAHTROOM=109]="CHATROOM_JOINCAHTROOM",e[e.CHATROOM_LEAVECAHTROOM=110]="CHATROOM_LEAVECAHTROOM",e[e.CHATROOM_FETCH_MEMBERS=111]="CHATROOM_FETCH_MEMBERS",e[e.CHATROOM_GET_ADMIN=112]="CHATROOM_GET_ADMIN",e[e.CHATROOM_SET_ADMIN=113]="CHATROOM_SET_ADMIN",e[e.CHATROOM_REMOVE_ADMIN=114]="CHATROOM_REMOVE_ADMIN",e[e.CHATROOM_MUTE_USER=115]="CHATROOM_MUTE_USER",e[e.CHATROOM_UNMUTE_USER=116]="CHATROOM_UNMUTE_USER",e[e.CHATROOM_FETCH_MUTES=117]="CHATROOM_FETCH_MUTES",e[e.CHATROOM_BLOCK_USER=118]="CHATROOM_BLOCK_USER",e[e.CHATROOM_BLOCK_USERS=119]="CHATROOM_BLOCK_USERS",e[e.CHATROOM_UNBLOCK_USER=120]="CHATROOM_UNBLOCK_USER",e[e.CHATROOM_UNBLOCK_USERS=121]="CHATROOM_UNBLOCK_USERS",e[e.CHATROOM_FETCH_BANS=122]="CHATROOM_FETCH_BANS",e[e.CHATROOM_MUTE_ALLMEMEBERS=123]="CHATROOM_MUTE_ALLMEMEBERS",e[e.CHATROOM_UNMUTE_ALLMEMEBERS=124]="CHATROOM_UNMUTE_ALLMEMEBERS",e[e.CHATROOM_ADD_WHITELIST=125]="CHATROOM_ADD_WHITELIST",e[e.CHATROOM_REMOVE_WHITELIST=126]="CHATROOM_REMOVE_WHITELIST",e[e.CHATROOM_FETCH_WHITELIST=127]="CHATROOM_FETCH_WHITELIST",e[e.CHATROOM_FETCH_MEMBERIN_WHITELIST=128]="CHATROOM_FETCH_MEMBERIN_WHITELIST",e[e.CHATROOM_FETCH_ANNOUNCEMENT=129]="CHATROOM_FETCH_ANNOUNCEMENT",e[e.CHATROOM_UPDATE_ANNOUNCEMENT=130]="CHATROOM_UPDATE_ANNOUNCEMENT",e[e.CHATROOM_REMOVE_SHARE_FILE=131]="CHATROOM_REMOVE_SHARE_FILE",e[e.CHATROOM_GET_SHARE_FILE_LIST=132]="CHATROOM_GET_SHARE_FILE_LIST",e[e.CHATROOM_UPLOAD_FILE=133]="CHATROOM_UPLOAD_FILE",e[e.CHATROOM_OPERATE=150]="CHATROOM_OPERATE"}(y||(y={})),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.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.GET_SESSION_LIST="REST_GET_SESSION_LIST",e.DELETE_SESSION="REST_DEL_SESSION",e.GET_HISTORY_MSG="REST_GET_HISTORY_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.GET_BLACK_LIST="ROSTER_BLACKLIST",e.GET_CONTACTS="ROSTER_CONTACTS",e.add="ROSTER_ADD",e.remove="ROSTER_REMOVE",e.accept="ROSTER_ACCEPT",e.decline="ROSTER_DECLINE",e.ban="ROSTER_BAN",e.allow="ROSTER_ALLOW",e.SEND_MSG="MSYNC_SENDMESSAGE",e.UPLOAD_MSG_ATTACH="UPLOAD_MSG_ATTACH",e.SEND_RECALL_MSG="MSYNC_RECALLMESSAGE"}(T||(T={})),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"}(_||(_={})),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"}(v||(v={})),function(e){e[e.success=200]="success",e[e.failed=400]="failed"}(O||(O={})),function(e){e[e.web=0]="web",e[e.native=1]="native"}(R||(R={}));var I={biz:"",debug:!1,token:""},S="https://data-reporting.agora.io/report",N="https://data-reporting.sh.agoralab.co/report",C=new Map,A=new Map,M=1e3,b=9675,U=function(e){var t=Number(y[e]);return t===y.USER_LOGIN?"MANUALLOGIN":t===y.MSYNC_SENDMESSAGE?"SENDMESSAGE":t>y.UNKNOWOPERATION&&t<y.REST_OPERATE?"REST":t>y.REST_OPERATE&&t<y.MSYNC_OPERATE?"MESSAGE":t>y.MSYNC_OPERATE&&t<y.ROSTER_OPERATE?"ROSTER":t>y.ROSTER_OPERATE&&t<y.USER_OPERATE?"USER":t>y.USER_OPERATE&&t<y.GROUP_OPERATE?"GROUP":t>y.GROUP_OPERATE&&t<y.CHATROOM_OPERATE?"CHATROOM":"OPERATION"},w=function(){return(new Date).getTime()},k=function(e){return[F.BAIDU,F.WX,F.DD,F.ZFB,F.TT,F.QUICK_APP,F.UNI].includes(e.platform)},P={},L=function(){function e(e){this.eventQueue=[],this.stock=1e3,this.config=e,this.governor()}return e.prototype.add=function(e){this.stock<=0?console.warn("Event Report limit 1000 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),o=r.filter((function(e){return e.appId===r[0].appId})),n=r.filter((function(e){return e.appId!==r[0].appId}));(t=e.eventQueue).unshift.apply(t,n),e.batchSend(o)}),1e3))},e.prototype.governor=function(){var e=this,t=setInterval((function(){e.stock=1e3}),6e4);addEventListener("beforeunload",(function(){clearInterval(t)}))},e.prototype.batchSend=function(e){var t,r;if(void 0===e&&(e=[]),0!==e.length)try{var o=e.map((function(e){e.biz,e.appId;var t=e.eventId,r=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(e,["biz","appId","eventId"]);return{eventId:Number(t),body:r}}));!function(e,t){try{var r=t.biz,o=t.appId,n=t.data,i=t.debug,s=t.onSuccess;if(!r)throw new Error("biz is not defined");P.global||(P=Y.getEnvInfo());var a=P;if(k(a)){var u={url:i?N:S,data:n,method:"POST",success:function(){null==s||s()},fail:function(){},complete:function(){}},c={token:e,appid:null!=o?o:"",sendts:""+Math.floor((new Date).getTime()/1e3),biz:r,debug:""+i};if("zfb"===a.platform||"dd"===a.platform?u.headers=c:u.header=c,"dd"===a.platform)return a.global.httpRequest(u);a.global.request(u)}else{var p=new XMLHttpRequest;p.onreadystatechange=function(){2===p.readyState&&(null==s||s())},p.open("POST",i?N:S),p.setRequestHeader("Content-Type","application/json"),p.setRequestHeader("token",e),p.setRequestHeader("appid",null!=o?o:""),p.setRequestHeader("sendts",""+Math.floor((new Date).getTime()/1e3)),p.setRequestHeader("biz",r),p.setRequestHeader("debug",""+i),p.send(JSON.stringify(n))}}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:o,debug:this.config.debug,onSuccess:this.consume.bind(this)})}catch(e){console.error(e)}},e}(),x=function(){return x=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},x.apply(this,arguments)},D=new(function(){function e(e){this.inited=!1,this.appId="",this.biz="",this.eventQueue={},this.config=I,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=x(x({},I),e),this.eventQueue=new L(this.config),this.log(e),this.inited=!0}catch(e){console.error(e)}},e.prototype.send=function(e,t,r){var o;if(void 0===t&&(t={}),this.inited){var n=x(x({},t),{eventId:Number(e),biz:this.biz,appId:null!==(o=null==r?void 0:r.appId)&&void 0!==o?o:this.appId});this.eventQueue.add(n),this.log(n)}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 o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(e,["payload"]);console.log("%c Event Report: "+this.config.biz+" ","background: #8A97FC; color: #fff"),console.table(r),t&&(console.info("payload:"),console.table(t))}}catch(e){console.error(e)}},e}()),G=function(){return G=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},G.apply(this,arguments)},B={requestName:"",subrequestid:"1",requestMethod:"GET",requestUrl:"",requestElapse:0,code:0,codeDesc:"",isLastApi:0,isSuccess:1},j=function(){function e(e){this.platform=Y.getEnvInfo(),this.isReportDt=e.isReport||!1,this.isCollectDt=!0,k(this.platform)&&!this.isReportDt&&(this.isCollectDt=!1),this.eventQueue=[],this.accessChannel="direct",this.options=function(e,t){t.platform||(t=Y.getEnvInfo());var r=e.org,o=e.appkey,n=e.deviceId,i=e.sdkVersion,s=(null===navigator||void 0===navigator?void 0:navigator.userAgent)||t.platform+"_mini_program";return{org:r,appkey:o,deviceId:n,sdkServiceId:"sid_"+Y.getUniqueId(),did:s,sdkVersion:i,os:7,sdkProduct:R.web}}(e,this.platform),this.sid=this.options.sdkServiceId,this.init(e)}return e.getInstance=function(){return 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){D.send(t.eventId,t.dt),r>=e.eventQueue.length-1&&(e.eventQueue=[])}))},e.prototype.init=function(t){e.instance||(e.instance=this,D.init({biz:"im",token:"32f24ab2ddb74f508aa9286c356cec84",appId:t.appkey,debug:!1}),this.reportInit())},e.prototype.reportInit=function(){if(this.isCollectDt){var e=this.options,t=e.did,r=e.os,o=e.sdkVersion,n=e.deviceId;this.reportData(9674,{did:t,os:r,sdkVersion:o,deviceId:n})}},e.prototype.geOperateFun=function(e){var t=this;if(!this.isCollectDt)return function(){};var r=1,o=w(),n=e.uid,i=e.operationName;n&&(this.uid=n);var s={uid:this.uid,operationId:"opr_"+Y.getUniqueId(),requestid:"req_"+Y.getUniqueId(),operationName:i};return function(e){var n,a;if((null===(n=e.data)||void 0===n?void 0:n.accessChannel)&&(t.accessChannel=null===(a=e.data)||void 0===a?void 0:a.accessChannel),e.isRetry?(r++,e.data.subrequestid=""+r):(s.requestid="req_"+Y.getUniqueId(),r=1),e.data.isLastApi){var u=w();e.data.requestElapse=u-o,e.data.requestMethod="",e.data.subrequestid="0"}else e.data.requestName||(e.data.requestName=i);e.data.requestElapse||(e.data.requestElapse=w()-o),t.reportData.call(t,b,G(G(G(G({},B),s),e.data),{accessChannel:t.accessChannel,operationType:U(i)})),e.isEndApi&&t.reportData.call(t,b,G(G(G({},s),B),{isSuccess:e.data.isSuccess,isLastApi:1,subrequestid:"0",requestMethod:"",requestElapse:e.data.requestElapse,accessChannel:t.accessChannel,operationType:U(i)}))}},e.prototype.reportData=function(e,t){return r=this,o=void 0,i=function(){var r,o,n,i,s,a,u,c;return function(e,t){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){s.label=i[1];break}if(6===i[0]&&s.label<n[1]){s.label=n[1],n=i;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(i);break}n[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(p){switch(p.label){case 0:return p.trys.push([0,3,,4]),r=w(),o=0,e!==b?[3,2]:[4,(l=this.platform,new Promise((function(e){var t;l.platform||(l=Y.getEnvInfo());var r="";if(l.platform===F.WEB){var o=navigator.connection;(null==o?void 0:o.type)?(null==o||o.type,r=v.WIFI):(null==o?void 0:o.effectiveType)&&(r=v[o.effectiveType.toLocaleUpperCase()]),e(r)}else l.platform===F.NODE?(r=v.UNKNOWN,e(r)):null===(t=l.global)||void 0===t||t.getNetworkType({success:function(t){r=v[t.networkType.toLocaleUpperCase()],e(r)}})})))];case 1:o=p.sent(),p.label=2;case 2:return n=this.options,i=n.appkey,s=n.sdkServiceId,a=n.sdkProduct,u=G({lts:r,net:o,appkey:i,sdkServiceId:s,sdkProduct:a},t),this.isReportDt?D.send(e,u):this.isCollectDt&&this.eventQueue.push({eventId:e,dt:u}),[3,4];case 3:return c=p.sent(),console.warn(c),[3,4];case 4:return[2]}var l}))},new((n=void 0)||(n=Promise))((function(e,t){function s(e){try{u(i.next(e))}catch(e){t(e)}}function a(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,a)}u((i=i.apply(r,o||[])).next())}));var r,o,n,i},e}();const H=j;var F,W=function(){return W=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},W.apply(this,arguments)},q=function(){};function K(e){return Object.prototype.toString.call(e).slice(8,-1)}function V(){return"undefined"!=typeof swan&&z(swan)?{platform:F.BAIDU,global:swan}:"undefined"!=typeof tt&&z(tt)?{platform:F.TT,global:tt}:"undefined"!=typeof dd&&z(dd)?{platform:F.DD,global:dd}:"undefined"!=typeof my&&z(my)?{platform:F.ZFB,global:my}:"undefined"!=typeof wx&&z(wx)?{platform:F.WX,global:wx}:"undefined"!=typeof uni&&z(uni)?{platform:F.UNI,global:uni}:"undefined"!=typeof window&&window.WebSocket?{platform:F.WEB,global:window}:{platform:F.NODE,global:r.g||{}}}function z(e){for(var t=["canIUse","getSystemInfo"],r=0,o=t.length;r<o;r++)if(!e[t[r]])return!1;return!0}function J(e){void 0===e&&(e={});var t=e.elapse,r=void 0===t?0:t,o=e.httpCode,n=void 0===o?0:o,i=e.errDesc;return{requestElapse:r,code:n,codeDesc:void 0===i?"":i}}!function(e){e.WEB="web",e.WX="wx",e.ZFB="zfb",e.DD="dd",e.TT="tt",e.BAIDU="baidu",e.QUICK_APP="quick_app",e.UNI="uni",e.NODE="node"}(F||(F={}));var X={autoIncrement:0,ajax:function(e,t){var r;return new Promise((function(t,o){var n=e.dataType||"text",i=e.success||q,s=e.error||q,a=new XMLHttpRequest;a.ontimeout=function(){o({type:g.REQUEST_TIMEOUT,message:"Request Timeout",errorType:"timeout_error",xhr:a})},a.onerror=function(){o({type:g.REQUEST_UNKNOWN,message:"Request Unknow Error",errorType:"onerror",xhr:a})},a.onabort=function(){o({type:g.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:a})},a.onreadystatechange=function(){if(4===a.readyState){var e=(new Date).getTime()-r,u=a.status||0,c={elapse:e,httpCode:u};if(200===u){try{switch(n){case"text":return i(a.responseText),void t(a.responseText);case"json":var p=JSON.parse(a.responseText);return p.extraInfo=c,i(p),void t(p);case"xml":return a.responseXML&&a.responseXML.documentElement?(i(a.responseXML.documentElement),void t(a.responseXML.documentElement)):(s({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:a.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}),void o({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:a.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}));default:s({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:a.responseText,message:"Invalid dataType"}),o({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:a.responseText,message:"Invalid dataType"})}return t(a.response||a.responseText),void i(a.response||a.responseText,a)}catch(e){o(e)}return}!function(e,t,r,o){var n,i,s,a,u,c,p,l,d,h,f,m,y,T=e.response;T&&"string"==typeof T&&(T=JSON.parse(T));var _=e.status,v={elapse:o,httpCode:_,errDesc:null==T?void 0:T.error_description};if(400===_){if(40002===T.error_code)return void t({type:g.THREAD_ALREADY_EXIST,message:null==T?void 0:T.error_description});if(40009===T.error_code)return void t({type:g.OPERATION_UNSUPPORTED,message:null==T?void 0:T.error_description});switch(null==T?void 0:T.error_description){case"the user is already operation this message":t({type:g.REACTION_ALREADY_ADDED,message:null==T?void 0:T.error_description,extraInfo:v});break;case"The quantity has exceeded the limit!":t({type:g.MAX_LIMIT,message:null==T?void 0:T.error_description,extraInfo:v});break;case"The user not in this group!":t({type:g.GROUP_NOT_JOINED,message:null==T?void 0:T.error_description,extraInfo:v});break;case"the user operation is illegal!":t({type:g.REACTION_OPERATION_IS_ILLEGAL,message:null==T?void 0:T.error_description,extraInfo:v});break;case"this appKey is not open reaction service!":t({type:g.SERVICE_NOT_ENABLED,message:null==T?void 0:T.error_description});break;case"this message is creating reaction, please try again.":t({type:g.REACTION_CREATING,message:null==T?void 0:T.error_description,extraInfo:v});break;case"groupId can not be null!":t({type:g.GROUP_NOT_EXIST,message:null==T?void 0:T.error_description});break;case"The input text is too long.":t({type:g.TRANSLATION_TEXT_TOO_LONG,message:null==T?void 0:T.error_description});break;case"The target language is not valid.":t({type:g.TRANSLATION_NOT_VALID,message:null==T?void 0:T.error_description});break;case"report failed, get message by id failed":t({type:g.MESSAGE_NOT_FOUND,message:null==T?void 0:T.error_description,extraInfo:v});break;case"ext is too big ":t({type:g.PRESENCE_PARAM_EXCEED,message:null==T?void 0:T.error_description});break;case"Request body not readable.Please check content type is correct!":t({type:g.REQUEST_PARAMETER_ERROR,message:null==T?void 0:T.error_description});break;default:t({type:g.WEBIM_CONNCTION_AJAX_ERROR,message:null==T?void 0:T.error_description,data:e.responseText,extraInfo:v}),r({type:g.WEBIM_CONNCTION_AJAX_ERROR,message:null==T?void 0:T.error_description,data:e.responseText,extraInfo:v})}}else if(401===_)40001===T.error_code&&t({type:g.NO_PERMISSION,message:null==T?void 0:T.error_description}),r({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText});else if(403===_)4e4===T.error_code?t({type:g.SERVICE_NOT_ENABLED,message:null==T?void 0:T.error_description}):40003===T.error_code||40004===T.error_code?t({type:g.THREAD_ALREADY_EXIST,message:null==T?void 0:T.error_description}):(40005===T.error_code||40007===T.error_code)&&t({type:g.MAX_LIMIT,message:null==T?void 0:T.error_description}),"group member list is full!"===T.error_description?(null===(n=e.responseURL)||void 0===n?void 0:n.includes("chatgroups"))?t({type:g.GROUP_MEMBERS_FULL,data:e.response||e.responseText,message:T.error_description,extraInfo:v}):t({type:g.CHATROOM_MEMBERS_FULL,data:e.response||e.responseText,message:T.error_description,extraInfo:v}):T.error_description.includes(T.error_description.includes("already in group"))?(null===(i=e.responseURL)||void 0===i?void 0:i.includes("chatgroups"))&&t({type:g.GROUP_ALREADY_JOINED,data:e.response||e.responseText,message:T.error_description,extraInfo:v}):T.error_description.includes("are not members of this group")?(null===(s=e.responseURL)||void 0===s?void 0:s.includes("chatgroups"))&&t({type:g.GROUP_NOT_JOINED,data:e.response||e.responseText,message:T.error_description,extraInfo:v}):T.error_description.includes("service not open!")||(null===(a=T.error_description)||void 0===a?void 0:a.includes("message report not open"))?t({type:g.SERVICE_NOT_ENABLED,data:e.response||e.responseText,message:T.error_description}):(null===(u=T.error_description)||void 0===u?void 0:u.includes("members size is greater than max user size !"))?t({type:g.GROUP_MEMBERS_LIMIT,data:e.response||e.responseText,message:T.error_description}):t({type:g.PERMISSION_DENIED,data:e.response||e.responseText,message:"permission denied",extraInfo:E(E({},v),{errDesc:"permission denied"})}),r({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:v});else if(404===_)40011===T.error_code?t({type:g.THREAD_NOT_EXIST,message:null==T?void 0:T.error_description}):40012===T.error_code&&t({type:g.NO_PERMISSION,message:null==T?void 0:T.error_description}),(null===(c=T.error_description)||void 0===c?void 0:c.includes("do not find this group"))||(null===(p=T.error_description)||void 0===p?void 0:p.includes("does not exist"))?(null===(l=e.responseURL)||void 0===l?void 0:l.includes("chatgroups"))?t({type:g.GROUP_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:E(E({},v),{errDesc:"The chat room dose not exist."})}):t({type:g.CHATROOM_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:E(E({},v),{errDesc:"The chat room dose not exist."})}):(null===(d=T.error_description)||void 0===d?void 0:d.includes("username"))&&(null===(h=T.error_description)||void 0===h?void 0:h.includes("doesn't exist!'"))||(null===(f=T.error_description)||void 0===f?void 0:f.includes("user not found"))?t({type:g.USER_NOT_FOUND,data:e.response||e.responseText,message:T.error_description,extraInfo:v}):t({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:v}),r({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:v});else if(429===_||503===_){if(null===(m=T.error_description)||void 0===m?void 0:m.includes("The request has reached the maximum limit"))return void t({type:g.MAX_LIMIT,message:e.responseText});t({type:g.SERVER_BUSY,data:e.response||e.responseText,message:"Server is busy.",extraInfo:E(E({},v),{errDesc:"Server is busy."})}),r({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"Server is busy.",extraInfo:E(E({},v),{errDesc:"Server is busy."})})}else if(500===_){if((40006===T.error_code||40008===T.error_code||40010===T.error_code)&&t({type:g.SERVER_UNKNOWN_ERROR,message:null==T?void 0:T.error_description}),null===(y=T.error_description)||void 0===y?void 0:y.includes("translte failed!"))return void t({type:g.TRANSLATION_FAILED,message:e.responseText});t({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:v}),r({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:v})}else t({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:E(E({},v),{errDesc:"ajax error"})}),r({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:E(E({},v),{errDesc:"ajax error"})})}(a,o,s,e)}0===a.readyState&&(s({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:a.responseText,message:"Request not initialized"}),o({type:g.WEBIM_CONNCTION_AJAX_ERROR,data:a.responseText,message:"Request not initialized"}))},e.responseType&&a.responseType&&(a.responseType=e.responseType),e.mimeType&&a.overrideMimeType(e.mimeType);var u=e.type||"POST",c=e.data||null,p="";if("get"===u.toLowerCase()&&c){for(var l in c)c.hasOwnProperty(l)&&(p+=l+"="+c[l]+"&");p=p?p.slice(0,-1):p,e.url+=(e.url.indexOf("?")>0?"&":"?")+(p?p+"&":p)+"_v="+(new Date).getTime(),c=null,p=""}r=(new Date).getTime(),a.open(u,e.url);var d=e.headers||{};for(var h in d["Content-Type"]||(d["Content-Type"]="application/json"),d)d.hasOwnProperty(h)&&a.setRequestHeader(h,d[h]);a.send(c)})).then((function(r){return t&&t!==T.SDK_INTERNAL&&(null==H?void 0:H.getInstance().geOperateFun({operationName:t}))({isEndApi:!0,data:W({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},J(r.extraInfo))}),t!==T.SDK_INTERNAL&&delete r.extraInfo,"Object"===K(r)?W(W({},r),{type:g.REQUEST_SUCCESS}):{data:r,type:g.REQUEST_SUCCESS}})).catch((function(r){throw t&&t!==T.SDK_INTERNAL&&(null==H?void 0:H.getInstance().geOperateFun({operationName:t}))({isEndApi:!0,data:W({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},J(r.extraInfo))}),t!==T.SDK_INTERNAL&&delete r.extraInfo,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:null},r="string"==typeof e?document.getElementById(e):e;if(window.URL.createObjectURL){if(!r.files)throw Error("this is not HTMLInputElement");var o=r.files;if(o.length>0){var n=o.item(0);t.data=n,t.url=window.URL.createObjectURL(n),t.filename=(null==n?void 0:n.name)||""}}else{if("string"!=typeof e)throw Error("in IE fileInputId must be string");n=document.getElementById(e).value,t.url=n;var i=n.lastIndexOf("/"),s=n.lastIndexOf("\\"),a=Math.max(i,s);t.filename=a<0?n:n.substring(a+1)}var u=t.filename.lastIndexOf(".");return-1!==u&&(t.filetype=t.filename.substring(u+1).toLowerCase()),t},uploadFile:function(e,t){var r,o,n=(new Date).getTime(),i=e.accessToken;if(i){var s=e.appKey,a=[],u="",c="";if(s&&(u=(a=s.split("#"))[0],c=a[1]),u||c){var p=e.apiUrl,l=e.uploadUrl||p+"/"+u+"/"+c+"/chatfiles";if((null===(o=null===(r=null==e?void 0:e.file)||void 0===r?void 0:r.data)||void 0===o?void 0:o.size)<=0)e.onFileUploadError&&e.onFileUploadError({type:g.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"});else{var d=new XMLHttpRequest;d.upload&&d.upload.addEventListener("progress",e.onFileUploadProgress||q,!1),d.addEventListener("abort",e.onFileUploadCanceled||q,!1),d.addEventListener("error",(function(e){f({type:g.WEBIM_UPLOADFILE_ERROR,data:d})}),!1),d.addEventListener("load",(function(r){try{var o=JSON.parse(d.responseText);if(400===d.status&&"content improper"===o.error)return f({type:g.WEBIM_UPLOADFILE_ERROR,data:o}),!1;try{!function(r){var o=(new Date).getTime()-n;t&&(null==H?void 0:H.getInstance().geOperateFun({operationName:t}))({isEndApi:!0,data:{isSuccess:(null==r?void 0:r.error)?0:1,requestMethod:"POST",requestName:t,requestElapse:o,requestUrl:l,code:d.status,codeDesc:(null==r?void 0:r.error_description)||""}}),e.onFileUploadComplete&&e.onFileUploadComplete(r)}(o)}catch(r){f({type:g.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:r})}}catch(r){f({type:g.WEBIM_UPLOADFILE_ERROR,data:d.responseText})}}),!1),d.open("POST",l),d.setRequestHeader("restrict-access","true"),d.setRequestHeader("Accept","*/*"),d.setRequestHeader("Authorization","Bearer "+i);var h=new FormData;h.append("file",e.file.data),d.send(h)}}else e.onFileUploadError&&e.onFileUploadError({type:g.WEBIM_UPLOADFILE_ERROR,message:"AppKey illegal"})}else e.onFileUploadError&&e.onFileUploadError({type:g.WEBIM_UPLOADFILE_NO_LOGIN,message:"AccessToken cannot be empty"});function f(r){var o=(new Date).getTime()-n;t&&(null==H?void 0:H.getInstance().geOperateFun({operationName:t}))({isEndApi:!0,data:{isSuccess:0,requestMethod:"POST",requestName:t,requestElapse:o,requestUrl:l,code:(null==d?void 0:d.status)||0,codeDesc:"upload file error"}}),e.onFileUploadError&&e.onFileUploadError(r)}},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=[],o=0;o<arguments.length;o++)r[o]=arguments[o];for(var n=0,i=t?e[n].apply(this,r):r[0];++n<t;)i=e[n].call(this,i);return i}},listenNetwork:function(e,t){var r=V();if(r.platform!==F.WEB){var o=r.global,n=function(r){r.isConnected?e():t()};o.offNetworkStatusChange&&o.offNetworkStatusChange(n),o.onNetworkStatusChange&&o.onNetworkStatusChange(n)}else window.addEventListener&&(window.addEventListener("online",e),window.addEventListener("offline",t))},getEnvInfo:V,wxRequest:function(e,t){return new Promise((function(t,r){var o=e.success||q,n=e.error||q,i=e.type||"POST",s=e.data||null,a="",u=(new Date).getTime(),c=X.getEnvInfo();if("get"===i.toLowerCase()&&s){for(var p in s)s.hasOwnProperty(p)&&(a+=p+"="+s[p]+"&");a=a?a.slice(0,-1):a,e.url+=(e.url.indexOf("?")>0?"&":"?")+(a?a+"&":a)+"_v="+(new Date).getTime(),s=null,a=""}var l={url:e.url,data:e.data,method:i,headers:{},success:function(e){var i,s,a,c,p,l={elapse:(new Date).getTime()-u,httpCode:Number((null===(i=e.statusCode)||void 0===i?void 0:i.toString())||(null===(s=e.status)||void 0===s?void 0:s.toString())),errDesc:(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.error_description)||""};if("200"===(null===(c=e.statusCode)||void 0===c?void 0:c.toString())||"200"===(null===(p=e.status)||void 0===p?void 0:p.toString())){e.data.extraInfo=l;var d=e.data;o(d),t(d)}else e.extraInfo=l,n(d=e),r(d)},complete:function(){},fail:function(e){n(e),r(e)}};if("zfb"===c.platform||"dd"===c.platform?l.headers=e.headers:l.header=e.headers,"dd"===c.platform)return dd.httpRequest(l);c.global.request(l)})).then((function(r){return t&&t!==T.SDK_INTERNAL&&(null==H?void 0:H.getInstance().geOperateFun({operationName:t}))({isEndApi:!0,data:W({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},J(r.extraInfo))}),t!==T.SDK_INTERNAL&&delete r.extraInfo,"Object"===K(r)?W(W({},r),{type:g.REQUEST_SUCCESS}):{data:r,type:g.REQUEST_SUCCESS}})).catch((function(r){throw t&&t!==T.SDK_INTERNAL&&(null==H?void 0:H.getInstance().geOperateFun({operationName:t}))({isEndApi:!0,data:W({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},J(r.extraInfo))}),t!==T.SDK_INTERNAL&&delete r.extraInfo,r}))},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:function(e,t){e.onFileDownloadComplete=e.onFileDownloadComplete||q,e.onFileDownloadError=e.onFileDownloadError||q;var r=(new Date).getTime(),o=new XMLHttpRequest;o.addEventListener("load",(function(n){var i=(new Date).getTime()-r;t&&(null==H?void 0:H.getInstance().geOperateFun({operationName:t}))({isEndApi:!0,data:{isSuccess:200===o.status?1:0,requestMethod:"POST",requestName:t,requestElapse:i,requestUrl:null==e?void 0:e.url,code:o.status,codeDesc:200===o.status?"":"download file error"}}),e.onFileDownloadComplete&&e.onFileDownloadComplete(o.response)}),!1),o.addEventListener("error",(function(n){var i=(new Date).getTime()-r;t&&(null==H?void 0:H.getInstance().geOperateFun({operationName:t}))({isEndApi:!0,data:{isSuccess:0,requestMethod:"POST",requestName:t,requestElapse:i,requestUrl:null==e?void 0:e.url,code:(null==o?void 0:o.status)||0,codeDesc:"download file error"}}),e.onFileDownloadError&&e.onFileDownloadError({type:g.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o})}),!1);var n=e.method||"GET",i=e.responseType||"blob",s=e.mimeType||"text/plain; charset=x-user-defined";o.open(n,e.url),"undefined"!=typeof Blob?o.responseType=i:o.overrideMimeType(s);var a={"X-Requested-With":"XMLHttpRequest",Accept:"application/octet-stream","share-secret":e.secret,Authorization:"Bearer "+this.context.accessToken},u=e.headers||{};for(var c in u)a[c]=u[c];for(var c in a)a[c]&&o.setRequestHeader(c,a[c]);o.send(null)},parseNotify:function(e){for(var t="",r=0;r<e.length;r++)t+="%"+e[r].toString(16);return JSON.parse(decodeURIComponent(t))},getExtraData:J};const Y=X;var Q=r(4188),$=r.n(Q);function Z(){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()}var ee,te="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),re=function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},oe=function(){},ne={};!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"}(ee||(ee={}));var ie=function(){function e(e,t,r){this.name=e||"defaultLogger",this.currentLevel=0,this.useCookiePersist=!1,this.storageLogLevelKey="loglevel",this.levels=ee,this.logMethods=["trace","debug","info","warn","error"],this.methodFactory=r||this.defaultMethodFactory;var o=this._getPersistedLevel();null==o&&(o=null===t?"WARN":t),this.logs=[],this.config={useCache:!1,maxCache:3145728,color:"",background:""},this.logBytes=0,this.setLevel(o,!1,"")}return 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=ee[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<ee.SILENT)return"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),o=document.createElement("a");o.style.display="none",o.href=r,o.setAttribute("download","sdklog"),document.body.appendChild(o),o.click()}},e.prototype._bindMethod=function(e,t,r){var o=this,n=e[t],i=this.getTime();if(r)return this._cacheLog;if("function"==typeof n.bind)return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=o.getTime();n.call.apply(n,re([e,s+" IM SDK ["+("log"===t?"debug":t)+"]: "],r,!1))};try{return Function.prototype.bind.call(n,e,i+" IM SDK ["+("log"===t?"debug":t)+"]: ")}catch(t){return function(){return Function.prototype.apply.apply(n,[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()+": ",o="";e.forEach((function(e){o+="object"==typeof e?JSON.stringify(e)+" ":e+" "})),this._cacheLogCall(r+o)},e.prototype._cacheLogCall=function(e){var t=se(e),r=this.logBytes+t,o=this.config.maxCache;if(!(t>=o)){if(r<o)this.logBytes+=t;else for(var n=r-o,i=0;i<n;){var s=this.logs.shift();void 0!==s&&(i+=se(s))}this.logs.push(e)}},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";"undefined"!=typeof window&&(window.localStorage&&(window.localStorage[this.storageLogLevelKey]=t),this.useCookiePersist&&(window.document.cookie=encodeURIComponent(this.storageLogLevelKey)+"="+t+";"))},e.prototype.replaceLoggingMethods=function(e,t){for(var r=0;r<this.logMethods.length;r++){var o=this.logMethods[r];this[o]=r<e?oe: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&&te?Z:void 0!==console[e]?this._bindMethod(console,e,this.config.useCache):void 0!==console.log?this._bindMethod(console,"log",this.config.useCache):oe)},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}();function se(e){for(var t=e.length,r=0;r<e.length;r++)e.charCodeAt(r)>255&&t++;return t}var ae=new ie;ae.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=ne[e];return t||(t=ne[e]=new ie(e,ae.getLevel(),ae.methodFactory)),t};var ue="undefined"!=typeof window?window.log:void 0;ae.noConflict=function(){return"undefined"!=typeof window&&window.log===ae&&(window.log=ue),ae},ae.getLoggers=function(){return ne};const ce=ae;var pe=function(){return pe=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},pe.apply(this,arguments)};function le(e){var t,r,o=e.id,n=e.payload,i=e.timestamp,s=e.to,a=n.bodies&&n.bodies.length>0?n.bodies[0]:{},u={},c={},p=n.type?n.type:s.indexOf("@conference.easemob.com")>-1?"groupChat":"singleChat";switch(a.type){case"txt":u={id:o,type:"txt",chatType:p,msg:a.msg||"",to:n.to||"",from:n.from,time:i,ext:n.ext};break;case"img":u={id:o,type:"img",chatType:p,to:n.to,from:n.from,time:i,ext:n.ext,width:(null===(t=a.size)||void 0===t?void 0:t.width)||0,height:(null===(r=a.size)||void 0===r?void 0:r.height)||0,secret:a.secret||"",url:(null==a?void 0:a.url)||"",file:{}};break;case"video":u={id:o,type:"video",chatType:p,from:n.from,to:n.to,url:(null==a?void 0:a.url)||"",secret:a.secret||"",filename:a.filename,length:a.length||0,file:{},file_length:a.fileLength||0,filetype:n.ext.file_type||"",ext:n.ext,time:i};break;case"loc":u={id:o,type:"loc",chatType:p,from:n.from,to:n.to,buildingName:a.buildingName||"",addr:a.addr,lat:a.lat,lng:a.lng,ext:n.ext,time:i};break;case"audio":u={id:o,type:"audio",chatType:p,from:n.from,to:n.to,secret:a.secret||"",ext:n.ext,time:i,url:(null==a?void 0:a.url)||"",file:{},filename:a.filename,length:n.ext.duration||0,file_length:a.fileLength||0,filetype:n.ext.file_type||""};break;case"file":u={id:o,type:"file",chatType:p,from:n.from,to:n.to,ext:n.ext,time:i,url:(null==a?void 0:a.url)||"",secret:a.secret||"",file:{},filename:a.filename||"",length:a.length||0,file_length:a.file_length||0,filetype:n.ext.file_type||""};break;case"cmd":u={id:o,type:"cmd",chatType:p,from:n.from,to:n.to,ext:n.ext,time:i,action:a.action||""};break;case"custom":u={id:o,type:"custom",chatType:p,from:n.from,to:n.to,ext:n.ext,time:i,customEvent:a.customEvent||""};break;default:ce.error("unexpected message: "+e)}if(n.msgConfig&&(c.msgConfig=n.msgConfig),null==n?void 0:n.meta){var l=n.meta;l.thread&&(c.chatThread={messageId:l.thread.msg_parent_id,parentId:l.thread.muc_parent_id,chatThreadName:l.thread.thread_name}),l.reactions&&(c.reactions=l.reactions),l.translations&&(c.translations=l.translations)}return pe(pe({},u),c)}const de=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:Y.getUniqueId(),chatType:e.chatType,ackId:e.id,type:"read",to:e.to,from:e.from||"",ackContent:e.ackContent,isChatThread:e.isChatThread}},e}(),he=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:Y.getUniqueId(),ackId:e.ackId,type:"delivery",to:e.to,from:e.from||"",isChatThread:e.isChatThread}},e}(),fe=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:Y.getUniqueId(),type:"channel",chatType:e.chatType||"singleChat",to:e.to,from:e.from||"",time:Date.now(),isChatThread:e.isChatThread}},e}(),me=function(){function e(e){var t=e.type,r=e.id||Y.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:Y.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}},e}(),ge=function(){function e(e){var t=e.type,r=e.id;this.id=r||Y.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:Y.getUniqueId(),type:"cmd",to:e.to,from:e.from||"",chatType:e.chatType||"singleChat",action:e.action,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread}},e}(),Ee=function(){function e(e){var t=e.type,r=e.id||Y.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:Y.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}},e}(),ye=function(){function e(e){var t=e.type,r=e.id;this.id=r||Y.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:Y.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}},e}(),Te=function(){function e(e){var t=e.type,r=e.id||Y.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&Y.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:Y.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,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,isChatThread:e.isChatThread}},e}(),_e=function(){function e(e){var t=e.type,r=e.id||Y.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&Y.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:Y.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}},e}(),ve=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&&Y.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:Y.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}},e}(),Oe=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&&Y.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:Y.getUniqueId(),chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,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}},e}();var Re=function(){function e(t,r){return this.type=t,this.id=r||Y.getUniqueId(),e.createOldMsg({type:t,id:this.id})}return e.createOldMsg=function(e){switch(e.type){case"read":return new de({type:"read",id:e.id});case"delivery":return new he({type:"delivery",id:e.id});case"channel":return new fe({type:"channel",id:e.id});case"txt":return new me({type:"txt",id:e.id});case"cmd":return new ge({type:"cmd",id:e.id});case"custom":return new Ee({type:"custom",id:e.id});case"loc":return new ye({type:"loc",id:e.id});case"img":return new Te({type:"img",id:e.id});case"audio":return new _e({type:"audio",id:e.id});case"video":return new ve({type:"video",id:e.id});case"file":return new Oe({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)?Te.create(e):function(e){return"cmd"===e.type&&!("version"in e)}(e)?ge.create(e):function(e){return"file"===e.type&&!("version"in e)}(e)?Oe.create(e):function(e){return"audio"===e.type&&!("version"in e)}(e)?_e.create(e):function(e){return"video"===e.type&&!("version"in e)}(e)?ve.create(e):function(e){return"custom"===e.type&&!("version"in e)}(e)?Ee.create(e):function(e){return"loc"===e.type&&!("version"in e)}(e)?ye.create(e):function(e){return"channel"===e.type&&!("version"in e)}(e)?fe.create(e):function(e){return"delivery"===e.type&&!("version"in e)}(e)?he.create(e):function(e){return"read"===e.type&&!("version"in e)}(e)?de.create(e):{}:me.create(e);var t},e.prototype.set=function(e){},e}(),Ie={0:"TEXT",1:"IMAGE",2:"VIDEO",3:"LOCATION",4:"VOICE",5:"FILE",6:"COMMAND",7:"CUSTOM"};function Se(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 o=e[r].varintValue,n=new(h())(o.low,o.high,o.unsigned).toString();t[e[r].key]=0!==Number(n)}else 2!==e[r].type&&3!==e[r].type&&4!==e[r].type||(o=e[r].varintValue,n=new(h())(o.low,o.high,o.unsigned).toString(),t[e[r].key]=Number(n));return t}function Ne(e,t,r){if(this.delivery&&e!==t){var o=this.getUniqueId(),n=new Re("delivery",o);n.set({ackId:r,to:e}),ce.debug("send delivery ack"),this.send(n.body)}}const Ce=function(e,t,r,o){var n,i,s,a,u,c,p,l=new(h())(e.timestamp.low,e.timestamp.high,e.timestamp.unsigned).toString(),d=this.root.lookup("easemob.pb.MessageBody").decode(e.payload),f=1;if(e.meta&&e.meta.length)switch(Y.parseNotify(e.meta).is_online){case 0:f=0;break;case 1:f=1;break;default:f=2}else f=3;var m,g=new(h())(e.id.low,e.id.high,e.id.unsigned).toString(),E=d.ackMessageId?new(h())(d.ackMessageId.low,d.ackMessageId.high,d.ackMessageId.unsigned).toString():"",y="",T=d.from&&d.from.name,_=d.to&&d.to.name;switch(ce.debug("thirdMessage:",d),d.type){case 1:y="chat","agoraToken"===this.grantType&&(y="singleChat"),this.delivery&&Ne.call(this,T,_,g);break;case 2:y="groupchat","agoraToken"===this.grantType&&(y="groupChat");break;case 3:y="chatroom","agoraToken"===this.grantType&&(y="chatRoom"),f=1;break;case 4:y="read_ack";var v=void 0;return d.ext[0]&&JSON.parse(d.ext[0].stringValue)?(v={id:g,type:"read",from:T,to:_,mid:E,groupReadCount:d.ext[0]&&JSON.parse(d.ext[0].stringValue),ackContent:d.ackContent,onlineState:f},this.onReadMessage&&this.onReadMessage(v),void(null===(n=this.eventHandler)||void 0===n||n.dispatch("onReadMessage",v))):(v={id:g,type:"read",from:T,to:_,mid:E,onlineState:f},this.onReadMessage&&this.onReadMessage(v),void(null===(i=this.eventHandler)||void 0===i||i.dispatch("onReadMessage",v)));case 5:y="deliver_ack",this.onDeliveredMessage&&this.onDeliveredMessage({id:g,type:"delivery",from:T,to:_,mid:E,onlineState:f});var O={id:g,type:"delivery",from:T,to:_,mid:E,onlineState:f};return void(null===(s=this.eventHandler)||void 0===s||s.dispatch("onDeliveredMessage",O));case 6:y="recall";var R={id:g,from:T||"admin",to:_,mid:E,onlineState:f};return this.onRecallMessage&&this.onRecallMessage(R),void(null===(a=this.eventHandler)||void 0===a||a.dispatch("onRecallMessage",R));case 7:this.onChannelMessage&&this.onChannelMessage({id:g,type:"channel",chatType:"singleChat",from:T,to:_,time:Number(l),onlineState:f});var I={id:g,type:"channel",chatType:"singleChat",from:T,to:_,time:Number(l),onlineState:f};return void(null===(u=this.eventHandler)||void 0===u||u.dispatch("onChannelMessage",I));default:return void ce.error("unexpected message type: "+d.type)}"chat"===y.toLowerCase()||"singleChat"===y?m="singleChat":"groupchat"===y.toLowerCase()||"groupChat"===y?m="groupChat":(m="chatRoom",f=1);for(var S=0;S<d.contents.length;S++){var N={},C={},A=t.errorCode>0,M=t.errorCode,b=t.reason,U=d.contents[S],w={},k=[],P=[],L=null,x=null,D=void 0;if(d.ext&&(w=Se(d.ext)),d.meta&&"string"==typeof d.meta){var G=JSON.parse(d.meta);G.reaction&&(k=G.reaction).forEach((function(e){e.isAddedBySelf=e.state,delete e.state})),G.translations&&(P=G.translations),G.thread&&"{}"!==JSON.stringify(G.thread)&&(L={messageId:G.thread.msg_parent_id,parentId:G.thread.muc_parent_id,chatThreadName:G.thread.thread_name}),G.thread_overview&&"{}"!==JSON.stringify(G.thread_overview)&&(x={id:G.thread_overview.id,parentId:G.thread_overview.muc_parent_id,name:G.thread_overview.name,lastMessage:le(G.thread_overview.last_message),createTimestamp:G.thread_overview.create_timestamp,updateTimestamp:G.thread_overview.update_timestamp,messageCount:G.thread_overview.message_count})}switch(U.type){case 0:!(N={id:g,type:y,contentsType:Ie[U.type],from:T,to:_,data:U.text,ext:w,sourceMsg:U.text,time:l,msgConfig:d.msgConfig,onlineState:f}).msgConfig&&delete d.msgConfig,N.error=A,N.errorText=b,N.errorCode=M,!r&&this.onTextMessage&&this.onTextMessage(N);var B={id:g,type:"txt",chatType:m,msg:U.text,to:_,from:T,ext:w,time:Number(l),onlineState:f};N.msgConfig&&(B.msgConfig=N.msgConfig),k.length>0&&(B.reactions=k),L&&(B.chatThread=L),x&&(B.chatThreadOverview=x),P.length>0&&(B.translations=P),C=B,!r&&this.eventHandler&&this.eventHandler.dispatch("onTextMessage",B);break;case 1:var j=(null===(c=null==U?void 0:U.size)||void 0===c?void 0:c.width)||0,H=(null===(p=null==U?void 0:U.size)||void 0===p?void 0:p.height)||0;D=this.useOwnUploadFun?U.remotePath:(U.remotePath&&this.apiUrl+U.remotePath.substr(U.remotePath.indexOf("/",9)))+"?em-redirect=true",U.secretKey&&!this.useOwnUploadFun&&(D=D+"&share-secret="+U.secretKey),!(N={id:g,type:y,contentsType:Ie[U.type],from:T,to:_,url:D,secret:U.secretKey,filename:U.displayName,thumb:this.useOwnUploadFun?"":D+"&thumbnail=true",thumb_secret:U.secretKey,file_length:U.fileLength||"",width:j,height:H,filetype:U.filetype||"",accessToken:this.token,ext:w,time:l,msgConfig:d.msgConfig,onlineState:f}).delay&&delete N.delay,!N.msgConfig&&delete d.msgConfig,N.error=A,N.errorText=b,N.errorCode=M,!r&&this.onPictureMessage&&this.onPictureMessage(N);var F={id:g,type:"img",chatType:m,from:T,to:_,url:D||"",file:{},width:j,height:H,secret:U.secretKey||"",thumb:this.useOwnUploadFun?"":D+"&thumbnail=true",thumb_secret:U.secretKey,ext:w,time:Number(l),onlineState:f};N.msgConfig&&(F.msgConfig=N.msgConfig),k.length>0&&(F.reactions=k),L&&(F.chatThread=L),x&&(F.chatThreadOverview=x),C=F,!r&&this.eventHandler&&this.eventHandler.dispatch("onImageMessage",F);break;case 2:D=this.useOwnUploadFun?U.remotePath:(U.remotePath&&this.apiUrl+U.remotePath.substr(U.remotePath.indexOf("/",9)))+"?em-redirect=true",U.secretKey&&!this.useOwnUploadFun&&(D=D+"&share-secret="+U.secretKey),!(N={id:g,type:y,contentsType:Ie[U.type],from:T,to:_,url:D,secret:U.secretKey,filename:U.displayName,length:U.duration||"",file_length:U.fileLength||"",filetype:U.filetype||"",accessToken:this.token||"",ext:w,time:l,msgConfig:d.msgConfig,onlineState:f}).delay&&delete N.delay,!N.msgConfig&&delete d.msgConfig,N.error=A,N.errorText=b,N.errorCode=M,!r&&this.onVideoMessage&&this.onVideoMessage(N);var W={id:g,type:"video",chatType:m,from:T,to:_,url:D,secret:U.secretKey,filename:U.displayName,length:U.duration||0,file:{},file_length:U.fileLength||0,filetype:U.filetype||"",accessToken:this.token||"",ext:w,time:Number(l),onlineState:f};N.msgConfig&&(W.msgConfig=N.msgConfig),k.length>0&&(W.reactions=k),L&&(W.chatThread=L),x&&(W.chatThreadOverview=x),C=W,!r&&this.eventHandler&&this.eventHandler.dispatch("onVideoMessage",W);break;case 3:!(N={id:g,type:y,contentsType:Ie[U.type],from:T,to:_,addr:U.address,buildingName:U.buildingName,lat:U.latitude,lng:U.longitude,ext:w,time:l,msgConfig:d.msgConfig,onlineState:f}).delay&&delete N.delay,!N.msgConfig&&delete d.msgConfig,N.error=A,N.errorText=b,N.errorCode=M,!r&&this.onLocationMessage&&this.onLocationMessage(N);var q={id:g,type:"loc",chatType:m,from:T,to:_,buildingName:U.buildingName,addr:U.address,lat:U.latitude,lng:U.longitude,ext:w,time:Number(l),onlineState:f};N.msgConfig&&(q.msgConfig=N.msgConfig),k.length>0&&(q.reactions=k),L&&(q.chatThread=L),x&&(q.chatThreadOverview=x),C=q,!r&&this.eventHandler&&this.eventHandler.dispatch("onLocationMessage",q);break;case 4:D=this.useOwnUploadFun?U.remotePath:(U.remotePath&&this.apiUrl+U.remotePath.substr(U.remotePath.indexOf("/",9)))+"?em-redirect=true",U.secretKey&&!this.useOwnUploadFun&&(D=D+"&share-secret="+U.secretKey),!(N={id:g,type:y,contentsType:Ie[U.type],from:T,to:_,url:D,secret:U.secretKey,filename:U.displayName,file_length:U.fileLength||"",accessToken:this.token||"",ext:w,length:U.duration,time:l,msgConfig:d.msgConfig,onlineState:f}).delay&&delete N.delay,!N.msgConfig&&delete d.msgConfig,N.error=A,N.errorText=b,N.errorCode=M,!r&&this.onAudioMessage&&this.onAudioMessage(N);var K={id:g,type:"audio",chatType:m,from:T,to:_,url:D,secret:U.secretKey,file:{},filename:U.displayName,length:U.duration||0,file_length:U.fileLength||0,filetype:U.filetype||"",accessToken:this.token||"",ext:w,time:Number(l),onlineState:f};N.msgConfig&&(K.msgConfig=N.msgConfig),k.length>0&&(K.reactions=k),L&&(K.chatThread=L),x&&(K.chatThreadOverview=x),C=K,!r&&this.eventHandler&&this.eventHandler.dispatch("onAudioMessage",K);break;case 5:D=this.useOwnUploadFun?U.remotePath:(U.remotePath&&this.apiUrl+U.remotePath.substr(U.remotePath.indexOf("/",9)))+"?em-redirect=true",U.secretKey&&!this.useOwnUploadFun&&(D=D+"&share-secret="+U.secretKey),!(N={id:g,type:y,contentsType:Ie[U.type],from:T,to:_,url:D,secret:U.secretKey,filename:U.displayName,file_length:U.fileLength,accessToken:this.token||"",ext:w,time:l,msgConfig:d.msgConfig,onlineState:f}).delay&&delete N.delay,!N.msgConfig&&delete d.msgConfig,N.error=A,N.errorText=b,N.errorCode=M,!r&&this.onFileMessage&&this.onFileMessage(N);var V={id:g,type:"file",chatType:m,from:T,to:_,url:D,secret:U.secretKey,file:{},filename:U.displayName,length:U.duration||0,file_length:U.fileLength||0,filetype:U.filetype||"",accessToken:this.token||"",ext:w,time:Number(l),onlineState:f};N.msgConfig&&(V.msgConfig=N.msgConfig),k.length>0&&(V.reactions=k),L&&(V.chatThread=L),x&&(V.chatThreadOverview=x),C=V,!r&&this.eventHandler&&this.eventHandler.dispatch("onFileMessage",V);break;case 6:!(N={id:g,type:y,contentsType:Ie[U.type],from:T,to:_,action:U.action,ext:w,time:l,msgConfig:d.msgConfig,onlineState:f}).msgConfig&&delete d.msgConfig,N.error=A,N.errorText=b,N.errorCode=M,!r&&this.onCmdMessage&&this.onCmdMessage(N);var z={id:g,type:"cmd",chatType:m,from:T,to:_,action:U.action,ext:w,time:Number(l),onlineState:f};N.msgConfig&&(z.msgConfig=N.msgConfig),k.length>0&&(z.reactions=k),L&&(z.chatThread=L),x&&(z.chatThreadOverview=x),C=z,!r&&this.eventHandler&&this.eventHandler.dispatch("onCmdMessage",z);break;case 7:var J={},X={};d.contents[0].customExts&&(J=Se(d.contents[0].customExts)),d.contents[0].params&&(X=Se(d.contents[0].params)),N={id:g,type:y,contentsType:Ie[U.type],from:T,to:_,customEvent:U.customEvent,params:X,customExts:J,ext:w,time:l,onlineState:f},!r&&this.onCustomMessage&&this.onCustomMessage(N);var Q={id:g,type:"custom",chatType:m,from:T,to:_,customEvent:U.customEvent,params:X,customExts:J,ext:w,time:Number(l),onlineState:f};N.msgConfig&&(Q.msgConfig=N.msgConfig),k.length>0&&(Q.reactions=k),L&&(Q.chatThread=L),x&&(Q.chatThreadOverview=x),C=Q,!r&&this.eventHandler&&this.eventHandler.dispatch("onCustomMessage",Q);break;default:ce.error("Unknow message type, message:",U)}return o?C:N}},Ae=function(e){var t=this.root.lookup("easemob.pb.MUCBody").decode(e.payload),r=t.operation;(function(e){var r,o,n,i=this;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:""},n={chatThreadId:t.mucId.name,chatThreadName:t.mucName,operation:"",parentId:t.mucParentId.name}):r={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},({40:function(){},39:function(){},38:function(){var e;n.operation="chatThreadNameUpdate",null===(e=i.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",n)},37:function(){var e;o.operation="userRemove",null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatThreadChange",o)},36:function(){var e;n.operation="chatThreadLeave",null===(e=i.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",n)},35:function(){var e;n.operation="chatThreadJoin",null===(e=i.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",n)},34:function(){var e;n.operation="chatThreadDestroy",null===(e=i.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",n)},33:function(){var e;n.operation="chatThreadCreate",null===(e=i.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",n)},32:function(){var e,o;r.type=t.isChatroom?"rmChatRoomMute":"rmGroupMute",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},31:function(){var e,o;r.type=t.isChatroom?"muteChatRoom":"muteGroup",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},30:function(){var e,o;r.type=t.isChatroom?"rmUserFromChatRoomWhiteList":"rmUserFromGroupWhiteList",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},29:function(){var e,o;r.type=t.isChatroom?"addUserToChatRoomWhiteList":"addUserToGroupWhiteList",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},28:function(){var e,o;r.type="deleteFile",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},27:function(){var e,o;r.type="uploadFile",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},26:function(){var e,o;r.type="deleteAnnouncement",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},25:function(){var e,o;r.type="updateAnnouncement",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},24:function(){var e,o;r.type="removeMute",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},23:function(){var e,o;r.type="addMute",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},22:function(){var e,o;r.type="removeAdmin",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},21:function(){var e,o;r.type="addAdmin",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},20:function(){var e,o;r.type="changeOwner",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},19:function(){var e,o;r.type="direct_joined",r.groupName=t.mucName,i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},18:function(){var e,o;r.type=t.isChatroom?"leaveChatRoom":"leaveGroup",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},17:function(){var e,o;r.type=t.isChatroom?"memberJoinChatRoomSuccess":"memberJoinPublicGroupSuccess",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},16:function(){var e,o;r.type="unblock",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},15:function(){var e,o;r.type="block",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},14:function(){var e,o;r.type="update",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},13:function(){var e,o;r.type="allow",r.reason=t.reason,i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},12:function(){var e,o;r.type="ban",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},11:function(){var e,o;r.type="getBlackList",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},10:function(){var e,o;r.type="removedFromGroup",r.kicked=r.to,i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},9:function(){var e,o;r.type="invite_decline",r.kicked=r.to,i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},8:function(){var e,o;r.type="invite_accept",r.kicked=r.to,i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},7:function(){var e,o;r.type="invite",r.kicked=r.to,r.groupName=t.mucName,i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},6:function(){var e,o;r.type="joinPublicGroupDeclined",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},5:function(){var e,o;r.type="joinPublicGroupSuccess",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},4:function(){var e,o;r.type="joinGroupNotifications",r.reason=t.reason,i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},3:function(){var e,o;r.type="leave",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},2:function(){var e,o;r.type="join",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)},1:function(){var e,o;r.type="deleteGroupChat",i.onPresence&&i.onPresence(r),t.isChatroom?null===(e=i.eventHandler)||void 0===e||e.dispatch("onChatroomChange",r):null===(o=i.eventHandler)||void 0===o||o.dispatch("onGroupChange",r)}}[e]||function(){console.error("No match operation "+e)})()}).call(this,r)};var Me;!function(e){e[e.Add=2]="Add",e[e.Remove=3]="Remove",e[e.Accept=4]="Accept",e[e.Decline=5]="Decline",e[e.Ban=6]="Ban",e[e.Allow=7]="Allow"}(Me||(Me={}));const be={operatRoster:function(e,t){var r=[],o=this.root.lookup("easemob.pb.RosterBody"),n=o.decode(r);switch(t){case"add":n.operation=Me.Add;break;case"remove":n.operation=Me.Remove;break;case"accept":n.operation=Me.Accept;break;case"decline":n.operation=Me.Decline;break;case"ban":n.operation=Me.Ban;break;case"allow":n.operation=Me.Allow;break;default:ce.error("operatRoster:",t)}n.from=this.context.jid;var i=[];if("string"==typeof e.to)i.push({appKey:this.appKey||this.context.appKey,name:e.to,domain:"easemob.com"});else if(e.to instanceof Array)for(var s=0;s<e.to.length;s++)i.push({appKey:this.appKey,name:e.to[s],domain:"easemob.com"});n.to=i,n.reason=e.message||"",n=o.encode(n).finish();var a=this.root.lookup("easemob.pb.Meta").decode(r);a.id=e.id||this.getUniqueId();var u=null==H?void 0:H.getInstance().geOperateFun({operationName:T[t]});C.size<=M&&C.set(a.id,{rpt:u,requestName:T[t]}),a.from=this.context.jid,a.to={domain:"@easemob.com"},a.ns=3,a.payload=n;var c=this.root.lookup("easemob.pb.CommSyncUL"),p=c.decode(r);p.meta=a,p=c.encode(p).finish();var l=this.root.lookup("easemob.pb.MSync"),d=l.decode(r);d.version=this.version,d.encryptType=[0],d.command=0,d.guid=this.jid,d.payload=p,d=l.encode(d).finish();var h=this.mSync.base64transform(d);this.sock.send(h)},handleRosterMsg:function(e){var t,r,o,n,i,s,a=this.root.lookup("easemob.pb.RosterBody").decode(e.payload),u={type:"",to:a.to[0].name,from:a.from.name,status:a.reason};switch(a.operation){case 2:u.type="subscribe",this.onContactInvited&&this.onContactInvited(u),null===(t=this.eventHandler)||void 0===t||t.dispatch("onContactInvited",u);break;case 3:u.type="unsubscribed",this.onContactDeleted&&this.onContactDeleted(u),null===(r=this.eventHandler)||void 0===r||r.dispatch("onContactDeleted",u);break;case 4:u.type="subscribed",this.onContactAdded&&this.onContactAdded(u),null===(o=this.eventHandler)||void 0===o||o.dispatch("onContactAdded",u);break;case 5:u.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(u),null===(n=this.eventHandler)||void 0===n||n.dispatch("onContactRefuse",u);break;case 6:case 7:this.getBlacklist();break;case 8:u.type="subscribed",this.onContactAgreed&&this.onContactAgreed(u),null===(i=this.eventHandler)||void 0===i||i.dispatch("onContactAgreed",u);break;case 9:u.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(u),null===(s=this.eventHandler)||void 0===s||s.dispatch("onContactRefuse",u);break;default:ce.error("handleRosterMsg:",a)}this.onPresence&&u.type&&this.onPresence(u)}},Ue=function(e){var t,r,o,n,i,s,a=this.root.lookup("easemob.pb.StatisticsBody").decode(e.payload);switch(a.operation){case 0:this.onStatisticMessage&&this.onStatisticMessage(a),null===(t=this.eventHandler)||void 0===t||t.dispatch("onStatisticMessage",a);break;case 1:s=f.create({type:g.WEBIM_CONNCTION_USER_REMOVED,message:"user has been removed"}),this.logOut=!0,this.onError&&this.onError(s),null===(r=this.eventHandler)||void 0===r||r.dispatch("onError",s);break;case 2:s=f.create({type:g.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE,message:"the user is already logged on another device"}),this.logOut=!0,this.onError&&this.onError(s),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",s);break;case 3:s=f.create({type:g.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD,message:"the user was kicked by changing password"}),this.logOut=!0,this.onError&&this.onError(s),null===(n=this.eventHandler)||void 0===n||n.dispatch("onError",s);break;case 4:s=f.create({type:g.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE,message:"the user was kicked by other device"}),this.logOut=!0,this.onError&&this.onError(s),null===(i=this.eventHandler)||void 0===i||i.dispatch("onError",s);break;default:ce.error("handleStatisticsMsg:",a)}};function we(e){var t,r=[],o=[];e.data&&e.data.values&&e.data.values.forEach((function(e){Object.entries(e.status).forEach((function(e){o.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:o})})),this.onPresenceStatusChange&&this.onPresenceStatusChange(r),null===(t=this.eventHandler)||void 0===t||t.dispatch("onPresenceStatusChange",r)}function ke(e){var t=this;e.data.forEach((function(e){var r,o={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",o)}))}function Pe(e){var t,r,o,n;if(e.data){var i=e.data,s={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":s.operation="create",s.createTimestamp=s.timestamp,s.messageCount=0,null===(t=this.eventHandler)||void 0===t||t.dispatch("onChatThreadChange",s);break;case"update_msg":s.operation="update",s.messageCount=i.message_count,i.last_message&&"{}"!==JSON.stringify(i.last_message)?s.lastMessage=le(i.last_message):"{}"===JSON.stringify(i.last_message)&&(s.lastMessage={}),null===(r=this.eventHandler)||void 0===r||r.dispatch("onChatThreadChange",s);break;case"update":s.operation="update",s.messageCount=i.message_count,null===(o=this.eventHandler)||void 0===o||o.dispatch("onChatThreadChange",s);break;case"delete":s.operation="destroy",null===(n=this.eventHandler)||void 0===n||n.dispatch("onChatThreadChange",s)}}}const Le=function(e){var t=Y.parseNotify(e.payload);switch(e.from.name,e.to.name,t.type){case"presence":we.call(this,t);break;case"reaction":ke.call(this,t);break;case"thread":Pe.call(this,t);break;default:ce.error("unexpected notify type: "+t.type)}};var xe=function(){return xe=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},xe.apply(this,arguments)};function De(){var e="webim",t="",r="",o=[],n=(new Date).valueOf();"webim"===this.deviceId?(r="random_"+n.toString(),e=this.deviceId+"_"+r,t=this.deviceId):e=t=r="webim_"+this.deviceId,this.context.jid&&(this.context.jid.clientResource=e);var i=this.root.lookup("easemob.pb.Provision"),s=i.decode(o);s.compressType=this.compressType,s.encryptType=this.encryptType,s.osType=this.osType,s.version=this.version,s.deviceName=t,s.resource=e,s.deviceUuid=r,s.auth="$t$"+this.token,s.actionVersion="v1.0",s=i.encode(s).finish();var a=this.root.lookup("easemob.pb.MSync"),u=a.decode(o);return u.version=this.version,u.guid=this.context.jid,u.auth="$t$"+this.token,u.command=3,u.deviceId=t,u.serviceId=null==H?void 0:H.getInstance().getServiceId(),u.encryptType=this.encryptType,u.payload=s,a.encode(u).finish()}function Ge(e,t){var r=this,o=Y.getEnvInfo();if("web"===o.platform||"zfb"===o.platform||"dd"===o.platform){for(var n="",i=0;i<e.length;i++)n+=String.fromCharCode(e[i]);return n=$().btoa(n),"web"===o.platform?n:{data:n,isBuffer:!1,complete:function(){},fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||(ce.debug("发送失败重联"),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.reconnect(),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}function Be(e,t){switch(e.ns){case 0:Ue.call(this,e);break;case 1:Ce.call(this,e,t);break;case 2:Ae.call(this,e);break;case 3:be.handleRosterMsg.call(this,e);break;case 4:this.registerConfrIQHandler&&this.registerConfrIQHandler(e,t,this);break;case 5:Le.call(this,e);break;default:ce.error("distributeMeta",e)}}function je(e,t){for(var r=function(r){var n=new(h())(e[r].id.low,e[r].id.high,e[r].id.unsigned).toString();if(o._load_msg_cache.some((function(e){return e.msgId===n})))return"continue";var i=e[r].from.name,s=e[r].to?e[r].to.name:"",a=!!e[r].to&&-1!==e[r].to.domain.indexOf("conference");o._load_msg_cache.length<=Jn.max_cache_length||o._load_msg_cache.shift(),o._load_msg_cache.push({msgId:n,from:i,to:s,isGroup:a}),Be.call(o,e[r],t)},o=this,n=0;n<e.length;n++)r(n)}function He(e){var t=this.root.lookup("easemob.pb.CommUnreadDL");if(t=t.decode(e.payload),"agoraToken"===this.grantType){var r=new(h())(t.timestamp.low,t.timestamp.high,t.timestamp.unsigned).toString();this.compareTokenExpireTime(Number(r),this.expirationTime)}if(0===t.unread.length)Xe.call(this);else for(var o=0;o<t.unread.length;o++)qe.call(this,t.unread[o].queue)}function Fe(){var e=[],t=this.root.lookup("easemob.pb.StatisticsBody"),r=t.decode(e);r.operation=0,r=t.encode(r).finish();var o=this.root.lookup("easemob.pb.Meta").decode(e);o.id=(new Date).valueOf(),o.ns=0,o.payload=r;var n=this.root.lookup("easemob.pb.CommSyncUL"),i=n.decode(e);i.meta=o,i=n.encode(i).finish();var s=this.root.lookup("easemob.pb.MSync"),a=s.decode(e);return a.version=this.version,a.encryptType=[0],a.command=0,a.payload=i,s.encode(a).finish()}function We(e){var t=[],r=this.root.lookup("easemob.pb.CommSyncUL"),o=r.decode(t);o.queue=e,o=r.encode(o).finish();var n=this.root.lookup("easemob.pb.MSync"),i=n.decode(t);return i.version=this.version,i.encryptType=this.encryptType,i.command=0,i.payload=o,n.encode(i).finish()}function qe(e){ce.debug("sendBackqueue");var t=We.call(this,e);pt.call(this,t)}function Ke(e,t){var r=[],o=this.root.lookup("easemob.pb.CommSyncUL"),n=o.decode(r);n.queue=t,n.key=new(h())(e.low,e.high,e.unsigned).toString(),n=o.encode(n).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=n,i.encode(s).finish()}function Ve(e,t){ce.debug("sendLastSession");var r=Ke.call(this,e,t);pt.call(this,r)}function ze(e){var t,r=this.root.lookup("easemob.pb.Provision").decode(e.payload);if(this.context.jid&&(this.context.jid.clientResource=r.resource),this.clientResource=r.resource,0===r.status.errorCode){if(this.onOpened&&this.onOpened(),null===(t=this.eventHandler)||void 0===t||t.dispatch("onConnected"),"agoraToken"===this.grantType){var o=Date.now();this.expiresIn=this.expirationTime-o,this.tokenExpireTimeCountDown(this.expiresIn)}Je.call(this),Qe.call(this),Ye.call(this),Xe.call(this)}else this.onError&&this.onError({type:g.WEBIM_CONNECTION_ERROR,message:"provision error",data:r})}function Je(){if(this.unSendMsgArr.length>0){for(var e=0;e<this.unSendMsgArr.length;e++){var t=this.unSendMsgArr[e];ct.call(this,t)}this.unSendMsgArr=[]}}function Xe(){var e=Fe.call(this);pt.call(this,e)}function Ye(){var e=Ze.call(this);pt.call(this,e)}function Qe(){var e=this;$e.call(this),this.heartBeatID=setInterval((function(){Ye.call(e)}),this.heartBeatWait)}function $e(){clearInterval(this.heartBeatID)}function Ze(){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 et(e,t){return e.some((function(e){return e.name===t.name}))}function rt(e){var t=this,r=this.root.lookup("easemob.pb.CommNotice").decode(e.payload);et(this._queues,r.queue)||this.clientResource===r.queue.clientResource&&r.queue.name===this.context.userId||(this._queues.push(r.queue),this.qTimer&&clearTimeout(this.qTimer),this.qTimer=setTimeout((function(){var e=r.queue;et(t._queues,e)&&(qe.call(t,r.queue),ce.debug("⬇q:",e))}),1e4),1===this._queues.length&&qe.call(this,r.queue))}function ot(e){var t=Y.getEnvInfo();if("web"===t.platform||"zfb"===t.platform||"dd"===t.platform){for(var r=$().atob(e.data),o=[],n=0,i=r.length;n<i;++n)o.push(r.charCodeAt(n));return this.root.lookup("easemob.pb.MSync").decode(o)}return this.root.lookup("easemob.pb.MSync").decode(e.data)}function nt(e){switch(e.command){case 0:it.call(this,e);break;case 1:He.call(this,e);break;case 2:rt.call(this,e);break;case 3:ze.call(this,e)}}function it(e){var t,r,o,n,i,s=this.root.lookup("easemob.pb.CommSyncDL");s=s.decode(e.payload);var a=new(h())(s.serverId.low,s.serverId.high,s.serverId.unsigned).toString(),u=new(h())(s.metaId.low,s.metaId.high,s.metaId.unsigned).toString();if(0!==s.metas.length)try{je.call(this,s.metas,s.status)}catch(e){this.onError&&this.onError({type:g.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e})}finally{if(s.isLast){var c=-1;this._queues.some((function(e,t){return e.name===s.name&&(c=t,!0)}))&&c>0&&this._queues.splice(c,1),this._queues.length>0&&(qe.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer))}else Ve.call(this,s.nextKey,s.queue)}else if(s.isLast){var p=-1;this._queues.some((function(e,t){return e.name===s.queue.name&&(p=t,!0)}))&&this._queues.splice(p,1),this._queues.length>0&&(qe.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer))}else if(s.status&&0===s.status.errorCode){if((m=C.get(u))&&((0,m.rpt)({isEndApi:!0,data:{isSuccess:1,requestName:m.requestName,requestMethod:"WEBSOCKET",requestUrl:this.url,code:O.success}}),C.delete(u)),this._msgHash[u]){A.has(u)&&(A.get(u).rpt({isEndApi:!0,data:{isSuccess:1,requestMethod:"WEBSOCKET",requestUrl:this.url,code:O.success,msgId:a}}),A.delete(u));try{(null===(t=this._msgHash[u])||void 0===t?void 0:t.resolve)instanceof Function&&this._msgHash[u].resolve({localMsgId:u,serverMsgId:a}),(null===(r=this._msgHash[u])||void 0===r?void 0:r.success)instanceof Function&&this._msgHash[u].success(u,a)}catch(e){this.onError&&this.onError({type:g.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e})}this.onReceivedMessage&&this.onReceivedMessage({id:u,mid:a,to:this._msgHash[u].to,time:0}),null===(o=this.eventHandler)||void 0===o||o.dispatch("onReceivedMessage",{id:u,mid:a,to:this._msgHash[u].to}),delete this._msgHash[u]}}else if(s.status&&15===s.status.errorCode)this.onMutedMessage&&this.onMutedMessage({mid:a}),this._msgHash[u].reject instanceof Function&&this._msgHash[u].reject({type:g.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"});else if(s.status&&1===s.status.errorCode){var l=void 0;switch(s.status.reason){case"blocked":l=g.PERMISSION_DENIED;break;case"group not found":l=g.GROUP_NOT_EXIST;break;case"not in group or chatroom":l=g.GROUP_NOT_JOINED;break;case"exceed recall time limit":l=g.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":l=g.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":l=g.SERVICE_NOT_ALLOW_MESSAGING;break;case"nonroster":l=g.USER_NOT_FRIEND,s.status.reason="not contact";break;default:l=s.status.reason.includes("moderation")?g.MESSAGE_MODERATION_BLOCKED:g.SERVER_UNKNOWN_ERROR}if(this._msgHash[u]){var d=f.create({type:l,message:s.status.reason||"",data:{id:u,mid:a}});this._msgHash[u].reject instanceof Function&&this._msgHash[u].reject(d),this._msgHash[u].fail instanceof Function&&this._msgHash[u].fail({type:l,reason:s.status.reason?s.status.reason:"",data:{id:u,mid:a}})}}else if(s.status&&7===s.status.errorCode)"sensitive words"===s.status.reason&&this._msgHash[u]?(d=f.create({type:g.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"sensitive words",data:{id:u,mid:a}}),this._msgHash[u].reject instanceof Function&&this._msgHash[u].reject(d),this._msgHash[u].fail instanceof Function&&this._msgHash[u].fail({type:g.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:u,mid:a,reason:"sensitive words"}})):"blocked by mod_antispam"===s.status.reason&&this._msgHash[u]?(d=f.create({type:g.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"blocked by mod_antispam",data:{id:u,mid:a}}),this._msgHash[u].reject instanceof Function&&this._msgHash[u].reject(d),this._msgHash[u].fail instanceof Function&&this._msgHash[u].fail({type:g.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:u,mid:a,reason:"blocked by mod_antispam"}})):"user is mute"===s.status.reason&&this._msgHash[u]&&(d=f.create({type:g.USER_MUTED_BY_ADMIN,message:"user is mute",data:{id:u,mid:a}}),this._msgHash[u].reject instanceof Function&&this._msgHash[u].reject(d),this._msgHash[u].fail instanceof Function&&this._msgHash[u].fail(d));else if(s.status&&19===s.status.errorCode)this._msgHash[u]&&(A.has(u)&&(A.get(u).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.MESSAGE_EXTERNAL_LOGIC_BLOCKED,codeDesc:s.status.reason||"",msgId:a}}),A.delete(u)),d=f.create({type:g.MESSAGE_EXTERNAL_LOGIC_BLOCKED,message:s.status.reason||"",data:{id:u,mid:a}}),this._msgHash[u].reject instanceof Function&&this._msgHash[u].reject(d),this._msgHash[u].fail instanceof Function&&this._msgHash[u].fail({type:g.MESSAGE_EXTERNAL_LOGIC_BLOCKED,data:{id:u,mid:a,reason:s.status.reason}}));else if(this._msgHash[u]){A.has(u)&&(A.get(u).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.WEBIM_LOAD_MSG_ERROR,codeDesc:(null===(n=s.status)||void 0===n?void 0:n.reason)||"",msgId:a}}),A.delete(u));try{d=f.create({type:g.WEBIM_LOAD_MSG_ERROR,message:(null===(i=s.status)||void 0===i?void 0:i.reason)||"",data:{id:u,mid:a,reason:s.status&&s.status.reason}}),this._msgHash[u].reject instanceof Function&&this._msgHash[u].reject(d),this._msgHash[u].fail instanceof Function&&this._msgHash[u].fail({type:g.WEBIM_LOAD_MSG_ERROR,data:{errorCode:s.status&&s.status.errorCode,reason:s.status&&s.status.reason}})}catch(e){this.onError&&this.onError({type:g.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e})}delete this._msgHash[u]}else{var m;A.has(u)&&(A.get(u).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,codeDesc:"on message error",msgId:a}}),A.delete(u)),(m=C.get(u))&&((0,m.rpt)({isEndApi:!0,data:{isSuccess:0,requestName:m.requestName,requestMethod:"WEBSOCKET",requestUrl:this.url,code:O.failed,codeDesc:"on message error"}}),C.delete(u)),this.onError&&this.onError({type:g.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"on message error"})}}function st(e){var t=[],r=this.root.lookup("easemob.pb.KeyValue"),o=[];for(var n in e){var i=r.decode(t);i.key=n,"object"==typeof e[n]?(i.type=8,i.stringValue=JSON.stringify(e[n])):"string"==typeof e[n]?(i.type=7,i.stringValue=e[n]):"boolean"==typeof e[n]?(i.type=1,i.varintValue=!0===e[n]?1:0):Number.isInteger(e[n])?(i.type=2,i.varintValue=e[n]):(i.type=6,i.doubleValue=e[n]),o.push(i)}return o}function at(e){var t,r,o=[];if(this.root){var n,i=this.root.lookup("easemob.pb.MessageBody.Content").decode(o);switch(n=!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":i.type=0,i.text=e.msg;break;case"img":i.type=1,e.body?(i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.size=e.body.size,i.thumbnailDisplayName=e.body.filename):e.file?(i.displayName=e.file.filename,i.remotePath=e.file.url,i.secretKey=e.file.secret,i.fileLength=e.file.file_length,i.size=e.file.size,i.thumbnailDisplayName=e.file.filename):(i.displayName=e.filename,i.remotePath=e.url,i.secretKey=e.secret,i.fileLength=e.file_length,i.size=e.size,i.thumbnailDisplayName=e.filename);break;case"video":i.type=2,i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.duration=e.body.length,i.thumbnailDisplayName=e.body.filename;break;case"loc":i.type=3,i.latitude=e.lat,i.longitude=e.lng,i.address=e.addr,i.buildingName=e.buildingName,i.latitude=e.lat;break;case"audio":i.type=4,i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.duration=e.body.length,i.thumbnailDisplayName=e.body.filename;break;case"file":i.type=5,i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.size=e.body.size,i.thumbnailDisplayName=e.body.filename;break;case"cmd":i.type=6,i.action=e.action;break;case"custom":i.type=7,i.customEvent=e.customEvent,i.customExts=st.call(this,e.customExts)}var s=[];e.ext&&(s=st.call(this,e.ext));var a=this.root.lookup("easemob.pb.MessageBody"),u=a.decode(o);u.from={name:this.context.jid.name},u.to={name:e.to},"channel"===e.type?u.type=7:"recall"===e.type?(u.type=6,u.ackMessageId=e.ackId):"delivery"===e.type?(u.type=5,u.ackMessageId=e.ackId):"read"===e.type?(u.type=4,u.ackMessageId=e.ackId,"groupChat"===n&&(u.msgConfig={allowGroupAck:!0},u.ackContent=e.ackContent)):"chatRoom"===n?u.type=3:"groupChat"===n?(u.type=2,e.msgConfig&&(u.msgConfig={allowGroupAck:!0})):"singleChat"===n&&(u.type=1),u.contents=[i],u.ext=s;var c=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);c&&(u.meta=c),u=a.encode(u).finish();var p=this.root.lookup("easemob.pb.Meta").decode(o);p.id=e.id;var l="easemob.com";"chatRoom"!==n&&"groupChat"!==n||(l="conference.easemob.com"),p.from=this.context.jid,p.to={appKey:this.appKey,name:e.to,domain:l},p.ns=1,p.payload=u;var d=this.root.lookup("easemob.pb.CommSyncUL"),h=d.decode(o);h.meta=p,h=d.encode(h).finish();var f=this.root.lookup("easemob.pb.MSync"),m=f.decode(o);return m.version=this.version,m.encryptType=this.encryptType,m.command=0,m.guid=this.context.jid,m.payload=h,f.encode(m).finish()}e.fail&&e.fail({type:g.WEBIM_CONNCTION_CLIENT_OFFLINE,message:"Not logged in"})}function ut(e){var t=this;if(!e.file)return e;var r=xe({},e);return r.accessToken=this.token,r.appKey=this.appKey,r.apiUrl=this.apiUrl,r.body&&r.body.url?at.call(this,r):new Promise((function(o,n){var i=r.onFileUploadComplete;r.onFileUploadComplete=function(o){var n;if(o.entities[0]["file-metadata"]){var s=o.entities[0]["file-metadata"]["content-length"];r.file_length=s,r.filetype=o.entities[0]["file-metadata"]["content-type"],s>204800&&(r.thumbnail=!0)}r.body={type:r.type||"file",secret:o.entities[0]["share-secret"],filename:r.file.filename||r.filename,url:(t.isHttpDNS?t.apiUrl+o.uri.substr(o.uri.indexOf("/",9)):o.uri)+"/"+o.entities[0].uuid,length:r.length||0,filetype:r.filetype||r.file.filetype,file_length:(null===(n=null==r?void 0:r.ext)||void 0===n?void 0:n.file_length)||0,size:{width:r.width||0,height:r.height||0}},r.file.url=o.uri,e.secret=o.entities[0]["share-secret"];var a=(t.isHttpDNS?t.apiUrl+o.uri.substr(o.uri.indexOf("/",9)):o.uri)+"/"+o.entities[0].uuid;e.url=a,o.url=a,"img"===r.type&&(e.thumb=a+"?thumbnail=true",o.thumb=a+"?thumbnail=true"),i instanceof Function&&i(o,r.id);var u=at.call(t,r);A.size<=M&&A.set(r.id,{rpt:null==H?void 0:H.getInstance().geOperateFun({operationName:T.SEND_MSG})}),pt.call(t,u)},Y.uploadFile.call(t,r,T.UPLOAD_MSG_ATTACH)}))}function ct(e){var t=this;return new Promise((function(r,o){var n,i;if(t.logOut)return o({type:g.WEBIM_CONNECTION_CLOSED,message:"not login"});var s="file"===e.type||"img"===e.type||"audio"===e.type||"video"===e.type,a="delivery"===e.type||"read"===e.type||"channel"===e.type;if(e.id&&((!s&&!a||s&&t.useOwnUploadFun)&&A.size<=M&&A.set(e.id,{rpt:null==H?void 0:H.getInstance().geOperateFun({operationName:"recall"===e.type?T.SEND_RECALL_MSG:T.SEND_MSG})}),t._msgHash[e.id]=xe(xe({},e),{resolve:r,reject:o})),s&&e.file)return ut.call(t,e);if("txt"===e.type&&(null===(n=e.msgConfig)||void 0===n?void 0:n.languages)&&Array.isArray(null===(i=e.msgConfig)||void 0===i?void 0:i.languages)&&e.msgConfig.languages.length>0)t.translateMessage({text:e.msg,languages:e.msgConfig.languages}).then((function(r){var o;console.log("res --",r);var n=null===(o=r.data[0])||void 0===o?void 0:o.translations;n=n.map((function(e){return{code:e.to,text:e.text}})),e.translations=n;var i=at.call(t,e);pt.call(t,i,e.id)})).catch((function(e){o(e)}));else{var u=at.call(t,e);pt.call(t,u,e.id)}}))}function pt(e,t){if(!this.isOpened())return this.unSendMsgArr.push(e),!this.logOut&&this.autoReconnectNumTotal<this.autoReconnectNumMax&&(this.autoReconnectNumTotal<=this.socketHost.length&&this.isHttpDNS||!this.isHttpDNS)&&(ce.debug("need to reconnect",this.autoReconnectNumTotal,this.autoReconnectNumMax),this.offLineSendConnecting=!0,this.reconnect()),void(this.onError&&this.onError({type:g.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}));var r=Ge.call(this,e,t);this.sock.send(r)}const lt=function(e,t){return e.send=ct,e.sendMsg=ct,{generateProvision:De.bind(e),base64transform:Ge.bind(e),distributeMeta:Be.bind(e),decodeMeta:je.bind(e),decodeUnreadDL:He.bind(e),_rebuild:Fe.bind(e),_lastsession:Ke.bind(e),receiveProvision:ze.bind(e),isInQueue:et.bind(e),decodeNotice:rt.bind(e),decodeMSync:ot.bind(e),distributeMSync:nt.bind(e),encodeChatMsg:at.bind(e),upLoadFile:ut.bind(e),send:ct.bind(e),stopHeartBeat:$e.bind(e)}};var dt=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 ce.debug("dispatch event: "+e,t||""),this.handlerData){var o=this.handlerData[r][e];o&&o(t)}},e}();const ht=dt;var ft=function(){};function mt(e){this.onOpened=e.onOpened||ft,this.onPresence=e.onPresence||ft,this.onTextMessage=e.onTextMessage||ft,this.onPictureMessage=e.onPictureMessage||ft,this.onAudioMessage=e.onAudioMessage||ft,this.onVideoMessage=e.onVideoMessage||ft,this.onFileMessage=e.onFileMessage||ft,this.onLocationMessage=e.onLocationMessage||ft,this.onCmdMessage=e.onCmdMessage||ft,this.onCustomMessage=e.onCustomMessage||ft,this.onReceivedMessage=e.onReceivedMessage||ft,this.onDeliveredMessage=e.onDeliveredMessage||ft,this.onReadMessage=e.onReadMessage||ft,this.onRecallMessage=e.onRecallMessage||ft,this.onMutedMessage=e.onMutedMessage||ft,this.onChannelMessage=e.onChannelMessage||ft,this.onError=e.onError||ft,this.onOffline=e.onOffline||ft,this.onOnline=e.onOnline||ft,this.onRoster=e.onRoster||ft,this.onStatisticMessage=e.onStatisticMessage||ft,this.onCreateGroup=e.onCreateGroup||ft,this.onBlacklistUpdate=e.onBlacklistUpdate||ft,this.onContactInvited=e.onContactInvited||ft,this.onContactAgreed=e.onContactAgreed||ft,this.onContactRefuse=e.onContactRefuse||ft,this.onContactDeleted=e.onContactDeleted||ft,this.onContactAdded=e.onContactAdded||ft,this.onTokenWillExpire=e.onTokenWillExpire||ft,this.onTokenExpired=e.onTokenExpired||ft,this.onClosed=e.onClosed||ft,this.onPresenceStatusChange=e.onPresenceStatusChange||ft}function gt(){var e=this.context.appName,t=this.context.orgName;return!(!e||!t)||(this.onError&&this.onError({type:g.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function Et(){var e;if(!this.context.accessToken){var t=f.create({type:g.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return this.onError&&this.onError(t),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",t),!1}return!0}function yt(){return Et.call(this)&>.call(this)}var Tt=function(){return Tt=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Tt.apply(this,arguments)},_t=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((o=o.apply(e,t||[])).next())}))},vt=function(e,t){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){s.label=i[1];break}if(6===i[0]&&s.label<n[1]){s.label=n[1],n=i;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(i);break}n[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};function Ot(e){var t=this;if(!yt.call(this)){var r=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},success:function(r){var o={};r.data.forEach((function(e){o[e]={name:e}})),t.onBlacklistUpdate&&t.onBlacklistUpdate(o),"function"==typeof(null==e?void 0:e.success)&&e.success(r)},error:function(r){t.onBlacklistUpdate&&t.onBlacklistUpdate({}),"function"==typeof(null==e?void 0:e.error)&&e.error(r)}};return ce.debug("Call getBlacklist"),Y.ajax(a,T.GET_BLACK_LIST)}function Rt(e){var t=this;if(!yt.call(this)){var r=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},success:function(r){var o=[];r.data.forEach((function(e){o.push({name:e,subscription:"both",jid:t.context.jid})})),"function"==typeof(null==e?void 0:e.success)&&e.success(o),t.onRoster&&t.onRoster(o)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return ce.debug("Call getContacts"),Y.ajax(a,T.GET_CONTACTS)}var It=Rt;function St(e){if("string"!=typeof e.deviceId||""===e.deviceId)throw Error('Invalid parameter: "deviceId"');if("string"!=typeof e.deviceToken||""===e.deviceToken)throw Error('Invalid parameter: "deviceToken"');if("string"!=typeof e.notifierName||""===e.notifierName)throw Error('Invalid parameter: "notifierName"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user,type:"PUT",data:JSON.stringify({device_id:e.deviceId,device_token:e.deviceToken,notifier_name:e.notifierName}),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call uploadPushToken",e),Y.ajax(s,T.UPLOAD_PUSH_TOKEN)}var Nt=St;function Ct(e){if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/user_channels",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return ce.debug("Call getSessionList"),Y.ajax(s,T.GET_SESSION_LIST)}function At(e){if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/user_channels",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return ce.debug("Call getConversationList"),Y.ajax(s,T.GET_SESSION_LIST).then((function(e){return function(e){var t=e.data.channel_infos;return null==t||t.forEach((function(e){e.meta&&"{}"!==JSON.stringify(e.meta)?(e.meta.payload=JSON.parse(e.meta.payload),e.lastMessage=le(e.meta)):e.lastMessage=e.meta,delete e.meta})),e}(e)}))}function Mt(e){if(e&&"string"!=typeof e.channel)throw Error("Invalid parameter channel: "+e.channel);if(e&&"singleChat"!==e.chatType&&"groupChat"!==e.chatType)throw Error("Invalid parameter chatType: "+e.chatType);if(e&&"boolean"!=typeof e.deleteRoam)throw Error("Invalid parameter deleteRoam: "+e.deleteRoam);if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r,o=this.context,n=o.orgName,i=o.appName,s=o.accessToken;r="singleChat"===e.chatType?"chat":"groupChat";var a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/user_channel",dataType:"json",type:"DELETE",data:JSON.stringify({channel:e.channel,type:r,delete_roam:e.deleteRoam}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call deleteSession",e),Y.ajax(a,T.DELETE_SESSION)}function bt(e,t){if(!yt.call(this)){var r=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a=["nickname","avatarurl","mail","phone","gender","sign","birth","ext"],u={};if("undefined"!=typeof wx||"undefined"!=typeof qq)if("string"==typeof e&&void 0!==t){if(!a.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");u[e]=t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");a.forEach((function(t){a.includes(t)&&void 0!==e[t]&&(u[t]=e[t])}))}else if("string"==typeof e){if(!a.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");u=e+"="+t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");var c=[];a.forEach((function(t){if(a.includes(t)&&void 0!==e[t]){var r=encodeURIComponent(t),o=encodeURIComponent(e[t]);c.push(r+"="+o)}})),u=c.join("&")}var p={url:this.apiUrl+"/"+n+"/"+i+"/metadata/user/"+this.user,type:"PUT",data:u,dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/x-www-form-urlencoded"}};return ce.debug("Call updateOwnUserInfo",e),Y.ajax(p,T.UPDATE_USER_INFO)}function Ut(e,t){if(!yt.call(this)){var r=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o,n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u=[];if("string"==typeof e)u=[e];else{if("[object Array]"!==Object.prototype.toString.call(e))throw new Error("illegal params");u=e}o="string"==typeof t?[t]:"[object Array]"===Object.prototype.toString.call(t)?t:["nickname","avatarurl","mail","phone","gender","sign","birth","ext"];var c={url:this.apiUrl+"/"+i+"/"+s+"/metadata/user/get",type:"POST",data:JSON.stringify({targets:u,properties:o}),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return ce.debug("Call fetchUserInfoById",e),Y.ajax(c,T.GET_USER_INFO)}function wt(e){if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user,type:"PUT",dataType:"json",data:JSON.stringify({nickname:e}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return ce.debug("Call updateCurrentUserNick",e),Y.ajax(s)}function kt(e){if("string"!=typeof e||""===e)throw Error('Invalid parameter: "agoraToken"');var t=this.context,r=t.orgName,o=t.appName,n={url:this.apiUrl+"/"+r+"/"+o+"/token",dataType:"json",type:"POST",data:JSON.stringify({grant_type:"agora"}),headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return ce.debug("Call getChatToken",e),Y.ajax(n,T.SDK_INTERNAL)}function Pt(e){var t=this;return new Promise((function(r,o){if(!e.queue)throw Error('Invalid parameter: "specified"');if(!yt.call(t)){var n=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(n)}(function e(t){var n=this,i=t.count||20;Lt.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 s=o.msgs.splice(0,i).reverse();t.success&&t.success(s),r(s)}else e.call(n,Tt(Tt({},t),{start:null}))},fail:function(e){o(e),t.fail&&t.fail(e)}})}).call(t,e),ce.debug("Call fetchHistoryMessages",e)}))}function Lt(e){var t=this,r=e.queue,o=this.mr_cache[r]||(this.mr_cache[r]={msgs:[]}),n=this.context.userId,i=e.start||-1,s=e.count||20;if(o.msgs.length>=s||o.is_last)"function"==typeof e.success&&e.success(o);else{o&&o.next_key&&(i=o.next_key),e.start&&(i=e.start);var a={queue:r+(e.isGroup?"@conference.easemob.com":"@easemob.com"),start:i,end:-1},u=this.context,c=u.orgName,p=u.appName,l=function(r){if(r.error&&r.error_description){var o=f.create({type:g.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:"fetch history messages error",data:r});t.onError&&t.onError(o)}"function"==typeof e.fail&&e.fail(l)},d={url:this.apiUrl+"/"+c+"/"+p+"/users/"+n+"/messageroaming",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(a),success:function(r){var n=null==r?void 0:r.data;if(!r.data.msgs)return"function"==typeof e.success&&e.success(o),o.is_last=!0,void(o.next_key="");var i=n.msgs,s=i.length;o.is_last=n.is_last,o.next_key=n.next_key;for(var a=function(r){for(var o=[],n=0,i=(r=$().atob(r)).length;n<i;++n)o.push(r.charCodeAt(n));var s=t.context.root.lookup("easemob.pb.Meta");if(1===(s=s.decode(o)).ns)return Ce.call(t,s,{errorCode:0,reason:""},!0,e.format)},u=0;u<s;u++){var c=a(i[u].msg);c&&o.msgs.push(c)}"function"==typeof e.success&&e.success(o)},error:l};Y.ajax(d,T.GET_HISTORY_MSG)}}function xt(e){var t=this;return new Promise((function(r,o){if("string"!=typeof e.targetId||""===e.targetId)throw Error('"Invalid parameter": "targetId"');if(!yt.call(t))return o(f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"}));var n=t.context,i=n.orgName,s=n.appName,a=n.userId,u="groupChat"===e.chatType||"chatRoom"===e.chatType?"@conference.easemob.com":"@easemob.com",c={queue:e.targetId+u,start:e.cursor||-1,pull_number:e.pageSize||20,isGroup:"groupChat"===e.chatType||"chatRoom"===e.chatType||!1,is_positive:"down"===e.searchDirection,end:-1},p={url:t.apiUrl+"/"+i+"/"+s+"/users/"+a+"/messageroaming",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+t.token,"Content-Type":"application/json"},data:JSON.stringify(c),success:function(e){for(var o=null==e?void 0:e.data,n=o.msgs,i=function(e){for(var r=[],o=0,n=(e=$().atob(e)).length;o<n;++o)r.push(e.charCodeAt(o));var i=t.context.root.lookup("easemob.pb.Meta");if(1===(i=i.decode(r)).ns)return Ce.call(t,i,{errorCode:0,reason:""},!0,!0)},s=[],a=0;a<n.length;a++){var u=i(n[a].msg);u&&s.push(u)}o.msgs=s;var c={cursor:o.next_key,messages:s};r(c)},error:e.fail};Y.ajax(p),ce.debug("Call getHistoryMessages",e)}))}function Dt(e,t){var r={id:this.getUniqueId(),to:e,message:t};be.operatRoster.call(this,r,"add"),ce.debug("Call addContact",r)}function Gt(e){var t={id:this.getUniqueId(),to:e};be.operatRoster.call(this,t,"remove"),ce.debug("Call deleteContact",t)}function Bt(e){var t={id:this.getUniqueId(),to:e};be.operatRoster.call(this,t,"accept"),ce.debug("Call acceptInvitation",t)}var jt=Bt;function Ht(e){var t={id:this.getUniqueId(),to:e};be.operatRoster.call(this,t,"decline"),ce.debug("Call declineContactInvite",t)}var Ft=Ht;function Wt(e){be.operatRoster.call(this,{to:e.name},"ban"),ce.debug("Call addUsersToBlacklist",e)}var qt=Wt;function Kt(e){be.operatRoster.call(this,{to:e.name},"allow"),ce.debug("Call removeFromBlackList",e)}var Vt=Kt;function zt(e){be.operatRoster.call(this,e,"add")}function Jt(e){be.operatRoster.call(this,e,"accept")}function Xt(e){be.operatRoster.call(this,e,"decline")}function Yt(e){be.operatRoster.call(this,e,"remove"),ce.debug("Call removeRoster",e)}function Qt(e){var t=this.getUniqueId(),r={id:t,to:e.to};this._msgHash[t]=Tt({},r);var o="";void 0!==e.chatType?o=e.chatType:void 0!==e.type&&(o="chat"===e.type?"singleChat":e.type);var n={id:t,type:"recall",chatType:o,ackId:e.mid,to:e.to,isChatThread:e.isChatThread||!1,success:e.success,fail:e.fail};return ce.debug("Call recallMessage",e),this.mSync.send(n,this)}function $t(e){return _t(this,void 0,void 0,(function(){var t,r,o,n,i,s,a,u,c;return vt(this,(function(p){switch(p.label){case 0:if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: "+e.messageId);if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: "+e.reaction);return yt.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.reaction,a=e.messageId,u={msgId:a,message:s},c={url:this.apiUrl+"/"+o+"/"+n+"/reaction/user/"+this.user,type:"POST",data:JSON.stringify(u),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,Y.ajax(c)]):(t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return p.sent(),[2]}}))}))}function Zt(e){return _t(this,void 0,void 0,(function(){var t,r,o,n,i,s,a,u;return vt(this,(function(c){switch(c.label){case 0:if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reactionId: "+e.reaction);return yt.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.messageId,a=e.reaction,u={url:this.apiUrl+"/"+o+"/"+n+"/reaction/user/"+this.user+"?msgId="+s+"&message="+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,Y.ajax(u)]):(t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return c.sent(),[2]}}))}))}function er(e){if("string"!=typeof e.chatType||!e.chatType)throw Error("Invalid parameter chatType: "+e.chatType);if(!e.messageId)throw Error("Invalid parameter messageId: "+e.messageId);if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatType,a=e.messageId,u={msgIdList:"string"==typeof a?[a]:a,msgType:"singleChat"===s?"chat":"groupchat",groupId:e.groupId||null},c={url:this.apiUrl+"/"+o+"/"+n+"/reaction/user/"+this.user,type:"GET",data:u,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return Y.ajax(c).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}))}function tr(e){if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: "+e.reaction);if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: "+e.messageId);if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.cursor,a=e.pageSize,u={msgId:e.messageId,message:e.reaction,currentPage:s||null,pageSize:a||20},c={url:this.apiUrl+"/"+o+"/"+n+"/reaction/user/"+this.user+"/detail",type:"GET",data:u,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return Y.ajax(c).then((function(e){return e.data.isAddedBySelf=e.data.state,delete e.data.state,delete e.data.reactionId,e}))}function rr(e){return _t(this,void 0,void 0,(function(){var t,r,o,n,i,s,a,u,c,p,l;return vt(this,(function(d){switch(d.label){case 0:if("string"!=typeof e.reportType||!e.reportType)throw Error("Invalid parameter reportType: "+e.reportType);if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: "+e.messageId);if("string"!=typeof e.reportReason||!e.reportReason)throw Error("Invalid parameter messageId: "+e.reportReason);return yt.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.reportType,a=e.reportReason,u=e.messageId,c={username:this.user,reportType:s,reportReason:a},p=this.apiUrl+"/"+o+"/"+n+"/user/"+this.user+"/moderation/report/message/"+u,l={url:p,type:"POST",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,Y.ajax(l)]):(t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return d.sent(),[2]}}))}))}function or(e){var t=this;if(!e||!e.data)throw Error("Invalid parameter");if(!yt.call(this)){var r=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups",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}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:function(r){e.success&&e.success(r),t.onCreateGroup&&t.onCreateGroup(r)},error:e.error};return ce.debug("Call createGroup:",e),Y.ajax(a,T.CREATE_GROUP)}var nr=or;function ir(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!yt.call(this)){var r=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={entities:[(t={},t["notification_ignore_"+e.groupId]=!0,t)]},u={type:"PUT",url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user,data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call blockGroupMessages",e),Y.ajax(u,T.BLOCK_GROUP)}var sr=ir;function ar(e){if("number"!=typeof e.limit)throw Error("Invalid parameter");if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={limit:e.limit,cursor:e.cursor};e.cursor||delete s.cursor;var a={url:this.apiUrl+"/"+o+"/"+n+"/publicchatgroups",type:"GET",dataType:"json",data:s,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call listGroups",e),Y.ajax(a,T.LIST_GROUP)}function ur(e){if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/joined_chatgroups",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return ce.debug("Call getJoinedGroups",e),Y.ajax(s,T.GET_USER_GROUP)}function cr(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');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/joined_chatgroups?pagenum="+e.pageNum+"&pagesize="+e.pageSize,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return ce.debug("Call getGroup",e),Y.ajax(s,T.GET_USER_GROUP)}function pr(e){if("string"!=typeof e.groupId||"string"!=typeof e.newOwner)throw Error("Invalid parameter");if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={newowner:e.newOwner},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups/"+e.groupId,type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},data:JSON.stringify(r),success:e.success,error:e.error};return ce.debug("Call changeOwner",e),Y.ajax(a,T.CHANGE_OWNER)}var lr=pr;function dr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"?joined_time=true",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getGroupInfo",e),Y.ajax(s,T.GET_GROUP_INFO)}function hr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={groupname:e.groupName,description:e.description},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s,type:"PUT",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call modifyGroup",e),Y.ajax(u,T.MODIFY_GROUP)}function fr(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');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups/"+e.groupId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call listGroupMember",e),Y.ajax(a,T.LIST_GROUP_MEMBER)}var mr=fr;function gr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getGroupAdmin",e),Y.ajax(a,T.GET_GROUP_ADMIN)}function Er(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={newadmin:e.username},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call setGroupAdmin",e),Y.ajax(u,T.SET_GROUP_ADMIN)}var yr=Er;function Tr(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call removeAdmin",e),Y.ajax(u,T.REMOVE_GROUP_ADMIN)}function _r(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"?version=v3",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call destroyGroup",e),Y.ajax(a,T.DISSOLVE_GROUP)}var vr=_r;function Or(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/quit",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call quitGroup",e),Y.ajax(a,T.QUIT_GROUP)}function Rr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o={usernames:e.users},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/chatgroups/"+r+"/invite",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call inviteUsersToGroup",e),Y.ajax(u,T.INVITE_TO_GROUP)}var Ir=Rr;function Sr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"/apply",type:"POST",dataType:"json",data:JSON.stringify({message:e.message||""}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call joinGroup",e),Y.ajax(s,T.JOIN_GROUP)}function Nr(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={applicant:e.applicant,verifyResult:!0,reason:"no clue"},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call agreeJoinGroup",e),Y.ajax(u,T.AGREE_JOIN_GROUP)}var Cr=Nr;function Ar(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={applicant:e.applicant,verifyResult:!1,reason:e.reason||""},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call rejectGroupJoinRequest",e),Y.ajax(u,T.REJECT_JOIN_GROUP)}var Mr=Ar;function br(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={invitee:e.invitee,verifyResult:!0},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call acceptGroupInvite",e),Y.ajax(u,T.AGREE_INVITE_GROUP)}var Ur=br;function wr(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={invitee:e.invitee,verifyResult:!1},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call rejectGroupInvite",e),Y.ajax(u,T.REJECT_INVITE_GROUP)}var kr=wr;function Pr(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o=e.username,n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/chatgroups/"+r+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call removeGroupMember",e),Y.ajax(u,T.REMOVE_GROUP_MEMBER)}var Lr=Pr;function xr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.users.join(","),u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call removeGroupMembers",e),Y.ajax(u,T.MULTI_REMOVE_GROUP_MEMBER)}var Dr=xr;function Gr(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"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:[e.username],mute_duration:e.muteDuration},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(a),success:e.success,error:e.error};return ce.debug("Call muteGroupMember",e),Y.ajax(u,T.MUTE_GROUP_MEMBER)}var Br=Gr;function jr(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute/"+a,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call unmuteGroupMember",e),Y.ajax(u,T.UNMUTE_GROUP_MEMBER)}var Hr=jr;function Fr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getGroupMuteList",e),Y.ajax(a,T.GET_GROUP_MUTE_LIST)}var Wr=Fr;function qr(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call blockGroupMember",e),Y.ajax(u,T.BLOCK_GROUP_MEMBER)}var Kr=qr;function Vr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:e.usernames},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users",data:JSON.stringify(a),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call blockGroupMembers",e),Y.ajax(u,T.BLOCK_GROUP_MEMBERS)}var zr=Vr;function Jr(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call unblockGroupMember",e),Y.ajax(u,T.UNBLOCK_GROUP_MEMBER)}var Xr=Jr;function Yr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.usernames.join(","),u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call unblockGroupMembers",e),Y.ajax(u,T.UNBLOCK_GROUP_MEMBERS)}var Qr=Yr;function $r(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getGroupBlacklist",e),Y.ajax(a,T.GET_GROUP_BLACK_LIST)}var Zr=$r;function eo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call disableSendGroupMsg",e),Y.ajax(a,T.DISABLED_SEND_GROUP_MSG)}function to(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call enableSendGroupMsg",e),Y.ajax(a,T.ENABLE_SEND_GROUP_MSG)}function ro(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:e.users},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users",type:"POST",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call addUsersToGroupWhitelist",e),Y.ajax(u,T.ADD_USERS_TO_GROUP_WHITE)}function oo(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users/"+e.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call removeGroupWhitelistMember",e),Y.ajax(a,T.REMOVE_GROUP_WHITE_MEMBER)}var no=oo;function io(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getGroupWhitelist",e),Y.ajax(a,T.GET_GROUP_WHITE_LIST)}function so(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call isGroupWhiteUser",e),Y.ajax(a,T.IS_IN_GROUP_WHITE_LIST)}var ao=so;function uo(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"/acks/"+e.msgId,dataType:"json",type:"GET",data:{limit:500,key:void 0},headers:{Authorization:"Bearer "+i},success:e.success,error:e.error};return ce.debug("Call getGroupMsgReadUser",e),Y.ajax(s,T.GET_GROUP_MSG_READ_USER)}function co(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/announcement",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call fetchGroupAnnouncement",e),Y.ajax(a,T.GET_GROUP_ANN)}function po(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={announcement:e.announcement},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/announcement",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call updateGroupAnnouncement",e),Y.ajax(u,T.UPDATE_GROUP_ANN)}function lo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(yt.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=e.groupId;Y.uploadFile({uploadUrl:this.apiUrl+"/"+r+"/"+o+"/chatgroups/"+i+"/share_files",onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:n,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey},T.UPLOAD_GROUP_FILE),ce.debug("Call uploadGroupSharedFile",e)}}function ho(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.fileId,u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/share_files/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call deleteGroupSharedFile",e),Y.ajax(u,T.DELETE_GROUP_FILE)}function fo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.pageNum||1,a=e.pageSize||10,u=e.groupId,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+u+"/share_files?pagenum="+s+"&pagesize="+a,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call fetchGroupSharedFileList",e),Y.ajax(c,T.GET_GROUP_FILE_LIST)}function mo(e){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=this.apiUrl,s=e.groupId,a=e.fileId;Y.download.call(this,{url:i+"/"+r+"/"+o+"/chatgroups/"+s+"/share_files/"+a,onFileDownloadComplete:e.onFileDownloadComplete,onFileDownloadError:e.onFileDownloadError,accessToken:n,id:a,secret:e.secret},T.DOWN_GROUP_FILE),ce.debug("Call downloadGroupSharedFile",e)}function go(e){var t=this;if("number"!=typeof e.pagenum||"number"!=typeof e.pagesize)throw Error("Invalid parameter");if(!yt.call(this)){var r=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o={pagenum:e.pagenum||1,pagesize:e.pagesize||20},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+a},data:o,success:function(t){"function"==typeof e.success&&e.success(t)},error:function(r){r.error&&r.error_description&&t.onError&&t.onError({type:g.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:r.error_description,data:r}),"function"==typeof e.error&&e.error(r)}};return ce.debug("Call getChatRooms",e),Y.ajax(u,T.GET_CHATROOM_LIST)}function Eo(e){if("string"!=typeof e.name)throw Error("Invalid parameter");if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={name:e.name,description:e.description,maxusers:e.maxusers,owner:this.user,members:e.members},o=this.context,n=o.orgName,i=o.appName,s=(o.accessToken,{url:this.apiUrl+"/"+n+"/"+i+"/chatrooms",dataType:"json",type:"POST",data:JSON.stringify(r),headers:{Authorization:"Bearer "+e.token||0,"Content-Type":"application/json"},success:e.success,error:e.error});return ce.debug("Call createChatRoom",e),Y.ajax(s,T.CREATE_CHATROOM)}function yo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=(r.accessToken,{url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+e.token||0},success:e.success,error:e.error});return ce.debug("Call destroyChatRoom",e),Y.ajax(i,T.DESTROY_CHATROOM)}function To(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getChatRoomDetails",e),Y.ajax(s,T.GET_CHATROOM_DETAIL)}function _o(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={groupname:e.chatRoomName,description:e.description,maxusers:e.maxusers},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s,type:"PUT",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call modifyChatRoom",e),Y.ajax(u,T.MODIFY_CHATROOM)}function vo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||"string"!=typeof e.username)throw Error("Invalid parameter");if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call removeChatRoomMember",e),Y.ajax(u,T.REMOVE_CHATROOM_MEMBER)}var Oo=vo;function Ro(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o=e.users.join(","),n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms/"+r+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call removeChatRoomMembers",e),Y.ajax(u,T.MULTI_REMOVE_CHATROOM_MEMBER)}var Io=Ro;function So(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o={usernames:e.users},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms/"+r+"/users",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call addUsersToChatRoom",e),Y.ajax(u,T.ADD_USERS_TO_CHATROOM)}function No(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.roomId+"/apply",dataType:"json",type:"POST",data:JSON.stringify({message:e.message||""}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call joinChatRoom",e),Y.ajax(s,T.JOIN_CHATROOM)}function Co(e){var t=this;if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!yt.call(this)){var r=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatrooms/"+e.roomId+"/quit",dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+s},success:function(r){t._load_msg_cache=t._load_msg_cache.filter((function(t){return(!t.isGroup||t.to!==e.roomId)&&t})),"function"==typeof e.success&&e.success(r)},error:e.error};return ce.debug("Call quitChatRoom",e),Y.ajax(a,T.QUIT_CHATROOM)}function Ao(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');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatrooms/"+e.chatRoomId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call listChatRoomMembers",e),Y.ajax(a,T.LIST_CHATROOM_MEMBERS)}var Mo=Ao;function bo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getChatRoomAdmin",e),Y.ajax(a,T.GET_CHATROOM_ADMIN)}function Uo(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={newadmin:e.username},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call setChatRoomAdmin",e),Y.ajax(u,T.SET_CHATROOM_ADMIN)}function wo(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call removeChatRoomAdmin",e),Y.ajax(u,T.REMOVE_CHATROOM_ADMIN)}function ko(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:[e.username],mute_duration:e.muteDuration},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(a),success:e.success,error:e.error};return ce.debug("Call muteChatRoomMember",e),Y.ajax(u,T.MUTE_CHATROOM_MEMBER)}function Po(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute/"+a,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call unmuteChatRoomMember",e),Y.ajax(u,T.REMOVE_MUTE_CHATROOM_MEMBER)}var Lo=Po;function xo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getChatRoomMuteList",e),Y.ajax(a,T.GET_MUTE_CHATROOM_MEMBERS)}var Do=xo;function Go(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call blockChatRoomMember",e),Y.ajax(u,T.SET_CHATROOM_MEMBER_TO_BLACK)}var Bo=Go;function jo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:e.usernames},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users",data:JSON.stringify(a),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Chat RoomBlock Multi Api:",u),Y.ajax(u,T.MULTI_SET_CHATROOM_MEMBER_TO_BLACK)}var Ho=jo;function Fo(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call unblockChatRoomMember",e),Y.ajax(u,T.REMOVE_CHATROOM_MEMBER_BLACK)}var Wo=Fo;function qo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.usernames.join(","),u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call unblockChatRoomMembers",e),Y.ajax(u,T.MULTI_REMOVE_CHATROOM_MEMBER_BLACK)}var Ko=qo;function Vo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getChatRoomBlacklist",e),Y.ajax(a,T.GET_CHATROOM_BLOCK_MEMBERS)}var zo=Vo;function Jo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call disableSendChatRoomMsg",e),Y.ajax(a,T.DISABLED_CHATROOM_SEND_MSG)}function Xo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call enableSendChatRoomMsg",e),Y.ajax(a,T.ENABLE_CHATROOM_SEND_MSG)}function Yo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:e.users},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users",type:"POST",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call addUsersToChatRoomWhitelist",e),Y.ajax(u,T.ADD_USERS_TO_CHATROOM)}function Qo(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users/"+e.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call removeChatRoomWhitelistMember",e),Y.ajax(a,T.REMOVE_CHATROOM_WHITE_USERS)}var $o=Qo;function Zo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getChatRoomWhitelist",e),Y.ajax(a,T.GET_CHATROOM_WHITE_USERS)}function en(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call isChatRoomWhiteUser",e),Y.ajax(a,T.CHECK_CHATROOM_WHITE_USER)}function tn(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/announcement",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call fetchChatRoomAnnouncement",e),Y.ajax(a,T.GET_CHATROOM_ANN)}function rn(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={announcement:e.announcement},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/announcement",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call updateChatRoomAnnouncement:",e),Y.ajax(u,T.UPDATE_CHATROOM_ANN)}function on(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(yt.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=e.roomId;Y.uploadFile({uploadUrl:this.apiUrl+"/"+r+"/"+o+"/chatrooms/"+i+"/share_files",onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:n,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey},T.UPLOAD_CHATROOM_FILE),ce.debug("Call uploadChatRoomSharedFile",e)}}function nn(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a=e.fileId,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/share_files/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call deleteChatRoomSharedFile",e),Y.ajax(u,T.DELETE_CHATROOM_FILE)}function sn(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/share_files",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json",accept:"application/json"},success:e.success,error:e.error};return ce.debug("Call fetchChatRoomSharedFileList",e),Y.ajax(a,T.GET_CHATROOM_FILES)}function an(e){if("string"!=typeof e.description)throw Error('Invalid parameter: "description"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,s=r.userId,a=this.context.jid.clientResource,u={ext:e.description},c={url:this.apiUrl+"/"+n+"/"+i+"/users/"+s+"/presence/"+a+"/1",type:"POST",dataType:"json",data:JSON.stringify(u),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call publishPresence:",e),Y.ajax(c)}function un(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"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.userId,s=r.accessToken,a={usernames:e.usernames},u={url:this.apiUrl+"/"+o+"/"+n+"/users/"+i+"/presence/"+e.expiry,type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call subscribePresence:",e),Y.ajax(u)}function cn(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.userId,s=r.accessToken,a=(e.usernames,{url:this.apiUrl+"/"+o+"/"+n+"/users/"+i+"/presence",type:"DELETE",dataType:"json",data:JSON.stringify(e.usernames),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error});return ce.debug("Call unsubscribePresence:",e),Y.ajax(a)}function pn(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');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.userId,s=r.accessToken,a={url:this.apiUrl+"/"+o+"/"+n+"/users/"+i+"/presence/sublist?pageNum="+e.pageNum+"&pageSize="+e.pageSize,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getSubscribedPresenceList:",e),Y.ajax(a)}function ln(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={usernames:e.usernames},o=this.context,n=o.orgName,i=o.appName,s=o.userId,a=o.accessToken,u={url:this.apiUrl+"/"+n+"/"+i+"/users/"+s+"/presence",type:"POST",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getPresenceStatus:",e),Y.ajax(u)}function dn(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,o=r.startTime,n=r.endTime;if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of startTime"');if(!o.hours||"number"!=typeof o.hours||!o.minutes||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(n instanceof Object&&Object.keys(n).length))throw Error('Invalid parameter: "options of endTime"');if(!n.hours||"number"!=typeof n.hours||!n.minutes||"number"!=typeof n.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}if(!yt.call(this)){var i=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(i)}var s=this.context,a=s.accessToken,u=s.orgName,c=s.appName,p=s.userId,l={};switch(t){case 0:l={type:e.options.remindType};break;case 1:l={ignoreDuration:e.options.duration};break;case 2:var d=e.options;o=d.startTime,n=d.endTime,l={ignoreInterval:o.hours+":"+o.minutes+"-"+n.hours+":"+n.minutes}}var h={url:this.apiUrl+"/"+u+"/"+c+"/users/"+p+"/notification/user/"+p,type:"PUT",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call setSilentModeForAll:",e),Y.ajax(h)}function hn(e){if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,s=r.userId,a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+s+"/notification/user/"+s,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return ce.debug("Call getSilentModeForAll:",e),Y.ajax(a)}function fn(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,o=r.startTime,n=r.endTime;if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of startTime"');if(!o.hours||"number"!=typeof o.hours||!o.minutes||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(n instanceof Object&&Object.keys(n).length))throw Error('Invalid parameter: "options of endTime"');if(!n.hours||"number"!=typeof n.hours||!n.minutes||"number"!=typeof n.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}if(!yt.call(this)){var i=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(i)}var s=this.context,a=s.accessToken,u=s.orgName,c=s.appName,p=s.userId,l="chatgroup",d={};switch(t){case 0:d={type:e.options.remindType};break;case 1:d={ignoreDuration:e.options.duration};break;case 2:var h=e.options;o=h.startTime,n=h.endTime,d={ignoreInterval:o.hours+":"+o.minutes+"-"+n.hours+":"+n.minutes}}"singleChat"===e.type&&(l="user");var m={url:this.apiUrl+"/"+u+"/"+c+"/users/"+p+"/notification/"+l+"/"+e.conversationId,type:"PUT",dataType:"json",data:JSON.stringify(d),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call setSilentModeForConversation:",e),Y.ajax(m)}function mn(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(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,s=r.userId,a="chatgroup";"singleChat"===e.type&&(a="user");var u={url:this.apiUrl+"/"+n+"/"+i+"/users/"+s+"/notification/"+a+"/"+e.conversationId,type:"PUT",dataType:"json",data:JSON.stringify({type:"DEFAULT"}),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call clearRemindTypeForConversation:",e),Y.ajax(u)}function gn(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(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,s=r.userId,a="chatgroup";"singleChat"===e.type&&(a="user");var u={url:this.apiUrl+"/"+n+"/"+i+"/users/"+s+"/notification/"+a+"/"+e.conversationId,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getSilentModeForConversation:",e),Y.ajax(u)}function En(e){if(!Array.isArray(e.conversationList))throw Error('Invalid parameter: "conversationList"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,s=r.userId,a=[],u=[];e.conversationList.forEach((function(e){"singleChat"===e.type?a.push(e.id):u.push(e.id)}));var c=a.length?a.join(","):"",p=u.length?u.join(","):"",l={url:this.apiUrl+"/"+n+"/"+i+"/users/"+s+"/notification?user="+c+"&group="+p,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call getSilentModeForConversations:",e),Y.ajax(l)}function yn(e){if("string"!=typeof e.language||!e.language)throw Error('Invalid parameter: "language"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={translationLanguage:e.language},o=this.context,n=o.accessToken,i=o.orgName,s=o.appName,a=o.userId,u={url:this.apiUrl+"/"+i+"/"+s+"/users/"+a+"/notification/language",type:"PUT",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:e.success,error:e.error};return ce.debug("Call setPushPerformLanguage:",e),Y.ajax(u)}function Tn(e){if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,s=r.userId,a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+s+"/notification/language",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return ce.debug("Call getPushPerformLanguage:",e),Y.ajax(a)}var _n=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((o=o.apply(e,t||[])).next())}))},vn=function(e,t){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){s.label=i[1];break}if(6===i[0]&&s.label<n[1]){s.label=n[1],n=i;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(i);break}n[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};function On(e){if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: "+e.name);if("string"!=typeof e.messageId||""===e.messageId)throw Error("Invalid parameter messageId: "+e.messageId);if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: "+e.parentId);if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=r.jid,a={name:e.name,msg_id:e.messageId,group_id:e.parentId,owner:this.user},u={url:this.apiUrl+"/"+o+"/"+n+"/thread?resource="+s.clientResource,type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return Y.ajax(u).then((function(e){var t=e.data.thread_id;return e.data={chatThreadId:t},e}))}function Rn(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: "+e.chatThreadId);if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=r.jid,a={url:this.apiUrl+"/"+o+"/"+n+"/thread/"+e.chatThreadId+"/user/"+this.user+"/join?resource="+s.clientResource,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return Y.ajax(a).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 In(e){return _n(this,void 0,void 0,(function(){var t,r,o,n,i,s,a;return vn(this,(function(u){switch(u.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: "+e.chatThreadId);return yt.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=r.jid,a={url:this.apiUrl+"/"+o+"/"+n+"/thread/"+e.chatThreadId+"/user/"+this.user+"/quit?resource="+s.clientResource,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,Y.ajax(a)]):(t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return u.sent(),[2]}}))}))}function Sn(e){return _n(this,void 0,void 0,(function(){var t,r,o,n,i,s,a;return vn(this,(function(u){switch(u.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: "+e.chatThreadId);return yt.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=r.jid,a={url:this.apiUrl+"/"+o+"/"+n+"/thread/"+e.chatThreadId+"?resource="+s.clientResource,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,Y.ajax(a)]):(t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return u.sent(),[2]}}))}))}function Nn(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: "+e.chatThreadId);if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: "+e.name);if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=r.jid,a={name:e.name},u={url:this.apiUrl+"/"+o+"/"+n+"/thread/"+e.chatThreadId+"?resource="+s.clientResource,type:"PUT",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return Y.ajax(u)}function Cn(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: "+e.chatThreadId);if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={limit:e.pageSize||20,cursor:e.cursor||""},a={url:this.apiUrl+"/"+o+"/"+n+"/thread/"+e.chatThreadId+"/users",type:"GET",dataType:"json",data:s,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return Y.ajax(a)}function An(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: "+e.chatThreadId);if("string"!=typeof e.username||""===e.username)throw Error("Invalid parameter username: "+e.username);if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=r.jid,a={url:this.apiUrl+"/"+o+"/"+n+"/thread/"+e.chatThreadId+"/users/"+e.username+"?resource="+s.clientResource,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return Y.ajax(a)}function Mn(e){if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={limit:e.pageSize||20,cursor:e.cursor||""},a={url:e.parentId?this.apiUrl+"/"+o+"/"+n+"/threads/chatgroups/"+e.parentId+"/user/"+this.user:this.apiUrl+"/"+o+"/"+n+"/threads/user/"+this.user,type:"GET",dataType:"json",data:s,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return Y.ajax(a).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 bn(e){if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: "+e.parentId);if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={cursor:e.cursor||"",limit:e.pageSize||20},a={url:this.apiUrl+"/"+o+"/"+n+"/threads/chatgroups/"+e.parentId,type:"GET",dataType:"json",data:s,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return Y.ajax(a).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 Un(e){if(!Array.isArray(e.chatThreadIds))throw Error("Invalid parameter chatThreadIds: "+e.chatThreadIds);if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={threadIds:e.chatThreadIds},a={url:this.apiUrl+"/"+o+"/"+n+"/thread/message",type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return Y.ajax(a).then((function(e){return function(e){var t=e.entities;return null==t||t.forEach((function(e){e.chatThreadId=e.thread_id,e.last_message&&"{}"!==JSON.stringify(e.last_message)?e.lastMessage=le(e.last_message):e.lastMessage=e.last_message,delete e.thread_id,delete e.last_message})),e}(e)}))}function wn(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: "+e.chatThreadId);if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/thread/"+e.chatThreadId,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return Y.ajax(s).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}))}function kn(){if(!yt.call(this)){var e=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(e)}var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i={url:this.apiUrl+"/"+r+"/"+o+"/users/"+this.user+"/translate/support/language",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+n}};return ce.debug("Call getSupportedLanguages"),Y.ajax(i)}function Pn(e){if("string"!=typeof e.text||""===e.text)throw Error('Invalid parameter: "text"');if(!Array.isArray(e.languages))throw Error('Invalid parameter: "language"');if(!yt.call(this)){var t=f.create({type:g.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/translate",a={text:e.text,to:e.languages},u={url:s,dataType:"json",type:"POST",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i}};return ce.debug("Call translateMessage"),Y.ajax(u)}var Ln=function(){return Ln=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Ln.apply(this,arguments)},xn=Y.getEnvInfo(),Dn="web"===xn.platform,Gn=function(){};function Bn(e,t){var r=this,o=t.rpt,n=t.isRetry,i=e.promise,s=this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users",a={requestName:_.RESISTER,requestUrl:s},u=e.error||Gn;if(!this.orgName&&!this.appName){var c=f.create({type:g.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"signup error"});u(c)}var p={headers:{"Content-type":"application/json"},url:s,dataType:"json",data:JSON.stringify({username:e.username,password:e.password,nickname:e.nickname||""}),success:function(t){e.success&&e.success(t);var r=Ln(Ln({},t),{type:g.REQUEST_SUCCESS});i.resolve&&i.resolve(r);var s=t.extraInfo,u=s.httpCode,c=s.elapse;o({isEndApi:!0,isRetry:n,data:Ln(Ln({},{requestElapse:c,isSuccess:1,code:u}),a)})},error:function(t){var s=t.extraInfo,c=s.elapse,p=s.httpCode,l=s.errDesc;return o({isRetry:n,data:Ln(Ln({},{requestElapse:c,isSuccess:0,code:p,codeDesc:l}),a)}),r.isHttpDNS&&r.restIndex+1<r.restTotal?(r.restIndex++,zn.call(r,"signup"),Bn.call(r,e,{rpt:o,isRetry:n}),Promise.reject(t)):(o({data:{isLastApi:1,isSuccess:0}}),r.clear(),i.reject&&i.reject(t),u(t))}};return Y.ajax(p).catch((function(e){i.reject&&i.reject(e)}))}function jn(e,t){var r=this;if(qn.call(this,e)&&!this.isOpened()){var o=t.rpt,n=t.isRetry;Kn.call(this,e),this.user=e.user;var i=e.promise,s=this.context.appName,a=this.context.orgName,u=this.apiUrl+"/"+a+"/"+s+"/token";if(e.agoraToken)this.grantType="agoraToken",this.getChatToken(e.agoraToken).then((function(t){ce.info("getChatToken result:",t),r.expirationTime=t.expire_timestamp,r.token=t.access_token,r.context.accessToken=t.access_token,r.context.restTokenData=t.access_token;var n=t.extraInfo,s=n.httpCode,a=n.elapse;i.resolve({accessToken:t.access_token,expireTimestamp:t.expire_timestamp}),Wn.call(r,Ln(Ln({},e),{access_token:t.access_token}),o);var c={requestName:_.LOGIN_BY_AGORA_TOKEN,requestUrl:u,requestElapse:a,isSuccess:1,code:s};o({data:c})})).catch((function(e){var t,n=f.create({type:g.WEBIM_CONNCTION_GETROSTER_ERROR,message:"get chat token fail",data:e});i.reject(n),r.onError&&r.onError(n),null===(t=r.eventHandler)||void 0===t||t.dispatch("onError",n);var s=e.extraInfo,a=s.elapse,c=s.httpCode,p=s.errDesc,l={requestName:_.LOGIN_BY_AGORA_TOKEN,requestUrl:u,requestElapse:a,isSuccess:0,code:c,codeDesc:p};o({data:l}),o({data:{isLastApi:1,isSuccess:0}})}));else if(e.accessToken)this.grantType="accessToken",this.token=e.accessToken,this.context.accessToken=e.accessToken,this.context.restTokenData=e.accessToken,i.resolve({accessToken:e.accessToken}),Wn.call(this,e,o);else{this.grantType="password";var c={grant_type:"password",username:e.user,password:e.pwd,timestamp:+new Date},p=JSON.stringify(c),l={headers:{"Content-type":"application/json"},url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/token",dataType:"json",data:p,success:function(t){"function"==typeof e.success&&e.success(t),r.token=t.access_token,r.context.restTokenData=t.access_token,r.context.accessToken=t.access_token,i.resolve({accessToken:t.access_token,duration:t.expires_in});var s=t.extraInfo,a=s.httpCode,c=s.elapse,p={requestName:_.LOGIN_BY_PWD,requestElapse:c,requestUrl:u,isSuccess:1,code:a};o({isRetry:n,data:p}),Wn.call(r,t,o)}||Gn,error:function(t){var s,a=t.extraInfo,c=a.elapse,p=a.httpCode,l=a.errDesc,d={requestName:_.LOGIN_BY_PWD,requestElapse:c,requestUrl:u,isSuccess:0,code:p,codeDesc:l};if(o({isRetry:n,data:d}),r.isHttpDNS&&r.restIndex+1<r.restTotal)return r.restIndex++,zn.call(r,"login"),void jn.call(r,e,{rpt:o,isRetry:!0});o({data:{isLastApi:1,isSuccess:0}}),r.clear(),t.error&&t.error_description?(s=f.create({type:g.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,message:t.error_description,data:t}),r.onError&&r.onError(s)):(s=f.create({type:g.WEBIM_CONNCTION_OPEN_ERROR,message:t.error_description,data:t}),r.onError&&r.onError(s)),"function"==typeof e.error&&e.error(s),i.reject(s)}||Gn,version:"4.0.4"};Y.ajax(l).catch((function(e){console.warn(e)}))}Y.listenNetwork(Hn.bind(this),Fn.bind(this))}}function Hn(){var e;ce.debug("online"),this.onOnline&&this.onOnline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOnline"),this.sock&&1!==this.sock.readyState&&(ce.debug("sock.readyState:",this.sock.readyState),this.reconnect())}function Fn(){var e;ce.debug("offline"),this.onOffline&&this.onOffline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOffline")}function Wn(e,t){var r=this,o=this._getSock();this.sock=o;var n=function(){var e;ce.debug("websockt onOpen"),r.logOut=!1,t&&t({data:{isLastApi:1,isSuccess:1,accessChannel:null===(e=r.socketHost[r.hostIndex])||void 0===e?void 0:e.channel}}),"zfb"!==xn.platform&&"dd"!==xn.platform||(r.sock.readyState=1);var n=Y.flow([r.mSync.generateProvision,r.mSync.base64transform])();try{o.send(n)}catch(e){var i=f.create({type:g.SDK_RUNTIME_ERROR,message:"send message error",data:e});r.onError&&r.onError(i)}},i=function(){var e,t;if(ce.debug("websockt onClose"),"zfb"!==xn.platform&&"dd"!==xn.platform||(r.sock.readyState=3),!r.logOut&&r.autoReconnectNumTotal<r.autoReconnectNumMax){r.reconnect();var o={type:g.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};r.onError&&r.onError(o)}else r.logOut?(r.clear(),r.onClosed&&r.onClosed(),null===(e=r.eventHandler)||void 0===e||e.dispatch("onDisconnected"),r.mSync.stopHeartBeat(),r.autoReconnectInterval=0,r.times=1,r.autoReconnectNumTotal=0,r.hostIndex=0):(o={type:g.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"},r.onError&&r.onError(o),r.onClosed&&r.onClosed(),null===(t=r.eventHandler)||void 0===t||t.dispatch("onDisconnected"),r.mSync.stopHeartBeat(),ce.debug("reconnect fail"),r.autoReconnectInterval=0,r.times=1,r.autoReconnectNumTotal=0,r.hostIndex=0)},s=function(e){var t=r.mSync,o=t.decodeMSync,n=t.distributeMSync;Y.flow([o,n])(e)};"web"===xn.platform?(o.onopen=n,o.onclose=i,o.onmessage=s):(o.onOpen(n),o.onMessage(s),o.onClose(i),o.onError((function(e){var o;ce.debug("小程序 sock on error",e),r.isOnCloseReconnet=!1,r.onError&&r.onError({type:g.WEBIM_CONNECTION_ERROR,message:"on socket error",data:e}),!r.logOut&&r.autoReconnectNumTotal<r.autoReconnectNumMax&&(ce.debug("----- sock.onError reconnect -----",r.autoReconnectNumTotal,r.autoReconnectNumMax),r.reconnect()),t&&t({data:{isLastApi:1,isSuccess:0,accessChannel:null===(o=r.socketHost[r.hostIndex])||void 0===o?void 0:o.channel}})})))}function qn(e){if(""===e.user){var t=f.create({type:g.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR,message:"the user cannot be empty"});return this.onError&&this.onError(t),!1}var r=this.appKey.split("#");return!(2!==r.length||!r[0]||!r[1])||(t=f.create({type:g.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"the appKey is illegal"}),this.onError&&this.onError(t),!1)}function Kn(e){this.context.jid={appKey:this.appKey,name:e.user,domain:this.domain,clientResource:this.clientResource};var t=this.appKey.split("#"),r=t[0],o=t[1];this.context.root=this.root,this.context.userId=e.user,this.context.appKey=this.appKey,this.context.appName=o,this.context.orgName=r}function Vn(e,t,r){var o=this,n=r.rpt,i=r.isRetry,s=this.dnsArr[this.dnsIndex]+"/easemob/server.json",a={url:s,dataType:"json",type:"GET",data:{app_key:encodeURIComponent(this.appKey)},success:function(r){var a=r.extraInfo,u=a.elapse,c=a.httpCode,p={requestUrl:s,requestName:_.GET_DNS,requestElapse:u,isSuccess:1,code:c};"true"===(null==r?void 0:r.enableDataReport)?(null==H||H.getInstance().setIsCollectDt(!0),null==H||H.getInstance().setIsReportDt(!0)):(null==H||H.getInstance().setIsReportDt(!1),null==H||H.getInstance().setIsCollectDt(!1)),n({isRetry:i,data:p});var l=r.rest.hosts,d=o.https?"https":"http";if(ce.info("httpType: "+d),!l)return Promise.reject(!1);for(var h=l.filter((function(e){if(e.protocol===d)return e})),f=0;f<h.length;f++)if(h[f].protocol===d){var m=h[f];h.splice(f,1),h.unshift(m)}o.restHosts=h,o.restTotal=h.length;var g=r["msync-ws"].hosts;if(!g)return Promise.reject(!1);var E=g.filter((function(e){return e.protocol===d&&e}));o.socketHost=E,o.hostTotal=E.length,zn.call(o,e),"login"===e?jn.call(o,t,{rpt:n}):Bn.call(o,t,{rpt:n})}||Gn,error:function(r){var a=r.extraInfo,u=a.elapse,c=a.httpCode,p=a.errDesc,l={requestUrl:s,requestName:_.GET_DNS,isSuccess:0,code:c,codeDesc:p,requestElapse:u};n({isRetry:i,data:l}),ce.debug("getHttpDNS fail: "+o.dnsIndex),o.dnsIndex++,o.dnsIndex<o.dnsTotal&&Vn.call(o,e,t,{rpt:n,isRetry:!0})}||Gn};return Y.ajax(a).catch((function(e){console.warn(e)}))}function zn(e){var t,r;if(this.restIndex>this.restTotal)return"";var o="",n=this.restHosts[this.restIndex],i=n.domain,s=n.ip,a=n.port,u=this.https?"https:":"http:";return s&&"undefined"!=typeof window&&"http:"===(null===(t=null===window||void 0===window?void 0:window.location)||void 0===t?void 0:t.protocol)?o=u+"//"+s+":"+a:(o=u+"//"+i,a&&"80"!==a&&"443"!==a&&(o+=":"+a),"undefined"==typeof window||window.location||(o="https://"+i),"undefined"!=typeof window&&window.location&&"file:"===(null===(r=window.location)||void 0===r?void 0:r.protocol)&&(o="https://"+i)),"undefined"==typeof window&&(o=u+"//"+i),this.apiUrl=o,o}const Jn=function(){function r(o){var c;this.isDebug=o.isDebug||!1,this.isReport=!1,this.isHttpDNS=void 0===o.isHttpDNS?Dn:o.isHttpDNS,this.heartBeatWait=o.heartBeatWait||3e4,this.autoReconnectNumMax=o.autoReconnectNumMax||5,this.delivery=o.delivery||!1,this.dnsArr=["https://rs.easemob.com","http://59.110.89.59","http://39.97.193.190","http://39.97.193.187"],this.dnsIndex=0,this.dnsTotal=this.dnsArr.length,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.appKey=o.appKey,this.appName="",this.orgName="",this.token="",this.grantType="",this.apiUrl=o.apiUrl||"",this.url=o.url||"",this.https=o.https||"undefined"!=typeof window&&"https:"===(null===(c=window.location)||void 0===c?void 0:c.protocol),this.version="4.0.4",this.deviceId=o.deviceId||"webim",this.osType=16,this.useOwnUploadFun=o.useOwnUploadFun||!1,this.compressType=[0],this.encryptType=[0],this.clientResource="",this.expiresIn=0,this.expirationTime=0,this.logOut=!0,this.context={jid:{appKey:"",clientResource:"",domain:"easemob.com",name:""},userId:"",appKey:"",status:0,restTokenData:"",appName:"",orgName:"",root:{},accessToken:""},this._msgHash={},this._msgPromiseHash={},this._queues=[],this._load_msg_cache=[],this.unSendMsgArr=[],this.mr_cache={};var p=this.appKey.split("#");if(2!==p.length&&p[0]&&p[1])throw Error("Illegal appkey: "+this.appKey);this.orgName=p[0],this.appName=p[1],this.listen=mt.bind(this),this.mSync=this.usePlugin(lt),this.eventHandler=this.usePlugin(ht),Object.assign(r.prototype,e),Object.assign(r.prototype,t),Object.assign(r.prototype,n),Object.assign(r.prototype,i),Object.assign(r.prototype,s),Object.assign(r.prototype,a),Object.assign(r.prototype,u),new H({appkey:this.appKey,org:this.orgName,sdkVersion:this.version,deviceId:this.deviceId,isReport:this.isReport})}return r.prototype.usePlugin=function(e,t){if(!t)return new e(this);this[t]=new e(this)},r.prototype.listen=function(e){},r.prototype.addEventHandler=function(e,t){},r.prototype.removeEventHandler=function(e){},r.prototype.registerUser=function(e){var t=this;return new Promise((function(r,o){var n,i=null===(n=H.getInstance())||void 0===n?void 0:n.geOperateFun({uid:e.username,operationName:T.REGISTER});if(t.isHttpDNS){t.dnsIndex=0;var s=Ln(Ln({},e),{user:e.username,pwd:e.password,promise:{resolve:r,reject:o}});Vn.call(t,"signup",s,{rpt:i})}else s=Ln(Ln({},e),{promise:{resolve:r,reject:o}}),Bn.call(t,s,{rpt:i})}))},r.prototype.open=function(e){var t=this;return ce.debug("open"),new Promise((function(r,o){if(qn.call(t,e)){e.accessToken&&(t.token=e.accessToken);var n=Ln(Ln({},e),{promise:{resolve:r,reject:o}}),i=H.getInstance().geOperateFun({uid:e.user,operationName:T.LOGIN});t.isHttpDNS?Vn.call(t,"login",n,{rpt:i}):jn.call(t,n,{rpt:i})}}))},r.prototype.isOpened=function(){return this.sock&&1===this.sock.readyState||!1},r.prototype.close=function(){this.logOut=!0,this.context.status=g.STATUS_CLOSING,this.sock&&this.sock.close(),this.stopHeartBeat(),this.context.status=g.STATUS_CLOSED,this._load_msg_cache=[],this.unSendMsgArr=[],this._queues=[],this._msgHash={},this.mr_cache={}},r.prototype.stopHeartBeat=function(){clearInterval(this.heartBeatID)},r.prototype._checkOpenParams=function(e){return qn.call(this,e)},r.prototype.clear=function(){this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.hostTotal=0},r.prototype.heartBeat=function(){},r.prototype.renewToken=function(e){var t=this;return this.isOpened()?this.getChatToken(e).then((function(e){var r=Date.now();return t.expirationTime=e.expire_timestamp,t.expiresIn=e.expire_timestamp-r,t.token=e.access_token,t.context.accessToken=e.access_token,t.clearTokenTimeout(),t.tokenExpireTimeCountDown(t.expiresIn),{status:!0,token:e.access_token,expire:e.expire_timestamp}})):Promise.reject({status:!1})},r.prototype.clearTokenTimeout=function(){ce.debug("clearTokenTimeout"),this.tokenWillExpireTimer&&clearTimeout(this.tokenWillExpireTimer),this.tokenExpiredTimer&&clearTimeout(this.tokenExpiredTimer)},r.prototype.tokenExpireTimeCountDown=function(e){var t=this;this.tokenWillExpireTimer=setTimeout((function(){var e;t.onTokenWillexpire&&t.onTokenWillexpire(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenWillExpire"),ce.info("onTokenWillExpire")}),e/2),this.tokenExpiredTimer=setTimeout((function(){var e;ce.info("onTokenExpired"),t.onTokenExpired&&t.onTokenExpired(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),t.close()}),e)},r.prototype.compareTokenExpireTime=function(e,t){var r,o=Number(t)-Number(e);ce.debug("compareTokenExpireTime",o),o<=this.expiresIn/2&&o>0?(this.onTokenWillExpire&&this.onTokenWillExpire(),null===(r=this.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),ce.info("onTokenWillExpire")):o<=0&&(this.closeByTokenExpired(),ce.info("closeByTokenExpired"))},r.prototype.closeByTokenExpired=function(){var e;ce.info("closed By TokenExpired"),this.onTokenExpired&&this.onTokenExpired(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),this.close()},r.prototype.reconnect=function(){var e=this;ce.info("reconnect: time",this.times),ce.info("reconnect sock.readyState: ",this.sock.readyState),0!==this.sock.readyState&&1!==this.sock.readyState&&(this.isHttpDNS&&(this.hostIndex,this.socketHost.length),this.hostIndex++,this.hostIndex>=this.socketHost.length-1&&(this.hostIndex=this.socketHost.length-1),setTimeout((function(){ce.info("login sock.readyState: ",e.sock.readyState),e.sock.close(),1!==e.sock.readyState&&(Wn.call(e,{access_token:e.context.accessToken}),e.autoReconnectInterval+=e.times*e.times,e.times++)}),500*this.times),this.autoReconnectNumTotal++)},r.prototype.send=function(e){return Promise.resolve(null)},r.max_cache_length=100,r._getSock=function(){},r}();var Xn=Y.getEnvInfo(),Yn=Xn.global;l.util.Long=h(),l.configure();var Qn=l.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}},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}},nested:{Type:{values:{TEXT:0,IMAGE:1,VIDEO:2,LOCATION:3,VOICE:4,FILE:5,COMMAND:6,CUSTOM:7}},Size:{fields:{width:{type:"double",id:1},height:{type:"double",id:2}}}}},Type:{values:{NORMAL:0,CHAT:1,GROUPCHAT:2,CHATROOM:3,READ_ACK:4,DELIVER_ACK:5,RECALL:6,CHANNEL_ACK:7}},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:{type:"KeyValue",id:8},meta:{type:"bytes",id:9}},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}}}},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}},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}},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}},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}},nested:{ErrorCode:{values:{OK:0,PERMISSION_DENIED:1,WRONG_PARAMETER:2,MUC_NOT_EXIST:3,USER_NOT_EXIST:4,UNKNOWN:5}}}}}},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}},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}}}}}}}}}});Jn.prototype.root=Qn;var $n=function(e){this.onOpen=Yn.onSocketOpen,this.onClose=Yn.onSocketClose,this.onMessage=Yn.onSocketMessage,this.onError=Yn.onSocketError,this.close=Yn.closeSocket,this.send=Yn.sendSocketMessage,this.connectSocket=Yn.connectSocket,this.readyState=0,this.connect=function(){Yn.connectSocket({url:e.url,header:{"content-type":"application/json"},success:function(e){},fail:function(){}})}};Jn.prototype._getSock=function(){var e;return this.sock&&this.sock.close&&this.sock.close(),(e="zfb"===Xn.platform||"dd"===Xn.platform?new $n(this):Yn.connectSocket({url:this.url,header:{"content-type":"application/json"},success:function(e){},fail:function(e){e.errMsg.indexOf("suspend")},complete:function(){}})).connect&&e.connect(),e},Jn.prototype.getUniqueId=Y.getUniqueId,Jn.prototype.deviceId="miniProgram_"+Xn.platform;var Zn=ce.getLogger("IM-SDK-LOG");Zn.setConfig({useCache:!1,maxCache:3145728}),Zn.enableAll(),Y.ajax=Y.wxRequest;const ei={connection:Jn,message:Re,utils:Y,logger:ie,statusCode:g}})(),o})()}));
- //# sourceMappingURL=Easemob-chat.js.map
|