zego-zim-web
Version:
ZEGO ZIM SDK for Web
1 lines • 1.03 MB
JavaScript
((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r,s=t();for(r in s)("object"==typeof exports?exports:e)[r]=s[r]}})("undefined"!=typeof self?self:this,(function(){return(e=>{var t={};function r(s){var n;return(t[s]||(n=t[s]={i:s,l:!1,exports:{}},e[s].call(n.exports,n,n.exports,r),n.l=!0,n)).exports}return r.m=e,r.c=t,r.d=function(e,t,s){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(s,n,function(t){return e[t]}.bind(null,n));return s},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=20)})([function(e,t,r){var s=r(12),n=(r.d(t,"c",(function(){return s.a})),r(27)),i=(r.d(t,"a",(function(){return n.a})),r.d(t,"b",(function(){return n.b})),r.d(t,"f",(function(){return n.c})),r.d(t,"i",(function(){return n.d})),r.d(t,"j",(function(){return n.e})),r.d(t,"n",(function(){return n.f})),r.d(t,"o",(function(){return n.g})),r.d(t,"p",(function(){return n.h})),r.d(t,"q",(function(){return n.i})),r.d(t,"r",(function(){return n.j})),r.d(t,"s",(function(){return n.k})),r.d(t,"t",(function(){return n.l})),r.d(t,"w",(function(){return n.m})),r.d(t,"x",(function(){return n.n})),r.d(t,"y",(function(){return n.o})),r.d(t,"z",(function(){return n.p})),r(28)),o=(r.d(t,"d",(function(){return i.a})),r.d(t,"e",(function(){return i.b})),r.d(t,"g",(function(){return i.c})),r(29)),a=(r.d(t,"h",(function(){return o.a})),r.d(t,"m",(function(){return o.b})),r(30)),u=(r.d(t,"k",(function(){return a.a})),r.d(t,"l",(function(){return a.b})),r(31));r.d(t,"u",(function(){return u.a})),r.d(t,"v",(function(){return u.b}))},function(e,t,r){var s=r(25),n=(r.d(t,"o",(function(){return s.a})),r.d(t,"q",(function(){return s.b})),r.d(t,"r",(function(){return s.c})),r(15)),i=(r.d(t,"m",(function(){return n.a})),r.d(t,"y",(function(){return n.b})),r(26));r.d(t,"a",(function(){return i.a})),r.d(t,"b",(function(){return i.b})),r.d(t,"c",(function(){return i.c})),r.d(t,"d",(function(){return i.d})),r.d(t,"e",(function(){return i.e})),r.d(t,"f",(function(){return i.f})),r.d(t,"g",(function(){return i.g})),r.d(t,"h",(function(){return i.h})),r.d(t,"i",(function(){return i.i})),r.d(t,"j",(function(){return i.j})),r.d(t,"k",(function(){return i.k})),r.d(t,"l",(function(){return i.l})),r.d(t,"n",(function(){return i.m})),r.d(t,"p",(function(){return i.n})),r.d(t,"s",(function(){return i.o})),r.d(t,"t",(function(){return i.p})),r.d(t,"u",(function(){return i.q})),r.d(t,"v",(function(){return i.r})),r.d(t,"w",(function(){return i.s})),r.d(t,"x",(function(){return i.t}))},function(e,t,r){r.d(t,"a",(function(){return p}));var s=r(54),n=r(62),i=r(79),o=r(81),a=r(89),u=r(93),c=r(0),l=c.v.MGR,p=(d.getInstance=function(){return this.instance||(this.instance=new d)},d.prototype.getVersion=function(){return"2.21.0"},d.prototype.createEngine=function(e){var t={appID:e,version:"2.21.0 7/15 16:01"},r=this.handle;return this.enginMap.get(r)?(t.msg="had created",this.lg.i(l,c.u.Create,t),null):(e=new n.a(r,e),this.enginMap.set(r,e),this.lg.i(l,c.u.Create,t),e)},d.prototype.destroyEngine=function(e){this.lg.i(l,c.u.Destroy),e&&(this.enginMap.delete(e.econf.handle),e.destroy())},d.prototype.setLogConfig=function(e){this.lg.i(l,c.u.SetLogConfig,e),this.lg.setLogConfig(Object.assign({logLevel:"info"},e))},d.prototype.setAdvancedConfig=function(e,t){this.st.advancedConfig[e]=t},d.prototype.setGeofencingConfig=function(e,t){var r,s,n=this;return(t==c.c.GeofencingType.Include||t==c.c.GeofencingType.Exclude)&&e&&0<e.length&&e.every((function(e){return 2<=e&&e<=7}))?(e=e.map((function(e){return 0|e})),this.st.advancedConfig.geoFence.type=t,this.st.advancedConfig.geoFence.areas=e,t==c.c.GeofencingType.Include?(s=1<e.length?(Math.random()*e.length|0)%e.length:0,this.st.setHost(e[s])):((r=new Set(Object.keys(this.st.advancedConfig.geoFence.hostMap).map((function(e){return+e})))).delete(1),e.forEach((function(e){r.delete(e),n.st.advancedConfig.geoFence.hostMap[e].relatives.forEach((function(e){return r.delete(e)}))})),s=1<(e=Array.from(r)).length?(Math.random()*e.length|0)%e.length:0,this.st.setHost(e[s]||1)),this.lg.i(l,c.u.SetGeoFence,this.st.advancedConfig.geoFence),1!=this.st.advancedConfig.geoFence.id):(this.lg.i(l,c.u.SetGeoFence,{type:t,areas:e}),!1)},d);function d(){if(this.handle=Symbol(),this.enginMap=new Map,d.instance)return d.instance;this.lg=new a.a(this.getVersion()),this.st=new u.a(this.getVersion()),this.dr=new o.a(this.lg,this.st,this.getVersion()),this.crypto=new s.a,this.pb=new i.a(this.crypto,this.st),d.instance=this}},function(e,t,r){r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return i})),r.d(t,"g",(function(){return o})),r.d(t,"d",(function(){return a})),r.d(t,"f",(function(){return c})),r.d(t,"e",(function(){return l})),r.d(t,"c",(function(){return h}));var s,n={importantLevel:0,reportSize:2e3,reportNum:20,bps:16e3,netTimeout:3},i={totalAvailCache:102400,cacheMaxSize:2e4,cacheDelPer:.2},o=(s=1,function(){return s++}),a=(u.prototype.isEmpty=function(){return 0==this.items.length},u.prototype.enqueue=function(e){this.items.push(e)},u.prototype.dequeue=function(){return this.items.shift()},u.prototype.front=function(){return this.isEmpty()?"No elements in Queue":this.items[0]},u.prototype.size=function(){return this.items.length},u.prototype.clear=function(){this.items=[]},u);function u(){this.items=[],this.items=[]}var c={TIMEOUT:{code:100001,msg:"network timeout"},DATAEXIST:{code:100002,msg:"data exist"}},l=-1,p=(Object.defineProperty(d.prototype,"id",{get:function(){return this._id||null},set:function(e){this._id=e},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e},enumerable:!1,configurable:!0}),d.prototype.hasNext=function(){return this.next&&this.next.id},d.prototype.hasPrev=function(){return this.prev&&this.prev.id},d);function d(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this.next=null,this.prev=null,this._id=e,this._data=t}f.prototype.insertBefore=function(e,t){return(t=new p(this._idCounter,t)).next=e,t.prev=e.prev,e.prev&&(e.prev.next=t),e.prev=t,++this._idCounter,++this._numNodes,t},f.prototype.addLast=function(e){return this.insertBefore(this.end,e)},f.prototype.add=function(e){return this.addLast(e)},f.prototype.getFirst=function(){return 0===this._numNodes?null:this.start.next},f.prototype.getLast=function(){return 0===this._numNodes?null:this.end.prev},f.prototype.size=function(){return this._numNodes},f.prototype.getFromFirst=function(e){var t=0,r=this.start.next;if(0<=e)for(;t<e&&null!==r;)r=r.next,++t;else r=null;if(null===r)throw"Index out of bounds.";return r},f.prototype.get=function(e){return 0===e?this.getFirst():e===this._numNodes-1?this.getLast():this.getFromFirst(e)},f.prototype.remove=function(e){return e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),--this._numNodes,e},f.prototype.removeFirst=function(){var e=null;return 0<this._numNodes&&this.start.next?this.remove(this.start.next):e},f.prototype.removeLast=function(){var e=null;return 0<this._numNodes&&this.end.prev?this.remove(this.end.prev):e},f.prototype.removeAll=function(){this.start.next=this.end,this.end.prev=this.start,this._numNodes=0,this._idCounter=0},f.prototype.each=function(e){for(var t=this.start;t.hasNext();)e(t=t.next)},f.prototype.find=function(e){for(var t=this.start,r=!1,s=null;t.hasNext()&&!r;)e(t=t.next)&&(s=t,r=!0);return s},f.prototype.map=function(e){for(var t=this.start,r=[];t.hasNext();)e(t=t.next)&&r.push(t);return r},f.prototype.push=function(e){return this.addLast(e)},f.prototype.unshift=function(e){0<this._numNodes?this.insertBefore(this.start.next,e):this.insertBefore(this.end,e)},f.prototype.pop=function(){return this.removeLast()},f.prototype.shift=function(){return this.removeFirst()};var h=f;function f(){this.start=new p,this.end=new p,this._idCounter=0,this._numNodes=0,this.start.next=this.end,this.start.prev=null,this.end.prev=this.start,this.end.next=null}},function(e,t){e.exports=s;var r=null;try{r=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 s(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}Object.defineProperty(s.prototype,"__isLong__",{value:!0}),s.isLong=n;var i={},o={};function a(e,t){var r,s,n;return t?(n=0<=(e>>>=0)&&e<256)&&(s=o[e])?s:(r=c(e,(0|e)<0?-1:0,!0),n&&(o[e]=r),r):(n=-128<=(e|=0)&&e<128)&&(s=i[e])?s:(r=c(e,e<0?-1:0,!1),n&&(i[e]=r),r)}function u(e,t){if(isNaN(e))return t?v:_;if(t){if(e<0)return v;if(f<=e)return k}else{if(e<=-g)return I;if(g<=e+1)return S}return e<0?u(-e,t).neg():c(e%h|0,e/h|0,t)}function c(e,t,r){return new s(e,t,r)}s.fromInt=a,s.fromNumber=u,s.fromBits=c;var l=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 _;if(t="number"==typeof t?(r=t,!1):!!t,(r=r||10)<2||36<r)throw RangeError("radix");var s;if(0<(s=e.indexOf("-")))throw Error("interior hyphen");if(0===s)return p(e.substring(1),t,r).neg();for(var n=u(l(r,8)),i=_,o=0;o<e.length;o+=8){var a=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+a),r);i=(a<8?(a=u(l(r,a)),i.mul(a)):i=i.mul(n)).add(u(c))}return i.unsigned=t,i}function d(e,t){return"number"==typeof e?u(e,t):"string"==typeof e?p(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}s.fromString=p,s.fromValue=d;var h=4294967296,f=h*h,g=f/2,m=a(1<<24),_=a(0),v=(s.ZERO=_,a(0,!0)),b=(s.UZERO=v,a(1)),y=(s.ONE=b,a(1,!0)),M=(s.UONE=y,a(-1)),S=(s.NEG_ONE=M,c(-1,2147483647,!1)),k=(s.MAX_VALUE=S,c(-1,-1,!0)),I=(s.MAX_UNSIGNED_VALUE=k,c(0,-2147483648,!1));(e=(s.MIN_VALUE=I,s.prototype)).toInt=function(){return this.unsigned?this.low>>>0:this.low},e.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},e.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";var t,r;if(this.isNegative())return this.eq(I)?(r=u(e),r=(t=this.div(r)).mul(r).sub(this),t.toString(e)+r.toInt().toString(e)):"-"+this.neg().toString(e);for(var s=u(l(e,6),this.unsigned),n=this,i="";;){var o=n.div(s),a=(n.sub(o.mul(s)).toInt()>>>0).toString(e);if((n=o).isZero())return a+i;for(;a.length<6;)a="0"+a;i=""+a+i}},e.getHighBits=function(){return this.high},e.getHighBitsUnsigned=function(){return this.high>>>0},e.getLowBits=function(){return this.low},e.getLowBitsUnsigned=function(){return this.low>>>0},e.getNumBitsAbs=function(){if(this.isNegative())return this.eq(I)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;0<t&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},e.isZero=function(){return 0===this.high&&0===this.low},e.eqz=e.isZero,e.isNegative=function(){return!this.unsigned&&this.high<0},e.isPositive=function(){return this.unsigned||0<=this.high},e.isOdd=function(){return 1==(1&this.low)},e.isEven=function(){return 0==(1&this.low)},e.equals=function(e){return n(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},e.eq=e.equals,e.notEquals=function(e){return!this.eq(e)},e.neq=e.notEquals,e.ne=e.notEquals,e.lessThan=function(e){return this.comp(e)<0},e.lt=e.lessThan,e.lessThanOrEqual=function(e){return this.comp(e)<=0},e.lte=e.lessThanOrEqual,e.le=e.lessThanOrEqual,e.greaterThan=function(e){return 0<this.comp(e)},e.gt=e.greaterThan,e.greaterThanOrEqual=function(e){return 0<=this.comp(e)},e.gte=e.greaterThanOrEqual,e.ge=e.greaterThanOrEqual,e.compare=function(e){var t,r;return n(e)||(e=d(e)),this.eq(e)?0:(t=this.isNegative(),r=e.isNegative(),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)},e.comp=e.compare,e.negate=function(){return!this.unsigned&&this.eq(I)?I:this.not().add(b)},e.neg=e.negate,e.add=function(e){n(e)||(e=d(e));var t=this.high>>>16,r=65535&this.high,s=this.low>>>16,i=65535&this.low,o=e.high>>>16,a=65535&e.high,u=e.low>>>16,l=0,p=0,h=0,f=0;return p+=(h=h+((f+=i+(65535&e.low))>>>16)+(s+u))>>>16,c((h&=65535)<<16|(f&=65535),((l+=(p+=r+a)>>>16)+(t+o)&65535)<<16|(p&=65535),this.unsigned)},e.subtract=function(e){return n(e)||(e=d(e)),this.add(e.neg())},e.sub=e.subtract,e.multiply=function(e){var t,s,i,o,a,l,p,h,f,g,v;return this.isZero()?_:(n(e)||(e=d(e)),r?c(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):e.isZero()?_:this.eq(I)?e.isOdd()?I:_:e.eq(I)?this.isOdd()?I:_:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(m)&&e.lt(m)?u(this.toNumber()*e.toNumber(),this.unsigned):(t=this.high>>>16,s=65535&this.high,i=this.low>>>16,o=65535&this.low,a=e.high>>>16,l=65535&e.high,p=e.low>>>16,v=(v=g=f=h=0)+((f=f+((g+=o*(e=65535&e.low))>>>16)+i*e)>>>16)+((f=(65535&f)+o*p)>>>16),c((f&=65535)<<16|(g&=65535),(h=(h=(h+=(v+=s*e)>>>16)+((v=(65535&v)+i*p)>>>16)+((v=(65535&v)+o*l)>>>16))+(t*e+s*p+i*l+o*a)&65535)<<16|(v&=65535),this.unsigned)))},e.mul=e.multiply,e.divide=function(e){if((e=n(e)?e:d(e)).isZero())throw Error("division by zero");var t,s,i;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?v:_;if(this.unsigned){if((e=e.unsigned?e:e.toUnsigned()).gt(this))return v;if(e.gt(this.shru(1)))return y;s=v}else{if(this.eq(I))return e.eq(b)||e.eq(M)?I:e.eq(I)?b:(i=this.shr(1).div(e).shl(1)).eq(_)?e.isNegative()?b:M:(t=this.sub(e.mul(i)),i.add(t.div(e)));if(e.eq(I))return this.unsigned?v:_;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();s=_}for(t=this;t.gte(e);){i=Math.max(1,Math.floor(t.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(i)/Math.LN2),a=o<=48?1:l(2,o-48),p=u(i),h=p.mul(e);h.isNegative()||h.gt(t);)h=(p=u(i-=a,this.unsigned)).mul(e);p.isZero()&&(p=b),s=s.add(p),t=t.sub(h)}return s},e.div=e.divide,e.modulo=function(e){return n(e)||(e=d(e)),r?c((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},e.mod=e.modulo,e.rem=e.modulo,e.not=function(){return c(~this.low,~this.high,this.unsigned)},e.and=function(e){return n(e)||(e=d(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},e.or=function(e){return n(e)||(e=d(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},e.xor=function(e){return n(e)||(e=d(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},e.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},e.shl=e.shiftLeft,e.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,0<=this.high?0:-1,this.unsigned)},e.shr=e.shiftRight,e.shiftRightUnsigned=function(e){var t;return n(e)&&(e=e.toInt()),0==(e&=63)?this:(t=this.high,e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned))},e.shru=e.shiftRightUnsigned,e.shr_u=e.shiftRightUnsigned,e.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},e.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},e.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},e.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]},e.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]},s.fromBytes=function(e,t,r){return r?s.fromBytesLE(e,t):s.fromBytesBE(e,t)},s.fromBytesLE=function(e,t){return new s(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},s.fromBytesBE=function(e,t){return new s(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,r){(function(t){e.exports=(e=>{var s;if("undefined"!=typeof window&&window.crypto&&(s=window.crypto),"undefined"!=typeof self&&self.crypto&&(s=self.crypto),!(s=!(s=!(s="undefined"!=typeof globalThis&&globalThis.crypto?globalThis.crypto:s)&&"undefined"!=typeof window&&window.msCrypto?window.msCrypto:s)&&void 0!==t&&t.crypto?t.crypto:s))try{s=r(94)}catch(o){}var n=Object.create||function(e){return i.prototype=e,e=new i,i.prototype=null,e};function i(){}var o={},a=o.lib={},u=a.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=u.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||p).stringify(this)},concat:function(e){var t=this.words,r=e.words,s=this.sigBytes,n=e.sigBytes;if(this.clamp(),s%4)for(var i=0;i<n;i++){var o=r[i>>>2]>>>24-i%4*8&255;t[s+i>>>2]|=o<<24-(s+i)%4*8}else for(var a=0;a<n;a+=4)t[s+a>>>2]=r[a>>>2];return this.sigBytes+=n,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=u.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push((()=>{if(s){if("function"==typeof s.getRandomValues)try{return s.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof s.randomBytes)try{return s.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")})());return new c.init(t,e)}}),l=o.enc={},p=l.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,s=[],n=0;n<r;n++){var i=t[n>>>2]>>>24-n%4*8&255;s.push((i>>>4).toString(16)),s.push((15&i).toString(16))}return s.join("")},parse:function(e){for(var t=e.length,r=[],s=0;s<t;s+=2)r[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new c.init(r,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,s=[],n=0;n<r;n++){var i=t[n>>>2]>>>24-n%4*8&255;s.push(String.fromCharCode(i))}return s.join("")},parse:function(e){for(var t=e.length,r=[],s=0;s<t;s++)r[s>>>2]|=(255&e.charCodeAt(s))<<24-s%4*8;return new c.init(r,t)}},h=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,s=this._data,n=s.words,i=s.sigBytes,o=this.blockSize,a=i/(4*o),u=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o;t=e.min(4*u,i);if(u){for(var l=0;l<u;l+=o)this._doProcessBlock(n,l);r=n.splice(0,u),s.sigBytes-=t}return new c.init(r,t)},clone:function(){var e=u.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(a.Hasher=f.extend({cfg:u.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new g.HMAC.init(e,r).finalize(t)}}}),o.algo={});return o})(Math)}).call(this,r(11))},function(e,t,r){r.d(t,"a",(function(){return E})),r="function"==typeof Buffer;let s="function"==typeof TextDecoder?new TextDecoder:void 0,n="function"==typeof TextEncoder?new TextEncoder:void 0,i=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),o=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(i),a=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,u=String.fromCharCode.bind(String),c="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),l=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),p=e=>e.replace(/[^A-Za-z0-9\+\/]/g,"");t=e=>{let t,r,s,n,o="";var a=e.length%3;for(let a=0;a<e.length;){if(255<(r=e.charCodeAt(a++))||255<(s=e.charCodeAt(a++))||255<(n=e.charCodeAt(a++)))throw new TypeError("invalid character found");t=r<<16|s<<8|n,o+=i[t>>18&63]+i[t>>12&63]+i[t>>6&63]+i[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o};let d="function"==typeof btoa?e=>btoa(e):r?e=>Buffer.from(e,"binary").toString("base64"):t,h=r?e=>Buffer.from(e).toString("base64"):e=>{var t=[];for(let r=0,s=e.length;r<s;r+=4096)t.push(u.apply(null,e.subarray(r,r+4096)));return d(t.join(""))},f=(e,t=!1)=>t?l(h(e)):h(e),g=e=>{var t;return e.length<2?(t=e.charCodeAt(0))<128?e:t<2048?u(192|t>>>6)+u(128|63&t):u(224|t>>>12&15)+u(128|t>>>6&63)+u(128|63&t):(t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320),u(240|t>>>18&7)+u(128|t>>>12&63)+u(128|t>>>6&63)+u(128|63&t))},m=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,_=e=>e.replace(m,g),v=r?e=>Buffer.from(e,"utf8").toString("base64"):n?e=>h(n.encode(e)):e=>d(_(e)),b=(e,t=!1)=>t?l(v(e)):v(e);var y=e=>b(e,!0);let M=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return u(55296+(t>>>10))+u(56320+(1023&t));case 3:return u((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return u((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},k=e=>e.replace(M,S);var I=e=>{if(e=e.replace(/\s+/g,""),!a.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,s,n="";for(let i=0;i<e.length;)t=o[e.charAt(i++)]<<18|o[e.charAt(i++)]<<12|(r=o[e.charAt(i++)])<<6|(s=o[e.charAt(i++)]),n+=64===r?u(t>>16&255):64===s?u(t>>16&255,t>>8&255):u(t>>16&255,t>>8&255,255&t);return n};let C="function"==typeof atob?e=>atob(p(e)):r?e=>Buffer.from(e,"base64").toString("binary"):I,D=r?e=>c(Buffer.from(e,"base64")):e=>c(C(e).split("").map(e=>e.charCodeAt(0))),q=e=>D(A(e)),w=r?e=>Buffer.from(e,"base64").toString("utf8"):s?e=>s.decode(D(e)):e=>k(C(e)),A=e=>p(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),R=e=>w(A(e));function T(){var e=(e,t)=>Object.defineProperty(String.prototype,e,U(t));e("fromBase64",(function(){return R(this)})),e("toBase64",(function(e){return b(this,e)})),e("toBase64URI",(function(){return b(this,!0)})),e("toBase64URL",(function(){return b(this,!0)})),e("toUint8Array",(function(){return q(this)}))}function x(){var e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,U(t));e("toBase64",(function(e){return f(this,e)})),e("toBase64URI",(function(){return f(this,!0)})),e("toBase64URL",(function(){return f(this,!0)}))}let U=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),E={version:"3.7.7",VERSION:"3.7.7",atob:C,atobPolyfill:I,btoa:d,btoaPolyfill:t,fromBase64:R,toBase64:b,encode:b,encodeURI:y,encodeURL:y,utob:_,btou:k,decode:R,isValid:e=>"string"==typeof e&&(e=e.replace(/\s+/g,"").replace(/={0,2}$/,""),!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)),fromUint8Array:f,toUint8Array:q,extendString:T,extendUint8Array:x,extendBuiltins:()=>{T(),x()}}},function(e,t,r){e.exports=(e=>{for(var t=Math,r=e,s=(i=r.lib).WordArray,n=i.Hasher,i=r.algo,o=[],a=0;a<64;a++)o[a]=4294967296*t.abs(t.sin(a+1))|0;function u(e,t,r,s,n,i,o){return((e=e+(t&r|~t&s)+n+o)<<i|e>>>32-i)+t}function c(e,t,r,s,n,i,o){return((e=e+(t&s|r&~s)+n+o)<<i|e>>>32-i)+t}function l(e,t,r,s,n,i,o){return((e=e+(t^r^s)+n+o)<<i|e>>>32-i)+t}function p(e,t,r,s,n,i,o){return((e=e+(r^(t|~s))+n+o)<<i|e>>>32-i)+t}return i=i.MD5=n.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var s=t+r,n=e[s];e[s]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var i=this._hash.words,a=e[t+0],d=e[t+1],h=e[t+2],f=e[t+3],g=e[t+4],m=e[t+5],_=e[t+6],v=e[t+7],b=e[t+8],y=e[t+9],M=e[t+10],S=e[t+11],k=e[t+12],I=e[t+13],C=e[t+14],D=e[t+15],q=u(i[0],R=i[1],A=i[2],w=i[3],a,7,o[0]),w=u(w,q,R,A,d,12,o[1]),A=u(A,w,q,R,h,17,o[2]),R=u(R,A,w,q,f,22,o[3]);q=u(q,R,A,w,g,7,o[4]),w=u(w,q,R,A,m,12,o[5]),A=u(A,w,q,R,_,17,o[6]),R=u(R,A,w,q,v,22,o[7]),q=u(q,R,A,w,b,7,o[8]),w=u(w,q,R,A,y,12,o[9]),A=u(A,w,q,R,M,17,o[10]),R=u(R,A,w,q,S,22,o[11]),q=u(q,R,A,w,k,7,o[12]),w=u(w,q,R,A,I,12,o[13]),A=u(A,w,q,R,C,17,o[14]),q=c(q,R=u(R,A,w,q,D,22,o[15]),A,w,d,5,o[16]),w=c(w,q,R,A,_,9,o[17]),A=c(A,w,q,R,S,14,o[18]),R=c(R,A,w,q,a,20,o[19]),q=c(q,R,A,w,m,5,o[20]),w=c(w,q,R,A,M,9,o[21]),A=c(A,w,q,R,D,14,o[22]),R=c(R,A,w,q,g,20,o[23]),q=c(q,R,A,w,y,5,o[24]),w=c(w,q,R,A,C,9,o[25]),A=c(A,w,q,R,f,14,o[26]),R=c(R,A,w,q,b,20,o[27]),q=c(q,R,A,w,I,5,o[28]),w=c(w,q,R,A,h,9,o[29]),A=c(A,w,q,R,v,14,o[30]),q=l(q,R=c(R,A,w,q,k,20,o[31]),A,w,m,4,o[32]),w=l(w,q,R,A,b,11,o[33]),A=l(A,w,q,R,S,16,o[34]),R=l(R,A,w,q,C,23,o[35]),q=l(q,R,A,w,d,4,o[36]),w=l(w,q,R,A,g,11,o[37]),A=l(A,w,q,R,v,16,o[38]),R=l(R,A,w,q,M,23,o[39]),q=l(q,R,A,w,I,4,o[40]),w=l(w,q,R,A,a,11,o[41]),A=l(A,w,q,R,f,16,o[42]),R=l(R,A,w,q,_,23,o[43]),q=l(q,R,A,w,y,4,o[44]),w=l(w,q,R,A,k,11,o[45]),A=l(A,w,q,R,D,16,o[46]),q=p(q,R=l(R,A,w,q,h,23,o[47]),A,w,a,6,o[48]),w=p(w,q,R,A,v,10,o[49]),A=p(A,w,q,R,C,15,o[50]),R=p(R,A,w,q,m,21,o[51]),q=p(q,R,A,w,k,6,o[52]),w=p(w,q,R,A,f,10,o[53]),A=p(A,w,q,R,M,15,o[54]),R=p(R,A,w,q,d,21,o[55]),q=p(q,R,A,w,b,6,o[56]),w=p(w,q,R,A,D,10,o[57]),A=p(A,w,q,R,_,15,o[58]),R=p(R,A,w,q,I,21,o[59]),q=p(q,R,A,w,g,6,o[60]),w=p(w,q,R,A,S,10,o[61]),A=p(A,w,q,R,h,15,o[62]),R=p(R,A,w,q,y,21,o[63]),i[0]=i[0]+q|0,i[1]=i[1]+R|0,i[2]=i[2]+A|0,i[3]=i[3]+w|0},_doFinalize:function(){for(var e=this._data,r=e.words,s=8*this._nDataBytes,n=8*e.sigBytes,i=(r[n>>>5]|=128<<24-n%32,t.floor(s/4294967296)),o=(i=(r[15+(64+n>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(64+n>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process(),this._hash)).words,a=0;a<4;a++){var u=o[a];o[a]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return i},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),r.MD5=n._createHelper(i),r.HmacMD5=n._createHmacHelper(i),e.MD5})(r(5))},function(e,t,r){r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return i}));var s,n={DEBUG:0,INFO:1,WARN:2,ERROR:3,REPORT:99,DISABLE:100,debug:0,info:1,warn:2,error:3,report:99,disable:100},i=(s=1,function(){return s++})},function(e,t,r){(function(e){var s=t;function n(e,t,r){for(var s=Object.keys(t),n=0;n<s.length;++n)void 0!==e[s[n]]&&r||(e[s[n]]=t[s[n]]);return e}function i(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&n(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}s.asPromise=r(101),s.base64=r(102),s.EventEmitter=r(103),s.float=r(104),s.inquire=r(105),s.utf8=r(106),s.pool=r(107),s.LongBits=r(108),s.isNode=Boolean(void 0!==e&&e&&e.process&&e.process.versions&&e.process.versions.node),s.global=s.isNode&&e||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,s.emptyArray=Object.freeze?Object.freeze([]):[],s.emptyObject=Object.freeze?Object.freeze({}):{},s.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},s.isString=function(e){return"string"==typeof e||e instanceof String},s.isObject=function(e){return e&&"object"==typeof e},s.isset=s.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||0<(Array.isArray(r)?r:Object.keys(r)).length)},s.Buffer=(()=>{try{var e=s.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}})(),s._Buffer_from=null,s._Buffer_allocUnsafe=null,s.newBuffer=function(e){return"number"==typeof e?s.Buffer?s._Buffer_allocUnsafe(e):new s.Array(e):s.Buffer?s._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},s.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,s.Long=s.global.dcodeIO&&s.global.dcodeIO.Long||s.global.Long||s.inquire("long"),s.key2Re=/^true|false|0|1$/,s.key32Re=/^-?(?:0|[1-9][0-9]*)$/,s.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,s.longToHash=function(e){return e?s.LongBits.from(e).toHash():s.LongBits.zeroHash},s.longFromHash=function(e,t){return e=s.LongBits.fromHash(e),s.Long?s.Long.fromBits(e.lo,e.hi,t):e.toNumber(Boolean(t))},s.merge=n,s.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},s.newError=i,s.ProtocolError=i("ProtocolError"),s.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;-1<r;--r)if(1===t[e[r]]&&null!=this[e[r]])return e[r]}},s.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},s.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},s._configure=function(){var e=s.Buffer;e?(s._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},s._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):s._Buffer_from=s._Buffer_allocUnsafe=null}}).call(this,r(11))},function(e,t,r){e.exports=r(100)},function(e,t){var r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var s=r(23),n=(r.d(t,"b",(function(){return s.a})),r(20));r.d(t,"a",(function(){return n.ZIM})),r(46),r(47),r(48),r(49),r(50),r(51),r(52),r(53)},function(e,t,r){r.d(t,"a",(function(){return f}));var s=r(2),n=r(1),i=r(0),o=function(){return(o=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},a=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var s,n,i=r.call(e),o=[];try{for(;(void 0===t||0<t--)&&!(s=i.next()).done;)o.push(s.value)}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},u=function(e,t,r){if(r||2===arguments.length)for(var s,n=0,i=t.length;n<i;n++)!s&&n in t||((s=s||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},c={11:"jpeg",12:"txt",13:"mp3",14:"mp4"},l=i.v.Conv,p=6000121,d=6000212,h=6000001,f=(g.prototype.destroy=function(){this.dbMgr=null,this.cnMgr=null,this.bus=null,this.lg=null,this.econf=null},g.prototype.sendCommand=function(e,t,r){var s,a,u,c,d=this;return this.dbMgr&&this.cnMgr&&this.econf?(u=new Date,c=(s=u.getTime())-this.lastSendTime,a={time:u,delay:c,convID:this.convID,onattach:void 0,message:o({},e)},this.initSendingMessage(e,t),e.orderKey=(this.dbConv.msgSeq||0)*i.h.MESSAGE_SEQ_MULTIPLIER+1,e.receiptStatus=i.c.MessageReceiptStatus.None,e.isMentionAll=!1,e.mentionedUserIDs=[],e.type==i.c.MessageType.Command&&c<this.econf.cloudSetting.qps.send_msg?(e.sentStatus=i.c.MessageSentStatus.Failed,a.error=Object(n.y)(6000004),this.lg.w(l,i.u.SendMsg,a),Promise.reject(a.error)):(r&&"function"==typeof r.onMessageAttached&&setTimeout((function(){var t=e.localMessageID;try{r.onMessageAttached(e)}catch(t){throw t}finally{a.onattach=t}}),0),this.lastSendTime=s,e.type==i.c.MessageType.Barrage&&c<this.econf.cloudSetting.qps.send_barrage_msg?new Promise((function(t){setTimeout((function(){e.sentStatus=i.c.MessageSentStatus.Success,e.timestamp=d.st.getRealClientTimestamp(s),d.emitMsgSentStatus(e,""),d.lg.i(l,i.u.SendMsg,a),t({message:e})}),80*Math.random()+50)})):(c={msg_type:e.type,priority_type:t.priority,msg:"string"==typeof(u=e.message)?Object(n.j)(u):u,conv_id:this.convID,payload:Object(n.j)(e.extendedData)},t=o(o({},this.getAssociatedReqBody()),{conv_id:this.convID,command_msg_info:c}),this.cnMgr.send(i.d["msg_cmd_"+this.convType],t).then((function(t){var r;return t.code?(e.sentStatus=i.c.MessageSentStatus.Failed,e.timestamp=d.st.getRealClientTimestamp(),d.emitMsgSentStatus(e,""),a.error=d.withSendMessageErrorCode(t.code,t.message),d.lg.w(l,i.u.SendMsg,a),Promise.reject(a.error)):(r=t.msg_id,t=t.command_svr_info,e.sentStatus=i.c.MessageSentStatus.Success,e.messageID=t?t.msg_id:r,e.timestamp=t?t.msg_time:d.st.getRealClientTimestamp(),d.emitMsgSentStatus(e,""),d.dr.addMsgLife(e),d.lg.i(l,i.u.SendMsg,a),{message:e})}))))):Promise.reject(Object(n.y)(p,i.u.SendMsg))},g.prototype.sendMessage=function(e,t,r,s){var o,a,u,c,d,h,f=this;return this.dbMgr&&this.cnMgr&&this.econf?(o=this.copyMsgObj(e),a=!!t.isRetrySend,c=(u=(h=new Date).getTime())-this.lastSendTime,d={time:h,seq:0,delay:c,convID:this.convID,onattach:a,message:o},(h=this.initSendingMessage(o,t))?e=o:Object.assign(e,o),h&&a||!(c<this.econf.cloudSetting.qps.send_msg)?(h&&a||(this.lastSendTime=u),new Promise((function(n,u){f.emitSendingMessage(e,o,d,s,a?void 0:r),f.saveLocalMessage(e,o,i.c.MessageSentStatus.Sending),f.innerSendText(e,o,t,!1,d,s).then(n).catch((function(r){f.isRetrySend(r)?f.addTextSendTask(e,o,t,d,n,u,s):u(f.handleSendMsgFail(e,o,d,r))}))}))):(o.sentStatus=i.c.MessageSentStatus.Failed,e.sentStatus=o.sentStatus,d.error=Object(n.y)(6000004),delete d.message,d.msgType=o.type,this.lg.w(l,i.u.SendMsg,d),Promise.reject(d.error))):Promise.reject(Object(n.y)(p,i.u.SendMsg))},g.prototype.sendMediaMessage=function(e,t,r,o){var a,u,c,l,d,h,f,g,m=this;return this.dbMgr&&this.cnMgr&&this.econf?(a=this.copyMsgObj(e),u=!!t.isRetrySend,c={time:new Date,seq:0,convID:this.convID,onattach:u,message:a},a.type>=i.c.MessageType.Image&&a.type<=i.c.MessageType.Video&&(a.isServerMessage||a.sentStatus!=i.c.MessageSentStatus.Success)&&(a.fileUID="",e.fileUID=""),this.initSendingMessage(a,t)?e=a:Object.assign(e,a),a.type==i.c.MessageType.Combine&&(a.aesKey=a.aesKey||s.a.getInstance().crypto.generateNonce(),l=a.conversationType,d=a.localMessageID,h=a.conversationID,f=a.aesKey,a.combineID="0-"+l+"_"+d+"_"+f+"-"+h,e.aesKey=a.aesKey,e.combineID=a.combineID),a.fileDownloadUrl||a.fileUID?new Promise((function(s,n){m.emitSendingMessage(e,a,c,o,u?void 0:r),m.saveLocalMessage(e,a,i.c.MessageSentStatus.Sending),m.innerSendText(e,a,t,!1,c,o).then(s).catch((function(r){m.isRetrySend(r)?m.addTextSendTask(e,a,t,c,s,n,o):n(m.handleSendMsgFail(e,a,c,r))}))})):(g=a.type==i.c.MessageType.Combine?this.getCombineMessageFile(a):a.fileLocalPath,this.dbMgr.getFileInfo(g).then((function(s){return a.fileUID=s.md5,a.fileSize=s.size||1,(!a.fileName||a.fileName.indexOf(".")<1)&&(a.fileName=s.name),m.emitSendingMessage(e,a,c,o,u?void 0:r),m.saveLocalMessage(e,a,i.c.MessageSentStatus.Sending),new Promise((function(s,n){m.innerSendMedia(e,a,t,r,g,c,o).then(s).catch((function(u){var l;m.isRetrySend(u)?(l={convID:m.convID,convType:m.convType,retryTime:Date.now(),type:i.c.MessageType.Image,oMessage:e,sMessage:a,config:t,notification:r,file:g,originMessage:o,log:c,resolve:s,reject:n},m.econf.msgRetrySendTasks.push(l)):n(m.handleSendMsgFail(e,a,c,u))}))}))})))):Promise.reject(Object(n.y)(p,i.u.SendMsg))},g.prototype.sendMultipleMessage=function(e,t,r,s){var o,a,u,c,d,f,g,m=this;return this.dbMgr&&this.cnMgr&&this.econf?(o=this.copyMsgObj(e),a=!!t.isRetrySend,u={time:new Date,seq:0,convID:this.convID,onattach:a,message:o},(c=this.initSendingMessage(o,t))?e=o:Object.assign(e,o),d={},f=new Map,o.messageInfoList.forEach((function(e,t){d[e.type]=(d[e.type]||0)+1,e.type>=i.c.MessageType.Image&&e.type<=i.c.MessageType.Video&&(e.fileLocalPath?(f.set(t,e),e.fileName||"object"!=typeof e.fileLocalPath||(e.fileName=e.fileLocalPath.name)):c||(e.fileUID=""))})),g="",(20<o.messageInfoList.length?g="messageInfoList length exceeds 20.":(1<d[i.c.MessageType.Custom]||1<d[i.c.MessageType.File]||1<d[i.c.MessageType.Audio]||1<d[i.c.MessageType.Video]||10<d[i.c.MessageType.Image])&&(g="Item exceeds its limit: "+JSON.stringify(d)))?(o.sentStatus=i.c.MessageSentStatus.Failed,e.sentStatus=o.sentStatus,this.emitSendingMessage(e,o,u,s,a?void 0:r),this.saveLocalMessage(e,o,i.c.MessageSentStatus.Failed),u.error=Object(n.y)(h,g),this.lg.w(l,i.u.SendMsg,u),Promise.reject(u.error)):c||!f.size?new Promise((function(n,c){m.emitSendingMessage(e,o,u,s,a?void 0:r),m.saveLocalMessage(e,o,i.c.MessageSentStatus.Sending),m.innerSendText(e,o,t,!1,u,s).then(n).catch((function(r){m.isRetrySend(r)?m.addTextSendTask(e,o,t,u,n,c,s):c(m.handleSendMsgFail(e,o,u,r))}))})):this.getMultipleMsgFileInfos(f,u).then((function(n){var c=n.file_list,l=n.totalUploadData;return m.emitSendingMessage(e,o,u,s,a?void 0:r),m.saveLocalMessage(e,o,i.c.MessageSentStatus.Sending),new Promise((function(n,a){var p={file_list:Object.values(c)};m.uploadMultipleMsg(o,r,p,f,l).then((function(){return m.innerSendText(e,o,t,!0,u,s).then(n)})).catch((function(c){var d;m.isRetrySend(c)?(d={convID:m.convID,convType:m.convType,retryTime:Date.now(),type:i.c.MessageType.Multiple,oMessage:e,sMessage:o,config:t,notification:r,reqBody:p,uploadLiteMap:f,totalUploadData:l,originMessage:s,log:u,resolve:n,reject:a},m.econf.msgRetrySendTasks.push(d)):a(m.handleSendMsgFail(e,o,u,c))}))}))}))):Promise.reject(Object(n.y)(p,i.u.SendMsg))},g.prototype.retrySendMsg=function(e,t,r){var s,n,o,u,c=this,p=e.oMessage,d=p.localMessageID;this.econf.msgRetrySendTasks.some((function(e){return e.oMessage.localMessageID==d}))&&(r?e.reject(this.handleSendMsgFail(p,e.sMessage,e.log,r)):(s=this.convType==i.c.ConversationType.Room?this.econf.cloudSetting.retry.room_msg_max_degree:this.econf.cloudSetting.retry.msg_max_degree,e.log.retryCount||(e.log.retryCount=1),n=function(t){c.delRetrySendTask(d),e.resolve(t)},o=function(t){c.isRetrySend(t)&&e.log.retryCount<s?(e.log.retryCount++,c.retrySendMsg(e,!1)):(c.delRetrySendTask(d),e.reject(c.handleSendMsgFail(p,e.sMessage,e.log,t)))},u=function(){return c.queryMessageStatus([e.sMessage],2).then((function(t){var r;if((t=((t=a(t,2))[0],t[1]))&&t.sentStatus==i.c.MessageSentStatus.Success)return r=t.messageSeq,c.saveMessageList([t],r,c.dbConv.state,i.w.Sended),e.log.seq=r,c.lg.i(l,i.u.SendMsg,e.log),Object.assign(e.sMessage,t),Object.assign(p,e.sMessage),n({message:p}),!0}))},e.type==i.c.MessageType.Text?t?setTimeout((function(){u().then((function(t){t||(t=e.sMessage,c.innerSendText(p,t,e.config,!1,e.log,e.originMessage).then(n).catch(o))}))}),this.econf.cloudSetting.retry.msg_itvl):u().then((function(t){t||(t=e.sMessage,c.innerSendText(p,t,e.config,!1,e.log,e.originMessage).then(n).catch(o))})):e.type==i.c.MessageType.Image?u().then((function(t){t||(t=e.sMessage,c.innerSendMedia(p,t,e.config,e.notification,e.file,e.log,e.originMessage).then(n).catch(o))})):e.type==i.c.MessageType.Multiple&&u().then((function(t){var r,s,i;t||(r=e.sMessage,s=e.config,i=e.originMessage,c.uploadMultipleMsg(r,e.notification,e.reqBody,e.uploadLiteMap,e.totalUploadData).then((function(){return c.innerSendText(p,r,s,!0,e.log,i).then(n)})).catch(o))}))))},g.prototype.editMessage=function(e,t){var r,s,o=this;return this.dbMgr&&this.cnMgr&&this.econf?(r=e.messageSeq,s={time:new Date,type:e.type,seq:r},this.dbMgr.getMessageListBySeqs(this.convID,this.convType,[r]).then((function(a){var u=a.get(r);if(!u)return Promise.reject(Object(n.y)(h,"The message no found in DB."));if(u.type!=e.type)return Promise.reject(Object(n.y)(h,"Message type can not changed."));a=Promise.resolve(!1);var c={conv_id:o.convID,conv_msg_seq:u.messageSeq,msg_type:u.type,msg_id:u.messageID},p=0,d=((u.extendedData||"")!=(e.extendedData||"")&&(p|=2,c.payload=Object(n.j)(e.extendedData)),Array.isArray(u.mentionedUserIDs)?u.mentionedUserIDs:[]),f=Array.isArray(e.mentionedUserIDs)?e.mentionedUserIDs:[],g=(d=(s.oAtList=d,s.sAtList=f,(d.length!=f.length||d.some((function(e){return-1==f.indexOf(e)}))||f.length)&&(p|=4,c.at_list=f),!!u.isMentionAll),!!e.isMentionAll);if((s.oAtAll=d)==(s.sAtAll=g)&&!g||(p|=8,c.is_at_all=g),u.type==i.c.MessageType.Custom&&((u.subType||0)!=(e.subType||0)&&(p|=16,c.sub_msg_type=e.subType),(u.searchedContent||"")!=(e.searchedContent||""))&&(p|=32,c.searched_content=e.searchedContent),u.type!=i.c.MessageType.Text&&u.type!=i.c.MessageType.Custom||u.message==e.message){if(u.type==i.c.MessageType.Multiple){p|=1;var m={},_=new Map;d=(e.messageInfoList.forEach((function(e,t){m[e.type]=(m[e.type]||0)+1,e.type>=i.c.MessageType.Image&&e.type<=i.c.MessageType.Video&&e.fileLocalPath&&(_.set(t,e),e.fileName||"object"!=typeof e.fileLocalPath||(e.fileName=e.fileLocalPath.name))})),"");if(20<e.messageInfoList.length?d="messageInfoList length exceeds 20.":(1<m[i.c.MessageType.Custom]||1<m[i.c.MessageType.File]||1<m[i.c.MessageType.Audio]||1<m[i.c.MessageType.Video]||10<m[i.c.MessageType.Image])&&(d="Item exceeds its limit: "+JSON.stringify(m)))return Promise.reject(Object(n.y)(h,d));_.size&&(a=o.getMultipleMsgFileInfos(_,s).then((function(r){var s=r.file_list,n=(r=r.totalUploadData,0);return _.forEach((function(t,r){var s,i,o=e.messageInfoList.find((function(e,s){return e.fileUID==t.fileUID&&r!=s&&!!e.fileDownloadUrl}));o&&(n++,s=t.fileName,i=t.fileLocalPath,Object.assign(t,o),t.fileName=s,t.fileLocalPath=i)})),!(n<_.size)||o.uploadMultipleMsg(e,t,{file_list:Object.values(s)},_,r)})))}}else p|=1,c.msg=Object(n.j)(e.message);return(c.edit_type=p)?(t&&"function"==typeof t.onMessageAttached&&setTimeout((function(){try{t.onMessageAttached(e)}catch(e){}}),0),a.then((function(t){var r,a,p;return e.type==i.c.MessageType.Multiple&&(r=e.messageInfoList,a=u.messageInfoList,s.oInfos=a,p=[],(s.sInfos=r).forEach((function(e,t){return!(e.type!=i.c.MessageType.Text&&e.type!=i.c.MessageType.Custom||a.some((function(t){return e.type==t.type&&e.message==t.message})))||e.type>=i.c.MessageType.Image&&e.type<=i.c.MessageType.Video&&!a.some((function(t){return t=t,(r=e).fileUID?r.fileUID==t.fileUID:r.type==i.c.MessageType.Image?r.fileDownloadUrl==t.fileDownloadUrl||r.thumbnailDownloadUrl==t.thumbnailDownloadUrl||r.largeImageDownloadUrl==t.largeImageDownloadUrl:r.fileDownloadUrl==t.fileDownloadUrl;var r}))?p.push(t):void 0})),c.audit_list=p,c.msg=o.encodeMsgBody(e,!1,!1)),o.cnMgr.send(i.d["msg_edit_"+o.convType],c).then((function(r){if(r.code)return s.error=Object(n.y)(6000205,r.message,r.code),o.lg.w(l,i.u.EditMsg,s),Promise.reject(s.error);o.updateMsgStateSeq(r.state_msg_seq),o.clearMsgObjFile(e),e.editSeq=r.edit_msg_seq,e.editedTime=r.edit_time,e.editorUserID=o.econf.user.userID;var a=r.msg_flag;return 2!=a&&3!=a||(e.extendedData=Object(n.g)(r.payload_rsp)),!t&&1!=a&&3!=a||o.pb.decodeMsgBody(o.econf,e,r.msg_rsp),o.dbConv.lastMessage&&o.dbConv.lastMessage.messageID==e.messageID&&(o.dbConv.lastMessage=e,o.emitConvChanged(i.c.ConversationEvent.Updated),o.dbMgr.addConversationList([o.dbConv])),o.dbMgr.getReplyMessageListBySeqs(o.convID,o.convType,[e.messageSeq],2).then((function(t){t.length&&(t.forEach((function(t){return o.pb.handleReplyMsgInfo(t,e,!0)})),o.bus.emit(i.m.MsgRepliedInfo,{messageList:t})),o.updateMsgCacheList(t.concat(JSON.parse(JSON.stringify(e))))})),o.lg.i(l,i.u.EditMsg,s),{message:e}}))}))):Promise.reject(Object(n.y)(h,"No changed fields."))}))):Promise.reject(Object(n.y)(p,i.u.EditMsg))},g.prototype.deleteMessages=function(e,t){var r=this,s={time:new Date,convID:this.convID,config:t};return t&&t.isAlsoDeleteServerMessage&&0!=(t=e.filter((function(e){return!!e.messageSeq}))).length?(t=this.convType==i.c.ConversationType.Peer?{conv_id:this.convID,conv_type:this.convType,msg_ids:t.map((function(e){return e.messageID}))}:{conv_id:this.convID,conv_msg_seq:t.map((function(e){return e.messageSeq}))},this.cnMgr.send(i.d["msg_del_"+this.convType],t).then((function(t){return t.code?(s.error=Object(n.y)(6000602,t.message,t.code),r.lg.w(l,i.u.DelMsg,s),Promise.reject(s.error)):r.deleteLocalMessages(e,s)}))):this.deleteLocalMessages(e,s)},g.prototype.deleteAllMessage=function(e){var t=this,r={time:new Date,convID:this.convID,config:e};return e&&e.isAlsoDeleteServerMessage?(e={conv_id:this.convID,conv_type:this.convType},this.cnMgr.send(i.d["msg_del_all_"+this.convType],e).then((function(e){return e.code?(r.error=Object(n.y)(6000602,e.message,e.code),t.lg.w(l,i.u.DelAllMsg,r),Promise.reject(r.error)):t.deleteLocalAllMessage(r)}))):this.deleteLocalAllMessage(r)},g.prototype.queryHistoryMessage=function(e){var t=this;return this.dbMgr&&this.cnMgr&&this.econf?new Promise((function(r,s){function o(e){if(!t.dbMgr||!t.cnMgr||!t.econf)return s(Object(n.y)(p,i.u.QueryHistoryMsg));(a=e.filter((function(e){return e.sentStatus==i.c.MessageSentStatus.Sending}))).length&&t.queryMessageStatus(a,0);var o=[],a=t.convType==i.c.ConversationType.Peer,u=t.dbConv.maxSendReceiptMsgSeq||0,m=t.dbConv.maxRecvReceiptMsgSeq||0,_=a?t.econf.HBConf.history_c2c_msg_seq:t.dbConv.historyMsgSeq,v=a?t.econf.msgExtraMap.get(t.getMsgExtraKey(0)):void 0,b=t.convType==i.c.ConversationType.Room?[]:Array.from(t.econf.msgExtraMap.values()).filter((function(e){return 0<e.rootRepliedCount&&e.conversationID==t.convID&&e.conversationType==t.convType})),y=(e=e.map((function(e){return(t.mergeMessageExtra(e,b,u,m,_,v)||e.type==i.c.MessageType.Tips&&0==e.event)&&o.push(e),t.pb.handleDBMessage(t.econf,e)})),t.filterReceiptMemberMsg(e)),M=(h?e.sort((function(e,t){return t.orderKey-e.orderKey})):e.sort((function(e,t){return e.orderKey-t.orderKey})),!c&&h&&t.convType!=i.c.ConversationType.Room&&(k=e[0],(M=t.dbConv.lastMessage)&&!k&&(S.status.convLastMsg=M.messageSeq+","+M.messageID,o.push(JSON.parse(JSON.stringify(M))),e.unshift(M)),k)&&(!M||M.orderKey<k.orderKey)&&(S.status.dbLastMsg=k.messageSeq+","+k.messageID,t.updateConvOrderKey(k.timestamp),t.dbConv.lastMessage=k,t.emitConvChanged(i.c.ConversationEvent.Updated,"checkLastMsg")),o.length&&t.updateMsgCacheList(o),0),k=(M=c?e.findIndex((function(e){return c===e.localMessageID}))+1:M)+d;e=e.slice(M,k),h&&e.sort((function(e,t){return e.orderKey-t.orderKey})),S.status.count=e.length,S.status.historySeq=_,a&&(S.status.sendSeq=u,S.status.recvSeq=m),k={dbMsgSeq:f,dbMaxSeq:g,delMax:t.dbConv.deletedMsgMaxSeq,start:M};Object.assign(S.status,k),t.lg.i(l,i.u.QueryHistoryMsg,S),r({list:e,receiptMemberMsgs:y})}var c=e.nextMessage?e.nextMessage.localMessageID:"",d=e.count,h=e.reverse,f=t.dbConv.msgSeq||0,g=t.dbConv.maxSeq||0,m=e.nextMessage?e.nextMessage.messageSeq||Math.ceil(e.nextMessage.orderKey/100):0,_=!e.nextMessage&&h,v=!1,b=0,y=0,M=(h?(y=m?m-1:f,b=Math.max(t.dbConv.deletedMsgMaxSeq||0,y-d)):(b=Math.max(t.dbConv.deletedMsgMaxSeq||0,m),y=Math.min(b+d,f)),String(++t.st.queryMsgSeq)),S=(m={dbCount:0,count:0,queryCount:d,reverse:h,next:m,patch:0},{_seq:M,time:new Date,convID:t.convID,smin:b,smax:y,lmin:0,lmax:0,lsize:0,status:m});t.dbMgr.getMessageList(t.dbConv,e,M).then((function(r){r.length<=0&&(g=f=0);var c=t.econf.user.deleteAllMsgTime||0,l=t.dbConv.deletedMsgMaxSeq||0,d=t.dbConv.deletedMsgSeqs||[],m=t.dbConv.hideMsgSeqs,k=r.filter((function(e){return e.messageSeq&&e.sentStatus==i.c.MessageSentStatus.Success})).map((function(e){return e.messageSeq})),I=(m=(d.length&&k.push.apply(k,u([],a(d),!1)),m&&m.length&&k.push.apply(k,u([],a(m),!1)),(k=Array.from(new Set(k))).sort((function(e,t){return e-t})),k[0]||0),k[k.length-1]||0),C=(S.status.dbCount=r.length,S.lmin=m,S.lmax=I,S.lsize=k.length,I-m<k.length&&m<=b+1&&y<=I);if(!_&&C)return o(r);function D(a){if(!t.dbMgr||!t.cnMgr||!t.econf)return s(Object(n.y)(p,i.u.QueryHistoryMsg));a.list.forEach((function(e){var r=e.msg_svr_info.conv_msg_seq,s=e.msg_svr_info.msg_time;E.push(r),w<r&&(w=r),(!q||r<q)&&(q=r),x.has(r)||T&&!(-1==d.indexOf(r)&&l<r&&c<s)||(s=t.transform2Message(e,!0),x.set(r,s),s.hide%2)||(R=!1)}));var u,f=_?v:h;a.nextSeq&&(!f&&w<y||f&&b<q)?t.fetchSvrMessage(a.nextSeq,++A,U,f).then(D):(S.status.patch=x.size,u=t.dbConv.state,x.size&&!R&&u!=i.j.Delete&&(t.dbConv.state=i.j.Normal),t.insertDeletedMsgSeqs(E,S.status),x.size?t.saveMsgRepliedInfo(x,!0,!1).then((function(r){t.saveMessageList(r,w,u,i.w.Fetch),t.dbMgr.getMessageList(t.dbConv,e,M).then(o)})):(o(r),_&&!a.code&&(t.dbConv.maxSeq=a.maxSeq||t.dbConv.msgSeq,t.dbMgr.addConversationList([t.dbConv]))))}var q=0,w=0,A=1,R=!0,T=t.convType!=i.c.ConversationType.Room,x=new Map,U=i.n.B,E=[];if(_)return g&&f<g?void t.fetchSvrMessage(f,A,U,v).then(D):g&&C?o(r):(v=!0,C=Math.min(