zego-zim-miniprogram
Version:
ZEGO ZIM SDK for mini program
1 lines • 1.01 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=21)})([function(e,t,r){var s=r(13),n=(r.d(t,"c",(function(){return s.a})),r(30)),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(31)),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.d(t,"A",(function(){return i.d})),r(32)),a=(r.d(t,"h",(function(){return o.a})),r.d(t,"m",(function(){return o.b})),r(33)),u=(r.d(t,"k",(function(){return a.a})),r.d(t,"l",(function(){return a.b})),r(34));r.d(t,"u",(function(){return u.a})),r.d(t,"v",(function(){return u.b}))},function(e,t,r){var s=r(27),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(28)),i=(r.d(t,"m",(function(){return n.a})),r.d(t,"y",(function(){return n.b})),r(29));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(55),n=r(63),i=r(79),o=r(81),a=r(89),u=r(93),c=r(0),l=c.v.Manager,p=(d.getInstance=function(){return this.instance||(this.instance=new d)},d.prototype.getVersion=function(){return"2.20.0"},d.prototype.createEngine=function(e){var t={appID:e,version:"2.20.0 3/21 17:16"},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.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<=-m)return I;if(m<=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,m=f/2,g=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,m,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(g)&&e.lt(g)?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=m=f=h=0)+((f=f+((m+=o*(e=65535&e.low))>>>16)+i*e)>>>16)+((f=(65535&f)+o*p)>>>16),c((f&=65535)<<16|(m&=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){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),m=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))},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,_=e=>e.replace(g,m),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,q=r?e=>c(Buffer.from(e,"base64")):e=>c(C(e).split("").map(e=>e.charCodeAt(0))),D=e=>q(A(e)),w=r?e=>Buffer.from(e,"base64").toString("utf8"):s?e=>s.decode(q(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 D(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:D,extendString:T,extendUint8Array:x,extendBuiltins:()=>{T(),x()}}},function(e,t,r){r.r(t),r.d(t,"ZIMFileStoreBase",(function(){return u}));var s=r(5),n=r(2),i=r(1),o=r(0),a=function(){return(a=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)},u=(c.prototype.destroy=function(){this.itemMap.clear(),this.fs=null,this.lg=null},c.prototype.writeLog=function(e,t){this.lg.i(this.logTags,e,t)},c.prototype.unlinkFile=function(){var e=this,t=new Date;this.fs.unlink({filePath:this.path,complete:function(r){e.lg.i(e.logTags,"unlinkFile",a({time:t},r))}})},c.prototype.getList=function(){var e=this;return this.isReadAll?(this.lg.i(this.logTags,"getList_cache",{total:this.itemMap.size}),Promise.resolve(Array.from(this.itemMap.values()))):new Promise((function(t){var r=new Date;e.fs.readFile({filePath:e.path,encoding:"utf8",success:function(s){var n=0;s.data.split("\n").forEach((function(t){!t||t.length<=2||(n++,t=e.decode(t),e.itemMap.set(e.getValueOfKey(t),t))})),s.time=r,s.total=e.itemMap.size,s.count=n,s.size=s.data.length,delete s.data,e.isReadAll=!0,e.lg.i(e.logTags,"getList_readFile1",s),t(Array.from(e.itemMap.values()))},fail:function(s){s&&(s.time=r,s.total=e.itemMap.size,s.count=e.itemMap.size),e.lg.i(e.logTags,"getList_readFile0",s),t(Array.from(e.itemMap.values()))}})}))},c.prototype.get=function(e){var t=this;return this.itemMap.has(e)?Promise.resolve(this.itemMap.get(e)):new Promise((function(r){var s=new Date;t.fs.readFile({filePath:t.path,encoding:"utf8",success:function(n){var i=n.data.split("\n");i.some((function(r){var s;return!!(r&&2<r.length)&&(r=t.decode(r),s=t.getValueOfKey(r),t.itemMap.set(s,r),s==e)})),n.time=s,n.total=t.itemMap.size,n.count=i.length-1,n.id=e,n.size=n.data.length,delete n.data,t.lg.i(t.logTags,"get_readFile1",n),r(t.itemMap.get(e)||{})},fail:function(n){n&&(n.time=s,n.total=t.itemMap.size,n.count=t.itemMap.size,n.id=e),t.lg.i(t.logTags,"get_readFile0",n),r(t.itemMap.get(e)||{})}})}))},c.prototype.getFromCache=function(e){return this.itemMap.get(e)},c.prototype.getListFromCache=function(){return this.itemMap},c.prototype.isExist=function(e,t){var r=!1;return this.itemMap.forEach((function(s){r||s[t]!=e||(r=!0)})),r},c.prototype.addList=function(e,t,r){var s=this;if(!e.length)return r&&r();var n=new Date,i=!1,o=(e.forEach((function(e){var t=s.getValueOfKey(e);!i&&s.itemMap.has(t)&&(i=!0),s.itemMap.set(t,e)})),e.length),a=(e=i?Array.from(this.itemMap.values()):e).map((function(e){return s.encode(e)})).join("\n")+"\n";this.fs.access({path:this.path,success:function(){var e={time:n,hasUpdate:i,total:s.itemMap.size,count:o,flag:t};s.writeFile(i,"ba",a,e),r&&r()},fail:function(e){e={time:n,hasUpdate:i,total:s.itemMap.size,count:o,flag:t,accessRes:e&&e.errMsg},s.writeFile(!0,"ba",a,e),r&&r()}})},c.prototype.deleteListFromCache=function(e){var t=this;e.forEach((function(e){return t.itemMap.delete(e)}))},c.prototype.deleteList=function(e,t){var r=this;if(!e.length)return t&&t(Array.from(this.itemMap.values()));var s=new Date;e.forEach((function(e){return r.itemMap.delete(e)})),this.fs.access({path:this.path,complete:function(n){var i=Array.from(r.itemMap.values()),o=i.map((function(e){return r.encode(e)})).join("\n")+"\n";r.writeFile(!0,"bd",o,{time:s,ids:e,accessRes:n&&n.errMsg}),t&&t(i)}})},c.prototype.deleteAll=function(){this.itemMap.clear(),this.writeFile(!0,"da","",{time:new Date})},c.prototype.createFile=function(){var e=this,t=new Date;this.fs.access({path:this.path,success:function(){e.lg.i(e.logTags,"create",{time:t})},fail:function(){e.writeFile(!0,"create","",{time:t})}})},c.prototype.writeFile=function(e,t,r,s){var n=this,i=e?"writeFile":"appendFile";this.fs[i]({filePath:this.path,data:r||"\n",encoding:"utf8",complete:function(e){e.length=r.length,n.lg.i(n.logTags,t+"_"+i,Object.assign(s,e))}})},c.prototype.encode=function(e){return s.a.btoa(encodeURI(JSON.stringify(e)))},c.prototype.decode=function(e){try{return JSON.parse(decodeURI(s.a.atob(e)))}catch(e){return{}}},c.prototype.getValueOfKey=function(e){return 1==this.key.length?e[this.key[0]]:e[this.key[0]][this.key[1]]},c);function c(e,t,r){this.lg=n.a.getInstance().lg,this.isReadAll=!1,this.itemMap=new Map,this.path=e,this.key=r.split("."),this.fs=i.p.getFileSystemManager(),this.logTags=o.v.Database+","+t,this.createFile()}},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}),m=(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 m.HMAC.init(e,r).finalize(t)}}}),o.algo={});return o})(Math)}).call(this,r(11))},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],m=e[t+4],g=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],q=e[t+15],D=u(i[0],R=i[1],A=i[2],w=i[3],a,7,o[0]),w=u(w,D,R,A,d,12,o[1]),A=u(A,w,D,R,h,17,o[2]),R=u(R,A,w,D,f,22,o[3]);D=u(D,R,A,w,m,7,o[4]),w=u(w,D,R,A,g,12,o[5]),A=u(A,w,D,R,_,17,o[6]),R=u(R,A,w,D,v,22,o[7]),D=u(D,R,A,w,b,7,o[8]),w=u(w,D,R,A,y,12,o[9]),A=u(A,w,D,R,M,17,o[10]),R=u(R,A,w,D,S,22,o[11]),D=u(D,R,A,w,k,7,o[12]),w=u(w,D,R,A,I,12,o[13]),A=u(A,w,D,R,C,17,o[14]),D=c(D,R=u(R,A,w,D,q,22,o[15]),A,w,d,5,o[16]),w=c(w,D,R,A,_,9,o[17]),A=c(A,w,D,R,S,14,o[18]),R=c(R,A,w,D,a,20,o[19]),D=c(D,R,A,w,g,5,o[20]),w=c(w,D,R,A,M,9,o[21]),A=c(A,w,D,R,q,14,o[22]),R=c(R,A,w,D,m,20,o[23]),D=c(D,R,A,w,y,5,o[24]),w=c(w,D,R,A,C,9,o[25]),A=c(A,w,D,R,f,14,o[26]),R=c(R,A,w,D,b,20,o[27]),D=c(D,R,A,w,I,5,o[28]),w=c(w,D,R,A,h,9,o[29]),A=c(A,w,D,R,v,14,o[30]),D=l(D,R=c(R,A,w,D,k,20,o[31]),A,w,g,4,o[32]),w=l(w,D,R,A,b,11,o[33]),A=l(A,w,D,R,S,16,o[34]),R=l(R,A,w,D,C,23,o[35]),D=l(D,R,A,w,d,4,o[36]),w=l(w,D,R,A,m,11,o[37]),A=l(A,w,D,R,v,16,o[38]),R=l(R,A,w,D,M,23,o[39]),D=l(D,R,A,w,I,4,o[40]),w=l(w,D,R,A,a,11,o[41]),A=l(A,w,D,R,f,16,o[42]),R=l(R,A,w,D,_,23,o[43]),D=l(D,R,A,w,y,4,o[44]),w=l(w,D,R,A,k,11,o[45]),A=l(A,w,D,R,q,16,o[46]),D=p(D,R=l(R,A,w,D,h,23,o[47]),A,w,a,6,o[48]),w=p(w,D,R,A,v,10,o[49]),A=p(A,w,D,R,C,15,o[50]),R=p(R,A,w,D,g,21,o[51]),D=p(D,R,A,w,k,6,o[52]),w=p(w,D,R,A,f,10,o[53]),A=p(A,w,D,R,M,15,o[54]),R=p(R,A,w,D,d,21,o[55]),D=p(D,R,A,w,b,6,o[56]),w=p(w,D,R,A,q,10,o[57]),A=p(A,w,D,R,_,15,o[58]),R=p(R,A,w,D,I,21,o[59]),D=p(D,R,A,w,m,6,o[60]),w=p(w,D,R,A,S,10,o[61]),A=p(A,w,D,R,h,15,o[62]),R=p(R,A,w,D,y,21,o[63]),i[0]=i[0]+D|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(7))},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){r.r(t),r.d(t,"convertFormData",(function(){return o}));var s=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},n=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))};function i(e){for(var t=[],r=0;r<e.length;r++){t.push.apply(t,n([],s(((e,t)=>{var r=[],s=0,n=e.charCodeAt(t);return n<128?r[s++]=n:(n<2048?r[s++]=n>>6|192:(55296==(64512&n)&&t+1<e.length&&56320==(64512&e.charCodeAt(t+1))?(n=65536+((1023&n)<<10)+(1023&e.charCodeAt(++t)),r[s++]=n>>18|240,r[s++]=n>>12&63|128):r[s++]=n>>12|224,r[s++]=n>>6&63|128),r[s++]=63&n|128),r})(e,r)),!1));var i=e.codePointAt(r);i&&65535<i&&r++}return t}function o(e,t,r,o){var a,u,c,l,p="wxmpFormBoundary"+Math.random().toString(16).substring(2),d="--"+p,h=d+"--",f=[];for(a in e)f=f.concat((c=e[u=a],i("".concat(d,'\r\nContent-Disposition: form-data; name="').concat(u,'"\r\n\r\n').concat(c,"\r\n"))));return f=(f=f.concat((t=t,r=r,o=o,(l=(l=i("".concat(l=d,'\r\nContent-Disposition: form-data; name="').concat(t,'"; filename="').concat(o,'"\r\nContent-Type: application/x-zip-compressed\r\n\r\n'))).concat(Array.prototype.slice.call(r))).push.apply(l,n([],s(i("\r\n")),!1)),l))).concat(i(h)),["multipart/form-data; boundary="+p,new Uint8Array(f).buffer]}},function(e,t,r){var s=r(25),n=(r.d(t,"b",(function(){return s.a})),r(21));r.d(t,"a",(function(){return n.ZIM})),r(47),r(48),r(49),r(50),r(51),r(52),r(53),r(54)},function(e,t,r){r.d(t,"a",(function(){return h}));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.Conversation,p=6000121,d=6000212,h=(f.prototype.destroy=function(){this.dbMgr=null,this.cnMgr=null,this.bus=null,this.lg=null,this.econf=null},f.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.lg.i(l,i.u.SendMsg,a),{message:e})}))))):Promise.reject(Object(n.y)(p,i.u.SendMsg))},f.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),Object.assign(e,o),h&&a||!(c<this.econf.cloudSetting.qps.send_msg)?(h&&a||(this.lastSendTime=u),this.emitSendingMessage(e,o,d,s,a?void 0:r),new Promise((function(r,n){f.saveLocalMessage(e,o,i.c.MessageSentStatus.Sending),f.innerSendText(e,o,t,!1,d,s).then(r).catch((function(i){f.isRetrySend(i)?f.addTextSendTask(e,o,t,d,r,n,s):n(f.handleSendMsgFail(e,o,d,i))}))}))):(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))},f.prototype.sendMediaMessage=function(e,t,r,o){var a,u,c,l,d,h,f,m=this;return this.dbMgr&&this.cnMgr&&this.econf?(a=this.copyMsgObj(e),c=!!t.isRetrySend,u={time:new Date,seq:0,convID:this.convID,onattach:c,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),Object.assign(e,a),this.emitSendingMessage(e,a,u,o,c?void 0:r),a.type==i.c.MessageType.Combine&&(a.aesKey=a.aesKey||s.a.getInstance().crypto.generateNonce(),c=a.conversationType,l=a.localMessageID,d=a.conversationID,h=a.aesKey,a.combineID="0-"+c+"_"+l+"_"+h+"-"+d,e.aesKey=a.aesKey,e.combineID=a.combineID),a.fileDownloadUrl||a.fileUID?new Promise((function(r,s){m.saveLocalMessage(e,a,i.c.MessageSentStatus.Sending),m.innerSendText(e,a,t,!1,u,o).then(r).catch((function(n){m.isRetrySend(n)?m.addTextSendTask(e,a,t,u,r,s,o):s(m.handleSendMsgFail(e,a,u,n))}))})):(f=a.type==i.c.MessageType.Combine?this.getCombineMessageFile(a):a.fileLocalPath,this.dbMgr.getFileInfo(f).then((function(s){return a.fileUID=s.md5,a.fileSize=s.size||1,(!a.fileName||a.fileName.indexOf(".")<1)&&(a.fileName=s.name),m.saveLocalMessage(e,a,i.c.MessageSentStatus.Sending),new Promise((function(s,n){m.innerSendMedia(e,a,t,r,f,u,o).then(s).catch((function(c){var l;m.isRetrySend(c)?(l={convID:m.convID,convType:m.convType,retryTime:Date.now(),type:i.c.MessageType.Image,oMessage:e,sMessage:a,config:t,notification:r,file:f,originMessage:o,log:u,resolve:s,reject:n},m.econf.msgRetrySendTasks.push(l)):n(m.handleSendMsgFail(e,a,u,c))}))}))})))):Promise.reject(Object(n.y)(p,i.u.SendMsg))},f.prototype.sendMultipleMessage=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),h=!!t.isRetrySend,a={time:new Date,seq:0,convID:this.convID,onattach:h,message:o},u=this.initSendingMessage(o,t),Object.assign(e,o),this.emitSendingMessage(e,o,a,s,h?void 0:r),c={},d=new Map,o.messageInfoList.forEach((function(e,t){c[e.type]=(c[e.type]||0)+1,e.type>=i.c.MessageType.Image&&e.type<=i.c.MessageType.Video&&(e.fileLocalPath?(d.set(t,e),e.fileName||"object"!=typeof e.fileLocalPath||(e.fileName=e.fileLocalPath.name)):u||(e.fileUID=""))})),h="",(20<o.messageInfoList.length?h="messageInfoList length exceeds 20.":(1<c[i.c.MessageType.Custom]||1<c[i.c.MessageType.File]||1<c[i.c.MessageType.Audio]||1<c[i.c.MessageType.Video]||10<c[i.c.MessageType.Image])&&(h="Item exceeds its limit: "+JSON.stringify(c)))?(o.sentStatus=i.c.MessageSentStatus.Failed,e.sentStatus=o.sentStatus,this.saveLocalMessage(e,o,i.c.MessageSentStatus.Failed),a.error=Object(n.y)(6000001,h),this.lg.w(l,i.u.SendMsg,a),Promise.reject(a.error)):u||!d.size?new Promise((function(r,n){f.saveLocalMessage(e,o,i.c.MessageSentStatus.Sending),f.innerSendText(e,o,t,!1,a,s).then(r).catch((function(i){f.isRetrySend(i)?f.addTextSendTask(e,o,t,a,r,n,s):n(f.handleSendMsgFail(e,o,a,i))}))})):this.getMultipleMsgFileInfos(d,a).then((function(n){var u=n.file_list,c=n.totalUploadData;return f.saveLocalMessage(e,o,i.c.MessageSentStatus.Sending),new Promise((function(n,l){var p={file_list:Object.values(u)};f.uploadMultipleMsg(o,r,p,d,c).then((function(){return f.innerSendText(e,o,t,!0,a,s).then(n)})).catch((function(u){var h;f.isRetrySend(u)?(h={convID:f.convID,convType:f.convType,retryTime:Date.now(),type:i.c.MessageType.Multiple,oMessage:e,sMessage:o,config:t,notification:r,reqBody:p,uploadLiteMap:d,totalUploadData:c,originMessage:s,log:a,resolve:n,reject:l},f.econf.msgRetrySendTasks.push(h)):l(f.handleSendMsgFail(e,o,a,u))}))}))}))):Promise.reject(Object(n.y)(p,i.u.SendMsg))},f.prototype.retrySendMsg=function(e,t,r){var s,n,o,a,u,c,l,p,d,h=this,f=e.oMessage,m=f.localMessageID;this.econf.msgRetrySendTasks.some((function(e){return e.oMessage.localMessageID==m}))&&(r?e.reject(this.handleSendMsgFail(f,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){h.delRetrySendTask(m),e.resolve(t)},o=function(t){h.isRetrySend(t)&&e.log.retryCount<s?(e.log.retryCount++,h.retrySendMsg(e,!1)):(h.delRetrySendTask(m),e.reject(h.handleSendMsgFail(f,e.sMessage,e.log,t)))},e.type==i.c.MessageType.Text?(a=e.sMessage,u=e.config,c=e.originMessage,t?setTimeout((function(){h.innerSendText(f,a,u,!1,e.log,c).then(n).catch(o)}),this.econf.cloudSetting.retry.msg_itvl):this.innerSendText(f,a,u,!1,e.log,c).then(n).catch(o)):e.type==i.c.MessageType.Image?(r=e.sMessage,this.innerSendMedia(f,r,e.config,e.notification,e.file,e.log,e.originMessage).then(n).catch(o)):e.type==i.c.MessageType.Multiple&&(l=e.sMessage,p=e.config,d=e.originMessage,this.uploadMultipleMsg(l,e.notification,e.reqBody,e.uploadLiteMap,e.totalUploadData).then((function(){return h.innerSendText(f,l,p,!0,e.log,d).then(n)})).catch(o))))},f.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=6000001,c=a.get(r);if(!c)return Promise.reject(Object(n.y)(u,"The message no found in DB."));if(c.type!=e.type)return Promise.reject(Object(n.y)(u,"Message type can not changed."));a=Promise.resolve(!1);var p={conv_id:o.convID,conv_msg_seq:c.messageSeq,msg_type:c.type,msg_id:c.messageID},d=0,h=((c.extendedData||"")!=(e.extendedData||"")&&(d|=2,p.payload=Object(n.j)(e.extendedData)),Array.isArray(c.mentionedUserIDs)?c.mentionedUserIDs:[]),f=Array.isArray(e.mentionedUserIDs)?e.mentionedUserIDs:[],m=(h=(s.oAtList=h,s.sAtList=f,(h.length!=f.length||h.some((function(e){return-1==f.indexOf(e)}))||f.length)&&(d|=4,p.at_list=f),!!c.isMentionAll),!!e.isMentionAll);if((s.oAtAll=h)==(s.sAtAll=m)&&!m||(d|=8,p.is_at_all=m),c.type==i.c.MessageType.Custom&&(e.searchedContent=c.searchedContent,(c.subType||0)!=(e.subType||0))&&(d|=16,p.sub_msg_type=e.subType),c.type!=i.c.MessageType.Text&&c.type!=i.c.MessageType.Custom||c.message==e.message){if(c.type==i.c.MessageType.Multiple){d|=1;var g={},_=new Map;h=(e.messageInfoList.forEach((function(e,t){g[e.type]=(g[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?h="messageInfoList length exceeds 20.":(1<g[i.c.MessageType.Custom]||1<g[i.c.MessageType.File]||1<g[i.c.MessageType.Audio]||1<g[i.c.MessageType.Video]||10<g[i.c.MessageType.Image])&&(h="Item exceeds its limit: "+JSON.stringify(g)))return Promise.reject(Object(n.y)(u,h));_.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 d|=1,p.msg=Object(n.j)(e.message);return(p.edit_type=d)?(t&&"function"==typeof t.onMessageAttached&&setTimeout((function(){try{t.onMessageAttached(e)}catch(e){}}),0),a.then((function(t){var r,a,u;return e.type==i.c.MessageType.Multiple&&(r=e.messageInfoList,a=c.messageInfoList,s.oInfos=a,u=[],(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}))?u.push(t):void 0})),p.audit_list=u,p.msg=o.encodeMsgBody(e,!1,!1)),o.cnMgr.send(i.d["msg_edit_"+o.convType],p).then((function(r){return r.code?(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),t&&o.pb.decodeMsgBody(o.econf,e,r.msg_rsp),e.editSeq=r.edit_msg_seq,e.editedTime=r.edit_time,e.editorUserID=o.econf.user.userID,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(e))})),o.lg.i(l,i.u.EditMsg,s),{message:e})}))}))):Promise.reject(Object(n.y)(u,"No changed fields."))}))):Promise.reject(Object(n.y)(p,i.u.EditMsg))},f.prototype.deleteMessages=function(e,t){var r=this,s={time:new Date,convID:this.convID,config:t};return t&&t.isAlsoDele