nim-web-sdk-ng 0.19.0 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHATROOM_BROWSER_SDK.js +4 -4
- package/dist/CHATROOM_MINIAPP_SDK.js +4 -4
- package/dist/CHATROOM_UNIAPP_SDK.js +4 -4
- package/dist/NIM_BROWSER_SDK/OfflinePushInterface.d.ts +4 -8
- package/dist/NIM_BROWSER_SDK/SignalingServiceInterface.d.ts +22 -0
- package/dist/NIM_BROWSER_SDK.js +4 -4
- package/dist/NIM_MINIAPP_SDK/OfflinePushInterface.d.ts +4 -8
- package/dist/NIM_MINIAPP_SDK/SignalingServiceInterface.d.ts +22 -0
- package/dist/NIM_MINIAPP_SDK.js +4 -4
- package/dist/NIM_UNIAPP_SDK.js +4 -4
- package/dist/QCHAT_BROWSER_SDK.js +4 -4
- package/dist/QCHAT_UNIAPP_SDK.js +4 -4
- package/dist/esm/index.js +4 -4
- package/dist/esm/nim/src/OfflinePushInterface.d.ts +4 -8
- package/dist/esm/nim/src/SignalingServiceInterface.d.ts +22 -0
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
* Version: 0.19.
|
|
3
|
+
* Version: 0.19.2
|
|
4
4
|
*
|
|
5
|
-
* Git Hash:
|
|
5
|
+
* Git Hash: 4c6efcfd89422dc377ec2d0080309e3910d77f24
|
|
6
6
|
*
|
|
7
|
-
* Created At: 2024/
|
|
7
|
+
* Created At: 2024/9/19 15:56:28
|
|
8
8
|
*
|
|
9
9
|
* Target: CHATROOM_BROWSER_SDK.js
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
!function(t,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define(a):(t="undefined"!=typeof globalThis?globalThis:t||self).Chatroom=a()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t){var a={exports:{}};return t(a,a.exports),a.exports}var a,u,h=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports}))),check=function(t){return t&&t.Math==Math&&t},m=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||function(){return this}()||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},g=!fails((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),b=Function.prototype,w=b.apply,x=b.call,k="object"==typeof Reflect&&Reflect.apply||(g?x.bind(w):function(){return x.apply(w,arguments)}),S=Function.prototype,_=S.bind,C=S.call,T=g&&_.bind(C,C),M=g?function(t){return t&&T(t)}:function(t){return t&&function(){return C.apply(t,arguments)}},isCallable=function(t){return"function"==typeof t},E=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),P=Function.prototype.call,O=g?P.bind(P):function(){return P.apply(P,arguments)},I={}.propertyIsEnumerable,A=Object.getOwnPropertyDescriptor,j={f:A&&!I.call({1:2},1)?function propertyIsEnumerable(t){var a=A(this,t);return!!a&&a.enumerable}:I},createPropertyDescriptor=function(t,a){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:a}},R=M({}.toString),L=M("".slice),classofRaw=function(t){return L(R(t),8,-1)},N=Object,U=M("".split),D=fails((function(){return!N("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?U(t,""):N(t)}:N,isNullOrUndefined=function(t){return null==t},B=TypeError,requireObjectCoercible=function(t){if(isNullOrUndefined(t))throw B("Can't call method on "+t);return t},toIndexedObject=function(t){return D(requireObjectCoercible(t))},q="object"==typeof document&&document.all,G=void 0===q&&void 0!==q?function(t){return"object"==typeof t?null!==t:isCallable(t)||t===q}:function(t){return"object"==typeof t?null!==t:isCallable(t)},H={},aFunction=function(t){return isCallable(t)?t:void 0},getBuiltIn=function(t,a){return arguments.length<2?aFunction(H[t])||aFunction(m[t]):H[t]&&H[t][a]||m[t]&&m[t][a]},z=M({}.isPrototypeOf),K=getBuiltIn("navigator","userAgent")||"",$=m.process,W=m.Deno,V=$&&$.versions||W&&W.version,Q=V&&V.v8;Q&&(u=(a=Q.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!u&&K&&(!(a=K.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=K.match(/Chrome\/(\d+)/))&&(u=+a[1]);var J,Y=u,X=!!Object.getOwnPropertySymbols&&!fails((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Y&&Y<41})),Z=X&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ee=Object,te=Z?function(t){return"symbol"==typeof t}:function(t){var a=getBuiltIn("Symbol");return isCallable(a)&&z(a.prototype,ee(t))},re=String,tryToString=function(t){try{return re(t)}catch(t){return"Object"}},ne=TypeError,aCallable=function(t){if(isCallable(t))return t;throw ne(tryToString(t)+" is not a function")},getMethod=function(t,a){var u=t[a];return isNullOrUndefined(u)?void 0:aCallable(u)},oe=TypeError,ie=Object.defineProperty,ae="__core-js_shared__",se=m[ae]||function(t,a){try{ie(m,t,{value:a,configurable:!0,writable:!0})}catch(u){m[t]=a}return a}(ae,{}),ce=createCommonjsModule((function(t){(t.exports=function(t,a){return se[t]||(se[t]=void 0!==a?a:{})})("versions",[]).push({version:"3.25.0",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE",source:"https://github.com/zloirock/core-js"})})),ue=Object,toObject=function(t){return ue(requireObjectCoercible(t))},le=M({}.hasOwnProperty),fe=Object.hasOwn||function hasOwn(t,a){return le(toObject(t),a)},pe=0,de=Math.random(),he=M(1..toString),uid=function(t){return"Symbol("+(void 0===t?"":t)+")_"+he(++pe+de,36)},me=ce("wks"),ge=m.Symbol,ve=ge&&ge.for,ye=Z?ge:ge&&ge.withoutSetter||uid,wellKnownSymbol=function(t){if(!fe(me,t)||!X&&"string"!=typeof me[t]){var a="Symbol."+t;X&&fe(ge,t)?me[t]=ge[t]:me[t]=Z&&ve?ve(a):ye(a)}return me[t]},be=TypeError,we=wellKnownSymbol("toPrimitive"),toPrimitive=function(t,a){if(!G(t)||te(t))return t;var u,h=getMethod(t,we);if(h){if(void 0===a&&(a="default"),u=O(h,t,a),!G(u)||te(u))return u;throw be("Can't convert object to primitive value")}return void 0===a&&(a="number"),function(t,a){var u,h;if("string"===a&&isCallable(u=t.toString)&&!G(h=O(u,t)))return h;if(isCallable(u=t.valueOf)&&!G(h=O(u,t)))return h;if("string"!==a&&isCallable(u=t.toString)&&!G(h=O(u,t)))return h;throw oe("Can't convert object to primitive value")}(t,a)},toPropertyKey=function(t){var a=toPrimitive(t,"string");return te(a)?a:a+""},xe=m.document,ke=G(xe)&&G(xe.createElement),documentCreateElement=function(t){return ke?xe.createElement(t):{}},Se=!E&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),_e=Object.getOwnPropertyDescriptor,Ce={f:E?_e:function getOwnPropertyDescriptor(t,a){if(t=toIndexedObject(t),a=toPropertyKey(a),Se)try{return _e(t,a)}catch(t){}if(fe(t,a))return createPropertyDescriptor(!O(j.f,t,a),t[a])}},Te=/#|\.prototype\./,isForced=function(t,a){var u=Ee[Me(t)];return u==Oe||u!=Pe&&(isCallable(a)?fails(a):!!a)},Me=isForced.normalize=function(t){return String(t).replace(Te,".").toLowerCase()},Ee=isForced.data={},Pe=isForced.NATIVE="N",Oe=isForced.POLYFILL="P",Ie=isForced,Ae=M(M.bind),functionBindContext=function(t,a){return aCallable(t),void 0===a?t:g?Ae(t,a):function(){return t.apply(a,arguments)}},je=E&&fails((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Re=String,Le=TypeError,anObject=function(t){if(G(t))return t;throw Le(Re(t)+" is not an object")},Fe=TypeError,Ne=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,De="enumerable",Be="configurable",qe="writable",Ge={f:E?je?function defineProperty(t,a,u){if(anObject(t),a=toPropertyKey(a),anObject(u),"function"==typeof t&&"prototype"===a&&"value"in u&&qe in u&&!u.writable){var h=Ue(t,a);h&&h.writable&&(t[a]=u.value,u={configurable:Be in u?u.configurable:h.configurable,enumerable:De in u?u.enumerable:h.enumerable,writable:!1})}return Ne(t,a,u)}:Ne:function defineProperty(t,a,u){if(anObject(t),a=toPropertyKey(a),anObject(u),Se)try{return Ne(t,a,u)}catch(t){}if("get"in u||"set"in u)throw Fe("Accessors not supported");return"value"in u&&(t[a]=u.value),t}},He=E?function(t,a,u){return Ge.f(t,a,createPropertyDescriptor(1,u))}:function(t,a,u){return t[a]=u,t},ze=Ce.f,wrapConstructor=function(t){var Wrapper=function(a,u,h){if(this instanceof Wrapper){switch(arguments.length){case 0:return new t;case 1:return new t(a);case 2:return new t(a,u)}return new t(a,u,h)}return k(t,this,arguments)};return Wrapper.prototype=t.prototype,Wrapper},_export=function(t,a){var u,h,g,b,w,x,k,S,_=t.target,C=t.global,T=t.stat,E=t.proto,P=C?m:T?m[_]:(m[_]||{}).prototype,O=C?H:H[_]||He(H,_,{})[_],I=O.prototype;for(g in a)u=!Ie(C?g:_+(T?".":"#")+g,t.forced)&&P&&fe(P,g),w=O[g],u&&(x=t.dontCallGetSet?(S=ze(P,g))&&S.value:P[g]),b=u&&x?x:a[g],u&&typeof w==typeof b||(k=t.bind&&u?functionBindContext(b,m):t.wrap&&u?wrapConstructor(b):E&&isCallable(b)?M(b):b,(t.sham||b&&b.sham||w&&w.sham)&&He(k,"sham",!0),He(O,g,k),E&&(fe(H,h=_+"Prototype")||He(H,h,{}),He(H[h],g,b),t.real&&I&&!I[g]&&He(I,g,b)))},Ke=Math.ceil,$e=Math.floor,We=Math.trunc||function trunc(t){var a=+t;return(a>0?$e:Ke)(a)},toIntegerOrInfinity=function(t){var a=+t;return a!=a||0===a?0:We(a)},Ve=Math.max,Qe=Math.min,toAbsoluteIndex=function(t,a){var u=toIntegerOrInfinity(t);return u<0?Ve(u+a,0):Qe(u,a)},Je=Math.min,lengthOfArrayLike=function(t){return(a=t.length)>0?Je(toIntegerOrInfinity(a),9007199254740991):0;var a},createMethod$4=function(t){return function(a,u,h){var m,g=toIndexedObject(a),b=lengthOfArrayLike(g),w=toAbsoluteIndex(h,b);if(t&&u!=u){for(;b>w;)if((m=g[w++])!=m)return!0}else for(;b>w;w++)if((t||w in g)&&g[w]===u)return t||w||0;return!t&&-1}},Ye={includes:createMethod$4(!0),indexOf:createMethod$4(!1)},Xe={},Ze=Ye.indexOf,et=M([].push),objectKeysInternal=function(t,a){var u,h=toIndexedObject(t),m=0,g=[];for(u in h)!fe(Xe,u)&&fe(h,u)&&et(g,u);for(;a.length>m;)fe(h,u=a[m++])&&(~Ze(g,u)||et(g,u));return g},tt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rt=Object.keys||function keys(t){return objectKeysInternal(t,tt)},nt=E&&!je?Object.defineProperties:function defineProperties(t,a){anObject(t);for(var u,h=toIndexedObject(a),m=rt(a),g=m.length,b=0;g>b;)Ge.f(t,u=m[b++],h[u]);return t},ot={f:nt},it=getBuiltIn("document","documentElement"),at=ce("keys"),sharedKey=function(t){return at[t]||(at[t]=uid(t))},st=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag("")),t.close();var a=t.parentWindow.Object;return t=null,a},NullProtoObject=function(){try{J=new ActiveXObject("htmlfile")}catch(t){}var t,a;NullProtoObject="undefined"!=typeof document?document.domain&&J?NullProtoObjectViaActiveX(J):((a=documentCreateElement("iframe")).style.display="none",it.appendChild(a),a.src=String("javascript:"),(t=a.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F):NullProtoObjectViaActiveX(J);for(var u=tt.length;u--;)delete NullProtoObject.prototype[tt[u]];return NullProtoObject()};Xe[st]=!0;var ct=Object.create||function create(t,a){var u;return null!==t?(EmptyConstructor.prototype=anObject(t),u=new EmptyConstructor,EmptyConstructor.prototype=null,u[st]=t):u=NullProtoObject(),void 0===a?u:ot.f(u,a)};_export({target:"Object",stat:!0,sham:!E},{create:ct});var ut=H.Object,lt=function create(t,a){return ut.create(t,a)},ft=String,pt=TypeError,dt=Object.setPrototypeOf||("__proto__"in{}?function(){var t,a=!1,u={};try{(t=M(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(u,[]),a=u instanceof Array}catch(t){}return function setPrototypeOf(u,h){return anObject(u),function(t){if("object"==typeof t||isCallable(t))return t;throw pt("Can't set "+ft(t)+" as a prototype")}(h),a?t(u,h):u.__proto__=h,u}}():void 0);_export({target:"Object",stat:!0},{setPrototypeOf:dt});var ht=H.Object.setPrototypeOf,mt=M([].slice),gt=Function,vt=M([].concat),yt=M([].join),bt={},construct$8=function(t,a,u){if(!fe(bt,a)){for(var h=[],m=0;m<a;m++)h[m]="a["+m+"]";bt[a]=gt("C,a","return new C("+yt(h,",")+")")}return bt[a](t,u)},wt=g?gt.bind:function bind(t){var a=aCallable(this),u=a.prototype,h=mt(arguments,1),m=function bound(){var u=vt(h,mt(arguments));return this instanceof m?construct$8(a,u.length,u):a.apply(t,u)};return G(u)&&(m.prototype=u),m};_export({target:"Function",proto:!0,forced:Function.bind!==wt},{bind:wt});var entryVirtual=function(t){return H[t+"Prototype"]},xt=entryVirtual("Function").bind,kt=Function.prototype,bind$1=function(t){var a=t.bind;return t===kt||z(kt,t)&&a===kt.bind?xt:a},St=createCommonjsModule((function(t){function _setPrototypeOf(a,u){var h;return t.exports=_setPrototypeOf=ht?bind$1(h=ht).call(h):function _setPrototypeOf(t,a){return t.__proto__=a,t},t.exports.__esModule=!0,t.exports.default=t.exports,_setPrototypeOf(a,u)}t.exports=_setPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),_t=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _inheritsLoose(t,a){t.prototype=lt(a.prototype),t.prototype.constructor=t,St(t,a)},t.exports.__esModule=!0,t.exports.default=t.exports})));_export({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991});var Ct={f:Object.getOwnPropertySymbols},Tt=Object.assign,Mt=Object.defineProperty,Et=M([].concat),Pt=!Tt||fails((function(){if(E&&1!==Tt({b:1},Tt(Mt({},"a",{enumerable:!0,get:function(){Mt(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},a={},u=Symbol(),h="abcdefghijklmnopqrst";return t[u]=7,h.split("").forEach((function(t){a[t]=t})),7!=Tt({},t)[u]||rt(Tt({},a)).join("")!=h}))?function assign(t,a){for(var u=toObject(t),h=arguments.length,m=1,g=Ct.f,b=j.f;h>m;)for(var w,x=D(arguments[m++]),k=g?Et(rt(x),g(x)):rt(x),S=k.length,_=0;S>_;)w=k[_++],E&&!O(b,x,w)||(u[w]=x[w]);return u}:Tt;_export({target:"Object",stat:!0,arity:2,forced:Object.assign!==Pt},{assign:Pt});var Ot=H.Object.assign,It=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),At=sharedKey("IE_PROTO"),jt=Object,Rt=jt.prototype,Lt=It?jt.getPrototypeOf:function(t){var a=toObject(t);if(fe(a,At))return a[At];var u=a.constructor;return isCallable(u)&&a instanceof u?u.prototype:a instanceof jt?Rt:null},Ft=tt.concat("length","prototype"),Nt={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,Ft)}},Ut=M([].concat),Dt=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var a=Nt.f(anObject(t)),u=Ct.f;return u?Ut(a,u(t)):a},Bt=Error,qt=M("".replace),Gt=String(Bt("zxcasd").stack),Ht=/\n\s*at [^:]*:[^\n]*/,zt=Ht.test(Gt),errorStackClear=function(t,a){if(zt&&"string"==typeof t&&!Bt.prepareStackTrace)for(;a--;)t=qt(t,Ht,"");return t},installErrorCause=function(t,a){G(a)&&"cause"in a&&He(t,"cause",a.cause)},Kt={},$t=wellKnownSymbol("iterator"),Wt=Array.prototype,isArrayIteratorMethod=function(t){return void 0!==t&&(Kt.Array===t||Wt[$t]===t)},Vt={};Vt[wellKnownSymbol("toStringTag")]="z";var Qt="[object z]"===String(Vt),Jt=wellKnownSymbol("toStringTag"),Yt=Object,Xt="Arguments"==classofRaw(function(){return arguments}()),Zt=Qt?classofRaw:function(t){var a,u,h;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(u=function(t,a){try{return t[a]}catch(t){}}(a=Yt(t),Jt))?u:Xt?classofRaw(a):"Object"==(h=classofRaw(a))&&isCallable(a.callee)?"Arguments":h},er=wellKnownSymbol("iterator"),getIteratorMethod$5=function(t){if(!isNullOrUndefined(t))return getMethod(t,er)||getMethod(t,"@@iterator")||Kt[Zt(t)]},tr=TypeError,getIterator=function(t,a){var u=arguments.length<2?getIteratorMethod$5(t):a;if(aCallable(u))return anObject(O(u,t));throw tr(tryToString(t)+" is not iterable")},iteratorClose=function(t,a,u){var h,m;anObject(t);try{if(!(h=getMethod(t,"return"))){if("throw"===a)throw u;return u}h=O(h,t)}catch(t){m=!0,h=t}if("throw"===a)throw u;if(m)throw h;return anObject(h),u},rr=TypeError,Result=function(t,a){this.stopped=t,this.result=a},nr=Result.prototype,iterate=function(t,a,u){var h,m,g,b,w,x,k,S=u&&u.that,_=!(!u||!u.AS_ENTRIES),C=!(!u||!u.IS_RECORD),T=!(!u||!u.IS_ITERATOR),M=!(!u||!u.INTERRUPTED),E=functionBindContext(a,S),stop=function(t){return h&&iteratorClose(h,"normal",t),new Result(!0,t)},callFn=function(t){return _?(anObject(t),M?E(t[0],t[1],stop):E(t[0],t[1])):M?E(t,stop):E(t)};if(C)h=t.iterator;else if(T)h=t;else{if(!(m=getIteratorMethod$5(t)))throw rr(tryToString(t)+" is not iterable");if(isArrayIteratorMethod(m)){for(g=0,b=lengthOfArrayLike(t);b>g;g++)if((w=callFn(t[g]))&&z(nr,w))return w;return new Result(!1)}h=getIterator(t,m)}for(x=C?t.next:h.next;!(k=O(x,h)).done;){try{w=callFn(k.value)}catch(t){iteratorClose(h,"throw",t)}if("object"==typeof w&&w&&z(nr,w))return w}return new Result(!1)},or=String,toString$1=function(t){if("Symbol"===Zt(t))throw TypeError("Cannot convert a Symbol value to a string");return or(t)},normalizeStringArgument=function(t,a){return void 0===t?arguments.length<2?"":a:toString$1(t)},ir=!fails((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",createPropertyDescriptor(1,7)),7!==t.stack)})),ar=wellKnownSymbol("toStringTag"),sr=Error,cr=[].push,ur=function AggregateError(t,a){var u,h=arguments.length>2?arguments[2]:void 0,m=z(lr,this);dt?u=dt(sr(),m?Lt(this):lr):(u=m?this:ct(lr),He(u,ar,"Error")),void 0!==a&&He(u,"message",normalizeStringArgument(a)),ir&&He(u,"stack",errorStackClear(u.stack,1)),installErrorCause(u,h);var g=[];return iterate(t,cr,{that:g}),He(u,"errors",g),u};dt?dt(ur,sr):function(t,a,u){for(var h=Dt(a),m=Ge.f,g=Ce.f,b=0;b<h.length;b++){var w=h[b];fe(t,w)||u&&fe(u,w)||m(t,w,g(a,w))}}(ur,sr,{name:!0});var lr=ur.prototype=ct(sr.prototype,{constructor:createPropertyDescriptor(1,ur),message:createPropertyDescriptor(1,""),name:createPropertyDescriptor(1,"AggregateError")});_export({global:!0,constructor:!0,arity:2},{AggregateError:ur});var fr,pr,dr,hr=m.WeakMap,mr=isCallable(hr)&&/native code/.test(String(hr)),gr="Object already initialized",vr=m.TypeError,yr=m.WeakMap;if(mr||se.state){var br=se.state||(se.state=new yr),wr=M(br.get),xr=M(br.has),kr=M(br.set);fr=function(t,a){if(xr(br,t))throw vr(gr);return a.facade=t,kr(br,t,a),a},pr=function(t){return wr(br,t)||{}},dr=function(t){return xr(br,t)}}else{var Sr=sharedKey("state");Xe[Sr]=!0,fr=function(t,a){if(fe(t,Sr))throw vr(gr);return a.facade=t,He(t,Sr,a),a},pr=function(t){return fe(t,Sr)?t[Sr]:{}},dr=function(t){return fe(t,Sr)}}var _r,Cr,Tr,Mr={set:fr,get:pr,has:dr,enforce:function(t){return dr(t)?pr(t):fr(t,{})},getterFor:function(t){return function(a){var u;if(!G(a)||(u=pr(a)).type!==t)throw vr("Incompatible receiver, "+t+" required");return u}}},Er=Function.prototype,Pr=E&&Object.getOwnPropertyDescriptor,Or=fe(Er,"name"),Ir={EXISTS:Or,PROPER:Or&&"something"===function something(){}.name,CONFIGURABLE:Or&&(!E||E&&Pr(Er,"name").configurable)},defineBuiltIn=function(t,a,u,h){return h&&h.enumerable?t[a]=u:He(t,a,u),t},Ar=wellKnownSymbol("iterator"),jr=!1;[].keys&&("next"in(Tr=[].keys())?(Cr=Lt(Lt(Tr)))!==Object.prototype&&(_r=Cr):jr=!0);var Rr=!G(_r)||fails((function(){var t={};return _r[Ar].call(t)!==t}));_r=Rr?{}:ct(_r),isCallable(_r[Ar])||defineBuiltIn(_r,Ar,(function(){return this}));var Lr={IteratorPrototype:_r,BUGGY_SAFARI_ITERATORS:jr},Fr=Qt?{}.toString:function toString(){return"[object "+Zt(this)+"]"},Nr=Ge.f,Ur=wellKnownSymbol("toStringTag"),setToStringTag=function(t,a,u,h){if(t){var m=u?t:t.prototype;fe(m,Ur)||Nr(m,Ur,{configurable:!0,value:a}),h&&!Qt&&He(m,"toString",Fr)}},Dr=Lr.IteratorPrototype,returnThis$1=function(){return this},Br=Ir.PROPER,qr=Lr.BUGGY_SAFARI_ITERATORS,Gr=wellKnownSymbol("iterator"),Hr="keys",zr="values",Kr="entries",returnThis=function(){return this},iteratorDefine=function(t,a,u,h,m,g,b){!function(t,a,u,h){var m=a+" Iterator";t.prototype=ct(Dr,{next:createPropertyDescriptor(+!h,u)}),setToStringTag(t,m,!1,!0),Kt[m]=returnThis$1}(u,a,h);var w,x,k,getIterationMethod=function(t){if(t===m&&M)return M;if(!qr&&t in C)return C[t];switch(t){case Hr:return function keys(){return new u(this,t)};case zr:return function values(){return new u(this,t)};case Kr:return function entries(){return new u(this,t)}}return function(){return new u(this)}},S=a+" Iterator",_=!1,C=t.prototype,T=C[Gr]||C["@@iterator"]||m&&C[m],M=!qr&&T||getIterationMethod(m),E="Array"==a&&C.entries||T;if(E&&(w=Lt(E.call(new t)))!==Object.prototype&&w.next&&(setToStringTag(w,S,!0,!0),Kt[S]=returnThis),Br&&m==zr&&T&&T.name!==zr&&(_=!0,M=function values(){return O(T,this)}),m)if(x={values:getIterationMethod(zr),keys:g?M:getIterationMethod(Hr),entries:getIterationMethod(Kr)},b)for(k in x)(qr||_||!(k in C))&&defineBuiltIn(C,k,x[k]);else _export({target:a,proto:!0,forced:qr||_},x);return b&&C[Gr]!==M&&defineBuiltIn(C,Gr,M,{name:m}),Kt[a]=M,x};Ge.f;var $r="Array Iterator",Wr=Mr.set,Vr=Mr.getterFor($r);iteratorDefine(Array,"Array",(function(t,a){Wr(this,{type:$r,target:toIndexedObject(t),index:0,kind:a})}),(function(){var t=Vr(this),a=t.target,u=t.kind,h=t.index++;return!a||h>=a.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==u?{value:h,done:!1}:"values"==u?{value:a[h],done:!1}:{value:[h,a[h]],done:!1}}),"values"),Kt.Arguments=Kt.Array;var Qr="process"==classofRaw(m.process),Jr=wellKnownSymbol("species"),setSpecies=function(t){var a=getBuiltIn(t),u=Ge.f;E&&a&&!a[Jr]&&u(a,Jr,{configurable:!0,get:function(){return this}})},Yr=TypeError,anInstance=function(t,a){if(z(a,t))return t;throw Yr("Incorrect invocation")},Xr=M(Function.toString);isCallable(se.inspectSource)||(se.inspectSource=function(t){return Xr(t)});var Zr=se.inspectSource,noop$1=function(){},en=[],tn=getBuiltIn("Reflect","construct"),rn=/^\s*(?:class|function)\b/,nn=M(rn.exec),an=!rn.exec(noop$1),sn=function isConstructor(t){if(!isCallable(t))return!1;try{return tn(noop$1,en,t),!0}catch(t){return!1}},cn=function isConstructor(t){if(!isCallable(t))return!1;switch(Zt(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return an||!!nn(rn,Zr(t))}catch(t){return!0}};cn.sham=!0;var un,ln,fn,pn,dn=!tn||fails((function(){var t;return sn(sn.call)||!sn(Object)||!sn((function(){t=!0}))||t}))?cn:sn,hn=TypeError,aConstructor=function(t){if(dn(t))return t;throw hn(tryToString(t)+" is not a constructor")},mn=wellKnownSymbol("species"),speciesConstructor=function(t,a){var u,h=anObject(t).constructor;return void 0===h||isNullOrUndefined(u=anObject(h)[mn])?a:aConstructor(u)},gn=TypeError,validateArgumentsLength=function(t,a){if(t<a)throw gn("Not enough arguments");return t},vn=/(?:ipad|iphone|ipod).*applewebkit/i.test(K),yn=m.setImmediate,bn=m.clearImmediate,wn=m.process,xn=m.Dispatch,kn=m.Function,Sn=m.MessageChannel,_n=m.String,Cn=0,Tn={},Mn="onreadystatechange";try{un=m.location}catch(t){}var run=function(t){if(fe(Tn,t)){var a=Tn[t];delete Tn[t],a()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){m.postMessage(_n(t),un.protocol+"//"+un.host)};yn&&bn||(yn=function setImmediate(t){validateArgumentsLength(arguments.length,1);var a=isCallable(t)?t:kn(t),u=mt(arguments,1);return Tn[++Cn]=function(){k(a,void 0,u)},ln(Cn),Cn},bn=function clearImmediate(t){delete Tn[t]},Qr?ln=function(t){wn.nextTick(runner(t))}:xn&&xn.now?ln=function(t){xn.now(runner(t))}:Sn&&!vn?(pn=(fn=new Sn).port2,fn.port1.onmessage=listener,ln=functionBindContext(pn.postMessage,pn)):m.addEventListener&&isCallable(m.postMessage)&&!m.importScripts&&un&&"file:"!==un.protocol&&!fails(post)?(ln=post,m.addEventListener("message",listener,!1)):ln=Mn in documentCreateElement("script")?function(t){it.appendChild(documentCreateElement("script")).onreadystatechange=function(){it.removeChild(this),run(t)}}:function(t){setTimeout(runner(t),0)});var En,Pn,On,In,An,jn,Rn,Ln,Fn={set:yn,clear:bn},Nn=/ipad|iphone|ipod/i.test(K)&&void 0!==m.Pebble,Un=/web0s(?!.*chrome)/i.test(K),Dn=Ce.f,Bn=Fn.set,qn=m.MutationObserver||m.WebKitMutationObserver,Gn=m.document,Hn=m.process,zn=m.Promise,Kn=Dn(m,"queueMicrotask"),$n=Kn&&Kn.value;$n||(En=function(){var t,a;for(Qr&&(t=Hn.domain)&&t.exit();Pn;){a=Pn.fn,Pn=Pn.next;try{a()}catch(t){throw Pn?In():On=void 0,t}}On=void 0,t&&t.enter()},vn||Qr||Un||!qn||!Gn?!Nn&&zn&&zn.resolve?((Rn=zn.resolve(void 0)).constructor=zn,Ln=functionBindContext(Rn.then,Rn),In=function(){Ln(En)}):Qr?In=function(){Hn.nextTick(En)}:(Bn=functionBindContext(Bn,m),In=function(){Bn(En)}):(An=!0,jn=Gn.createTextNode(""),new qn(En).observe(jn,{characterData:!0}),In=function(){jn.data=An=!An}));var Wn=$n||function(t){var a={fn:t,next:void 0};On&&(On.next=a),Pn||(Pn=a,In()),On=a},perform=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Queue=function(){this.head=null,this.tail=null};Queue.prototype={add:function(t){var a={item:t,next:null};this.head?this.tail.next=a:this.head=a,this.tail=a},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var Vn,Qn,Jn=Queue,Yn=m.Promise,Xn="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Zn=!Xn&&!Qr&&"object"==typeof window&&"object"==typeof document,eo=Yn&&Yn.prototype,to=wellKnownSymbol("species"),ro=!1,no=isCallable(m.PromiseRejectionEvent),oo=Ie("Promise",(function(){var t=Zr(Yn),a=t!==String(Yn);if(!a&&66===Y)return!0;if(!eo.catch||!eo.finally)return!0;if(!Y||Y<51||!/native code/.test(t)){var u=new Yn((function(t){t(1)})),FakePromise=function(t){t((function(){}),(function(){}))};if((u.constructor={})[to]=FakePromise,!(ro=u.then((function(){}))instanceof FakePromise))return!0}return!a&&(Zn||Xn)&&!no})),io={CONSTRUCTOR:oo,REJECTION_EVENT:no,SUBCLASSING:ro},ao=TypeError,PromiseCapability=function(t){var a,u;this.promise=new t((function(t,h){if(void 0!==a||void 0!==u)throw ao("Bad Promise constructor");a=t,u=h})),this.resolve=aCallable(a),this.reject=aCallable(u)},so={f:function(t){return new PromiseCapability(t)}},co=Fn.set,uo="Promise",lo=io.CONSTRUCTOR,fo=io.REJECTION_EVENT,po=Mr.getterFor(uo),ho=Mr.set,mo=Yn&&Yn.prototype,go=Yn,vo=mo,yo=m.TypeError,bo=m.document,wo=m.process,xo=so.f,ko=xo,So=!!(bo&&bo.createEvent&&m.dispatchEvent),_o="unhandledrejection",isThenable=function(t){var a;return!(!G(t)||!isCallable(a=t.then))&&a},callReaction=function(t,a){var u,h,m,g=a.value,b=1==a.state,w=b?t.ok:t.fail,x=t.resolve,k=t.reject,S=t.domain;try{w?(b||(2===a.rejection&&onHandleUnhandled(a),a.rejection=1),!0===w?u=g:(S&&S.enter(),u=w(g),S&&(S.exit(),m=!0)),u===t.promise?k(yo("Promise-chain cycle")):(h=isThenable(u))?O(h,u,x,k):x(u)):k(g)}catch(t){S&&!m&&S.exit(),k(t)}},notify=function(t,a){t.notified||(t.notified=!0,Wn((function(){for(var u,h=t.reactions;u=h.get();)callReaction(u,t);t.notified=!1,a&&!t.rejection&&onUnhandled(t)})))},dispatchEvent=function(t,a,u){var h,g;So?((h=bo.createEvent("Event")).promise=a,h.reason=u,h.initEvent(t,!1,!0),m.dispatchEvent(h)):h={promise:a,reason:u},!fo&&(g=m["on"+t])?g(h):t===_o&&function(t,a){var u=m.console;u&&u.error&&(1==arguments.length?u.error(t):u.error(t,a))}("Unhandled promise rejection",u)},onUnhandled=function(t){O(co,m,(function(){var a,u=t.facade,h=t.value;if(isUnhandled(t)&&(a=perform((function(){Qr?wo.emit("unhandledRejection",h,u):dispatchEvent(_o,u,h)})),t.rejection=Qr||isUnhandled(t)?2:1,a.error))throw a.value}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){O(co,m,(function(){var a=t.facade;Qr?wo.emit("rejectionHandled",a):dispatchEvent("rejectionhandled",a,t.value)}))},bind=function(t,a,u){return function(h){t(a,h,u)}},internalReject=function(t,a,u){t.done||(t.done=!0,u&&(t=u),t.value=a,t.state=2,notify(t,!0))},internalResolve=function(t,a,u){if(!t.done){t.done=!0,u&&(t=u);try{if(t.facade===a)throw yo("Promise can't be resolved itself");var h=isThenable(a);h?Wn((function(){var u={done:!1};try{O(h,a,bind(internalResolve,u,t),bind(internalReject,u,t))}catch(a){internalReject(u,a,t)}})):(t.value=a,t.state=1,notify(t,!1))}catch(a){internalReject({done:!1},a,t)}}};lo&&(vo=(go=function Promise(t){anInstance(this,vo),aCallable(t),O(Vn,this);var a=po(this);try{t(bind(internalResolve,a),bind(internalReject,a))}catch(t){internalReject(a,t)}}).prototype,(Vn=function Promise(t){ho(this,{type:uo,done:!1,notified:!1,parent:!1,reactions:new Jn,rejection:!1,state:0,value:void 0})}).prototype=defineBuiltIn(vo,"then",(function then(t,a){var u=po(this),h=xo(speciesConstructor(this,go));return u.parent=!0,h.ok=!isCallable(t)||t,h.fail=isCallable(a)&&a,h.domain=Qr?wo.domain:void 0,0==u.state?u.reactions.add(h):Wn((function(){callReaction(h,u)})),h.promise})),Qn=function(){var t=new Vn,a=po(t);this.promise=t,this.resolve=bind(internalResolve,a),this.reject=bind(internalReject,a)},so.f=xo=function(t){return t===go||undefined===t?new Qn(t):ko(t)}),_export({global:!0,constructor:!0,wrap:!0,forced:lo},{Promise:go}),setToStringTag(go,uo,!1,!0),setSpecies(uo);var Co=wellKnownSymbol("iterator"),To=!1;try{var Mo=0,Eo={next:function(){return{done:!!Mo++}},return:function(){To=!0}};Eo[Co]=function(){return this},Array.from(Eo,(function(){throw 2}))}catch(t){}var checkCorrectnessOfIteration=function(t,a){if(!a&&!To)return!1;var u=!1;try{var h={};h[Co]=function(){return{next:function(){return{done:u=!0}}}},t(h)}catch(t){}return u},Po=io.CONSTRUCTOR||!checkCorrectnessOfIteration((function(t){Yn.all(t).then(void 0,(function(){}))}));_export({target:"Promise",stat:!0,forced:Po},{all:function all(t){var a=this,u=so.f(a),h=u.resolve,m=u.reject,g=perform((function(){var u=aCallable(a.resolve),g=[],b=0,w=1;iterate(t,(function(t){var x=b++,k=!1;w++,O(u,a,t).then((function(t){k||(k=!0,g[x]=t,--w||h(g))}),m)})),--w||h(g)}));return g.error&&m(g.value),u.promise}});var Oo=io.CONSTRUCTOR;Yn&&Yn.prototype,_export({target:"Promise",proto:!0,forced:Oo,real:!0},{catch:function(t){return this.then(void 0,t)}}),_export({target:"Promise",stat:!0,forced:Po},{race:function race(t){var a=this,u=so.f(a),h=u.reject,m=perform((function(){var m=aCallable(a.resolve);iterate(t,(function(t){O(m,a,t).then(u.resolve,h)}))}));return m.error&&h(m.value),u.promise}}),_export({target:"Promise",stat:!0,forced:io.CONSTRUCTOR},{reject:function reject(t){var a=so.f(this);return O(a.reject,void 0,t),a.promise}});var promiseResolve=function(t,a){if(anObject(t),G(a)&&a.constructor===t)return a;var u=so.f(t);return(0,u.resolve)(a),u.promise},Io=io.CONSTRUCTOR,Ao=getBuiltIn("Promise"),jo=!Io;_export({target:"Promise",stat:!0,forced:!0},{resolve:function resolve(t){return promiseResolve(jo&&this===Ao?Yn:this,t)}}),_export({target:"Promise",stat:!0},{allSettled:function allSettled(t){var a=this,u=so.f(a),h=u.resolve,m=u.reject,g=perform((function(){var u=aCallable(a.resolve),m=[],g=0,b=1;iterate(t,(function(t){var w=g++,x=!1;b++,O(u,a,t).then((function(t){x||(x=!0,m[w]={status:"fulfilled",value:t},--b||h(m))}),(function(t){x||(x=!0,m[w]={status:"rejected",reason:t},--b||h(m))}))})),--b||h(m)}));return g.error&&m(g.value),u.promise}});var Ro="No one promise resolved";_export({target:"Promise",stat:!0},{any:function any(t){var a=this,u=getBuiltIn("AggregateError"),h=so.f(a),m=h.resolve,g=h.reject,b=perform((function(){var h=aCallable(a.resolve),b=[],w=0,x=1,k=!1;iterate(t,(function(t){var S=w++,_=!1;x++,O(h,a,t).then((function(t){_||k||(k=!0,m(t))}),(function(t){_||k||(_=!0,b[S]=t,--x||g(new u(b,Ro)))}))})),--x||g(new u(b,Ro))}));return b.error&&g(b.value),h.promise}});var Lo=Yn&&Yn.prototype,Fo=!!Yn&&fails((function(){Lo.finally.call({then:function(){}},(function(){}))}));_export({target:"Promise",proto:!0,real:!0,forced:Fo},{finally:function(t){var a=speciesConstructor(this,getBuiltIn("Promise")),u=isCallable(t);return this.then(u?function(u){return promiseResolve(a,t()).then((function(){return u}))}:t,u?function(u){return promiseResolve(a,t()).then((function(){throw u}))}:t)}});var No=M("".charAt),Uo=M("".charCodeAt),Do=M("".slice),createMethod$3=function(t){return function(a,u){var h,m,g=toString$1(requireObjectCoercible(a)),b=toIntegerOrInfinity(u),w=g.length;return b<0||b>=w?t?"":void 0:(h=Uo(g,b))<55296||h>56319||b+1===w||(m=Uo(g,b+1))<56320||m>57343?t?No(g,b):h:t?Do(g,b,b+2):m-56320+(h-55296<<10)+65536}},Bo={codeAt:createMethod$3(!1),charAt:createMethod$3(!0)}.charAt,qo="String Iterator",Go=Mr.set,Ho=Mr.getterFor(qo);iteratorDefine(String,"String",(function(t){Go(this,{type:qo,string:toString$1(t),index:0})}),(function next(){var t,a=Ho(this),u=a.string,h=a.index;return h>=u.length?{value:void 0,done:!0}:(t=Bo(u,h),a.index+=t.length,{value:t,done:!1})}));var zo=H.Promise,Ko=wellKnownSymbol("toStringTag");for(var $o in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var Wo=m[$o],Vo=Wo&&Wo.prototype;Vo&&Zt(Vo)!==Ko&&He(Vo,Ko,$o),Kt[$o]=Kt.Array}var Qo=zo;_export({target:"Promise",stat:!0,forced:!0},{try:function(t){var a=so.f(this),u=perform(t);return(u.error?a.reject:a.resolve)(u.value),a.promise}});var Jo=Qo,Yo=Date,Xo=M(Yo.prototype.getTime);_export({target:"Date",stat:!0},{now:function now(){return Xo(new Yo)}});var Zo=H.Date.now,ei=Array.isArray||function isArray(t){return"Array"==classofRaw(t)},ti=TypeError,doesNotExceedSafeInteger=function(t){if(t>9007199254740991)throw ti("Maximum allowed index exceeded");return t},createProperty=function(t,a,u){var h=toPropertyKey(a);h in t?Ge.f(t,h,createPropertyDescriptor(0,u)):t[h]=u},ri=wellKnownSymbol("species"),ni=Array,arraySpeciesCreate=function(t,a){return new(function(t){var a;return ei(t)&&(a=t.constructor,(dn(a)&&(a===ni||ei(a.prototype))||G(a)&&null===(a=a[ri]))&&(a=void 0)),void 0===a?ni:a}(t))(0===a?0:a)},oi=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return Y>=51||!fails((function(){var a=[];return(a.constructor={})[oi]=function(){return{foo:1}},1!==a[t](Boolean).foo}))},ii=wellKnownSymbol("isConcatSpreadable"),ai=Y>=51||!fails((function(){var t=[];return t[ii]=!1,t.concat()[0]!==t})),si=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!G(t))return!1;var a=t[ii];return void 0!==a?!!a:ei(t)};_export({target:"Array",proto:!0,arity:1,forced:!ai||!si},{concat:function concat(t){var a,u,h,m,g,b=toObject(this),w=arraySpeciesCreate(b,0),x=0;for(a=-1,h=arguments.length;a<h;a++)if(isConcatSpreadable(g=-1===a?b:arguments[a]))for(m=lengthOfArrayLike(g),doesNotExceedSafeInteger(x+m),u=0;u<m;u++,x++)u in g&&createProperty(w,x,g[u]);else doesNotExceedSafeInteger(x+1),createProperty(w,x++,g);return w.length=x,w}});var ci=entryVirtual("Array").concat,ui=Array.prototype,concat=function(t){var a=t.concat;return t===ui||z(ui,t)&&a===ui.concat?ci:a},li=/MSIE .\./.test(K),fi=m.Function,wrap$1=function(t){return li?function(a,u){var h=validateArgumentsLength(arguments.length,1)>2,m=isCallable(a)?a:fi(a),g=h?mt(arguments,2):void 0;return t(h?function(){k(m,this,g)}:m,u)}:t},pi={setTimeout:wrap$1(m.setTimeout),setInterval:wrap$1(m.setInterval)},di=pi.setInterval;_export({global:!0,bind:!0,forced:m.setInterval!==di},{setInterval:di});var hi=pi.setTimeout;_export({global:!0,bind:!0,forced:m.setTimeout!==hi},{setTimeout:hi});var mi=H.setTimeout,gi=createCommonjsModule((function(t){var a=Object.prototype.hasOwnProperty,u="~";function Events(){}function EE(t,a,u){this.fn=t,this.context=a,this.once=u||!1}function addListener(t,a,h,m,g){if("function"!=typeof h)throw new TypeError("The listener must be a function");var b=new EE(h,m||t,g),w=u?u+a:a;return t._events[w]?t._events[w].fn?t._events[w]=[t._events[w],b]:t._events[w].push(b):(t._events[w]=b,t._eventsCount++),t}function clearEvent(t,a){0==--t._eventsCount?t._events=new Events:delete t._events[a]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(u=!1)),EventEmitter.prototype.eventNames=function eventNames(){var t,h,m=[];if(0===this._eventsCount)return m;for(h in t=this._events)a.call(t,h)&&m.push(u?h.slice(1):h);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(t)):m},EventEmitter.prototype.listeners=function listeners(t){var a=u?u+t:t,h=this._events[a];if(!h)return[];if(h.fn)return[h.fn];for(var m=0,g=h.length,b=new Array(g);m<g;m++)b[m]=h[m].fn;return b},EventEmitter.prototype.listenerCount=function listenerCount(t){var a=u?u+t:t,h=this._events[a];return h?h.fn?1:h.length:0},EventEmitter.prototype.emit=function emit(t,a,h,m,g,b){var w=u?u+t:t;if(!this._events[w])return!1;var x,k,S=this._events[w],_=arguments.length;if(S.fn){switch(S.once&&this.removeListener(t,S.fn,void 0,!0),_){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,a),!0;case 3:return S.fn.call(S.context,a,h),!0;case 4:return S.fn.call(S.context,a,h,m),!0;case 5:return S.fn.call(S.context,a,h,m,g),!0;case 6:return S.fn.call(S.context,a,h,m,g,b),!0}for(k=1,x=new Array(_-1);k<_;k++)x[k-1]=arguments[k];S.fn.apply(S.context,x)}else{var C,T=S.length;for(k=0;k<T;k++)switch(S[k].once&&this.removeListener(t,S[k].fn,void 0,!0),_){case 1:S[k].fn.call(S[k].context);break;case 2:S[k].fn.call(S[k].context,a);break;case 3:S[k].fn.call(S[k].context,a,h);break;case 4:S[k].fn.call(S[k].context,a,h,m);break;default:if(!x)for(C=1,x=new Array(_-1);C<_;C++)x[C-1]=arguments[C];S[k].fn.apply(S[k].context,x)}}return!0},EventEmitter.prototype.on=function on(t,a,u){return addListener(this,t,a,u,!1)},EventEmitter.prototype.once=function once(t,a,u){return addListener(this,t,a,u,!0)},EventEmitter.prototype.removeListener=function removeListener(t,a,h,m){var g=u?u+t:t;if(!this._events[g])return this;if(!a)return clearEvent(this,g),this;var b=this._events[g];if(b.fn)b.fn!==a||m&&!b.once||h&&b.context!==h||clearEvent(this,g);else{for(var w=0,x=[],k=b.length;w<k;w++)(b[w].fn!==a||m&&!b[w].once||h&&b[w].context!==h)&&x.push(b[w]);x.length?this._events[g]=1===x.length?x[0]:x:clearEvent(this,g)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(t){var a;return t?(a=u?u+t:t,this._events[a]&&clearEvent(this,a)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=u,EventEmitter.EventEmitter=EventEmitter,t.exports=EventEmitter}));_export({global:!0},{globalThis:m});var vi=Array,yi=Math.max,arraySliceSimple=function(t,a,u){for(var h=lengthOfArrayLike(t),m=toAbsoluteIndex(a,h),g=toAbsoluteIndex(void 0===u?h:u,h),b=vi(yi(g-m,0)),w=0;m<g;m++,w++)createProperty(b,w,t[m]);return b.length=w,b},bi=Nt.f,wi="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],xi={f:function getOwnPropertyNames(t){return wi&&"Window"==classofRaw(t)?function(t){try{return bi(t)}catch(t){return arraySliceSimple(wi)}}(t):bi(toIndexedObject(t))}},ki={f:wellKnownSymbol},Si=Ge.f,wellKnownSymbolDefine=function(t){var a=H.Symbol||(H.Symbol={});fe(a,t)||Si(a,t,{value:ki.f(t)})},symbolDefineToPrimitive=function(){var t=getBuiltIn("Symbol"),a=t&&t.prototype,u=a&&a.valueOf,h=wellKnownSymbol("toPrimitive");a&&!a[h]&&defineBuiltIn(a,h,(function(t){return O(u,this)}),{arity:1})},_i=M([].push),createMethod$2=function(t){var a=1==t,u=2==t,h=3==t,m=4==t,g=6==t,b=7==t,w=5==t||g;return function(x,k,S,_){for(var C,T,M=toObject(x),E=D(M),P=functionBindContext(k,S),O=lengthOfArrayLike(E),I=0,A=_||arraySpeciesCreate,j=a?A(x,O):u||b?A(x,0):void 0;O>I;I++)if((w||I in E)&&(T=P(C=E[I],I,M),t))if(a)j[I]=T;else if(T)switch(t){case 3:return!0;case 5:return C;case 6:return I;case 2:_i(j,C)}else switch(t){case 4:return!1;case 7:_i(j,C)}return g?-1:h||m?m:j}},Ci={forEach:createMethod$2(0),map:createMethod$2(1),filter:createMethod$2(2),some:createMethod$2(3),every:createMethod$2(4),find:createMethod$2(5),findIndex:createMethod$2(6),filterReject:createMethod$2(7)},Ti=Ci.forEach,Mi=sharedKey("hidden"),Ei="Symbol",Pi=Mr.set,Oi=Mr.getterFor(Ei),Ii=Object.prototype,Ai=m.Symbol,ji=Ai&&Ai.prototype,Ri=m.TypeError,Li=m.QObject,Fi=Ce.f,Ni=Ge.f,Ui=xi.f,Di=j.f,Bi=M([].push),qi=ce("symbols"),Gi=ce("op-symbols"),Hi=ce("wks"),zi=!Li||!Li.prototype||!Li.prototype.findChild,Ki=E&&fails((function(){return 7!=ct(Ni({},"a",{get:function(){return Ni(this,"a",{value:7}).a}})).a}))?function(t,a,u){var h=Fi(Ii,a);h&&delete Ii[a],Ni(t,a,u),h&&t!==Ii&&Ni(Ii,a,h)}:Ni,wrap=function(t,a){var u=qi[t]=ct(ji);return Pi(u,{type:Ei,tag:t,description:a}),E||(u.description=a),u},$i=function defineProperty(t,a,u){t===Ii&&$i(Gi,a,u),anObject(t);var h=toPropertyKey(a);return anObject(u),fe(qi,h)?(u.enumerable?(fe(t,Mi)&&t[Mi][h]&&(t[Mi][h]=!1),u=ct(u,{enumerable:createPropertyDescriptor(0,!1)})):(fe(t,Mi)||Ni(t,Mi,createPropertyDescriptor(1,{})),t[Mi][h]=!0),Ki(t,h,u)):Ni(t,h,u)},Wi=function defineProperties(t,a){anObject(t);var u=toIndexedObject(a),h=rt(u).concat($getOwnPropertySymbols(u));return Ti(h,(function(a){E&&!O(Vi,u,a)||$i(t,a,u[a])})),t},Vi=function propertyIsEnumerable(t){var a=toPropertyKey(t),u=O(Di,this,a);return!(this===Ii&&fe(qi,a)&&!fe(Gi,a))&&(!(u||!fe(this,a)||!fe(qi,a)||fe(this,Mi)&&this[Mi][a])||u)},Qi=function getOwnPropertyDescriptor(t,a){var u=toIndexedObject(t),h=toPropertyKey(a);if(u!==Ii||!fe(qi,h)||fe(Gi,h)){var m=Fi(u,h);return!m||!fe(qi,h)||fe(u,Mi)&&u[Mi][h]||(m.enumerable=!0),m}},Ji=function getOwnPropertyNames(t){var a=Ui(toIndexedObject(t)),u=[];return Ti(a,(function(t){fe(qi,t)||fe(Xe,t)||Bi(u,t)})),u},$getOwnPropertySymbols=function(t){var a=t===Ii,u=Ui(a?Gi:toIndexedObject(t)),h=[];return Ti(u,(function(t){!fe(qi,t)||a&&!fe(Ii,t)||Bi(h,qi[t])})),h};X||(Ai=function Symbol(){if(z(ji,this))throw Ri("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?toString$1(arguments[0]):void 0,a=uid(t),setter=function(t){this===Ii&&O(setter,Gi,t),fe(this,Mi)&&fe(this[Mi],a)&&(this[Mi][a]=!1),Ki(this,a,createPropertyDescriptor(1,t))};return E&&zi&&Ki(Ii,a,{configurable:!0,set:setter}),wrap(a,t)},ji=Ai.prototype,defineBuiltIn(ji,"toString",(function toString(){return Oi(this).tag})),defineBuiltIn(Ai,"withoutSetter",(function(t){return wrap(uid(t),t)})),j.f=Vi,Ge.f=$i,ot.f=Wi,Ce.f=Qi,Nt.f=xi.f=Ji,Ct.f=$getOwnPropertySymbols,ki.f=function(t){return wrap(wellKnownSymbol(t),t)},E&&Ni(ji,"description",{configurable:!0,get:function description(){return Oi(this).description}})),_export({global:!0,constructor:!0,wrap:!0,forced:!X,sham:!X},{Symbol:Ai}),Ti(rt(Hi),(function(t){wellKnownSymbolDefine(t)})),_export({target:Ei,stat:!0,forced:!X},{useSetter:function(){zi=!0},useSimple:function(){zi=!1}}),_export({target:"Object",stat:!0,forced:!X,sham:!E},{create:function create(t,a){return void 0===a?ct(t):Wi(ct(t),a)},defineProperty:$i,defineProperties:Wi,getOwnPropertyDescriptor:Qi}),_export({target:"Object",stat:!0,forced:!X},{getOwnPropertyNames:Ji}),symbolDefineToPrimitive(),setToStringTag(Ai,Ei),Xe[Mi]=!0;var Yi=X&&!!Symbol.for&&!!Symbol.keyFor,Xi=ce("string-to-symbol-registry"),Zi=ce("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Yi},{for:function(t){var a=toString$1(t);if(fe(Xi,a))return Xi[a];var u=getBuiltIn("Symbol")(a);return Xi[a]=u,Zi[u]=a,u}});var ea=ce("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Yi},{keyFor:function keyFor(t){if(!te(t))throw TypeError(tryToString(t)+" is not a symbol");if(fe(ea,t))return ea[t]}});var ta=getBuiltIn("JSON","stringify"),ra=M(/./.exec),na=M("".charAt),oa=M("".charCodeAt),ia=M("".replace),aa=M(1..toString),sa=/[\uD800-\uDFFF]/g,ca=/^[\uD800-\uDBFF]$/,ua=/^[\uDC00-\uDFFF]$/,la=!X||fails((function(){var t=getBuiltIn("Symbol")();return"[null]"!=ta([t])||"{}"!=ta({a:t})||"{}"!=ta(Object(t))})),fa=fails((function(){return'"\\udf06\\ud834"'!==ta("\udf06\ud834")||'"\\udead"'!==ta("\udead")})),stringifyWithSymbolsFix=function(t,a){var u=mt(arguments),h=a;if((G(a)||void 0!==t)&&!te(t))return ei(a)||(a=function(t,a){if(isCallable(h)&&(a=O(h,this,t,a)),!te(a))return a}),u[1]=a,k(ta,null,u)},fixIllFormed=function(t,a,u){var h=na(u,a-1),m=na(u,a+1);return ra(ca,t)&&!ra(ua,m)||ra(ua,t)&&!ra(ca,h)?"\\u"+aa(oa(t,0),16):t};ta&&_export({target:"JSON",stat:!0,arity:3,forced:la||fa},{stringify:function stringify(t,a,u){var h=mt(arguments),m=k(la?stringifyWithSymbolsFix:ta,null,h);return fa&&"string"==typeof m?ia(m,sa,fixIllFormed):m}});var pa=!X||fails((function(){Ct.f(1)}));_export({target:"Object",stat:!0,forced:pa},{getOwnPropertySymbols:function getOwnPropertySymbols(t){var a=Ct.f;return a?a(toObject(t)):[]}}),wellKnownSymbolDefine("asyncIterator"),wellKnownSymbolDefine("hasInstance"),wellKnownSymbolDefine("isConcatSpreadable"),wellKnownSymbolDefine("iterator"),wellKnownSymbolDefine("match"),wellKnownSymbolDefine("matchAll"),wellKnownSymbolDefine("replace"),wellKnownSymbolDefine("search"),wellKnownSymbolDefine("species"),wellKnownSymbolDefine("split"),wellKnownSymbolDefine("toPrimitive"),symbolDefineToPrimitive(),wellKnownSymbolDefine("toStringTag"),setToStringTag(getBuiltIn("Symbol"),"Symbol"),wellKnownSymbolDefine("unscopables"),setToStringTag(m.JSON,"JSON",!0);var da=H.Symbol;wellKnownSymbolDefine("asyncDispose"),wellKnownSymbolDefine("dispose"),wellKnownSymbolDefine("matcher"),wellKnownSymbolDefine("metadataKey"),wellKnownSymbolDefine("observable"),wellKnownSymbolDefine("metadata"),wellKnownSymbolDefine("patternMatch"),wellKnownSymbolDefine("replaceAll");var ha=da,ma=Ge.f;_export({target:"Object",stat:!0,forced:Object.defineProperty!==ma,sham:!E},{defineProperty:ma});var ga=createCommonjsModule((function(t){var a=H.Object,u=t.exports=function defineProperty(t,u,h){return a.defineProperty(t,u,h)};a.defineProperty.sham&&(u.sham=!0)})),va=ga,ya=fails((function(){Lt(1)}));_export({target:"Object",stat:!0,forced:ya,sham:!It},{getPrototypeOf:function getPrototypeOf(t){return Lt(toObject(t))}});var ba=H.Object.getPrototypeOf,arrayMethodIsStrict=function(t,a){var u=[][t];return!!u&&fails((function(){u.call(null,a||function(){return 1},1)}))},wa=Ci.forEach,xa=arrayMethodIsStrict("forEach")?[].forEach:function forEach(t){return wa(this,t,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=xa},{forEach:xa});var ka=entryVirtual("Array").forEach,Sa=Array.prototype,_a={DOMTokenList:!0,NodeList:!0},forEach$1=function(t){var a=t.forEach;return t===Sa||z(Sa,t)&&a===Sa.forEach||fe(_a,Zt(t))?ka:a},Ca=M([].reverse),Ta=[1,2];_export({target:"Array",proto:!0,forced:String(Ta)===String(Ta.reverse())},{reverse:function reverse(){return ei(this)&&(this.length=this.length),Ca(this)}});var Ma=entryVirtual("Array").reverse,Ea=Array.prototype,reverse=function(t){var a=t.reverse;return t===Ea||z(Ea,t)&&a===Ea.reverse?Ma:a},Pa=arrayMethodHasSpeciesSupport("slice"),Oa=wellKnownSymbol("species"),Ia=Array,Aa=Math.max;_export({target:"Array",proto:!0,forced:!Pa},{slice:function slice(t,a){var u,h,m,g=toIndexedObject(this),b=lengthOfArrayLike(g),w=toAbsoluteIndex(t,b),x=toAbsoluteIndex(void 0===a?b:a,b);if(ei(g)&&(u=g.constructor,(dn(u)&&(u===Ia||ei(u.prototype))||G(u)&&null===(u=u[Oa]))&&(u=void 0),u===Ia||void 0===u))return mt(g,w,x);for(h=new(void 0===u?Ia:u)(Aa(x-w,0)),m=0;w<x;w++,m++)w in g&&createProperty(h,m,g[w]);return h.length=m,h}});var ja=entryVirtual("Array").slice,Ra=Array.prototype,slice=function(t){var a=t.slice;return t===Ra||z(Ra,t)&&a===Ra.slice?ja:a},La=Ye.includes,Fa=fails((function(){return!Array(1).includes()}));_export({target:"Array",proto:!0,forced:Fa},{includes:function includes(t){return La(this,t,arguments.length>1?arguments[1]:void 0)}});var Na=entryVirtual("Array").includes,Ua=wellKnownSymbol("match"),Da=TypeError,notARegexp=function(t){if(function(t){var a;return G(t)&&(void 0!==(a=t[Ua])?!!a:"RegExp"==classofRaw(t))}(t))throw Da("The method doesn't accept regular expressions");return t},Ba=wellKnownSymbol("match"),qa=M("".indexOf);_export({target:"String",proto:!0,forced:!function(t){var a=/./;try{"/./"[t](a)}catch(u){try{return a[Ba]=!1,"/./"[t](a)}catch(t){}}return!1}("includes")},{includes:function includes(t){return!!~qa(toString$1(requireObjectCoercible(this)),toString$1(notARegexp(t)),arguments.length>1?arguments[1]:void 0)}});var Ga=entryVirtual("String").includes,Ha=Array.prototype,za=String.prototype,includes=function(t){var a=t.includes;return t===Ha||z(Ha,t)&&a===Ha.includes?Na:"string"==typeof t||t===za||z(za,t)&&a===za.includes?Ga:a},Ka=fails((function(){rt(1)}));_export({target:"Object",stat:!0,forced:Ka},{keys:function keys(t){return rt(toObject(t))}});var $a=H.Object.keys,Wa=Ci.map,Va=arrayMethodHasSpeciesSupport("map");_export({target:"Array",proto:!0,forced:!Va},{map:function map(t){return Wa(this,t,arguments.length>1?arguments[1]:void 0)}});var Qa=entryVirtual("Array").map,Ja=Array.prototype,map$6=function(t){var a=t.map;return t===Ja||z(Ja,t)&&a===Ja.map?Qa:a},Ya=Ci.filter,Xa=arrayMethodHasSpeciesSupport("filter");_export({target:"Array",proto:!0,forced:!Xa},{filter:function filter(t){return Ya(this,t,arguments.length>1?arguments[1]:void 0)}});var Za=entryVirtual("Array").filter,es=Array.prototype,filter=function(t){var a=t.filter;return t===es||z(es,t)&&a===es.filter?Za:a},ts=createCommonjsModule((function(t,a){t.exports=function(){function _regeneratorRuntime(){_regeneratorRuntime=function _regeneratorRuntime(){return t};var t={},a=Object.prototype,u=a.hasOwnProperty,h="function"==typeof ha?ha:{},m=h.iterator||"@@iterator",g=h.asyncIterator||"@@asyncIterator",b=h.toStringTag||"@@toStringTag";function define(t,a,u){return va(t,a,{value:u,enumerable:!0,configurable:!0,writable:!0}),t[a]}try{define({},"")}catch(t){define=function define(t,a,u){return t[a]=u}}function wrap(t,a,u,h){var m=a&&a.prototype instanceof Generator?a:Generator,g=lt(m.prototype),b=new Context(h||[]);return g._invoke=function(t,a,u){var h="suspendedStart";return function(m,g){if("executing"===h)throw new Error("Generator is already running");if("completed"===h){if("throw"===m)throw g;return doneResult()}for(u.method=m,u.arg=g;;){var b=u.delegate;if(b){var x=maybeInvokeDelegate(b,u);if(x){if(x===w)continue;return x}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===h)throw h="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);h="executing";var k=tryCatch(t,a,u);if("normal"===k.type){if(h=u.done?"completed":"suspendedYield",k.arg===w)continue;return{value:k.arg,done:u.done}}"throw"===k.type&&(h="completed",u.method="throw",u.arg=k.arg)}}}(t,u,b),g}function tryCatch(t,a,u){try{return{type:"normal",arg:t.call(a,u)}}catch(t){return{type:"throw",arg:t}}}t.wrap=wrap;var w={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var x={};define(x,m,(function(){return this}));var k=ba&&ba(ba(values([])));k&&k!==a&&u.call(k,m)&&(x=k);var S=GeneratorFunctionPrototype.prototype=Generator.prototype=lt(x);function defineIteratorMethods(t){var a;forEach$1(a=["next","throw","return"]).call(a,(function(a){define(t,a,(function(t){return this._invoke(a,t)}))}))}function AsyncIterator(t,a){function invoke(h,m,g,b){var w=tryCatch(t[h],t,m);if("throw"!==w.type){var x=w.arg,k=x.value;return k&&"object"==typeof k&&u.call(k,"__await")?a.resolve(k.__await).then((function(t){invoke("next",t,g,b)}),(function(t){invoke("throw",t,g,b)})):a.resolve(k).then((function(t){x.value=t,g(x)}),(function(t){return invoke("throw",t,g,b)}))}b(w.arg)}var h;this._invoke=function(t,u){function callInvokeWithMethodAndArg(){return new a((function(a,h){invoke(t,u,a,h)}))}return h=h?h.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,a){var u=t.iterator[a.method];if(void 0===u){if(a.delegate=null,"throw"===a.method){if(t.iterator.return&&(a.method="return",a.arg=void 0,maybeInvokeDelegate(t,a),"throw"===a.method))return w;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return w}var h=tryCatch(u,t.iterator,a.arg);if("throw"===h.type)return a.method="throw",a.arg=h.arg,a.delegate=null,w;var m=h.arg;return m?m.done?(a[t.resultName]=m.value,a.next=t.nextLoc,"return"!==a.method&&(a.method="next",a.arg=void 0),a.delegate=null,w):m:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,w)}function pushTryEntry(t){var a={tryLoc:t[0]};1 in t&&(a.catchLoc=t[1]),2 in t&&(a.finallyLoc=t[2],a.afterLoc=t[3]),this.tryEntries.push(a)}function resetTryEntry(t){var a=t.completion||{};a.type="normal",delete a.arg,t.completion=a}function Context(t){this.tryEntries=[{tryLoc:"root"}],forEach$1(t).call(t,pushTryEntry,this),this.reset(!0)}function values(t){if(t){var a=t[m];if(a)return a.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var h=-1,g=function next(){for(;++h<t.length;)if(u.call(t,h))return next.value=t[h],next.done=!1,next;return next.value=void 0,next.done=!0,next};return g.next=g}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(S,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,b,"GeneratorFunction"),t.isGeneratorFunction=function(t){var a="function"==typeof t&&t.constructor;return!!a&&(a===GeneratorFunction||"GeneratorFunction"===(a.displayName||a.name))},t.mark=function(t){return ht?ht(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,b,"GeneratorFunction")),t.prototype=lt(S),t},t.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,g,(function(){return this})),t.AsyncIterator=AsyncIterator,t.async=function(a,u,h,m,g){void 0===g&&(g=Jo);var b=new AsyncIterator(wrap(a,u,h,m),g);return t.isGeneratorFunction(u)?b:b.next().then((function(t){return t.done?t.value:b.next()}))},defineIteratorMethods(S),define(S,b,"Generator"),define(S,m,(function(){return this})),define(S,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var a=[];for(var u in t)a.push(u);return reverse(a).call(a),function next(){for(;a.length;){var u=a.pop();if(u in t)return next.value=u,next.done=!1,next}return next.done=!0,next}},t.values=values,Context.prototype={constructor:Context,reset:function reset(t){var a;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,forEach$1(a=this.tryEntries).call(a,resetTryEntry),!t)for(var h in this)"t"===h.charAt(0)&&u.call(this,h)&&!isNaN(+slice(h).call(h,1))&&(this[h]=void 0)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var a=this;function handle(u,h){return g.type="throw",g.arg=t,a.next=u,h&&(a.method="next",a.arg=void 0),!!h}for(var h=this.tryEntries.length-1;h>=0;--h){var m=this.tryEntries[h],g=m.completion;if("root"===m.tryLoc)return handle("end");if(m.tryLoc<=this.prev){var b=u.call(m,"catchLoc"),w=u.call(m,"finallyLoc");if(b&&w){if(this.prev<m.catchLoc)return handle(m.catchLoc,!0);if(this.prev<m.finallyLoc)return handle(m.finallyLoc)}else if(b){if(this.prev<m.catchLoc)return handle(m.catchLoc,!0)}else{if(!w)throw new Error("try statement without catch or finally");if(this.prev<m.finallyLoc)return handle(m.finallyLoc)}}}},abrupt:function abrupt(t,a){for(var h=this.tryEntries.length-1;h>=0;--h){var m=this.tryEntries[h];if(m.tryLoc<=this.prev&&u.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var g=m;break}}g&&("break"===t||"continue"===t)&&g.tryLoc<=a&&a<=g.finallyLoc&&(g=null);var b=g?g.completion:{};return b.type=t,b.arg=a,g?(this.method="next",this.next=g.finallyLoc,w):this.complete(b)},complete:function complete(t,a){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&a&&(this.next=a),w},finish:function finish(t){for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a];if(u.finallyLoc===t)return this.complete(u.completion,u.afterLoc),resetTryEntry(u),w}},catch:function _catch(t){for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a];if(u.tryLoc===t){var h=u.completion;if("throw"===h.type){var m=h.arg;resetTryEntry(u)}return m}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,a,u){return this.delegate={iterator:values(t),resultName:a,nextLoc:u},"next"===this.method&&(this.arg=void 0),w}},t}function _classCallCheck(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,a){for(var u=0;u<a.length;u++){var h=a[u];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),va(t,h.key,h)}}function _createClass(t,a,u){return a&&_defineProperties(t.prototype,a),u&&_defineProperties(t,u),va(t,"prototype",{writable:!1}),t}function __awaiter(t,a,u,h){function adopt(t){return t instanceof u?t:new u((function(a){a(t)}))}return new(u||(u=Jo))((function(u,m){function fulfilled(t){try{step(h.next(t))}catch(t){m(t)}}function rejected(t){try{step(h.throw(t))}catch(t){m(t)}}function step(t){t.done?u(t.value):adopt(t.value).then(fulfilled,rejected)}step((h=h.apply(t,a||[])).next())}))}var t={isDataReportEnable:!0,maxSize:100,msgListMaxSize:1e3,cacheMaxSize:1e3,maxDelay:3e5,maxInterval:3e4,minInterval:1e4,timeout:5e3,autoStart:!0,loginFailIgnoreInterval:6e5},a=function emptyFn(){},u=function(){function Reporter(a){_classCallCheck(this,Reporter),this.isUploadEnable=!0,this.serverAllowUpload=!1,this.initConfigLoaded=!1,this.loading=!1,this.isDestroyed=!1,this.reportConfig=t,this.configPath="dispatcher/req",this.dataReportPath="statics/report/common/form",this.traceMsgCache={},this.highPriorityMsgList=[],this.msgList=[],this.lowPriorityMsgList=[],this.cacheMsgList=[],this.lastReportTime=Zo(),this.timer=null,this.endedAsyncMsgByModule={},this.lastFailLogin={},this.setConfig(a),this.reportConfig.isDataReportEnable&&this.reportConfig.autoStart&&this.initUploadConfig()}return _createClass(Reporter,[{key:"setConfig",value:function setConfig(t){var a=Ot({},this.reportConfig.common,t.common);this.reportConfig=Ot({},this.reportConfig,t),this.reportConfig.common=a,this.reportConfig.common.sdk_type||(this.reportConfig.common.sdk_type="im")}},{key:"reportImmediately",value:function reportImmediately(t,a){var u=this;this.reportConfig.isDataReportEnable&&this.reportConfig.request(t,Ot({dataType:"json",method:"POST",timeout:this.reportConfig.timeout},a)).catch((function(t){var a,h;null===(h=null===(a=u.reportConfig)||void 0===a?void 0:a.logger)||void 0===h||h.warn("Reporter immediately upload failed",t)}))}},{key:"report",value:function report(a,u){var h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(h.priority||(h.priority=this.getEventPriority(a,u)),this.reportConfig.isDataReportEnable&&a){if("login"===a&&!1===u.succeed&&u.process_id){var m=this.lastFailLogin[u.process_id]||0;if(u.start_time-m<t.loginFailIgnoreInterval)return;this.lastFailLogin[u.process_id]=u.start_time}var g=Zo();"HIGH"===h.priority?this.highPriorityMsgList.push({module:a,msg:u,createTime:g}):"NORMAL"===h.priority?this.msgList.push({module:a,msg:u,createTime:g}):"LOW"===h.priority&&this.lowPriorityMsgList.push({module:a,msg:u,createTime:g}),this.highPriorityMsgList.length>this.reportConfig.msgListMaxSize&&this.highPriorityMsgList.shift(),this.msgList.length>this.reportConfig.msgListMaxSize&&this.msgList.shift(),this.lowPriorityMsgList.length>this.reportConfig.msgListMaxSize&&this.lowPriorityMsgList.shift(),this.doReport()}}},{key:"reportTraceStart",value:function reportTraceStart(t,a){if(this.reportConfig.isDataReportEnable&&t&&!this.traceMsgCache[t]){var u=Ot(Ot({start_time:Zo()},a),{extension:[]});this.traceMsgCache[t]=u}}},{key:"reportTraceUpdate",value:function reportTraceUpdate(t){}},{key:"reportTraceUpdateV2",value:function reportTraceUpdateV2(t,a,u){var h,m=this;if(this.reportConfig.isDataReportEnable&&this.traceMsgCache[t]){var g=this.traceMsgCache[t].extension,b=g.length,w=(new Date).getTime();0===b?a.duration=w-this.traceMsgCache[t].start_time:g[b-1].end_time?a.duration=w-g[b-1].end_time:a.duration=w-this.traceMsgCache[t].start_time,g.push(Ot({end_time:w},a));var x=g.length-1;(null==u?void 0:u.asyncParams)&&((h=this.traceMsgCache[t]).asyncPromiseArray||(h.asyncPromiseArray=[]),this.traceMsgCache[t].asyncPromiseArray.push(u.asyncParams.then((function(a){m.traceMsgCache[t]&&m.traceMsgCache[t].extension[x]&&Ot(m.traceMsgCache[t].extension[x],a)}))))}}},{key:"reportTraceEnd",value:function reportTraceEnd(t){var a,u,h=this,m=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.reportConfig.isDataReportEnable&&this.traceMsgCache[t])if("nos"!==t||!1===m){"boolean"==typeof m?this.traceMsgCache[t].succeed=!!m:this.traceMsgCache[t].state=m,this.traceMsgCache[t].duration=Zo()-this.traceMsgCache[t].start_time,forEach$1(a=this.traceMsgCache[t].extension).call(a,(function(t){delete t.end_time}));var g=this.traceMsgCache[t];if(this.traceMsgCache[t]=null,g.asyncPromiseArray){(u=this.endedAsyncMsgByModule)[t]||(u[t]=[]),this.endedAsyncMsgByModule[t].push(g);var b=function asyncCallback(){var a;h.endedAsyncMsgByModule[t]&&includes(a=h.endedAsyncMsgByModule[t]).call(a,g)&&(delete g.asyncPromiseArray,h.report(t,g,{priority:h.getEventPriority(t,g)}))};Jo.all(g.asyncPromiseArray).then(b).catch(b)}else this.report(t,g,{priority:this.getEventPriority(t,g)})}else this.traceMsgCache[t]=null}},{key:"getEventPriority",value:function getEventPriority(t,a){if("exceptions"===t){if(0===a.action)return"HIGH";if(2===a.action)return"HIGH";if(1===a.action&&0!==a.exception_service)return"HIGH"}else{if("msgReceive"===t)return"LOW";if("nim_api_trace"===t)return"LOW"}return"NORMAL"}},{key:"reportTraceCancel",value:function reportTraceCancel(t){this.reportConfig.isDataReportEnable&&(this.endedAsyncMsgByModule[t]=[],this.traceMsgCache[t]=null)}},{key:"pause",value:function pause(){this.reportConfig.isDataReportEnable&&(this.isUploadEnable=!1)}},{key:"restore",value:function restore(){this.reportConfig.isDataReportEnable&&(this.isUploadEnable=!0,this.initConfigLoaded||this.initUploadConfig())}},{key:"destroy",value:function destroy(){var t,u=this;this.reportConfig.isDataReportEnable&&(forEach$1(t=$a(this.traceMsgCache)).call(t,(function(t){u.reportTraceEnd(t,1)})),null!==this.timer&&clearTimeout(this.timer),this.setConfig=a,this.report=a,this.reportTraceStart=a,this.reportTraceUpdate=a,this.reportTraceEnd=a,this.pause=a,this.restore=a,this.destroy=a,this.cacheMsgList=[],this.traceMsgCache={},this.lowPriorityMsgList=[],this.msgList=[],this.highPriorityMsgList=[],this.reportConfig={},this.isDestroyed=!0)}},{key:"initUploadConfig",value:function initUploadConfig(){var t,a;return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark((function _callee(){var u,h,m,g,b=this;return _regeneratorRuntime().wrap((function _callee$(w){for(var x;;)switch(w.prev=w.next){case 0:if(!this.loading){w.next=2;break}return w.abrupt("return");case 2:this.loading=!0,u=this.reportConfig.common||{},h=map$6(x=this.reportConfig.compassDataEndpoint.split(",")).call(x,(function(t){var a;return concat(a="".concat(t,"/")).call(a,b.configPath)})),m=_regeneratorRuntime().mark((function _loop(m){return _regeneratorRuntime().wrap((function _loop$(g){for(;;)switch(g.prev=g.next){case 0:if(!b.initConfigLoaded&&!b.isDestroyed){g.next=2;break}return g.abrupt("return","break");case 2:return g.prev=2,g.next=5,b.reportConfig.request(h[m],{method:"GET",dataType:"json",params:{deviceId:u.dev_id,sdkVer:u.sdk_ver,platform:u.platform,appkey:u.app_key},timeout:b.reportConfig.timeout}).then((function(t){var a,u;if(!b.isDestroyed){if(200===t.status&&t.data&&200===t.data.code){b.initConfigLoaded=!0;var g=t.data.data||{};b.reportConfig.maxSize=g.maxSize>1e3?1e3:g.maxSize,b.reportConfig.maxInterval=g.maxInterval>1e4?1e4:g.maxInterval,b.reportConfig.maxInterval=g.maxInterval<10?10:g.maxInterval,b.reportConfig.minInterval=g.minInterval<2?2:g.minInterval,b.reportConfig.maxDelay=g.maxDelay||300,b.reportConfig.maxInterval=1e3*b.reportConfig.maxInterval,b.reportConfig.minInterval=1e3*b.reportConfig.minInterval,b.reportConfig.maxDelay=1e3*b.reportConfig.maxDelay,g.endpoint?b.dataReportEndpoint=g.endpoint:b.dataReportEndpoint=h[m],b.serverAllowUpload=!0,b.loading=!1,b.reportHeartBeat()}else 200===t.status&&(b.initConfigLoaded=!0);null===(u=null===(a=b.reportConfig)||void 0===a?void 0:a.logger)||void 0===u||u.log("Get reporter upload config success")}})).catch((function(t){var a,u;b.loading=!1,null===(u=null===(a=b.reportConfig)||void 0===a?void 0:a.logger)||void 0===u||u.error("Get reporter upload config failed",t)}));case 5:g.next=11;break;case 7:g.prev=7,g.t0=g.catch(2),b.loading=!1,null===(a=null===(t=b.reportConfig)||void 0===t?void 0:t.logger)||void 0===a||a.error("Exec reporter request failed",g.t0);case 11:case"end":return g.stop()}}),_loop,null,[[2,7]])})),g=0;case 7:if(!(g<h.length)){w.next=15;break}return w.delegateYield(m(g),"t0",9);case 9:if("break"!==w.t0){w.next=12;break}return w.abrupt("break",15);case 12:g++,w.next=7;break;case 15:case"end":return w.stop()}}),_callee,this)})))}},{key:"reportHeartBeat",value:function reportHeartBeat(){var t=this;this.isDestroyed||(this.timer=mi((function(){t.reportHeartBeat()}),this.reportConfig.minInterval),this.doReport())}},{key:"doReport",value:function doReport(){if(!this.isDestroyed){var t=this.highPriorityMsgList.length+this.msgList.length+this.lowPriorityMsgList.length+this.cacheMsgList.length>2*this.reportConfig.maxSize?this.reportConfig.minInterval:this.reportConfig.maxInterval;Zo()-this.lastReportTime>=t&&this.upload()}}},{key:"getUploadMsg",value:function getUploadMsg(){var t,a,u,h,m,g,b=this,w={},x=Zo();this.highPriorityMsgList=filter(t=this.highPriorityMsgList).call(t,(function(t){return x-t.createTime<b.reportConfig.maxDelay})),this.msgList=filter(a=this.msgList).call(a,(function(t){return x-t.createTime<b.reportConfig.maxDelay})),this.lowPriorityMsgList=filter(u=this.lowPriorityMsgList).call(u,(function(t){return x-t.createTime<b.reportConfig.maxDelay})),this.cacheMsgList=filter(h=this.cacheMsgList).call(h,(function(t){return x-t.createTime<b.reportConfig.maxDelay}));var k=slice(m=this.highPriorityMsgList).call(m,0,this.reportConfig.maxSize);if(this.highPriorityMsgList=slice(g=this.highPriorityMsgList).call(g,k.length),k.length<this.reportConfig.maxSize){var S,_,C=this.reportConfig.maxSize-k.length;k=concat(k).call(k,slice(S=this.msgList).call(S,0,C)),this.msgList=slice(_=this.msgList).call(_,C)}if(k.length<this.reportConfig.maxSize){var T,M,E=this.reportConfig.maxSize-k.length;k=concat(k).call(k,slice(T=this.lowPriorityMsgList).call(T,0,E)),this.lowPriorityMsgList=slice(M=this.lowPriorityMsgList).call(M,E)}if(k.length<this.reportConfig.maxSize){var P,O,I=this.reportConfig.maxSize-k.length;k=concat(k).call(k,slice(P=this.cacheMsgList).call(P,0,I)),this.cacheMsgList=slice(O=this.cacheMsgList).call(O,I)}return forEach$1(k).call(k,(function(t){w[t.module]?w[t.module].push(t.msg):w[t.module]=[t.msg]})),{uploadMsgArr:k,uploadMsg:w}}},{key:"upload",value:function upload(){var t,a,u=this;if(this.isUploadEnable&&this.serverAllowUpload&&!(this.lastReportTime&&Zo()-this.lastReportTime<this.reportConfig.minInterval)){var h=this.getUploadMsg(),m=h.uploadMsgArr,g=h.uploadMsg;if(m.length){this.lastReportTime=Zo();try{var b,w=concat(b="".concat(this.dataReportEndpoint,"/")).call(b,this.dataReportPath);this.reportConfig.request(w,{dataType:"json",method:"POST",data:{common:this.reportConfig.common,event:g},headers:{sdktype:"im"},timeout:this.reportConfig.timeout}).catch((function(t){var a,h,g,b;u.cacheMsgList=slice(a=concat(h=u.cacheMsgList).call(h,m)).call(a,0,u.reportConfig.cacheMaxSize),null===(b=null===(g=u.reportConfig)||void 0===g?void 0:g.logger)||void 0===b||b.warn("Reporter upload failed",t)}))}catch(u){null===(a=null===(t=this.reportConfig)||void 0===t?void 0:t.logger)||void 0===a||a.warn("Exec reporter request failed",u)}clearTimeout(this.timer),this.reportHeartBeat()}}}}]),Reporter}();return u}()})),rs="\t\n\v\f\r \u2028\u2029\ufeff",ns=M("".replace),os="["+rs+"]",is=RegExp("^"+os+os+"*"),as=RegExp(os+os+"*$"),createMethod$1=function(t){return function(a){var u=toString$1(requireObjectCoercible(a));return 1&t&&(u=ns(u,is,"")),2&t&&(u=ns(u,as,"")),u}},ss={start:createMethod$1(1),end:createMethod$1(2),trim:createMethod$1(3)},cs=ss.trim,us=m.parseInt,ls=m.Symbol,fs=ls&&ls.iterator,ps=/^[+-]?0x/i,ds=M(ps.exec),hs=8!==us(rs+"08")||22!==us(rs+"0x16")||fs&&!fails((function(){us(Object(fs))}))?function parseInt(t,a){var u=cs(toString$1(t));return us(u,a>>>0||(ds(ps,u)?16:10))}:us;_export({global:!0,forced:parseInt!=hs},{parseInt:hs});var ms=H.parseInt,gs=Ye.indexOf,vs=M([].indexOf),ys=!!vs&&1/vs([1],1,-0)<0,bs=arrayMethodIsStrict("indexOf");_export({target:"Array",proto:!0,forced:ys||!bs},{indexOf:function indexOf(t){var a=arguments.length>1?arguments[1]:void 0;return ys?vs(this,t,a)||0:gs(this,t,a)}});var ws=entryVirtual("Array").indexOf,xs=Array.prototype,indexOf=function(t){var a=t.indexOf;return t===xs||z(xs,t)&&a===xs.indexOf?ws:a},ks=fails((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Ss=Object.isExtensible,_s=fails((function(){Ss(1)}))||ks?function isExtensible(t){return!!G(t)&&((!ks||"ArrayBuffer"!=classofRaw(t))&&(!Ss||Ss(t)))}:Ss,Cs=!fails((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ts=createCommonjsModule((function(t){var a=Ge.f,u=!1,h=uid("meta"),m=0,setMetadata=function(t){a(t,h,{value:{objectID:"O"+m++,weakData:{}}})},g=t.exports={enable:function(){g.enable=function(){},u=!0;var t=Nt.f,a=M([].splice),m={};m[h]=1,t(m).length&&(Nt.f=function(u){for(var m=t(u),g=0,b=m.length;g<b;g++)if(m[g]===h){a(m,g,1);break}return m},_export({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:xi.f}))},fastKey:function(t,a){if(!G(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!fe(t,h)){if(!_s(t))return"F";if(!a)return"E";setMetadata(t)}return t[h].objectID},getWeakData:function(t,a){if(!fe(t,h)){if(!_s(t))return!0;if(!a)return!1;setMetadata(t)}return t[h].weakData},onFreeze:function(t){return Cs&&u&&_s(t)&&!fe(t,h)&&setMetadata(t),t}};Xe[h]=!0})),Ms=Ge.f,Es=Ci.forEach,Ps=Mr.set,Os=Mr.getterFor,defineBuiltIns=function(t,a,u){for(var h in a)u&&u.unsafe&&t[h]?t[h]=a[h]:defineBuiltIn(t,h,a[h],u);return t},Is=Ge.f,As=Ts.fastKey,js=Mr.set,Rs=Mr.getterFor,Ls={getConstructor:function(t,a,u,h){var m=t((function(t,m){anInstance(t,g),js(t,{type:a,index:ct(null),first:void 0,last:void 0,size:0}),E||(t.size=0),isNullOrUndefined(m)||iterate(m,t[h],{that:t,AS_ENTRIES:u})})),g=m.prototype,b=Rs(a),define=function(t,a,u){var h,m,g=b(t),w=getEntry(t,a);return w?w.value=u:(g.last=w={index:m=As(a,!0),key:a,value:u,previous:h=g.last,next:void 0,removed:!1},g.first||(g.first=w),h&&(h.next=w),E?g.size++:t.size++,"F"!==m&&(g.index[m]=w)),t},getEntry=function(t,a){var u,h=b(t),m=As(a);if("F"!==m)return h.index[m];for(u=h.first;u;u=u.next)if(u.key==a)return u};return defineBuiltIns(g,{clear:function clear(){for(var t=b(this),a=t.index,u=t.first;u;)u.removed=!0,u.previous&&(u.previous=u.previous.next=void 0),delete a[u.index],u=u.next;t.first=t.last=void 0,E?t.size=0:this.size=0},delete:function(t){var a=this,u=b(a),h=getEntry(a,t);if(h){var m=h.next,g=h.previous;delete u.index[h.index],h.removed=!0,g&&(g.next=m),m&&(m.previous=g),u.first==h&&(u.first=m),u.last==h&&(u.last=g),E?u.size--:a.size--}return!!h},forEach:function forEach(t){for(var a,u=b(this),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);a=a?a.next:u.first;)for(h(a.value,a.key,this);a&&a.removed;)a=a.previous},has:function has(t){return!!getEntry(this,t)}}),defineBuiltIns(g,u?{get:function get(t){var a=getEntry(this,t);return a&&a.value},set:function set(t,a){return define(this,0===t?0:t,a)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}}),E&&Is(g,"size",{get:function(){return b(this).size}}),m},setStrong:function(t,a,u){var h=a+" Iterator",m=Rs(a),g=Rs(h);iteratorDefine(t,a,(function(t,a){js(this,{type:h,target:t,state:m(t),kind:a,last:void 0})}),(function(){for(var t=g(this),a=t.kind,u=t.last;u&&u.removed;)u=u.previous;return t.target&&(t.last=u=u?u.next:t.state.first)?"keys"==a?{value:u.key,done:!1}:"values"==a?{value:u.value,done:!1}:{value:[u.key,u.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),u?"entries":"values",!u,!0),setSpecies(a)}};!function(t,a,u){var h,g=-1!==t.indexOf("Map"),b=-1!==t.indexOf("Weak"),w=g?"set":"add",x=m[t],k=x&&x.prototype,S={};if(E&&isCallable(x)&&(b||k.forEach&&!fails((function(){(new x).entries().next()})))){var _=(h=a((function(a,u){Ps(anInstance(a,_),{type:t,collection:new x}),null!=u&&iterate(u,a[w],{that:a,AS_ENTRIES:g})}))).prototype,C=Os(t);Es(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(t){var a="add"==t||"set"==t;!(t in k)||b&&"clear"==t||He(_,t,(function(u,h){var m=C(this).collection;if(!a&&b&&!G(u))return"get"==t&&void 0;var g=m[t](0===u?0:u,h);return a?this:g}))})),b||Ms(_,"size",{configurable:!0,get:function(){return C(this).collection.size}})}else h=u.getConstructor(a,t,g,w),Ts.enable();setToStringTag(h,t,!1,!0),S[t]=h,_export({global:!0,forced:!0},S),b||u.setStrong(h,t,g)}("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),Ls);var Fs=H.Map,Ns=[].push;_export({target:"Map",stat:!0,forced:!0},{from:function from(t){var a,u,h,m,g=arguments.length,b=g>1?arguments[1]:void 0;return aConstructor(this),(a=void 0!==b)&&aCallable(b),isNullOrUndefined(t)?new this:(u=[],a?(h=0,m=functionBindContext(b,g>2?arguments[2]:void 0),iterate(t,(function(t){O(Ns,u,m(t,h++))}))):iterate(t,Ns,{that:u}),new this(u))}});_export({target:"Map",stat:!0,forced:!0},{of:function of(){return new this(mt(arguments))}});_export({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function deleteAll(){for(var t,a=anObject(this),u=aCallable(a.delete),h=!0,m=0,g=arguments.length;m<g;m++)t=O(u,a,arguments[m]),h=h&&t;return!!h}});_export({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function emplace(t,a){var u,h,m=anObject(this),g=aCallable(m.get),b=aCallable(m.has),w=aCallable(m.set);return O(b,m,t)?(u=O(g,m,t),"update"in a&&(u=a.update(u,t,m),O(w,m,t,u)),u):(h=a.insert(t,m),O(w,m,t,h),h)}});var Us=getIterator;_export({target:"Map",proto:!0,real:!0,forced:!0},{every:function every(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return!iterate(u,(function(t,u,m){if(!h(u,t,a))return m()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{filter:function filter(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(u,(function(t,u){h(u,t,a)&&O(g,m,t,u)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{find:function find(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(u,(function(t,u,m){if(h(u,t,a))return m(u)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function findKey(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(u,(function(t,u,m){if(h(u,t,a))return m(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});var Ds=M([].push);_export({target:"Map",stat:!0,forced:!0},{groupBy:function groupBy(t,a){aCallable(a);var u=getIterator(t),h=new this,m=aCallable(h.has),g=aCallable(h.get),b=aCallable(h.set);return iterate(u,(function(t){var u=a(t);O(m,h,u)?Ds(O(g,h,u),t):O(b,h,u,[t])}),{IS_ITERATOR:!0}),h}});_export({target:"Map",proto:!0,real:!0,forced:!0},{includes:function includes(t){return iterate(Us(anObject(this)),(function(a,u,h){if((m=u)===(g=t)||m!=m&&g!=g)return h();var m,g}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",stat:!0,forced:!0},{keyBy:function keyBy(t,a){var u=new this;aCallable(a);var h=aCallable(u.set);return iterate(t,(function(t){O(h,u,a(t),t)})),u}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function keyOf(t){return iterate(Us(anObject(this)),(function(a,u,h){if(u===t)return h(a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function mapKeys(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(u,(function(t,u){O(g,m,h(u,t,a),u)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function mapValues(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(u,(function(t,u){O(g,m,t,h(u,t,a))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function merge(t){for(var a=anObject(this),u=aCallable(a.set),h=arguments.length,m=0;m<h;)iterate(arguments[m++],u,{that:a,AS_ENTRIES:!0});return a}});var Bs=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function reduce(t){var a=anObject(this),u=Us(a),h=arguments.length<2,m=h?void 0:arguments[1];if(aCallable(t),iterate(u,(function(u,g){h?(h=!1,m=g):m=t(m,g,u,a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),h)throw Bs("Reduce of empty map with no initial value");return m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{some:function some(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(u,(function(t,u,m){if(h(u,t,a))return m()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var qs=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{update:function update(t,a){var u=anObject(this),h=aCallable(u.get),m=aCallable(u.has),g=aCallable(u.set),b=arguments.length;aCallable(a);var w=O(m,u,t);if(!w&&b<3)throw qs("Updating absent value");var x=w?O(h,u,t):aCallable(b>2?arguments[2]:void 0)(t,u);return O(g,u,t,a(x,t,u)),u}});var Gs=TypeError,Hs=function upsert(t,a){var u,h=anObject(this),m=aCallable(h.get),g=aCallable(h.has),b=aCallable(h.set),w=arguments.length>2?arguments[2]:void 0;if(!isCallable(a)&&!isCallable(w))throw Gs("At least one callback required");return O(g,h,t)?(u=O(m,h,t),isCallable(a)&&(u=a(u),O(b,h,t,u))):isCallable(w)&&(u=w(),O(b,h,t,u)),u};_export({target:"Map",proto:!0,real:!0,forced:!0},{upsert:Hs}),_export({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:Hs});var zs=Fs,Ks=createCommonjsModule((function(t){function _getPrototypeOf(a){var u;return t.exports=_getPrototypeOf=ht?bind$1(u=ba).call(u):function _getPrototypeOf(t){return t.__proto__||ba(t)},t.exports.__esModule=!0,t.exports.default=t.exports,_getPrototypeOf(a)}t.exports=_getPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),$s=createCommonjsModule((function(t){t.exports=function _isNativeFunction(t){var a;return-1!==indexOf(a=Function.toString.call(t)).call(a,"[native code]")},t.exports.__esModule=!0,t.exports.default=t.exports})),Ws=getBuiltIn("Reflect","construct"),Vs=Object.prototype,Qs=[].push,Js=fails((function(){function F(){}return!(Ws((function(){}),[],F)instanceof F)})),Ys=!fails((function(){Ws((function(){}))})),Xs=Js||Ys;_export({target:"Reflect",stat:!0,forced:Xs,sham:Xs},{construct:function construct(t,a){aConstructor(t),anObject(a);var u=arguments.length<3?t:aConstructor(arguments[2]);if(Ys&&!Js)return Ws(t,a,u);if(t==u){switch(a.length){case 0:return new t;case 1:return new t(a[0]);case 2:return new t(a[0],a[1]);case 3:return new t(a[0],a[1],a[2]);case 4:return new t(a[0],a[1],a[2],a[3])}var h=[null];return k(Qs,h,a),new(k(wt,t,h))}var m=u.prototype,g=ct(G(m)?m:Vs),b=k(t,g,a);return G(b)?b:g}});var Zs=H.Reflect.construct,ec=createCommonjsModule((function(t){t.exports=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Zs)return!1;if(Zs.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Zs(Boolean,[],(function(){}))),!0}catch(t){return!1}},t.exports.__esModule=!0,t.exports.default=t.exports})),tc=createCommonjsModule((function(t){function _construct(a,u,h){var m;ec()?(t.exports=_construct=bind$1(m=Zs).call(m),t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=_construct=function _construct(t,a,u){var h=[null];h.push.apply(h,a);var m=new(bind$1(Function).apply(t,h));return u&&St(m,u.prototype),m},t.exports.__esModule=!0,t.exports.default=t.exports);return _construct.apply(null,arguments)}t.exports=_construct,t.exports.__esModule=!0,t.exports.default=t.exports})),rc=createCommonjsModule((function(t){function _wrapNativeSuper(a){var u="function"==typeof zs?new zs:void 0;return t.exports=_wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!$s(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==u){if(u.has(t))return u.get(t);u.set(t,Wrapper)}function Wrapper(){return tc(t,arguments,Ks(this).constructor)}return Wrapper.prototype=lt(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),St(Wrapper,t)},t.exports.__esModule=!0,t.exports.default=t.exports,_wrapNativeSuper(a)}t.exports=_wrapNativeSuper,t.exports.__esModule=!0,t.exports.default=t.exports})),nc=getDefaultExportFromCjs(rc),oc=function(t){function CustomError(a,u,h){var m;return void 0===u&&(u={}),void 0===h&&(h=400),(m=t.call(this,a)||this).data=u,m.code=h,m.name="customError",m}return _t(CustomError,t),CustomError}(nc(Error)),ic=function(t){function ValidateError(a,u,h){var m;return void 0===u&&(u={}),(m=t.call(this,a,u,414)||this).code=414,m.name="validateError",m.rules=h,m}return _t(ValidateError,t),ValidateError}(oc),ac={200:null,406:null,808:null,810:null,201:"The client version is incorrect. You need to upgrade the SDK",302:"The user name or password is incorrect. Please check whether the appkey and token are valid and whether the account and token match",403:"Illegal operation or no permission",404:"Target object does not exist",405:"Parameter length too long",408:"Client request timed out",414:"Request parameter error",415:"Service unavailable",416:"Frequency control",417:"Repeat operation",422:"Account disabled",500:"Server internal error",503:"Server busy",508:"Expiration date",509:"Invalid",7101:"Be pulled black",700:"Partial failure of batch operation",801:"The number of people in the team has reached the upper limit",802:"No permission",803:"The team does not exist or has not changed",804:"The user is not in the team",805:"Team type mismatch",806:"The number of teams created has reached the limit",807:"Team member not valid",809:"Already in the team",811:"The number of accounts in the forced push list exceeds the limit",812:"The team is muted",813:"Due to the limited number of team, some pull people successfully",814:"Disable team message read service",815:"Maximum number of team administrators",816:"Batch operation partial failure",997:"The packet has expired",998:"Deserialize packet error",999:"Serialize packet error",9102:"Channel failure",9103:"This call has been answered / rejected at another end",10201:"Signaling: target NIM client is offline",10202:"Signaling: push is unreachable",10404:"Signaling: channel not exists",10405:"Signaling: channel already exists",10406:"Signaling: member of channel not exists",10407:"Signaling: member of channel already exists",10408:"Signaling: the invitation request does not exist or has expired",10409:"Signaling: the invitation request has been rejected",10410:"Signaling: the invitation request has been accepted",10414:"Signaling: request parameter error",10417:"Signaling: uid conflict",10419:"Signaling: the number of members of channel exceed the limit",10420:"Signaling: member is already in the channel on other client",10700:"Signaling: phased success",13002:"Abnormal chatroom status",13003:"In the blacklist",13004:"In the mute list",13006:"All members are muted, and only the administrator can speak"},sc=function(t){function CmdError(a,u,h,m,g){var b;return void 0===h&&(h=""),void 0===m&&(m=(new Date).getTime()),void 0===g&&(g={}),h=h||ac[a],(b=t.call(this,h,g,a)||this).name="cmdError",b.cmd=u,b.timetag=m,b}return _t(CmdError,t),CmdError}(oc);var cc=function(t){function UploadError(a,u,h,m,g){var b;return(b=t.call(this,a,{file:g},400)||this).name="uploadError",b.rawError=u,b.curProvider=h||1,b.mixStorePolicy=m,b}return _t(UploadError,t),UploadError}(oc),uc="object"==typeof t&&t&&t.Object===Object&&t,lc="object"==typeof self&&self&&self.Object===Object&&self,fc=uc||lc||Function("return this")(),pc=fc.Symbol,dc=Object.prototype,hc=dc.hasOwnProperty,mc=dc.toString,gc=pc?pc.toStringTag:void 0;var vc=function getRawTag(t){var a=hc.call(t,gc),u=t[gc];try{t[gc]=void 0;var h=!0}catch(t){}var m=mc.call(t);return h&&(a?t[gc]=u:delete t[gc]),m},yc=Object.prototype.toString;var bc=function objectToString(t){return yc.call(t)},wc=pc?pc.toStringTag:void 0;var xc=function baseGetTag(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":wc&&wc in Object(t)?vc(t):bc(t)};var kc=function isObject(t){var a=typeof t;return null!=t&&("object"==a||"function"==a)};var Sc=function isFunction(t){if(!kc(t))return!1;var a=xc(t);return"[object Function]"==a||"[object GeneratorFunction]"==a||"[object AsyncFunction]"==a||"[object Proxy]"==a},_c=fc["__core-js_shared__"],Cc=function(){var t=/[^.]+$/.exec(_c&&_c.keys&&_c.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var Tc=function isMasked(t){return!!Cc&&Cc in t},Mc=Function.prototype.toString;var Ec=function toSource(t){if(null!=t){try{return Mc.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Pc=/^\[object .+?Constructor\]$/,Oc=Function.prototype,Ic=Object.prototype,Ac=Oc.toString,jc=Ic.hasOwnProperty,Rc=RegExp("^"+Ac.call(jc).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Lc=function baseIsNative(t){return!(!kc(t)||Tc(t))&&(Sc(t)?Rc:Pc).test(Ec(t))};var Fc=function getValue(t,a){return null==t?void 0:t[a]};var Nc=function getNative(t,a){var u=Fc(t,a);return Lc(u)?u:void 0},Uc=function(){try{var t=Nc(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Dc=function baseAssignValue(t,a,u){"__proto__"==a&&Uc?Uc(t,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):t[a]=u};var Bc=function eq(t,a){return t===a||t!=t&&a!=a},qc=Object.prototype.hasOwnProperty;var Gc=function assignValue(t,a,u){var h=t[a];qc.call(t,a)&&Bc(h,u)&&(void 0!==u||a in t)||Dc(t,a,u)};var Hc=function copyObject(t,a,u,h){var m=!u;u||(u={});for(var g=-1,b=a.length;++g<b;){var w=a[g],x=h?h(u[w],t[w],w,u,t):void 0;void 0===x&&(x=t[w]),m?Dc(u,w,x):Gc(u,w,x)}return u};var zc=function identity(t){return t};var Kc=function apply(t,a,u){switch(u.length){case 0:return t.call(a);case 1:return t.call(a,u[0]);case 2:return t.call(a,u[0],u[1]);case 3:return t.call(a,u[0],u[1],u[2])}return t.apply(a,u)},$c=Math.max;var Wc=function overRest(t,a,u){return a=$c(void 0===a?t.length-1:a,0),function(){for(var h=arguments,m=-1,g=$c(h.length-a,0),b=Array(g);++m<g;)b[m]=h[a+m];m=-1;for(var w=Array(a+1);++m<a;)w[m]=h[m];return w[a]=u(b),Kc(t,this,w)}};var Vc=function constant(t){return function(){return t}},Qc=Uc?function(t,a){return Uc(t,"toString",{configurable:!0,enumerable:!1,value:Vc(a),writable:!0})}:zc,Jc=Date.now;var Yc=function shortOut(t){var a=0,u=0;return function(){var h=Jc(),m=16-(h-u);if(u=h,m>0){if(++a>=800)return arguments[0]}else a=0;return t.apply(void 0,arguments)}},Xc=Yc(Qc);var Zc=function baseRest(t,a){return Xc(Wc(t,a,zc),t+"")};var eu=function isLength(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var tu=function isArrayLike(t){return null!=t&&eu(t.length)&&!Sc(t)},ru=/^(?:0|[1-9]\d*)$/;var nu=function isIndex(t,a){var u=typeof t;return!!(a=null==a?9007199254740991:a)&&("number"==u||"symbol"!=u&&ru.test(t))&&t>-1&&t%1==0&&t<a};var ou=function isIterateeCall(t,a,u){if(!kc(u))return!1;var h=typeof a;return!!("number"==h?tu(u)&&nu(a,u.length):"string"==h&&a in u)&&Bc(u[a],t)};var iu=function createAssigner(t){return Zc((function(a,u){var h=-1,m=u.length,g=m>1?u[m-1]:void 0,b=m>2?u[2]:void 0;for(g=t.length>3&&"function"==typeof g?(m--,g):void 0,b&&ou(u[0],u[1],b)&&(g=m<3?void 0:g,m=1),a=Object(a);++h<m;){var w=u[h];w&&t(a,w,h,g)}return a}))};var au=function baseTimes(t,a){for(var u=-1,h=Array(t);++u<t;)h[u]=a(u);return h};var su=function isObjectLike(t){return null!=t&&"object"==typeof t};var cu=function baseIsArguments(t){return su(t)&&"[object Arguments]"==xc(t)},uu=Object.prototype,lu=uu.hasOwnProperty,fu=uu.propertyIsEnumerable,pu=cu(function(){return arguments}())?cu:function(t){return su(t)&&lu.call(t,"callee")&&!fu.call(t,"callee")},du=pu,hu=Array.isArray;var mu=function stubFalse(){return!1},gu=createCommonjsModule((function(t,a){var u=a&&!a.nodeType&&a,h=u&&t&&!t.nodeType&&t,m=h&&h.exports===u?fc.Buffer:void 0,g=(m?m.isBuffer:void 0)||mu;t.exports=g})),vu={};vu["[object Float32Array]"]=vu["[object Float64Array]"]=vu["[object Int8Array]"]=vu["[object Int16Array]"]=vu["[object Int32Array]"]=vu["[object Uint8Array]"]=vu["[object Uint8ClampedArray]"]=vu["[object Uint16Array]"]=vu["[object Uint32Array]"]=!0,vu["[object Arguments]"]=vu["[object Array]"]=vu["[object ArrayBuffer]"]=vu["[object Boolean]"]=vu["[object DataView]"]=vu["[object Date]"]=vu["[object Error]"]=vu["[object Function]"]=vu["[object Map]"]=vu["[object Number]"]=vu["[object Object]"]=vu["[object RegExp]"]=vu["[object Set]"]=vu["[object String]"]=vu["[object WeakMap]"]=!1;var yu=function baseIsTypedArray(t){return su(t)&&eu(t.length)&&!!vu[xc(t)]};var bu=function baseUnary(t){return function(a){return t(a)}},wu=createCommonjsModule((function(t,a){var u=a&&!a.nodeType&&a,h=u&&t&&!t.nodeType&&t,m=h&&h.exports===u&&uc.process,g=function(){try{var t=h&&h.require&&h.require("util").types;return t||m&&m.binding&&m.binding("util")}catch(t){}}();t.exports=g})),xu=wu&&wu.isTypedArray,ku=xu?bu(xu):yu,Su=Object.prototype.hasOwnProperty;var _u=function arrayLikeKeys(t,a){var u=hu(t),h=!u&&du(t),m=!u&&!h&&gu(t),g=!u&&!h&&!m&&ku(t),b=u||h||m||g,w=b?au(t.length,String):[],x=w.length;for(var k in t)!a&&!Su.call(t,k)||b&&("length"==k||m&&("offset"==k||"parent"==k)||g&&("buffer"==k||"byteLength"==k||"byteOffset"==k)||nu(k,x))||w.push(k);return w},Cu=Object.prototype;var Tu=function isPrototype(t){var a=t&&t.constructor;return t===("function"==typeof a&&a.prototype||Cu)};var Mu=function overArg(t,a){return function(u){return t(a(u))}},Eu=Mu(Object.keys,Object),Pu=Object.prototype.hasOwnProperty;var Ou=function baseKeys(t){if(!Tu(t))return Eu(t);var a=[];for(var u in Object(t))Pu.call(t,u)&&"constructor"!=u&&a.push(u);return a};var Iu=function keys(t){return tu(t)?_u(t):Ou(t)};iu((function(t,a,u,h){Hc(a,Iu(a),t,h)}));var Au,ju=function isUndefined(t){return void 0===t},Ru=(Au=function _s4(){return(65536*(1+Math.random())|0).toString(16).substring(1)},function(){return Au()+Au()+Au()+Au()+Au()+Au()+Au()+Au()});function getEnumKeys(t){var a;return filter(a=$a(t)).call(a,(function(t){return!(+t>=0)}))}function getEnumKeyByEnumValue(t,a){var u,h=filter(u=$a(t)).call(u,(function(u){return t[u]==a}));return h.length>0?h[0]:void 0}function emptyFuncWithPromise(){return Jo.resolve()}var Lu=TypeError,createMethod=function(t){return function(a,u,h,m){aCallable(u);var g=toObject(a),b=D(g),w=lengthOfArrayLike(g),x=t?w-1:0,k=t?-1:1;if(h<2)for(;;){if(x in b){m=b[x],x+=k;break}if(x+=k,t?x<0:w<=x)throw Lu("Reduce of empty array with no initial value")}for(;t?x>=0:w>x;x+=k)x in b&&(m=u(m,b[x],x,g));return m}},Fu={left:createMethod(!1),right:createMethod(!0)}.left,Nu=arrayMethodIsStrict("reduce");_export({target:"Array",proto:!0,forced:!Nu||!Qr&&Y>79&&Y<83},{reduce:function reduce(t){var a=arguments.length;return Fu(this,t,a,a>1?arguments[1]:void 0)}});var Uu=entryVirtual("Array").reduce,Du=Array.prototype,reduce=function(t){var a=t.reduce;return t===Du||z(Du,t)&&a===Du.reduce?Uu:a},Bu={},qu={};function parseCmd(t,a){var u,h,m;try{m=JSON.parse(t)}catch(u){throw a.error("Parse command error: ",t),u}var g=m.sid+"_"+m.cid,b=m.r;if(includes(u=["4_1","4_2","4_10","4_11"]).call(u,g)){var w=m.r[1].headerPacket;g=w.sid+"_"+w.cid,b=m.r[1].body}var x,k=qu[g],S=Bu[k],_=function genCmdError(t,a){var u=ac[t];return null===u?null:new sc(t,a,u,(new Date).getTime())}(m.code,k),C={cmd:k,raw:m,error:_,service:null==S?void 0:S.service,content:{}};if(C.error){if(C.error.cmd=k,C.error.callFunc="parseCmd",!(null===(h=null==S?void 0:S.ignoreErrCodes)||void 0===h?void 0:includes(h).call(h,m.code)))return C;a.warn("parseCmd:: ignore error ",C.error),C.error.ignore=!0}if(!k||!S)return C.notFound=!0,C;S.response&&forEach$1(x=S.response).call(x,(function(t,a){var u=b[a],h=t.type,m=t.name,g=t.reflectMapper;if(!ju(u))switch(h){case"Property":C.content[m]=g?deserialize(u,g):u;break;case"PropertyArray":C.content[m]=map$6(u).call(u,(function(t){return g?deserialize(t,g):t}));break;case"long":case"Long":case"byte":case"Byte":case"Number":C.content[m]=+u;break;default:C.content[m]=u}}));return C}function serialize(t,a){var u={};for(var h in t)void 0!==a[h]&&(u[a[h]]=t[h]);return u}function deserialize(t,a){var u={};for(var h in t)void 0!==a[h]&&(u[a[h]]=t[h]);return u}function registerParser(t){Bu=Ot(Bu,t.cmdConfig),qu=Ot(qu,t.cmdMap)}function invertSerializeMap(t){var a;return reduce(a=$a(t)).call(a,(function(a,u){var h,m=t[u];return a[u]=reduce(h=$a(m)).call(h,(function(t,a){return t[m[a]]=a,t}),{}),a}),{})}H.JSON||(H.JSON={stringify:JSON.stringify});var Gu=function stringify(t,a,u){return k(H.JSON.stringify,null,arguments)},Hu=Gu,zu=entryVirtual("Array").values,Ku=Array.prototype,$u={DOMTokenList:!0,NodeList:!0},values=function(t){var a=t.values;return t===Ku||z(Ku,t)&&a===Ku.values||fe($u,Zt(t))?zu:a};_export({target:"Array",stat:!0},{isArray:ei});var Wu=H.Array.isArray,Vu=Ci.every,Qu=arrayMethodIsStrict("every");_export({target:"Array",proto:!0,forced:!Qu},{every:function every(t){return Vu(this,t,arguments.length>1?arguments[1]:void 0)}});var Ju=entryVirtual("Array").every,Yu=Array.prototype,every=function(t){var a=t.every;return t===Yu||z(Yu,t)&&a===Yu.every?Ju:a};var Xu=function baseIsRegExp(t){return su(t)&&"[object RegExp]"==xc(t)},Zu=wu&&wu.isRegExp,el=Zu?bu(Zu):Xu,tl=Nc(Object,"create");var rl=function hashClear(){this.__data__=tl?tl(null):{},this.size=0};var nl=function hashDelete(t){var a=this.has(t)&&delete this.__data__[t];return this.size-=a?1:0,a},ol=Object.prototype.hasOwnProperty;var il=function hashGet(t){var a=this.__data__;if(tl){var u=a[t];return"__lodash_hash_undefined__"===u?void 0:u}return ol.call(a,t)?a[t]:void 0},al=Object.prototype.hasOwnProperty;var sl=function hashHas(t){var a=this.__data__;return tl?void 0!==a[t]:al.call(a,t)};var cl=function hashSet(t,a){var u=this.__data__;return this.size+=this.has(t)?0:1,u[t]=tl&&void 0===a?"__lodash_hash_undefined__":a,this};function Hash(t){var a=-1,u=null==t?0:t.length;for(this.clear();++a<u;){var h=t[a];this.set(h[0],h[1])}}Hash.prototype.clear=rl,Hash.prototype.delete=nl,Hash.prototype.get=il,Hash.prototype.has=sl,Hash.prototype.set=cl;var ul=Hash;var ll=function listCacheClear(){this.__data__=[],this.size=0};var fl=function assocIndexOf(t,a){for(var u=t.length;u--;)if(Bc(t[u][0],a))return u;return-1},pl=Array.prototype.splice;var dl=function listCacheDelete(t){var a=this.__data__,u=fl(a,t);return!(u<0)&&(u==a.length-1?a.pop():pl.call(a,u,1),--this.size,!0)};var hl=function listCacheGet(t){var a=this.__data__,u=fl(a,t);return u<0?void 0:a[u][1]};var ml=function listCacheHas(t){return fl(this.__data__,t)>-1};var gl=function listCacheSet(t,a){var u=this.__data__,h=fl(u,t);return h<0?(++this.size,u.push([t,a])):u[h][1]=a,this};function ListCache(t){var a=-1,u=null==t?0:t.length;for(this.clear();++a<u;){var h=t[a];this.set(h[0],h[1])}}ListCache.prototype.clear=ll,ListCache.prototype.delete=dl,ListCache.prototype.get=hl,ListCache.prototype.has=ml,ListCache.prototype.set=gl;var vl=ListCache,yl=Nc(fc,"Map");var bl=function mapCacheClear(){this.size=0,this.__data__={hash:new ul,map:new(yl||vl),string:new ul}};var wl=function isKeyable(t){var a=typeof t;return"string"==a||"number"==a||"symbol"==a||"boolean"==a?"__proto__"!==t:null===t};var xl=function getMapData(t,a){var u=t.__data__;return wl(a)?u["string"==typeof a?"string":"hash"]:u.map};var kl=function mapCacheDelete(t){var a=xl(this,t).delete(t);return this.size-=a?1:0,a};var Sl=function mapCacheGet(t){return xl(this,t).get(t)};var _l=function mapCacheHas(t){return xl(this,t).has(t)};var Cl=function mapCacheSet(t,a){var u=xl(this,t),h=u.size;return u.set(t,a),this.size+=u.size==h?0:1,this};function MapCache(t){var a=-1,u=null==t?0:t.length;for(this.clear();++a<u;){var h=t[a];this.set(h[0],h[1])}}MapCache.prototype.clear=bl,MapCache.prototype.delete=kl,MapCache.prototype.get=Sl,MapCache.prototype.has=_l,MapCache.prototype.set=Cl;var Tl=MapCache;var Ml=function setCacheAdd(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var El=function setCacheHas(t){return this.__data__.has(t)};function SetCache(t){var a=-1,u=null==t?0:t.length;for(this.__data__=new Tl;++a<u;)this.add(t[a])}SetCache.prototype.add=SetCache.prototype.push=Ml,SetCache.prototype.has=El;var Pl=SetCache;var Ol=function baseFindIndex(t,a,u,h){for(var m=t.length,g=u+(h?1:-1);h?g--:++g<m;)if(a(t[g],g,t))return g;return-1};var Il=function baseIsNaN(t){return t!=t};var Al=function strictIndexOf(t,a,u){for(var h=u-1,m=t.length;++h<m;)if(t[h]===a)return h;return-1};var jl=function baseIndexOf(t,a,u){return a==a?Al(t,a,u):Ol(t,Il,u)};var Rl=function arrayIncludes(t,a){return!!(null==t?0:t.length)&&jl(t,a,0)>-1};var Ll=function arrayIncludesWith(t,a,u){for(var h=-1,m=null==t?0:t.length;++h<m;)if(u(a,t[h]))return!0;return!1};var Fl=function arrayMap(t,a){for(var u=-1,h=null==t?0:t.length,m=Array(h);++u<h;)m[u]=a(t[u],u,t);return m};var Nl=function cacheHas(t,a){return t.has(a)};var Ul=function baseDifference(t,a,u,h){var m=-1,g=Rl,b=!0,w=t.length,x=[],k=a.length;if(!w)return x;u&&(a=Fl(a,bu(u))),h?(g=Ll,b=!1):a.length>=200&&(g=Nl,b=!1,a=new Pl(a));e:for(;++m<w;){var S=t[m],_=null==u?S:u(S);if(S=h||0!==S?S:0,b&&_==_){for(var C=k;C--;)if(a[C]===_)continue e;x.push(S)}else g(a,_,h)||x.push(S)}return x};var Dl=function isArrayLikeObject(t){return su(t)&&tu(t)},Bl=Zc((function(t,a){return Dl(t)?Ul(t,a):[]})),ql=Bl;function replacer(t,a){return a instanceof RegExp?"__REGEXP "+a.toString():a}function validate(t,a,u){var h;void 0===a&&(a={});var m={};return forEach$1(h=$a(t)).call(h,(function(h){var g=t[h].type,b=u?"In "+u+", ":"";if(void 0===a[h]){if(!1===t[h].required)return void(m[h]=a[h]);throw new ic(b+'param "'+h+'" is required',{key:h},"required")}var w=Gl[g];if(w&&!w(a,h,t[h]))throw new ic(b+'param "'+h+'" expects '+Hu(t[h],replacer),{key:h,value:a[h]},Hu(t[h]));m[h]=a[h]})),m}var Gl={string:function string(t,a,u){var h=u.allowEmpty,m=u.max,g=u.min,b=u.regExp,w=t[a];return"string"==typeof w&&((!1!==h||""!==w)&&(!("number"==typeof m&&w.length>m)&&(!("number"==typeof g&&w.length<g)&&!(el(b)&&!b.test(w)))))},number:function number(t,a,u){var h=u.min,m=u.max,g=t[a];return"number"==typeof g&&(!("number"==typeof h&&g<h)&&!("number"==typeof m&&g>m))},boolean:function boolean(t,a){return"boolean"==typeof t[a]},enum:function _enum(t,a,u){var h=values(u),m=t[a];return!h||indexOf(h).call(h,m)>-1},array:function array(t,a,u){var h,m=u.itemType,g=u.rules,b=u.min,w=u.max,x=values(u),k=t[a];return!!Wu(k)&&(!("number"==typeof w&&k.length>w)&&(!("number"==typeof b&&k.length<b)&&(!(m&&"enum"!==m&&!every(k).call(k,(function(t){return typeof t===m})))&&(("enum"!==m||!x||!ql.apply(void 0,concat(h=[k]).call(h,x)).length)&&(g&&forEach$1(k).call(k,(function(t,u){return validate(g,t,a+"["+u+"]")})),!0)))))},object:function object(t,a,u){var h=u.rules,m=t[a];return h&&validate(h,m,a),!0}},Hl=Ci.findIndex,zl="findIndex",Kl=!0;zl in[]&&Array(1).findIndex((function(){Kl=!1})),_export({target:"Array",proto:!0,forced:Kl},{findIndex:function findIndex(t){return Hl(this,t,arguments.length>1?arguments[1]:void 0)}});var $l=entryVirtual("Array").findIndex,Wl=Array.prototype,findIndex=function(t){var a=t.findIndex;return t===Wl||z(Wl,t)&&a===Wl.findIndex?$l:a},Vl=["error","warn","log","debug"],Ql=function emptyFunc(){},Jl=["off","error","warn","log","debug"],Yl=function(){function Logger(t,a){this.name=a,this.strategies={debug:console.log,log:console.log,warn:console.warn,error:console.error},this.debug=Ql,this.log=Ql,this.warn=Ql,this.error=Ql,this.name=a,Logger.instancesName.push(a),includes(Jl).call(Jl,t)||(t="off"),this.setLogFunc(t)}var t=Logger.prototype;return t.setLogFunc=function setLogFunc(t){var a=this,u=findIndex(Vl).call(Vl,(function(a){return a===t}));forEach$1(Vl).call(Vl,(function(t,h){h<=u&&(a[t]=function(){var a=slice(Array.prototype).call(arguments),u=this.formatArgs(a,t);this.strategies[t](u)})}))},t.formatArgs=function formatArgs(t,a){var u=new Date,h=u.getMonth()+1+"-"+u.getDate()+" "+u.getHours()+":"+u.getMinutes()+":"+u.getSeconds()+":"+u.getMilliseconds();return"[NIM "+a+" "+this.name+" "+h+"] "+map$6(t).call(t,(function(t){return t instanceof oc?t.name+", "+t.code+", "+t.message:t instanceof Error?t&&t.message?t.message:t:"object"==typeof t?Hu(t):t})).join(" ")},t.destroy=function destroy(){this.debug=Ql,this.log=Ql,this.warn=Ql,this.error=Ql},Logger}();Yl.instancesName=[];var Xl=ki.f("iterator"),Zl=createCommonjsModule((function(t){function _typeof(a){return t.exports=_typeof="function"==typeof ha&&"symbol"==typeof Xl?function(t){return typeof t}:function(t){return t&&"function"==typeof ha&&t.constructor===ha&&t!==ha.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,_typeof(a)}t.exports=_typeof,t.exports.__esModule=!0,t.exports.default=t.exports})),ef=createCommonjsModule((function(t){var a=Zl.default;function _regeneratorRuntime(){t.exports=_regeneratorRuntime=function _regeneratorRuntime(){return u},t.exports.__esModule=!0,t.exports.default=t.exports;var u={},h=Object.prototype,m=h.hasOwnProperty,g="function"==typeof ha?ha:{},b=g.iterator||"@@iterator",w=g.asyncIterator||"@@asyncIterator",x=g.toStringTag||"@@toStringTag";function define(t,a,u){return va(t,a,{value:u,enumerable:!0,configurable:!0,writable:!0}),t[a]}try{define({},"")}catch(t){define=function define(t,a,u){return t[a]=u}}function wrap(t,a,u,h){var m=a&&a.prototype instanceof Generator?a:Generator,g=lt(m.prototype),b=new Context(h||[]);return g._invoke=function(t,a,u){var h="suspendedStart";return function(m,g){if("executing"===h)throw new Error("Generator is already running");if("completed"===h){if("throw"===m)throw g;return doneResult()}for(u.method=m,u.arg=g;;){var b=u.delegate;if(b){var w=maybeInvokeDelegate(b,u);if(w){if(w===k)continue;return w}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===h)throw h="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);h="executing";var x=tryCatch(t,a,u);if("normal"===x.type){if(h=u.done?"completed":"suspendedYield",x.arg===k)continue;return{value:x.arg,done:u.done}}"throw"===x.type&&(h="completed",u.method="throw",u.arg=x.arg)}}}(t,u,b),g}function tryCatch(t,a,u){try{return{type:"normal",arg:t.call(a,u)}}catch(t){return{type:"throw",arg:t}}}u.wrap=wrap;var k={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var S={};define(S,b,(function(){return this}));var _=ba&&ba(ba(values([])));_&&_!==h&&m.call(_,b)&&(S=_);var C=GeneratorFunctionPrototype.prototype=Generator.prototype=lt(S);function defineIteratorMethods(t){var a;forEach$1(a=["next","throw","return"]).call(a,(function(a){define(t,a,(function(t){return this._invoke(a,t)}))}))}function AsyncIterator(t,u){function invoke(h,g,b,w){var x=tryCatch(t[h],t,g);if("throw"!==x.type){var k=x.arg,S=k.value;return S&&"object"==a(S)&&m.call(S,"__await")?u.resolve(S.__await).then((function(t){invoke("next",t,b,w)}),(function(t){invoke("throw",t,b,w)})):u.resolve(S).then((function(t){k.value=t,b(k)}),(function(t){return invoke("throw",t,b,w)}))}w(x.arg)}var h;this._invoke=function(t,a){function callInvokeWithMethodAndArg(){return new u((function(u,h){invoke(t,a,u,h)}))}return h=h?h.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,a){var u=t.iterator[a.method];if(void 0===u){if(a.delegate=null,"throw"===a.method){if(t.iterator.return&&(a.method="return",a.arg=void 0,maybeInvokeDelegate(t,a),"throw"===a.method))return k;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var h=tryCatch(u,t.iterator,a.arg);if("throw"===h.type)return a.method="throw",a.arg=h.arg,a.delegate=null,k;var m=h.arg;return m?m.done?(a[t.resultName]=m.value,a.next=t.nextLoc,"return"!==a.method&&(a.method="next",a.arg=void 0),a.delegate=null,k):m:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,k)}function pushTryEntry(t){var a={tryLoc:t[0]};1 in t&&(a.catchLoc=t[1]),2 in t&&(a.finallyLoc=t[2],a.afterLoc=t[3]),this.tryEntries.push(a)}function resetTryEntry(t){var a=t.completion||{};a.type="normal",delete a.arg,t.completion=a}function Context(t){this.tryEntries=[{tryLoc:"root"}],forEach$1(t).call(t,pushTryEntry,this),this.reset(!0)}function values(t){if(t){var a=t[b];if(a)return a.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var u=-1,h=function next(){for(;++u<t.length;)if(m.call(t,u))return next.value=t[u],next.done=!1,next;return next.value=void 0,next.done=!0,next};return h.next=h}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(C,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,x,"GeneratorFunction"),u.isGeneratorFunction=function(t){var a="function"==typeof t&&t.constructor;return!!a&&(a===GeneratorFunction||"GeneratorFunction"===(a.displayName||a.name))},u.mark=function(t){return ht?ht(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,x,"GeneratorFunction")),t.prototype=lt(C),t},u.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,w,(function(){return this})),u.AsyncIterator=AsyncIterator,u.async=function(t,a,h,m,g){void 0===g&&(g=Jo);var b=new AsyncIterator(wrap(t,a,h,m),g);return u.isGeneratorFunction(a)?b:b.next().then((function(t){return t.done?t.value:b.next()}))},defineIteratorMethods(C),define(C,x,"Generator"),define(C,b,(function(){return this})),define(C,"toString",(function(){return"[object Generator]"})),u.keys=function(t){var a=[];for(var u in t)a.push(u);return reverse(a).call(a),function next(){for(;a.length;){var u=a.pop();if(u in t)return next.value=u,next.done=!1,next}return next.done=!0,next}},u.values=values,Context.prototype={constructor:Context,reset:function reset(t){var a;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,forEach$1(a=this.tryEntries).call(a,resetTryEntry),!t)for(var u in this)"t"===u.charAt(0)&&m.call(this,u)&&!isNaN(+slice(u).call(u,1))&&(this[u]=void 0)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var a=this;function handle(u,h){return g.type="throw",g.arg=t,a.next=u,h&&(a.method="next",a.arg=void 0),!!h}for(var u=this.tryEntries.length-1;u>=0;--u){var h=this.tryEntries[u],g=h.completion;if("root"===h.tryLoc)return handle("end");if(h.tryLoc<=this.prev){var b=m.call(h,"catchLoc"),w=m.call(h,"finallyLoc");if(b&&w){if(this.prev<h.catchLoc)return handle(h.catchLoc,!0);if(this.prev<h.finallyLoc)return handle(h.finallyLoc)}else if(b){if(this.prev<h.catchLoc)return handle(h.catchLoc,!0)}else{if(!w)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return handle(h.finallyLoc)}}}},abrupt:function abrupt(t,a){for(var u=this.tryEntries.length-1;u>=0;--u){var h=this.tryEntries[u];if(h.tryLoc<=this.prev&&m.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var g=h;break}}g&&("break"===t||"continue"===t)&&g.tryLoc<=a&&a<=g.finallyLoc&&(g=null);var b=g?g.completion:{};return b.type=t,b.arg=a,g?(this.method="next",this.next=g.finallyLoc,k):this.complete(b)},complete:function complete(t,a){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&a&&(this.next=a),k},finish:function finish(t){for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a];if(u.finallyLoc===t)return this.complete(u.completion,u.afterLoc),resetTryEntry(u),k}},catch:function _catch(t){for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a];if(u.tryLoc===t){var h=u.completion;if("throw"===h.type){var m=h.arg;resetTryEntry(u)}return m}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,a,u){return this.delegate={iterator:values(t),resultName:a,nextLoc:u},"next"===this.method&&(this.arg=void 0),k}},u}t.exports=_regeneratorRuntime,t.exports.__esModule=!0,t.exports.default=t.exports})),tf=ef(),rf=tf;try{regeneratorRuntime=tf}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=tf:Function("r","regeneratorRuntime = r")(tf)}function __rest(t,a){var u={};for(var h in t)Object.prototype.hasOwnProperty.call(t,h)&&a.indexOf(h)<0&&(u[h]=t[h]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var m=0;for(h=Object.getOwnPropertySymbols(t);m<h.length;m++)a.indexOf(h[m])<0&&Object.prototype.propertyIsEnumerable.call(t,h[m])&&(u[h[m]]=t[h[m]])}return u}function __awaiter(t,a,u,h){return new(u||(u=Promise))((function(m,g){function fulfilled(t){try{step(h.next(t))}catch(t){g(t)}}function rejected(t){try{step(h.throw(t))}catch(t){g(t)}}function step(t){t.done?m(t.value):function adopt(t){return t instanceof u?t:new u((function(a){a(t)}))}(t.value).then(fulfilled,rejected)}step((h=h.apply(t,a||[])).next())}))}var nf=function stackClear(){this.__data__=new vl,this.size=0};var af=function stackDelete(t){var a=this.__data__,u=a.delete(t);return this.size=a.size,u};var sf=function stackGet(t){return this.__data__.get(t)};var cf=function stackHas(t){return this.__data__.has(t)};var uf=function stackSet(t,a){var u=this.__data__;if(u instanceof vl){var h=u.__data__;if(!yl||h.length<199)return h.push([t,a]),this.size=++u.size,this;u=this.__data__=new Tl(h)}return u.set(t,a),this.size=u.size,this};function Stack(t){var a=this.__data__=new vl(t);this.size=a.size}Stack.prototype.clear=nf,Stack.prototype.delete=af,Stack.prototype.get=sf,Stack.prototype.has=cf,Stack.prototype.set=uf;var lf=Stack;var ff=function assignMergeValue(t,a,u){(void 0!==u&&!Bc(t[a],u)||void 0===u&&!(a in t))&&Dc(t,a,u)};var pf=function createBaseFor(t){return function(a,u,h){for(var m=-1,g=Object(a),b=h(a),w=b.length;w--;){var x=b[t?w:++m];if(!1===u(g[x],x,g))break}return a}}(),df=createCommonjsModule((function(t,a){var u=a&&!a.nodeType&&a,h=u&&t&&!t.nodeType&&t,m=h&&h.exports===u?fc.Buffer:void 0,g=m?m.allocUnsafe:void 0;t.exports=function cloneBuffer(t,a){if(a)return t.slice();var u=t.length,h=g?g(u):new t.constructor(u);return t.copy(h),h}})),hf=fc.Uint8Array;var mf=function cloneArrayBuffer(t){var a=new t.constructor(t.byteLength);return new hf(a).set(new hf(t)),a};var gf=function cloneTypedArray(t,a){var u=a?mf(t.buffer):t.buffer;return new t.constructor(u,t.byteOffset,t.length)};var vf=function copyArray(t,a){var u=-1,h=t.length;for(a||(a=Array(h));++u<h;)a[u]=t[u];return a},yf=Object.create,bf=function(){function object(){}return function(t){if(!kc(t))return{};if(yf)return yf(t);object.prototype=t;var a=new object;return object.prototype=void 0,a}}(),wf=Mu(Object.getPrototypeOf,Object);var xf=function initCloneObject(t){return"function"!=typeof t.constructor||Tu(t)?{}:bf(wf(t))},kf=Function.prototype,Sf=Object.prototype,_f=kf.toString,Cf=Sf.hasOwnProperty,Tf=_f.call(Object);var Mf=function isPlainObject(t){if(!su(t)||"[object Object]"!=xc(t))return!1;var a=wf(t);if(null===a)return!0;var u=Cf.call(a,"constructor")&&a.constructor;return"function"==typeof u&&u instanceof u&&_f.call(u)==Tf};var Ef=function safeGet(t,a){if(("constructor"!==a||"function"!=typeof t[a])&&"__proto__"!=a)return t[a]};var Pf=function nativeKeysIn(t){var a=[];if(null!=t)for(var u in Object(t))a.push(u);return a},Of=Object.prototype.hasOwnProperty;var If=function baseKeysIn(t){if(!kc(t))return Pf(t);var a=Tu(t),u=[];for(var h in t)("constructor"!=h||!a&&Of.call(t,h))&&u.push(h);return u};var Af=function keysIn(t){return tu(t)?_u(t,!0):If(t)};var jf=function toPlainObject(t){return Hc(t,Af(t))};var Rf=function baseMergeDeep(t,a,u,h,m,g,b){var w=Ef(t,u),x=Ef(a,u),k=b.get(x);if(k)ff(t,u,k);else{var S=g?g(w,x,u+"",t,a,b):void 0,_=void 0===S;if(_){var C=hu(x),T=!C&&gu(x),M=!C&&!T&&ku(x);S=x,C||T||M?hu(w)?S=w:Dl(w)?S=vf(w):T?(_=!1,S=df(x,!0)):M?(_=!1,S=gf(x,!0)):S=[]:Mf(x)||du(x)?(S=w,du(w)?S=jf(w):kc(w)&&!Sc(w)||(S=xf(x))):_=!1}_&&(b.set(x,S),m(S,x,h,g,b),b.delete(x)),ff(t,u,S)}};var Lf=function baseMerge(t,a,u,h,m){t!==a&&pf(a,(function(g,b){if(m||(m=new lf),kc(g))Rf(t,a,b,u,baseMerge,h,m);else{var w=h?h(Ef(t,b),g,b+"",t,a,m):void 0;void 0===w&&(w=g),ff(t,b,w)}}),Af)},Ff=iu((function(t,a,u){Lf(t,a,u)})),Nf=Ci.some,Uf=arrayMethodIsStrict("some");_export({target:"Array",proto:!0,forced:!Uf},{some:function some(t){return Nf(this,t,arguments.length>1?arguments[1]:void 0)}});var Df,Bf,qf=entryVirtual("Array").some,Gf=Array.prototype,some=function(t){var a=t.some;return t===Gf||z(Gf,t)&&a===Gf.some?qf:a};!function(t){t[t.Unset=0]="Unset",t[t.RN=2]="RN",t[t.UNIAPP=3]="UNIAPP",t[t.Electron=5]="Electron",t[t.WeiXin=6]="WeiXin",t[t.BROWSER=100]="BROWSER",t[t.H5=101]="H5",t[t.Ali=102]="Ali",t[t.Baidu=103]="Baidu",t[t.Tiktok=104]="Tiktok"}(Df||(Df={})),function(t){t[t.kStatNetTypeUnkonw=0]="kStatNetTypeUnkonw",t[t.kStatNetTypeEthernet=1]="kStatNetTypeEthernet",t[t.kStatNetTypeWifi=2]="kStatNetTypeWifi",t[t.kStatNetType2G=3]="kStatNetType2G",t[t.kStatNetType3G=4]="kStatNetType3G",t[t.kStatNetType4G=5]="kStatNetType4G",t[t.kStatNetType5G=6]="kStatNetType5G"}(Bf||(Bf={}));var Hf={wifi:Bf.kStatNetTypeWifi,"2g":Bf.kStatNetType2G,"3g":Bf.kStatNetType3G,"4g":Bf.kStatNetType4G,"5g":Bf.kStatNetType5G,ethernet:Bf.kStatNetTypeEthernet,unknown:Bf.kStatNetTypeUnkonw,none:Bf.kStatNetTypeUnkonw,notreachable:Bf.kStatNetTypeUnkonw,wwan:Bf.kStatNetTypeUnkonw};function isMobile(){if(!navigator||!navigator.userAgent)return!1;var t=[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i];return some(t).call(t,(function(t){return navigator.userAgent.match(t)}))}function isElectron(){var t;return!(!navigator||!navigator.userAgent)&&("object"==typeof navigator&&"string"==typeof navigator.userAgent&&indexOf(t=navigator.userAgent).call(t,"Electron")>=0)}function isBrowser(){return navigator&&navigator.userAgent}var zf={setLogger:function setLogger(t){throw new Error("Function not implemented.")},platform:"",WebSocket:function(){function AdapterSocket(t,a){throw this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,new Error("Method not implemented.")}var t=AdapterSocket.prototype;return t.close=function close(t,a){throw new Error("Method not implemented.")},t.send=function send(t){throw new Error("Method not implemented.")},t.onclose=function onclose(t){throw new Error("Method not implemented.")},t.onerror=function onerror(t){throw new Error("Method not implemented.")},t.onmessage=function onmessage(t){throw new Error("Method not implemented.")},t.onopen=function onopen(t){throw new Error("Method not implemented.")},AdapterSocket}(),localStorage:{},request:function request(t,a){throw new Error("Function not implemented.")},uploadFile:function uploadFile(t){throw new Error("Function not implemented.")},getSystemInfo:function getSystemInfo(){throw new Error("Function not implemented.")},net:{__getEnv:function __getEnv(){return null},__onNetworkStatusChangeFn:null,getNetworkStatus:function getNetworkStatus(){var t=this.__getEnv();return new Jo((function(a,u){t.getNetworkType({success:function success(t){var u=!1;u="boolean"==typeof t.networkAvailable?t.networkAvailable:"none"!==t.networkType.toLowerCase(),a({net_type:Hf[t.networkType.toLowerCase()],net_connect:u})},fail:function fail(){u(new Error("getNetworkType failed"))}})}))},onNetworkStatusChange:function onNetworkStatusChange(t){var a=this.__getEnv();this.offNetworkStatusChange(),a.onNetworkStatusChange&&(this.__onNetworkStatusChangeFn=function(a){var u=a.networkType.toLowerCase();t({isConnected:a.isConnected||"none"!==u,networkType:Hf[u]})},a.onNetworkStatusChange(this.__onNetworkStatusChangeFn))},offNetworkStatusChange:function offNetworkStatusChange(){var t=this.__getEnv();t.offNetworkStatusChange&&(this.__onNetworkStatusChangeFn&&t.offNetworkStatusChange(this.__onNetworkStatusChangeFn),this.__onNetworkStatusChangeFn=null)}}};var Kf=function(){function CoreAdapters(t){this.lastSuccUploadHost="",this.core=t}var t=CoreAdapters.prototype;return t.request=function request(t,a,u){var h=this,m=(new Date).getTime(),g=(null==u?void 0:u.exception_service)||0;return zf.request(t,a).catch((function(u){var b,w,x=u;throw h.core.reporter.reportTraceStart("exceptions",{user_id:h.core.options.account,trace_id:null===(w=null===(b=h.core.clientSocket)||void 0===b?void 0:b.socket)||void 0===w?void 0:w.sessionId,start_time:m,action:1,exception_service:g}),h.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof x.code?x.code:0,description:x.message||""+x.code,operation_type:0,target:t,context:a?Hu(a):""},{asyncParams:zf.net.getNetworkStatus()}),h.core.reporter.reportTraceEnd("exceptions",1),u}))},t.uploadFile=function uploadFile(t){var a,u,h,m;return __awaiter(this,void 0,void 0,rf.mark((function _callee(){var g,b,w,x,k,S,_,C,T,M,E,P,O,I;return rf.wrap((function _callee$(A){for(;;)switch(A.prev=A.next){case 0:w="BROWSER"===zf.platform,x=w?t.chunkUploadHostBackupList:t.commonUploadHostBackupList,k=w?t.chunkUploadHost:t.commonUploadHost,S=indexOf(x).call(x,k),_=-1===S?concat(g=[k]).call(g,x):concat(b=[k]).call(b,slice(x).call(x,0,S),slice(x).call(x,S+1)),C=Math.max(indexOf(_).call(_,this.lastSuccUploadHost),0),T=null,M=0;case 8:if(!(M<_.length)){A.next=32;break}return E=(new Date).getTime(),P=_[(M+C)%_.length],A.prev=11,A.next=14,zf.uploadFile(Ot(Ot({},t),w?{chunkUploadHost:P}:{commonUploadHost:P}));case 14:return O=A.sent,this.lastSuccUploadHost=P,A.abrupt("return",O);case 19:if(A.prev=19,A.t0=A.catch(11),this.core.cloudStorage.nosErrorCount--,T=A.t0,I=A.t0,this.core.reporter.reportTraceStart("exceptions",{user_id:this.core.options.account||(null===(u=null===(a=this.core)||void 0===a?void 0:a.auth)||void 0===u?void 0:u.account),trace_id:null===(m=null===(h=this.core.clientSocket)||void 0===h?void 0:h.socket)||void 0===m?void 0:m.sessionId,start_time:E,action:1,exception_service:3}),this.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof I.code?I.code:0,description:I.message||""+I.code,operation_type:1,target:P},{asyncParams:zf.net.getNetworkStatus()}),this.core.reporter.reportTraceEnd("exceptions",1),!A.t0||191002!==A.t0.code&&10499!==A.t0.errCode){A.next=29;break}throw A.t0;case 29:M++,A.next=8;break;case 32:throw T;case 33:case"end":return A.stop()}}),_callee,this,[[11,19]])})))},CoreAdapters}(),$f="imElite_sdk_abtest_web",Wf="https://statistic.live.126.net,https://statistic-overseas.yunxinfw.com",Vf=function(){function ABTest(t,a){this.abtInfo={},this.core=t,this.config=a}return ABTest.prototype.abtRequest=function abtRequest(){var t,a;return __awaiter(this,void 0,void 0,rf.mark((function _callee(){var u;return rf.wrap((function _callee$(h){for(;;)switch(h.prev=h.next){case 0:if(this.core.options.isAbtestEnable){h.next=2;break}return h.abrupt("return");case 2:if(!this.abtInfo.experiments){h.next=4;break}return h.abrupt("return");case 4:if(this.config.abtestUrl){h.next=6;break}return h.abrupt("return");case 6:return h.prev=6,h.next=9,this.core.adapters.request(this.config.abtestUrl,{method:"POST",dataType:"json",headers:{sdktype:"ABTest"},data:{clientInfo:{projectKey:this.config.abtestProjectKey,appKey:this.core.options.appkey,osType:"Web",sdkVersion:"0.19.0",deviceId:this.core.config.deviceId},useLocalCache:!0}},{exception_service:7});case 9:u=h.sent,h.next=15;break;case 12:h.prev=12,h.t0=h.catch(6),this.core.logger.warn("ABTest request failed");case 15:this.abtInfo=(null===(a=null===(t=null==u?void 0:u.data)||void 0===t?void 0:t.data)||void 0===a?void 0:a.abtInfo)||{};case 16:case"end":return h.stop()}}),_callee,this,[[6,12]])})))},ABTest}(),Qf=TypeError,Jf=Object.getOwnPropertyDescriptor,Yf=E&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,a){if(ei(t)&&!Jf(t,"length").writable)throw Qf("Cannot set read only .length");return t.length=a}:function(t,a){return t.length=a},Xf=TypeError,deletePropertyOrThrow=function(t,a){if(!delete t[a])throw Xf("Cannot delete property "+tryToString(a)+" of "+tryToString(t))},Zf=arrayMethodHasSpeciesSupport("splice"),ep=Math.max,tp=Math.min;_export({target:"Array",proto:!0,forced:!Zf},{splice:function splice(t,a){var u,h,m,g,b,w,x=toObject(this),k=lengthOfArrayLike(x),S=toAbsoluteIndex(t,k),_=arguments.length;for(0===_?u=h=0:1===_?(u=0,h=k-S):(u=_-2,h=tp(ep(toIntegerOrInfinity(a),0),k-S)),doesNotExceedSafeInteger(k+u-h),m=arraySpeciesCreate(x,h),g=0;g<h;g++)(b=S+g)in x&&createProperty(m,g,x[b]);if(m.length=h,u<h){for(g=S;g<k-h;g++)w=g+u,(b=g+h)in x?x[w]=x[b]:deletePropertyOrThrow(x,w);for(g=k;g>k-h+u;g--)deletePropertyOrThrow(x,g-1)}else if(u>h)for(g=k-h;g>S;g--)w=g+u-1,(b=g+h-1)in x?x[w]=x[b]:deletePropertyOrThrow(x,w);for(g=0;g<u;g++)x[g+S]=arguments[g+2];return Yf(x,k-h+u),m}});var rp=entryVirtual("Array").splice,np=Array.prototype,splice=function(t){var a=t.splice;return t===np||z(np,t)&&a===np.splice?rp:a},callWithSafeIterationClosing=function(t,a,u,h){try{return h?a(anObject(u)[0],u[1]):a(u)}catch(a){iteratorClose(t,"throw",a)}},op=Array,ip=!checkCorrectnessOfIteration((function(t){Array.from(t)}));_export({target:"Array",stat:!0,forced:ip},{from:function from(t){var a=toObject(t),u=dn(this),h=arguments.length,m=h>1?arguments[1]:void 0,g=void 0!==m;g&&(m=functionBindContext(m,h>2?arguments[2]:void 0));var b,w,x,k,S,_,C=getIteratorMethod$5(a),T=0;if(!C||this===op&&isArrayIteratorMethod(C))for(b=lengthOfArrayLike(a),w=u?new this(b):op(b);b>T;T++)_=g?m(a[T],T):a[T],createProperty(w,T,_);else for(S=(k=getIterator(a,C)).next,w=u?new this:[];!(x=O(S,k)).done;T++)_=g?callWithSafeIterationClosing(k,m,[x.value,T],!0):x.value,createProperty(w,T,_);return w.length=T,w}});var ap=H.Array.from,sp=getIteratorMethod$5;function _createForOfIteratorHelperLoose$1(t,a){var u,h=void 0!==ha&&sp(t)||t["@@iterator"];if(h)return bind$1(u=(h=h.call(t)).next).call(u,h);if(Wu(t)||(h=function _unsupportedIterableToArray$1(t,a){var u;if(!t)return;if("string"==typeof t)return _arrayLikeToArray$1(t,a);var h=slice(u=Object.prototype.toString.call(t)).call(u,8,-1);"Object"===h&&t.constructor&&(h=t.constructor.name);if("Map"===h||"Set"===h)return ap(t);if("Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return _arrayLikeToArray$1(t,a)}(t))||a&&t&&"number"==typeof t.length){h&&(t=h);var m=0;return function(){return m>=t.length?{done:!0}:{done:!1,value:t[m++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray$1(t,a){(null==a||a>t.length)&&(a=t.length);for(var u=0,h=new Array(a);u<a;u++)h[u]=t[u];return h}var cp=function(){function TimerManager(){this.timerList=[],this.id=0,this.timer=null,this.timeout=0}var t=TimerManager.prototype;return t.addTimer=function addTimer(t,a,u){void 0===a&&(a=0),void 0===u&&(u=1);var h=(new Date).getTime(),m=this.id;return this.timerList.push({id:m,loop:u,count:0,timeout:h+a,interval:a,callback:t}),this.id++,this.checkTimer(h),m},t.checkTimer=function checkTimer(t){if(void 0===t&&(t=(new Date).getTime()),this.removeFinished(),0!==this.timerList.length||null==this.timer){for(var a,u,h=0,m=_createForOfIteratorHelperLoose$1(this.timerList);!(a=m()).done;){var g=a.value;(0===h||h>g.timeout)&&(h=g.timeout)}if(0!==this.timerList.length)if(null===this.timer||h<this.timeout||this.timeout<t)this.timer=mi(bind$1(u=this.nowTime).call(u,this),h-t),this.timeout=h}},t.nowTime=function nowTime(){for(var t,nowTime=(new Date).getTime(),a=_createForOfIteratorHelperLoose$1(this.timerList);!(t=a()).done;){var u=t.value;nowTime>=u.timeout&&(u.callback(),u.count++,u.timeout=nowTime+u.interval)}this.clerTime(),this.checkTimer(nowTime)},t.clerTime=function clerTime(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},t.deleteTimer=function deleteTimer(t){for(var a=this.timerList.length-1;a>=0;a--){var u;if(this.timerList[a].id===t)splice(u=this.timerList).call(u,a,1)}},t.removeFinished=function removeFinished(){for(var t=this.timerList.length-1;t>=0;t--){var a,u=this.timerList[t];if(u.loop>=0&&u.count>=u.loop)splice(a=this.timerList).call(a,t,1)}},t.destroy=function destroy(){this.clerTime(),this.timerList=[],this.id=0,this.timer=null},TimerManager}(),up=function(){function Service(t,a){this.name=t,this.core=a,this.name=t,this.logger=a.logger,this.core=a}return Service.prototype.process=function process(t){var a=this[t.cmd+"Handler"];return"function"==typeof a?a.call(this,t):t.error&&!t.error.ignore?Jo.reject(t.error):Jo.resolve(t)},Service}(),lp=Backoff;function Backoff(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var a=Math.random(),u=Math.floor(a*this.jitter*t);t=0==(1&Math.floor(10*a))?t-u:t+u}return 0|Math.min(t,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(t){this.ms=t},Backoff.prototype.setMax=function(t){this.max=t},Backoff.prototype.setJitter=function(t){this.jitter=t};var fp=function isSymbol(t){return"symbol"==typeof t||su(t)&&"[object Symbol]"==xc(t)},pp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dp=/^\w*$/;var hp=function isKey(t,a){if(hu(t))return!1;var u=typeof t;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=t&&!fp(t))||(dp.test(t)||!pp.test(t)||null!=a&&t in Object(a))};function memoize(t,a){if("function"!=typeof t||null!=a&&"function"!=typeof a)throw new TypeError("Expected a function");var memoized=function(){var u=arguments,h=a?a.apply(this,u):u[0],m=memoized.cache;if(m.has(h))return m.get(h);var g=t.apply(this,u);return memoized.cache=m.set(h,g)||m,g};return memoized.cache=new(memoize.Cache||Tl),memoized}memoize.Cache=Tl;var mp=memoize;var gp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vp=/\\(\\)?/g,yp=function memoizeCapped(t){var a=mp(t,(function(t){return 500===u.size&&u.clear(),t})),u=a.cache;return a}((function(t){var a=[];return 46===t.charCodeAt(0)&&a.push(""),t.replace(gp,(function(t,u,h,m){a.push(h?m.replace(vp,"$1"):u||t)})),a})),bp=yp,wp=pc?pc.prototype:void 0,xp=wp?wp.toString:void 0;var kp=function baseToString(t){if("string"==typeof t)return t;if(hu(t))return Fl(t,baseToString)+"";if(fp(t))return xp?xp.call(t):"";var a=t+"";return"0"==a&&1/t==-Infinity?"-0":a};var Sp=function toString(t){return null==t?"":kp(t)};var _p=function castPath(t,a){return hu(t)?t:hp(t,a)?[t]:bp(Sp(t))};var Cp=function toKey(t){if("string"==typeof t||fp(t))return t;var a=t+"";return"0"==a&&1/t==-Infinity?"-0":a};var Tp=function baseGet(t,a){for(var u=0,h=(a=_p(a,t)).length;null!=t&&u<h;)t=t[Cp(a[u++])];return u&&u==h?t:void 0};var Mp=function get(t,a,u){var h=null==t?void 0:Tp(t,a);return void 0===h?u:h},Ep=Nc(fc,"Set");var Pp=function noop(){};var Op=function setToArray(t){var a=-1,u=Array(t.size);return t.forEach((function(t){u[++a]=t})),u},Ip=Ep&&1/Op(new Ep([,-0]))[1]==1/0?function(t){return new Ep(t)}:Pp,Ap=Ip;var jp=function baseUniq(t,a,u){var h=-1,m=Rl,g=t.length,b=!0,w=[],x=w;if(u)b=!1,m=Ll;else if(g>=200){var k=a?null:Ap(t);if(k)return Op(k);b=!1,m=Nl,x=new Pl}else x=a?[]:w;e:for(;++h<g;){var S=t[h],_=a?a(S):S;if(S=u||0!==S?S:0,b&&_==_){for(var C=x.length;C--;)if(x[C]===_)continue e;a&&x.push(_),w.push(S)}else m(x,_,u)||(x!==w&&x.push(_),w.push(S))}return w};var Rp,Lp=function uniq(t){return t&&t.length?jp(t):[]},Fp=["disconnect","connect","heartbeat","message","json","event","ack","error","noop"],Np=["transport not supported","client not handshaken","unauthorized"],Up=["reconnect"],Dp=function(t){function BaseWebsocket(a,u){var h;return(h=t.call(this)||this).url=u,h.websocket=null,h.socketConnectTimer=0,h.core=a,h.url=u,h.status="disconnected",h.logger=a.logger,h.connect(),h}_t(BaseWebsocket,t);var a=BaseWebsocket.prototype;return a.connect=function connect(){var t=this;"connecting"!==this.status&&"connected"!==this.status?(this.status="connecting",this.core.adapters.request("https://"+this.url+"/socket.io/1/?t="+Zo(),{method:"GET",dataType:"text",timeout:this.core.options.xhrConnectTimeout||8e3},{exception_service:6}).then((function(a){var u=a.data.split(":"),h=u[0],m=u[1];return t.sessionId=h,t.closeTimeout=1e3*m,t._createWebsocket("wss://"+t.url+"/socket.io/1/websocket/"+h)})).catch((function(a){a=a||{},t.logger.error("imsocket::handshake fail. message: ",a&&a.message," err code: ",a&&a.code),a.code=408===a.code?408:415,t.status="disconnected",t.emit("handshakeFailed",a)}))):this.logger.warn("imsocket::socket is connecting or connected",this.status)},a.close=function close(){if(this.websocket){this.logger.log("imsocket:: close websocket");try{this.websocket.send(this.encodePacket({type:"disconnect"}))}catch(t){this.logger.warn("attempt to send encodePacket error",t)}try{this.websocket.close()}catch(t){this.logger.warn("attempt to close websocket error",t)}this.clean()}},a.clean=function clean(){this.status="disconnected",this.websocket&&(this.socketUrl=void 0,this.websocket.onmessage=null,this.websocket.onopen=null,this.websocket.onerror=null,this.websocket.onclose=null,this.websocket=null,this.emit("disconnect"))},a.onConnect=function onConnect(){this.status="connected",this.resetCloseTimer(),this.emit("connect"),clearTimeout(this.socketConnectTimer)},a._createWebsocket=function _createWebsocket(t){var a,u=this;this.socketConnectTimer=mi((function(){u.logger.error("core:: socket connect timeout. url: ",u.socketUrl),u.emit("handshakeFailed",new oc("BaseWebsocket::_createWebSocket socket connect timeout. url: "+u.socketUrl,{},408))}),this.core.options.socketConnectTimeout||8e3),this.socketUrl=t,this.websocket=new zf.WebSocket(t),this.websocket.onmessage=bind$1(a=this.onMessage).call(a,this),this.websocket.onclose=function(){u.logger.log("imsocket:: websocket onclose done"),u.clean()},this.websocket.onerror=function(t){u.logger.error("imsocket:: onerror",t),"logined"===u.core.status&&u.core.clientSocket.ping()}},a.onMessage=function onMessage(t){var a;this.resetCloseTimer();var u=this.decodePacket(t.data);if(u)switch(u.type){case"connect":this.onConnect();break;case"disconnect":this.close();break;case"message":case"json":this.emit("message",u.data);break;case"event":u.name&&this.emit(u.name,u.args);break;case"error":"unauthorized"===u.reason?this.emit("connect_failed",u.reason):this.emit("error",u.reason),this.logger.error("core:: socket onmessage type error. url: ",this.socketUrl),clearTimeout(this.socketConnectTimer),this.emit("handshakeFailed",new oc("BaseWebsocket::onMessage socket error. url: "+this.socketUrl,{},415));break;case"heartbeat":null===(a=this.websocket)||void 0===a||a.send(this.encodePacket({type:"heartbeat"}));break;default:this.logger.warn("imsocket::no handler type",u.type)}},a.encodePacket=function encodePacket(t){var a,u,h=t.type,m=t.id,g=void 0===m?"":m,b=t.endpoint,w=void 0===b?"":b,x=t.ack,k=null;if(!h)return"";switch(h){case"error":a=t.reason?indexOf(Np).call(Np,t.reason):"",u=t.advice?indexOf(Up).call(Up,t.advice):"",""===a&&""===u||(k=a+(""!==u?"+"+u:""));break;case"message":""!==t.data&&(k=t.data);break;case"event":a={name:t.name},a=t.args&&t.args.length?{name:t.name,args:t.args}:{name:t.name},k=Hu(a);break;case"json":k=Hu(t.data);break;case"connect":t.qs&&(k=t.qs);break;case"ack":k=t.ackId+(t.args&&t.args.length?"+"+Hu(t.args):"")}var S=[indexOf(Fp).call(Fp,h),g+("data"===x?"+":""),w];return null!=k&&S.push(k),S.join(":")},a.decodePacket=function decodePacket(t){if(t)if("�"!=t.charAt(0)){var a=t.match(/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/);if(a){var u,h=a[1],m=a[2],g=a[3],b=a[4],w=a[5],x={type:Fp[+h],endpoint:b};switch(m&&(x.id=m,x.ack=!g||"data"),x.type){case"error":u=w.split("+"),x.reason=Np[+u[0]]||"";break;case"message":x.data=w||"";break;case"connect":x.qs=w||"";break;case"event":try{var k=JSON.parse(w);x.name=k.name,x.args=k.args}catch(t){this.logger.error("imsocket::parseData::type::event error",t)}x.args=x.args||[];break;case"json":try{x.data=JSON.parse(w)}catch(t){this.logger.error("imsocket::parseData::type::json error",t)}break;case"ack":if((u=w.match(/^([0-9]+)(\+)?(.*)/))&&(x.ackId=u[1],x.args=[],u[3]))try{x.args=u[3]?JSON.parse(u[3]):[]}catch(t){this.logger.error("imsocket::parseData::type::ack error",t)}}return x}}else this.logger.error("imsocket::unrecognize dataStr",slice(t).call(t,0,20))},a.send=function send(t){var a,u={data:t,type:"message",endpoint:""};null===(a=this.websocket)||void 0===a||a.send(this.encodePacket(u))},a.resetCloseTimer=function resetCloseTimer(){var t=this;this.closeTimeout&&(clearTimeout(this.closeTimer),this.closeTimer=mi((function(){t.close()}),this.closeTimeout))},BaseWebsocket}(gi);!function(t){t[t.ACTIVE=1]="ACTIVE",t[t.KICKED=2]="KICKED",t[t.OFFLINE=3]="OFFLINE"}(Rp||(Rp={}));var Bp=function(){function ClientSocket(t){this.linkUrls=[],this.isAutoReconnect=!1,this.packetTimeout=3e4,this.packetSer=1,this.retryCount=0,this.reconnectTimer=0,this.backoff=new lp({max:8e3,min:1600,jitter:.01}),this.sendingCmdMap=new zs,this.pingTimer=0,this.hasNetworkListener=!1,this.core=t,this.logger=t.logger,this.reporter=t.reporter,this.timerManager=t.timerManager}var t=ClientSocket.prototype;return t.connect=function connect(t,a){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,rf.mark((function _callee(){var u,h,m,g,b,w;return rf.wrap((function _callee$(x){for(;;)switch(x.prev=x.next){case 0:if(validate({linkUrls:{type:"array",itemType:"string",required:!1}},t),/^(unconnected|waitReconnect)$/.test(this.core.status)){x.next=5;break}return u="Core socket status is "+this.core.status+", and would not connect",this.logger.warn(u),x.abrupt("return",Jo.reject(u));case 5:this.core.status="connecting",t.linkUrls&&t.linkUrls.length>0&&(this.linkUrls=concat(h=t.linkUrls).call(h,this.linkUrls),this.linkUrls=Lp(this.linkUrls)),0===this.linkUrls.length&&this.linkUrls.push("weblink.netease.im:443"),m=0;case 9:if(!(m<this.linkUrls.length)){x.next=31;break}return g=this.linkUrls[m],b=(new Date).getTime(),x.prev=12,x.next=15,this.doConnect(g);case 15:return this.core.status="connected",this.logger.log("core:: connect success with url: "+g),x.abrupt("return",g);case 20:x.prev=20,x.t0=x.catch(12),w=x.t0,a&&a(w,g),this.reporter.reportTraceStart("exceptions",{user_id:this.core.options.account,start_time:b,action:0,exception_service:6}),this.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof w.code?w.code:0,description:w.message||""+w.code,operation_type:0,target:g},{asyncParams:zf.net.getNetworkStatus()}),this.reporter.reportTraceEnd("exceptions",1),this.logger.warn("core:: connect failed with url: "+g,x.t0);case 28:m++,x.next=9;break;case 31:throw 0===this.retryCount?this.doDisconnect(Rp.ACTIVE,"SocketHandshakeFailed"):this.doDisconnect(Rp.OFFLINE,"ReconnectHadRetryAllLinks"),new Error("core: socket xhr or socket connect failed");case 33:case"end":return x.stop()}}),_callee,this,[[12,20]])})))},t.doConnect=function doConnect(t){var a=this,u=!1;return new Jo((function(h,m){var g;a.socket=new Dp(a.core,t),a.socket.on("connect",(function(){a.logger.log("socket on connect",t),u=!0,h()})),a.socket.on("message",bind$1(g=a.onMessage).call(g,a)),a.socket.on("disconnect",(function(t){a.logger.log("core:: socket on disconnect",t),u=!0,a.doDisconnect(Rp.OFFLINE,"SocketOnDisconnect")})),a.socket.on("handshakeFailed",(function(t){u?a.ping():(a.logger.error("core:: handshake failed. ",t&&t.message),a.cleanSocket()),u=!0,m(t)}))}))},t.cleanSocket=function cleanSocket(){this.socket&&("function"==typeof this.socket.removeAllListeners&&this.socket.removeAllListeners(),"function"==typeof this.socket.close&&this.socket.close(),this.socket=void 0)},t.beforeConnect=function beforeConnect(){this.reconnectTimer&&clearTimeout(this.reconnectTimer)},t.resetConnectStatus=function resetConnectStatus(){clearTimeout(this.reconnectTimer),this.backoff.reset(),this.retryCount=0,this.initOnlineListener()},t.doDisconnect=function doDisconnect(t,a){if(this.logger.log("doDisconnect: type "+t+", description "+a),"unconnected"!==this.core.status){var u={1:"close",2:"kicked",3:"broken"}[t]||"";this.markAllCmdInvaild(new oc("Packet timeout due to instance disconnect",{disconnect_reason:u},415)),this.timerManager.destroy(),clearTimeout(this.pingTimer),this.cleanSocket();var h=!this.core.options.needReconnect||this.retryCount>=this.core.options.reconnectionAttempts;if(t===Rp.ACTIVE||h)this.logger.log("doDisconnect: emit disconnect, type "+t,h),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.core.eventBus.emit("disconnect"),this.core.emit("disconnect"),this.destroyOnlineListener();else if(t===Rp.KICKED){this.logger.log("doDisconnect: kicked"),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer);var m="string"==typeof a?{reason:"unknow",message:a}:a;this.core.eventBus.emit("kicked",m),this.core.emit("kicked",m),this.destroyOnlineListener()}else t===Rp.OFFLINE&&this.core.auth.isManualLoginAttempt?(this.logger.log("doDisconnect: offline in manual login phase. no reconnect"),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.destroyOnlineListener()):t===Rp.OFFLINE?(this.logger.log("doDisconnect: start to reconnect"),this.attempToReconnect()):this.logger.log("doDisconnect: nothing to do")}else this.logger.warn("doDisconnect: already unconnected")},t.attempToReconnect=function attempToReconnect(){var t=this;if("waitReconnect"!==this.core.status){0===this.retryCount&&(this.core.eventBus.emit("disconnect"),this.core.emit("disconnect"));var a=this.backoff.duration();this.retryCount++,this.logger.log("willReconnect "+this.retryCount+" "+a),this.core.eventBus.emit("willReconnect",{retryCount:this.retryCount,duration:a}),this.core.emit("willReconnect",{retryCount:this.retryCount,duration:a}),this.core.status="waitReconnect",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=mi((function(){return __awaiter(t,void 0,void 0,rf.mark((function _callee2(){var t=this;return rf.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if("waitReconnect"===this.core.status){a.next=3;break}return this.logger.warn("doDisconnect: reconnectTimer status is "+this.core.status+", would not go on reconnecting"),a.abrupt("return");case 3:return a.next=5,zf.net.getNetworkStatus();case 5:!1===a.sent.net_connect?(this.logger.log("doDisconnect: skip this reconnection attempt because network is offline"),this.core.status="connecting",this.retryCount>=this.core.options.reconnectionAttempts?this.doDisconnect(Rp.OFFLINE,"MaxReconnectionAttemptExceed"):this.attempToReconnect()):this.core.auth.login({isAutoReconnect:!0}).catch((function(){t.logger.error("core::attempToReconnect failed "+t.retryCount)}));case 7:case"end":return a.stop()}}),_callee2,this)})))}),a)}else this.logger.warn("doDisconnect: already is waiting reconnect")},t.sendCmd=function sendCmd(t,a,u){var h=this;if("logined"!==this.core.status&&"login"!==t&&"chatroomLogin"!==t&&"qchatLogin"!==t)return this.logger.warn("instance status is "+this.core.status+", so can not sendCmd "+t),Jo.reject({cmd:t,error:{code:"No_connected",message:"Connection not established",timetag:(new Date).getTime()}});if(!this.socket||!this.socket.send)return Jo.reject("No_socket");var m="heartbeat"!==t,g=m?this.packetSer++:0,b=function createCmd(t,a,u,h){var m=Bu[t];if(!m)return u.error("createCmd:: can not find cmd config: ",t),null;var g,b={SER:a,SID:m.sid,CID:m.cid,Q:[]};return m.params&&h&&forEach$1(g=m.params).call(g,(function(t){var a=h[t.name];if(!ju(a)){var u=t.type,m=t.reflectMapper;switch(t.type){case"PropertyArray":u="ArrayMable",a=map$6(a).call(a,(function(t){return{t:"Property",v:m?serialize(t,m):t}}));break;case"Property":a=m?serialize(a,m):a;break;case"Bool":case"bool":a=a?"true":"false"}b.Q.push({t:u,v:a})}})),{packet:b,hasPacketResponse:"boolean"!=typeof m.hasPacketResponse||m.hasPacketResponse,hasPacketTimer:"boolean"!=typeof m.hasPacketTimer||m.hasPacketTimer}}(t,g,this.logger,a);if(!b){var w="SendCmd "+g+" "+t+" error";return this.logger.error(w),Jo.reject(w)}var x=b.packet,k=b.hasPacketResponse,S=b.hasPacketTimer,_=Hu(x);m&&("debug"===this.core.options.debugLevel?this.logger.debug("core::sendCmd",t,"ser:"+g,_):this.logger.log("core::sendCmd",t,"ser:"+g));var C=(new Date).getTime();return new Jo((function(m,b){k&&h.sendingCmdMap.set(g,{cmd:t,params:a,callback:[m,b],timer:S?mi((function(){var a=new sc(408,t,"Packet Timeout",(new Date).getTime(),{message:"ser "+g+" cmd "+t+" timeout"});a.callFunc="sendCmd",h.markCmdInvalid(g,a,t)}),u&&u.timeout?u.timeout:h.core.config.timeout):null});try{h.socket.send(_),k||m(x)}catch(a){var w=new sc(415,t,a&&a.message||"Unable to send packet",(new Date).getTime(),{message:"send json error",rawError:a});w.callFunc="sendCmd",h.markCmdInvalid(g,w,t),b(a)}})).catch((function(t){var a,u=[408,415];if(!includes(u).call(u,t.code))return Jo.reject(t);h.reporter.reportTraceStart("exceptions",{user_id:h.core.options.account,trace_id:null===(a=h.socket)||void 0===a?void 0:a.sessionId,start_time:C,action:2,exception_service:6});var m=Mp(t,"data.disconnect_reason")||"",g=408===t.code?"Send failed due to timeout":"Send failed. Reason unknown";return g=415===t.code?Hu({disconnect_reason:m}):g,h.reporter.reportTraceUpdateV2("exceptions",{code:t.code||415,description:g,operation_type:1,target:x.SID+"-"+x.CID,context:""+x.SER},{asyncParams:zf.net.getNetworkStatus()}),h.reporter.reportTraceEnd("exceptions",1),Jo.reject(t)}))},t.onMessage=function onMessage(t){var a=parseCmd(t,this.logger);if(a){var u=a.raw.ser;a.error&&this.logger.error("core:onMessage packet error",a.raw.sid+"_"+a.raw.cid+", ser:"+u+",",a.error),a.notFound?this.logger.warn("core::onMessage packet not found",a.raw.sid+"_"+a.raw.cid+", ser:"+u):("heartbeat"!==a.cmd&&("debug"===this.core.options.debugLevel?this.logger.debug("imsocket::recvCmd ser:"+u,a.cmd,a.content):this.logger.log("imsocket::recvCmd ser:"+u,a.cmd)),a.__receiveTime=Zo(),this.packetHandler(a))}},t.packetHandler=function packetHandler(t){var a,u;if(t){var h=t.raw.ser,m=this.sendingCmdMap.get(h);if(m&&m.cmd===t.cmd){var g=m.callback,b=m.timer,w=m.params;if(clearTimeout(b),t.params=w,this.sendingCmdMap.delete(h),"heartbeat"===t.cmd)return void g[0]();var x=null===(a=this.core[t.service])||void 0===a?void 0:a.process(t);x&&"function"==typeof x.then?x.then((function(t){g[0](t)})).catch((function(t){g[1](t)})):(this.logger.log("imsocket:: handlerFn without promise",t.service,t.cmd),g[0]())}else null===(u=this.core[t.service])||void 0===u||u.process(t)}},t.markCmdInvalid=function markCmdInvalid(t,a,u){var h=this.sendingCmdMap.get(t);if(h){var m=h.callback,g=h.timer;g&&clearTimeout(g),this.sendingCmdMap.delete(t),this.logger.warn("packet "+t+", "+u+" is invalid:",a),m[1](a)}},t.markAllCmdInvaild=function markAllCmdInvaild(t){var a,u=this;this.logger.log("markAllCmdInvaild",t),forEach$1(a=this.sendingCmdMap).call(a,(function(a){var h=a.callback,m=a.timer,g=a.cmd;u.logger.debug('markAllCmdInvaild:: cmd "'+g+'"'),m&&clearTimeout(m),h[1](t)})),this.sendingCmdMap.clear()},t.ping=function ping(){return __awaiter(this,void 0,void 0,rf.mark((function _callee3(){var t=this;return rf.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:return clearTimeout(this.pingTimer),a.prev=1,a.next=4,this.sendCmd("heartbeat");case 4:a.next=14;break;case 6:return a.prev=6,a.t0=a.catch(1),a.next=10,this.testHeartBeat5Timeout();case 10:if(!a.sent){a.next=14;break}return this.doDisconnect(Rp.OFFLINE,"PingError"),a.abrupt("return");case 14:this.pingTimer=mi((function(){t.ping()}),3e4);case 15:case"end":return a.stop()}}),_callee3,this,[[1,6]])})))},t.testHeartBeat5Timeout=function testHeartBeat5Timeout(){return __awaiter(this,void 0,void 0,rf.mark((function _callee4(){var t;return rf.wrap((function _callee4$(a){for(;;)switch(a.prev=a.next){case 0:clearTimeout(this.pingTimer),t=0;case 2:if(!(t<5)){a.next=15;break}return a.prev=3,a.next=6,this.sendCmd("heartbeat",{},{timeout:3e3});case 6:return a.abrupt("return",!1);case 9:a.prev=9,a.t0=a.catch(3),this.logger.debug("core:: test heartbeat "+t+" Timeout");case 12:t++,a.next=2;break;case 15:return a.abrupt("return",!0);case 16:case"end":return a.stop()}}),_callee4,this,[[3,9]])})))},t.initOnlineListener=function initOnlineListener(){var t=this;this.hasNetworkListener||(this.logger.log("core::onlineListener:init"),this.hasNetworkListener=!0,zf.net.onNetworkStatusChange((function(a){t.logger.log("core::onlineListener:network change",a),a.isConnected&&"logined"===t.core.status?t.ping():a.isConnected&&"waitReconnect"===t.core.status?(t.reconnectTimer&&clearTimeout(t.reconnectTimer),t.core.auth.login({isAutoReconnect:!0}).catch((function(){t.logger.error("core::attempToReconnect failed "+t.retryCount)}))):a.isConnected||t.doDisconnect(Rp.OFFLINE,"OfflineListener")})))},t.destroyOnlineListener=function destroyOnlineListener(){this.logger.log("core::onlineListener:destroy"),zf.net.offNetworkStatusChange(),this.hasNetworkListener=!1},t.disconnect=function disconnect(){switch(this.core.status){case"connected":case"logined":case"connecting":case"waitReconnect":return this.doDisconnect(Rp.ACTIVE,"UserActiveDisconnect"),Jo.resolve();case"unconnected":case"destroyed":return Jo.resolve()}},ClientSocket}();var qp=function baseForOwn(t,a){return t&&pf(t,a,Iu)};var Gp=function baseInverter(t,a,u,h){return qp(t,(function(t,m,g){a(h,u(t),m,g)})),h};var Hp,zp,Kp=function createInverter(t,a){return function(u,h){return Gp(u,t,a(h),{})}},$p=Object.prototype.toString,Wp=Kp((function(t,a,u){null!=a&&"function"!=typeof a.toString&&(a=$p.call(a)),t[a]=u}),Vc(zc));function formatChatroom(t){var a=Ot({},t),u=["announcement","broadcastUrl","ext"],h=["createTime","updateTime","onlineMemberNum"],m=["mute"];return forEach$1(u).call(u,(function(t){void 0===a[t]&&(a[t]="")})),forEach$1(h).call(h,(function(t){void 0!==a[t]&&(a[t]=ms(a[t]))})),forEach$1(m).call(m,(function(t){void 0!==a[t]&&(a[t]=1===ms(a[t]))})),a}!function(t){t[t.Android=1]="Android",t[t.iOS=2]="iOS",t[t.PC=4]="PC",t[t.WindowsPhone=8]="WindowsPhone",t[t.Web=16]="Web",t[t.Server=32]="Server",t[t.Mac=64]="Mac"}(Hp||(Hp={})),function(t){t[t.text=0]="text",t[t.image=1]="image",t[t.audio=2]="audio",t[t.video=3]="video",t[t.geo=4]="geo",t[t.notification=5]="notification",t[t.file=6]="file",t[t.tip=10]="tip",t[t.robot=11]="robot",t[t.g2=12]="g2",t[t.custom=100]="custom"}(zp||(zp={}));var Vp=Wp({unset:"-2",restricted:"-1",common:"0",owner:"1",manager:"2",guest:"3",anonymous:"4"});function formatChatroomMember(t){var a,u=Ot({},t),h=["chatroomId"],m=["level","enterTime","updateTime","tempMuteDuration"],g=["online","guest","blacked","muted","valid","tempMuted"],b={tempMuted:!1,tempMuteDuration:0};return forEach$1(a=$a(b)).call(a,(function(t){u[t]=u[t]||b[t]})),forEach$1(h).call(h,(function(t){void 0!==u[t]&&(u[t]=u[t].toString())})),forEach$1(m).call(m,(function(t){void 0!==u[t]&&(u[t]=ms(u[t]))})),forEach$1(g).call(g,(function(t){void 0!==u[t]&&(u[t]=1===ms(u[t]))})),void 0!==u.type&&(u.type=Vp[u.type]),u.avatar,u.online||delete u.enterTime,u.guest&&(u.type="guest",delete u.valid,delete u.guest),"common"!==u.type&&delete u.level,u}function formatChatroomMembers(t){return t&&t.length>0?map$6(t).call(t,(function(t){return formatChatroomMember(t)})):[]}function generatorMsgForCmd(t,a,u){t.onSendBefore;var h=__rest(t,["onSendBefore"]),m=["subType"],g=["body","antiSpamContent","antiSpamBusinessId","ext"],b=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];return t.resend||(h.idClient=Ru()),h.type=zp[t.type],h.from=a,h.fromClientType=16,h.fromDeviceId=u,h.status=h.status||"sending",forEach$1(b).call(b,(function(a){void 0!==t[a]&&(h[a]=t[a]?1:0)})),forEach$1(m).call(m,(function(a){void 0!==t[a]&&(h[a]=ms(t[a]))})),forEach$1(g).call(g,(function(a){void 0!==t[a]&&(h[a]="string"==typeof t[a]?t[a]:Hu(t[a]))})),h}var Qp={301:"memberEnter",302:"memberExit",303:"blackMember",304:"unblackMember",305:"gagMember",306:"ungagMember",307:"addManager",308:"removeManager",309:"addCommon",310:"removeCommon",311:"closeChatroom",312:"updateChatroom",313:"kickMember",314:"addTempMute",315:"removeTempMute",316:"updateMemberInfo",317:"updateQueue",318:"muteRoom",319:"unmuteRoom",320:"batchUpdateQueue",321:"addTempMuteTag",322:"removeTempMuteTag",323:"deleteChatroomMsg",325:"updateChatroomTags"};function formatChatroomMsg(t,a){t.onUploadDone,t.onUploadProgress,t.onUploadStart;var u=__rest(t,["onUploadDone","onUploadProgress","onUploadStart"]),h=["time","userUpdateTime"],m=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];if(forEach$1(h).call(h,(function(t){void 0!==u[t]&&(u[t]=ms(u[t]))})),forEach$1(m).call(m,(function(t){void 0!==u[t]&&(u[t]=1===ms(u[t]))})),u.type=getEnumKeyByEnumValue(zp,u.type),u.fromClientType=getEnumKeyByEnumValue(Hp,u.fromClientType),u.flow=u.from===a?"out":"in",u.status=u.status||"success","string"==typeof u.body)try{u.body=JSON.parse(u.body)}catch(t){}return"notification"===u.type&&(u.attach=u.body?function formatNotificationBody(t){var a,u={};if(u.type=Qp[t.id]||t.id,!t.data)return t;u=Ot(u,t.data);var h={operator:"from",opeNick:"fromNick",target:"to",tarNick:"toNick"};forEach$1(a=$a(h)).call(a,(function(t){void 0!==u[t]&&(u[h[t]]=u[t],delete u[t])}));var m=["muteDuration"];if(forEach$1(m).call(m,(function(t){void 0!==u[t]&&(u[t]=ms(u[t]))})),!u.queueChange)return u;var g={};try{g=JSON.parse(u.queueChange)}catch(t){return u}switch(g._e){case"OFFER":g={type:"OFFER",elementKey:g.key,elementValue:g.content};break;case"POLL":g={type:"POLL",elementKey:g.key,elementValue:g.content};break;case"DROP":g={type:"DROP"};break;case"PARTCLEAR":case"BATCH_UPDATE":g={type:g._e,elementKv:g.kvObject}}return u.queueChange=g,u}(u.body):{},u.body=""),u}function formatChatroomMsgs(t,a){return t&&t.length>0?map$6(t).call(t,(function(t){return formatChatroomMsg(t,a)})):[]}var Jp={1:{code:"chatroomClosed",message:"Chatroom is closed"},2:{code:"managerKick",message:"Kicked out by owners or administrators"},3:{code:"samePlatformKick",message:"The same account is not allowed to multiple login at the same time"},4:{code:"silentlyKick",message:"Quietly kicked"},5:{code:"blacked",message:"Was blacklisted"}};var Yp=function(){function V1AuthAuthenticatorService(t){this.core=t}return V1AuthAuthenticatorService.prototype.verifyAuthentication=function verifyAuthentication(t){var a,u;return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,rf.mark((function _callee(){var h,m,g,b,w,x,k,S;return rf.wrap((function _callee$(_){for(;;)switch(_.prev=_.next){case 0:return m=this.core.options,g=zf.getSystemInfo(),b=Ot(Ot({},m),{appLogin:t?0:1,deviceId:this.core.config.deviceId,clientType:16,protocolVersion:1,sdkVersion:91600,sdkHumanVersion:"0.19.0",os:g.os,browser:g.browser,session:null===(a=this.core.clientSocket.socket)||void 0===a?void 0:a.sessionId,userAgent:this.core.options.loginSDKTypeParamCompat?"Native/0.19.0":slice(h=g.userAgent).call(h,0,299),libEnv:this.core.options.loginSDKTypeParamCompat?void 0:g.libEnv,hostEnv:this.core.options.loginSDKTypeParamCompat?0:g.hostEnvEnum}),w=Ot(Ot({},m),{appkey:m.appkey,account:m.account,deviceId:this.core.config.deviceId,session:null===(u=this.core.clientSocket.socket)||void 0===u?void 0:u.sessionId,appLogin:1}),m.isAnonymous&&(w.isAnonymous=1,w.account=w.account||"nimanon_"+Ru(),b.account=w.account,w.chatroomNick=w.account||"nimanon_"+Ru(),w.chatroomAvatar=w.chatroomAvatar||" "),m.tags&&m.tags.length>0&&(w.tags=Hu(m.tags)),_.next=8,this.core.clientSocket.sendCmd("chatroomLogin",{type:1,chatroomLogin:w,chatroomIMLogin:b});case 8:return x=_.sent,this.core.status="logined",k=formatChatroom(x.content.chatroom),S=formatChatroomMember(x.content.chatroomMember),_.abrupt("return",{chatroom:k,member:S});case 13:case"end":return _.stop()}}),_callee,this)})))},V1AuthAuthenticatorService}(),Xp=function(t){function ChatroomAuthService(a){var u;return(u=t.call(this,"chatroomAuth",a)||this).account="",u.token="",u.deviceId="",u.isManualLoginAttempt=!1,u.authenticatorService=new Yp(a),u}_t(ChatroomAuthService,t);var a=ChatroomAuthService.prototype;return a.login=function login(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,rf.mark((function _callee(){var a,u;return rf.wrap((function _callee$(h){for(;;)switch(h.prev=h.next){case 0:return t.isAutoReconnect||(this.isManualLoginAttempt=!0),a=Zo(),h.next=4,this._connect(t);case 4:return u=h.sent,this.core.abtest.abtRequest(),h.prev=6,h.next=9,this.doLogin(t.isAutoReconnect,u,a);case 9:this.isManualLoginAttempt=!1,h.next=16;break;case 12:throw h.prev=12,h.t0=h.catch(6),this.isManualLoginAttempt=!1,h.t0;case 16:case"end":return h.stop()}}),_callee,this,[[6,12]])})))},a._connect=function _connect(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,rf.mark((function _callee2(){var a,u,h;return rf.wrap((function _callee2$(m){for(;;)switch(m.prev=m.next){case 0:if(/^(unconnected|waitReconnect)$/.test(this.core.status)){m.next=4;break}return a="Chatroom status is "+this.core.status+", and would not connect",this.logger.warn(a),m.abrupt("return",Jo.reject(a));case 4:return this.core.clientSocket.beforeConnect(),u=t.isAutoReconnect||!1,m.next=8,this.core.clientSocket.connect({linkUrls:this.core.options.chatroomAddresses,isAutoReconnect:u});case 8:return h=m.sent,m.abrupt("return",h);case 10:case"end":return m.stop()}}),_callee2,this)})))},a.doLogin=function doLogin(t,a,u){return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,rf.mark((function _callee3(){var h,m,g;return rf.wrap((function _callee3$(b){for(;;)switch(b.prev=b.next){case 0:return b.prev=0,b.next=3,this.authenticatorService.verifyAuthentication(t);case 3:h=b.sent,this.core.status="logined",this.core.reporter.report("chatroomLogin",{accid:this.core.account,roomId:this.core.options.chatroomId,serverIps:this.core.options.chatroomAddresses,currentServerIp:a,rt:Zo()-u,result:200,failReason:"",time:Zo()}),b.next=18;break;case 8:if(b.prev=8,b.t0=b.catch(0),this.logger.error("chatroom login error",b.t0),m=Mp(b.t0,"error.code")||Mp(b.t0,"code")||408,g=Mp(b.t0,"error.message")||Mp(b.t0,"message")||"login failed",this.core.reporter.report("chatroomLogin",{accid:this.core.account,roomId:this.core.options.chatroomId,serverIps:this.core.options.chatroomAddresses,currentServerIp:a,rt:Zo()-u,result:m,failReason:g,time:Zo()}),this.core.clientSocket.doDisconnect(Rp.OFFLINE,this.isManualLoginAttempt?"FailedToInitializeLogin":"ReconnectLoginFailed"),!this.isManualLoginAttempt){b.next=17;break}throw b.t0;case 17:return b.abrupt("return");case 18:return b.prev=18,b.next=21,this.core.cloudStorage.init();case 21:b.next=26;break;case 23:b.prev=23,b.t1=b.catch(18),this.logger.error("NIM:login cloudStorage init failed ",b.t1);case 26:this.core.eventBus.emit("logined",h),this.core.emit("logined",h),this.core.clientSocket.resetConnectStatus(),this.core.clientSocket.ping();case 30:case"end":return b.stop()}}),_callee3,this,[[0,8],[18,23]])})))},a.beKickedFromChatroomHandler=function beKickedFromChatroomHandler(t){var a=t.content,u=a.reason,h=a.ext,m=function formatKickedReason(t){var a=Jp[t];return{reason:a?a.code:"unknow",message:a?a.message:"Unknown reason"}}(u);this.logger.warn("beKickedFromChatroomHandler:: ",m.reason,m.message,h),this.core.clientSocket.doDisconnect(Rp.KICKED,m)},ChatroomAuthService}(up),Zp=function(t){function ChatroomService(a){return t.call(this,"chatroom",a)||this}_t(ChatroomService,t);var a=ChatroomService.prototype;return a.getInfo=function getInfo(){var t;return __awaiter(this,void 0,void 0,rf.mark((function _callee(){var a;return rf.wrap((function _callee$(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.core.sendCmd("getChatroom");case 2:return a=u.sent,u.abrupt("return",formatChatroom(null===(t=a.content)||void 0===t?void 0:t.chatroom));case 4:case"end":return u.stop()}}),_callee,this)})))},a.updateInfo=function updateInfo(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee2(){return rf.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({chatroom:{type:"object",rules:{name:{type:"string",required:!1},announcement:{type:"string",required:!1},broadcastUrl:{type:"string",required:!1},ext:{type:"string",required:!1},queuelevel:{type:"number",min:0,max:1,required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("updateChatroom",Ot(Ot({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee2,this)})))},a.updateChatroomTagHandler=function updateChatroomTagHandler(t){var a,u=t.content;this.logger.log("updateChatroomTagHandler:: ",u);var h=null===(a=null==u?void 0:u.updateTags)||void 0===a?void 0:a.currentTags;try{h=JSON.parse(h)}catch(t){this.logger.error("updateChatroomTagHandler:: ",t)}this.core.emit("tagsUpdate",h)},ChatroomService}(up),ed=ss.trim,td=M("".charAt),rd=m.parseFloat,nd=m.Symbol,od=nd&&nd.iterator,id=1/rd(rs+"-0")!=-1/0||od&&!fails((function(){rd(Object(od))}))?function parseFloat(t){var a=ed(toString$1(t)),u=rd(a);return 0===u&&"-"==td(a,0)?-0:u}:rd;_export({global:!0,forced:parseFloat!=id},{parseFloat:id});var ad=H.parseFloat;var sd=function arraySome(t,a){for(var u=-1,h=null==t?0:t.length;++u<h;)if(a(t[u],u,t))return!0;return!1};var cd=function equalArrays(t,a,u,h,m,g){var b=1&u,w=t.length,x=a.length;if(w!=x&&!(b&&x>w))return!1;var k=g.get(t),S=g.get(a);if(k&&S)return k==a&&S==t;var _=-1,C=!0,T=2&u?new Pl:void 0;for(g.set(t,a),g.set(a,t);++_<w;){var M=t[_],E=a[_];if(h)var P=b?h(E,M,_,a,t,g):h(M,E,_,t,a,g);if(void 0!==P){if(P)continue;C=!1;break}if(T){if(!sd(a,(function(t,a){if(!Nl(T,a)&&(M===t||m(M,t,u,h,g)))return T.push(a)}))){C=!1;break}}else if(M!==E&&!m(M,E,u,h,g)){C=!1;break}}return g.delete(t),g.delete(a),C};var ud=function mapToArray(t){var a=-1,u=Array(t.size);return t.forEach((function(t,h){u[++a]=[h,t]})),u},ld=pc?pc.prototype:void 0,fd=ld?ld.valueOf:void 0;var pd=function equalByTag(t,a,u,h,m,g,b){switch(u){case"[object DataView]":if(t.byteLength!=a.byteLength||t.byteOffset!=a.byteOffset)return!1;t=t.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=a.byteLength||!g(new hf(t),new hf(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Bc(+t,+a);case"[object Error]":return t.name==a.name&&t.message==a.message;case"[object RegExp]":case"[object String]":return t==a+"";case"[object Map]":var w=ud;case"[object Set]":var x=1&h;if(w||(w=Op),t.size!=a.size&&!x)return!1;var k=b.get(t);if(k)return k==a;h|=2,b.set(t,a);var S=cd(w(t),w(a),h,m,g,b);return b.delete(t),S;case"[object Symbol]":if(fd)return fd.call(t)==fd.call(a)}return!1};var dd=function arrayPush(t,a){for(var u=-1,h=a.length,m=t.length;++u<h;)t[m+u]=a[u];return t};var hd=function baseGetAllKeys(t,a,u){var h=a(t);return hu(t)?h:dd(h,u(t))};var md=function arrayFilter(t,a){for(var u=-1,h=null==t?0:t.length,m=0,g=[];++u<h;){var b=t[u];a(b,u,t)&&(g[m++]=b)}return g};var gd=function stubArray(){return[]},vd=Object.prototype.propertyIsEnumerable,yd=Object.getOwnPropertySymbols,bd=yd?function(t){return null==t?[]:(t=Object(t),md(yd(t),(function(a){return vd.call(t,a)})))}:gd,wd=bd;var xd=function getAllKeys(t){return hd(t,Iu,wd)},kd=Object.prototype.hasOwnProperty;var Sd=function equalObjects(t,a,u,h,m,g){var b=1&u,w=xd(t),x=w.length;if(x!=xd(a).length&&!b)return!1;for(var k=x;k--;){var S=w[k];if(!(b?S in a:kd.call(a,S)))return!1}var _=g.get(t),C=g.get(a);if(_&&C)return _==a&&C==t;var T=!0;g.set(t,a),g.set(a,t);for(var M=b;++k<x;){var E=t[S=w[k]],P=a[S];if(h)var O=b?h(P,E,S,a,t,g):h(E,P,S,t,a,g);if(!(void 0===O?E===P||m(E,P,u,h,g):O)){T=!1;break}M||(M="constructor"==S)}if(T&&!M){var I=t.constructor,A=a.constructor;I==A||!("constructor"in t)||!("constructor"in a)||"function"==typeof I&&I instanceof I&&"function"==typeof A&&A instanceof A||(T=!1)}return g.delete(t),g.delete(a),T},_d=Nc(fc,"DataView"),Cd=Nc(fc,"Promise"),Td=Nc(fc,"WeakMap"),Md="[object Map]",Ed="[object Promise]",Pd="[object Set]",Od="[object WeakMap]",Id="[object DataView]",Ad=Ec(_d),jd=Ec(yl),Rd=Ec(Cd),Ld=Ec(Ep),Fd=Ec(Td),Nd=xc;(_d&&Nd(new _d(new ArrayBuffer(1)))!=Id||yl&&Nd(new yl)!=Md||Cd&&Nd(Cd.resolve())!=Ed||Ep&&Nd(new Ep)!=Pd||Td&&Nd(new Td)!=Od)&&(Nd=function(t){var a=xc(t),u="[object Object]"==a?t.constructor:void 0,h=u?Ec(u):"";if(h)switch(h){case Ad:return Id;case jd:return Md;case Rd:return Ed;case Ld:return Pd;case Fd:return Od}return a});var Ud=Nd,Dd="[object Arguments]",Bd="[object Array]",qd="[object Object]",Gd=Object.prototype.hasOwnProperty;var Hd=function baseIsEqualDeep(t,a,u,h,m,g){var b=hu(t),w=hu(a),x=b?Bd:Ud(t),k=w?Bd:Ud(a),S=(x=x==Dd?qd:x)==qd,_=(k=k==Dd?qd:k)==qd,C=x==k;if(C&&gu(t)){if(!gu(a))return!1;b=!0,S=!1}if(C&&!S)return g||(g=new lf),b||ku(t)?cd(t,a,u,h,m,g):pd(t,a,x,u,h,m,g);if(!(1&u)){var T=S&&Gd.call(t,"__wrapped__"),M=_&&Gd.call(a,"__wrapped__");if(T||M){var E=T?t.value():t,P=M?a.value():a;return g||(g=new lf),m(E,P,u,h,g)}}return!!C&&(g||(g=new lf),Sd(t,a,u,h,m,g))};var zd=function baseIsEqual(t,a,u,h,m){return t===a||(null==t||null==a||!su(t)&&!su(a)?t!=t&&a!=a:Hd(t,a,u,h,baseIsEqual,m))};var Kd=function baseIsMatch(t,a,u,h){var m=u.length,g=m,b=!h;if(null==t)return!g;for(t=Object(t);m--;){var w=u[m];if(b&&w[2]?w[1]!==t[w[0]]:!(w[0]in t))return!1}for(;++m<g;){var x=(w=u[m])[0],k=t[x],S=w[1];if(b&&w[2]){if(void 0===k&&!(x in t))return!1}else{var _=new lf;if(h)var C=h(k,S,x,t,a,_);if(!(void 0===C?zd(S,k,3,h,_):C))return!1}}return!0};var $d=function isStrictComparable(t){return t==t&&!kc(t)};var Wd=function getMatchData(t){for(var a=Iu(t),u=a.length;u--;){var h=a[u],m=t[h];a[u]=[h,m,$d(m)]}return a};var Vd=function matchesStrictComparable(t,a){return function(u){return null!=u&&(u[t]===a&&(void 0!==a||t in Object(u)))}};var Qd=function baseMatches(t){var a=Wd(t);return 1==a.length&&a[0][2]?Vd(a[0][0],a[0][1]):function(u){return u===t||Kd(u,t,a)}};var Jd=function baseHasIn(t,a){return null!=t&&a in Object(t)};var Yd=function hasPath(t,a,u){for(var h=-1,m=(a=_p(a,t)).length,g=!1;++h<m;){var b=Cp(a[h]);if(!(g=null!=t&&u(t,b)))break;t=t[b]}return g||++h!=m?g:!!(m=null==t?0:t.length)&&eu(m)&&nu(b,m)&&(hu(t)||du(t))};var Xd=function hasIn(t,a){return null!=t&&Yd(t,a,Jd)};var Zd=function baseMatchesProperty(t,a){return hp(t)&&$d(a)?Vd(Cp(t),a):function(u){var h=Mp(u,t);return void 0===h&&h===a?Xd(u,t):zd(a,h,3)}};var eh=function baseProperty(t){return function(a){return null==a?void 0:a[t]}};var th=function basePropertyDeep(t){return function(a){return Tp(a,t)}};var rh=function property(t){return hp(t)?eh(Cp(t)):th(t)};var nh=function baseIteratee(t){return"function"==typeof t?t:null==t?zc:"object"==typeof t?hu(t)?Zd(t[0],t[1]):Qd(t):rh(t)};var oh=function baseSet(t,a,u,h){if(!kc(t))return t;for(var m=-1,g=(a=_p(a,t)).length,b=g-1,w=t;null!=w&&++m<g;){var x=Cp(a[m]),k=u;if("__proto__"===x||"constructor"===x||"prototype"===x)return t;if(m!=b){var S=w[x];void 0===(k=h?h(S,x,w):void 0)&&(k=kc(S)?S:nu(a[m+1])?[]:{})}Gc(w,x,k),w=w[x]}return t};var ih=function basePickBy(t,a,u){for(var h=-1,m=a.length,g={};++h<m;){var b=a[h],w=Tp(t,b);u(w,b)&&oh(g,_p(b,t),w)}return g},ah=Object.getOwnPropertySymbols?function(t){for(var a=[];t;)dd(a,wd(t)),t=wf(t);return a}:gd;var sh=function getAllKeysIn(t){return hd(t,Af,ah)};var ch,uh,lh=function pickBy(t,a){if(null==t)return{};var u=Fl(sh(t),(function(t){return[t]}));return a=nh(a),ih(t,u,(function(t,u){return a(t,u[0])}))},fh={"6_2":"getNosToken","6_22":"getOriginUrl","6_26":"getNosCdnHost","6_27":"getGrayscaleConfig","6_28":"getMixStorePolicy","6_29":"getMixStoreToken","6_30":"getFileAuthToken"},ph={nosToken:{objectName:1,token:2,bucket:3,expireTime:4,expireSec:7,tag:8,shortUrl:9},mixStoreTokenReqTag:{provider:0,tokenCount:1,fileExpireSec:2,tag:3,returnBody:4},nosConfigTag:{bucket:1,cdnDomain:2,expire:3,objectNamePrefix:4},grayConfigTag:{config:0,ttl:1},mixStorePolicyTag:{providers:0,ttl:1,mixEnable:2,nosPolicy:3,s3Policy:4},mixStoreTokenResTag:{provider:0,accessKeyId:1,secretAccessKey:2,sessionToken:3,token:4,expireTime:5,bucket:6,objectName:7,fileExpireSec:8,tag:9,shortUrl:10,region:11},nosSafeUrlTag:{safeUrl:0,originUrl:1},mixStoreAuthTokenReqTag:{type:1,urls:2},mixStoreAuthTokenResTag:{type:1,tokens:2,token:3,ttl:4}},dh=invertSerializeMap(ph),hh={getNosToken:{sid:6,cid:2,service:"cloudStorage",response:[{type:"Property",name:"nosToken",reflectMapper:dh.nosToken}],params:[{type:"String",name:"responseBody"},{type:"Property",name:"nosToken",entity:"nosToken",reflectMapper:ph.nosToken}]},getOriginUrl:{sid:6,cid:22,service:"cloudStorage",response:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:dh.nosSafeUrlTag}],params:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:ph.nosSafeUrlTag}]},getNosCdnHost:{sid:6,cid:26,service:"misc",response:[{type:"Property",name:"nosConfigTag",reflectMapper:dh.nosConfigTag}]},getGrayscaleConfig:{sid:6,cid:27,service:"cloudStorage",response:[{type:"Property",name:"grayConfigTag",reflectMapper:dh.grayConfigTag}],params:[{type:"Property",name:"config"}]},getMixStorePolicy:{sid:6,cid:28,service:"cloudStorage",params:[{type:"LongArray",name:"supportType"}],response:[{type:"Property",name:"mixStorePolicyTag",reflectMapper:dh.mixStorePolicyTag}]},getMixStoreToken:{sid:6,cid:29,service:"cloudStorage",params:[{type:"Property",name:"mixStoreTokenReqTag",reflectMapper:ph.mixStoreTokenReqTag}],response:[{type:"Property",name:"mixStoreTokenResTag",reflectMapper:dh.mixStoreTokenResTag}]},getFileAuthToken:{sid:6,cid:30,service:"cloudStorage",params:[{type:"Property",name:"mixStoreAuthTokenReqTag",reflectMapper:ph.mixStoreAuthTokenReqTag}],response:[{type:"Property",name:"mixStoreAuthTokenResTag",reflectMapper:dh.mixStoreAuthTokenResTag}]}},mh={file:{md5:"$(Etag)",size:"$(ObjectSize)"},image:{md5:"$(Etag)",size:"$(ObjectSize)",w:"$(ImageInfo.Width)",h:"$(ImageInfo.Height)",orientation:"$(ImageInfo.Orientation)"},audio:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Audio.Duration)"},video:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Video.Duration)",w:"$(AVinfo.Video.Width)",h:"$(AVinfo.Video.Height)"}},gh={accessKeyId:"",secretAccessKey:"",sessionToken:"",region:"",maxRetries:0,bucket:"",objectName:"",token:"",shortUrl:""};!function(t){t[t.nos=1]="nos",t[t.s3=2]="s3"}(ch||(ch={})),function(t){t[t.dontNeed=-1]="dontNeed",t[t.time=2]="time",t[t.urls=3]="urls"}(uh||(uh={}));var vh={chunkUploadHost:"https://wannos-web.127.net",chunkUploadHostBackupList:["https://fileup.chatnos.com","https://oss.chatnos.com"],commonUploadHost:"https://fileup.chatnos.com",commonUploadHostBackupList:["https://oss.chatnos.com"],chunkMaxSize:4194304e4,commonMaxSize:104857600,uploadReplaceFormat:"https://{host}/{object}",cdn:{defaultCdnDomain:"nim.nosdn.127.net",cdnDomain:"",bucket:"",objectNamePrefix:""},downloadUrl:"https://{bucket}-nosdn.netease.im/{object}",downloadHostList:["nos.netease.com"],nosCdnEnable:!0,isNeedToGetUploadPolicyFromServer:!0};function _createForOfIteratorHelperLoose(t,a){var u,h=void 0!==ha&&sp(t)||t["@@iterator"];if(h)return bind$1(u=(h=h.call(t)).next).call(u,h);if(Wu(t)||(h=function _unsupportedIterableToArray(t,a){var u;if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,a);var h=slice(u=Object.prototype.toString.call(t)).call(u,8,-1);"Object"===h&&t.constructor&&(h=t.constructor.name);if("Map"===h||"Set"===h)return ap(t);if("Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return _arrayLikeToArray(t,a)}(t))||a&&t&&"number"==typeof t.length){h&&(t=h);var m=0;return function(){return m>=t.length?{done:!0}:{done:!1,value:t[m++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray(t,a){(null==a||a>t.length)&&(a=t.length);for(var u=0,h=new Array(a);u<a;u++)h[u]=t[u];return h}function getUploadResponseFormat(t){return void 0===t&&(t="file"),Hu(mh[t]||{}).replace(/"/gi,'\\"')}var yh,bh=function(){function CloudStorageService(t,a){void 0===a&&(a={}),this.GRAYKEY="AllGrayscaleConfig",this.MIXSTOREKEY="AllMixStorePolicy",this.config={},this.nosCdnHostTimer=0,this.grayConfig={mixStoreEnable:!1,timeStamp:0,ttl:0},this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=ch.nos,this.s3=null,this.mixStoreErrorCount=10,this.nosErrorCount=0,this.circuitTimer=0,this.ongoingTask=new zs,this.name="cloudStorage",this.logger=t.logger,this.core=t,registerParser({cmdMap:fh,cmdConfig:hh}),this.setOptions(a)}var t=CloudStorageService.prototype;return t.setOptions=function setOptions(t){void 0===t&&(t={});var a=t.storageKeyPrefix||"NIMClient";this.GRAYKEY=a+"-AllGrayscaleConfig",this.MIXSTOREKEY=a+"-AllMixStorePolicy";var u=t.s3,h=__rest(t,["s3"]),m=Ot({},vh,this.config);if(h&&Object.prototype.hasOwnProperty.call(h,"cdn")){var g={cdn:Ot(Ot({},m.cdn),h.cdn)};this.config=Ot({},m,h,g)}else this.config=Ot({},m,h);u&&(this.s3=u)},t.init=function init(){return __awaiter(this,void 0,void 0,rf.mark((function _callee(){return rf.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(this.grayConfig=null,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=ch.nos,this.mixStoreErrorCount=10,!this.config.isNeedToGetUploadPolicyFromServer){t.next=9;break}return t.next=7,this.getGrayscaleConfig(this.core.options.appkey);case 7:return t.next=9,this.getNosCdnHost();case 9:case"end":return t.stop()}}),_callee,this)})))},t.abortUploadTask=function abortUploadTask(){for(var t,a=_createForOfIteratorHelperLoose(values(u=this.ongoingTask).call(u));!(t=a()).done;){var u,h=t.value;h&&"function"==typeof h.abort&&h.abort()}this.ongoingTask.clear()},t.processCallback=function processCallback(t){var a=this,u=t.onUploadProgress,h=t.onUploadDone,m=t.onUploadStart,g=Ru();return{onUploadStart:"function"==typeof m?function(t){try{a.ongoingTask.set(g,t),m(t)}catch(t){a.logger.error("CloudStorage::uploadFile:options.onUploadStart execute error",t)}}:function(){},onUploadProgress:"function"==typeof u?function(t){try{u(t)}catch(t){a.logger.error("CloudStorage::uploadFile:options.onUploadProgress execute error",t)}}:function(){},onUploadDone:"function"==typeof h?function(t){try{a.ongoingTask.delete(g),h(t)}catch(t){a.logger.error("CloudStorage::uploadFile:options.onUploadDone execute error",t)}}:function(){}}},t.uploadFile=function uploadFile(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee2(){var a,u,h,m,g,b;return rf.wrap((function _callee2$(w){for(;;)switch(w.prev=w.next){case 0:if(validate({maxSize:{type:"number",required:!1},type:{type:"enum",values:["file","image","audio","video"]}},t),t.fileInput||t.file||t.filePath){w.next=3;break}throw new Error("uploadFile needs target file object or a filePath");case 3:if(!t.type||"file"===t.type){w.next=7;break}if("string"!=typeof(a=Mp(t,"file.type"))||-1!==indexOf(a).call(a,t.type)){w.next=7;break}throw new Error('The meta type "'+a+'" does not match "'+t.type+'"');case 7:return u=this.processCallback(t),h=u.onUploadStart,m=u.onUploadProgress,g=u.onUploadDone,t.onUploadStart=h,t.onUploadProgress=m,t.onUploadDone=g,w.next=13,this._uploadFile(t);case 13:return(b=w.sent).url=decodeURIComponent(b.url),t.onUploadDone({size:b.size,name:b.name,url:b.url,ext:b.name.split(".")[1]||"unknown"}),w.abrupt("return",b);case 17:case"end":return w.stop()}}),_callee2,this)})))},t._uploadFile=function _uploadFile(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee3(){var a,u;return rf.wrap((function _callee3$(h){for(;;)switch(h.prev=h.next){case 0:if(this.grayConfig&&this.grayConfig.mixStoreEnable&&this.mixStorePolicy.providers.length){h.next=3;break}return this.logger.log("uploadFile:: uploadFile begin, use old nos"),h.abrupt("return",this.nosUpload(t));case 3:return this.logger.log("uploadFile:: uploadFile begin,Current settings grayConfig mixStoreEnable:"+this.grayConfig.mixStoreEnable+" curProvider:"+this.curProvider),this.s3||(this.curProvider=ch.nos),a=gh,h.prev=6,h.next=9,this.core.sendCmd("getMixStoreToken",{mixStoreTokenReqTag:{provider:this.curProvider,tokenCount:1,tag:"qchat",returnBody:getUploadResponseFormat(t.type)}});case 9:u=h.sent,a=u.content.mixStoreTokenResTag,h.next=17;break;case 13:throw h.prev=13,h.t0=h.catch(6),this.core.logger.error("uploadFile:: getMixStoreToken error",h.t0),new cc("getMixStoreToken error",h.t0,this.curProvider,this.mixStorePolicy);case 17:return h.abrupt("return",this.curProvider===ch.s3?this.s3Upload(t,a):this.nosUpload(t,a));case 18:case"end":return h.stop()}}),_callee3,this,[[6,13]])})))},t.nosUpload=function nosUpload(t,a){var u,h;return __awaiter(this,void 0,void 0,rf.mark((function _callee4(){var m,g,b,w,x,k,S,_,C,T,M,E,P,O,I;return rf.wrap((function _callee4$(A){for(;;)switch(A.prev=A.next){case 0:if(m=Mp(this.core,"config.cdn.bucket"),g={tag:t.nosScenes||m||"nim",expireSec:t.nosSurvivalTime},a){A.next=13;break}return A.prev=3,A.next=6,this.core.sendCmd("getNosToken",{responseBody:getUploadResponseFormat(t.type),nosToken:g});case 6:b=A.sent,A.next=13;break;case 9:throw A.prev=9,A.t0=A.catch(3),this.core.logger.error("uploadFile:: getNosToken error",A.t0),new cc("getNosToken error",A.t0,1);case 13:return w=this.config.uploadReplaceFormat.replace("{host}",this.config.cdn.cdnDomain||this.config.cdn.defaultCdnDomain).replace("{object}",b?b.content.nosToken.objectName:null==a?void 0:a.objectName),x="",a&&a.shortUrl&&(x=a.shortUrl),k=x||w,A.prev=17,_=b?b.content.nosToken:a,this.core.logger.debug("uploadFile:: uploadFile params",{nosToken:_,chunkUploadHost:this.config.chunkUploadHost,chunkUploadHostBackupList:this.config.chunkUploadHostBackupList,commonUploadHost:this.config.commonUploadHost,commonUploadHostBackupList:this.config.commonUploadHostBackupList,platform:zf.platform}),A.next=22,this.core.adapters.uploadFile(Ot(Ot({},t),{nosToken:_,chunkUploadHost:this.config.chunkUploadHost,chunkUploadHostBackupList:this.config.chunkUploadHostBackupList,commonUploadHost:this.config.commonUploadHost,commonUploadHostBackupList:this.config.commonUploadHostBackupList,maxSize:t.maxSize||this.config.chunkMaxSize}));case 22:S=A.sent,A.next=48;break;case 25:if(A.prev=25,A.t1=A.catch(17),this.core.logger.error("uploadFile::nos uploadFile error",A.t1),10499!==Mp(A.t1,"errCode")){A.next=30;break}throw new cc(Mp(A.t1,"message")||"Request abort",A.t1,1);case 30:if(!a){A.next=47;break}if(!(this.nosErrorCount<=0)){A.next=43;break}A.prev=32,this._addCircuitTimer(),A.next=39;break;case 36:throw A.prev=36,A.t2=A.catch(32),new cc("upload file error",A.t2,this.curProvider,this.mixStorePolicy,t.file||t.filePath);case 39:return this.nosErrorCount=null===(u=this.mixStorePolicy.nosPolicy)||void 0===u?void 0:u.uploadConfig.retryPolicy.retry,A.abrupt("return",this._uploadFile(t));case 43:return this.nosErrorCount--,A.abrupt("return",this.nosUpload(t,a));case 45:A.next=48;break;case 47:throw new cc("nos uploadFile error",A.t1,1);case 48:if(C=null==S?void 0:S.type,T=C&&indexOf(C).call(C,"/")>-1?slice(C).call(C,0,indexOf(C).call(C,"/")):"",(M={image:"imageInfo",video:"vinfo",audio:"vinfo"})[T]){A.next=53;break}return A.abrupt("return",Ot({url:k},S));case 53:return A.prev=53,A.next=56,this.core.adapters.request(w+"?"+M[T],{method:"GET",dataType:"json",timeout:5e3},{exception_service:3});case 56:E=A.sent,A.next=63;break;case 59:return A.prev=59,A.t3=A.catch(53),this.core.logger.error("uploadFile:: fetch file info error",A.t3),A.abrupt("return",Ot({url:k},S));case 63:if(!E){A.next=70;break}return P=E.data,O="imageInfo"===M[T]?P:null===(h=null==P?void 0:P.GetVideoInfo)||void 0===h?void 0:h.VideoInfo,I={url:k,name:S.name,size:S.size,ext:S.ext,w:O.Width,h:O.Height,orientation:O.Orientation,dur:O.Duration,audioCodec:O.AudioCodec,videoCodec:O.VideoCodec,container:O.Container},A.abrupt("return",lh(I,(function(t,a){return void 0!==a})));case 70:return A.abrupt("return",Ot({url:k},S));case 71:case"end":return A.stop()}}),_callee4,this,[[3,9],[17,25],[32,36],[53,59]])})))},t.getNosCdnHost=function getNosCdnHost(){var t;return __awaiter(this,void 0,void 0,rf.mark((function _callee5(){var a,u,h,m=this;return rf.wrap((function _callee5$(g){for(;;)switch(g.prev=g.next){case 0:return g.prev=0,g.next=3,this.core.sendCmd("getNosCdnHost");case 3:a=g.sent,g.next=10;break;case 6:return g.prev=6,g.t0=g.catch(0),this.logger.error("getNosCdnHost::error",g.t0),g.abrupt("return");case 10:if(a){g.next=12;break}return g.abrupt("return");case 12:u=null===(t=null==a?void 0:a.content)||void 0===t?void 0:t.nosConfigTag,0!==(h=ms(null==u?void 0:u.expire))&&u.cdnDomain?-1===h?(this.config.cdn.bucket=u.bucket,this.config.cdn.cdnDomain=u.cdnDomain,this.config.cdn.objectNamePrefix=u.objectNamePrefix):(this.config.cdn.bucket=u.bucket,this.config.cdn.cdnDomain=u.cdnDomain,this.config.cdn.objectNamePrefix=u.objectNamePrefix,this.nosCdnHostTimer=this.core.timerManager.addTimer((function(){m.getNosCdnHost()}),1e3*h)):(this.config.cdn.bucket="",this.config.cdn.cdnDomain="",this.config.cdn.objectNamePrefix="");case 15:case"end":return g.stop()}}),_callee5,this,[[0,6]])})))},t.getGrayscaleConfig=function getGrayscaleConfig(t){var a;return __awaiter(this,void 0,void 0,rf.mark((function _callee6(){var u,h;return rf.wrap((function _callee6$(m){for(;;)switch(m.prev=m.next){case 0:if(zf.localStorage)try{zf.localStorage.getItem&&zf.localStorage.getItem(this.GRAYKEY)&&(this.grayConfig=JSON.parse(zf.localStorage.getItem(this.GRAYKEY))[t])}catch(t){zf.localStorage.getItem(this.GRAYKEY)&&this.core.logger.error("uploadFile:: JSON.parse grayscaleConfig error ",t)}if(this.grayConfig&&!(this.grayConfig.timeStamp+1e3*this.grayConfig.ttl<(new Date).getTime())){m.next=17;break}return m.next=4,this.core.sendCmd("getGrayscaleConfig",{config:{}});case 4:if(!(u=m.sent).content||!u.content.grayConfigTag){m.next=16;break}this.logger.log("uploadFile::getAppGrayConfigRequest success ");try{this.grayConfig=JSON.parse(u.content.grayConfigTag.config),this.grayConfig.ttl=JSON.parse(u.content.grayConfigTag.ttl)}catch(t){this.logger.error("getGrayscaleConfig error",t)}if(this.grayConfig){m.next=10;break}return m.abrupt("return");case 10:h=zf.localStorage.getItem(this.GRAYKEY)?JSON.parse(zf.localStorage.getItem(this.GRAYKEY)):{},this.grayConfig.timeStamp=(new Date).getTime(),h[t]=this.grayConfig,zf.localStorage.setItem(this.GRAYKEY,Hu(h)),m.next=17;break;case 16:this.logger.debug("uploadFile:: result grayConfig:",u.content);case 17:if(!(null===(a=this.grayConfig)||void 0===a?void 0:a.mixStoreEnable)){m.next=20;break}return m.next=20,this._getMixStorePolicy(t);case 20:case"end":return m.stop()}}),_callee6,this)})))},t._getMixStorePolicy=function _getMixStorePolicy(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee7(){var a,u,h,m,g,b,w;return rf.wrap((function _callee7$(x){for(;;)switch(x.prev=x.next){case 0:if(a=(new Date).getTime(),zf.localStorage)try{this.mixStorePolicy=JSON.parse(zf.localStorage.getItem(this.MIXSTOREKEY))[t],this.curProvider=ms(this.mixStorePolicy.providers[0]),this.mixStorePolicy.timeStamp&&this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl>a&&(h=this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl-a,this.core.timerManager.addTimer(bind$1(u=this._getMixStorePolicy).call(u,this,t),h))}catch(a){zf.localStorage.getItem(this.MIXSTOREKEY)&&JSON.parse(zf.localStorage.getItem(this.MIXSTOREKEY))[t]&&this.core.logger.error("uploadFile:: JSON.parse mixStorePolicy error ",a)}if(this.mixStorePolicy&&!(this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl<=a)){x.next=30;break}return x.prev=3,x.next=6,this.core.sendCmd("getMixStorePolicy",{supportType:this.s3?[1,2]:[1]});case 6:g=x.sent,b=g.content.mixStorePolicyTag,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.mixStorePolicy.ttl=Number(b.ttl),this.mixStorePolicy.providers=b.providers.split(","),this.circuitTimer&&this.core.timerManager.deleteTimer(this.circuitTimer),this.curProvider=ms(this.mixStorePolicy.providers[0]),this.mixStorePolicy.nosPolicy=b.nosPolicy?JSON.parse(b.nosPolicy):null,this.mixStorePolicy.s3Policy=b.s3Policy?JSON.parse(b.s3Policy):null,null===this.mixStorePolicy.s3Policy?this.mixStorePolicy.providers=["1"]:null===this.mixStorePolicy.nosPolicy?this.mixStorePolicy.providers=["2"]:this.mixStorePolicy.providers=this.mixStorePolicy.s3Policy.priority<this.mixStorePolicy.nosPolicy.priority?["2","1"]:["1","2"],this.core.timerManager.addTimer(bind$1(m=this._getMixStorePolicy).call(m,this,t),1e3*this.mixStorePolicy.ttl),w=zf.localStorage.getItem(this.MIXSTOREKEY)?JSON.parse(zf.localStorage.getItem(this.MIXSTOREKEY)):{},this.mixStorePolicy.timeStamp=(new Date).getTime(),w[t]=this.mixStorePolicy,zf.localStorage.setItem(this.MIXSTOREKEY,Hu(w)),x.next=30;break;case 23:if(x.prev=23,x.t0=x.catch(3),this.logger.error("getMixStorePolicy error",x.t0),0!==this.mixStoreErrorCount){x.next=28;break}throw new Error("getMixStorePolicy all count error");case 28:this._getMixStorePolicy(t),this.mixStoreErrorCount--;case 30:this.mixStorePolicy.nosPolicy&&(this.nosErrorCount=this.mixStorePolicy.nosPolicy.uploadConfig.retryPolicy.retry);case 31:case"end":return x.stop()}}),_callee7,this,[[3,23]])})))},t.s3Upload=function s3Upload(t,a){return __awaiter(this,void 0,void 0,rf.mark((function _callee8(){var u,h,m,g,b,w,x,k,S,_,C=this;return rf.wrap((function _callee8$(T){for(;;)switch(T.prev=T.next){case 0:if(!t.file){T.next=4;break}u=t.file,T.next=19;break;case 4:if("string"!=typeof t.fileInput){T.next=14;break}if(this.logger.warn("fileInput will abandon,Please use file or filepath"),!((h=document.getElementById(t.fileInput))&&h.files&&h.files[0])){T.next=11;break}u=h.files[0],T.next=12;break;case 11:throw new Error("Can not get file from fileInput");case 12:T.next=19;break;case 14:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){T.next=18;break}u=t.fileInput.files[0],T.next=19;break;case 18:throw new Error("Can not get file from fileInput "+t.fileInput);case 19:if(this.mixStorePolicy.s3Policy){T.next=21;break}throw new Error("dont get s3 policy");case 21:return m={accessKeyId:a.accessKeyId,secretAccessKey:a.secretAccessKey,sessionToken:a.sessionToken,region:a.region,maxRetries:this.mixStorePolicy.s3Policy.uploadConfig.retryPolicy.retry},g=this.s3,(b=new g).config.update(m),w=decodeURIComponent(a.bucket),x=decodeURIComponent(a.objectName),S={Bucket:w,Key:x,Body:k=u,Metadata:{token:a.token},ContentType:k.type||"application/octet-stream"},this.core.logger.debug("uploadFile:: s3 upload params:",S),(_=b.upload(S)).on("httpUploadProgress",(function(a){var u=ad((a.loaded/a.total).toFixed(2));t.onUploadProgress&&t.onUploadProgress({total:a.total,loaded:a.loaded,percentage:u,percentageText:Math.round(100*u)+"%"})})),T.abrupt("return",new Jo((function(u,h){var m=(new Date).getTime();_.send((function(g,b){var S;if(g&&"RequestAbortedError"===g.code)C.logger.error("uploadFile:","api::s3:upload file abort",g),h(new oc(g.message,g,10499));else if(g){C.logger.error("uploadFile:","api::s3:upload file failed",g),C.core.reporter.reportTraceStart("exceptions",{user_id:C.core.options.account,trace_id:null===(S=C.core.clientSocket.socket)||void 0===S?void 0:S.sessionId,start_time:m,action:1,exception_service:4}),C.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof g.status?g.status:"number"==typeof g.code?g.code:0,description:g.message||""+g.code,operation_type:1,target:Hu({bucket:w,object:x})},{asyncParams:zf.net.getNetworkStatus()}),C.core.reporter.reportTraceEnd("exceptions",1);try{C._addCircuitTimer()}catch(g){h(new cc("upload file error",g,C.curProvider,C.mixStorePolicy,t.file||t.filePath))}u(C._uploadFile(t))}else{var _=C.mixStorePolicy.s3Policy.cdnSchema;_=(_=_.replace("{cdnDomain}",C.mixStorePolicy.s3Policy.dlcdn)).replace("{objectName}",b.Key),u({size:k.size,name:k.name,url:a.shortUrl?a.shortUrl:_,ext:k.name.split(".")[1]||"unknown"})}})),t.onUploadStart&&t.onUploadStart(_)})));case 33:case"end":return T.stop()}}),_callee8,this)})))},t.getPrivateUrl=function getPrivateUrl(t){var a;if(!new RegExp(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/).test(t))return this.logger.error("illegal file url:"+t),"";var u=/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(t);u[0];var h=u[1];u[2];var m=u[3];u[4];var g=u[5];if(u[6],u[7],null===(a=this.grayConfig)||void 0===a?void 0:a.mixStoreEnable){var b=this._getUrlType(t);return b===ch.s3&&this.mixStorePolicy.s3Policy&&(t=this.mixStorePolicy.s3Policy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.s3Policy.dlcdn).replace("{objectName}",g)),b===ch.nos&&this.mixStorePolicy.nosPolicy&&(t=this.mixStorePolicy.nosPolicy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.nosPolicy.dlcdn).replace("{objectName}",g)),t}var w=this.config,x=w.downloadUrl,k=w.downloadHostList,S=w.nosCdnEnable,_=this.config.cdn.cdnDomain,C=this.config.cdn.objectNamePrefix?decodeURIComponent(this.config.cdn.objectNamePrefix):"",T=decodeURIComponent(g),M=indexOf(T).call(T,C);if(_&&M>-1&&S)return""+h+_+"/"+slice(T).call(T,M);if(includes(k).call(k,m)&&includes(g).call(g,"/")){var E=indexOf(g).call(g,"/"),P=g.substring(0,E),O=g.substring(E+1);return x.replace("{bucket}",P).replace("{object}",O)}var I=filter(k).call(k,(function(t){return"string"==typeof m&&includes(m).call(m,t)}))[0],A=I?m.replace(I,"").replace(/\W/g,""):null;return A?x.replace("{bucket}",A).replace("{object}",g):t},t.getOriginUrl=function getOriginUrl(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee9(){var a;return rf.wrap((function _callee9$(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.core.sendCmd("getOriginUrl",{nosSafeUrlTag:{safeUrl:t}});case 2:return a=u.sent,u.abrupt("return",a.content.nosSafeUrlTag.originUrl);case 4:case"end":return u.stop()}}),_callee9,this)})))},t.getFileToken=function getFileToken(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee10(){var a,u,h,m,g,b=this;return rf.wrap((function _callee10$(w){for(;;)switch(w.prev=w.next){case 0:if(validate({type:{type:"number",min:2,max:3},urls:{type:"array",required:!1,itemType:"string"}},t),a=this.mixStorePolicy.nosPolicy?this.mixStorePolicy.nosPolicy.authPolicy.policyType:null,u=this.mixStorePolicy.s3Policy?this.mixStorePolicy.s3Policy.authPolicy.policyType:null,a!==String(uh.dontNeed)||u!==String(uh.dontNeed)){w.next=8;break}throw this.logger.error("don't need token"),new Error("don't need token");case 8:if(t.type!==uh.time){w.next=17;break}if(!(a&&indexOf(a).call(a,String(uh.time))>=0||u&&indexOf(u).call(u,String(uh.time))>0)){w.next=13;break}return w.abrupt("return",this.getFileAuthToken(t));case 13:throw this.logger.error("don't support time token "),new Error("don't support type time token ");case 15:w.next=33;break;case 17:if(t.urls&&t.urls.length){w.next=20;break}throw this.logger.error("urls is required when urls token"),new Error("urls is required when urls token");case 20:if(m=[],g=[],forEach$1(h=t.urls).call(h,(function(t){var a=b._getUrlType(t);a===ch.nos&&g.push(t),a===ch.s3&&m.push(t)})),(!u||0!==m.length&&indexOf(u).call(u,String(uh.urls))<0)&&(this.logger.warn("s3 url don't support url token"),m=[]),(!a||0!==g.length&&indexOf(a).call(a,String(uh.urls))<0)&&(this.logger.warn("nos url don't support url token"),g=[]),0!==m.length||0!==g.length){w.next=30;break}throw this.logger.error("not support urls"),new Error("not support urls");case 30:if(0!==m.length&&0!==g.length){w.next=33;break}return t.urls=Hu(t.urls),w.abrupt("return",this.getFileAuthToken(t));case 33:case"end":return w.stop()}}),_callee10,this)})))},t.getFileAuthToken=function getFileAuthToken(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee11(){var a;return rf.wrap((function _callee11$(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.core.sendCmd("getFileAuthToken",{mixStoreAuthTokenReqTag:t});case 2:return a=u.sent,u.abrupt("return",a.content.mixStoreAuthTokenResTag);case 4:case"end":return u.stop()}}),_callee11,this)})))},t._getUrlType=function _getUrlType(t){var a,u;return this.mixStorePolicy.nosPolicy&&some(a=this.mixStorePolicy.nosPolicy.dlcdns).call(a,(function(a){return indexOf(t).call(t,a)>=0}))?ch.nos:this.mixStorePolicy.s3Policy&&some(u=this.mixStorePolicy.s3Policy.dlcdns).call(u,(function(a){return indexOf(t).call(t,a)>=0}))?ch.s3:null},t._addCircuitTimer=function _addCircuitTimer(){var t=this,a=this.mixStorePolicy.providers,u=a[(indexOf(a).call(a,String(this.curProvider))+1)%a.length];if(u===a[0])throw new Error("uploadFile all policy fail");var h=Mp(this.mixStorePolicy,"s3Policy.uploadConfig.retryPolicy");if(h&&h.retryNext&&u&&(this.logger.log("uploadFile:: upload policy will change,now policy:"+this.curProvider+" nextProvider:"+u),this.curProvider=ms(u),this.mixStorePolicy.nosPolicy&&this.mixStorePolicy.s3Policy)){var m=this.mixStorePolicy[this.curProvider===ch.nos?"nosPolicy":"s3Policy"].uploadConfig.retryPolicy.circuit;if(!m||0===m)return;this.circuitTimer=this.core.timerManager.addTimer((function(){t.logger.log("uploadFile:: upload policy will change,now policy:"+t.curProvider+" nextProvider:"+ms(t.mixStorePolicy.providers[0])),t.curProvider=ms(t.mixStorePolicy.providers[0]),t.core.timerManager.deleteTimer(t.circuitTimer)}),1e3*m)}},t.process=function process(t){return t.error&&!t.error.ignore?Jo.reject(t.error):Jo.resolve(t)},CloudStorageService}(),wh=function(t){function ChatroomMsgService(a){return t.call(this,"chatroomMsg",a)||this}_t(ChatroomMsgService,t);var a=ChatroomMsgService.prototype;return a.sendTextMsg=function sendTextMsg(t){return validate({body:{type:"string",allowEmpty:!1}},t),this.sendMsg(Ot(Ot({},t),{type:"text"}))},a.sendGeoLocationMsg=function sendGeoLocationMsg(t){return validate({body:{type:"object",rules:{title:{type:"string",allowEmpty:!1},lat:{type:"number"},lng:{type:"number"}}}},t),this.sendMsg(Ot(Ot({},t),{type:"geo",body:Hu(t.body)}))},a.sendTipMsg=function sendTipMsg(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee(){return rf.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),a.abrupt("return",this.sendMsg(Ot(Ot({},t),{type:"tip"})));case 2:case"end":return a.stop()}}),_callee,this)})))},a.sendCustomMsg=function sendCustomMsg(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee2(){return rf.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),a.abrupt("return",this.sendMsg(Ot(Ot({},t),{type:"custom"})));case 2:case"end":return a.stop()}}),_callee2,this)})))},a.sendImageMsg=function sendImageMsg(t){return this.doSendFile(Ot(Ot({},t),{type:"image"}))},a.sendFileMsg=function sendFileMsg(t){return this.doSendFile(Ot(Ot({},t),{type:"file"}))},a.sendAudioMsg=function sendAudioMsg(t){return this.doSendFile(Ot(Ot({},t),{type:"audio"}))},a.sendVideoMsg=function sendVideoMsg(t){return this.doSendFile(Ot(Ot({},t),{type:"video"}))},a.doSendFile=function doSendFile(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee3(){var a;return rf.wrap((function _callee3$(u){for(;;)switch(u.prev=u.next){case 0:if(validate({type:{type:"string",allowEmpty:!1},body:{type:"object",rules:{url:{type:"string",allowEmpty:!1}},required:!1},maxSize:{type:"number",min:1,required:!1}},t),a=t.body){u.next=15;break}if(this.core.cloudStorage&&this.core.cloudStorage.uploadFile){u.next=5;break}throw new Error('Service "cloudStorage" does not exist');case 5:return u.prev=5,u.next=8,this.core.cloudStorage.uploadFile(t);case 8:a=u.sent,u.next=15;break;case 11:throw u.prev=11,u.t0=u.catch(5),this.logger.error("sendFile:: upload File error or abort",u.t0),u.t0;case 15:return u.abrupt("return",this.sendMsg(Ot(Ot({},t),{body:Hu(a),type:t.type})));case 16:case"end":return u.stop()}}),_callee3,this,[[5,11]])})))},a.queryMessageHistory=function queryMessageHistory(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee4(){var a,u,h;return rf.wrap((function _callee4$(m){for(;;)switch(m.prev=m.next){case 0:return validate({timetag:{type:"number",required:!1},limit:{type:"number",min:1,max:100,required:!1},reverse:{type:"boolean",required:!1},msgTypes:{type:"array",itemType:"string",required:!1}},t),m.next=3,this.core.sendCmd("chatroomQueryMessageHistory",Ot(Ot({timetag:0,limit:100,reverse:!1},t),{msgTypes:t.msgTypes?map$6(a=t.msgTypes).call(a,(function(t){return zp[t]})):[]}));case 3:return u=m.sent,h=u.content.chatroomMsgs,m.abrupt("return",formatChatroomMsgs(h,this.core.account));case 6:case"end":return m.stop()}}),_callee4,this)})))},a.getHistoryMsgsByTags=function getHistoryMsgsByTags(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee5(){var a,u,h,m,g;return rf.wrap((function _callee5$(b){for(;;)switch(b.prev=b.next){case 0:return validate({tags:{type:"array",itemType:"string",required:!0},types:{type:"array",itemType:"string",required:!1},fromTime:{type:"number",min:0,required:!1},toTime:{type:"number",min:0,required:!1},limit:{type:"number",min:0,required:!1},reverse:{type:"number",required:!1}},t),h=Ot(Ot({fromTime:0,toTime:0,limit:100,reverse:0},t),{types:t.types?map$6(a=filter(u=t.types).call(u,(function(t){return void 0!==zp[t]}))).call(a,(function(t){return zp[t]})):[]}),b.next=4,this.core.sendCmd("getHistoryMsgsByTags",{chatRoomTagHistoryMsgRequestTag:Ot(h,{tags:Hu(h.tags),types:Hu(h.types)})});case 4:return m=b.sent,g=m.content.chatroomMsgs,b.abrupt("return",formatChatroomMsgs(g,this.core.account));case 7:case"end":return b.stop()}}),_callee5,this)})))},a.onChatroomMsgHandler=function onChatroomMsgHandler(t){var a=t.content,u=Zo(),h=formatChatroomMsg(null==a?void 0:a.chatroomMsg,this.core.account);if("debug"===this.core.options.debugLevel?this.logger.debug("onChatroomMsgHandler::recvMsg",h.type,h.idClient,h):this.logger.log("onChatroomMsgHandler::recvMsg",h.type,h.idClient),this.core.emit("chatroomMsg",h),"out"!==h.flow){var m={msgId:"",clientId:h.idClient,receiveTime:t.__receiveTime,serverTime:h.time,callbackTime:Zo(),preHandleTime:u,fromAccid:h.from,toAccid:this.core.account,type:4,roomId:h.chatroomId,tid:"",result:200,failReason:"",rt:Zo()-h.time};this.core.reporter.report("msgReceive",m)}},a.sendMsg=function sendMsg(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee6(){var a,u,h,m,g;return rf.wrap((function _callee6$(b){for(;;)switch(b.prev=b.next){case 0:validate({type:{type:"enum",values:getEnumKeys(zp)},subType:{type:"number",min:1,required:!1}},t),a=generatorMsgForCmd(t,this.core.account,this.core.config.deviceId),u=formatChatroomMsg(Ot(Ot({},a),{status:"sending",time:(new Date).getTime()}),this.core.account);try{t.onSendBefore&&t.onSendBefore(u)}catch(t){this.core.logger.error("sendMsg: options.onSendBefore error",t)}return b.prev=4,b.next=7,this.core.sendCmd("sendChatroomMsg",{chatroomMsg:a});case 7:return h=b.sent,m=formatChatroomMsg(Ot(Ot(Ot({},a),h.content.chatroomMsg),{status:"success"}),this.core.account),this.core.reporter.report("msgSend",{msgId:"",clientId:m.idClient,msgTime:m.time,fromAccid:this.core.account,toAccid:"",type:4,roomId:m.chatroomId,tid:"",result:200,failReason:"",rt:Zo()-u.time}),b.abrupt("return",m);case 13:throw b.prev=13,b.t0=b.catch(4),g=formatChatroomMsg(Ot(Ot({},a),{status:"fail"}),this.core.account),b.t0.msg=g,this.core.reporter.report("msgSend",{msgId:"",clientId:g.idClient,fromAccid:this.core.account,toAccid:"",type:4,roomId:g.chatroomId,tid:"",result:null===b.t0||void 0===b.t0?void 0:b.t0.code,failReason:(null===b.t0||void 0===b.t0?void 0:b.t0.message)||"",rt:Zo()-a.time}),b.t0;case 19:case"end":return b.stop()}}),_callee6,this,[[4,13]])})))},ChatroomMsgService}(up);!function(t){t[t.regular=0]="regular",t[t.temp=1]="temp",t[t.regularOnline=2]="regularOnline",t[t.regularReverse=3]="regularReverse"}(yh||(yh={}));var xh=function(t){function ChatroomMemberService(a){return t.call(this,"chatroomMember",a)||this}_t(ChatroomMemberService,t);var a=ChatroomMemberService.prototype;return a.updateMyRoomRole=function updateMyRoomRole(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee(){return rf.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({member:{type:"object",rules:{nick:{type:"string",required:!1},avatar:{type:"string",required:!1},ext:{type:"string",required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1},needSave:{type:"boolean",required:!1}},t),a.next=3,this.core.sendCmd("chatroomUpdateMyRoomRole",Ot(Ot({},t),{chatroomMember:t.member,ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee,this)})))},a.setMemberManager=function setMemberManager(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee2(){return rf.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(Ot(Ot({},t),{type:1}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee2,this)})))},a.setMemberNormal=function setMemberNormal(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee3(){return rf.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(Ot(Ot({},t),{type:2}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee3,this)})))},a.setMemberMute=function setMemberMute(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee4(){return rf.wrap((function _callee4$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(Ot(Ot({},t),{type:-2}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee4,this)})))},a.setMemberBlackList=function setMemberBlackList(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee5(){return rf.wrap((function _callee5$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(Ot(Ot({},t),{type:-1}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee5,this)})))},a.queryMembers=function queryMembers(t){var a;return __awaiter(this,void 0,void 0,rf.mark((function _callee6(){var u;return rf.wrap((function _callee6$(h){for(;;)switch(h.prev=h.next){case 0:return validate({type:{type:"enum",values:getEnumKeys(yh)},time:{type:"number",required:!1},limit:{type:"number",required:!1}},t),h.next=3,this.core.sendCmd("chatroomQueryMembers",Ot(Ot({time:0,limit:100},t),{type:yh[t.type]}));case 3:return u=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=u.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee6,this)})))},a.queryMembersByAccounts=function queryMembersByAccounts(t){var a;return __awaiter(this,void 0,void 0,rf.mark((function _callee7(){var u;return rf.wrap((function _callee7$(h){for(;;)switch(h.prev=h.next){case 0:return validate({accounts:{type:"array",min:1,max:20,itemType:"string"}},t),h.next=3,this.core.sendCmd("chatroomQueryMembersByAccounts",t);case 3:return u=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=u.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee7,this)})))},a.setMemberTempMute=function setMemberTempMute(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee8(){return rf.wrap((function _callee8$(a){for(;;)switch(a.prev=a.next){case 0:return validate({account:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean",required:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomSetMemberTempMute",Ot(Ot({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee8,this)})))},a.kickMember=function kickMember(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee9(){return rf.wrap((function _callee9$(a){for(;;)switch(a.prev=a.next){case 0:return validate({account:{type:"string",allowEmpty:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomKickMember",Ot(Ot({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee9,this)})))},a.queryMembersCountByTag=function queryMembersCountByTag(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee10(){var a;return rf.wrap((function _callee10$(u){for(;;)switch(u.prev=u.next){case 0:return validate({tag:{type:"string",allowEmpty:!1}},t),u.next=3,this.core.sendCmd("chatroomQueryMembersCountByTag",Ot({},t));case 3:return a=u.sent,u.abrupt("return",a.content.count);case 5:case"end":return u.stop()}}),_callee10,this)})))},a.queryMembersByTag=function queryMembersByTag(t){var a;return __awaiter(this,void 0,void 0,rf.mark((function _callee11(){var u;return rf.wrap((function _callee11$(h){for(;;)switch(h.prev=h.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},time:{type:"number",required:!1},limit:{type:"number",max:100,required:!1}},t),h.next=3,this.core.sendCmd("chatroomQueryMembersByTag",{chatroomTagMemberReq:Ot({time:0,limit:100},t)});case 3:return u=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=u.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee11,this)})))},a.setMembersTempMuteByTag=function setMembersTempMuteByTag(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee12(){return rf.wrap((function _callee12$(a){for(;;)switch(a.prev=a.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean"},notifyTargetTags:{type:"string",allowEmpty:!1,required:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomSetMembersTempMuteByTag",{chatroomTagMuteReq:Ot(Ot({},t),{needNotify:t.needNotify?1:0,ext:t.ext||""})});case 3:case"end":return a.stop()}}),_callee12,this)})))},a.markChatroomMember=function markChatroomMember(t){var a;return __awaiter(this,void 0,void 0,rf.mark((function _callee13(){var u;return rf.wrap((function _callee13$(h){for(;;)switch(h.prev=h.next){case 0:return validate({account:{type:"string"},isAdd:{type:"boolean"},ext:{type:"string",required:!1},level:{type:"number",required:!1}},t),h.next=3,this.core.sendCmd("markChatroomMember",Ot(Ot({level:0},t),{ext:t.ext||""}));case 3:return u=h.sent,h.abrupt("return",formatChatroomMember(null===(a=u.content)||void 0===a?void 0:a.chatroomMember));case 5:case"end":return h.stop()}}),_callee13,this)})))},ChatroomMemberService}(up),kh=function(t){function ChatroomQueueService(a){return t.call(this,"chatroomQueue",a)||this}_t(ChatroomQueueService,t);var a=ChatroomQueueService.prototype;return a.init=function init(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee(){return rf.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({maxItemCount:{type:"number",min:0,max:1e3}},t),a.next=3,this.core.sendCmd("chatroomQueueInit",t);case 3:case"end":return a.stop()}}),_callee,this)})))},a.update=function update(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee2(){return rf.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({elementKey:{type:"string",allowEmpty:!1},elementValue:{type:"string",max:4096,allowEmpty:!1},transient:{type:"boolean",required:!1},account:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomQueueOffer",Ot(Ot({},t),{transient:!!t.transient}));case 3:case"end":return a.stop()}}),_callee2,this)})))},a.poll=function poll(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee3(){var a;return rf.wrap((function _callee3$(u){for(;;)switch(u.prev=u.next){case 0:return validate({key:{type:"string",required:!1}},t),t.key||(t.key=""),u.next=4,this.core.sendCmd("chatroomQueuePoll",t||{});case 4:return a=u.sent,u.abrupt("return",a.content);case 6:case"end":return u.stop()}}),_callee3,this)})))},a.batchUpdate=function batchUpdate(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee4(){var a;return rf.wrap((function _callee4$(u){for(;;)switch(u.prev=u.next){case 0:return validate({itemList:{type:"object"},needNotify:{type:"boolean",required:!1},notifyExtension:{type:"string",required:!1}},t),u.next=3,this.core.sendCmd("chatroomQueueChange",Ot(Ot({},t),{needNotify:!!t.needNotify}));case 3:return a=u.sent,u.abrupt("return",a.content.invalidKeyList);case 5:case"end":return u.stop()}}),_callee4,this)})))},a.fetch=function fetch(){return __awaiter(this,void 0,void 0,rf.mark((function _callee5(){var t;return rf.wrap((function _callee5$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("chatroomQueueList");case 2:return t=a.sent,a.abrupt("return",t.content.itemList);case 4:case"end":return a.stop()}}),_callee5,this)})))},a.pickHeader=function pickHeader(){return __awaiter(this,void 0,void 0,rf.mark((function _callee6(){var t,a,u,h;return rf.wrap((function _callee6$(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,this.core.sendCmd("chatroomQueuePeak");case 2:return a=m.sent,u=a.content.elementKey,h=a.content.elementValue,m.abrupt("return",((t={})[u]=h,t));case 6:case"end":return m.stop()}}),_callee6,this)})))},a.clear=function clear(){return __awaiter(this,void 0,void 0,rf.mark((function _callee7(){return rf.wrap((function _callee7$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.core.sendCmd("chatroomQueueDrop");case 2:case"end":return t.stop()}}),_callee7,this)})))},ChatroomQueueService}(up),Sh={"1_2":"heartbeat","13_2":"chatroomLogin","13_3":"beKickedFromChatroom","13_4":"chatroomExit","13_6":"sendChatroomMsg","13_7":"onChatroomMsg","13_8":"chatroomQueryMembers","13_9":"chatroomQueryMessageHistory","13_11":"markChatroomMember","13_12":"closeChatroom","13_13":"getChatroom","13_14":"updateChatroom","13_15":"chatroomUpdateMyRoomRole","13_16":"chatroomQueryMembersByAccounts","13_17":"chatroomKickMember","13_19":"chatroomSetMemberTempMute","13_20":"chatroomQueueOffer","13_21":"chatroomQueuePoll","13_22":"chatroomQueueList","13_23":"chatroomQueuePeak","13_24":"chatroomQueueDrop","13_25":"chatroomQueueInit","13_26":"chatroomQueueChange","13_30":"chatroomSetMembersTempMuteByTag","13_31":"chatroomQueryMembersByTag","13_32":"chatroomQueryMembersCountByTag","13_36":"getHistoryMsgsByTags","13_101":"updateChatroomTag"},_h={chatroomLogin:{appkey:1,account:2,deviceId:3,chatroomId:5,appLogin:8,chatroomNick:20,chatroomAvatar:21,chatroomExt:22,chatroomEnterExt:23,session:26,isAnonymous:38,tags:39,notifyTargetTags:40,authType:41,loginExt:42},chatroomIMLogin:{clientType:3,os:4,sdkVersion:6,appLogin:8,protocolVersion:9,pushTokenName:10,pushToken:11,deviceId:13,appkey:18,account:19,browser:24,session:26,deviceInfo:32,token:1e3,customTag:38,customClientType:39,sdkHumanVersion:40,hostEnv:41,userAgent:42,libEnv:44,isReactNative:112,authType:115,loginExt:116},chatroomMsg:{idClient:1,type:2,body:3,ext:4,resend:5,userUpdateTime:6,fromNick:7,fromAvatar:8,fromExt:9,needAntiSpam:10,antiSpamContent:11,skipHistory:12,messageBody:13,antiSpamBusinessId:14,clientAntiSpam:15,antiSpamUsingYidun:16,time:20,from:21,chatroomId:22,fromClientType:23,highPriority:25,callbackExt:27,subType:28,yidunAntiCheating:29,env:30,notifyTargetTags:31,yidunAntiSpamExt:32,yidunAntiSpamRes:33},chatroom:{id:1,name:3,announcement:4,broadcastUrl:5,ext:12,createTime:14,updateTime:15,queuelevel:16,creator:100,onlineMemberNum:101,mute:102},chatroomMember:{chatroomId:1,account:2,type:3,level:4,nick:5,avatar:6,ext:7,online:8,guest:9,enterTime:10,blacked:12,muted:13,valid:14,updateTime:15,tempMuted:16,tempMuteDuration:17},chatroomTagMemberReq:{tag:1,time:2,limit:3},chatroomTagMuteReq:{tag:1,duration:2,needNotify:3,ext:4,notifyTargetTags:5},chatroomCdnInfo:{enable:1,cdnUrls:2,timestamp:3,interval:4,decryptType:5,decryptKey:6,timeout:7},chatRoomTagHistoryMsgRequestTag:{tags:1,types:2,fromTime:3,toTime:4,limit:5,reverse:6},updateTags:{currentTags:1}},Ch=invertSerializeMap(_h),Th={heartbeat:{sid:1,cid:2,service:"chatroom"},chatroomLogin:{sid:13,cid:2,service:"chatroom",params:[{type:"Byte",name:"type"},{type:"Property",name:"chatroomLogin",reflectMapper:_h.chatroomLogin},{type:"Property",name:"chatroomIMLogin",reflectMapper:_h.chatroomIMLogin}],response:[{type:"Property",name:"chatroom",reflectMapper:Ch.chatroom},{type:"Property",name:"chatroomMember",reflectMapper:Ch.chatroomMember},{type:"Property",name:"chatroomCdnInfo",reflectMapper:Ch.chatroomCdnInfo}]},chatroomExit:{sid:13,cid:4,service:"chatroom"},sendChatroomMsg:{sid:13,cid:6,service:"chatroomMsg",params:[{type:"Property",name:"chatroomMsg",reflectMapper:_h.chatroomMsg}],response:[{type:"Property",name:"chatroomMsg",reflectMapper:Ch.chatroomMsg}]},chatroomQueryMessageHistory:{sid:13,cid:9,service:"chatroomMsg",params:[{type:"Long",name:"timetag"},{type:"Int",name:"limit"},{type:"Bool",name:"reverse"},{type:"LongArray",name:"msgTypes"}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:Ch.chatroomMsg}]},getHistoryMsgsByTags:{sid:13,cid:36,service:"chatroomMsg",params:[{type:"Property",name:"chatRoomTagHistoryMsgRequestTag",reflectMapper:_h.chatRoomTagHistoryMsgRequestTag}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:Ch.chatroomMsg}]},getChatroom:{sid:13,cid:13,service:"chatroom",response:[{type:"Property",name:"chatroom",reflectMapper:Ch.chatroom}]},updateChatroom:{sid:13,cid:14,service:"chatroom",params:[{type:"Property",name:"chatroom",reflectMapper:_h.chatroom},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"}]},chatroomUpdateMyRoomRole:{sid:13,cid:15,service:"chatroomMember",params:[{type:"Property",name:"chatroomMember",reflectMapper:_h.chatroomMember},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"},{type:"Bool",name:"needSave"}]},markChatroomMember:{sid:13,cid:11,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Int",name:"type"},{type:"Bool",name:"isAdd"},{type:"Int",name:"level"},{type:"String",name:"ext"}],response:[{type:"Property",name:"chatroomMember",reflectMapper:Ch.chatroomMember}]},chatroomQueryMembers:{sid:13,cid:8,service:"chatroomMember",params:[{type:"Byte",name:"type"},{type:"Long",name:"time"},{type:"Int",name:"limit"}],response:[{type:"PropertyArray",name:"members",reflectMapper:Ch.chatroomMember}]},chatroomQueryMembersByAccounts:{sid:13,cid:16,service:"chatroomMember",params:[{type:"StrArray",name:"accounts"}],response:[{type:"PropertyArray",name:"members",reflectMapper:Ch.chatroomMember}]},chatroomKickMember:{sid:13,cid:17,service:"chatroomMember",params:[{type:"string",name:"account"},{type:"string",name:"ext"}]},chatroomSetMemberTempMute:{sid:13,cid:19,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Long",name:"duration"},{type:"bool",name:"needNotify"},{type:"String",name:"ext"}]},closeChatroom:{sid:13,cid:12,service:"chatroom",params:[{type:"String",name:"ext"}]},chatroomQueryMembersCountByTag:{sid:13,cid:32,service:"chatroomMember",params:[{type:"String",name:"tag"}],response:[{type:"Long",name:"count"}]},chatroomQueryMembersByTag:{sid:13,cid:31,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMemberReq",reflectMapper:_h.chatroomTagMemberReq}],response:[{type:"PropertyArray",name:"members",reflectMapper:Ch.chatroomMember}]},chatroomSetMembersTempMuteByTag:{sid:13,cid:30,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMuteReq",reflectMapper:_h.chatroomTagMuteReq}]},chatroomQueueOffer:{sid:13,cid:20,service:"chatroomQueue",params:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"},{type:"bool",name:"transient"},{type:"String",name:"account"}]},chatroomQueuePoll:{sid:13,cid:21,service:"chatroomQueue",params:[{type:"String",name:"key"}],response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueChange:{sid:13,cid:26,service:"chatroomQueue",params:[{type:"StrStrMap",name:"itemList"},{type:"bool",name:"needNotify"},{type:"String",name:"notifyExtension"}],response:[{type:"StrArray",name:"invalidKeyList"}]},chatroomQueueList:{sid:13,cid:22,service:"chatroomQueue",response:[{type:"KVArray",name:"itemList"}]},chatroomQueuePeak:{sid:13,cid:23,service:"chatroomQueue",response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueDrop:{sid:13,cid:24,service:"chatroomQueue"},chatroomQueueInit:{sid:13,cid:25,service:"chatroomQueue",params:[{type:"Int",name:"maxItemCount"}]},onChatroomMsg:{sid:13,cid:7,service:"chatroomMsg",response:[{type:"Property",name:"chatroomMsg",reflectMapper:Ch.chatroomMsg}]},beKickedFromChatroom:{sid:13,cid:3,service:"auth",response:[{type:"Number",name:"reason"},{type:"String",name:"ext"}]},updateChatroomTag:{sid:13,cid:101,service:"chatroom",response:[{type:"Property",name:"updateTags",reflectMapper:Ch.updateTags}]}};function getIsDataReportEnable(t){var a,u,h=!0;return"boolean"==typeof(null===(a=null==t?void 0:t.reportConfig)||void 0===a?void 0:a.enableCompass)?h=t.reportConfig.enableCompass:"boolean"==typeof(null===(u=null==t?void 0:t.reportConfig)||void 0===u?void 0:u.isDataReportEnable)&&(h=t.reportConfig.isDataReportEnable),h}var Mh={debugLevel:"off",needReconnect:!0,reconnectionAttempts:9007199254740991,autoMarkRead:!0,isAbtestEnable:!0,abtestUrl:"https://abt-online.netease.im/v1/api/abt/client/getExperimentInfo",abtestProjectKey:$f},Eh=function(t){function Chatroom(a,u){var m,g;void 0===u&&(u={}),(m=t.call(this)||this).instanceName="Chatroom",m.status="unconnected",m.account="",m.eventBus=new gi,m.options={},m.chatroom={},m.chatroomMsg={},m.chatroomMember={},m.chatroomQueue={},m.cloudStorage={},m.logger=new Yl(a.debugLevel,a.account),m.setInitOptions(a),registerParser({cmdMap:Sh,cmdConfig:Th}),m.otherOptions=u,m.timerManager=new cp,m.adapters=new Kf(h(m)),m.abtest=new Vf(h(m),{isAbtestEnable:m.options.isAbtestEnable,abtestUrl:m.options.abtestUrl,abtestProjectKey:$f});var b=zf.localStorage.getItem("__NIM_DEVC_ID__");m.options.isFixedDeviceId?(b=zf.localStorage.getItem("__NIM_DEVC_ID__")||Ru(),zf.localStorage.setItem("__NIM_DEVC_ID__",b)):b=Ru(),m.config={timeout:8e3,deviceId:b};var w=zf.getSystemInfo();null===(g=null==u?void 0:u.reportConfig)||void 0===g||g.isDataReportEnable;var x=function getCompassDataEndpoint(t,a){var u,h,m=null===(u=null==a?void 0:a.reportConfig)||void 0===u?void 0:u.compassDataEndpoint,g=null===(h=null==a?void 0:a.reportConfig)||void 0===h?void 0:h.reportConfigUrl;if(m)return m;if(g){var b=g.match(/^https:\/\/([^/]+)\/*/);return Wu(b)&&b.length>=1?"https://"+b[1]:(t.error("Invalid reportConfigUrl: "+g),Wf)}return Wf}(m.logger,m.otherOptions);return m.reporter=new ts({compassDataEndpoint:x,isDataReportEnable:getIsDataReportEnable(m.otherOptions),common:{app_key:a.appkey,dev_id:"",platform:"Web",sdk_ver:"0.19.0",env:"online",os_name:w.os,os_ver:w.osVer,lib_env:w.libEnv,model:w.model,manufactor:w.manufactor,host_env:w.hostEnv,host_env_ver:w.hostEnvVer},request:zf.request,logger:m.logger,autoStart:!0}),zf.setLogger(m.logger),m.auth=new Xp(h(m)),m.clientSocket=new Bp(h(m)),m.chatroom=new Zp(h(m)),m.chatroomMsg=new wh(h(m)),m.chatroomMember=new xh(h(m)),m.chatroomQueue=new kh(h(m)),m.cloudStorage=new bh(h(m),Ot({storageKeyPrefix:m.instanceName},u.cloudStorageConfig)),Chatroom.instance=h(m),m.logger.log("Chatroom init, version ","0.19.0"," sdk version ",91600," appkey ",a.appkey),m}_t(Chatroom,t),Chatroom.getInstance=function getInstance(t,a){if(!Chatroom.instance){if(t)return new Chatroom(t,a);throw new Error("Instance not exist, please input options")}if(t){if(Chatroom.instance.options.account===t.account&&Chatroom.instance.options.appkey===t.appkey)return Chatroom.instance.setOptions(t),Chatroom.instance;throw new Error("Unexpected login")}return Chatroom.instance};var a=Chatroom.prototype;return a.setOptions=function setOptions(t){if("object"==typeof t&&null!==t&&(Object.prototype.hasOwnProperty.call(t,"account")&&t.account!==this.options.account||Object.prototype.hasOwnProperty.call(t,"appkey")&&t.appkey!==this.options.appkey))throw new Error("chatroom::setOptions account and appkey is not allowed to reset");validate({token:{type:"string",required:!1},chatroomId:{type:"string",required:!1},chatroomAddresses:{type:"array",itemType:"string",min:1,required:!1},needReconnect:{type:"boolean",required:!1},reconnectionAttempts:{type:"number",required:!1},isAnonymous:{type:"boolean",required:!1},tags:{type:"array",itemType:"string",required:!1}},t),this.logger.log("chatroom::setOptions options is",t),this.options=Ot(Ot({},this.options),t)},a.setInitOptions=function setInitOptions(t){validate({account:{type:"string"},appkey:{type:"string"},token:{type:"string"},chatroomId:{type:"string"},chatroomAddresses:{type:"array",itemType:"string",min:1},needReconnect:{type:"boolean",required:!1},reconnectionAttempts:{type:"number",required:!1},isAnonymous:{type:"boolean",required:!1},tags:{type:"array",itemType:"string",required:!1}},t),this.logger&&this.logger.log("chatroom::setInitOptions options is",t),this.account=t.account,this.options=Ot(Ot({},Mh),t)},a.connect=function connect(t){return void 0===t&&(t={}),this.auth.login(t)},a.disconnect=function disconnect(){var t,a=this;switch(null===(t=this.cloudStorage)||void 0===t||t.abortUploadTask(),this.status){case"logined":return this.sendCmd("chatroomExit",void 0,{timeout:1e3}).then((function(){a.clientSocket.doDisconnect(Rp.ACTIVE,"UserActiveDisconnect")})).catch((function(t){a.logger.error("Instance::disconnect sendCmd:logout error",t),a.clientSocket.doDisconnect(Rp.ACTIVE,"UserActiveDisconnect")}));case"connected":case"connecting":case"waitReconnect":return this.clientSocket.doDisconnect(Rp.ACTIVE,"UserActiveDisconnect"),Jo.resolve();case"unconnected":case"destroyed":return Jo.resolve()}},a.destroy=function destroy(){var t=this;return Chatroom.instance=null,this.disconnect().then((function(){t.status="destroyed",t.removeAllListeners(),t.eventBus.removeAllListeners(),t.logger.destroy(),t.reporter.destroy(),t.timerManager.destroy(),t.connect=emptyFuncWithPromise,t.disconnect=emptyFuncWithPromise,t.destroy=emptyFuncWithPromise}))},a.sendCmd=function sendCmd(t,a,u){return this.clientSocket.sendCmd(t,a,u)},a.emit=function emit(a){var u=this;try{for(var h,m,g=Zo(),b=arguments.length,w=new Array(b>1?b-1:0),x=1;x<b;x++)w[x-1]=arguments[x];var k=(h=t.prototype.emit).call.apply(h,concat(m=[this,a]).call(m,w)),S=Zo()-g;return S>=10&&this.logger.warn("Core::emit event: "+a+" process takes: "+S+"ms"),k}catch(t){return this.logger.error("Core::emit event: "+a+". Error: "+t),mi((function(){throw u.logger.error("Core::emit throw error in setTimeout. event: "+a+". Error: "+t),t}),0),!1}},Chatroom}(gi);Eh.instance=null,Eh.setAdapters=function setAdapters(t){Ff(zf,t)};var Ph=Math.min,Oh=[].lastIndexOf,Ih=!!Oh&&1/[1].lastIndexOf(1,-0)<0,Ah=arrayMethodIsStrict("lastIndexOf"),jh=Ih||!Ah?function lastIndexOf(t){if(Ih)return k(Oh,this,arguments)||0;var a=toIndexedObject(this),u=lengthOfArrayLike(a),h=u-1;for(arguments.length>1&&(h=Ph(h,toIntegerOrInfinity(arguments[1]))),h<0&&(h=u+h);h>=0;h--)if(h in a&&a[h]===t)return h||0;return-1}:Oh;_export({target:"Array",proto:!0,forced:jh!==[].lastIndexOf},{lastIndexOf:jh});var Rh=entryVirtual("Array").lastIndexOf,Lh=Array.prototype,lastIndexOf=function(t){var a=t.lastIndexOf;return t===Lh||z(Lh,t)&&a===Lh.lastIndexOf?Rh:a},Fh=createCommonjsModule((function(a,u){(function(){var h={function:!0,object:!0}[typeof window]&&window||this,m=u,g=a&&!a.nodeType&&a,b=m&&g&&"object"==typeof t&&t;!b||b.global!==b&&b.window!==b&&b.self!==b||(h=b);var w=Math.pow(2,53)-1,x=/\bOpera/,k=Object.prototype,S=k.hasOwnProperty,_=k.toString;function capitalize(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function format(t){return t=trim(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:capitalize(t)}function forOwn(t,a){for(var u in t)S.call(t,u)&&a(t[u],u,t)}function getClassOf(t){return null==t?capitalize(t):_.call(t).slice(8,-1)}function qualify(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function reduce(t,a){var u=null;return function each(t,a){var u=-1,h=t?t.length:0;if("number"==typeof h&&h>-1&&h<=w)for(;++u<h;)a(t[u],u,t);else forOwn(t,a)}(t,(function(h,m){u=a(u,h,m,t)})),u}function trim(t){return String(t).replace(/^ +| +$/g,"")}var C=function parse(t){var a=h,u=t&&"object"==typeof t&&"String"!=getClassOf(t);u&&(a=t,t=null);var m=a.navigator||{},g=m.userAgent||"";t||(t=g);var b,w,k=u?!!m.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(_.toString()),S="Object",C=u?S:"ScriptBridgingProxyObject",T=u?S:"Environment",M=u&&a.java?"JavaPackage":getClassOf(a.java),E=u?S:"RuntimeObject",P=/\bJava/.test(M)&&a.java,O=P&&getClassOf(a.environment)==T,I=P?"a":"α",A=P?"b":"β",j=a.document||{},R=a.operamini||a.opera,L=x.test(L=u&&R?R["[[Class]]"]:getClassOf(R))?L:R=null,N=t,U=[],D=null,B=t==g,q=B&&R&&"function"==typeof R.version&&R.version(),G=function getLayout(a){return reduce(a,(function(a,u){return a||RegExp("\\b"+(u.pattern||qualify(u))+"\\b","i").exec(t)&&(u.label||u)}))}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),H=function getName(a){return reduce(a,(function(a,u){return a||RegExp("\\b"+(u.pattern||qualify(u))+"\\b","i").exec(t)&&(u.label||u)}))}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),z=getProduct([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),K=function getManufacturer(a){return reduce(a,(function(a,u,h){return a||(u[z]||u[/^[a-z]+(?: +[a-z]+\b)*/i.exec(z)]||RegExp("\\b"+qualify(h)+"(?:\\b|\\w*\\d)","i").exec(t))&&h}))}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),$=function getOS(a){return reduce(a,(function(a,u){var h=u.pattern||qualify(u);return!a&&(a=RegExp("\\b"+h+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(a=function cleanupOS(t,a,u){var h={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return a&&u&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(h=h[/[\d.]+$/.exec(t)])&&(t="Windows "+h),t=String(t),a&&u&&(t=t.replace(RegExp(a,"i"),u)),format(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(a,h,u.label||u)),a}))}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function getProduct(a){return reduce(a,(function(a,u){var h=u.pattern||qualify(u);return!a&&(a=RegExp("\\b"+h+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+h+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+h+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((a=String(u.label&&!RegExp(h,"i").test(u.label)?u.label:a).split("/"))[1]&&!/[\d.]+/.test(a[0])&&(a[0]+=" "+a[1]),u=u.label||u,a=format(a[0].replace(RegExp(h,"i"),u).replace(RegExp("; *(?:"+u+"[_-])?","i")," ").replace(RegExp("("+u+")[-_.]?(\\w)","i"),"$1 $2"))),a}))}function getVersion(a){return reduce(a,(function(a,u){return a||(RegExp(u+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))}if(G&&(G=[G]),/\bAndroid\b/.test($)&&!z&&(b=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(t))&&(z=trim(b[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),K&&!z?z=getProduct([K]):K&&z&&(z=z.replace(RegExp("^("+qualify(K)+")[-_.\\s]","i"),K+" ").replace(RegExp("^("+qualify(K)+")[-_.]?(\\w)","i"),K+" $2")),(b=/\bGoogle TV\b/.exec(z))&&(z=b[0]),/\bSimulator\b/i.test(t)&&(z=(z?z+" ":"")+"Simulator"),"Opera Mini"==H&&/\bOPiOS\b/.test(t)&&U.push("running in Turbo/Uncompressed mode"),"IE"==H&&/\blike iPhone OS\b/.test(t)?(K=(b=parse(t.replace(/like iPhone OS/,""))).manufacturer,z=b.product):/^iP/.test(z)?(H||(H="Safari"),$="iOS"+((b=/ OS ([\d_]+)/i.exec(t))?" "+b[1].replace(/_/g,"."):"")):"Konqueror"==H&&/^Linux\b/i.test($)?$="Kubuntu":K&&"Google"!=K&&(/Chrome/.test(H)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(z))||/\bAndroid\b/.test($)&&/^Chrome/.test(H)&&/\bVersion\//i.test(t)?(H="Android Browser",$=/\bAndroid\b/.test($)?$:"Android"):"Silk"==H?(/\bMobi/i.test(t)||($="Android",U.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&U.unshift("accelerated")):"UC Browser"==H&&/\bUCWEB\b/.test(t)?U.push("speed mode"):"PaleMoon"==H&&(b=/\bFirefox\/([\d.]+)\b/.exec(t))?U.push("identifying as Firefox "+b[1]):"Firefox"==H&&(b=/\b(Mobile|Tablet|TV)\b/i.exec(t))?($||($="Firefox OS"),z||(z=b[1])):!H||(b=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(H))?(H&&!z&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(b+"/")+8))&&(H=null),(b=z||K||$)&&(z||K||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test($))&&(H=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test($)?$:b)+" Browser")):"Electron"==H&&(b=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&U.push("Chromium "+b),q||(q=getVersion(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",qualify(H),"(?:Firefox|Minefield|NetFront)"])),(b=("iCab"==G&&parseFloat(q)>3?"WebKit":/\bOpera\b/.test(H)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(G)&&"WebKit"||!G&&/\bMSIE\b/i.test(t)&&("Mac OS"==$?"Tasman":"Trident")||"WebKit"==G&&/\bPlayStation\b(?! Vita\b)/i.test(H)&&"NetFront")&&(G=[b]),"IE"==H&&(b=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(H+=" Mobile",$="Windows Phone "+(/\+$/.test(b)?b:b+".x"),U.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(H="IE Mobile",$="Windows Phone 8.x",U.unshift("desktop mode"),q||(q=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=H&&"Trident"==G&&(b=/\brv:([\d.]+)/.exec(t))&&(H&&U.push("identifying as "+H+(q?" "+q:"")),H="IE",q=b[1]),B){if(function isHostType(t,a){var u=null!=t?typeof t[a]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(u)||"object"==u&&!t[a])}(a,"global"))if(P&&(N=(b=P.lang.System).getProperty("os.arch"),$=$||b.getProperty("os.name")+" "+b.getProperty("os.version")),O){try{q=a.require("ringo/engine").version.join("."),H="RingoJS"}catch(t){(b=a.system)&&b.global.system==a.system&&(H="Narwhal",$||($=b[0].os||null))}H||(H="Rhino")}else"object"==typeof a.process&&!a.process.browser&&(b=a.process)&&("object"==typeof b.versions&&("string"==typeof b.versions.electron?(U.push("Node "+b.versions.node),H="Electron",q=b.versions.electron):"string"==typeof b.versions.nw&&(U.push("Chromium "+q,"Node "+b.versions.node),H="NW.js",q=b.versions.nw)),H||(H="Node.js",N=b.arch,$=b.platform,q=(q=/[\d.]+/.exec(b.version))?q[0]:null));else getClassOf(b=a.runtime)==C?(H="Adobe AIR",$=b.flash.system.Capabilities.os):getClassOf(b=a.phantom)==E?(H="PhantomJS",q=(b=b.version||null)&&b.major+"."+b.minor+"."+b.patch):"number"==typeof j.documentMode&&(b=/\bTrident\/(\d+)/i.exec(t))?(q=[q,j.documentMode],(b=+b[1]+4)!=q[1]&&(U.push("IE "+q[1]+" mode"),G&&(G[1]=""),q[1]=b),q="IE"==H?String(q[1].toFixed(1)):q[0]):"number"==typeof j.documentMode&&/^(?:Chrome|Firefox)\b/.test(H)&&(U.push("masking as "+H+" "+q),H="IE",q="11.0",G=["Trident"],$="Windows");$=$&&format($)}if(q&&(b=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(q)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(B&&m.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(D=/b/i.test(b)?"beta":"alpha",q=q.replace(RegExp(b+"\\+?$"),"")+("beta"==D?A:I)+(/\d+\+?/.exec(b)||"")),"Fennec"==H||"Firefox"==H&&/\b(?:Android|Firefox OS|KaiOS)\b/.test($))H="Firefox Mobile";else if("Maxthon"==H&&q)q=q.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(z))"Xbox 360"==z&&($=null),"Xbox 360"==z&&/\bIEMobile\b/.test(t)&&U.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(H)&&(!H||z||/Browser|Mobi/.test(H))||"Windows CE"!=$&&!/Mobi/i.test(t))if("IE"==H&&B)try{null===a.external&&U.unshift("platform preview")}catch(t){U.unshift("embedded")}else(/\bBlackBerry\b/.test(z)||/\bBB10\b/.test(t))&&(b=(RegExp(z.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||q)?($=((b=[b,/BB10/.test(t)])[1]?(z=null,K="BlackBerry"):"Device Software")+" "+b[0],q=null):this!=forOwn&&"Wii"!=z&&(B&&R||/Opera/.test(H)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==H&&/\bOS X (?:\d+\.){2,}/.test($)||"IE"==H&&($&&!/^Win/.test($)&&q>5.5||/\bWindows XP\b/.test($)&&q>8||8==q&&!/\bTrident\b/.test(t)))&&!x.test(b=parse.call(forOwn,t.replace(x,"")+";"))&&b.name&&(b="ing as "+b.name+((b=b.version)?" "+b:""),x.test(H)?(/\bIE\b/.test(b)&&"Mac OS"==$&&($=null),b="identify"+b):(b="mask"+b,H=L?format(L.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(b)&&($=null),B||(q=null)),G=["Presto"],U.push(b));else H+=" Mobile";(b=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(b=[parseFloat(b.replace(/\.(\d)$/,".0$1")),b],"Safari"==H&&"+"==b[1].slice(-1)?(H="WebKit Nightly",D="alpha",q=b[1].slice(0,-1)):q!=b[1]&&q!=(b[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(q=null),b[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==b[0]&&537.36==b[2]&&parseFloat(b[1])>=28&&"WebKit"==G&&(G=["Blink"]),B&&(k||b[1])?(G&&(G[1]="like Chrome"),b=b[1]||((b=b[0])<530?1:b<532?2:b<532.05?3:b<533?4:b<534.03?5:b<534.07?6:b<534.1?7:b<534.13?8:b<534.16?9:b<534.24?10:b<534.3?11:b<535.01?12:b<535.02?"13+":b<535.07?15:b<535.11?16:b<535.19?17:b<536.05?18:b<536.1?19:b<537.01?20:b<537.11?"21+":b<537.13?23:b<537.18?24:b<537.24?25:b<537.36?26:"Blink"!=G?"27":"28")):(G&&(G[1]="like Safari"),b=(b=b[0])<400?1:b<500?2:b<526?3:b<533?4:b<534?"4+":b<535?5:b<537?6:b<538?7:b<601?8:b<602?9:b<604?10:b<606?11:b<608?12:"12"),G&&(G[1]+=" "+(b+="number"==typeof b?".x":/[.+]/.test(b)?"":"+")),"Safari"==H&&(!q||parseInt(q)>45)?q=b:"Chrome"==H&&/\bHeadlessChrome/i.test(t)&&U.unshift("headless")),"Opera"==H&&(b=/\bzbov|zvav$/.exec($))?(H+=" ",U.unshift("desktop mode"),"zvav"==b?(H+="Mini",q=null):H+="Mobile",$=$.replace(RegExp(" *"+b+"$"),"")):"Safari"==H&&/\bChrome\b/.exec(G&&G[1])?(U.unshift("desktop mode"),H="Chrome Mobile",q=null,/\bOS X\b/.test($)?(K="Apple",$="iOS 4.3+"):$=null):/\bSRWare Iron\b/.test(H)&&!q&&(q=getVersion("Chrome")),q&&0==q.indexOf(b=/[\d.]+$/.exec($))&&t.indexOf("/"+b+"-")>-1&&($=trim($.replace(b,""))),$&&-1!=$.indexOf(H)&&!RegExp(H+" OS").test($)&&($=$.replace(RegExp(" *"+qualify(H)+" *"),"")),G&&!/\b(?:Avant|Nook)\b/.test(H)&&(/Browser|Lunascape|Maxthon/.test(H)||"Safari"!=H&&/^iOS/.test($)&&/\bSafari\b/.test(G[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(H)&&G[1])&&(b=G[G.length-1])&&U.push(b),U.length&&(U=["("+U.join("; ")+")"]),K&&z&&z.indexOf(K)<0&&U.push("on "+K),z&&U.push((/^on /.test(U[U.length-1])?"":"on ")+z),$&&(b=/ ([\d.+]+)$/.exec($),w=b&&"/"==$.charAt($.length-b[0].length-1),$={architecture:32,family:b&&!w?$.replace(b[0],""):$,version:b?b[1]:null,toString:function(){var t=this.version;return this.family+(t&&!w?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(b=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(N))&&!/\bi686\b/i.test(N)?($&&($.architecture=64,$.family=$.family.replace(RegExp(" *"+b),"")),H&&(/\bWOW64\b/i.test(t)||B&&/\w(?:86|32)$/.test(m.cpuClass||m.platform)&&!/\bWin64; x64\b/i.test(t))&&U.unshift("32-bit")):$&&/^OS X/.test($.family)&&"Chrome"==H&&parseFloat(q)>=39&&($.architecture=64),t||(t=null);var W={};return W.description=t,W.layout=G&&G[0],W.manufacturer=K,W.name=H,W.prerelease=D,W.product=z,W.ua=t,W.version=H&&q,W.os=$||{architecture:null,family:null,version:null,toString:function(){return"null"}},W.parse=parse,W.toString=function toStringPlatform(){return this.description||""},W.version&&U.unshift(q),W.name&&U.unshift(H),$&&H&&($!=String($).split(" ")[0]||$!=H.split(" ")[0]&&!z)&&U.push(z?"("+$+")":"on "+$),U.length&&(W.description=U.join(" ")),W}();m&&g?forOwn(C,(function(t,a){m[a]=t})):h.platform=C}).call(t)})),Nh=Math.floor,mergeSort=function(t,a){var u=t.length,h=Nh(u/2);return u<8?insertionSort(t,a):merge(t,mergeSort(arraySliceSimple(t,0,h),a),mergeSort(arraySliceSimple(t,h),a),a)},insertionSort=function(t,a){for(var u,h,m=t.length,g=1;g<m;){for(h=g,u=t[g];h&&a(t[h-1],u)>0;)t[h]=t[--h];h!==g++&&(t[h]=u)}return t},merge=function(t,a,u,h){for(var m=a.length,g=u.length,b=0,w=0;b<m||w<g;)t[b+w]=b<m&&w<g?h(a[b],u[w])<=0?a[b++]:u[w++]:b<m?a[b++]:u[w++];return t},Uh=mergeSort,Dh=K.match(/firefox\/(\d+)/i),Bh=!!Dh&&+Dh[1],qh=/MSIE|Trident/.test(K),Gh=K.match(/AppleWebKit\/(\d+)\./),Hh=!!Gh&&+Gh[1],zh=[],Kh=M(zh.sort),$h=M(zh.push),Wh=fails((function(){zh.sort(void 0)})),Vh=fails((function(){zh.sort(null)})),Qh=arrayMethodIsStrict("sort"),Jh=!fails((function(){if(Y)return Y<70;if(!(Bh&&Bh>3)){if(qh)return!0;if(Hh)return Hh<603;var t,a,u,h,m="";for(t=65;t<76;t++){switch(a=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:u=3;break;case 68:case 71:u=4;break;default:u=2}for(h=0;h<47;h++)zh.push({k:a+h,v:u})}for(zh.sort((function(t,a){return a.v-t.v})),h=0;h<zh.length;h++)a=zh[h].k.charAt(0),m.charAt(m.length-1)!==a&&(m+=a);return"DGBEFHACIJK"!==m}}));_export({target:"Array",proto:!0,forced:Wh||!Vh||!Qh||!Jh},{sort:function sort(t){void 0!==t&&aCallable(t);var a=toObject(this);if(Jh)return void 0===t?Kh(a):Kh(a,t);var u,h,m=[],g=lengthOfArrayLike(a);for(h=0;h<g;h++)h in a&&$h(m,a[h]);for(Uh(m,function(t){return function(a,u){return void 0===u?-1:void 0===a?1:void 0!==t?+t(a,u)||0:toString$1(a)>toString$1(u)?1:-1}}(t)),u=lengthOfArrayLike(m),h=0;h<u;)a[h]=m[h++];for(;h<g;)deletePropertyOrThrow(a,h++);return a}});var Yh=entryVirtual("Array").sort,Xh=Array.prototype,sort=function(t){var a=t.sort;return t===Xh||z(Xh,t)&&a===Xh.sort?Yh:a},Zh=createCommonjsModule((function(t,a){self,t.exports=function(){var t={d:function d(a,u){for(var h in u)t.o(u,h)&&!t.o(a,h)&&va(a,h,{enumerable:!0,get:u[h]})},o:function o(t,a){return Object.prototype.hasOwnProperty.call(t,a)}},a={};t.d(a,{default:function _default(){return _}});var u=function e(t){for(var a in function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.directUploadAddr="https://wanproxy-web.127.net",this.retryCount=4,this.trunkSize=4194304,this.trunkUploadTimeout=5e4,this.getOffsetTimeout=1e4,this.version="1.0",this.enableCache=!0,this.logger=console,this.onError=function(t){},this.onProgress=function(t){},this.onUploadProgress=function(t){},this.onComplete=function(t){},t)this[a]=t[a]};function n(t,a){var u=void 0!==ha&&sp(t)||t["@@iterator"];if(!u){if(Wu(t)||(u=function(t,a){if(t){var u;if("string"==typeof t)return r(t,a);var h=slice(u=Object.prototype.toString.call(t)).call(u,8,-1);return"Object"===h&&t.constructor&&(h=t.constructor.name),"Map"===h||"Set"===h?ap(t):"Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?r(t,a):void 0}}(t))||a&&t&&"number"==typeof t.length){u&&(t=u);var h=0,m=function i(){};return{s:m,n:function n(){return h>=t.length?{done:!0}:{done:!1,value:t[h++]}},e:function e(t){throw t},f:m}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,b=!0,w=!1;return{s:function s(){u=u.call(t)},n:function n(){var t=u.next();return b=t.done,t},e:function e(t){w=!0,g=t},f:function f(){try{b||null==u.return||u.return()}finally{if(w)throw g}}}}function r(t,a){(null==a||a>t.length)&&(a=t.length);for(var u=0,h=new Array(a);u<a;u++)h[u]=t[u];return h}var h={privateObj:{},setItem:function setItem(t,a){h.privateObj[t]=a},getItem:function getItem(t){return h.privateObj[t]},removeItem:function removeItem(t){delete h.privateObj[t]},getKeys:function getKeys(){return $a(h.privateObj)}},m={getFileKey:function getFileKey(t){var a=t.size.toString(),u=t.lastModified.toString();return"_NosUploader_"+t.name+slice(a).call(a,a.length-5)+slice(u).call(u,u.length-5)},getFileInfo:function getFileInfo(t){var a=h.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch(t){return null}},initFile:function initFile(t,a,u){m.clearExpiredInfo();var g=this.getFileKey(a),b={ctx:void 0!==t.ctx?t.ctx:"",bucket:t.bucketName,obj:t.objectName,token:t.token,modifyAt:Zo(),end:!1};return t.payload&&(b.payload=t.payload),u&&h.setItem(g,Hu(b)),g},setUploadContext:function setUploadContext(t,a,u){var m=this.getFileInfo(t);m&&(m.ctx=a,u&&h.setItem(t,Hu(m)))},setComplete:function setComplete(t,a){var u=this.getFileInfo(t);u&&(u.modifyAt=Zo(),u.end=!0,a&&h.setItem(t,Hu(u)))},getUploadContext:function getUploadContext(t){var a=this.getFileInfo(t);return a?a.ctx:""},removeFileInfo:function removeFileInfo(t){0===indexOf(t).call(t,"_NosUploader_")&&h.removeItem(t)},clearExpiredInfo:function clearExpiredInfo(){var t,a="function"==typeof h.getKeys?h.getKeys():$a(h),u=Zo(),g=[],b=n(a);try{for(b.s();!(t=b.n()).done;){var w=t.value;if(0===indexOf(w).call(w,"_NosUploader_")){var x=m.getFileInfo(w);null===x||u-x.modifyAt>_.expireTime?h.removeItem(w):g.push({fileInfo:x,key:w})}}}catch(t){b.e(t)}finally{b.f()}if(g.length>_.maxFileCache){var k,S,C=n(slice(k=sort(g).call(g,(function(t,a){return a.fileInfo.modifyAt-t.fileInfo.modifyAt}))).call(k,_.maxFileCache));try{for(C.s();!(S=C.n()).done;){var T,M=S.value;0===indexOf(T=M.key).call(T,"_NosUploader_")&&h.removeItem(M.key)}}catch(t){C.e(t)}finally{C.f()}}}},g=m;function c(t){return(c="function"==typeof ha&&"symbol"==typeof Xl?function(t){return typeof t}:function(t){return t&&"function"==typeof ha&&t.constructor===ha&&t!==ha.prototype?"symbol":typeof t})(t)}function s(t,a){return!a||"object"!==c(a)&&"function"!=typeof a?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):a}function f(t){var a="function"==typeof zs?new zs:void 0;return(f=function f(t){var u,h;if(null===t||(h=t,-1===indexOf(u=Function.toString.call(h)).call(u,"[native code]")))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==a){if(a.has(t))return a.get(t);a.set(t,n)}function n(){return l(t,arguments,y(this).constructor)}return n.prototype=lt(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)})(t)}function l(t,a,u){return(l=p()?Zs:function(t,a,u){var h=[null];h.push.apply(h,a);var m=new(bind$1(Function).apply(t,h));return u&&d(m,u.prototype),m}).apply(null,arguments)}function p(){if("undefined"==typeof Reflect||!Zs)return!1;if(Zs.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Zs(Boolean,[],(function(){}))),!0}catch(t){return!1}}function d(t,a){return(d=ht||function(t,a){return t.__proto__=a,t})(t,a)}function y(t){return(y=ht?ba:function(t){return t.__proto__||ba(t)})(t)}var b=function(t){!function(t,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");t.prototype=lt(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&d(t,a)}(r,t);var a,u,h=(a=r,u=p(),function(){var t,h=y(a);if(u){var m=y(this).constructor;t=Zs(h,arguments,m)}else t=h.apply(this,arguments);return s(this,t)});function r(t,a){var u;return function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,r),(u=h.call(this,"NosUploadError:"+t)).errCode=a,u.errMsg=t,u}return r}(f(Error)),w=function e(t,a,u){if("uploading"===t.uploadState){var h=t.config,m=t.param,w=g.getUploadContext(t.fileKey);if(!w)return u(0);var x=new XMLHttpRequest,k=h.directUploadAddr+"/".concat(m.bucketName)+"/".concat(encodeURIComponent(m.objectName))+"?uploadContext"+"&context=".concat(w)+"&version=".concat(h.version);x.onreadystatechange=function(){var m;if("abort"!==t.uploadState&&4===x.readyState){var w,S,_,C;try{C=JSON.parse(x.responseText)}catch(t){C={errMsg:"JsonParseError in getOffset. xhr.status = "+x.status+". xhr.responseText: "+x.responseText,errCode:500}}200===x.status?C.errCode?t.config.onError(new b(C.errMsg,C.errCode)):u(C.offset):x.status.toString().match(/^5/)?e(t,a-1,u):a>0?("function"==typeof(null===(m=h.logger)||void 0===m?void 0:m.error)&&h.logger.error(concat(w="getOffset(".concat(k,") error. retry after 3 seconds. ")).call(w,(new Date).toTimeString())),mi((function(){e(t,a-1,u)}),3500)):x.status?(g.removeFileInfo(t.fileKey),h.onError(new b(concat(S=concat(_="getOffset(".concat(k,") error: ")).call(_,x.status," ")).call(S,x.statusText)))):h.onError(new b("getOffset(".concat(k,") error. no Error Code")))}},x.open("get",k),x.setRequestHeader("x-nos-token",m.token),x.timeout=h.getOffsetTimeout,x.send()}},x=function e(t,a,u,h){if("uploading"===t.uploadState){var m=t.param,w=t.config,x=slice(File.prototype),k=void 0!==m.ctx?m.ctx:"",S=a+w.trunkSize>t.file.size,_=S?t.file.size:a+w.trunkSize,C=new XMLHttpRequest,T=w.directUploadAddr+"/".concat(m.bucketName)+"/".concat(encodeURIComponent(m.objectName));if(C.upload.onprogress=function(u){if("abort"!==t.uploadState){var h=0;u.lengthComputable?(h=(a+u.loaded)/t.file.size,w.onProgress(h),w.onUploadProgress({loaded:u.loaded,total:t.file.size,percentage:h,percentageText:(100*h).toFixed(2)+"%"})):w.onError(new b("browser does not support query upload progress"))}},C.onreadystatechange=function(){var m,x;if("abort"!==t.uploadState&&4===C.readyState){var k,_,M,E;try{E=JSON.parse(C.responseText)}catch(t){"function"==typeof(null===(m=w.logger)||void 0===m?void 0:m.error)&&w.logger.error("JsonParseError in uploadTrunk. xhr.status = "+C.status+". xhr.responseText: "+C.responseText,t),E={errMsg:"JsonParseError in uploadTrunk. xhr.status = "+C.status+". xhr.responseText: "+C.responseText}}200===C.status?(t.setContext(E.context),S?(h(),t.setComplete()):e(t,E.offset,w.retryCount,h)):C.status.toString().match(/^5/)?u>0?e(t,a,u-1,h):(g.removeFileInfo(t.fileKey),w.onError(new b(E.errMsg,E.errCode))):u>0?("function"==typeof(null===(x=w.logger)||void 0===x?void 0:x.error)&&w.logger.error(concat(k="uploadTrunk(".concat(T,") error. retry after 3 seconds. ")).call(k,(new Date).toTimeString())),mi((function(){e(t,a,u-1,h)}),3500)):C.status?(g.removeFileInfo(t.fileKey),w.onError(new b(concat(_=concat(M="uploadTrunk(".concat(T,") error: ")).call(M,C.status," ")).call(_,C.statusText)))):w.onError(new b("uploadTrunk(".concat(T,") error. no Error Code. Please check your network")))}},C.open("post",T+"?offset=".concat(a)+"&complete=".concat(S)+"&context=".concat(k)+"&version=".concat(w.version)),C.setRequestHeader("x-nos-token",m.token),m.md5&&C.setRequestHeader("content-md5",m.md5),t.file.type&&C.setRequestHeader("content-type",t.file.type),C.timeout=w.trunkUploadTimeout,"undefined"!=typeof FileReader){var M=new FileReader;M.addEventListener("load",(function(t){var a;(null===(a=null==t?void 0:t.target)||void 0===a?void 0:a.result)instanceof ArrayBuffer&&t.target.result.byteLength>0?C.send(t.target.result):w.onError(new b("Read ArrayBuffer failed",194003))})),M.addEventListener("error",(function(t){var a=t.target.error;w.onError(new b("Read ArrayBuffer error. ".concat(a.toString()),194003))})),M.readAsArrayBuffer(x.call(t.file,a,_))}else C.send(x.call(t.file,a,_))}};function v(t,a){for(var u=0;u<a.length;u++){var h=a[u];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),va(t,h.key,h)}}var k=function(){function e(t,a,u){!function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.uploadState="paused",this.config=u,this.file=t,this.param=a,this.fileKey=g.initFile(a,t,this.config.enableCache),this.resume()}var t;return(t=[{key:"resume",value:function value(){var t=this;if("uploading"!==this.uploadState){this.setUploadState("uploading");var a=this.config;w(this,a.retryCount,(function(u){x(t,u,a.retryCount,(function(){t.setUploadState("ended"),"function"==typeof a.onComplete&&a.onComplete(t.param)}))}))}}},{key:"pause",value:function value(){this.setUploadState("paused")}},{key:"abort",value:function value(){"ended"!==this.uploadState&&"abort"!==this.uploadState&&(this.setUploadState("abort"),this.config.onError(new b("Upload Aborted",10499)))}},{key:"setUploadState",value:function value(t){t!==this.uploadState&&(this.uploadState=t)}},{key:"setContext",value:function value(t){g.setUploadContext(this.fileKey,t,this.config.enableCache),this.param.ctx=t}},{key:"setComplete",value:function value(){g.setComplete(this.fileKey,this.config.enableCache),this.setUploadState("ended")}}])&&v(e.prototype,t),e}(),S={maxFileCache:1/0,expireTime:864e5,getFileUploadInformation:function getFileUploadInformation(t){var a=g.getFileKey(t),u=g.getFileInfo(a);return null===u?null:Zo()-u.modifyAt>S.expireTime?(g.removeFileInfo(a),null):{uploadInfo:Ot({bucketName:u.bucket,objectName:u.obj,token:u.token,ctx:u.ctx},u.payload?{payload:u.payload}:{}),complete:u.end}},setMaxFileCache:function setMaxFileCache(t){S.maxFileCache=t},setExpireTime:function setExpireTime(t){S.expireTime=t},printCaches:function printCaches(){if("undefined"!=typeof localStorage)for(var t=0,a=$a(localStorage);t<a.length;t++){var u=a[t],h=g.getFileInfo(u);h&&console.log(h,"modifiedAt",new Date(h.modifyAt).toTimeString())}},createConfig:function createConfig(t){return new u(t)},createTask:function createTask(t,a,u){return new k(t,a,u)}},_=S;return a.default}()})),em=createCommonjsModule((function(t,a){t.exports=function(){function object2String(t){if(t){var a,u="";return forEach$1(a=$a(t)).call(a,(function(a,h){u+=0===h?"?":"&",u+=a+"="+t[a]})),u}return""}var t=function(t){function V2NIMError(a,u,h,m){var g;return(g=t.call(this,h)||this).source=a,g.code=u,g.desc=h,g.detail=m||{},g}return _t(V2NIMError,t),V2NIMError}(nc(Error));function request(a,u){void 0===u&&(u={dataType:"json",method:"GET",timeout:5e3});var h="text"===u.dataType?"text/plain; charset=UTF-8":"application/json; charset=UTF-8",m="GET"===u.method?object2String(u.params):"";return new Jo((function(g,b){if(window.XMLHttpRequest){var w,x=new XMLHttpRequest;if(x.onreadystatechange=function(){if(4===x.readyState)if(200===x.status){try{w=JSON.parse(x.response||"{}")}catch(t){w=x.response}g({status:x.status,data:w})}else mi((function(){b(new t(1,x.status,"readyState: "+x.readyState+"; statusText: "+x.statusText))}),0)},x.open(u.method,""+a+m),x.timeout=u.timeout||5e3,x.setRequestHeader("Content-Type",h),u.headers)for(var k in u.headers)x.setRequestHeader(k,u.headers[k]);x.ontimeout=function(a){b(new t(1,408,a&&a.message?a.message:"request timeout"))},x.send(Hu(u.data))}else b(new t(2,10400,"request no suppout"))}))}return request}()})),tm=console;var rm=null,nm=null,om={setLogger:function setLogger(t){tm=t},platform:"BROWSER",localStorage:window.localStorage,request:em,WebSocket:window.WebSocket,uploadFile:function uploadFile(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee(){var a,u,h,m,g,b;return rf.wrap((function _callee$(w){for(;;)switch(w.prev=w.next){case 0:if(t.fileInput||t.file){w.next=2;break}throw new Error("File not exist");case 2:if(!t.file){w.next=6;break}m=t.file,w.next=20;break;case 6:if("string"!=typeof t.fileInput){w.next=15;break}if(!((g=document.getElementById(t.fileInput))&&g.files&&g.files[0])){w.next=12;break}m=g.files[0],w.next=13;break;case 12:throw new Error("Can not get file from fileInput");case 13:w.next=20;break;case 15:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){w.next=19;break}m=t.fileInput.files[0],w.next=20;break;case 19:throw new Error("Can not get file from fileInput "+t.fileInput);case 20:if(!(t.maxSize&&m.size>t.maxSize)){w.next=22;break}throw new Error("The file exceeds maxSize limit. maxSize: "+t.maxSize+", get "+m.size);case 22:return w.next=24,new Jo((function(a,u){var h=Zh.createConfig({enableCache:!1,directUploadAddr:t.chunkUploadHost,retryCount:0,onError:function onError(t){u(t)},onUploadProgress:t.onUploadProgress||function(){},onComplete:function onComplete(t){a(t)}}),g=Zh.createTask(m,{bucketName:t.nosToken.bucket,objectName:decodeURIComponent(t.nosToken.objectName),token:t.nosToken.token},h);try{t.onUploadStart&&t.onUploadStart(g)}catch(t){tm.error("Adapter uploadFile: options.onUploadStart error",t&&t.message),g.abort(),u(t)}}));case 24:return(b=w.sent).name=m.name,b.size=m.size,b.type=m.type,b.ext=lastIndexOf(a=b.name).call(a,".")>-1?slice(u=b.name).call(u,lastIndexOf(h=b.name).call(h,".")+1).toLowerCase():"",w.abrupt("return",b);case 30:case"end":return w.stop()}}),_callee)})))},getSystemInfo:function getSystemInfo(){var t,a,u=Fh.version||"";if(isElectron())try{var h=navigator.userAgent.match(/Electron\/([\d.]+\d+)/);h&&h[1]&&"string"==typeof h[1]&&(u=h[1])}catch(t){}return{os:(null===(t=Fh.os)||void 0===t?void 0:t.family)||"",osVer:(null===(a=Fh.os)||void 0===a?void 0:a.version)||"",browser:Fh.name||"",browserVer:Fh.version||"",libEnv:"BROWSER",hostEnv:isElectron()?"Electron":isMobile()?"H5":isBrowser()?"BROWSER":"Unset",hostEnvEnum:isElectron()?Df.Electron:isMobile()?Df.H5:isBrowser()?Df.BROWSER:Df.Unset,hostEnvVer:u,userAgent:navigator&&navigator.userAgent,model:u,manufactor:Fh.name||""}},net:{getNetworkStatus:function getNetworkStatus(){return Jo.resolve({net_type:Bf.kStatNetTypeUnkonw,net_connect:"undefined"==typeof navigator||"boolean"!=typeof navigator.onLine||navigator.onLine})},onNetworkStatusChange:function onNetworkStatusChange(t){rm=function onlineListener(){t({isConnected:!0,networkType:Bf.kStatNetTypeUnkonw})},nm=function offlineListener(){t({isConnected:!1,networkType:Bf.kStatNetTypeUnkonw})},window.addEventListener("online",rm),window.addEventListener("offline",nm)},offNetworkStatusChange:function offNetworkStatusChange(){rm&&window.removeEventListener("online",rm),nm&&window.removeEventListener("offline",nm),rm=null,nm=null}}};return Eh.setAdapters(om),Eh}));
|
|
13
|
+
!function(t,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define(a):(t="undefined"!=typeof globalThis?globalThis:t||self).Chatroom=a()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t){var a={exports:{}};return t(a,a.exports),a.exports}var a,u,h=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports}))),check=function(t){return t&&t.Math==Math&&t},m=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||function(){return this}()||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},g=!fails((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),b=Function.prototype,w=b.apply,x=b.call,k="object"==typeof Reflect&&Reflect.apply||(g?x.bind(w):function(){return x.apply(w,arguments)}),S=Function.prototype,_=S.bind,C=S.call,T=g&&_.bind(C,C),M=g?function(t){return t&&T(t)}:function(t){return t&&function(){return C.apply(t,arguments)}},isCallable=function(t){return"function"==typeof t},E=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),P=Function.prototype.call,O=g?P.bind(P):function(){return P.apply(P,arguments)},I={}.propertyIsEnumerable,A=Object.getOwnPropertyDescriptor,j={f:A&&!I.call({1:2},1)?function propertyIsEnumerable(t){var a=A(this,t);return!!a&&a.enumerable}:I},createPropertyDescriptor=function(t,a){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:a}},R=M({}.toString),L=M("".slice),classofRaw=function(t){return L(R(t),8,-1)},N=Object,U=M("".split),D=fails((function(){return!N("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?U(t,""):N(t)}:N,isNullOrUndefined=function(t){return null==t},B=TypeError,requireObjectCoercible=function(t){if(isNullOrUndefined(t))throw B("Can't call method on "+t);return t},toIndexedObject=function(t){return D(requireObjectCoercible(t))},q="object"==typeof document&&document.all,G=void 0===q&&void 0!==q?function(t){return"object"==typeof t?null!==t:isCallable(t)||t===q}:function(t){return"object"==typeof t?null!==t:isCallable(t)},H={},aFunction=function(t){return isCallable(t)?t:void 0},getBuiltIn=function(t,a){return arguments.length<2?aFunction(H[t])||aFunction(m[t]):H[t]&&H[t][a]||m[t]&&m[t][a]},z=M({}.isPrototypeOf),K=getBuiltIn("navigator","userAgent")||"",$=m.process,W=m.Deno,V=$&&$.versions||W&&W.version,Q=V&&V.v8;Q&&(u=(a=Q.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!u&&K&&(!(a=K.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=K.match(/Chrome\/(\d+)/))&&(u=+a[1]);var J,Y=u,X=!!Object.getOwnPropertySymbols&&!fails((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Y&&Y<41})),Z=X&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ee=Object,te=Z?function(t){return"symbol"==typeof t}:function(t){var a=getBuiltIn("Symbol");return isCallable(a)&&z(a.prototype,ee(t))},re=String,tryToString=function(t){try{return re(t)}catch(t){return"Object"}},ne=TypeError,aCallable=function(t){if(isCallable(t))return t;throw ne(tryToString(t)+" is not a function")},getMethod=function(t,a){var u=t[a];return isNullOrUndefined(u)?void 0:aCallable(u)},oe=TypeError,ie=Object.defineProperty,ae="__core-js_shared__",se=m[ae]||function(t,a){try{ie(m,t,{value:a,configurable:!0,writable:!0})}catch(u){m[t]=a}return a}(ae,{}),ce=createCommonjsModule((function(t){(t.exports=function(t,a){return se[t]||(se[t]=void 0!==a?a:{})})("versions",[]).push({version:"3.25.0",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE",source:"https://github.com/zloirock/core-js"})})),ue=Object,toObject=function(t){return ue(requireObjectCoercible(t))},le=M({}.hasOwnProperty),fe=Object.hasOwn||function hasOwn(t,a){return le(toObject(t),a)},pe=0,de=Math.random(),he=M(1..toString),uid=function(t){return"Symbol("+(void 0===t?"":t)+")_"+he(++pe+de,36)},me=ce("wks"),ge=m.Symbol,ve=ge&&ge.for,ye=Z?ge:ge&&ge.withoutSetter||uid,wellKnownSymbol=function(t){if(!fe(me,t)||!X&&"string"!=typeof me[t]){var a="Symbol."+t;X&&fe(ge,t)?me[t]=ge[t]:me[t]=Z&&ve?ve(a):ye(a)}return me[t]},be=TypeError,we=wellKnownSymbol("toPrimitive"),toPrimitive=function(t,a){if(!G(t)||te(t))return t;var u,h=getMethod(t,we);if(h){if(void 0===a&&(a="default"),u=O(h,t,a),!G(u)||te(u))return u;throw be("Can't convert object to primitive value")}return void 0===a&&(a="number"),function(t,a){var u,h;if("string"===a&&isCallable(u=t.toString)&&!G(h=O(u,t)))return h;if(isCallable(u=t.valueOf)&&!G(h=O(u,t)))return h;if("string"!==a&&isCallable(u=t.toString)&&!G(h=O(u,t)))return h;throw oe("Can't convert object to primitive value")}(t,a)},toPropertyKey=function(t){var a=toPrimitive(t,"string");return te(a)?a:a+""},xe=m.document,ke=G(xe)&&G(xe.createElement),documentCreateElement=function(t){return ke?xe.createElement(t):{}},Se=!E&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),_e=Object.getOwnPropertyDescriptor,Ce={f:E?_e:function getOwnPropertyDescriptor(t,a){if(t=toIndexedObject(t),a=toPropertyKey(a),Se)try{return _e(t,a)}catch(t){}if(fe(t,a))return createPropertyDescriptor(!O(j.f,t,a),t[a])}},Te=/#|\.prototype\./,isForced=function(t,a){var u=Ee[Me(t)];return u==Oe||u!=Pe&&(isCallable(a)?fails(a):!!a)},Me=isForced.normalize=function(t){return String(t).replace(Te,".").toLowerCase()},Ee=isForced.data={},Pe=isForced.NATIVE="N",Oe=isForced.POLYFILL="P",Ie=isForced,Ae=M(M.bind),functionBindContext=function(t,a){return aCallable(t),void 0===a?t:g?Ae(t,a):function(){return t.apply(a,arguments)}},je=E&&fails((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Re=String,Le=TypeError,anObject=function(t){if(G(t))return t;throw Le(Re(t)+" is not an object")},Fe=TypeError,Ne=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,De="enumerable",Be="configurable",qe="writable",Ge={f:E?je?function defineProperty(t,a,u){if(anObject(t),a=toPropertyKey(a),anObject(u),"function"==typeof t&&"prototype"===a&&"value"in u&&qe in u&&!u.writable){var h=Ue(t,a);h&&h.writable&&(t[a]=u.value,u={configurable:Be in u?u.configurable:h.configurable,enumerable:De in u?u.enumerable:h.enumerable,writable:!1})}return Ne(t,a,u)}:Ne:function defineProperty(t,a,u){if(anObject(t),a=toPropertyKey(a),anObject(u),Se)try{return Ne(t,a,u)}catch(t){}if("get"in u||"set"in u)throw Fe("Accessors not supported");return"value"in u&&(t[a]=u.value),t}},He=E?function(t,a,u){return Ge.f(t,a,createPropertyDescriptor(1,u))}:function(t,a,u){return t[a]=u,t},ze=Ce.f,wrapConstructor=function(t){var Wrapper=function(a,u,h){if(this instanceof Wrapper){switch(arguments.length){case 0:return new t;case 1:return new t(a);case 2:return new t(a,u)}return new t(a,u,h)}return k(t,this,arguments)};return Wrapper.prototype=t.prototype,Wrapper},_export=function(t,a){var u,h,g,b,w,x,k,S,_=t.target,C=t.global,T=t.stat,E=t.proto,P=C?m:T?m[_]:(m[_]||{}).prototype,O=C?H:H[_]||He(H,_,{})[_],I=O.prototype;for(g in a)u=!Ie(C?g:_+(T?".":"#")+g,t.forced)&&P&&fe(P,g),w=O[g],u&&(x=t.dontCallGetSet?(S=ze(P,g))&&S.value:P[g]),b=u&&x?x:a[g],u&&typeof w==typeof b||(k=t.bind&&u?functionBindContext(b,m):t.wrap&&u?wrapConstructor(b):E&&isCallable(b)?M(b):b,(t.sham||b&&b.sham||w&&w.sham)&&He(k,"sham",!0),He(O,g,k),E&&(fe(H,h=_+"Prototype")||He(H,h,{}),He(H[h],g,b),t.real&&I&&!I[g]&&He(I,g,b)))},Ke=Math.ceil,$e=Math.floor,We=Math.trunc||function trunc(t){var a=+t;return(a>0?$e:Ke)(a)},toIntegerOrInfinity=function(t){var a=+t;return a!=a||0===a?0:We(a)},Ve=Math.max,Qe=Math.min,toAbsoluteIndex=function(t,a){var u=toIntegerOrInfinity(t);return u<0?Ve(u+a,0):Qe(u,a)},Je=Math.min,lengthOfArrayLike=function(t){return(a=t.length)>0?Je(toIntegerOrInfinity(a),9007199254740991):0;var a},createMethod$4=function(t){return function(a,u,h){var m,g=toIndexedObject(a),b=lengthOfArrayLike(g),w=toAbsoluteIndex(h,b);if(t&&u!=u){for(;b>w;)if((m=g[w++])!=m)return!0}else for(;b>w;w++)if((t||w in g)&&g[w]===u)return t||w||0;return!t&&-1}},Ye={includes:createMethod$4(!0),indexOf:createMethod$4(!1)},Xe={},Ze=Ye.indexOf,et=M([].push),objectKeysInternal=function(t,a){var u,h=toIndexedObject(t),m=0,g=[];for(u in h)!fe(Xe,u)&&fe(h,u)&&et(g,u);for(;a.length>m;)fe(h,u=a[m++])&&(~Ze(g,u)||et(g,u));return g},tt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rt=Object.keys||function keys(t){return objectKeysInternal(t,tt)},nt=E&&!je?Object.defineProperties:function defineProperties(t,a){anObject(t);for(var u,h=toIndexedObject(a),m=rt(a),g=m.length,b=0;g>b;)Ge.f(t,u=m[b++],h[u]);return t},ot={f:nt},it=getBuiltIn("document","documentElement"),at=ce("keys"),sharedKey=function(t){return at[t]||(at[t]=uid(t))},st=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag("")),t.close();var a=t.parentWindow.Object;return t=null,a},NullProtoObject=function(){try{J=new ActiveXObject("htmlfile")}catch(t){}var t,a;NullProtoObject="undefined"!=typeof document?document.domain&&J?NullProtoObjectViaActiveX(J):((a=documentCreateElement("iframe")).style.display="none",it.appendChild(a),a.src=String("javascript:"),(t=a.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F):NullProtoObjectViaActiveX(J);for(var u=tt.length;u--;)delete NullProtoObject.prototype[tt[u]];return NullProtoObject()};Xe[st]=!0;var ct=Object.create||function create(t,a){var u;return null!==t?(EmptyConstructor.prototype=anObject(t),u=new EmptyConstructor,EmptyConstructor.prototype=null,u[st]=t):u=NullProtoObject(),void 0===a?u:ot.f(u,a)};_export({target:"Object",stat:!0,sham:!E},{create:ct});var ut=H.Object,lt=function create(t,a){return ut.create(t,a)},ft=String,pt=TypeError,dt=Object.setPrototypeOf||("__proto__"in{}?function(){var t,a=!1,u={};try{(t=M(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(u,[]),a=u instanceof Array}catch(t){}return function setPrototypeOf(u,h){return anObject(u),function(t){if("object"==typeof t||isCallable(t))return t;throw pt("Can't set "+ft(t)+" as a prototype")}(h),a?t(u,h):u.__proto__=h,u}}():void 0);_export({target:"Object",stat:!0},{setPrototypeOf:dt});var ht=H.Object.setPrototypeOf,mt=M([].slice),gt=Function,vt=M([].concat),yt=M([].join),bt={},construct$8=function(t,a,u){if(!fe(bt,a)){for(var h=[],m=0;m<a;m++)h[m]="a["+m+"]";bt[a]=gt("C,a","return new C("+yt(h,",")+")")}return bt[a](t,u)},wt=g?gt.bind:function bind(t){var a=aCallable(this),u=a.prototype,h=mt(arguments,1),m=function bound(){var u=vt(h,mt(arguments));return this instanceof m?construct$8(a,u.length,u):a.apply(t,u)};return G(u)&&(m.prototype=u),m};_export({target:"Function",proto:!0,forced:Function.bind!==wt},{bind:wt});var entryVirtual=function(t){return H[t+"Prototype"]},xt=entryVirtual("Function").bind,kt=Function.prototype,bind$1=function(t){var a=t.bind;return t===kt||z(kt,t)&&a===kt.bind?xt:a},St=createCommonjsModule((function(t){function _setPrototypeOf(a,u){var h;return t.exports=_setPrototypeOf=ht?bind$1(h=ht).call(h):function _setPrototypeOf(t,a){return t.__proto__=a,t},t.exports.__esModule=!0,t.exports.default=t.exports,_setPrototypeOf(a,u)}t.exports=_setPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),_t=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _inheritsLoose(t,a){t.prototype=lt(a.prototype),t.prototype.constructor=t,St(t,a)},t.exports.__esModule=!0,t.exports.default=t.exports})));_export({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991});var Ct={f:Object.getOwnPropertySymbols},Tt=Object.assign,Mt=Object.defineProperty,Et=M([].concat),Pt=!Tt||fails((function(){if(E&&1!==Tt({b:1},Tt(Mt({},"a",{enumerable:!0,get:function(){Mt(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},a={},u=Symbol(),h="abcdefghijklmnopqrst";return t[u]=7,h.split("").forEach((function(t){a[t]=t})),7!=Tt({},t)[u]||rt(Tt({},a)).join("")!=h}))?function assign(t,a){for(var u=toObject(t),h=arguments.length,m=1,g=Ct.f,b=j.f;h>m;)for(var w,x=D(arguments[m++]),k=g?Et(rt(x),g(x)):rt(x),S=k.length,_=0;S>_;)w=k[_++],E&&!O(b,x,w)||(u[w]=x[w]);return u}:Tt;_export({target:"Object",stat:!0,arity:2,forced:Object.assign!==Pt},{assign:Pt});var Ot=H.Object.assign,It=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),At=sharedKey("IE_PROTO"),jt=Object,Rt=jt.prototype,Lt=It?jt.getPrototypeOf:function(t){var a=toObject(t);if(fe(a,At))return a[At];var u=a.constructor;return isCallable(u)&&a instanceof u?u.prototype:a instanceof jt?Rt:null},Ft=tt.concat("length","prototype"),Nt={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,Ft)}},Ut=M([].concat),Dt=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var a=Nt.f(anObject(t)),u=Ct.f;return u?Ut(a,u(t)):a},Bt=Error,qt=M("".replace),Gt=String(Bt("zxcasd").stack),Ht=/\n\s*at [^:]*:[^\n]*/,zt=Ht.test(Gt),errorStackClear=function(t,a){if(zt&&"string"==typeof t&&!Bt.prepareStackTrace)for(;a--;)t=qt(t,Ht,"");return t},installErrorCause=function(t,a){G(a)&&"cause"in a&&He(t,"cause",a.cause)},Kt={},$t=wellKnownSymbol("iterator"),Wt=Array.prototype,isArrayIteratorMethod=function(t){return void 0!==t&&(Kt.Array===t||Wt[$t]===t)},Vt={};Vt[wellKnownSymbol("toStringTag")]="z";var Qt="[object z]"===String(Vt),Jt=wellKnownSymbol("toStringTag"),Yt=Object,Xt="Arguments"==classofRaw(function(){return arguments}()),Zt=Qt?classofRaw:function(t){var a,u,h;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(u=function(t,a){try{return t[a]}catch(t){}}(a=Yt(t),Jt))?u:Xt?classofRaw(a):"Object"==(h=classofRaw(a))&&isCallable(a.callee)?"Arguments":h},er=wellKnownSymbol("iterator"),getIteratorMethod$5=function(t){if(!isNullOrUndefined(t))return getMethod(t,er)||getMethod(t,"@@iterator")||Kt[Zt(t)]},tr=TypeError,getIterator=function(t,a){var u=arguments.length<2?getIteratorMethod$5(t):a;if(aCallable(u))return anObject(O(u,t));throw tr(tryToString(t)+" is not iterable")},iteratorClose=function(t,a,u){var h,m;anObject(t);try{if(!(h=getMethod(t,"return"))){if("throw"===a)throw u;return u}h=O(h,t)}catch(t){m=!0,h=t}if("throw"===a)throw u;if(m)throw h;return anObject(h),u},rr=TypeError,Result=function(t,a){this.stopped=t,this.result=a},nr=Result.prototype,iterate=function(t,a,u){var h,m,g,b,w,x,k,S=u&&u.that,_=!(!u||!u.AS_ENTRIES),C=!(!u||!u.IS_RECORD),T=!(!u||!u.IS_ITERATOR),M=!(!u||!u.INTERRUPTED),E=functionBindContext(a,S),stop=function(t){return h&&iteratorClose(h,"normal",t),new Result(!0,t)},callFn=function(t){return _?(anObject(t),M?E(t[0],t[1],stop):E(t[0],t[1])):M?E(t,stop):E(t)};if(C)h=t.iterator;else if(T)h=t;else{if(!(m=getIteratorMethod$5(t)))throw rr(tryToString(t)+" is not iterable");if(isArrayIteratorMethod(m)){for(g=0,b=lengthOfArrayLike(t);b>g;g++)if((w=callFn(t[g]))&&z(nr,w))return w;return new Result(!1)}h=getIterator(t,m)}for(x=C?t.next:h.next;!(k=O(x,h)).done;){try{w=callFn(k.value)}catch(t){iteratorClose(h,"throw",t)}if("object"==typeof w&&w&&z(nr,w))return w}return new Result(!1)},or=String,toString$1=function(t){if("Symbol"===Zt(t))throw TypeError("Cannot convert a Symbol value to a string");return or(t)},normalizeStringArgument=function(t,a){return void 0===t?arguments.length<2?"":a:toString$1(t)},ir=!fails((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",createPropertyDescriptor(1,7)),7!==t.stack)})),ar=wellKnownSymbol("toStringTag"),sr=Error,cr=[].push,ur=function AggregateError(t,a){var u,h=arguments.length>2?arguments[2]:void 0,m=z(lr,this);dt?u=dt(sr(),m?Lt(this):lr):(u=m?this:ct(lr),He(u,ar,"Error")),void 0!==a&&He(u,"message",normalizeStringArgument(a)),ir&&He(u,"stack",errorStackClear(u.stack,1)),installErrorCause(u,h);var g=[];return iterate(t,cr,{that:g}),He(u,"errors",g),u};dt?dt(ur,sr):function(t,a,u){for(var h=Dt(a),m=Ge.f,g=Ce.f,b=0;b<h.length;b++){var w=h[b];fe(t,w)||u&&fe(u,w)||m(t,w,g(a,w))}}(ur,sr,{name:!0});var lr=ur.prototype=ct(sr.prototype,{constructor:createPropertyDescriptor(1,ur),message:createPropertyDescriptor(1,""),name:createPropertyDescriptor(1,"AggregateError")});_export({global:!0,constructor:!0,arity:2},{AggregateError:ur});var fr,pr,dr,hr=m.WeakMap,mr=isCallable(hr)&&/native code/.test(String(hr)),gr="Object already initialized",vr=m.TypeError,yr=m.WeakMap;if(mr||se.state){var br=se.state||(se.state=new yr),wr=M(br.get),xr=M(br.has),kr=M(br.set);fr=function(t,a){if(xr(br,t))throw vr(gr);return a.facade=t,kr(br,t,a),a},pr=function(t){return wr(br,t)||{}},dr=function(t){return xr(br,t)}}else{var Sr=sharedKey("state");Xe[Sr]=!0,fr=function(t,a){if(fe(t,Sr))throw vr(gr);return a.facade=t,He(t,Sr,a),a},pr=function(t){return fe(t,Sr)?t[Sr]:{}},dr=function(t){return fe(t,Sr)}}var _r,Cr,Tr,Mr={set:fr,get:pr,has:dr,enforce:function(t){return dr(t)?pr(t):fr(t,{})},getterFor:function(t){return function(a){var u;if(!G(a)||(u=pr(a)).type!==t)throw vr("Incompatible receiver, "+t+" required");return u}}},Er=Function.prototype,Pr=E&&Object.getOwnPropertyDescriptor,Or=fe(Er,"name"),Ir={EXISTS:Or,PROPER:Or&&"something"===function something(){}.name,CONFIGURABLE:Or&&(!E||E&&Pr(Er,"name").configurable)},defineBuiltIn=function(t,a,u,h){return h&&h.enumerable?t[a]=u:He(t,a,u),t},Ar=wellKnownSymbol("iterator"),jr=!1;[].keys&&("next"in(Tr=[].keys())?(Cr=Lt(Lt(Tr)))!==Object.prototype&&(_r=Cr):jr=!0);var Rr=!G(_r)||fails((function(){var t={};return _r[Ar].call(t)!==t}));_r=Rr?{}:ct(_r),isCallable(_r[Ar])||defineBuiltIn(_r,Ar,(function(){return this}));var Lr={IteratorPrototype:_r,BUGGY_SAFARI_ITERATORS:jr},Fr=Qt?{}.toString:function toString(){return"[object "+Zt(this)+"]"},Nr=Ge.f,Ur=wellKnownSymbol("toStringTag"),setToStringTag=function(t,a,u,h){if(t){var m=u?t:t.prototype;fe(m,Ur)||Nr(m,Ur,{configurable:!0,value:a}),h&&!Qt&&He(m,"toString",Fr)}},Dr=Lr.IteratorPrototype,returnThis$1=function(){return this},Br=Ir.PROPER,qr=Lr.BUGGY_SAFARI_ITERATORS,Gr=wellKnownSymbol("iterator"),Hr="keys",zr="values",Kr="entries",returnThis=function(){return this},iteratorDefine=function(t,a,u,h,m,g,b){!function(t,a,u,h){var m=a+" Iterator";t.prototype=ct(Dr,{next:createPropertyDescriptor(+!h,u)}),setToStringTag(t,m,!1,!0),Kt[m]=returnThis$1}(u,a,h);var w,x,k,getIterationMethod=function(t){if(t===m&&M)return M;if(!qr&&t in C)return C[t];switch(t){case Hr:return function keys(){return new u(this,t)};case zr:return function values(){return new u(this,t)};case Kr:return function entries(){return new u(this,t)}}return function(){return new u(this)}},S=a+" Iterator",_=!1,C=t.prototype,T=C[Gr]||C["@@iterator"]||m&&C[m],M=!qr&&T||getIterationMethod(m),E="Array"==a&&C.entries||T;if(E&&(w=Lt(E.call(new t)))!==Object.prototype&&w.next&&(setToStringTag(w,S,!0,!0),Kt[S]=returnThis),Br&&m==zr&&T&&T.name!==zr&&(_=!0,M=function values(){return O(T,this)}),m)if(x={values:getIterationMethod(zr),keys:g?M:getIterationMethod(Hr),entries:getIterationMethod(Kr)},b)for(k in x)(qr||_||!(k in C))&&defineBuiltIn(C,k,x[k]);else _export({target:a,proto:!0,forced:qr||_},x);return b&&C[Gr]!==M&&defineBuiltIn(C,Gr,M,{name:m}),Kt[a]=M,x};Ge.f;var $r="Array Iterator",Wr=Mr.set,Vr=Mr.getterFor($r);iteratorDefine(Array,"Array",(function(t,a){Wr(this,{type:$r,target:toIndexedObject(t),index:0,kind:a})}),(function(){var t=Vr(this),a=t.target,u=t.kind,h=t.index++;return!a||h>=a.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==u?{value:h,done:!1}:"values"==u?{value:a[h],done:!1}:{value:[h,a[h]],done:!1}}),"values"),Kt.Arguments=Kt.Array;var Qr="process"==classofRaw(m.process),Jr=wellKnownSymbol("species"),setSpecies=function(t){var a=getBuiltIn(t),u=Ge.f;E&&a&&!a[Jr]&&u(a,Jr,{configurable:!0,get:function(){return this}})},Yr=TypeError,anInstance=function(t,a){if(z(a,t))return t;throw Yr("Incorrect invocation")},Xr=M(Function.toString);isCallable(se.inspectSource)||(se.inspectSource=function(t){return Xr(t)});var Zr=se.inspectSource,noop$1=function(){},en=[],tn=getBuiltIn("Reflect","construct"),rn=/^\s*(?:class|function)\b/,nn=M(rn.exec),an=!rn.exec(noop$1),sn=function isConstructor(t){if(!isCallable(t))return!1;try{return tn(noop$1,en,t),!0}catch(t){return!1}},cn=function isConstructor(t){if(!isCallable(t))return!1;switch(Zt(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return an||!!nn(rn,Zr(t))}catch(t){return!0}};cn.sham=!0;var un,ln,fn,pn,dn=!tn||fails((function(){var t;return sn(sn.call)||!sn(Object)||!sn((function(){t=!0}))||t}))?cn:sn,hn=TypeError,aConstructor=function(t){if(dn(t))return t;throw hn(tryToString(t)+" is not a constructor")},mn=wellKnownSymbol("species"),speciesConstructor=function(t,a){var u,h=anObject(t).constructor;return void 0===h||isNullOrUndefined(u=anObject(h)[mn])?a:aConstructor(u)},gn=TypeError,validateArgumentsLength=function(t,a){if(t<a)throw gn("Not enough arguments");return t},vn=/(?:ipad|iphone|ipod).*applewebkit/i.test(K),yn=m.setImmediate,bn=m.clearImmediate,wn=m.process,xn=m.Dispatch,kn=m.Function,Sn=m.MessageChannel,_n=m.String,Cn=0,Tn={},Mn="onreadystatechange";try{un=m.location}catch(t){}var run=function(t){if(fe(Tn,t)){var a=Tn[t];delete Tn[t],a()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){m.postMessage(_n(t),un.protocol+"//"+un.host)};yn&&bn||(yn=function setImmediate(t){validateArgumentsLength(arguments.length,1);var a=isCallable(t)?t:kn(t),u=mt(arguments,1);return Tn[++Cn]=function(){k(a,void 0,u)},ln(Cn),Cn},bn=function clearImmediate(t){delete Tn[t]},Qr?ln=function(t){wn.nextTick(runner(t))}:xn&&xn.now?ln=function(t){xn.now(runner(t))}:Sn&&!vn?(pn=(fn=new Sn).port2,fn.port1.onmessage=listener,ln=functionBindContext(pn.postMessage,pn)):m.addEventListener&&isCallable(m.postMessage)&&!m.importScripts&&un&&"file:"!==un.protocol&&!fails(post)?(ln=post,m.addEventListener("message",listener,!1)):ln=Mn in documentCreateElement("script")?function(t){it.appendChild(documentCreateElement("script")).onreadystatechange=function(){it.removeChild(this),run(t)}}:function(t){setTimeout(runner(t),0)});var En,Pn,On,In,An,jn,Rn,Ln,Fn={set:yn,clear:bn},Nn=/ipad|iphone|ipod/i.test(K)&&void 0!==m.Pebble,Un=/web0s(?!.*chrome)/i.test(K),Dn=Ce.f,Bn=Fn.set,qn=m.MutationObserver||m.WebKitMutationObserver,Gn=m.document,Hn=m.process,zn=m.Promise,Kn=Dn(m,"queueMicrotask"),$n=Kn&&Kn.value;$n||(En=function(){var t,a;for(Qr&&(t=Hn.domain)&&t.exit();Pn;){a=Pn.fn,Pn=Pn.next;try{a()}catch(t){throw Pn?In():On=void 0,t}}On=void 0,t&&t.enter()},vn||Qr||Un||!qn||!Gn?!Nn&&zn&&zn.resolve?((Rn=zn.resolve(void 0)).constructor=zn,Ln=functionBindContext(Rn.then,Rn),In=function(){Ln(En)}):Qr?In=function(){Hn.nextTick(En)}:(Bn=functionBindContext(Bn,m),In=function(){Bn(En)}):(An=!0,jn=Gn.createTextNode(""),new qn(En).observe(jn,{characterData:!0}),In=function(){jn.data=An=!An}));var Wn=$n||function(t){var a={fn:t,next:void 0};On&&(On.next=a),Pn||(Pn=a,In()),On=a},perform=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Queue=function(){this.head=null,this.tail=null};Queue.prototype={add:function(t){var a={item:t,next:null};this.head?this.tail.next=a:this.head=a,this.tail=a},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var Vn,Qn,Jn=Queue,Yn=m.Promise,Xn="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Zn=!Xn&&!Qr&&"object"==typeof window&&"object"==typeof document,eo=Yn&&Yn.prototype,to=wellKnownSymbol("species"),ro=!1,no=isCallable(m.PromiseRejectionEvent),oo=Ie("Promise",(function(){var t=Zr(Yn),a=t!==String(Yn);if(!a&&66===Y)return!0;if(!eo.catch||!eo.finally)return!0;if(!Y||Y<51||!/native code/.test(t)){var u=new Yn((function(t){t(1)})),FakePromise=function(t){t((function(){}),(function(){}))};if((u.constructor={})[to]=FakePromise,!(ro=u.then((function(){}))instanceof FakePromise))return!0}return!a&&(Zn||Xn)&&!no})),io={CONSTRUCTOR:oo,REJECTION_EVENT:no,SUBCLASSING:ro},ao=TypeError,PromiseCapability=function(t){var a,u;this.promise=new t((function(t,h){if(void 0!==a||void 0!==u)throw ao("Bad Promise constructor");a=t,u=h})),this.resolve=aCallable(a),this.reject=aCallable(u)},so={f:function(t){return new PromiseCapability(t)}},co=Fn.set,uo="Promise",lo=io.CONSTRUCTOR,fo=io.REJECTION_EVENT,po=Mr.getterFor(uo),ho=Mr.set,mo=Yn&&Yn.prototype,go=Yn,vo=mo,yo=m.TypeError,bo=m.document,wo=m.process,xo=so.f,ko=xo,So=!!(bo&&bo.createEvent&&m.dispatchEvent),_o="unhandledrejection",isThenable=function(t){var a;return!(!G(t)||!isCallable(a=t.then))&&a},callReaction=function(t,a){var u,h,m,g=a.value,b=1==a.state,w=b?t.ok:t.fail,x=t.resolve,k=t.reject,S=t.domain;try{w?(b||(2===a.rejection&&onHandleUnhandled(a),a.rejection=1),!0===w?u=g:(S&&S.enter(),u=w(g),S&&(S.exit(),m=!0)),u===t.promise?k(yo("Promise-chain cycle")):(h=isThenable(u))?O(h,u,x,k):x(u)):k(g)}catch(t){S&&!m&&S.exit(),k(t)}},notify=function(t,a){t.notified||(t.notified=!0,Wn((function(){for(var u,h=t.reactions;u=h.get();)callReaction(u,t);t.notified=!1,a&&!t.rejection&&onUnhandled(t)})))},dispatchEvent=function(t,a,u){var h,g;So?((h=bo.createEvent("Event")).promise=a,h.reason=u,h.initEvent(t,!1,!0),m.dispatchEvent(h)):h={promise:a,reason:u},!fo&&(g=m["on"+t])?g(h):t===_o&&function(t,a){var u=m.console;u&&u.error&&(1==arguments.length?u.error(t):u.error(t,a))}("Unhandled promise rejection",u)},onUnhandled=function(t){O(co,m,(function(){var a,u=t.facade,h=t.value;if(isUnhandled(t)&&(a=perform((function(){Qr?wo.emit("unhandledRejection",h,u):dispatchEvent(_o,u,h)})),t.rejection=Qr||isUnhandled(t)?2:1,a.error))throw a.value}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){O(co,m,(function(){var a=t.facade;Qr?wo.emit("rejectionHandled",a):dispatchEvent("rejectionhandled",a,t.value)}))},bind=function(t,a,u){return function(h){t(a,h,u)}},internalReject=function(t,a,u){t.done||(t.done=!0,u&&(t=u),t.value=a,t.state=2,notify(t,!0))},internalResolve=function(t,a,u){if(!t.done){t.done=!0,u&&(t=u);try{if(t.facade===a)throw yo("Promise can't be resolved itself");var h=isThenable(a);h?Wn((function(){var u={done:!1};try{O(h,a,bind(internalResolve,u,t),bind(internalReject,u,t))}catch(a){internalReject(u,a,t)}})):(t.value=a,t.state=1,notify(t,!1))}catch(a){internalReject({done:!1},a,t)}}};lo&&(vo=(go=function Promise(t){anInstance(this,vo),aCallable(t),O(Vn,this);var a=po(this);try{t(bind(internalResolve,a),bind(internalReject,a))}catch(t){internalReject(a,t)}}).prototype,(Vn=function Promise(t){ho(this,{type:uo,done:!1,notified:!1,parent:!1,reactions:new Jn,rejection:!1,state:0,value:void 0})}).prototype=defineBuiltIn(vo,"then",(function then(t,a){var u=po(this),h=xo(speciesConstructor(this,go));return u.parent=!0,h.ok=!isCallable(t)||t,h.fail=isCallable(a)&&a,h.domain=Qr?wo.domain:void 0,0==u.state?u.reactions.add(h):Wn((function(){callReaction(h,u)})),h.promise})),Qn=function(){var t=new Vn,a=po(t);this.promise=t,this.resolve=bind(internalResolve,a),this.reject=bind(internalReject,a)},so.f=xo=function(t){return t===go||undefined===t?new Qn(t):ko(t)}),_export({global:!0,constructor:!0,wrap:!0,forced:lo},{Promise:go}),setToStringTag(go,uo,!1,!0),setSpecies(uo);var Co=wellKnownSymbol("iterator"),To=!1;try{var Mo=0,Eo={next:function(){return{done:!!Mo++}},return:function(){To=!0}};Eo[Co]=function(){return this},Array.from(Eo,(function(){throw 2}))}catch(t){}var checkCorrectnessOfIteration=function(t,a){if(!a&&!To)return!1;var u=!1;try{var h={};h[Co]=function(){return{next:function(){return{done:u=!0}}}},t(h)}catch(t){}return u},Po=io.CONSTRUCTOR||!checkCorrectnessOfIteration((function(t){Yn.all(t).then(void 0,(function(){}))}));_export({target:"Promise",stat:!0,forced:Po},{all:function all(t){var a=this,u=so.f(a),h=u.resolve,m=u.reject,g=perform((function(){var u=aCallable(a.resolve),g=[],b=0,w=1;iterate(t,(function(t){var x=b++,k=!1;w++,O(u,a,t).then((function(t){k||(k=!0,g[x]=t,--w||h(g))}),m)})),--w||h(g)}));return g.error&&m(g.value),u.promise}});var Oo=io.CONSTRUCTOR;Yn&&Yn.prototype,_export({target:"Promise",proto:!0,forced:Oo,real:!0},{catch:function(t){return this.then(void 0,t)}}),_export({target:"Promise",stat:!0,forced:Po},{race:function race(t){var a=this,u=so.f(a),h=u.reject,m=perform((function(){var m=aCallable(a.resolve);iterate(t,(function(t){O(m,a,t).then(u.resolve,h)}))}));return m.error&&h(m.value),u.promise}}),_export({target:"Promise",stat:!0,forced:io.CONSTRUCTOR},{reject:function reject(t){var a=so.f(this);return O(a.reject,void 0,t),a.promise}});var promiseResolve=function(t,a){if(anObject(t),G(a)&&a.constructor===t)return a;var u=so.f(t);return(0,u.resolve)(a),u.promise},Io=io.CONSTRUCTOR,Ao=getBuiltIn("Promise"),jo=!Io;_export({target:"Promise",stat:!0,forced:!0},{resolve:function resolve(t){return promiseResolve(jo&&this===Ao?Yn:this,t)}}),_export({target:"Promise",stat:!0},{allSettled:function allSettled(t){var a=this,u=so.f(a),h=u.resolve,m=u.reject,g=perform((function(){var u=aCallable(a.resolve),m=[],g=0,b=1;iterate(t,(function(t){var w=g++,x=!1;b++,O(u,a,t).then((function(t){x||(x=!0,m[w]={status:"fulfilled",value:t},--b||h(m))}),(function(t){x||(x=!0,m[w]={status:"rejected",reason:t},--b||h(m))}))})),--b||h(m)}));return g.error&&m(g.value),u.promise}});var Ro="No one promise resolved";_export({target:"Promise",stat:!0},{any:function any(t){var a=this,u=getBuiltIn("AggregateError"),h=so.f(a),m=h.resolve,g=h.reject,b=perform((function(){var h=aCallable(a.resolve),b=[],w=0,x=1,k=!1;iterate(t,(function(t){var S=w++,_=!1;x++,O(h,a,t).then((function(t){_||k||(k=!0,m(t))}),(function(t){_||k||(_=!0,b[S]=t,--x||g(new u(b,Ro)))}))})),--x||g(new u(b,Ro))}));return b.error&&g(b.value),h.promise}});var Lo=Yn&&Yn.prototype,Fo=!!Yn&&fails((function(){Lo.finally.call({then:function(){}},(function(){}))}));_export({target:"Promise",proto:!0,real:!0,forced:Fo},{finally:function(t){var a=speciesConstructor(this,getBuiltIn("Promise")),u=isCallable(t);return this.then(u?function(u){return promiseResolve(a,t()).then((function(){return u}))}:t,u?function(u){return promiseResolve(a,t()).then((function(){throw u}))}:t)}});var No=M("".charAt),Uo=M("".charCodeAt),Do=M("".slice),createMethod$3=function(t){return function(a,u){var h,m,g=toString$1(requireObjectCoercible(a)),b=toIntegerOrInfinity(u),w=g.length;return b<0||b>=w?t?"":void 0:(h=Uo(g,b))<55296||h>56319||b+1===w||(m=Uo(g,b+1))<56320||m>57343?t?No(g,b):h:t?Do(g,b,b+2):m-56320+(h-55296<<10)+65536}},Bo={codeAt:createMethod$3(!1),charAt:createMethod$3(!0)}.charAt,qo="String Iterator",Go=Mr.set,Ho=Mr.getterFor(qo);iteratorDefine(String,"String",(function(t){Go(this,{type:qo,string:toString$1(t),index:0})}),(function next(){var t,a=Ho(this),u=a.string,h=a.index;return h>=u.length?{value:void 0,done:!0}:(t=Bo(u,h),a.index+=t.length,{value:t,done:!1})}));var zo=H.Promise,Ko=wellKnownSymbol("toStringTag");for(var $o in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var Wo=m[$o],Vo=Wo&&Wo.prototype;Vo&&Zt(Vo)!==Ko&&He(Vo,Ko,$o),Kt[$o]=Kt.Array}var Qo=zo;_export({target:"Promise",stat:!0,forced:!0},{try:function(t){var a=so.f(this),u=perform(t);return(u.error?a.reject:a.resolve)(u.value),a.promise}});var Jo=Qo,Yo=Date,Xo=M(Yo.prototype.getTime);_export({target:"Date",stat:!0},{now:function now(){return Xo(new Yo)}});var Zo=H.Date.now,ei=Array.isArray||function isArray(t){return"Array"==classofRaw(t)},ti=TypeError,doesNotExceedSafeInteger=function(t){if(t>9007199254740991)throw ti("Maximum allowed index exceeded");return t},createProperty=function(t,a,u){var h=toPropertyKey(a);h in t?Ge.f(t,h,createPropertyDescriptor(0,u)):t[h]=u},ri=wellKnownSymbol("species"),ni=Array,arraySpeciesCreate=function(t,a){return new(function(t){var a;return ei(t)&&(a=t.constructor,(dn(a)&&(a===ni||ei(a.prototype))||G(a)&&null===(a=a[ri]))&&(a=void 0)),void 0===a?ni:a}(t))(0===a?0:a)},oi=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return Y>=51||!fails((function(){var a=[];return(a.constructor={})[oi]=function(){return{foo:1}},1!==a[t](Boolean).foo}))},ii=wellKnownSymbol("isConcatSpreadable"),ai=Y>=51||!fails((function(){var t=[];return t[ii]=!1,t.concat()[0]!==t})),si=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!G(t))return!1;var a=t[ii];return void 0!==a?!!a:ei(t)};_export({target:"Array",proto:!0,arity:1,forced:!ai||!si},{concat:function concat(t){var a,u,h,m,g,b=toObject(this),w=arraySpeciesCreate(b,0),x=0;for(a=-1,h=arguments.length;a<h;a++)if(isConcatSpreadable(g=-1===a?b:arguments[a]))for(m=lengthOfArrayLike(g),doesNotExceedSafeInteger(x+m),u=0;u<m;u++,x++)u in g&&createProperty(w,x,g[u]);else doesNotExceedSafeInteger(x+1),createProperty(w,x++,g);return w.length=x,w}});var ci=entryVirtual("Array").concat,ui=Array.prototype,concat=function(t){var a=t.concat;return t===ui||z(ui,t)&&a===ui.concat?ci:a},li=/MSIE .\./.test(K),fi=m.Function,wrap$1=function(t){return li?function(a,u){var h=validateArgumentsLength(arguments.length,1)>2,m=isCallable(a)?a:fi(a),g=h?mt(arguments,2):void 0;return t(h?function(){k(m,this,g)}:m,u)}:t},pi={setTimeout:wrap$1(m.setTimeout),setInterval:wrap$1(m.setInterval)},di=pi.setInterval;_export({global:!0,bind:!0,forced:m.setInterval!==di},{setInterval:di});var hi=pi.setTimeout;_export({global:!0,bind:!0,forced:m.setTimeout!==hi},{setTimeout:hi});var mi=H.setTimeout,gi=createCommonjsModule((function(t){var a=Object.prototype.hasOwnProperty,u="~";function Events(){}function EE(t,a,u){this.fn=t,this.context=a,this.once=u||!1}function addListener(t,a,h,m,g){if("function"!=typeof h)throw new TypeError("The listener must be a function");var b=new EE(h,m||t,g),w=u?u+a:a;return t._events[w]?t._events[w].fn?t._events[w]=[t._events[w],b]:t._events[w].push(b):(t._events[w]=b,t._eventsCount++),t}function clearEvent(t,a){0==--t._eventsCount?t._events=new Events:delete t._events[a]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(u=!1)),EventEmitter.prototype.eventNames=function eventNames(){var t,h,m=[];if(0===this._eventsCount)return m;for(h in t=this._events)a.call(t,h)&&m.push(u?h.slice(1):h);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(t)):m},EventEmitter.prototype.listeners=function listeners(t){var a=u?u+t:t,h=this._events[a];if(!h)return[];if(h.fn)return[h.fn];for(var m=0,g=h.length,b=new Array(g);m<g;m++)b[m]=h[m].fn;return b},EventEmitter.prototype.listenerCount=function listenerCount(t){var a=u?u+t:t,h=this._events[a];return h?h.fn?1:h.length:0},EventEmitter.prototype.emit=function emit(t,a,h,m,g,b){var w=u?u+t:t;if(!this._events[w])return!1;var x,k,S=this._events[w],_=arguments.length;if(S.fn){switch(S.once&&this.removeListener(t,S.fn,void 0,!0),_){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,a),!0;case 3:return S.fn.call(S.context,a,h),!0;case 4:return S.fn.call(S.context,a,h,m),!0;case 5:return S.fn.call(S.context,a,h,m,g),!0;case 6:return S.fn.call(S.context,a,h,m,g,b),!0}for(k=1,x=new Array(_-1);k<_;k++)x[k-1]=arguments[k];S.fn.apply(S.context,x)}else{var C,T=S.length;for(k=0;k<T;k++)switch(S[k].once&&this.removeListener(t,S[k].fn,void 0,!0),_){case 1:S[k].fn.call(S[k].context);break;case 2:S[k].fn.call(S[k].context,a);break;case 3:S[k].fn.call(S[k].context,a,h);break;case 4:S[k].fn.call(S[k].context,a,h,m);break;default:if(!x)for(C=1,x=new Array(_-1);C<_;C++)x[C-1]=arguments[C];S[k].fn.apply(S[k].context,x)}}return!0},EventEmitter.prototype.on=function on(t,a,u){return addListener(this,t,a,u,!1)},EventEmitter.prototype.once=function once(t,a,u){return addListener(this,t,a,u,!0)},EventEmitter.prototype.removeListener=function removeListener(t,a,h,m){var g=u?u+t:t;if(!this._events[g])return this;if(!a)return clearEvent(this,g),this;var b=this._events[g];if(b.fn)b.fn!==a||m&&!b.once||h&&b.context!==h||clearEvent(this,g);else{for(var w=0,x=[],k=b.length;w<k;w++)(b[w].fn!==a||m&&!b[w].once||h&&b[w].context!==h)&&x.push(b[w]);x.length?this._events[g]=1===x.length?x[0]:x:clearEvent(this,g)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(t){var a;return t?(a=u?u+t:t,this._events[a]&&clearEvent(this,a)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=u,EventEmitter.EventEmitter=EventEmitter,t.exports=EventEmitter}));_export({global:!0},{globalThis:m});var vi=Array,yi=Math.max,arraySliceSimple=function(t,a,u){for(var h=lengthOfArrayLike(t),m=toAbsoluteIndex(a,h),g=toAbsoluteIndex(void 0===u?h:u,h),b=vi(yi(g-m,0)),w=0;m<g;m++,w++)createProperty(b,w,t[m]);return b.length=w,b},bi=Nt.f,wi="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],xi={f:function getOwnPropertyNames(t){return wi&&"Window"==classofRaw(t)?function(t){try{return bi(t)}catch(t){return arraySliceSimple(wi)}}(t):bi(toIndexedObject(t))}},ki={f:wellKnownSymbol},Si=Ge.f,wellKnownSymbolDefine=function(t){var a=H.Symbol||(H.Symbol={});fe(a,t)||Si(a,t,{value:ki.f(t)})},symbolDefineToPrimitive=function(){var t=getBuiltIn("Symbol"),a=t&&t.prototype,u=a&&a.valueOf,h=wellKnownSymbol("toPrimitive");a&&!a[h]&&defineBuiltIn(a,h,(function(t){return O(u,this)}),{arity:1})},_i=M([].push),createMethod$2=function(t){var a=1==t,u=2==t,h=3==t,m=4==t,g=6==t,b=7==t,w=5==t||g;return function(x,k,S,_){for(var C,T,M=toObject(x),E=D(M),P=functionBindContext(k,S),O=lengthOfArrayLike(E),I=0,A=_||arraySpeciesCreate,j=a?A(x,O):u||b?A(x,0):void 0;O>I;I++)if((w||I in E)&&(T=P(C=E[I],I,M),t))if(a)j[I]=T;else if(T)switch(t){case 3:return!0;case 5:return C;case 6:return I;case 2:_i(j,C)}else switch(t){case 4:return!1;case 7:_i(j,C)}return g?-1:h||m?m:j}},Ci={forEach:createMethod$2(0),map:createMethod$2(1),filter:createMethod$2(2),some:createMethod$2(3),every:createMethod$2(4),find:createMethod$2(5),findIndex:createMethod$2(6),filterReject:createMethod$2(7)},Ti=Ci.forEach,Mi=sharedKey("hidden"),Ei="Symbol",Pi=Mr.set,Oi=Mr.getterFor(Ei),Ii=Object.prototype,Ai=m.Symbol,ji=Ai&&Ai.prototype,Ri=m.TypeError,Li=m.QObject,Fi=Ce.f,Ni=Ge.f,Ui=xi.f,Di=j.f,Bi=M([].push),qi=ce("symbols"),Gi=ce("op-symbols"),Hi=ce("wks"),zi=!Li||!Li.prototype||!Li.prototype.findChild,Ki=E&&fails((function(){return 7!=ct(Ni({},"a",{get:function(){return Ni(this,"a",{value:7}).a}})).a}))?function(t,a,u){var h=Fi(Ii,a);h&&delete Ii[a],Ni(t,a,u),h&&t!==Ii&&Ni(Ii,a,h)}:Ni,wrap=function(t,a){var u=qi[t]=ct(ji);return Pi(u,{type:Ei,tag:t,description:a}),E||(u.description=a),u},$i=function defineProperty(t,a,u){t===Ii&&$i(Gi,a,u),anObject(t);var h=toPropertyKey(a);return anObject(u),fe(qi,h)?(u.enumerable?(fe(t,Mi)&&t[Mi][h]&&(t[Mi][h]=!1),u=ct(u,{enumerable:createPropertyDescriptor(0,!1)})):(fe(t,Mi)||Ni(t,Mi,createPropertyDescriptor(1,{})),t[Mi][h]=!0),Ki(t,h,u)):Ni(t,h,u)},Wi=function defineProperties(t,a){anObject(t);var u=toIndexedObject(a),h=rt(u).concat($getOwnPropertySymbols(u));return Ti(h,(function(a){E&&!O(Vi,u,a)||$i(t,a,u[a])})),t},Vi=function propertyIsEnumerable(t){var a=toPropertyKey(t),u=O(Di,this,a);return!(this===Ii&&fe(qi,a)&&!fe(Gi,a))&&(!(u||!fe(this,a)||!fe(qi,a)||fe(this,Mi)&&this[Mi][a])||u)},Qi=function getOwnPropertyDescriptor(t,a){var u=toIndexedObject(t),h=toPropertyKey(a);if(u!==Ii||!fe(qi,h)||fe(Gi,h)){var m=Fi(u,h);return!m||!fe(qi,h)||fe(u,Mi)&&u[Mi][h]||(m.enumerable=!0),m}},Ji=function getOwnPropertyNames(t){var a=Ui(toIndexedObject(t)),u=[];return Ti(a,(function(t){fe(qi,t)||fe(Xe,t)||Bi(u,t)})),u},$getOwnPropertySymbols=function(t){var a=t===Ii,u=Ui(a?Gi:toIndexedObject(t)),h=[];return Ti(u,(function(t){!fe(qi,t)||a&&!fe(Ii,t)||Bi(h,qi[t])})),h};X||(Ai=function Symbol(){if(z(ji,this))throw Ri("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?toString$1(arguments[0]):void 0,a=uid(t),setter=function(t){this===Ii&&O(setter,Gi,t),fe(this,Mi)&&fe(this[Mi],a)&&(this[Mi][a]=!1),Ki(this,a,createPropertyDescriptor(1,t))};return E&&zi&&Ki(Ii,a,{configurable:!0,set:setter}),wrap(a,t)},ji=Ai.prototype,defineBuiltIn(ji,"toString",(function toString(){return Oi(this).tag})),defineBuiltIn(Ai,"withoutSetter",(function(t){return wrap(uid(t),t)})),j.f=Vi,Ge.f=$i,ot.f=Wi,Ce.f=Qi,Nt.f=xi.f=Ji,Ct.f=$getOwnPropertySymbols,ki.f=function(t){return wrap(wellKnownSymbol(t),t)},E&&Ni(ji,"description",{configurable:!0,get:function description(){return Oi(this).description}})),_export({global:!0,constructor:!0,wrap:!0,forced:!X,sham:!X},{Symbol:Ai}),Ti(rt(Hi),(function(t){wellKnownSymbolDefine(t)})),_export({target:Ei,stat:!0,forced:!X},{useSetter:function(){zi=!0},useSimple:function(){zi=!1}}),_export({target:"Object",stat:!0,forced:!X,sham:!E},{create:function create(t,a){return void 0===a?ct(t):Wi(ct(t),a)},defineProperty:$i,defineProperties:Wi,getOwnPropertyDescriptor:Qi}),_export({target:"Object",stat:!0,forced:!X},{getOwnPropertyNames:Ji}),symbolDefineToPrimitive(),setToStringTag(Ai,Ei),Xe[Mi]=!0;var Yi=X&&!!Symbol.for&&!!Symbol.keyFor,Xi=ce("string-to-symbol-registry"),Zi=ce("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Yi},{for:function(t){var a=toString$1(t);if(fe(Xi,a))return Xi[a];var u=getBuiltIn("Symbol")(a);return Xi[a]=u,Zi[u]=a,u}});var ea=ce("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Yi},{keyFor:function keyFor(t){if(!te(t))throw TypeError(tryToString(t)+" is not a symbol");if(fe(ea,t))return ea[t]}});var ta=getBuiltIn("JSON","stringify"),ra=M(/./.exec),na=M("".charAt),oa=M("".charCodeAt),ia=M("".replace),aa=M(1..toString),sa=/[\uD800-\uDFFF]/g,ca=/^[\uD800-\uDBFF]$/,ua=/^[\uDC00-\uDFFF]$/,la=!X||fails((function(){var t=getBuiltIn("Symbol")();return"[null]"!=ta([t])||"{}"!=ta({a:t})||"{}"!=ta(Object(t))})),fa=fails((function(){return'"\\udf06\\ud834"'!==ta("\udf06\ud834")||'"\\udead"'!==ta("\udead")})),stringifyWithSymbolsFix=function(t,a){var u=mt(arguments),h=a;if((G(a)||void 0!==t)&&!te(t))return ei(a)||(a=function(t,a){if(isCallable(h)&&(a=O(h,this,t,a)),!te(a))return a}),u[1]=a,k(ta,null,u)},fixIllFormed=function(t,a,u){var h=na(u,a-1),m=na(u,a+1);return ra(ca,t)&&!ra(ua,m)||ra(ua,t)&&!ra(ca,h)?"\\u"+aa(oa(t,0),16):t};ta&&_export({target:"JSON",stat:!0,arity:3,forced:la||fa},{stringify:function stringify(t,a,u){var h=mt(arguments),m=k(la?stringifyWithSymbolsFix:ta,null,h);return fa&&"string"==typeof m?ia(m,sa,fixIllFormed):m}});var pa=!X||fails((function(){Ct.f(1)}));_export({target:"Object",stat:!0,forced:pa},{getOwnPropertySymbols:function getOwnPropertySymbols(t){var a=Ct.f;return a?a(toObject(t)):[]}}),wellKnownSymbolDefine("asyncIterator"),wellKnownSymbolDefine("hasInstance"),wellKnownSymbolDefine("isConcatSpreadable"),wellKnownSymbolDefine("iterator"),wellKnownSymbolDefine("match"),wellKnownSymbolDefine("matchAll"),wellKnownSymbolDefine("replace"),wellKnownSymbolDefine("search"),wellKnownSymbolDefine("species"),wellKnownSymbolDefine("split"),wellKnownSymbolDefine("toPrimitive"),symbolDefineToPrimitive(),wellKnownSymbolDefine("toStringTag"),setToStringTag(getBuiltIn("Symbol"),"Symbol"),wellKnownSymbolDefine("unscopables"),setToStringTag(m.JSON,"JSON",!0);var da=H.Symbol;wellKnownSymbolDefine("asyncDispose"),wellKnownSymbolDefine("dispose"),wellKnownSymbolDefine("matcher"),wellKnownSymbolDefine("metadataKey"),wellKnownSymbolDefine("observable"),wellKnownSymbolDefine("metadata"),wellKnownSymbolDefine("patternMatch"),wellKnownSymbolDefine("replaceAll");var ha=da,ma=Ge.f;_export({target:"Object",stat:!0,forced:Object.defineProperty!==ma,sham:!E},{defineProperty:ma});var ga=createCommonjsModule((function(t){var a=H.Object,u=t.exports=function defineProperty(t,u,h){return a.defineProperty(t,u,h)};a.defineProperty.sham&&(u.sham=!0)})),va=ga,ya=fails((function(){Lt(1)}));_export({target:"Object",stat:!0,forced:ya,sham:!It},{getPrototypeOf:function getPrototypeOf(t){return Lt(toObject(t))}});var ba=H.Object.getPrototypeOf,arrayMethodIsStrict=function(t,a){var u=[][t];return!!u&&fails((function(){u.call(null,a||function(){return 1},1)}))},wa=Ci.forEach,xa=arrayMethodIsStrict("forEach")?[].forEach:function forEach(t){return wa(this,t,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=xa},{forEach:xa});var ka=entryVirtual("Array").forEach,Sa=Array.prototype,_a={DOMTokenList:!0,NodeList:!0},forEach$1=function(t){var a=t.forEach;return t===Sa||z(Sa,t)&&a===Sa.forEach||fe(_a,Zt(t))?ka:a},Ca=M([].reverse),Ta=[1,2];_export({target:"Array",proto:!0,forced:String(Ta)===String(Ta.reverse())},{reverse:function reverse(){return ei(this)&&(this.length=this.length),Ca(this)}});var Ma=entryVirtual("Array").reverse,Ea=Array.prototype,reverse=function(t){var a=t.reverse;return t===Ea||z(Ea,t)&&a===Ea.reverse?Ma:a},Pa=arrayMethodHasSpeciesSupport("slice"),Oa=wellKnownSymbol("species"),Ia=Array,Aa=Math.max;_export({target:"Array",proto:!0,forced:!Pa},{slice:function slice(t,a){var u,h,m,g=toIndexedObject(this),b=lengthOfArrayLike(g),w=toAbsoluteIndex(t,b),x=toAbsoluteIndex(void 0===a?b:a,b);if(ei(g)&&(u=g.constructor,(dn(u)&&(u===Ia||ei(u.prototype))||G(u)&&null===(u=u[Oa]))&&(u=void 0),u===Ia||void 0===u))return mt(g,w,x);for(h=new(void 0===u?Ia:u)(Aa(x-w,0)),m=0;w<x;w++,m++)w in g&&createProperty(h,m,g[w]);return h.length=m,h}});var ja=entryVirtual("Array").slice,Ra=Array.prototype,slice=function(t){var a=t.slice;return t===Ra||z(Ra,t)&&a===Ra.slice?ja:a},La=Ye.includes,Fa=fails((function(){return!Array(1).includes()}));_export({target:"Array",proto:!0,forced:Fa},{includes:function includes(t){return La(this,t,arguments.length>1?arguments[1]:void 0)}});var Na=entryVirtual("Array").includes,Ua=wellKnownSymbol("match"),Da=TypeError,notARegexp=function(t){if(function(t){var a;return G(t)&&(void 0!==(a=t[Ua])?!!a:"RegExp"==classofRaw(t))}(t))throw Da("The method doesn't accept regular expressions");return t},Ba=wellKnownSymbol("match"),qa=M("".indexOf);_export({target:"String",proto:!0,forced:!function(t){var a=/./;try{"/./"[t](a)}catch(u){try{return a[Ba]=!1,"/./"[t](a)}catch(t){}}return!1}("includes")},{includes:function includes(t){return!!~qa(toString$1(requireObjectCoercible(this)),toString$1(notARegexp(t)),arguments.length>1?arguments[1]:void 0)}});var Ga=entryVirtual("String").includes,Ha=Array.prototype,za=String.prototype,includes=function(t){var a=t.includes;return t===Ha||z(Ha,t)&&a===Ha.includes?Na:"string"==typeof t||t===za||z(za,t)&&a===za.includes?Ga:a},Ka=fails((function(){rt(1)}));_export({target:"Object",stat:!0,forced:Ka},{keys:function keys(t){return rt(toObject(t))}});var $a=H.Object.keys,Wa=Ci.map,Va=arrayMethodHasSpeciesSupport("map");_export({target:"Array",proto:!0,forced:!Va},{map:function map(t){return Wa(this,t,arguments.length>1?arguments[1]:void 0)}});var Qa=entryVirtual("Array").map,Ja=Array.prototype,map$6=function(t){var a=t.map;return t===Ja||z(Ja,t)&&a===Ja.map?Qa:a},Ya=Ci.filter,Xa=arrayMethodHasSpeciesSupport("filter");_export({target:"Array",proto:!0,forced:!Xa},{filter:function filter(t){return Ya(this,t,arguments.length>1?arguments[1]:void 0)}});var Za=entryVirtual("Array").filter,es=Array.prototype,filter=function(t){var a=t.filter;return t===es||z(es,t)&&a===es.filter?Za:a},ts=createCommonjsModule((function(t,a){t.exports=function(){function _regeneratorRuntime(){_regeneratorRuntime=function _regeneratorRuntime(){return t};var t={},a=Object.prototype,u=a.hasOwnProperty,h="function"==typeof ha?ha:{},m=h.iterator||"@@iterator",g=h.asyncIterator||"@@asyncIterator",b=h.toStringTag||"@@toStringTag";function define(t,a,u){return va(t,a,{value:u,enumerable:!0,configurable:!0,writable:!0}),t[a]}try{define({},"")}catch(t){define=function define(t,a,u){return t[a]=u}}function wrap(t,a,u,h){var m=a&&a.prototype instanceof Generator?a:Generator,g=lt(m.prototype),b=new Context(h||[]);return g._invoke=function(t,a,u){var h="suspendedStart";return function(m,g){if("executing"===h)throw new Error("Generator is already running");if("completed"===h){if("throw"===m)throw g;return doneResult()}for(u.method=m,u.arg=g;;){var b=u.delegate;if(b){var x=maybeInvokeDelegate(b,u);if(x){if(x===w)continue;return x}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===h)throw h="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);h="executing";var k=tryCatch(t,a,u);if("normal"===k.type){if(h=u.done?"completed":"suspendedYield",k.arg===w)continue;return{value:k.arg,done:u.done}}"throw"===k.type&&(h="completed",u.method="throw",u.arg=k.arg)}}}(t,u,b),g}function tryCatch(t,a,u){try{return{type:"normal",arg:t.call(a,u)}}catch(t){return{type:"throw",arg:t}}}t.wrap=wrap;var w={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var x={};define(x,m,(function(){return this}));var k=ba&&ba(ba(values([])));k&&k!==a&&u.call(k,m)&&(x=k);var S=GeneratorFunctionPrototype.prototype=Generator.prototype=lt(x);function defineIteratorMethods(t){var a;forEach$1(a=["next","throw","return"]).call(a,(function(a){define(t,a,(function(t){return this._invoke(a,t)}))}))}function AsyncIterator(t,a){function invoke(h,m,g,b){var w=tryCatch(t[h],t,m);if("throw"!==w.type){var x=w.arg,k=x.value;return k&&"object"==typeof k&&u.call(k,"__await")?a.resolve(k.__await).then((function(t){invoke("next",t,g,b)}),(function(t){invoke("throw",t,g,b)})):a.resolve(k).then((function(t){x.value=t,g(x)}),(function(t){return invoke("throw",t,g,b)}))}b(w.arg)}var h;this._invoke=function(t,u){function callInvokeWithMethodAndArg(){return new a((function(a,h){invoke(t,u,a,h)}))}return h=h?h.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,a){var u=t.iterator[a.method];if(void 0===u){if(a.delegate=null,"throw"===a.method){if(t.iterator.return&&(a.method="return",a.arg=void 0,maybeInvokeDelegate(t,a),"throw"===a.method))return w;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return w}var h=tryCatch(u,t.iterator,a.arg);if("throw"===h.type)return a.method="throw",a.arg=h.arg,a.delegate=null,w;var m=h.arg;return m?m.done?(a[t.resultName]=m.value,a.next=t.nextLoc,"return"!==a.method&&(a.method="next",a.arg=void 0),a.delegate=null,w):m:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,w)}function pushTryEntry(t){var a={tryLoc:t[0]};1 in t&&(a.catchLoc=t[1]),2 in t&&(a.finallyLoc=t[2],a.afterLoc=t[3]),this.tryEntries.push(a)}function resetTryEntry(t){var a=t.completion||{};a.type="normal",delete a.arg,t.completion=a}function Context(t){this.tryEntries=[{tryLoc:"root"}],forEach$1(t).call(t,pushTryEntry,this),this.reset(!0)}function values(t){if(t){var a=t[m];if(a)return a.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var h=-1,g=function next(){for(;++h<t.length;)if(u.call(t,h))return next.value=t[h],next.done=!1,next;return next.value=void 0,next.done=!0,next};return g.next=g}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(S,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,b,"GeneratorFunction"),t.isGeneratorFunction=function(t){var a="function"==typeof t&&t.constructor;return!!a&&(a===GeneratorFunction||"GeneratorFunction"===(a.displayName||a.name))},t.mark=function(t){return ht?ht(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,b,"GeneratorFunction")),t.prototype=lt(S),t},t.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,g,(function(){return this})),t.AsyncIterator=AsyncIterator,t.async=function(a,u,h,m,g){void 0===g&&(g=Jo);var b=new AsyncIterator(wrap(a,u,h,m),g);return t.isGeneratorFunction(u)?b:b.next().then((function(t){return t.done?t.value:b.next()}))},defineIteratorMethods(S),define(S,b,"Generator"),define(S,m,(function(){return this})),define(S,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var a=[];for(var u in t)a.push(u);return reverse(a).call(a),function next(){for(;a.length;){var u=a.pop();if(u in t)return next.value=u,next.done=!1,next}return next.done=!0,next}},t.values=values,Context.prototype={constructor:Context,reset:function reset(t){var a;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,forEach$1(a=this.tryEntries).call(a,resetTryEntry),!t)for(var h in this)"t"===h.charAt(0)&&u.call(this,h)&&!isNaN(+slice(h).call(h,1))&&(this[h]=void 0)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var a=this;function handle(u,h){return g.type="throw",g.arg=t,a.next=u,h&&(a.method="next",a.arg=void 0),!!h}for(var h=this.tryEntries.length-1;h>=0;--h){var m=this.tryEntries[h],g=m.completion;if("root"===m.tryLoc)return handle("end");if(m.tryLoc<=this.prev){var b=u.call(m,"catchLoc"),w=u.call(m,"finallyLoc");if(b&&w){if(this.prev<m.catchLoc)return handle(m.catchLoc,!0);if(this.prev<m.finallyLoc)return handle(m.finallyLoc)}else if(b){if(this.prev<m.catchLoc)return handle(m.catchLoc,!0)}else{if(!w)throw new Error("try statement without catch or finally");if(this.prev<m.finallyLoc)return handle(m.finallyLoc)}}}},abrupt:function abrupt(t,a){for(var h=this.tryEntries.length-1;h>=0;--h){var m=this.tryEntries[h];if(m.tryLoc<=this.prev&&u.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var g=m;break}}g&&("break"===t||"continue"===t)&&g.tryLoc<=a&&a<=g.finallyLoc&&(g=null);var b=g?g.completion:{};return b.type=t,b.arg=a,g?(this.method="next",this.next=g.finallyLoc,w):this.complete(b)},complete:function complete(t,a){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&a&&(this.next=a),w},finish:function finish(t){for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a];if(u.finallyLoc===t)return this.complete(u.completion,u.afterLoc),resetTryEntry(u),w}},catch:function _catch(t){for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a];if(u.tryLoc===t){var h=u.completion;if("throw"===h.type){var m=h.arg;resetTryEntry(u)}return m}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,a,u){return this.delegate={iterator:values(t),resultName:a,nextLoc:u},"next"===this.method&&(this.arg=void 0),w}},t}function _classCallCheck(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,a){for(var u=0;u<a.length;u++){var h=a[u];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),va(t,h.key,h)}}function _createClass(t,a,u){return a&&_defineProperties(t.prototype,a),u&&_defineProperties(t,u),va(t,"prototype",{writable:!1}),t}function __awaiter(t,a,u,h){function adopt(t){return t instanceof u?t:new u((function(a){a(t)}))}return new(u||(u=Jo))((function(u,m){function fulfilled(t){try{step(h.next(t))}catch(t){m(t)}}function rejected(t){try{step(h.throw(t))}catch(t){m(t)}}function step(t){t.done?u(t.value):adopt(t.value).then(fulfilled,rejected)}step((h=h.apply(t,a||[])).next())}))}var t={isDataReportEnable:!0,maxSize:100,msgListMaxSize:1e3,cacheMaxSize:1e3,maxDelay:3e5,maxInterval:3e4,minInterval:1e4,timeout:5e3,autoStart:!0,loginFailIgnoreInterval:72e5},a=function emptyFn(){},u=function(){function Reporter(a){_classCallCheck(this,Reporter),this.isUploadEnable=!0,this.serverAllowUpload=!1,this.initConfigLoaded=!1,this.loading=!1,this.isDestroyed=!1,this.reportConfig=t,this.configPath="dispatcher/req",this.dataReportPath="statics/report/common/form",this.traceMsgCache={},this.highPriorityMsgList=[],this.msgList=[],this.lowPriorityMsgList=[],this.cacheMsgList=[],this.lastReportTime=Zo(),this.timer=null,this.endedAsyncMsgByModule={},this.lastFailLogin={},this.setConfig(a),this.reportConfig.isDataReportEnable&&this.reportConfig.autoStart&&this.initUploadConfig()}return _createClass(Reporter,[{key:"setConfig",value:function setConfig(t){var a=Ot({},this.reportConfig.common,t.common);this.reportConfig=Ot({},this.reportConfig,t),this.reportConfig.common=a,this.reportConfig.common.sdk_type||(this.reportConfig.common.sdk_type="im")}},{key:"reportImmediately",value:function reportImmediately(t,a){var u=this;this.reportConfig.isDataReportEnable&&this.reportConfig.request(t,Ot({dataType:"json",method:"POST",timeout:this.reportConfig.timeout},a)).catch((function(t){var a,h;null===(h=null===(a=u.reportConfig)||void 0===a?void 0:a.logger)||void 0===h||h.warn("Reporter immediately upload failed",t)}))}},{key:"report",value:function report(a,u){var h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(h.priority||(h.priority=this.getEventPriority(a,u)),this.reportConfig.isDataReportEnable&&a){if("login"===a&&!1===u.succeed&&u.process_id){var m=this.lastFailLogin[u.process_id]||0;if(u.start_time-m<t.loginFailIgnoreInterval)return;this.lastFailLogin[u.process_id]=u.start_time}var g=Zo();"HIGH"===h.priority?this.highPriorityMsgList.push({module:a,msg:u,createTime:g}):"NORMAL"===h.priority?this.msgList.push({module:a,msg:u,createTime:g}):"LOW"===h.priority&&this.lowPriorityMsgList.push({module:a,msg:u,createTime:g}),this.highPriorityMsgList.length>this.reportConfig.msgListMaxSize&&this.highPriorityMsgList.shift(),this.msgList.length>this.reportConfig.msgListMaxSize&&this.msgList.shift(),this.lowPriorityMsgList.length>this.reportConfig.msgListMaxSize&&this.lowPriorityMsgList.shift(),this.doReport()}}},{key:"reportTraceStart",value:function reportTraceStart(t,a){if(this.reportConfig.isDataReportEnable&&t&&!this.traceMsgCache[t]){var u=Ot(Ot({start_time:Zo()},a),{extension:[]});this.traceMsgCache[t]=u}}},{key:"reportTraceUpdate",value:function reportTraceUpdate(t){}},{key:"reportTraceUpdateV2",value:function reportTraceUpdateV2(t,a,u){var h,m=this;if(this.reportConfig.isDataReportEnable&&this.traceMsgCache[t]){var g=this.traceMsgCache[t].extension,b=g.length,w=(new Date).getTime();0===b?a.duration=w-this.traceMsgCache[t].start_time:g[b-1].end_time?a.duration=w-g[b-1].end_time:a.duration=w-this.traceMsgCache[t].start_time,g.push(Ot({end_time:w},a));var x=g.length-1;(null==u?void 0:u.asyncParams)&&((h=this.traceMsgCache[t]).asyncPromiseArray||(h.asyncPromiseArray=[]),this.traceMsgCache[t].asyncPromiseArray.push(u.asyncParams.then((function(a){m.traceMsgCache[t]&&m.traceMsgCache[t].extension[x]&&Ot(m.traceMsgCache[t].extension[x],a)}))))}}},{key:"reportTraceEnd",value:function reportTraceEnd(t){var a,u,h=this,m=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.reportConfig.isDataReportEnable&&this.traceMsgCache[t])if("nos"!==t||!1===m){"boolean"==typeof m?this.traceMsgCache[t].succeed=!!m:this.traceMsgCache[t].state=m,this.traceMsgCache[t].duration=Zo()-this.traceMsgCache[t].start_time,forEach$1(a=this.traceMsgCache[t].extension).call(a,(function(t){delete t.end_time}));var g=this.traceMsgCache[t];if(this.traceMsgCache[t]=null,g.asyncPromiseArray){(u=this.endedAsyncMsgByModule)[t]||(u[t]=[]),this.endedAsyncMsgByModule[t].push(g);var b=function asyncCallback(){var a;h.endedAsyncMsgByModule[t]&&includes(a=h.endedAsyncMsgByModule[t]).call(a,g)&&(delete g.asyncPromiseArray,h.report(t,g,{priority:h.getEventPriority(t,g)}))};Jo.all(g.asyncPromiseArray).then(b).catch(b)}else this.report(t,g,{priority:this.getEventPriority(t,g)})}else this.traceMsgCache[t]=null}},{key:"getEventPriority",value:function getEventPriority(t,a){if("exceptions"===t){if(0===a.action)return"HIGH";if(2===a.action)return"HIGH";if(1===a.action&&0!==a.exception_service)return"HIGH"}else{if("msgReceive"===t)return"LOW";if("nim_api_trace"===t)return"LOW"}return"NORMAL"}},{key:"reportTraceCancel",value:function reportTraceCancel(t){this.reportConfig.isDataReportEnable&&(this.endedAsyncMsgByModule[t]=[],this.traceMsgCache[t]=null)}},{key:"pause",value:function pause(){this.reportConfig.isDataReportEnable&&(this.isUploadEnable=!1)}},{key:"restore",value:function restore(){this.reportConfig.isDataReportEnable&&(this.isUploadEnable=!0,this.initConfigLoaded||this.initUploadConfig())}},{key:"destroy",value:function destroy(){var t,u=this;this.reportConfig.isDataReportEnable&&(forEach$1(t=$a(this.traceMsgCache)).call(t,(function(t){u.reportTraceEnd(t,1)})),null!==this.timer&&clearTimeout(this.timer),this.setConfig=a,this.report=a,this.reportTraceStart=a,this.reportTraceUpdate=a,this.reportTraceEnd=a,this.pause=a,this.restore=a,this.destroy=a,this.cacheMsgList=[],this.traceMsgCache={},this.lowPriorityMsgList=[],this.msgList=[],this.highPriorityMsgList=[],this.reportConfig={},this.isDestroyed=!0)}},{key:"initUploadConfig",value:function initUploadConfig(){var t,a;return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark((function _callee(){var u,h,m,g,b=this;return _regeneratorRuntime().wrap((function _callee$(w){for(var x;;)switch(w.prev=w.next){case 0:if(!this.loading){w.next=2;break}return w.abrupt("return");case 2:this.loading=!0,u=this.reportConfig.common||{},h=map$6(x=this.reportConfig.compassDataEndpoint.split(",")).call(x,(function(t){var a;return concat(a="".concat(t,"/")).call(a,b.configPath)})),m=_regeneratorRuntime().mark((function _loop(m){return _regeneratorRuntime().wrap((function _loop$(g){for(;;)switch(g.prev=g.next){case 0:if(!b.initConfigLoaded&&!b.isDestroyed){g.next=2;break}return g.abrupt("return","break");case 2:return g.prev=2,g.next=5,b.reportConfig.request(h[m],{method:"GET",dataType:"json",params:{deviceId:u.dev_id,sdkVer:u.sdk_ver,platform:u.platform,appkey:u.app_key},timeout:b.reportConfig.timeout}).then((function(t){var a,u;if(!b.isDestroyed){if(200===t.status&&t.data&&200===t.data.code){b.initConfigLoaded=!0;var g=t.data.data||{};b.reportConfig.maxSize=g.maxSize>1e3?1e3:g.maxSize,b.reportConfig.maxInterval=g.maxInterval>1e4?1e4:g.maxInterval,b.reportConfig.maxInterval=g.maxInterval<10?10:g.maxInterval,b.reportConfig.minInterval=g.minInterval<2?2:g.minInterval,b.reportConfig.maxDelay=g.maxDelay||300,b.reportConfig.maxInterval=1e3*b.reportConfig.maxInterval,b.reportConfig.minInterval=1e3*b.reportConfig.minInterval,b.reportConfig.maxDelay=1e3*b.reportConfig.maxDelay,g.endpoint?b.dataReportEndpoint=g.endpoint:b.dataReportEndpoint=h[m],b.serverAllowUpload=!0,b.loading=!1,b.reportHeartBeat()}else 200===t.status&&(b.initConfigLoaded=!0);null===(u=null===(a=b.reportConfig)||void 0===a?void 0:a.logger)||void 0===u||u.log("Get reporter upload config success")}})).catch((function(t){var a,u;b.loading=!1,null===(u=null===(a=b.reportConfig)||void 0===a?void 0:a.logger)||void 0===u||u.error("Get reporter upload config failed",t)}));case 5:g.next=11;break;case 7:g.prev=7,g.t0=g.catch(2),b.loading=!1,null===(a=null===(t=b.reportConfig)||void 0===t?void 0:t.logger)||void 0===a||a.error("Exec reporter request failed",g.t0);case 11:case"end":return g.stop()}}),_loop,null,[[2,7]])})),g=0;case 7:if(!(g<h.length)){w.next=15;break}return w.delegateYield(m(g),"t0",9);case 9:if("break"!==w.t0){w.next=12;break}return w.abrupt("break",15);case 12:g++,w.next=7;break;case 15:case"end":return w.stop()}}),_callee,this)})))}},{key:"reportHeartBeat",value:function reportHeartBeat(){var t=this;this.isDestroyed||(this.timer=mi((function(){t.reportHeartBeat()}),this.reportConfig.minInterval),this.doReport())}},{key:"doReport",value:function doReport(){if(!this.isDestroyed){var t=this.highPriorityMsgList.length+this.msgList.length+this.lowPriorityMsgList.length+this.cacheMsgList.length>2*this.reportConfig.maxSize?this.reportConfig.minInterval:this.reportConfig.maxInterval;Zo()-this.lastReportTime>=t&&this.upload()}}},{key:"getUploadMsg",value:function getUploadMsg(){var t,a,u,h,m,g,b=this,w={},x=Zo();this.highPriorityMsgList=filter(t=this.highPriorityMsgList).call(t,(function(t){return x-t.createTime<b.reportConfig.maxDelay})),this.msgList=filter(a=this.msgList).call(a,(function(t){return x-t.createTime<b.reportConfig.maxDelay})),this.lowPriorityMsgList=filter(u=this.lowPriorityMsgList).call(u,(function(t){return x-t.createTime<b.reportConfig.maxDelay})),this.cacheMsgList=filter(h=this.cacheMsgList).call(h,(function(t){return x-t.createTime<b.reportConfig.maxDelay}));var k=slice(m=this.highPriorityMsgList).call(m,0,this.reportConfig.maxSize);if(this.highPriorityMsgList=slice(g=this.highPriorityMsgList).call(g,k.length),k.length<this.reportConfig.maxSize){var S,_,C=this.reportConfig.maxSize-k.length;k=concat(k).call(k,slice(S=this.msgList).call(S,0,C)),this.msgList=slice(_=this.msgList).call(_,C)}if(k.length<this.reportConfig.maxSize){var T,M,E=this.reportConfig.maxSize-k.length;k=concat(k).call(k,slice(T=this.lowPriorityMsgList).call(T,0,E)),this.lowPriorityMsgList=slice(M=this.lowPriorityMsgList).call(M,E)}if(k.length<this.reportConfig.maxSize){var P,O,I=this.reportConfig.maxSize-k.length;k=concat(k).call(k,slice(P=this.cacheMsgList).call(P,0,I)),this.cacheMsgList=slice(O=this.cacheMsgList).call(O,I)}return forEach$1(k).call(k,(function(t){w[t.module]?w[t.module].push(t.msg):w[t.module]=[t.msg]})),{uploadMsgArr:k,uploadMsg:w}}},{key:"upload",value:function upload(){var t,a,u=this;if(this.isUploadEnable&&this.serverAllowUpload&&!(this.lastReportTime&&Zo()-this.lastReportTime<this.reportConfig.minInterval)){var h=this.getUploadMsg(),m=h.uploadMsgArr,g=h.uploadMsg;if(m.length){this.lastReportTime=Zo();try{var b,w=concat(b="".concat(this.dataReportEndpoint,"/")).call(b,this.dataReportPath);this.reportConfig.request(w,{dataType:"json",method:"POST",data:{common:this.reportConfig.common,event:g},headers:{sdktype:"im"},timeout:this.reportConfig.timeout}).catch((function(t){var a,h,g,b;u.cacheMsgList=slice(a=concat(h=u.cacheMsgList).call(h,m)).call(a,0,u.reportConfig.cacheMaxSize),null===(b=null===(g=u.reportConfig)||void 0===g?void 0:g.logger)||void 0===b||b.warn("Reporter upload failed",t)}))}catch(u){null===(a=null===(t=this.reportConfig)||void 0===t?void 0:t.logger)||void 0===a||a.warn("Exec reporter request failed",u)}clearTimeout(this.timer),this.reportHeartBeat()}}}}]),Reporter}();return u}()})),rs="\t\n\v\f\r \u2028\u2029\ufeff",ns=M("".replace),os="["+rs+"]",is=RegExp("^"+os+os+"*"),as=RegExp(os+os+"*$"),createMethod$1=function(t){return function(a){var u=toString$1(requireObjectCoercible(a));return 1&t&&(u=ns(u,is,"")),2&t&&(u=ns(u,as,"")),u}},ss={start:createMethod$1(1),end:createMethod$1(2),trim:createMethod$1(3)},cs=ss.trim,us=m.parseInt,ls=m.Symbol,fs=ls&&ls.iterator,ps=/^[+-]?0x/i,ds=M(ps.exec),hs=8!==us(rs+"08")||22!==us(rs+"0x16")||fs&&!fails((function(){us(Object(fs))}))?function parseInt(t,a){var u=cs(toString$1(t));return us(u,a>>>0||(ds(ps,u)?16:10))}:us;_export({global:!0,forced:parseInt!=hs},{parseInt:hs});var ms=H.parseInt,gs=Ye.indexOf,vs=M([].indexOf),ys=!!vs&&1/vs([1],1,-0)<0,bs=arrayMethodIsStrict("indexOf");_export({target:"Array",proto:!0,forced:ys||!bs},{indexOf:function indexOf(t){var a=arguments.length>1?arguments[1]:void 0;return ys?vs(this,t,a)||0:gs(this,t,a)}});var ws=entryVirtual("Array").indexOf,xs=Array.prototype,indexOf=function(t){var a=t.indexOf;return t===xs||z(xs,t)&&a===xs.indexOf?ws:a},ks=fails((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Ss=Object.isExtensible,_s=fails((function(){Ss(1)}))||ks?function isExtensible(t){return!!G(t)&&((!ks||"ArrayBuffer"!=classofRaw(t))&&(!Ss||Ss(t)))}:Ss,Cs=!fails((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ts=createCommonjsModule((function(t){var a=Ge.f,u=!1,h=uid("meta"),m=0,setMetadata=function(t){a(t,h,{value:{objectID:"O"+m++,weakData:{}}})},g=t.exports={enable:function(){g.enable=function(){},u=!0;var t=Nt.f,a=M([].splice),m={};m[h]=1,t(m).length&&(Nt.f=function(u){for(var m=t(u),g=0,b=m.length;g<b;g++)if(m[g]===h){a(m,g,1);break}return m},_export({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:xi.f}))},fastKey:function(t,a){if(!G(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!fe(t,h)){if(!_s(t))return"F";if(!a)return"E";setMetadata(t)}return t[h].objectID},getWeakData:function(t,a){if(!fe(t,h)){if(!_s(t))return!0;if(!a)return!1;setMetadata(t)}return t[h].weakData},onFreeze:function(t){return Cs&&u&&_s(t)&&!fe(t,h)&&setMetadata(t),t}};Xe[h]=!0})),Ms=Ge.f,Es=Ci.forEach,Ps=Mr.set,Os=Mr.getterFor,defineBuiltIns=function(t,a,u){for(var h in a)u&&u.unsafe&&t[h]?t[h]=a[h]:defineBuiltIn(t,h,a[h],u);return t},Is=Ge.f,As=Ts.fastKey,js=Mr.set,Rs=Mr.getterFor,Ls={getConstructor:function(t,a,u,h){var m=t((function(t,m){anInstance(t,g),js(t,{type:a,index:ct(null),first:void 0,last:void 0,size:0}),E||(t.size=0),isNullOrUndefined(m)||iterate(m,t[h],{that:t,AS_ENTRIES:u})})),g=m.prototype,b=Rs(a),define=function(t,a,u){var h,m,g=b(t),w=getEntry(t,a);return w?w.value=u:(g.last=w={index:m=As(a,!0),key:a,value:u,previous:h=g.last,next:void 0,removed:!1},g.first||(g.first=w),h&&(h.next=w),E?g.size++:t.size++,"F"!==m&&(g.index[m]=w)),t},getEntry=function(t,a){var u,h=b(t),m=As(a);if("F"!==m)return h.index[m];for(u=h.first;u;u=u.next)if(u.key==a)return u};return defineBuiltIns(g,{clear:function clear(){for(var t=b(this),a=t.index,u=t.first;u;)u.removed=!0,u.previous&&(u.previous=u.previous.next=void 0),delete a[u.index],u=u.next;t.first=t.last=void 0,E?t.size=0:this.size=0},delete:function(t){var a=this,u=b(a),h=getEntry(a,t);if(h){var m=h.next,g=h.previous;delete u.index[h.index],h.removed=!0,g&&(g.next=m),m&&(m.previous=g),u.first==h&&(u.first=m),u.last==h&&(u.last=g),E?u.size--:a.size--}return!!h},forEach:function forEach(t){for(var a,u=b(this),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);a=a?a.next:u.first;)for(h(a.value,a.key,this);a&&a.removed;)a=a.previous},has:function has(t){return!!getEntry(this,t)}}),defineBuiltIns(g,u?{get:function get(t){var a=getEntry(this,t);return a&&a.value},set:function set(t,a){return define(this,0===t?0:t,a)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}}),E&&Is(g,"size",{get:function(){return b(this).size}}),m},setStrong:function(t,a,u){var h=a+" Iterator",m=Rs(a),g=Rs(h);iteratorDefine(t,a,(function(t,a){js(this,{type:h,target:t,state:m(t),kind:a,last:void 0})}),(function(){for(var t=g(this),a=t.kind,u=t.last;u&&u.removed;)u=u.previous;return t.target&&(t.last=u=u?u.next:t.state.first)?"keys"==a?{value:u.key,done:!1}:"values"==a?{value:u.value,done:!1}:{value:[u.key,u.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),u?"entries":"values",!u,!0),setSpecies(a)}};!function(t,a,u){var h,g=-1!==t.indexOf("Map"),b=-1!==t.indexOf("Weak"),w=g?"set":"add",x=m[t],k=x&&x.prototype,S={};if(E&&isCallable(x)&&(b||k.forEach&&!fails((function(){(new x).entries().next()})))){var _=(h=a((function(a,u){Ps(anInstance(a,_),{type:t,collection:new x}),null!=u&&iterate(u,a[w],{that:a,AS_ENTRIES:g})}))).prototype,C=Os(t);Es(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(t){var a="add"==t||"set"==t;!(t in k)||b&&"clear"==t||He(_,t,(function(u,h){var m=C(this).collection;if(!a&&b&&!G(u))return"get"==t&&void 0;var g=m[t](0===u?0:u,h);return a?this:g}))})),b||Ms(_,"size",{configurable:!0,get:function(){return C(this).collection.size}})}else h=u.getConstructor(a,t,g,w),Ts.enable();setToStringTag(h,t,!1,!0),S[t]=h,_export({global:!0,forced:!0},S),b||u.setStrong(h,t,g)}("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),Ls);var Fs=H.Map,Ns=[].push;_export({target:"Map",stat:!0,forced:!0},{from:function from(t){var a,u,h,m,g=arguments.length,b=g>1?arguments[1]:void 0;return aConstructor(this),(a=void 0!==b)&&aCallable(b),isNullOrUndefined(t)?new this:(u=[],a?(h=0,m=functionBindContext(b,g>2?arguments[2]:void 0),iterate(t,(function(t){O(Ns,u,m(t,h++))}))):iterate(t,Ns,{that:u}),new this(u))}});_export({target:"Map",stat:!0,forced:!0},{of:function of(){return new this(mt(arguments))}});_export({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function deleteAll(){for(var t,a=anObject(this),u=aCallable(a.delete),h=!0,m=0,g=arguments.length;m<g;m++)t=O(u,a,arguments[m]),h=h&&t;return!!h}});_export({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function emplace(t,a){var u,h,m=anObject(this),g=aCallable(m.get),b=aCallable(m.has),w=aCallable(m.set);return O(b,m,t)?(u=O(g,m,t),"update"in a&&(u=a.update(u,t,m),O(w,m,t,u)),u):(h=a.insert(t,m),O(w,m,t,h),h)}});var Us=getIterator;_export({target:"Map",proto:!0,real:!0,forced:!0},{every:function every(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return!iterate(u,(function(t,u,m){if(!h(u,t,a))return m()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{filter:function filter(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(u,(function(t,u){h(u,t,a)&&O(g,m,t,u)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{find:function find(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(u,(function(t,u,m){if(h(u,t,a))return m(u)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function findKey(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(u,(function(t,u,m){if(h(u,t,a))return m(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});var Ds=M([].push);_export({target:"Map",stat:!0,forced:!0},{groupBy:function groupBy(t,a){aCallable(a);var u=getIterator(t),h=new this,m=aCallable(h.has),g=aCallable(h.get),b=aCallable(h.set);return iterate(u,(function(t){var u=a(t);O(m,h,u)?Ds(O(g,h,u),t):O(b,h,u,[t])}),{IS_ITERATOR:!0}),h}});_export({target:"Map",proto:!0,real:!0,forced:!0},{includes:function includes(t){return iterate(Us(anObject(this)),(function(a,u,h){if((m=u)===(g=t)||m!=m&&g!=g)return h();var m,g}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",stat:!0,forced:!0},{keyBy:function keyBy(t,a){var u=new this;aCallable(a);var h=aCallable(u.set);return iterate(t,(function(t){O(h,u,a(t),t)})),u}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function keyOf(t){return iterate(Us(anObject(this)),(function(a,u,h){if(u===t)return h(a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function mapKeys(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(u,(function(t,u){O(g,m,h(u,t,a),u)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function mapValues(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(u,(function(t,u){O(g,m,t,h(u,t,a))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function merge(t){for(var a=anObject(this),u=aCallable(a.set),h=arguments.length,m=0;m<h;)iterate(arguments[m++],u,{that:a,AS_ENTRIES:!0});return a}});var Bs=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function reduce(t){var a=anObject(this),u=Us(a),h=arguments.length<2,m=h?void 0:arguments[1];if(aCallable(t),iterate(u,(function(u,g){h?(h=!1,m=g):m=t(m,g,u,a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),h)throw Bs("Reduce of empty map with no initial value");return m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{some:function some(t){var a=anObject(this),u=Us(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(u,(function(t,u,m){if(h(u,t,a))return m()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var qs=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{update:function update(t,a){var u=anObject(this),h=aCallable(u.get),m=aCallable(u.has),g=aCallable(u.set),b=arguments.length;aCallable(a);var w=O(m,u,t);if(!w&&b<3)throw qs("Updating absent value");var x=w?O(h,u,t):aCallable(b>2?arguments[2]:void 0)(t,u);return O(g,u,t,a(x,t,u)),u}});var Gs=TypeError,Hs=function upsert(t,a){var u,h=anObject(this),m=aCallable(h.get),g=aCallable(h.has),b=aCallable(h.set),w=arguments.length>2?arguments[2]:void 0;if(!isCallable(a)&&!isCallable(w))throw Gs("At least one callback required");return O(g,h,t)?(u=O(m,h,t),isCallable(a)&&(u=a(u),O(b,h,t,u))):isCallable(w)&&(u=w(),O(b,h,t,u)),u};_export({target:"Map",proto:!0,real:!0,forced:!0},{upsert:Hs}),_export({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:Hs});var zs=Fs,Ks=createCommonjsModule((function(t){function _getPrototypeOf(a){var u;return t.exports=_getPrototypeOf=ht?bind$1(u=ba).call(u):function _getPrototypeOf(t){return t.__proto__||ba(t)},t.exports.__esModule=!0,t.exports.default=t.exports,_getPrototypeOf(a)}t.exports=_getPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),$s=createCommonjsModule((function(t){t.exports=function _isNativeFunction(t){var a;return-1!==indexOf(a=Function.toString.call(t)).call(a,"[native code]")},t.exports.__esModule=!0,t.exports.default=t.exports})),Ws=getBuiltIn("Reflect","construct"),Vs=Object.prototype,Qs=[].push,Js=fails((function(){function F(){}return!(Ws((function(){}),[],F)instanceof F)})),Ys=!fails((function(){Ws((function(){}))})),Xs=Js||Ys;_export({target:"Reflect",stat:!0,forced:Xs,sham:Xs},{construct:function construct(t,a){aConstructor(t),anObject(a);var u=arguments.length<3?t:aConstructor(arguments[2]);if(Ys&&!Js)return Ws(t,a,u);if(t==u){switch(a.length){case 0:return new t;case 1:return new t(a[0]);case 2:return new t(a[0],a[1]);case 3:return new t(a[0],a[1],a[2]);case 4:return new t(a[0],a[1],a[2],a[3])}var h=[null];return k(Qs,h,a),new(k(wt,t,h))}var m=u.prototype,g=ct(G(m)?m:Vs),b=k(t,g,a);return G(b)?b:g}});var Zs=H.Reflect.construct,ec=createCommonjsModule((function(t){t.exports=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Zs)return!1;if(Zs.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Zs(Boolean,[],(function(){}))),!0}catch(t){return!1}},t.exports.__esModule=!0,t.exports.default=t.exports})),tc=createCommonjsModule((function(t){function _construct(a,u,h){var m;ec()?(t.exports=_construct=bind$1(m=Zs).call(m),t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=_construct=function _construct(t,a,u){var h=[null];h.push.apply(h,a);var m=new(bind$1(Function).apply(t,h));return u&&St(m,u.prototype),m},t.exports.__esModule=!0,t.exports.default=t.exports);return _construct.apply(null,arguments)}t.exports=_construct,t.exports.__esModule=!0,t.exports.default=t.exports})),rc=createCommonjsModule((function(t){function _wrapNativeSuper(a){var u="function"==typeof zs?new zs:void 0;return t.exports=_wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!$s(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==u){if(u.has(t))return u.get(t);u.set(t,Wrapper)}function Wrapper(){return tc(t,arguments,Ks(this).constructor)}return Wrapper.prototype=lt(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),St(Wrapper,t)},t.exports.__esModule=!0,t.exports.default=t.exports,_wrapNativeSuper(a)}t.exports=_wrapNativeSuper,t.exports.__esModule=!0,t.exports.default=t.exports})),nc=getDefaultExportFromCjs(rc),oc=function(t){function CustomError(a,u,h){var m;return void 0===u&&(u={}),void 0===h&&(h=400),(m=t.call(this,a)||this).data=u,m.code=h,m.name="customError",m}return _t(CustomError,t),CustomError}(nc(Error)),ic=function(t){function ValidateError(a,u,h){var m;return void 0===u&&(u={}),(m=t.call(this,a,u,414)||this).code=414,m.name="validateError",m.rules=h,m}return _t(ValidateError,t),ValidateError}(oc),ac={200:null,406:null,808:null,810:null,201:"The client version is incorrect. You need to upgrade the SDK",302:"The user name or password is incorrect. Please check whether the appkey and token are valid and whether the account and token match",403:"Illegal operation or no permission",404:"Target object does not exist",405:"Parameter length too long",408:"Client request timed out",414:"Request parameter error",415:"Service unavailable",416:"Frequency control",417:"Repeat operation",422:"Account disabled",500:"Server internal error",503:"Server busy",508:"Expiration date",509:"Invalid",7101:"Be pulled black",700:"Partial failure of batch operation",801:"The number of people in the team has reached the upper limit",802:"No permission",803:"The team does not exist or has not changed",804:"The user is not in the team",805:"Team type mismatch",806:"The number of teams created has reached the limit",807:"Team member not valid",809:"Already in the team",811:"The number of accounts in the forced push list exceeds the limit",812:"The team is muted",813:"Due to the limited number of team, some pull people successfully",814:"Disable team message read service",815:"Maximum number of team administrators",816:"Batch operation partial failure",997:"The packet has expired",998:"Deserialize packet error",999:"Serialize packet error",9102:"Channel failure",9103:"This call has been answered / rejected at another end",10201:"Signaling: target NIM client is offline",10202:"Signaling: push is unreachable",10404:"Signaling: channel not exists",10405:"Signaling: channel already exists",10406:"Signaling: member of channel not exists",10407:"Signaling: member of channel already exists",10408:"Signaling: the invitation request does not exist or has expired",10409:"Signaling: the invitation request has been rejected",10410:"Signaling: the invitation request has been accepted",10414:"Signaling: request parameter error",10417:"Signaling: uid conflict",10419:"Signaling: the number of members of channel exceed the limit",10420:"Signaling: member is already in the channel on other client",10700:"Signaling: phased success",13002:"Abnormal chatroom status",13003:"In the blacklist",13004:"In the mute list",13006:"All members are muted, and only the administrator can speak"},sc=function(t){function CmdError(a,u,h,m,g){var b;return void 0===h&&(h=""),void 0===m&&(m=(new Date).getTime()),void 0===g&&(g={}),h=h||ac[a],(b=t.call(this,h,g,a)||this).name="cmdError",b.cmd=u,b.timetag=m,b}return _t(CmdError,t),CmdError}(oc);var cc=function(t){function UploadError(a,u,h,m,g){var b;return(b=t.call(this,a,{file:g},400)||this).name="uploadError",b.rawError=u,b.curProvider=h||1,b.mixStorePolicy=m,b}return _t(UploadError,t),UploadError}(oc),uc="object"==typeof t&&t&&t.Object===Object&&t,lc="object"==typeof self&&self&&self.Object===Object&&self,fc=uc||lc||Function("return this")(),pc=fc.Symbol,dc=Object.prototype,hc=dc.hasOwnProperty,mc=dc.toString,gc=pc?pc.toStringTag:void 0;var vc=function getRawTag(t){var a=hc.call(t,gc),u=t[gc];try{t[gc]=void 0;var h=!0}catch(t){}var m=mc.call(t);return h&&(a?t[gc]=u:delete t[gc]),m},yc=Object.prototype.toString;var bc=function objectToString(t){return yc.call(t)},wc=pc?pc.toStringTag:void 0;var xc=function baseGetTag(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":wc&&wc in Object(t)?vc(t):bc(t)};var kc=function isObject(t){var a=typeof t;return null!=t&&("object"==a||"function"==a)};var Sc=function isFunction(t){if(!kc(t))return!1;var a=xc(t);return"[object Function]"==a||"[object GeneratorFunction]"==a||"[object AsyncFunction]"==a||"[object Proxy]"==a},_c=fc["__core-js_shared__"],Cc=function(){var t=/[^.]+$/.exec(_c&&_c.keys&&_c.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var Tc=function isMasked(t){return!!Cc&&Cc in t},Mc=Function.prototype.toString;var Ec=function toSource(t){if(null!=t){try{return Mc.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Pc=/^\[object .+?Constructor\]$/,Oc=Function.prototype,Ic=Object.prototype,Ac=Oc.toString,jc=Ic.hasOwnProperty,Rc=RegExp("^"+Ac.call(jc).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Lc=function baseIsNative(t){return!(!kc(t)||Tc(t))&&(Sc(t)?Rc:Pc).test(Ec(t))};var Fc=function getValue(t,a){return null==t?void 0:t[a]};var Nc=function getNative(t,a){var u=Fc(t,a);return Lc(u)?u:void 0},Uc=function(){try{var t=Nc(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Dc=function baseAssignValue(t,a,u){"__proto__"==a&&Uc?Uc(t,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):t[a]=u};var Bc=function eq(t,a){return t===a||t!=t&&a!=a},qc=Object.prototype.hasOwnProperty;var Gc=function assignValue(t,a,u){var h=t[a];qc.call(t,a)&&Bc(h,u)&&(void 0!==u||a in t)||Dc(t,a,u)};var Hc=function copyObject(t,a,u,h){var m=!u;u||(u={});for(var g=-1,b=a.length;++g<b;){var w=a[g],x=h?h(u[w],t[w],w,u,t):void 0;void 0===x&&(x=t[w]),m?Dc(u,w,x):Gc(u,w,x)}return u};var zc=function identity(t){return t};var Kc=function apply(t,a,u){switch(u.length){case 0:return t.call(a);case 1:return t.call(a,u[0]);case 2:return t.call(a,u[0],u[1]);case 3:return t.call(a,u[0],u[1],u[2])}return t.apply(a,u)},$c=Math.max;var Wc=function overRest(t,a,u){return a=$c(void 0===a?t.length-1:a,0),function(){for(var h=arguments,m=-1,g=$c(h.length-a,0),b=Array(g);++m<g;)b[m]=h[a+m];m=-1;for(var w=Array(a+1);++m<a;)w[m]=h[m];return w[a]=u(b),Kc(t,this,w)}};var Vc=function constant(t){return function(){return t}},Qc=Uc?function(t,a){return Uc(t,"toString",{configurable:!0,enumerable:!1,value:Vc(a),writable:!0})}:zc,Jc=Date.now;var Yc=function shortOut(t){var a=0,u=0;return function(){var h=Jc(),m=16-(h-u);if(u=h,m>0){if(++a>=800)return arguments[0]}else a=0;return t.apply(void 0,arguments)}},Xc=Yc(Qc);var Zc=function baseRest(t,a){return Xc(Wc(t,a,zc),t+"")};var eu=function isLength(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var tu=function isArrayLike(t){return null!=t&&eu(t.length)&&!Sc(t)},ru=/^(?:0|[1-9]\d*)$/;var nu=function isIndex(t,a){var u=typeof t;return!!(a=null==a?9007199254740991:a)&&("number"==u||"symbol"!=u&&ru.test(t))&&t>-1&&t%1==0&&t<a};var ou=function isIterateeCall(t,a,u){if(!kc(u))return!1;var h=typeof a;return!!("number"==h?tu(u)&&nu(a,u.length):"string"==h&&a in u)&&Bc(u[a],t)};var iu=function createAssigner(t){return Zc((function(a,u){var h=-1,m=u.length,g=m>1?u[m-1]:void 0,b=m>2?u[2]:void 0;for(g=t.length>3&&"function"==typeof g?(m--,g):void 0,b&&ou(u[0],u[1],b)&&(g=m<3?void 0:g,m=1),a=Object(a);++h<m;){var w=u[h];w&&t(a,w,h,g)}return a}))};var au=function baseTimes(t,a){for(var u=-1,h=Array(t);++u<t;)h[u]=a(u);return h};var su=function isObjectLike(t){return null!=t&&"object"==typeof t};var cu=function baseIsArguments(t){return su(t)&&"[object Arguments]"==xc(t)},uu=Object.prototype,lu=uu.hasOwnProperty,fu=uu.propertyIsEnumerable,pu=cu(function(){return arguments}())?cu:function(t){return su(t)&&lu.call(t,"callee")&&!fu.call(t,"callee")},du=pu,hu=Array.isArray;var mu=function stubFalse(){return!1},gu=createCommonjsModule((function(t,a){var u=a&&!a.nodeType&&a,h=u&&t&&!t.nodeType&&t,m=h&&h.exports===u?fc.Buffer:void 0,g=(m?m.isBuffer:void 0)||mu;t.exports=g})),vu={};vu["[object Float32Array]"]=vu["[object Float64Array]"]=vu["[object Int8Array]"]=vu["[object Int16Array]"]=vu["[object Int32Array]"]=vu["[object Uint8Array]"]=vu["[object Uint8ClampedArray]"]=vu["[object Uint16Array]"]=vu["[object Uint32Array]"]=!0,vu["[object Arguments]"]=vu["[object Array]"]=vu["[object ArrayBuffer]"]=vu["[object Boolean]"]=vu["[object DataView]"]=vu["[object Date]"]=vu["[object Error]"]=vu["[object Function]"]=vu["[object Map]"]=vu["[object Number]"]=vu["[object Object]"]=vu["[object RegExp]"]=vu["[object Set]"]=vu["[object String]"]=vu["[object WeakMap]"]=!1;var yu=function baseIsTypedArray(t){return su(t)&&eu(t.length)&&!!vu[xc(t)]};var bu=function baseUnary(t){return function(a){return t(a)}},wu=createCommonjsModule((function(t,a){var u=a&&!a.nodeType&&a,h=u&&t&&!t.nodeType&&t,m=h&&h.exports===u&&uc.process,g=function(){try{var t=h&&h.require&&h.require("util").types;return t||m&&m.binding&&m.binding("util")}catch(t){}}();t.exports=g})),xu=wu&&wu.isTypedArray,ku=xu?bu(xu):yu,Su=Object.prototype.hasOwnProperty;var _u=function arrayLikeKeys(t,a){var u=hu(t),h=!u&&du(t),m=!u&&!h&&gu(t),g=!u&&!h&&!m&&ku(t),b=u||h||m||g,w=b?au(t.length,String):[],x=w.length;for(var k in t)!a&&!Su.call(t,k)||b&&("length"==k||m&&("offset"==k||"parent"==k)||g&&("buffer"==k||"byteLength"==k||"byteOffset"==k)||nu(k,x))||w.push(k);return w},Cu=Object.prototype;var Tu=function isPrototype(t){var a=t&&t.constructor;return t===("function"==typeof a&&a.prototype||Cu)};var Mu=function overArg(t,a){return function(u){return t(a(u))}},Eu=Mu(Object.keys,Object),Pu=Object.prototype.hasOwnProperty;var Ou=function baseKeys(t){if(!Tu(t))return Eu(t);var a=[];for(var u in Object(t))Pu.call(t,u)&&"constructor"!=u&&a.push(u);return a};var Iu=function keys(t){return tu(t)?_u(t):Ou(t)};iu((function(t,a,u,h){Hc(a,Iu(a),t,h)}));var Au,ju=function isUndefined(t){return void 0===t},Ru=(Au=function _s4(){return(65536*(1+Math.random())|0).toString(16).substring(1)},function(){return Au()+Au()+Au()+Au()+Au()+Au()+Au()+Au()});function getEnumKeys(t){var a;return filter(a=$a(t)).call(a,(function(t){return!(+t>=0)}))}function getEnumKeyByEnumValue(t,a){var u,h=filter(u=$a(t)).call(u,(function(u){return t[u]==a}));return h.length>0?h[0]:void 0}function emptyFuncWithPromise(){return Jo.resolve()}var Lu=TypeError,createMethod=function(t){return function(a,u,h,m){aCallable(u);var g=toObject(a),b=D(g),w=lengthOfArrayLike(g),x=t?w-1:0,k=t?-1:1;if(h<2)for(;;){if(x in b){m=b[x],x+=k;break}if(x+=k,t?x<0:w<=x)throw Lu("Reduce of empty array with no initial value")}for(;t?x>=0:w>x;x+=k)x in b&&(m=u(m,b[x],x,g));return m}},Fu={left:createMethod(!1),right:createMethod(!0)}.left,Nu=arrayMethodIsStrict("reduce");_export({target:"Array",proto:!0,forced:!Nu||!Qr&&Y>79&&Y<83},{reduce:function reduce(t){var a=arguments.length;return Fu(this,t,a,a>1?arguments[1]:void 0)}});var Uu=entryVirtual("Array").reduce,Du=Array.prototype,reduce=function(t){var a=t.reduce;return t===Du||z(Du,t)&&a===Du.reduce?Uu:a},Bu={},qu={};function parseCmd(t,a){var u,h,m;try{m=JSON.parse(t)}catch(u){throw a.error("Parse command error: ",t),u}var g=m.sid+"_"+m.cid,b=m.r;if(includes(u=["4_1","4_2","4_10","4_11"]).call(u,g)){var w=m.r[1].headerPacket;g=w.sid+"_"+w.cid,b=m.r[1].body}var x,k=qu[g],S=Bu[k],_=function genCmdError(t,a){var u=ac[t];return null===u?null:new sc(t,a,u,(new Date).getTime())}(m.code,k),C={cmd:k,raw:m,error:_,service:null==S?void 0:S.service,content:{}};if(C.error){if(C.error.cmd=k,C.error.callFunc="parseCmd",!(null===(h=null==S?void 0:S.ignoreErrCodes)||void 0===h?void 0:includes(h).call(h,m.code)))return C;a.warn("parseCmd:: ignore error ",C.error),C.error.ignore=!0}if(!k||!S)return C.notFound=!0,C;S.response&&forEach$1(x=S.response).call(x,(function(t,a){var u=b[a],h=t.type,m=t.name,g=t.reflectMapper;if(!ju(u))switch(h){case"Property":C.content[m]=g?deserialize(u,g):u;break;case"PropertyArray":C.content[m]=map$6(u).call(u,(function(t){return g?deserialize(t,g):t}));break;case"long":case"Long":case"byte":case"Byte":case"Number":C.content[m]=+u;break;default:C.content[m]=u}}));return C}function serialize(t,a){var u={};for(var h in t)void 0!==a[h]&&(u[a[h]]=t[h]);return u}function deserialize(t,a){var u={};for(var h in t)void 0!==a[h]&&(u[a[h]]=t[h]);return u}function registerParser(t){Bu=Ot(Bu,t.cmdConfig),qu=Ot(qu,t.cmdMap)}function invertSerializeMap(t){var a;return reduce(a=$a(t)).call(a,(function(a,u){var h,m=t[u];return a[u]=reduce(h=$a(m)).call(h,(function(t,a){return t[m[a]]=a,t}),{}),a}),{})}H.JSON||(H.JSON={stringify:JSON.stringify});var Gu=function stringify(t,a,u){return k(H.JSON.stringify,null,arguments)},Hu=Gu,zu=entryVirtual("Array").values,Ku=Array.prototype,$u={DOMTokenList:!0,NodeList:!0},values=function(t){var a=t.values;return t===Ku||z(Ku,t)&&a===Ku.values||fe($u,Zt(t))?zu:a};_export({target:"Array",stat:!0},{isArray:ei});var Wu=H.Array.isArray,Vu=Ci.every,Qu=arrayMethodIsStrict("every");_export({target:"Array",proto:!0,forced:!Qu},{every:function every(t){return Vu(this,t,arguments.length>1?arguments[1]:void 0)}});var Ju=entryVirtual("Array").every,Yu=Array.prototype,every=function(t){var a=t.every;return t===Yu||z(Yu,t)&&a===Yu.every?Ju:a};var Xu=function baseIsRegExp(t){return su(t)&&"[object RegExp]"==xc(t)},Zu=wu&&wu.isRegExp,el=Zu?bu(Zu):Xu,tl=Nc(Object,"create");var rl=function hashClear(){this.__data__=tl?tl(null):{},this.size=0};var nl=function hashDelete(t){var a=this.has(t)&&delete this.__data__[t];return this.size-=a?1:0,a},ol=Object.prototype.hasOwnProperty;var il=function hashGet(t){var a=this.__data__;if(tl){var u=a[t];return"__lodash_hash_undefined__"===u?void 0:u}return ol.call(a,t)?a[t]:void 0},al=Object.prototype.hasOwnProperty;var sl=function hashHas(t){var a=this.__data__;return tl?void 0!==a[t]:al.call(a,t)};var cl=function hashSet(t,a){var u=this.__data__;return this.size+=this.has(t)?0:1,u[t]=tl&&void 0===a?"__lodash_hash_undefined__":a,this};function Hash(t){var a=-1,u=null==t?0:t.length;for(this.clear();++a<u;){var h=t[a];this.set(h[0],h[1])}}Hash.prototype.clear=rl,Hash.prototype.delete=nl,Hash.prototype.get=il,Hash.prototype.has=sl,Hash.prototype.set=cl;var ul=Hash;var ll=function listCacheClear(){this.__data__=[],this.size=0};var fl=function assocIndexOf(t,a){for(var u=t.length;u--;)if(Bc(t[u][0],a))return u;return-1},pl=Array.prototype.splice;var dl=function listCacheDelete(t){var a=this.__data__,u=fl(a,t);return!(u<0)&&(u==a.length-1?a.pop():pl.call(a,u,1),--this.size,!0)};var hl=function listCacheGet(t){var a=this.__data__,u=fl(a,t);return u<0?void 0:a[u][1]};var ml=function listCacheHas(t){return fl(this.__data__,t)>-1};var gl=function listCacheSet(t,a){var u=this.__data__,h=fl(u,t);return h<0?(++this.size,u.push([t,a])):u[h][1]=a,this};function ListCache(t){var a=-1,u=null==t?0:t.length;for(this.clear();++a<u;){var h=t[a];this.set(h[0],h[1])}}ListCache.prototype.clear=ll,ListCache.prototype.delete=dl,ListCache.prototype.get=hl,ListCache.prototype.has=ml,ListCache.prototype.set=gl;var vl=ListCache,yl=Nc(fc,"Map");var bl=function mapCacheClear(){this.size=0,this.__data__={hash:new ul,map:new(yl||vl),string:new ul}};var wl=function isKeyable(t){var a=typeof t;return"string"==a||"number"==a||"symbol"==a||"boolean"==a?"__proto__"!==t:null===t};var xl=function getMapData(t,a){var u=t.__data__;return wl(a)?u["string"==typeof a?"string":"hash"]:u.map};var kl=function mapCacheDelete(t){var a=xl(this,t).delete(t);return this.size-=a?1:0,a};var Sl=function mapCacheGet(t){return xl(this,t).get(t)};var _l=function mapCacheHas(t){return xl(this,t).has(t)};var Cl=function mapCacheSet(t,a){var u=xl(this,t),h=u.size;return u.set(t,a),this.size+=u.size==h?0:1,this};function MapCache(t){var a=-1,u=null==t?0:t.length;for(this.clear();++a<u;){var h=t[a];this.set(h[0],h[1])}}MapCache.prototype.clear=bl,MapCache.prototype.delete=kl,MapCache.prototype.get=Sl,MapCache.prototype.has=_l,MapCache.prototype.set=Cl;var Tl=MapCache;var Ml=function setCacheAdd(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var El=function setCacheHas(t){return this.__data__.has(t)};function SetCache(t){var a=-1,u=null==t?0:t.length;for(this.__data__=new Tl;++a<u;)this.add(t[a])}SetCache.prototype.add=SetCache.prototype.push=Ml,SetCache.prototype.has=El;var Pl=SetCache;var Ol=function baseFindIndex(t,a,u,h){for(var m=t.length,g=u+(h?1:-1);h?g--:++g<m;)if(a(t[g],g,t))return g;return-1};var Il=function baseIsNaN(t){return t!=t};var Al=function strictIndexOf(t,a,u){for(var h=u-1,m=t.length;++h<m;)if(t[h]===a)return h;return-1};var jl=function baseIndexOf(t,a,u){return a==a?Al(t,a,u):Ol(t,Il,u)};var Rl=function arrayIncludes(t,a){return!!(null==t?0:t.length)&&jl(t,a,0)>-1};var Ll=function arrayIncludesWith(t,a,u){for(var h=-1,m=null==t?0:t.length;++h<m;)if(u(a,t[h]))return!0;return!1};var Fl=function arrayMap(t,a){for(var u=-1,h=null==t?0:t.length,m=Array(h);++u<h;)m[u]=a(t[u],u,t);return m};var Nl=function cacheHas(t,a){return t.has(a)};var Ul=function baseDifference(t,a,u,h){var m=-1,g=Rl,b=!0,w=t.length,x=[],k=a.length;if(!w)return x;u&&(a=Fl(a,bu(u))),h?(g=Ll,b=!1):a.length>=200&&(g=Nl,b=!1,a=new Pl(a));e:for(;++m<w;){var S=t[m],_=null==u?S:u(S);if(S=h||0!==S?S:0,b&&_==_){for(var C=k;C--;)if(a[C]===_)continue e;x.push(S)}else g(a,_,h)||x.push(S)}return x};var Dl=function isArrayLikeObject(t){return su(t)&&tu(t)},Bl=Zc((function(t,a){return Dl(t)?Ul(t,a):[]})),ql=Bl;function replacer(t,a){return a instanceof RegExp?"__REGEXP "+a.toString():a}function validate(t,a,u){var h;void 0===a&&(a={});var m={};return forEach$1(h=$a(t)).call(h,(function(h){var g=t[h].type,b=u?"In "+u+", ":"";if(void 0===a[h]){if(!1===t[h].required)return void(m[h]=a[h]);throw new ic(b+'param "'+h+'" is required',{key:h},"required")}var w=Gl[g];if(w&&!w(a,h,t[h]))throw new ic(b+'param "'+h+'" expects '+Hu(t[h],replacer),{key:h,value:a[h]},Hu(t[h]));m[h]=a[h]})),m}var Gl={string:function string(t,a,u){var h=u.allowEmpty,m=u.max,g=u.min,b=u.regExp,w=t[a];return"string"==typeof w&&((!1!==h||""!==w)&&(!("number"==typeof m&&w.length>m)&&(!("number"==typeof g&&w.length<g)&&!(el(b)&&!b.test(w)))))},number:function number(t,a,u){var h=u.min,m=u.max,g=t[a];return"number"==typeof g&&(!("number"==typeof h&&g<h)&&!("number"==typeof m&&g>m))},boolean:function boolean(t,a){return"boolean"==typeof t[a]},enum:function _enum(t,a,u){var h=values(u),m=t[a];return!h||indexOf(h).call(h,m)>-1},array:function array(t,a,u){var h,m=u.itemType,g=u.rules,b=u.min,w=u.max,x=values(u),k=t[a];return!!Wu(k)&&(!("number"==typeof w&&k.length>w)&&(!("number"==typeof b&&k.length<b)&&(!(m&&"enum"!==m&&!every(k).call(k,(function(t){return typeof t===m})))&&(("enum"!==m||!x||!ql.apply(void 0,concat(h=[k]).call(h,x)).length)&&(g&&forEach$1(k).call(k,(function(t,u){return validate(g,t,a+"["+u+"]")})),!0)))))},object:function object(t,a,u){var h=u.rules,m=t[a];return h&&validate(h,m,a),!0}},Hl=Ci.findIndex,zl="findIndex",Kl=!0;zl in[]&&Array(1).findIndex((function(){Kl=!1})),_export({target:"Array",proto:!0,forced:Kl},{findIndex:function findIndex(t){return Hl(this,t,arguments.length>1?arguments[1]:void 0)}});var $l=entryVirtual("Array").findIndex,Wl=Array.prototype,findIndex=function(t){var a=t.findIndex;return t===Wl||z(Wl,t)&&a===Wl.findIndex?$l:a},Vl=["error","warn","log","debug"],Ql=function emptyFunc(){},Jl=["off","error","warn","log","debug"],Yl=function(){function Logger(t,a){this.name=a,this.strategies={debug:console.log,log:console.log,warn:console.warn,error:console.error},this.debug=Ql,this.log=Ql,this.warn=Ql,this.error=Ql,this.name=a,Logger.instancesName.push(a),includes(Jl).call(Jl,t)||(t="off"),this.setLogFunc(t)}var t=Logger.prototype;return t.setLogFunc=function setLogFunc(t){var a=this,u=findIndex(Vl).call(Vl,(function(a){return a===t}));forEach$1(Vl).call(Vl,(function(t,h){h<=u&&(a[t]=function(){var a=slice(Array.prototype).call(arguments),u=this.formatArgs(a,t);this.strategies[t](u)})}))},t.formatArgs=function formatArgs(t,a){var u=new Date,h=u.getMonth()+1+"-"+u.getDate()+" "+u.getHours()+":"+u.getMinutes()+":"+u.getSeconds()+":"+u.getMilliseconds();return"[NIM "+a+" "+this.name+" "+h+"] "+map$6(t).call(t,(function(t){return t instanceof oc?t.name+", "+t.code+", "+t.message:t instanceof Error?t&&t.message?t.message:t:"object"==typeof t?Hu(t):t})).join(" ")},t.destroy=function destroy(){this.debug=Ql,this.log=Ql,this.warn=Ql,this.error=Ql},Logger}();Yl.instancesName=[];var Xl=ki.f("iterator"),Zl=createCommonjsModule((function(t){function _typeof(a){return t.exports=_typeof="function"==typeof ha&&"symbol"==typeof Xl?function(t){return typeof t}:function(t){return t&&"function"==typeof ha&&t.constructor===ha&&t!==ha.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,_typeof(a)}t.exports=_typeof,t.exports.__esModule=!0,t.exports.default=t.exports})),ef=createCommonjsModule((function(t){var a=Zl.default;function _regeneratorRuntime(){t.exports=_regeneratorRuntime=function _regeneratorRuntime(){return u},t.exports.__esModule=!0,t.exports.default=t.exports;var u={},h=Object.prototype,m=h.hasOwnProperty,g="function"==typeof ha?ha:{},b=g.iterator||"@@iterator",w=g.asyncIterator||"@@asyncIterator",x=g.toStringTag||"@@toStringTag";function define(t,a,u){return va(t,a,{value:u,enumerable:!0,configurable:!0,writable:!0}),t[a]}try{define({},"")}catch(t){define=function define(t,a,u){return t[a]=u}}function wrap(t,a,u,h){var m=a&&a.prototype instanceof Generator?a:Generator,g=lt(m.prototype),b=new Context(h||[]);return g._invoke=function(t,a,u){var h="suspendedStart";return function(m,g){if("executing"===h)throw new Error("Generator is already running");if("completed"===h){if("throw"===m)throw g;return doneResult()}for(u.method=m,u.arg=g;;){var b=u.delegate;if(b){var w=maybeInvokeDelegate(b,u);if(w){if(w===k)continue;return w}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===h)throw h="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);h="executing";var x=tryCatch(t,a,u);if("normal"===x.type){if(h=u.done?"completed":"suspendedYield",x.arg===k)continue;return{value:x.arg,done:u.done}}"throw"===x.type&&(h="completed",u.method="throw",u.arg=x.arg)}}}(t,u,b),g}function tryCatch(t,a,u){try{return{type:"normal",arg:t.call(a,u)}}catch(t){return{type:"throw",arg:t}}}u.wrap=wrap;var k={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var S={};define(S,b,(function(){return this}));var _=ba&&ba(ba(values([])));_&&_!==h&&m.call(_,b)&&(S=_);var C=GeneratorFunctionPrototype.prototype=Generator.prototype=lt(S);function defineIteratorMethods(t){var a;forEach$1(a=["next","throw","return"]).call(a,(function(a){define(t,a,(function(t){return this._invoke(a,t)}))}))}function AsyncIterator(t,u){function invoke(h,g,b,w){var x=tryCatch(t[h],t,g);if("throw"!==x.type){var k=x.arg,S=k.value;return S&&"object"==a(S)&&m.call(S,"__await")?u.resolve(S.__await).then((function(t){invoke("next",t,b,w)}),(function(t){invoke("throw",t,b,w)})):u.resolve(S).then((function(t){k.value=t,b(k)}),(function(t){return invoke("throw",t,b,w)}))}w(x.arg)}var h;this._invoke=function(t,a){function callInvokeWithMethodAndArg(){return new u((function(u,h){invoke(t,a,u,h)}))}return h=h?h.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,a){var u=t.iterator[a.method];if(void 0===u){if(a.delegate=null,"throw"===a.method){if(t.iterator.return&&(a.method="return",a.arg=void 0,maybeInvokeDelegate(t,a),"throw"===a.method))return k;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var h=tryCatch(u,t.iterator,a.arg);if("throw"===h.type)return a.method="throw",a.arg=h.arg,a.delegate=null,k;var m=h.arg;return m?m.done?(a[t.resultName]=m.value,a.next=t.nextLoc,"return"!==a.method&&(a.method="next",a.arg=void 0),a.delegate=null,k):m:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,k)}function pushTryEntry(t){var a={tryLoc:t[0]};1 in t&&(a.catchLoc=t[1]),2 in t&&(a.finallyLoc=t[2],a.afterLoc=t[3]),this.tryEntries.push(a)}function resetTryEntry(t){var a=t.completion||{};a.type="normal",delete a.arg,t.completion=a}function Context(t){this.tryEntries=[{tryLoc:"root"}],forEach$1(t).call(t,pushTryEntry,this),this.reset(!0)}function values(t){if(t){var a=t[b];if(a)return a.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var u=-1,h=function next(){for(;++u<t.length;)if(m.call(t,u))return next.value=t[u],next.done=!1,next;return next.value=void 0,next.done=!0,next};return h.next=h}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(C,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,x,"GeneratorFunction"),u.isGeneratorFunction=function(t){var a="function"==typeof t&&t.constructor;return!!a&&(a===GeneratorFunction||"GeneratorFunction"===(a.displayName||a.name))},u.mark=function(t){return ht?ht(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,x,"GeneratorFunction")),t.prototype=lt(C),t},u.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,w,(function(){return this})),u.AsyncIterator=AsyncIterator,u.async=function(t,a,h,m,g){void 0===g&&(g=Jo);var b=new AsyncIterator(wrap(t,a,h,m),g);return u.isGeneratorFunction(a)?b:b.next().then((function(t){return t.done?t.value:b.next()}))},defineIteratorMethods(C),define(C,x,"Generator"),define(C,b,(function(){return this})),define(C,"toString",(function(){return"[object Generator]"})),u.keys=function(t){var a=[];for(var u in t)a.push(u);return reverse(a).call(a),function next(){for(;a.length;){var u=a.pop();if(u in t)return next.value=u,next.done=!1,next}return next.done=!0,next}},u.values=values,Context.prototype={constructor:Context,reset:function reset(t){var a;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,forEach$1(a=this.tryEntries).call(a,resetTryEntry),!t)for(var u in this)"t"===u.charAt(0)&&m.call(this,u)&&!isNaN(+slice(u).call(u,1))&&(this[u]=void 0)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var a=this;function handle(u,h){return g.type="throw",g.arg=t,a.next=u,h&&(a.method="next",a.arg=void 0),!!h}for(var u=this.tryEntries.length-1;u>=0;--u){var h=this.tryEntries[u],g=h.completion;if("root"===h.tryLoc)return handle("end");if(h.tryLoc<=this.prev){var b=m.call(h,"catchLoc"),w=m.call(h,"finallyLoc");if(b&&w){if(this.prev<h.catchLoc)return handle(h.catchLoc,!0);if(this.prev<h.finallyLoc)return handle(h.finallyLoc)}else if(b){if(this.prev<h.catchLoc)return handle(h.catchLoc,!0)}else{if(!w)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return handle(h.finallyLoc)}}}},abrupt:function abrupt(t,a){for(var u=this.tryEntries.length-1;u>=0;--u){var h=this.tryEntries[u];if(h.tryLoc<=this.prev&&m.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var g=h;break}}g&&("break"===t||"continue"===t)&&g.tryLoc<=a&&a<=g.finallyLoc&&(g=null);var b=g?g.completion:{};return b.type=t,b.arg=a,g?(this.method="next",this.next=g.finallyLoc,k):this.complete(b)},complete:function complete(t,a){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&a&&(this.next=a),k},finish:function finish(t){for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a];if(u.finallyLoc===t)return this.complete(u.completion,u.afterLoc),resetTryEntry(u),k}},catch:function _catch(t){for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a];if(u.tryLoc===t){var h=u.completion;if("throw"===h.type){var m=h.arg;resetTryEntry(u)}return m}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,a,u){return this.delegate={iterator:values(t),resultName:a,nextLoc:u},"next"===this.method&&(this.arg=void 0),k}},u}t.exports=_regeneratorRuntime,t.exports.__esModule=!0,t.exports.default=t.exports})),tf=ef(),rf=tf;try{regeneratorRuntime=tf}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=tf:Function("r","regeneratorRuntime = r")(tf)}function __rest(t,a){var u={};for(var h in t)Object.prototype.hasOwnProperty.call(t,h)&&a.indexOf(h)<0&&(u[h]=t[h]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var m=0;for(h=Object.getOwnPropertySymbols(t);m<h.length;m++)a.indexOf(h[m])<0&&Object.prototype.propertyIsEnumerable.call(t,h[m])&&(u[h[m]]=t[h[m]])}return u}function __awaiter(t,a,u,h){return new(u||(u=Promise))((function(m,g){function fulfilled(t){try{step(h.next(t))}catch(t){g(t)}}function rejected(t){try{step(h.throw(t))}catch(t){g(t)}}function step(t){t.done?m(t.value):function adopt(t){return t instanceof u?t:new u((function(a){a(t)}))}(t.value).then(fulfilled,rejected)}step((h=h.apply(t,a||[])).next())}))}var nf=function stackClear(){this.__data__=new vl,this.size=0};var af=function stackDelete(t){var a=this.__data__,u=a.delete(t);return this.size=a.size,u};var sf=function stackGet(t){return this.__data__.get(t)};var cf=function stackHas(t){return this.__data__.has(t)};var uf=function stackSet(t,a){var u=this.__data__;if(u instanceof vl){var h=u.__data__;if(!yl||h.length<199)return h.push([t,a]),this.size=++u.size,this;u=this.__data__=new Tl(h)}return u.set(t,a),this.size=u.size,this};function Stack(t){var a=this.__data__=new vl(t);this.size=a.size}Stack.prototype.clear=nf,Stack.prototype.delete=af,Stack.prototype.get=sf,Stack.prototype.has=cf,Stack.prototype.set=uf;var lf=Stack;var ff=function assignMergeValue(t,a,u){(void 0!==u&&!Bc(t[a],u)||void 0===u&&!(a in t))&&Dc(t,a,u)};var pf=function createBaseFor(t){return function(a,u,h){for(var m=-1,g=Object(a),b=h(a),w=b.length;w--;){var x=b[t?w:++m];if(!1===u(g[x],x,g))break}return a}}(),df=createCommonjsModule((function(t,a){var u=a&&!a.nodeType&&a,h=u&&t&&!t.nodeType&&t,m=h&&h.exports===u?fc.Buffer:void 0,g=m?m.allocUnsafe:void 0;t.exports=function cloneBuffer(t,a){if(a)return t.slice();var u=t.length,h=g?g(u):new t.constructor(u);return t.copy(h),h}})),hf=fc.Uint8Array;var mf=function cloneArrayBuffer(t){var a=new t.constructor(t.byteLength);return new hf(a).set(new hf(t)),a};var gf=function cloneTypedArray(t,a){var u=a?mf(t.buffer):t.buffer;return new t.constructor(u,t.byteOffset,t.length)};var vf=function copyArray(t,a){var u=-1,h=t.length;for(a||(a=Array(h));++u<h;)a[u]=t[u];return a},yf=Object.create,bf=function(){function object(){}return function(t){if(!kc(t))return{};if(yf)return yf(t);object.prototype=t;var a=new object;return object.prototype=void 0,a}}(),wf=Mu(Object.getPrototypeOf,Object);var xf=function initCloneObject(t){return"function"!=typeof t.constructor||Tu(t)?{}:bf(wf(t))},kf=Function.prototype,Sf=Object.prototype,_f=kf.toString,Cf=Sf.hasOwnProperty,Tf=_f.call(Object);var Mf=function isPlainObject(t){if(!su(t)||"[object Object]"!=xc(t))return!1;var a=wf(t);if(null===a)return!0;var u=Cf.call(a,"constructor")&&a.constructor;return"function"==typeof u&&u instanceof u&&_f.call(u)==Tf};var Ef=function safeGet(t,a){if(("constructor"!==a||"function"!=typeof t[a])&&"__proto__"!=a)return t[a]};var Pf=function nativeKeysIn(t){var a=[];if(null!=t)for(var u in Object(t))a.push(u);return a},Of=Object.prototype.hasOwnProperty;var If=function baseKeysIn(t){if(!kc(t))return Pf(t);var a=Tu(t),u=[];for(var h in t)("constructor"!=h||!a&&Of.call(t,h))&&u.push(h);return u};var Af=function keysIn(t){return tu(t)?_u(t,!0):If(t)};var jf=function toPlainObject(t){return Hc(t,Af(t))};var Rf=function baseMergeDeep(t,a,u,h,m,g,b){var w=Ef(t,u),x=Ef(a,u),k=b.get(x);if(k)ff(t,u,k);else{var S=g?g(w,x,u+"",t,a,b):void 0,_=void 0===S;if(_){var C=hu(x),T=!C&&gu(x),M=!C&&!T&&ku(x);S=x,C||T||M?hu(w)?S=w:Dl(w)?S=vf(w):T?(_=!1,S=df(x,!0)):M?(_=!1,S=gf(x,!0)):S=[]:Mf(x)||du(x)?(S=w,du(w)?S=jf(w):kc(w)&&!Sc(w)||(S=xf(x))):_=!1}_&&(b.set(x,S),m(S,x,h,g,b),b.delete(x)),ff(t,u,S)}};var Lf=function baseMerge(t,a,u,h,m){t!==a&&pf(a,(function(g,b){if(m||(m=new lf),kc(g))Rf(t,a,b,u,baseMerge,h,m);else{var w=h?h(Ef(t,b),g,b+"",t,a,m):void 0;void 0===w&&(w=g),ff(t,b,w)}}),Af)},Ff=iu((function(t,a,u){Lf(t,a,u)})),Nf=Ci.some,Uf=arrayMethodIsStrict("some");_export({target:"Array",proto:!0,forced:!Uf},{some:function some(t){return Nf(this,t,arguments.length>1?arguments[1]:void 0)}});var Df,Bf,qf=entryVirtual("Array").some,Gf=Array.prototype,some=function(t){var a=t.some;return t===Gf||z(Gf,t)&&a===Gf.some?qf:a};!function(t){t[t.Unset=0]="Unset",t[t.RN=2]="RN",t[t.UNIAPP=3]="UNIAPP",t[t.Electron=5]="Electron",t[t.WeiXin=6]="WeiXin",t[t.BROWSER=100]="BROWSER",t[t.H5=101]="H5",t[t.Ali=102]="Ali",t[t.Baidu=103]="Baidu",t[t.Tiktok=104]="Tiktok"}(Df||(Df={})),function(t){t[t.kStatNetTypeUnkonw=0]="kStatNetTypeUnkonw",t[t.kStatNetTypeEthernet=1]="kStatNetTypeEthernet",t[t.kStatNetTypeWifi=2]="kStatNetTypeWifi",t[t.kStatNetType2G=3]="kStatNetType2G",t[t.kStatNetType3G=4]="kStatNetType3G",t[t.kStatNetType4G=5]="kStatNetType4G",t[t.kStatNetType5G=6]="kStatNetType5G"}(Bf||(Bf={}));var Hf={wifi:Bf.kStatNetTypeWifi,"2g":Bf.kStatNetType2G,"3g":Bf.kStatNetType3G,"4g":Bf.kStatNetType4G,"5g":Bf.kStatNetType5G,ethernet:Bf.kStatNetTypeEthernet,unknown:Bf.kStatNetTypeUnkonw,none:Bf.kStatNetTypeUnkonw,notreachable:Bf.kStatNetTypeUnkonw,wwan:Bf.kStatNetTypeUnkonw};function isMobile(){if(!navigator||!navigator.userAgent)return!1;var t=[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i];return some(t).call(t,(function(t){return navigator.userAgent.match(t)}))}function isElectron(){var t;return!(!navigator||!navigator.userAgent)&&("object"==typeof navigator&&"string"==typeof navigator.userAgent&&indexOf(t=navigator.userAgent).call(t,"Electron")>=0)}function isBrowser(){return navigator&&navigator.userAgent}var zf={setLogger:function setLogger(t){throw new Error("Function not implemented.")},platform:"",WebSocket:function(){function AdapterSocket(t,a){throw this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,new Error("Method not implemented.")}var t=AdapterSocket.prototype;return t.close=function close(t,a){throw new Error("Method not implemented.")},t.send=function send(t){throw new Error("Method not implemented.")},t.onclose=function onclose(t){throw new Error("Method not implemented.")},t.onerror=function onerror(t){throw new Error("Method not implemented.")},t.onmessage=function onmessage(t){throw new Error("Method not implemented.")},t.onopen=function onopen(t){throw new Error("Method not implemented.")},AdapterSocket}(),localStorage:{},request:function request(t,a){throw new Error("Function not implemented.")},uploadFile:function uploadFile(t){throw new Error("Function not implemented.")},getSystemInfo:function getSystemInfo(){throw new Error("Function not implemented.")},net:{__getEnv:function __getEnv(){return null},__onNetworkStatusChangeFn:null,getNetworkStatus:function getNetworkStatus(){var t=this.__getEnv();return new Jo((function(a,u){t.getNetworkType({success:function success(t){var u=!1;u="boolean"==typeof t.networkAvailable?t.networkAvailable:"none"!==t.networkType.toLowerCase(),a({net_type:Hf[t.networkType.toLowerCase()],net_connect:u})},fail:function fail(){u(new Error("getNetworkType failed"))}})}))},onNetworkStatusChange:function onNetworkStatusChange(t){var a=this.__getEnv();this.offNetworkStatusChange(),a.onNetworkStatusChange&&(this.__onNetworkStatusChangeFn=function(a){var u=a.networkType.toLowerCase();t({isConnected:a.isConnected||"none"!==u,networkType:Hf[u]})},a.onNetworkStatusChange(this.__onNetworkStatusChangeFn))},offNetworkStatusChange:function offNetworkStatusChange(){var t=this.__getEnv();t.offNetworkStatusChange&&(this.__onNetworkStatusChangeFn&&t.offNetworkStatusChange(this.__onNetworkStatusChangeFn),this.__onNetworkStatusChangeFn=null)}}};var Kf=function(){function CoreAdapters(t){this.lastSuccUploadHost="",this.core=t}var t=CoreAdapters.prototype;return t.request=function request(t,a,u){var h=this,m=(new Date).getTime(),g=(null==u?void 0:u.exception_service)||0;return zf.request(t,a).catch((function(u){var b,w,x=u;throw h.core.reporter.reportTraceStart("exceptions",{user_id:h.core.options.account,trace_id:null===(w=null===(b=h.core.clientSocket)||void 0===b?void 0:b.socket)||void 0===w?void 0:w.sessionId,start_time:m,action:1,exception_service:g}),h.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof x.code?x.code:0,description:x.message||""+x.code,operation_type:0,target:t,context:a?Hu(a):""},{asyncParams:zf.net.getNetworkStatus()}),h.core.reporter.reportTraceEnd("exceptions",1),u}))},t.uploadFile=function uploadFile(t){var a,u,h,m;return __awaiter(this,void 0,void 0,rf.mark((function _callee(){var g,b,w,x,k,S,_,C,T,M,E,P,O,I;return rf.wrap((function _callee$(A){for(;;)switch(A.prev=A.next){case 0:w="BROWSER"===zf.platform,x=w?t.chunkUploadHostBackupList:t.commonUploadHostBackupList,k=w?t.chunkUploadHost:t.commonUploadHost,S=indexOf(x).call(x,k),_=-1===S?concat(g=[k]).call(g,x):concat(b=[k]).call(b,slice(x).call(x,0,S),slice(x).call(x,S+1)),C=Math.max(indexOf(_).call(_,this.lastSuccUploadHost),0),T=null,M=0;case 8:if(!(M<_.length)){A.next=32;break}return E=(new Date).getTime(),P=_[(M+C)%_.length],A.prev=11,A.next=14,zf.uploadFile(Ot(Ot({},t),w?{chunkUploadHost:P}:{commonUploadHost:P}));case 14:return O=A.sent,this.lastSuccUploadHost=P,A.abrupt("return",O);case 19:if(A.prev=19,A.t0=A.catch(11),this.core.cloudStorage.nosErrorCount--,T=A.t0,I=A.t0,this.core.reporter.reportTraceStart("exceptions",{user_id:this.core.options.account||(null===(u=null===(a=this.core)||void 0===a?void 0:a.auth)||void 0===u?void 0:u.account),trace_id:null===(m=null===(h=this.core.clientSocket)||void 0===h?void 0:h.socket)||void 0===m?void 0:m.sessionId,start_time:E,action:1,exception_service:3}),this.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof I.code?I.code:0,description:I.message||""+I.code,operation_type:1,target:P},{asyncParams:zf.net.getNetworkStatus()}),this.core.reporter.reportTraceEnd("exceptions",1),!A.t0||191002!==A.t0.code&&10499!==A.t0.errCode){A.next=29;break}throw A.t0;case 29:M++,A.next=8;break;case 32:throw T;case 33:case"end":return A.stop()}}),_callee,this,[[11,19]])})))},CoreAdapters}(),$f="imElite_sdk_abtest_web",Wf="https://statistic.live.126.net,https://statistic-overseas.yunxinfw.com",Vf=function(){function ABTest(t,a){this.abtInfo={},this.core=t,this.config=a}return ABTest.prototype.abtRequest=function abtRequest(){var t,a;return __awaiter(this,void 0,void 0,rf.mark((function _callee(){var u;return rf.wrap((function _callee$(h){for(;;)switch(h.prev=h.next){case 0:if(this.core.options.isAbtestEnable){h.next=2;break}return h.abrupt("return");case 2:if(!this.abtInfo.experiments){h.next=4;break}return h.abrupt("return");case 4:if(this.config.abtestUrl){h.next=6;break}return h.abrupt("return");case 6:return h.prev=6,h.next=9,this.core.adapters.request(this.config.abtestUrl,{method:"POST",dataType:"json",headers:{sdktype:"ABTest"},data:{clientInfo:{projectKey:this.config.abtestProjectKey,appKey:this.core.options.appkey,osType:"Web",sdkVersion:"0.19.2",deviceId:this.core.config.deviceId},useLocalCache:!0}},{exception_service:7});case 9:u=h.sent,h.next=15;break;case 12:h.prev=12,h.t0=h.catch(6),this.core.logger.warn("ABTest request failed");case 15:this.abtInfo=(null===(a=null===(t=null==u?void 0:u.data)||void 0===t?void 0:t.data)||void 0===a?void 0:a.abtInfo)||{};case 16:case"end":return h.stop()}}),_callee,this,[[6,12]])})))},ABTest}(),Qf=TypeError,Jf=Object.getOwnPropertyDescriptor,Yf=E&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,a){if(ei(t)&&!Jf(t,"length").writable)throw Qf("Cannot set read only .length");return t.length=a}:function(t,a){return t.length=a},Xf=TypeError,deletePropertyOrThrow=function(t,a){if(!delete t[a])throw Xf("Cannot delete property "+tryToString(a)+" of "+tryToString(t))},Zf=arrayMethodHasSpeciesSupport("splice"),ep=Math.max,tp=Math.min;_export({target:"Array",proto:!0,forced:!Zf},{splice:function splice(t,a){var u,h,m,g,b,w,x=toObject(this),k=lengthOfArrayLike(x),S=toAbsoluteIndex(t,k),_=arguments.length;for(0===_?u=h=0:1===_?(u=0,h=k-S):(u=_-2,h=tp(ep(toIntegerOrInfinity(a),0),k-S)),doesNotExceedSafeInteger(k+u-h),m=arraySpeciesCreate(x,h),g=0;g<h;g++)(b=S+g)in x&&createProperty(m,g,x[b]);if(m.length=h,u<h){for(g=S;g<k-h;g++)w=g+u,(b=g+h)in x?x[w]=x[b]:deletePropertyOrThrow(x,w);for(g=k;g>k-h+u;g--)deletePropertyOrThrow(x,g-1)}else if(u>h)for(g=k-h;g>S;g--)w=g+u-1,(b=g+h-1)in x?x[w]=x[b]:deletePropertyOrThrow(x,w);for(g=0;g<u;g++)x[g+S]=arguments[g+2];return Yf(x,k-h+u),m}});var rp=entryVirtual("Array").splice,np=Array.prototype,splice=function(t){var a=t.splice;return t===np||z(np,t)&&a===np.splice?rp:a},callWithSafeIterationClosing=function(t,a,u,h){try{return h?a(anObject(u)[0],u[1]):a(u)}catch(a){iteratorClose(t,"throw",a)}},op=Array,ip=!checkCorrectnessOfIteration((function(t){Array.from(t)}));_export({target:"Array",stat:!0,forced:ip},{from:function from(t){var a=toObject(t),u=dn(this),h=arguments.length,m=h>1?arguments[1]:void 0,g=void 0!==m;g&&(m=functionBindContext(m,h>2?arguments[2]:void 0));var b,w,x,k,S,_,C=getIteratorMethod$5(a),T=0;if(!C||this===op&&isArrayIteratorMethod(C))for(b=lengthOfArrayLike(a),w=u?new this(b):op(b);b>T;T++)_=g?m(a[T],T):a[T],createProperty(w,T,_);else for(S=(k=getIterator(a,C)).next,w=u?new this:[];!(x=O(S,k)).done;T++)_=g?callWithSafeIterationClosing(k,m,[x.value,T],!0):x.value,createProperty(w,T,_);return w.length=T,w}});var ap=H.Array.from,sp=getIteratorMethod$5;function _createForOfIteratorHelperLoose$1(t,a){var u,h=void 0!==ha&&sp(t)||t["@@iterator"];if(h)return bind$1(u=(h=h.call(t)).next).call(u,h);if(Wu(t)||(h=function _unsupportedIterableToArray$1(t,a){var u;if(!t)return;if("string"==typeof t)return _arrayLikeToArray$1(t,a);var h=slice(u=Object.prototype.toString.call(t)).call(u,8,-1);"Object"===h&&t.constructor&&(h=t.constructor.name);if("Map"===h||"Set"===h)return ap(t);if("Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return _arrayLikeToArray$1(t,a)}(t))||a&&t&&"number"==typeof t.length){h&&(t=h);var m=0;return function(){return m>=t.length?{done:!0}:{done:!1,value:t[m++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray$1(t,a){(null==a||a>t.length)&&(a=t.length);for(var u=0,h=new Array(a);u<a;u++)h[u]=t[u];return h}var cp=function(){function TimerManager(){this.timerList=[],this.id=0,this.timer=null,this.timeout=0}var t=TimerManager.prototype;return t.addTimer=function addTimer(t,a,u){void 0===a&&(a=0),void 0===u&&(u=1);var h=(new Date).getTime(),m=this.id;return this.timerList.push({id:m,loop:u,count:0,timeout:h+a,interval:a,callback:t}),this.id++,this.checkTimer(h),m},t.checkTimer=function checkTimer(t){if(void 0===t&&(t=(new Date).getTime()),this.removeFinished(),0!==this.timerList.length||null==this.timer){for(var a,u,h=0,m=_createForOfIteratorHelperLoose$1(this.timerList);!(a=m()).done;){var g=a.value;(0===h||h>g.timeout)&&(h=g.timeout)}if(0!==this.timerList.length)if(null===this.timer||h<this.timeout||this.timeout<t)this.timer=mi(bind$1(u=this.nowTime).call(u,this),h-t),this.timeout=h}},t.nowTime=function nowTime(){for(var t,nowTime=(new Date).getTime(),a=_createForOfIteratorHelperLoose$1(this.timerList);!(t=a()).done;){var u=t.value;nowTime>=u.timeout&&(u.callback(),u.count++,u.timeout=nowTime+u.interval)}this.clerTime(),this.checkTimer(nowTime)},t.clerTime=function clerTime(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},t.deleteTimer=function deleteTimer(t){for(var a=this.timerList.length-1;a>=0;a--){var u;if(this.timerList[a].id===t)splice(u=this.timerList).call(u,a,1)}},t.removeFinished=function removeFinished(){for(var t=this.timerList.length-1;t>=0;t--){var a,u=this.timerList[t];if(u.loop>=0&&u.count>=u.loop)splice(a=this.timerList).call(a,t,1)}},t.destroy=function destroy(){this.clerTime(),this.timerList=[],this.id=0,this.timer=null},TimerManager}(),up=function(){function Service(t,a){this.name=t,this.core=a,this.name=t,this.logger=a.logger,this.core=a}return Service.prototype.process=function process(t){var a=this[t.cmd+"Handler"];return"function"==typeof a?a.call(this,t):t.error&&!t.error.ignore?Jo.reject(t.error):Jo.resolve(t)},Service}(),lp=Backoff;function Backoff(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var a=Math.random(),u=Math.floor(a*this.jitter*t);t=0==(1&Math.floor(10*a))?t-u:t+u}return 0|Math.min(t,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(t){this.ms=t},Backoff.prototype.setMax=function(t){this.max=t},Backoff.prototype.setJitter=function(t){this.jitter=t};var fp=function isSymbol(t){return"symbol"==typeof t||su(t)&&"[object Symbol]"==xc(t)},pp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dp=/^\w*$/;var hp=function isKey(t,a){if(hu(t))return!1;var u=typeof t;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=t&&!fp(t))||(dp.test(t)||!pp.test(t)||null!=a&&t in Object(a))};function memoize(t,a){if("function"!=typeof t||null!=a&&"function"!=typeof a)throw new TypeError("Expected a function");var memoized=function(){var u=arguments,h=a?a.apply(this,u):u[0],m=memoized.cache;if(m.has(h))return m.get(h);var g=t.apply(this,u);return memoized.cache=m.set(h,g)||m,g};return memoized.cache=new(memoize.Cache||Tl),memoized}memoize.Cache=Tl;var mp=memoize;var gp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vp=/\\(\\)?/g,yp=function memoizeCapped(t){var a=mp(t,(function(t){return 500===u.size&&u.clear(),t})),u=a.cache;return a}((function(t){var a=[];return 46===t.charCodeAt(0)&&a.push(""),t.replace(gp,(function(t,u,h,m){a.push(h?m.replace(vp,"$1"):u||t)})),a})),bp=yp,wp=pc?pc.prototype:void 0,xp=wp?wp.toString:void 0;var kp=function baseToString(t){if("string"==typeof t)return t;if(hu(t))return Fl(t,baseToString)+"";if(fp(t))return xp?xp.call(t):"";var a=t+"";return"0"==a&&1/t==-Infinity?"-0":a};var Sp=function toString(t){return null==t?"":kp(t)};var _p=function castPath(t,a){return hu(t)?t:hp(t,a)?[t]:bp(Sp(t))};var Cp=function toKey(t){if("string"==typeof t||fp(t))return t;var a=t+"";return"0"==a&&1/t==-Infinity?"-0":a};var Tp=function baseGet(t,a){for(var u=0,h=(a=_p(a,t)).length;null!=t&&u<h;)t=t[Cp(a[u++])];return u&&u==h?t:void 0};var Mp=function get(t,a,u){var h=null==t?void 0:Tp(t,a);return void 0===h?u:h},Ep=Nc(fc,"Set");var Pp=function noop(){};var Op=function setToArray(t){var a=-1,u=Array(t.size);return t.forEach((function(t){u[++a]=t})),u},Ip=Ep&&1/Op(new Ep([,-0]))[1]==1/0?function(t){return new Ep(t)}:Pp,Ap=Ip;var jp=function baseUniq(t,a,u){var h=-1,m=Rl,g=t.length,b=!0,w=[],x=w;if(u)b=!1,m=Ll;else if(g>=200){var k=a?null:Ap(t);if(k)return Op(k);b=!1,m=Nl,x=new Pl}else x=a?[]:w;e:for(;++h<g;){var S=t[h],_=a?a(S):S;if(S=u||0!==S?S:0,b&&_==_){for(var C=x.length;C--;)if(x[C]===_)continue e;a&&x.push(_),w.push(S)}else m(x,_,u)||(x!==w&&x.push(_),w.push(S))}return w};var Rp,Lp=function uniq(t){return t&&t.length?jp(t):[]},Fp=["disconnect","connect","heartbeat","message","json","event","ack","error","noop"],Np=["transport not supported","client not handshaken","unauthorized"],Up=["reconnect"],Dp=function(t){function BaseWebsocket(a,u){var h;return(h=t.call(this)||this).url=u,h.websocket=null,h.socketConnectTimer=0,h.core=a,h.url=u,h.status="disconnected",h.logger=a.logger,h.connect(),h}_t(BaseWebsocket,t);var a=BaseWebsocket.prototype;return a.connect=function connect(){var t=this;"connecting"!==this.status&&"connected"!==this.status?(this.status="connecting",this.core.adapters.request("https://"+this.url+"/socket.io/1/?t="+Zo(),{method:"GET",dataType:"text",timeout:this.core.options.xhrConnectTimeout||8e3},{exception_service:6}).then((function(a){var u=a.data.split(":"),h=u[0],m=u[1];return t.sessionId=h,t.closeTimeout=1e3*m,t._createWebsocket("wss://"+t.url+"/socket.io/1/websocket/"+h)})).catch((function(a){a=a||{},t.logger.error("imsocket::handshake fail. message: ",a&&a.message," err code: ",a&&a.code),a.code=408===a.code?408:415,t.status="disconnected",t.emit("handshakeFailed",a)}))):this.logger.warn("imsocket::socket is connecting or connected",this.status)},a.close=function close(){if(this.websocket){this.logger.log("imsocket:: close websocket");try{this.websocket.send(this.encodePacket({type:"disconnect"}))}catch(t){this.logger.warn("attempt to send encodePacket error",t)}try{this.websocket.close()}catch(t){this.logger.warn("attempt to close websocket error",t)}this.clean()}},a.clean=function clean(){this.status="disconnected",this.websocket&&(this.socketUrl=void 0,this.websocket.onmessage=null,this.websocket.onopen=null,this.websocket.onerror=null,this.websocket.onclose=null,this.websocket=null,this.emit("disconnect"))},a.onConnect=function onConnect(){this.status="connected",this.resetCloseTimer(),this.emit("connect"),clearTimeout(this.socketConnectTimer)},a._createWebsocket=function _createWebsocket(t){var a,u=this;this.socketConnectTimer=mi((function(){u.logger.error("core:: socket connect timeout. url: ",u.socketUrl),u.emit("handshakeFailed",new oc("BaseWebsocket::_createWebSocket socket connect timeout. url: "+u.socketUrl,{},408))}),this.core.options.socketConnectTimeout||8e3),this.socketUrl=t,this.websocket=new zf.WebSocket(t),this.websocket.onmessage=bind$1(a=this.onMessage).call(a,this),this.websocket.onclose=function(){u.logger.log("imsocket:: websocket onclose done"),u.clean()},this.websocket.onerror=function(t){u.logger.error("imsocket:: onerror",t),"logined"===u.core.status&&u.core.clientSocket.ping()}},a.onMessage=function onMessage(t){var a;this.resetCloseTimer();var u=this.decodePacket(t.data);if(u)switch(u.type){case"connect":this.onConnect();break;case"disconnect":this.close();break;case"message":case"json":this.emit("message",u.data);break;case"event":u.name&&this.emit(u.name,u.args);break;case"error":"unauthorized"===u.reason?this.emit("connect_failed",u.reason):this.emit("error",u.reason),this.logger.error("core:: socket onmessage type error. url: ",this.socketUrl),clearTimeout(this.socketConnectTimer),this.emit("handshakeFailed",new oc("BaseWebsocket::onMessage socket error. url: "+this.socketUrl,{},415));break;case"heartbeat":null===(a=this.websocket)||void 0===a||a.send(this.encodePacket({type:"heartbeat"}));break;default:this.logger.warn("imsocket::no handler type",u.type)}},a.encodePacket=function encodePacket(t){var a,u,h=t.type,m=t.id,g=void 0===m?"":m,b=t.endpoint,w=void 0===b?"":b,x=t.ack,k=null;if(!h)return"";switch(h){case"error":a=t.reason?indexOf(Np).call(Np,t.reason):"",u=t.advice?indexOf(Up).call(Up,t.advice):"",""===a&&""===u||(k=a+(""!==u?"+"+u:""));break;case"message":""!==t.data&&(k=t.data);break;case"event":a={name:t.name},a=t.args&&t.args.length?{name:t.name,args:t.args}:{name:t.name},k=Hu(a);break;case"json":k=Hu(t.data);break;case"connect":t.qs&&(k=t.qs);break;case"ack":k=t.ackId+(t.args&&t.args.length?"+"+Hu(t.args):"")}var S=[indexOf(Fp).call(Fp,h),g+("data"===x?"+":""),w];return null!=k&&S.push(k),S.join(":")},a.decodePacket=function decodePacket(t){if(t)if("�"!=t.charAt(0)){var a=t.match(/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/);if(a){var u,h=a[1],m=a[2],g=a[3],b=a[4],w=a[5],x={type:Fp[+h],endpoint:b};switch(m&&(x.id=m,x.ack=!g||"data"),x.type){case"error":u=w.split("+"),x.reason=Np[+u[0]]||"";break;case"message":x.data=w||"";break;case"connect":x.qs=w||"";break;case"event":try{var k=JSON.parse(w);x.name=k.name,x.args=k.args}catch(t){this.logger.error("imsocket::parseData::type::event error",t)}x.args=x.args||[];break;case"json":try{x.data=JSON.parse(w)}catch(t){this.logger.error("imsocket::parseData::type::json error",t)}break;case"ack":if((u=w.match(/^([0-9]+)(\+)?(.*)/))&&(x.ackId=u[1],x.args=[],u[3]))try{x.args=u[3]?JSON.parse(u[3]):[]}catch(t){this.logger.error("imsocket::parseData::type::ack error",t)}}return x}}else this.logger.error("imsocket::unrecognize dataStr",slice(t).call(t,0,20))},a.send=function send(t){var a,u={data:t,type:"message",endpoint:""};null===(a=this.websocket)||void 0===a||a.send(this.encodePacket(u))},a.resetCloseTimer=function resetCloseTimer(){var t=this;this.closeTimeout&&(clearTimeout(this.closeTimer),this.closeTimer=mi((function(){t.close()}),this.closeTimeout))},BaseWebsocket}(gi);!function(t){t[t.ACTIVE=1]="ACTIVE",t[t.KICKED=2]="KICKED",t[t.OFFLINE=3]="OFFLINE"}(Rp||(Rp={}));var Bp=function(){function ClientSocket(t){this.linkUrls=[],this.isAutoReconnect=!1,this.packetTimeout=3e4,this.packetSer=1,this.retryCount=0,this.reconnectTimer=0,this.backoff=new lp({max:8e3,min:1600,jitter:.01}),this.sendingCmdMap=new zs,this.pingTimer=0,this.hasNetworkListener=!1,this.core=t,this.logger=t.logger,this.reporter=t.reporter,this.timerManager=t.timerManager}var t=ClientSocket.prototype;return t.connect=function connect(t,a){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,rf.mark((function _callee(){var u,h,m,g,b,w;return rf.wrap((function _callee$(x){for(;;)switch(x.prev=x.next){case 0:if(validate({linkUrls:{type:"array",itemType:"string",required:!1}},t),/^(unconnected|waitReconnect)$/.test(this.core.status)){x.next=5;break}return u="Core socket status is "+this.core.status+", and would not connect",this.logger.warn(u),x.abrupt("return",Jo.reject(u));case 5:this.core.status="connecting",t.linkUrls&&t.linkUrls.length>0&&(this.linkUrls=concat(h=t.linkUrls).call(h,this.linkUrls),this.linkUrls=Lp(this.linkUrls)),0===this.linkUrls.length&&this.linkUrls.push("weblink.netease.im:443"),m=0;case 9:if(!(m<this.linkUrls.length)){x.next=31;break}return g=this.linkUrls[m],b=(new Date).getTime(),x.prev=12,x.next=15,this.doConnect(g);case 15:return this.core.status="connected",this.logger.log("core:: connect success with url: "+g),x.abrupt("return",g);case 20:x.prev=20,x.t0=x.catch(12),w=x.t0,a&&a(w,g),this.reporter.reportTraceStart("exceptions",{user_id:this.core.options.account,start_time:b,action:0,exception_service:6}),this.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof w.code?w.code:0,description:w.message||""+w.code,operation_type:0,target:g},{asyncParams:zf.net.getNetworkStatus()}),this.reporter.reportTraceEnd("exceptions",1),this.logger.warn("core:: connect failed with url: "+g,x.t0);case 28:m++,x.next=9;break;case 31:throw 0===this.retryCount?this.doDisconnect(Rp.ACTIVE,"SocketHandshakeFailed"):this.doDisconnect(Rp.OFFLINE,"ReconnectHadRetryAllLinks"),new Error("core: socket xhr or socket connect failed");case 33:case"end":return x.stop()}}),_callee,this,[[12,20]])})))},t.doConnect=function doConnect(t){var a=this,u=!1;return new Jo((function(h,m){var g;a.socket=new Dp(a.core,t),a.socket.on("connect",(function(){a.logger.log("socket on connect",t),u=!0,h()})),a.socket.on("message",bind$1(g=a.onMessage).call(g,a)),a.socket.on("disconnect",(function(t){a.logger.log("core:: socket on disconnect",t),u=!0,a.doDisconnect(Rp.OFFLINE,"SocketOnDisconnect")})),a.socket.on("handshakeFailed",(function(t){u?a.ping():(a.logger.error("core:: handshake failed. ",t&&t.message),a.cleanSocket()),u=!0,m(t)}))}))},t.cleanSocket=function cleanSocket(){this.socket&&("function"==typeof this.socket.removeAllListeners&&this.socket.removeAllListeners(),"function"==typeof this.socket.close&&this.socket.close(),this.socket=void 0)},t.beforeConnect=function beforeConnect(){this.reconnectTimer&&clearTimeout(this.reconnectTimer)},t.resetConnectStatus=function resetConnectStatus(){clearTimeout(this.reconnectTimer),this.backoff.reset(),this.retryCount=0,this.initOnlineListener()},t.doDisconnect=function doDisconnect(t,a){if(this.logger.log("doDisconnect: type "+t+", description "+a),"unconnected"!==this.core.status){var u={1:"close",2:"kicked",3:"broken"}[t]||"";this.markAllCmdInvaild(new oc("Packet timeout due to instance disconnect",{disconnect_reason:u},415)),this.timerManager.destroy(),clearTimeout(this.pingTimer),this.cleanSocket();var h=!this.core.options.needReconnect||this.retryCount>=this.core.options.reconnectionAttempts;if(t===Rp.ACTIVE||h)this.logger.log("doDisconnect: emit disconnect, type "+t,h),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.core.eventBus.emit("disconnect"),this.core.emit("disconnect"),this.destroyOnlineListener();else if(t===Rp.KICKED){this.logger.log("doDisconnect: kicked"),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer);var m="string"==typeof a?{reason:"unknow",message:a}:a;this.core.eventBus.emit("kicked",m),this.core.emit("kicked",m),this.destroyOnlineListener()}else t===Rp.OFFLINE&&this.core.auth.isManualLoginAttempt?(this.logger.log("doDisconnect: offline in manual login phase. no reconnect"),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.destroyOnlineListener()):t===Rp.OFFLINE?(this.logger.log("doDisconnect: start to reconnect"),this.attempToReconnect()):this.logger.log("doDisconnect: nothing to do")}else this.logger.warn("doDisconnect: already unconnected")},t.attempToReconnect=function attempToReconnect(){var t=this;if("waitReconnect"!==this.core.status){0===this.retryCount&&(this.core.eventBus.emit("disconnect"),this.core.emit("disconnect"));var a=this.backoff.duration();this.retryCount++,this.logger.log("willReconnect "+this.retryCount+" "+a),this.core.eventBus.emit("willReconnect",{retryCount:this.retryCount,duration:a}),this.core.emit("willReconnect",{retryCount:this.retryCount,duration:a}),this.core.status="waitReconnect",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=mi((function(){return __awaiter(t,void 0,void 0,rf.mark((function _callee2(){var t=this;return rf.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if("waitReconnect"===this.core.status){a.next=3;break}return this.logger.warn("doDisconnect: reconnectTimer status is "+this.core.status+", would not go on reconnecting"),a.abrupt("return");case 3:return a.next=5,zf.net.getNetworkStatus();case 5:!1===a.sent.net_connect?(this.logger.log("doDisconnect: skip this reconnection attempt because network is offline"),this.core.status="connecting",this.retryCount>=this.core.options.reconnectionAttempts?this.doDisconnect(Rp.OFFLINE,"MaxReconnectionAttemptExceed"):this.attempToReconnect()):this.core.auth.login({isAutoReconnect:!0}).catch((function(){t.logger.error("core::attempToReconnect failed "+t.retryCount)}));case 7:case"end":return a.stop()}}),_callee2,this)})))}),a)}else this.logger.warn("doDisconnect: already is waiting reconnect")},t.sendCmd=function sendCmd(t,a,u){var h=this;if("logined"!==this.core.status&&"login"!==t&&"chatroomLogin"!==t&&"qchatLogin"!==t)return this.logger.warn("instance status is "+this.core.status+", so can not sendCmd "+t),Jo.reject({cmd:t,error:{code:"No_connected",message:"Connection not established",timetag:(new Date).getTime()}});if(!this.socket||!this.socket.send)return Jo.reject("No_socket");var m="heartbeat"!==t,g=m?this.packetSer++:0,b=function createCmd(t,a,u,h){var m=Bu[t];if(!m)return u.error("createCmd:: can not find cmd config: ",t),null;var g,b={SER:a,SID:m.sid,CID:m.cid,Q:[]};return m.params&&h&&forEach$1(g=m.params).call(g,(function(t){var a=h[t.name];if(!ju(a)){var u=t.type,m=t.reflectMapper;switch(t.type){case"PropertyArray":u="ArrayMable",a=map$6(a).call(a,(function(t){return{t:"Property",v:m?serialize(t,m):t}}));break;case"Property":a=m?serialize(a,m):a;break;case"Bool":case"bool":a=a?"true":"false"}b.Q.push({t:u,v:a})}})),{packet:b,hasPacketResponse:"boolean"!=typeof m.hasPacketResponse||m.hasPacketResponse,hasPacketTimer:"boolean"!=typeof m.hasPacketTimer||m.hasPacketTimer}}(t,g,this.logger,a);if(!b){var w="SendCmd "+g+" "+t+" error";return this.logger.error(w),Jo.reject(w)}var x=b.packet,k=b.hasPacketResponse,S=b.hasPacketTimer,_=Hu(x);m&&("debug"===this.core.options.debugLevel?this.logger.debug("core::sendCmd",t,"ser:"+g,_):this.logger.log("core::sendCmd",t,"ser:"+g));var C=(new Date).getTime();return new Jo((function(m,b){k&&h.sendingCmdMap.set(g,{cmd:t,params:a,callback:[m,b],timer:S?mi((function(){var a=new sc(408,t,"Packet Timeout",(new Date).getTime(),{message:"ser "+g+" cmd "+t+" timeout"});a.callFunc="sendCmd",h.markCmdInvalid(g,a,t)}),u&&u.timeout?u.timeout:h.core.config.timeout):null});try{h.socket.send(_),k||m(x)}catch(a){var w=new sc(415,t,a&&a.message||"Unable to send packet",(new Date).getTime(),{message:"send json error",rawError:a});w.callFunc="sendCmd",h.markCmdInvalid(g,w,t),b(a)}})).catch((function(t){var a,u=[408,415];if(!includes(u).call(u,t.code))return Jo.reject(t);h.reporter.reportTraceStart("exceptions",{user_id:h.core.options.account,trace_id:null===(a=h.socket)||void 0===a?void 0:a.sessionId,start_time:C,action:2,exception_service:6});var m=Mp(t,"data.disconnect_reason")||"",g=408===t.code?"Send failed due to timeout":"Send failed. Reason unknown";return g=415===t.code?Hu({disconnect_reason:m}):g,h.reporter.reportTraceUpdateV2("exceptions",{code:t.code||415,description:g,operation_type:1,target:x.SID+"-"+x.CID,context:""+x.SER},{asyncParams:zf.net.getNetworkStatus()}),h.reporter.reportTraceEnd("exceptions",1),Jo.reject(t)}))},t.onMessage=function onMessage(t){var a=parseCmd(t,this.logger);if(a){var u=a.raw.ser;if(a.error&&this.logger.error("core:onMessage packet error",a.raw.sid+"_"+a.raw.cid+", ser:"+u+",",a.error),a.notFound){var h=Mp(a,"raw.r[1].headerPacket"),m=h?h.sid+"_"+h.cid:a.raw.sid+"_"+a.raw.cid;this.logger.warn("core::onMessage packet not found",m+", ser:"+u)}else"heartbeat"!==a.cmd&&("debug"===this.core.options.debugLevel?this.logger.debug("imsocket::recvCmd ser:"+u,a.cmd,a.content):this.logger.log("imsocket::recvCmd ser:"+u,a.cmd)),a.__receiveTime=Zo(),this.packetHandler(a)}},t.packetHandler=function packetHandler(t){var a,u;if(t){var h=t.raw.ser,m=this.sendingCmdMap.get(h);if(m&&m.cmd===t.cmd){var g=m.callback,b=m.timer,w=m.params;if(clearTimeout(b),t.params=w,this.sendingCmdMap.delete(h),"heartbeat"===t.cmd)return void g[0]();var x=null===(a=this.core[t.service])||void 0===a?void 0:a.process(t);x&&"function"==typeof x.then?x.then((function(t){g[0](t)})).catch((function(t){g[1](t)})):(this.logger.log("imsocket:: handlerFn without promise",t.service,t.cmd),g[0]())}else null===(u=this.core[t.service])||void 0===u||u.process(t)}},t.markCmdInvalid=function markCmdInvalid(t,a,u){var h=this.sendingCmdMap.get(t);if(h){var m=h.callback,g=h.timer;g&&clearTimeout(g),this.sendingCmdMap.delete(t),this.logger.warn("packet "+t+", "+u+" is invalid:",a),m[1](a)}},t.markAllCmdInvaild=function markAllCmdInvaild(t){var a,u=this;this.logger.log("markAllCmdInvaild",t),forEach$1(a=this.sendingCmdMap).call(a,(function(a){var h=a.callback,m=a.timer,g=a.cmd;u.logger.debug('markAllCmdInvaild:: cmd "'+g+'"'),m&&clearTimeout(m),h[1](t)})),this.sendingCmdMap.clear()},t.ping=function ping(){return __awaiter(this,void 0,void 0,rf.mark((function _callee3(){var t=this;return rf.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:return clearTimeout(this.pingTimer),a.prev=1,a.next=4,this.sendCmd("heartbeat");case 4:a.next=14;break;case 6:return a.prev=6,a.t0=a.catch(1),a.next=10,this.testHeartBeat5Timeout();case 10:if(!a.sent){a.next=14;break}return this.doDisconnect(Rp.OFFLINE,"PingError"),a.abrupt("return");case 14:this.pingTimer=mi((function(){t.ping()}),3e4);case 15:case"end":return a.stop()}}),_callee3,this,[[1,6]])})))},t.testHeartBeat5Timeout=function testHeartBeat5Timeout(){return __awaiter(this,void 0,void 0,rf.mark((function _callee4(){var t;return rf.wrap((function _callee4$(a){for(;;)switch(a.prev=a.next){case 0:clearTimeout(this.pingTimer),t=0;case 2:if(!(t<5)){a.next=15;break}return a.prev=3,a.next=6,this.sendCmd("heartbeat",{},{timeout:3e3});case 6:return a.abrupt("return",!1);case 9:a.prev=9,a.t0=a.catch(3),this.logger.debug("core:: test heartbeat "+t+" Timeout");case 12:t++,a.next=2;break;case 15:return a.abrupt("return",!0);case 16:case"end":return a.stop()}}),_callee4,this,[[3,9]])})))},t.initOnlineListener=function initOnlineListener(){var t=this;this.hasNetworkListener||(this.logger.log("core::onlineListener:init"),this.hasNetworkListener=!0,zf.net.onNetworkStatusChange((function(a){t.logger.log("core::onlineListener:network change",a),a.isConnected&&"logined"===t.core.status?t.ping():a.isConnected&&"waitReconnect"===t.core.status?(t.reconnectTimer&&clearTimeout(t.reconnectTimer),t.core.auth.login({isAutoReconnect:!0}).catch((function(){t.logger.error("core::attempToReconnect failed "+t.retryCount)}))):a.isConnected||t.doDisconnect(Rp.OFFLINE,"OfflineListener")})))},t.destroyOnlineListener=function destroyOnlineListener(){this.logger.log("core::onlineListener:destroy"),zf.net.offNetworkStatusChange(),this.hasNetworkListener=!1},t.disconnect=function disconnect(){switch(this.core.status){case"connected":case"logined":case"connecting":case"waitReconnect":return this.doDisconnect(Rp.ACTIVE,"UserActiveDisconnect"),Jo.resolve();case"unconnected":case"destroyed":return Jo.resolve()}},ClientSocket}();var qp=function baseForOwn(t,a){return t&&pf(t,a,Iu)};var Gp=function baseInverter(t,a,u,h){return qp(t,(function(t,m,g){a(h,u(t),m,g)})),h};var Hp,zp,Kp=function createInverter(t,a){return function(u,h){return Gp(u,t,a(h),{})}},$p=Object.prototype.toString,Wp=Kp((function(t,a,u){null!=a&&"function"!=typeof a.toString&&(a=$p.call(a)),t[a]=u}),Vc(zc));function formatChatroom(t){var a=Ot({},t),u=["announcement","broadcastUrl","ext"],h=["createTime","updateTime","onlineMemberNum"],m=["mute"];return forEach$1(u).call(u,(function(t){void 0===a[t]&&(a[t]="")})),forEach$1(h).call(h,(function(t){void 0!==a[t]&&(a[t]=ms(a[t]))})),forEach$1(m).call(m,(function(t){void 0!==a[t]&&(a[t]=1===ms(a[t]))})),a}!function(t){t[t.Android=1]="Android",t[t.iOS=2]="iOS",t[t.PC=4]="PC",t[t.WindowsPhone=8]="WindowsPhone",t[t.Web=16]="Web",t[t.Server=32]="Server",t[t.Mac=64]="Mac"}(Hp||(Hp={})),function(t){t[t.text=0]="text",t[t.image=1]="image",t[t.audio=2]="audio",t[t.video=3]="video",t[t.geo=4]="geo",t[t.notification=5]="notification",t[t.file=6]="file",t[t.tip=10]="tip",t[t.robot=11]="robot",t[t.g2=12]="g2",t[t.custom=100]="custom"}(zp||(zp={}));var Vp=Wp({unset:"-2",restricted:"-1",common:"0",owner:"1",manager:"2",guest:"3",anonymous:"4"});function formatChatroomMember(t){var a,u=Ot({},t),h=["chatroomId"],m=["level","enterTime","updateTime","tempMuteDuration"],g=["online","guest","blacked","muted","valid","tempMuted"],b={tempMuted:!1,tempMuteDuration:0};return forEach$1(a=$a(b)).call(a,(function(t){u[t]=u[t]||b[t]})),forEach$1(h).call(h,(function(t){void 0!==u[t]&&(u[t]=u[t].toString())})),forEach$1(m).call(m,(function(t){void 0!==u[t]&&(u[t]=ms(u[t]))})),forEach$1(g).call(g,(function(t){void 0!==u[t]&&(u[t]=1===ms(u[t]))})),void 0!==u.type&&(u.type=Vp[u.type]),u.avatar,u.online||delete u.enterTime,u.guest&&(u.type="guest",delete u.valid,delete u.guest),"common"!==u.type&&delete u.level,u}function formatChatroomMembers(t){return t&&t.length>0?map$6(t).call(t,(function(t){return formatChatroomMember(t)})):[]}function generatorMsgForCmd(t,a,u){t.onSendBefore;var h=__rest(t,["onSendBefore"]),m=["subType"],g=["body","antiSpamContent","antiSpamBusinessId","ext"],b=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];return t.resend||(h.idClient=Ru()),h.type=zp[t.type],h.from=a,h.fromClientType=16,h.fromDeviceId=u,h.status=h.status||"sending",forEach$1(b).call(b,(function(a){void 0!==t[a]&&(h[a]=t[a]?1:0)})),forEach$1(m).call(m,(function(a){void 0!==t[a]&&(h[a]=ms(t[a]))})),forEach$1(g).call(g,(function(a){void 0!==t[a]&&(h[a]="string"==typeof t[a]?t[a]:Hu(t[a]))})),h}var Qp={301:"memberEnter",302:"memberExit",303:"blackMember",304:"unblackMember",305:"gagMember",306:"ungagMember",307:"addManager",308:"removeManager",309:"addCommon",310:"removeCommon",311:"closeChatroom",312:"updateChatroom",313:"kickMember",314:"addTempMute",315:"removeTempMute",316:"updateMemberInfo",317:"updateQueue",318:"muteRoom",319:"unmuteRoom",320:"batchUpdateQueue",321:"addTempMuteTag",322:"removeTempMuteTag",323:"deleteChatroomMsg",325:"updateChatroomTags"};function formatChatroomMsg(t,a){t.onUploadDone,t.onUploadProgress,t.onUploadStart;var u=__rest(t,["onUploadDone","onUploadProgress","onUploadStart"]),h=["time","userUpdateTime"],m=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];if(forEach$1(h).call(h,(function(t){void 0!==u[t]&&(u[t]=ms(u[t]))})),forEach$1(m).call(m,(function(t){void 0!==u[t]&&(u[t]=1===ms(u[t]))})),u.type=getEnumKeyByEnumValue(zp,u.type),u.fromClientType=getEnumKeyByEnumValue(Hp,u.fromClientType),u.flow=u.from===a?"out":"in",u.status=u.status||"success","string"==typeof u.body)try{u.body=JSON.parse(u.body)}catch(t){}return"notification"===u.type&&(u.attach=u.body?function formatNotificationBody(t){var a,u={};if(u.type=Qp[t.id]||t.id,!t.data)return t;u=Ot(u,t.data);var h={operator:"from",opeNick:"fromNick",target:"to",tarNick:"toNick"};forEach$1(a=$a(h)).call(a,(function(t){void 0!==u[t]&&(u[h[t]]=u[t],delete u[t])}));var m=["muteDuration"];if(forEach$1(m).call(m,(function(t){void 0!==u[t]&&(u[t]=ms(u[t]))})),!u.queueChange)return u;var g={};try{g=JSON.parse(u.queueChange)}catch(t){return u}switch(g._e){case"OFFER":g={type:"OFFER",elementKey:g.key,elementValue:g.content};break;case"POLL":g={type:"POLL",elementKey:g.key,elementValue:g.content};break;case"DROP":g={type:"DROP"};break;case"PARTCLEAR":case"BATCH_UPDATE":g={type:g._e,elementKv:g.kvObject}}return u.queueChange=g,u}(u.body):{},u.body=""),u}function formatChatroomMsgs(t,a){return t&&t.length>0?map$6(t).call(t,(function(t){return formatChatroomMsg(t,a)})):[]}var Jp={1:{code:"chatroomClosed",message:"Chatroom is closed"},2:{code:"managerKick",message:"Kicked out by owners or administrators"},3:{code:"samePlatformKick",message:"The same account is not allowed to multiple login at the same time"},4:{code:"silentlyKick",message:"Quietly kicked"},5:{code:"blacked",message:"Was blacklisted"}};var Yp=function(){function V1AuthAuthenticatorService(t){this.core=t}return V1AuthAuthenticatorService.prototype.verifyAuthentication=function verifyAuthentication(t){var a,u;return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,rf.mark((function _callee(){var h,m,g,b,w,x,k,S;return rf.wrap((function _callee$(_){for(;;)switch(_.prev=_.next){case 0:return m=this.core.options,g=zf.getSystemInfo(),b=Ot(Ot({},m),{appLogin:t?0:1,deviceId:this.core.config.deviceId,clientType:16,protocolVersion:1,sdkVersion:91602,sdkHumanVersion:"0.19.2",os:g.os,browser:g.browser,session:null===(a=this.core.clientSocket.socket)||void 0===a?void 0:a.sessionId,userAgent:this.core.options.loginSDKTypeParamCompat?"Native/0.19.2":slice(h=g.userAgent).call(h,0,299),libEnv:this.core.options.loginSDKTypeParamCompat?void 0:g.libEnv,hostEnv:this.core.options.loginSDKTypeParamCompat?0:g.hostEnvEnum}),w=Ot(Ot({},m),{appkey:m.appkey,account:m.account,deviceId:this.core.config.deviceId,session:null===(u=this.core.clientSocket.socket)||void 0===u?void 0:u.sessionId,appLogin:1}),m.isAnonymous&&(w.isAnonymous=1,w.account=w.account||"nimanon_"+Ru(),b.account=w.account,w.chatroomNick=w.account||"nimanon_"+Ru(),w.chatroomAvatar=w.chatroomAvatar||" "),m.tags&&m.tags.length>0&&(w.tags=Hu(m.tags)),_.next=8,this.core.clientSocket.sendCmd("chatroomLogin",{type:1,chatroomLogin:w,chatroomIMLogin:b});case 8:return x=_.sent,this.core.status="logined",k=formatChatroom(x.content.chatroom),S=formatChatroomMember(x.content.chatroomMember),_.abrupt("return",{chatroom:k,member:S});case 13:case"end":return _.stop()}}),_callee,this)})))},V1AuthAuthenticatorService}(),Xp=function(t){function ChatroomAuthService(a){var u;return(u=t.call(this,"chatroomAuth",a)||this).account="",u.token="",u.deviceId="",u.isManualLoginAttempt=!1,u.authenticatorService=new Yp(a),u}_t(ChatroomAuthService,t);var a=ChatroomAuthService.prototype;return a.login=function login(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,rf.mark((function _callee(){var a,u;return rf.wrap((function _callee$(h){for(;;)switch(h.prev=h.next){case 0:return t.isAutoReconnect||(this.isManualLoginAttempt=!0),a=Zo(),h.next=4,this._connect(t);case 4:return u=h.sent,this.core.abtest.abtRequest(),h.prev=6,h.next=9,this.doLogin(t.isAutoReconnect,u,a);case 9:this.isManualLoginAttempt=!1,h.next=16;break;case 12:throw h.prev=12,h.t0=h.catch(6),this.isManualLoginAttempt=!1,h.t0;case 16:case"end":return h.stop()}}),_callee,this,[[6,12]])})))},a._connect=function _connect(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,rf.mark((function _callee2(){var a,u,h;return rf.wrap((function _callee2$(m){for(;;)switch(m.prev=m.next){case 0:if(/^(unconnected|waitReconnect)$/.test(this.core.status)){m.next=4;break}return a="Chatroom status is "+this.core.status+", and would not connect",this.logger.warn(a),m.abrupt("return",Jo.reject(a));case 4:return this.core.clientSocket.beforeConnect(),u=t.isAutoReconnect||!1,m.next=8,this.core.clientSocket.connect({linkUrls:this.core.options.chatroomAddresses,isAutoReconnect:u});case 8:return h=m.sent,m.abrupt("return",h);case 10:case"end":return m.stop()}}),_callee2,this)})))},a.doLogin=function doLogin(t,a,u){return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,rf.mark((function _callee3(){var h,m,g;return rf.wrap((function _callee3$(b){for(;;)switch(b.prev=b.next){case 0:return b.prev=0,b.next=3,this.authenticatorService.verifyAuthentication(t);case 3:h=b.sent,this.core.status="logined",this.core.reporter.report("chatroomLogin",{accid:this.core.account,roomId:this.core.options.chatroomId,serverIps:this.core.options.chatroomAddresses,currentServerIp:a,rt:Zo()-u,result:200,failReason:"",time:Zo()}),b.next=18;break;case 8:if(b.prev=8,b.t0=b.catch(0),this.logger.error("chatroom login error",b.t0),m=Mp(b.t0,"error.code")||Mp(b.t0,"code")||408,g=Mp(b.t0,"error.message")||Mp(b.t0,"message")||"login failed",this.core.reporter.report("chatroomLogin",{accid:this.core.account,roomId:this.core.options.chatroomId,serverIps:this.core.options.chatroomAddresses,currentServerIp:a,rt:Zo()-u,result:m,failReason:g,time:Zo()}),this.core.clientSocket.doDisconnect(Rp.OFFLINE,this.isManualLoginAttempt?"FailedToInitializeLogin":"ReconnectLoginFailed"),!this.isManualLoginAttempt){b.next=17;break}throw b.t0;case 17:return b.abrupt("return");case 18:return b.prev=18,b.next=21,this.core.cloudStorage.init();case 21:b.next=26;break;case 23:b.prev=23,b.t1=b.catch(18),this.logger.error("NIM:login cloudStorage init failed ",b.t1);case 26:this.core.eventBus.emit("logined",h),this.core.emit("logined",h),this.core.clientSocket.resetConnectStatus(),this.core.clientSocket.ping();case 30:case"end":return b.stop()}}),_callee3,this,[[0,8],[18,23]])})))},a.beKickedFromChatroomHandler=function beKickedFromChatroomHandler(t){var a=t.content,u=a.reason,h=a.ext,m=function formatKickedReason(t){var a=Jp[t];return{reason:a?a.code:"unknow",message:a?a.message:"Unknown reason"}}(u);this.logger.warn("beKickedFromChatroomHandler:: ",m.reason,m.message,h),this.core.clientSocket.doDisconnect(Rp.KICKED,m)},ChatroomAuthService}(up),Zp=function(t){function ChatroomService(a){return t.call(this,"chatroom",a)||this}_t(ChatroomService,t);var a=ChatroomService.prototype;return a.getInfo=function getInfo(){var t;return __awaiter(this,void 0,void 0,rf.mark((function _callee(){var a;return rf.wrap((function _callee$(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.core.sendCmd("getChatroom");case 2:return a=u.sent,u.abrupt("return",formatChatroom(null===(t=a.content)||void 0===t?void 0:t.chatroom));case 4:case"end":return u.stop()}}),_callee,this)})))},a.updateInfo=function updateInfo(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee2(){return rf.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({chatroom:{type:"object",rules:{name:{type:"string",required:!1},announcement:{type:"string",required:!1},broadcastUrl:{type:"string",required:!1},ext:{type:"string",required:!1},queuelevel:{type:"number",min:0,max:1,required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("updateChatroom",Ot(Ot({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee2,this)})))},a.updateChatroomTagHandler=function updateChatroomTagHandler(t){var a,u=t.content;this.logger.log("updateChatroomTagHandler:: ",u);var h=null===(a=null==u?void 0:u.updateTags)||void 0===a?void 0:a.currentTags;try{h=JSON.parse(h)}catch(t){this.logger.error("updateChatroomTagHandler:: ",t)}this.core.emit("tagsUpdate",h)},ChatroomService}(up),ed=ss.trim,td=M("".charAt),rd=m.parseFloat,nd=m.Symbol,od=nd&&nd.iterator,id=1/rd(rs+"-0")!=-1/0||od&&!fails((function(){rd(Object(od))}))?function parseFloat(t){var a=ed(toString$1(t)),u=rd(a);return 0===u&&"-"==td(a,0)?-0:u}:rd;_export({global:!0,forced:parseFloat!=id},{parseFloat:id});var ad=H.parseFloat;var sd=function arraySome(t,a){for(var u=-1,h=null==t?0:t.length;++u<h;)if(a(t[u],u,t))return!0;return!1};var cd=function equalArrays(t,a,u,h,m,g){var b=1&u,w=t.length,x=a.length;if(w!=x&&!(b&&x>w))return!1;var k=g.get(t),S=g.get(a);if(k&&S)return k==a&&S==t;var _=-1,C=!0,T=2&u?new Pl:void 0;for(g.set(t,a),g.set(a,t);++_<w;){var M=t[_],E=a[_];if(h)var P=b?h(E,M,_,a,t,g):h(M,E,_,t,a,g);if(void 0!==P){if(P)continue;C=!1;break}if(T){if(!sd(a,(function(t,a){if(!Nl(T,a)&&(M===t||m(M,t,u,h,g)))return T.push(a)}))){C=!1;break}}else if(M!==E&&!m(M,E,u,h,g)){C=!1;break}}return g.delete(t),g.delete(a),C};var ud=function mapToArray(t){var a=-1,u=Array(t.size);return t.forEach((function(t,h){u[++a]=[h,t]})),u},ld=pc?pc.prototype:void 0,fd=ld?ld.valueOf:void 0;var pd=function equalByTag(t,a,u,h,m,g,b){switch(u){case"[object DataView]":if(t.byteLength!=a.byteLength||t.byteOffset!=a.byteOffset)return!1;t=t.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=a.byteLength||!g(new hf(t),new hf(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Bc(+t,+a);case"[object Error]":return t.name==a.name&&t.message==a.message;case"[object RegExp]":case"[object String]":return t==a+"";case"[object Map]":var w=ud;case"[object Set]":var x=1&h;if(w||(w=Op),t.size!=a.size&&!x)return!1;var k=b.get(t);if(k)return k==a;h|=2,b.set(t,a);var S=cd(w(t),w(a),h,m,g,b);return b.delete(t),S;case"[object Symbol]":if(fd)return fd.call(t)==fd.call(a)}return!1};var dd=function arrayPush(t,a){for(var u=-1,h=a.length,m=t.length;++u<h;)t[m+u]=a[u];return t};var hd=function baseGetAllKeys(t,a,u){var h=a(t);return hu(t)?h:dd(h,u(t))};var md=function arrayFilter(t,a){for(var u=-1,h=null==t?0:t.length,m=0,g=[];++u<h;){var b=t[u];a(b,u,t)&&(g[m++]=b)}return g};var gd=function stubArray(){return[]},vd=Object.prototype.propertyIsEnumerable,yd=Object.getOwnPropertySymbols,bd=yd?function(t){return null==t?[]:(t=Object(t),md(yd(t),(function(a){return vd.call(t,a)})))}:gd,wd=bd;var xd=function getAllKeys(t){return hd(t,Iu,wd)},kd=Object.prototype.hasOwnProperty;var Sd=function equalObjects(t,a,u,h,m,g){var b=1&u,w=xd(t),x=w.length;if(x!=xd(a).length&&!b)return!1;for(var k=x;k--;){var S=w[k];if(!(b?S in a:kd.call(a,S)))return!1}var _=g.get(t),C=g.get(a);if(_&&C)return _==a&&C==t;var T=!0;g.set(t,a),g.set(a,t);for(var M=b;++k<x;){var E=t[S=w[k]],P=a[S];if(h)var O=b?h(P,E,S,a,t,g):h(E,P,S,t,a,g);if(!(void 0===O?E===P||m(E,P,u,h,g):O)){T=!1;break}M||(M="constructor"==S)}if(T&&!M){var I=t.constructor,A=a.constructor;I==A||!("constructor"in t)||!("constructor"in a)||"function"==typeof I&&I instanceof I&&"function"==typeof A&&A instanceof A||(T=!1)}return g.delete(t),g.delete(a),T},_d=Nc(fc,"DataView"),Cd=Nc(fc,"Promise"),Td=Nc(fc,"WeakMap"),Md="[object Map]",Ed="[object Promise]",Pd="[object Set]",Od="[object WeakMap]",Id="[object DataView]",Ad=Ec(_d),jd=Ec(yl),Rd=Ec(Cd),Ld=Ec(Ep),Fd=Ec(Td),Nd=xc;(_d&&Nd(new _d(new ArrayBuffer(1)))!=Id||yl&&Nd(new yl)!=Md||Cd&&Nd(Cd.resolve())!=Ed||Ep&&Nd(new Ep)!=Pd||Td&&Nd(new Td)!=Od)&&(Nd=function(t){var a=xc(t),u="[object Object]"==a?t.constructor:void 0,h=u?Ec(u):"";if(h)switch(h){case Ad:return Id;case jd:return Md;case Rd:return Ed;case Ld:return Pd;case Fd:return Od}return a});var Ud=Nd,Dd="[object Arguments]",Bd="[object Array]",qd="[object Object]",Gd=Object.prototype.hasOwnProperty;var Hd=function baseIsEqualDeep(t,a,u,h,m,g){var b=hu(t),w=hu(a),x=b?Bd:Ud(t),k=w?Bd:Ud(a),S=(x=x==Dd?qd:x)==qd,_=(k=k==Dd?qd:k)==qd,C=x==k;if(C&&gu(t)){if(!gu(a))return!1;b=!0,S=!1}if(C&&!S)return g||(g=new lf),b||ku(t)?cd(t,a,u,h,m,g):pd(t,a,x,u,h,m,g);if(!(1&u)){var T=S&&Gd.call(t,"__wrapped__"),M=_&&Gd.call(a,"__wrapped__");if(T||M){var E=T?t.value():t,P=M?a.value():a;return g||(g=new lf),m(E,P,u,h,g)}}return!!C&&(g||(g=new lf),Sd(t,a,u,h,m,g))};var zd=function baseIsEqual(t,a,u,h,m){return t===a||(null==t||null==a||!su(t)&&!su(a)?t!=t&&a!=a:Hd(t,a,u,h,baseIsEqual,m))};var Kd=function baseIsMatch(t,a,u,h){var m=u.length,g=m,b=!h;if(null==t)return!g;for(t=Object(t);m--;){var w=u[m];if(b&&w[2]?w[1]!==t[w[0]]:!(w[0]in t))return!1}for(;++m<g;){var x=(w=u[m])[0],k=t[x],S=w[1];if(b&&w[2]){if(void 0===k&&!(x in t))return!1}else{var _=new lf;if(h)var C=h(k,S,x,t,a,_);if(!(void 0===C?zd(S,k,3,h,_):C))return!1}}return!0};var $d=function isStrictComparable(t){return t==t&&!kc(t)};var Wd=function getMatchData(t){for(var a=Iu(t),u=a.length;u--;){var h=a[u],m=t[h];a[u]=[h,m,$d(m)]}return a};var Vd=function matchesStrictComparable(t,a){return function(u){return null!=u&&(u[t]===a&&(void 0!==a||t in Object(u)))}};var Qd=function baseMatches(t){var a=Wd(t);return 1==a.length&&a[0][2]?Vd(a[0][0],a[0][1]):function(u){return u===t||Kd(u,t,a)}};var Jd=function baseHasIn(t,a){return null!=t&&a in Object(t)};var Yd=function hasPath(t,a,u){for(var h=-1,m=(a=_p(a,t)).length,g=!1;++h<m;){var b=Cp(a[h]);if(!(g=null!=t&&u(t,b)))break;t=t[b]}return g||++h!=m?g:!!(m=null==t?0:t.length)&&eu(m)&&nu(b,m)&&(hu(t)||du(t))};var Xd=function hasIn(t,a){return null!=t&&Yd(t,a,Jd)};var Zd=function baseMatchesProperty(t,a){return hp(t)&&$d(a)?Vd(Cp(t),a):function(u){var h=Mp(u,t);return void 0===h&&h===a?Xd(u,t):zd(a,h,3)}};var eh=function baseProperty(t){return function(a){return null==a?void 0:a[t]}};var th=function basePropertyDeep(t){return function(a){return Tp(a,t)}};var rh=function property(t){return hp(t)?eh(Cp(t)):th(t)};var nh=function baseIteratee(t){return"function"==typeof t?t:null==t?zc:"object"==typeof t?hu(t)?Zd(t[0],t[1]):Qd(t):rh(t)};var oh=function baseSet(t,a,u,h){if(!kc(t))return t;for(var m=-1,g=(a=_p(a,t)).length,b=g-1,w=t;null!=w&&++m<g;){var x=Cp(a[m]),k=u;if("__proto__"===x||"constructor"===x||"prototype"===x)return t;if(m!=b){var S=w[x];void 0===(k=h?h(S,x,w):void 0)&&(k=kc(S)?S:nu(a[m+1])?[]:{})}Gc(w,x,k),w=w[x]}return t};var ih=function basePickBy(t,a,u){for(var h=-1,m=a.length,g={};++h<m;){var b=a[h],w=Tp(t,b);u(w,b)&&oh(g,_p(b,t),w)}return g},ah=Object.getOwnPropertySymbols?function(t){for(var a=[];t;)dd(a,wd(t)),t=wf(t);return a}:gd;var sh=function getAllKeysIn(t){return hd(t,Af,ah)};var ch,uh,lh=function pickBy(t,a){if(null==t)return{};var u=Fl(sh(t),(function(t){return[t]}));return a=nh(a),ih(t,u,(function(t,u){return a(t,u[0])}))},fh={"6_2":"getNosToken","6_22":"getOriginUrl","6_26":"getNosCdnHost","6_27":"getGrayscaleConfig","6_28":"getMixStorePolicy","6_29":"getMixStoreToken","6_30":"getFileAuthToken"},ph={nosToken:{objectName:1,token:2,bucket:3,expireTime:4,expireSec:7,tag:8,shortUrl:9},mixStoreTokenReqTag:{provider:0,tokenCount:1,fileExpireSec:2,tag:3,returnBody:4},nosConfigTag:{bucket:1,cdnDomain:2,expire:3,objectNamePrefix:4},grayConfigTag:{config:0,ttl:1},mixStorePolicyTag:{providers:0,ttl:1,mixEnable:2,nosPolicy:3,s3Policy:4},mixStoreTokenResTag:{provider:0,accessKeyId:1,secretAccessKey:2,sessionToken:3,token:4,expireTime:5,bucket:6,objectName:7,fileExpireSec:8,tag:9,shortUrl:10,region:11},nosSafeUrlTag:{safeUrl:0,originUrl:1},mixStoreAuthTokenReqTag:{type:1,urls:2},mixStoreAuthTokenResTag:{type:1,tokens:2,token:3,ttl:4}},dh=invertSerializeMap(ph),hh={getNosToken:{sid:6,cid:2,service:"cloudStorage",response:[{type:"Property",name:"nosToken",reflectMapper:dh.nosToken}],params:[{type:"String",name:"responseBody"},{type:"Property",name:"nosToken",entity:"nosToken",reflectMapper:ph.nosToken}]},getOriginUrl:{sid:6,cid:22,service:"cloudStorage",response:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:dh.nosSafeUrlTag}],params:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:ph.nosSafeUrlTag}]},getNosCdnHost:{sid:6,cid:26,service:"misc",response:[{type:"Property",name:"nosConfigTag",reflectMapper:dh.nosConfigTag}]},getGrayscaleConfig:{sid:6,cid:27,service:"cloudStorage",response:[{type:"Property",name:"grayConfigTag",reflectMapper:dh.grayConfigTag}],params:[{type:"Property",name:"config"}]},getMixStorePolicy:{sid:6,cid:28,service:"cloudStorage",params:[{type:"LongArray",name:"supportType"}],response:[{type:"Property",name:"mixStorePolicyTag",reflectMapper:dh.mixStorePolicyTag}]},getMixStoreToken:{sid:6,cid:29,service:"cloudStorage",params:[{type:"Property",name:"mixStoreTokenReqTag",reflectMapper:ph.mixStoreTokenReqTag}],response:[{type:"Property",name:"mixStoreTokenResTag",reflectMapper:dh.mixStoreTokenResTag}]},getFileAuthToken:{sid:6,cid:30,service:"cloudStorage",params:[{type:"Property",name:"mixStoreAuthTokenReqTag",reflectMapper:ph.mixStoreAuthTokenReqTag}],response:[{type:"Property",name:"mixStoreAuthTokenResTag",reflectMapper:dh.mixStoreAuthTokenResTag}]}},mh={file:{md5:"$(Etag)",size:"$(ObjectSize)"},image:{md5:"$(Etag)",size:"$(ObjectSize)",w:"$(ImageInfo.Width)",h:"$(ImageInfo.Height)",orientation:"$(ImageInfo.Orientation)"},audio:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Audio.Duration)"},video:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Video.Duration)",w:"$(AVinfo.Video.Width)",h:"$(AVinfo.Video.Height)"}},gh={accessKeyId:"",secretAccessKey:"",sessionToken:"",region:"",maxRetries:0,bucket:"",objectName:"",token:"",shortUrl:""};!function(t){t[t.nos=1]="nos",t[t.s3=2]="s3"}(ch||(ch={})),function(t){t[t.dontNeed=-1]="dontNeed",t[t.time=2]="time",t[t.urls=3]="urls"}(uh||(uh={}));var vh={chunkUploadHost:"https://wannos-web.127.net",chunkUploadHostBackupList:["https://fileup.chatnos.com","https://oss.chatnos.com"],commonUploadHost:"https://fileup.chatnos.com",commonUploadHostBackupList:["https://oss.chatnos.com"],chunkMaxSize:4194304e4,commonMaxSize:104857600,uploadReplaceFormat:"https://{host}/{object}",cdn:{defaultCdnDomain:"nim.nosdn.127.net",cdnDomain:"",bucket:"",objectNamePrefix:""},downloadUrl:"https://{bucket}-nosdn.netease.im/{object}",downloadHostList:["nos.netease.com"],nosCdnEnable:!0,isNeedToGetUploadPolicyFromServer:!0};function _createForOfIteratorHelperLoose(t,a){var u,h=void 0!==ha&&sp(t)||t["@@iterator"];if(h)return bind$1(u=(h=h.call(t)).next).call(u,h);if(Wu(t)||(h=function _unsupportedIterableToArray(t,a){var u;if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,a);var h=slice(u=Object.prototype.toString.call(t)).call(u,8,-1);"Object"===h&&t.constructor&&(h=t.constructor.name);if("Map"===h||"Set"===h)return ap(t);if("Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return _arrayLikeToArray(t,a)}(t))||a&&t&&"number"==typeof t.length){h&&(t=h);var m=0;return function(){return m>=t.length?{done:!0}:{done:!1,value:t[m++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray(t,a){(null==a||a>t.length)&&(a=t.length);for(var u=0,h=new Array(a);u<a;u++)h[u]=t[u];return h}function getUploadResponseFormat(t){return void 0===t&&(t="file"),Hu(mh[t]||{}).replace(/"/gi,'\\"')}var yh,bh=function(){function CloudStorageService(t,a){void 0===a&&(a={}),this.GRAYKEY="AllGrayscaleConfig",this.MIXSTOREKEY="AllMixStorePolicy",this.config={},this.nosCdnHostTimer=0,this.grayConfig={mixStoreEnable:!1,timeStamp:0,ttl:0},this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=ch.nos,this.s3=null,this.mixStoreErrorCount=10,this.nosErrorCount=0,this.circuitTimer=0,this.ongoingTask=new zs,this.name="cloudStorage",this.logger=t.logger,this.core=t,registerParser({cmdMap:fh,cmdConfig:hh}),this.setOptions(a)}var t=CloudStorageService.prototype;return t.setOptions=function setOptions(t){void 0===t&&(t={});var a=t.storageKeyPrefix||"NIMClient";this.GRAYKEY=a+"-AllGrayscaleConfig",this.MIXSTOREKEY=a+"-AllMixStorePolicy";var u=t.s3,h=__rest(t,["s3"]),m=Ot({},vh,this.config);if(h&&Object.prototype.hasOwnProperty.call(h,"cdn")){var g={cdn:Ot(Ot({},m.cdn),h.cdn)};this.config=Ot({},m,h,g)}else this.config=Ot({},m,h);u&&(this.s3=u)},t.init=function init(){return __awaiter(this,void 0,void 0,rf.mark((function _callee(){return rf.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(this.grayConfig=null,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=ch.nos,this.mixStoreErrorCount=10,!this.config.isNeedToGetUploadPolicyFromServer){t.next=9;break}return t.next=7,this.getGrayscaleConfig(this.core.options.appkey);case 7:return t.next=9,this.getNosCdnHost();case 9:case"end":return t.stop()}}),_callee,this)})))},t.abortUploadTask=function abortUploadTask(){for(var t,a=_createForOfIteratorHelperLoose(values(u=this.ongoingTask).call(u));!(t=a()).done;){var u,h=t.value;h&&"function"==typeof h.abort&&h.abort()}this.ongoingTask.clear()},t.processCallback=function processCallback(t){var a=this,u=t.onUploadProgress,h=t.onUploadDone,m=t.onUploadStart,g=Ru();return{onUploadStart:"function"==typeof m?function(t){try{a.ongoingTask.set(g,t),m(t)}catch(t){a.logger.error("CloudStorage::uploadFile:options.onUploadStart execute error",t)}}:function(){},onUploadProgress:"function"==typeof u?function(t){try{u(t)}catch(t){a.logger.error("CloudStorage::uploadFile:options.onUploadProgress execute error",t)}}:function(){},onUploadDone:"function"==typeof h?function(t){try{a.ongoingTask.delete(g),h(t)}catch(t){a.logger.error("CloudStorage::uploadFile:options.onUploadDone execute error",t)}}:function(){}}},t.uploadFile=function uploadFile(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee2(){var a,u,h,m,g,b;return rf.wrap((function _callee2$(w){for(;;)switch(w.prev=w.next){case 0:if(validate({maxSize:{type:"number",required:!1},type:{type:"enum",values:["file","image","audio","video"]}},t),t.fileInput||t.file||t.filePath){w.next=3;break}throw new Error("uploadFile needs target file object or a filePath");case 3:if(!t.type||"file"===t.type){w.next=7;break}if("string"!=typeof(a=Mp(t,"file.type"))||-1!==indexOf(a).call(a,t.type)){w.next=7;break}throw new Error('The meta type "'+a+'" does not match "'+t.type+'"');case 7:return u=this.processCallback(t),h=u.onUploadStart,m=u.onUploadProgress,g=u.onUploadDone,t.onUploadStart=h,t.onUploadProgress=m,t.onUploadDone=g,w.next=13,this._uploadFile(t);case 13:return(b=w.sent).url=decodeURIComponent(b.url),t.onUploadDone({size:b.size,name:b.name,url:b.url,ext:b.name.split(".")[1]||"unknown"}),w.abrupt("return",b);case 17:case"end":return w.stop()}}),_callee2,this)})))},t._uploadFile=function _uploadFile(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee3(){var a,u;return rf.wrap((function _callee3$(h){for(;;)switch(h.prev=h.next){case 0:if(this.grayConfig&&this.grayConfig.mixStoreEnable&&this.mixStorePolicy.providers.length){h.next=3;break}return this.logger.log("uploadFile:: uploadFile begin, use old nos"),h.abrupt("return",this.nosUpload(t));case 3:return this.logger.log("uploadFile:: uploadFile begin,Current settings grayConfig mixStoreEnable:"+this.grayConfig.mixStoreEnable+" curProvider:"+this.curProvider),this.s3||(this.curProvider=ch.nos),a=gh,h.prev=6,h.next=9,this.core.sendCmd("getMixStoreToken",{mixStoreTokenReqTag:{provider:this.curProvider,tokenCount:1,tag:"qchat",returnBody:getUploadResponseFormat(t.type)}});case 9:u=h.sent,a=u.content.mixStoreTokenResTag,h.next=17;break;case 13:throw h.prev=13,h.t0=h.catch(6),this.core.logger.error("uploadFile:: getMixStoreToken error",h.t0),new cc("getMixStoreToken error",h.t0,this.curProvider,this.mixStorePolicy);case 17:return h.abrupt("return",this.curProvider===ch.s3?this.s3Upload(t,a):this.nosUpload(t,a));case 18:case"end":return h.stop()}}),_callee3,this,[[6,13]])})))},t.nosUpload=function nosUpload(t,a){var u,h;return __awaiter(this,void 0,void 0,rf.mark((function _callee4(){var m,g,b,w,x,k,S,_,C,T,M,E,P,O,I;return rf.wrap((function _callee4$(A){for(;;)switch(A.prev=A.next){case 0:if(m=Mp(this.core,"config.cdn.bucket"),g={tag:t.nosScenes||m||"nim",expireSec:t.nosSurvivalTime},a){A.next=13;break}return A.prev=3,A.next=6,this.core.sendCmd("getNosToken",{responseBody:getUploadResponseFormat(t.type),nosToken:g});case 6:b=A.sent,A.next=13;break;case 9:throw A.prev=9,A.t0=A.catch(3),this.core.logger.error("uploadFile:: getNosToken error",A.t0),new cc("getNosToken error",A.t0,1);case 13:return w=this.config.uploadReplaceFormat.replace("{host}",this.config.cdn.cdnDomain||this.config.cdn.defaultCdnDomain).replace("{object}",b?b.content.nosToken.objectName:null==a?void 0:a.objectName),x="",a&&a.shortUrl&&(x=a.shortUrl),k=x||w,A.prev=17,_=b?b.content.nosToken:a,this.core.logger.debug("uploadFile:: uploadFile params",{nosToken:_,chunkUploadHost:this.config.chunkUploadHost,chunkUploadHostBackupList:this.config.chunkUploadHostBackupList,commonUploadHost:this.config.commonUploadHost,commonUploadHostBackupList:this.config.commonUploadHostBackupList,platform:zf.platform}),A.next=22,this.core.adapters.uploadFile(Ot(Ot({},t),{nosToken:_,chunkUploadHost:this.config.chunkUploadHost,chunkUploadHostBackupList:this.config.chunkUploadHostBackupList,commonUploadHost:this.config.commonUploadHost,commonUploadHostBackupList:this.config.commonUploadHostBackupList,maxSize:t.maxSize||this.config.chunkMaxSize}));case 22:S=A.sent,A.next=48;break;case 25:if(A.prev=25,A.t1=A.catch(17),this.core.logger.error("uploadFile::nos uploadFile error",A.t1),10499!==Mp(A.t1,"errCode")){A.next=30;break}throw new cc(Mp(A.t1,"message")||"Request abort",A.t1,1);case 30:if(!a){A.next=47;break}if(!(this.nosErrorCount<=0)){A.next=43;break}A.prev=32,this._addCircuitTimer(),A.next=39;break;case 36:throw A.prev=36,A.t2=A.catch(32),new cc("upload file error",A.t2,this.curProvider,this.mixStorePolicy,t.file||t.filePath);case 39:return this.nosErrorCount=null===(u=this.mixStorePolicy.nosPolicy)||void 0===u?void 0:u.uploadConfig.retryPolicy.retry,A.abrupt("return",this._uploadFile(t));case 43:return this.nosErrorCount--,A.abrupt("return",this.nosUpload(t,a));case 45:A.next=48;break;case 47:throw new cc("nos uploadFile error",A.t1,1);case 48:if(C=null==S?void 0:S.type,T=C&&indexOf(C).call(C,"/")>-1?slice(C).call(C,0,indexOf(C).call(C,"/")):"",(M={image:"imageInfo",video:"vinfo",audio:"vinfo"})[T]){A.next=53;break}return A.abrupt("return",Ot({url:k},S));case 53:return A.prev=53,A.next=56,this.core.adapters.request(w+"?"+M[T],{method:"GET",dataType:"json",timeout:5e3},{exception_service:3});case 56:E=A.sent,A.next=63;break;case 59:return A.prev=59,A.t3=A.catch(53),this.core.logger.error("uploadFile:: fetch file info error",A.t3),A.abrupt("return",Ot({url:k},S));case 63:if(!E){A.next=70;break}return P=E.data,O="imageInfo"===M[T]?P:null===(h=null==P?void 0:P.GetVideoInfo)||void 0===h?void 0:h.VideoInfo,I={url:k,name:S.name,size:S.size,ext:S.ext,w:O.Width,h:O.Height,orientation:O.Orientation,dur:O.Duration,audioCodec:O.AudioCodec,videoCodec:O.VideoCodec,container:O.Container},A.abrupt("return",lh(I,(function(t,a){return void 0!==a})));case 70:return A.abrupt("return",Ot({url:k},S));case 71:case"end":return A.stop()}}),_callee4,this,[[3,9],[17,25],[32,36],[53,59]])})))},t.getNosCdnHost=function getNosCdnHost(){var t;return __awaiter(this,void 0,void 0,rf.mark((function _callee5(){var a,u,h,m=this;return rf.wrap((function _callee5$(g){for(;;)switch(g.prev=g.next){case 0:return g.prev=0,g.next=3,this.core.sendCmd("getNosCdnHost");case 3:a=g.sent,g.next=10;break;case 6:return g.prev=6,g.t0=g.catch(0),this.logger.error("getNosCdnHost::error",g.t0),g.abrupt("return");case 10:if(a){g.next=12;break}return g.abrupt("return");case 12:u=null===(t=null==a?void 0:a.content)||void 0===t?void 0:t.nosConfigTag,0!==(h=ms(null==u?void 0:u.expire))&&u.cdnDomain?-1===h?(this.config.cdn.bucket=u.bucket,this.config.cdn.cdnDomain=u.cdnDomain,this.config.cdn.objectNamePrefix=u.objectNamePrefix):(this.config.cdn.bucket=u.bucket,this.config.cdn.cdnDomain=u.cdnDomain,this.config.cdn.objectNamePrefix=u.objectNamePrefix,this.nosCdnHostTimer=this.core.timerManager.addTimer((function(){m.getNosCdnHost()}),1e3*h)):(this.config.cdn.bucket="",this.config.cdn.cdnDomain="",this.config.cdn.objectNamePrefix="");case 15:case"end":return g.stop()}}),_callee5,this,[[0,6]])})))},t.getGrayscaleConfig=function getGrayscaleConfig(t){var a;return __awaiter(this,void 0,void 0,rf.mark((function _callee6(){var u,h;return rf.wrap((function _callee6$(m){for(;;)switch(m.prev=m.next){case 0:if(zf.localStorage)try{zf.localStorage.getItem&&zf.localStorage.getItem(this.GRAYKEY)&&(this.grayConfig=JSON.parse(zf.localStorage.getItem(this.GRAYKEY))[t])}catch(t){zf.localStorage.getItem(this.GRAYKEY)&&this.core.logger.error("uploadFile:: JSON.parse grayscaleConfig error ",t)}if(this.grayConfig&&!(this.grayConfig.timeStamp+1e3*this.grayConfig.ttl<(new Date).getTime())){m.next=17;break}return m.next=4,this.core.sendCmd("getGrayscaleConfig",{config:{}});case 4:if(!(u=m.sent).content||!u.content.grayConfigTag){m.next=16;break}this.logger.log("uploadFile::getAppGrayConfigRequest success ");try{this.grayConfig=JSON.parse(u.content.grayConfigTag.config),this.grayConfig.ttl=JSON.parse(u.content.grayConfigTag.ttl)}catch(t){this.logger.error("getGrayscaleConfig error",t)}if(this.grayConfig){m.next=10;break}return m.abrupt("return");case 10:h=zf.localStorage.getItem(this.GRAYKEY)?JSON.parse(zf.localStorage.getItem(this.GRAYKEY)):{},this.grayConfig.timeStamp=(new Date).getTime(),h[t]=this.grayConfig,zf.localStorage.setItem(this.GRAYKEY,Hu(h)),m.next=17;break;case 16:this.logger.debug("uploadFile:: result grayConfig:",u.content);case 17:if(!(null===(a=this.grayConfig)||void 0===a?void 0:a.mixStoreEnable)){m.next=20;break}return m.next=20,this._getMixStorePolicy(t);case 20:case"end":return m.stop()}}),_callee6,this)})))},t._getMixStorePolicy=function _getMixStorePolicy(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee7(){var a,u,h,m,g,b,w;return rf.wrap((function _callee7$(x){for(;;)switch(x.prev=x.next){case 0:if(a=(new Date).getTime(),zf.localStorage)try{this.mixStorePolicy=JSON.parse(zf.localStorage.getItem(this.MIXSTOREKEY))[t],this.curProvider=ms(this.mixStorePolicy.providers[0]),this.mixStorePolicy.timeStamp&&this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl>a&&(h=this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl-a,this.core.timerManager.addTimer(bind$1(u=this._getMixStorePolicy).call(u,this,t),h))}catch(a){zf.localStorage.getItem(this.MIXSTOREKEY)&&JSON.parse(zf.localStorage.getItem(this.MIXSTOREKEY))[t]&&this.core.logger.error("uploadFile:: JSON.parse mixStorePolicy error ",a)}if(this.mixStorePolicy&&!(this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl<=a)){x.next=30;break}return x.prev=3,x.next=6,this.core.sendCmd("getMixStorePolicy",{supportType:this.s3?[1,2]:[1]});case 6:g=x.sent,b=g.content.mixStorePolicyTag,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.mixStorePolicy.ttl=Number(b.ttl),this.mixStorePolicy.providers=b.providers.split(","),this.circuitTimer&&this.core.timerManager.deleteTimer(this.circuitTimer),this.curProvider=ms(this.mixStorePolicy.providers[0]),this.mixStorePolicy.nosPolicy=b.nosPolicy?JSON.parse(b.nosPolicy):null,this.mixStorePolicy.s3Policy=b.s3Policy?JSON.parse(b.s3Policy):null,null===this.mixStorePolicy.s3Policy?this.mixStorePolicy.providers=["1"]:null===this.mixStorePolicy.nosPolicy?this.mixStorePolicy.providers=["2"]:this.mixStorePolicy.providers=this.mixStorePolicy.s3Policy.priority<this.mixStorePolicy.nosPolicy.priority?["2","1"]:["1","2"],this.core.timerManager.addTimer(bind$1(m=this._getMixStorePolicy).call(m,this,t),1e3*this.mixStorePolicy.ttl),w=zf.localStorage.getItem(this.MIXSTOREKEY)?JSON.parse(zf.localStorage.getItem(this.MIXSTOREKEY)):{},this.mixStorePolicy.timeStamp=(new Date).getTime(),w[t]=this.mixStorePolicy,zf.localStorage.setItem(this.MIXSTOREKEY,Hu(w)),x.next=30;break;case 23:if(x.prev=23,x.t0=x.catch(3),this.logger.error("getMixStorePolicy error",x.t0),0!==this.mixStoreErrorCount){x.next=28;break}throw new Error("getMixStorePolicy all count error");case 28:this._getMixStorePolicy(t),this.mixStoreErrorCount--;case 30:this.mixStorePolicy.nosPolicy&&(this.nosErrorCount=this.mixStorePolicy.nosPolicy.uploadConfig.retryPolicy.retry);case 31:case"end":return x.stop()}}),_callee7,this,[[3,23]])})))},t.s3Upload=function s3Upload(t,a){return __awaiter(this,void 0,void 0,rf.mark((function _callee8(){var u,h,m,g,b,w,x,k,S,_,C=this;return rf.wrap((function _callee8$(T){for(;;)switch(T.prev=T.next){case 0:if(!t.file){T.next=4;break}u=t.file,T.next=19;break;case 4:if("string"!=typeof t.fileInput){T.next=14;break}if(this.logger.warn("fileInput will abandon,Please use file or filepath"),!((h=document.getElementById(t.fileInput))&&h.files&&h.files[0])){T.next=11;break}u=h.files[0],T.next=12;break;case 11:throw new Error("Can not get file from fileInput");case 12:T.next=19;break;case 14:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){T.next=18;break}u=t.fileInput.files[0],T.next=19;break;case 18:throw new Error("Can not get file from fileInput "+t.fileInput);case 19:if(this.mixStorePolicy.s3Policy){T.next=21;break}throw new Error("dont get s3 policy");case 21:return m={accessKeyId:a.accessKeyId,secretAccessKey:a.secretAccessKey,sessionToken:a.sessionToken,region:a.region,maxRetries:this.mixStorePolicy.s3Policy.uploadConfig.retryPolicy.retry},g=this.s3,(b=new g).config.update(m),w=decodeURIComponent(a.bucket),x=decodeURIComponent(a.objectName),S={Bucket:w,Key:x,Body:k=u,Metadata:{token:a.token},ContentType:k.type||"application/octet-stream"},this.core.logger.debug("uploadFile:: s3 upload params:",S),(_=b.upload(S)).on("httpUploadProgress",(function(a){var u=ad((a.loaded/a.total).toFixed(2));t.onUploadProgress&&t.onUploadProgress({total:a.total,loaded:a.loaded,percentage:u,percentageText:Math.round(100*u)+"%"})})),T.abrupt("return",new Jo((function(u,h){var m=(new Date).getTime();_.send((function(g,b){var S;if(g&&"RequestAbortedError"===g.code)C.logger.error("uploadFile:","api::s3:upload file abort",g),h(new oc(g.message,g,10499));else if(g){C.logger.error("uploadFile:","api::s3:upload file failed",g),C.core.reporter.reportTraceStart("exceptions",{user_id:C.core.options.account,trace_id:null===(S=C.core.clientSocket.socket)||void 0===S?void 0:S.sessionId,start_time:m,action:1,exception_service:4}),C.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof g.status?g.status:"number"==typeof g.code?g.code:0,description:g.message||""+g.code,operation_type:1,target:Hu({bucket:w,object:x})},{asyncParams:zf.net.getNetworkStatus()}),C.core.reporter.reportTraceEnd("exceptions",1);try{C._addCircuitTimer()}catch(g){h(new cc("upload file error",g,C.curProvider,C.mixStorePolicy,t.file||t.filePath))}u(C._uploadFile(t))}else{var _=C.mixStorePolicy.s3Policy.cdnSchema;_=(_=_.replace("{cdnDomain}",C.mixStorePolicy.s3Policy.dlcdn)).replace("{objectName}",b.Key),u({size:k.size,name:k.name,url:a.shortUrl?a.shortUrl:_,ext:k.name.split(".")[1]||"unknown"})}})),t.onUploadStart&&t.onUploadStart(_)})));case 33:case"end":return T.stop()}}),_callee8,this)})))},t.getPrivateUrl=function getPrivateUrl(t){var a;if(!new RegExp(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/).test(t))return this.logger.error("illegal file url:"+t),"";var u=/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(t);u[0];var h=u[1];u[2];var m=u[3];u[4];var g=u[5];if(u[6],u[7],null===(a=this.grayConfig)||void 0===a?void 0:a.mixStoreEnable){var b=this._getUrlType(t);return b===ch.s3&&this.mixStorePolicy.s3Policy&&(t=this.mixStorePolicy.s3Policy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.s3Policy.dlcdn).replace("{objectName}",g)),b===ch.nos&&this.mixStorePolicy.nosPolicy&&(t=this.mixStorePolicy.nosPolicy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.nosPolicy.dlcdn).replace("{objectName}",g)),t}var w=this.config,x=w.downloadUrl,k=w.downloadHostList,S=w.nosCdnEnable,_=this.config.cdn.cdnDomain,C=this.config.cdn.objectNamePrefix?decodeURIComponent(this.config.cdn.objectNamePrefix):"",T=decodeURIComponent(g),M=indexOf(T).call(T,C);if(_&&M>-1&&S)return""+h+_+"/"+slice(T).call(T,M);if(includes(k).call(k,m)&&includes(g).call(g,"/")){var E=indexOf(g).call(g,"/"),P=g.substring(0,E),O=g.substring(E+1);return x.replace("{bucket}",P).replace("{object}",O)}var I=filter(k).call(k,(function(t){return"string"==typeof m&&includes(m).call(m,t)}))[0],A=I?m.replace(I,"").replace(/\W/g,""):null;return A?x.replace("{bucket}",A).replace("{object}",g):t},t.getOriginUrl=function getOriginUrl(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee9(){var a;return rf.wrap((function _callee9$(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.core.sendCmd("getOriginUrl",{nosSafeUrlTag:{safeUrl:t}});case 2:return a=u.sent,u.abrupt("return",a.content.nosSafeUrlTag.originUrl);case 4:case"end":return u.stop()}}),_callee9,this)})))},t.getFileToken=function getFileToken(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee10(){var a,u,h,m,g,b=this;return rf.wrap((function _callee10$(w){for(;;)switch(w.prev=w.next){case 0:if(validate({type:{type:"number",min:2,max:3},urls:{type:"array",required:!1,itemType:"string"}},t),a=this.mixStorePolicy.nosPolicy?this.mixStorePolicy.nosPolicy.authPolicy.policyType:null,u=this.mixStorePolicy.s3Policy?this.mixStorePolicy.s3Policy.authPolicy.policyType:null,a!==String(uh.dontNeed)||u!==String(uh.dontNeed)){w.next=8;break}throw this.logger.error("don't need token"),new Error("don't need token");case 8:if(t.type!==uh.time){w.next=17;break}if(!(a&&indexOf(a).call(a,String(uh.time))>=0||u&&indexOf(u).call(u,String(uh.time))>0)){w.next=13;break}return w.abrupt("return",this.getFileAuthToken(t));case 13:throw this.logger.error("don't support time token "),new Error("don't support type time token ");case 15:w.next=33;break;case 17:if(t.urls&&t.urls.length){w.next=20;break}throw this.logger.error("urls is required when urls token"),new Error("urls is required when urls token");case 20:if(m=[],g=[],forEach$1(h=t.urls).call(h,(function(t){var a=b._getUrlType(t);a===ch.nos&&g.push(t),a===ch.s3&&m.push(t)})),(!u||0!==m.length&&indexOf(u).call(u,String(uh.urls))<0)&&(this.logger.warn("s3 url don't support url token"),m=[]),(!a||0!==g.length&&indexOf(a).call(a,String(uh.urls))<0)&&(this.logger.warn("nos url don't support url token"),g=[]),0!==m.length||0!==g.length){w.next=30;break}throw this.logger.error("not support urls"),new Error("not support urls");case 30:if(0!==m.length&&0!==g.length){w.next=33;break}return t.urls=Hu(t.urls),w.abrupt("return",this.getFileAuthToken(t));case 33:case"end":return w.stop()}}),_callee10,this)})))},t.getFileAuthToken=function getFileAuthToken(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee11(){var a;return rf.wrap((function _callee11$(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.core.sendCmd("getFileAuthToken",{mixStoreAuthTokenReqTag:t});case 2:return a=u.sent,u.abrupt("return",a.content.mixStoreAuthTokenResTag);case 4:case"end":return u.stop()}}),_callee11,this)})))},t._getUrlType=function _getUrlType(t){var a,u;return this.mixStorePolicy.nosPolicy&&some(a=this.mixStorePolicy.nosPolicy.dlcdns).call(a,(function(a){return indexOf(t).call(t,a)>=0}))?ch.nos:this.mixStorePolicy.s3Policy&&some(u=this.mixStorePolicy.s3Policy.dlcdns).call(u,(function(a){return indexOf(t).call(t,a)>=0}))?ch.s3:null},t._addCircuitTimer=function _addCircuitTimer(){var t=this,a=this.mixStorePolicy.providers,u=a[(indexOf(a).call(a,String(this.curProvider))+1)%a.length];if(u===a[0])throw new Error("uploadFile all policy fail");var h=Mp(this.mixStorePolicy,"s3Policy.uploadConfig.retryPolicy");if(h&&h.retryNext&&u&&(this.logger.log("uploadFile:: upload policy will change,now policy:"+this.curProvider+" nextProvider:"+u),this.curProvider=ms(u),this.mixStorePolicy.nosPolicy&&this.mixStorePolicy.s3Policy)){var m=this.mixStorePolicy[this.curProvider===ch.nos?"nosPolicy":"s3Policy"].uploadConfig.retryPolicy.circuit;if(!m||0===m)return;this.circuitTimer=this.core.timerManager.addTimer((function(){t.logger.log("uploadFile:: upload policy will change,now policy:"+t.curProvider+" nextProvider:"+ms(t.mixStorePolicy.providers[0])),t.curProvider=ms(t.mixStorePolicy.providers[0]),t.core.timerManager.deleteTimer(t.circuitTimer)}),1e3*m)}},t.process=function process(t){return t.error&&!t.error.ignore?Jo.reject(t.error):Jo.resolve(t)},CloudStorageService}(),wh=function(t){function ChatroomMsgService(a){return t.call(this,"chatroomMsg",a)||this}_t(ChatroomMsgService,t);var a=ChatroomMsgService.prototype;return a.sendTextMsg=function sendTextMsg(t){return validate({body:{type:"string",allowEmpty:!1}},t),this.sendMsg(Ot(Ot({},t),{type:"text"}))},a.sendGeoLocationMsg=function sendGeoLocationMsg(t){return validate({body:{type:"object",rules:{title:{type:"string",allowEmpty:!1},lat:{type:"number"},lng:{type:"number"}}}},t),this.sendMsg(Ot(Ot({},t),{type:"geo",body:Hu(t.body)}))},a.sendTipMsg=function sendTipMsg(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee(){return rf.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),a.abrupt("return",this.sendMsg(Ot(Ot({},t),{type:"tip"})));case 2:case"end":return a.stop()}}),_callee,this)})))},a.sendCustomMsg=function sendCustomMsg(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee2(){return rf.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),a.abrupt("return",this.sendMsg(Ot(Ot({},t),{type:"custom"})));case 2:case"end":return a.stop()}}),_callee2,this)})))},a.sendImageMsg=function sendImageMsg(t){return this.doSendFile(Ot(Ot({},t),{type:"image"}))},a.sendFileMsg=function sendFileMsg(t){return this.doSendFile(Ot(Ot({},t),{type:"file"}))},a.sendAudioMsg=function sendAudioMsg(t){return this.doSendFile(Ot(Ot({},t),{type:"audio"}))},a.sendVideoMsg=function sendVideoMsg(t){return this.doSendFile(Ot(Ot({},t),{type:"video"}))},a.doSendFile=function doSendFile(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee3(){var a;return rf.wrap((function _callee3$(u){for(;;)switch(u.prev=u.next){case 0:if(validate({type:{type:"string",allowEmpty:!1},body:{type:"object",rules:{url:{type:"string",allowEmpty:!1}},required:!1},maxSize:{type:"number",min:1,required:!1}},t),a=t.body){u.next=15;break}if(this.core.cloudStorage&&this.core.cloudStorage.uploadFile){u.next=5;break}throw new Error('Service "cloudStorage" does not exist');case 5:return u.prev=5,u.next=8,this.core.cloudStorage.uploadFile(t);case 8:a=u.sent,u.next=15;break;case 11:throw u.prev=11,u.t0=u.catch(5),this.logger.error("sendFile:: upload File error or abort",u.t0),u.t0;case 15:return u.abrupt("return",this.sendMsg(Ot(Ot({},t),{body:Hu(a),type:t.type})));case 16:case"end":return u.stop()}}),_callee3,this,[[5,11]])})))},a.queryMessageHistory=function queryMessageHistory(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee4(){var a,u,h;return rf.wrap((function _callee4$(m){for(;;)switch(m.prev=m.next){case 0:return validate({timetag:{type:"number",required:!1},limit:{type:"number",min:1,max:100,required:!1},reverse:{type:"boolean",required:!1},msgTypes:{type:"array",itemType:"string",required:!1}},t),m.next=3,this.core.sendCmd("chatroomQueryMessageHistory",Ot(Ot({timetag:0,limit:100,reverse:!1},t),{msgTypes:t.msgTypes?map$6(a=t.msgTypes).call(a,(function(t){return zp[t]})):[]}));case 3:return u=m.sent,h=u.content.chatroomMsgs,m.abrupt("return",formatChatroomMsgs(h,this.core.account));case 6:case"end":return m.stop()}}),_callee4,this)})))},a.getHistoryMsgsByTags=function getHistoryMsgsByTags(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee5(){var a,u,h,m,g;return rf.wrap((function _callee5$(b){for(;;)switch(b.prev=b.next){case 0:return validate({tags:{type:"array",itemType:"string",required:!0},types:{type:"array",itemType:"string",required:!1},fromTime:{type:"number",min:0,required:!1},toTime:{type:"number",min:0,required:!1},limit:{type:"number",min:0,required:!1},reverse:{type:"number",required:!1}},t),h=Ot(Ot({fromTime:0,toTime:0,limit:100,reverse:0},t),{types:t.types?map$6(a=filter(u=t.types).call(u,(function(t){return void 0!==zp[t]}))).call(a,(function(t){return zp[t]})):[]}),b.next=4,this.core.sendCmd("getHistoryMsgsByTags",{chatRoomTagHistoryMsgRequestTag:Ot(h,{tags:Hu(h.tags),types:Hu(h.types)})});case 4:return m=b.sent,g=m.content.chatroomMsgs,b.abrupt("return",formatChatroomMsgs(g,this.core.account));case 7:case"end":return b.stop()}}),_callee5,this)})))},a.onChatroomMsgHandler=function onChatroomMsgHandler(t){var a=t.content,u=Zo(),h=formatChatroomMsg(null==a?void 0:a.chatroomMsg,this.core.account);if("debug"===this.core.options.debugLevel?this.logger.debug("onChatroomMsgHandler::recvMsg",h.type,h.idClient,h):this.logger.log("onChatroomMsgHandler::recvMsg",h.type,h.idClient),this.core.emit("chatroomMsg",h),"out"!==h.flow){var m={msgId:"",clientId:h.idClient,receiveTime:t.__receiveTime,serverTime:h.time,callbackTime:Zo(),preHandleTime:u,fromAccid:h.from,toAccid:this.core.account,type:4,roomId:h.chatroomId,tid:"",result:200,failReason:"",rt:Zo()-h.time};this.core.reporter.report("msgReceive",m)}},a.sendMsg=function sendMsg(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee6(){var a,u,h,m,g;return rf.wrap((function _callee6$(b){for(;;)switch(b.prev=b.next){case 0:validate({type:{type:"enum",values:getEnumKeys(zp)},subType:{type:"number",min:1,required:!1}},t),a=generatorMsgForCmd(t,this.core.account,this.core.config.deviceId),u=formatChatroomMsg(Ot(Ot({},a),{status:"sending",time:(new Date).getTime()}),this.core.account);try{t.onSendBefore&&t.onSendBefore(u)}catch(t){this.core.logger.error("sendMsg: options.onSendBefore error",t)}return b.prev=4,b.next=7,this.core.sendCmd("sendChatroomMsg",{chatroomMsg:a});case 7:return h=b.sent,m=formatChatroomMsg(Ot(Ot(Ot({},a),h.content.chatroomMsg),{status:"success"}),this.core.account),this.core.reporter.report("msgSend",{msgId:"",clientId:m.idClient,msgTime:m.time,fromAccid:this.core.account,toAccid:"",type:4,roomId:m.chatroomId,tid:"",result:200,failReason:"",rt:Zo()-u.time}),b.abrupt("return",m);case 13:throw b.prev=13,b.t0=b.catch(4),g=formatChatroomMsg(Ot(Ot({},a),{status:"fail"}),this.core.account),b.t0.msg=g,this.core.reporter.report("msgSend",{msgId:"",clientId:g.idClient,fromAccid:this.core.account,toAccid:"",type:4,roomId:g.chatroomId,tid:"",result:null===b.t0||void 0===b.t0?void 0:b.t0.code,failReason:(null===b.t0||void 0===b.t0?void 0:b.t0.message)||"",rt:Zo()-a.time}),b.t0;case 19:case"end":return b.stop()}}),_callee6,this,[[4,13]])})))},ChatroomMsgService}(up);!function(t){t[t.regular=0]="regular",t[t.temp=1]="temp",t[t.regularOnline=2]="regularOnline",t[t.regularReverse=3]="regularReverse"}(yh||(yh={}));var xh=function(t){function ChatroomMemberService(a){return t.call(this,"chatroomMember",a)||this}_t(ChatroomMemberService,t);var a=ChatroomMemberService.prototype;return a.updateMyRoomRole=function updateMyRoomRole(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee(){return rf.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({member:{type:"object",rules:{nick:{type:"string",required:!1},avatar:{type:"string",required:!1},ext:{type:"string",required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1},needSave:{type:"boolean",required:!1}},t),a.next=3,this.core.sendCmd("chatroomUpdateMyRoomRole",Ot(Ot({},t),{chatroomMember:t.member,ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee,this)})))},a.setMemberManager=function setMemberManager(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee2(){return rf.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(Ot(Ot({},t),{type:1}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee2,this)})))},a.setMemberNormal=function setMemberNormal(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee3(){return rf.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(Ot(Ot({},t),{type:2}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee3,this)})))},a.setMemberMute=function setMemberMute(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee4(){return rf.wrap((function _callee4$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(Ot(Ot({},t),{type:-2}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee4,this)})))},a.setMemberBlackList=function setMemberBlackList(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee5(){return rf.wrap((function _callee5$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(Ot(Ot({},t),{type:-1}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee5,this)})))},a.queryMembers=function queryMembers(t){var a;return __awaiter(this,void 0,void 0,rf.mark((function _callee6(){var u;return rf.wrap((function _callee6$(h){for(;;)switch(h.prev=h.next){case 0:return validate({type:{type:"enum",values:getEnumKeys(yh)},time:{type:"number",required:!1},limit:{type:"number",required:!1}},t),h.next=3,this.core.sendCmd("chatroomQueryMembers",Ot(Ot({time:0,limit:100},t),{type:yh[t.type]}));case 3:return u=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=u.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee6,this)})))},a.queryMembersByAccounts=function queryMembersByAccounts(t){var a;return __awaiter(this,void 0,void 0,rf.mark((function _callee7(){var u;return rf.wrap((function _callee7$(h){for(;;)switch(h.prev=h.next){case 0:return validate({accounts:{type:"array",min:1,max:20,itemType:"string"}},t),h.next=3,this.core.sendCmd("chatroomQueryMembersByAccounts",t);case 3:return u=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=u.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee7,this)})))},a.setMemberTempMute=function setMemberTempMute(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee8(){return rf.wrap((function _callee8$(a){for(;;)switch(a.prev=a.next){case 0:return validate({account:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean",required:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomSetMemberTempMute",Ot(Ot({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee8,this)})))},a.kickMember=function kickMember(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee9(){return rf.wrap((function _callee9$(a){for(;;)switch(a.prev=a.next){case 0:return validate({account:{type:"string",allowEmpty:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomKickMember",Ot(Ot({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee9,this)})))},a.queryMembersCountByTag=function queryMembersCountByTag(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee10(){var a;return rf.wrap((function _callee10$(u){for(;;)switch(u.prev=u.next){case 0:return validate({tag:{type:"string",allowEmpty:!1}},t),u.next=3,this.core.sendCmd("chatroomQueryMembersCountByTag",Ot({},t));case 3:return a=u.sent,u.abrupt("return",a.content.count);case 5:case"end":return u.stop()}}),_callee10,this)})))},a.queryMembersByTag=function queryMembersByTag(t){var a;return __awaiter(this,void 0,void 0,rf.mark((function _callee11(){var u;return rf.wrap((function _callee11$(h){for(;;)switch(h.prev=h.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},time:{type:"number",required:!1},limit:{type:"number",max:100,required:!1}},t),h.next=3,this.core.sendCmd("chatroomQueryMembersByTag",{chatroomTagMemberReq:Ot({time:0,limit:100},t)});case 3:return u=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=u.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee11,this)})))},a.setMembersTempMuteByTag=function setMembersTempMuteByTag(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee12(){return rf.wrap((function _callee12$(a){for(;;)switch(a.prev=a.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean"},notifyTargetTags:{type:"string",allowEmpty:!1,required:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomSetMembersTempMuteByTag",{chatroomTagMuteReq:Ot(Ot({},t),{needNotify:t.needNotify?1:0,ext:t.ext||""})});case 3:case"end":return a.stop()}}),_callee12,this)})))},a.markChatroomMember=function markChatroomMember(t){var a;return __awaiter(this,void 0,void 0,rf.mark((function _callee13(){var u;return rf.wrap((function _callee13$(h){for(;;)switch(h.prev=h.next){case 0:return validate({account:{type:"string"},isAdd:{type:"boolean"},ext:{type:"string",required:!1},level:{type:"number",required:!1}},t),h.next=3,this.core.sendCmd("markChatroomMember",Ot(Ot({level:0},t),{ext:t.ext||""}));case 3:return u=h.sent,h.abrupt("return",formatChatroomMember(null===(a=u.content)||void 0===a?void 0:a.chatroomMember));case 5:case"end":return h.stop()}}),_callee13,this)})))},ChatroomMemberService}(up),kh=function(t){function ChatroomQueueService(a){return t.call(this,"chatroomQueue",a)||this}_t(ChatroomQueueService,t);var a=ChatroomQueueService.prototype;return a.init=function init(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee(){return rf.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({maxItemCount:{type:"number",min:0,max:1e3}},t),a.next=3,this.core.sendCmd("chatroomQueueInit",t);case 3:case"end":return a.stop()}}),_callee,this)})))},a.update=function update(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee2(){return rf.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({elementKey:{type:"string",allowEmpty:!1},elementValue:{type:"string",max:4096,allowEmpty:!1},transient:{type:"boolean",required:!1},account:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomQueueOffer",Ot(Ot({},t),{transient:!!t.transient}));case 3:case"end":return a.stop()}}),_callee2,this)})))},a.poll=function poll(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee3(){var a;return rf.wrap((function _callee3$(u){for(;;)switch(u.prev=u.next){case 0:return validate({key:{type:"string",required:!1}},t),t.key||(t.key=""),u.next=4,this.core.sendCmd("chatroomQueuePoll",t||{});case 4:return a=u.sent,u.abrupt("return",a.content);case 6:case"end":return u.stop()}}),_callee3,this)})))},a.batchUpdate=function batchUpdate(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee4(){var a;return rf.wrap((function _callee4$(u){for(;;)switch(u.prev=u.next){case 0:return validate({itemList:{type:"object"},needNotify:{type:"boolean",required:!1},notifyExtension:{type:"string",required:!1}},t),u.next=3,this.core.sendCmd("chatroomQueueChange",Ot(Ot({},t),{needNotify:!!t.needNotify}));case 3:return a=u.sent,u.abrupt("return",a.content.invalidKeyList);case 5:case"end":return u.stop()}}),_callee4,this)})))},a.fetch=function fetch(){return __awaiter(this,void 0,void 0,rf.mark((function _callee5(){var t;return rf.wrap((function _callee5$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("chatroomQueueList");case 2:return t=a.sent,a.abrupt("return",t.content.itemList);case 4:case"end":return a.stop()}}),_callee5,this)})))},a.pickHeader=function pickHeader(){return __awaiter(this,void 0,void 0,rf.mark((function _callee6(){var t,a,u,h;return rf.wrap((function _callee6$(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,this.core.sendCmd("chatroomQueuePeak");case 2:return a=m.sent,u=a.content.elementKey,h=a.content.elementValue,m.abrupt("return",((t={})[u]=h,t));case 6:case"end":return m.stop()}}),_callee6,this)})))},a.clear=function clear(){return __awaiter(this,void 0,void 0,rf.mark((function _callee7(){return rf.wrap((function _callee7$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.core.sendCmd("chatroomQueueDrop");case 2:case"end":return t.stop()}}),_callee7,this)})))},ChatroomQueueService}(up),Sh={"1_2":"heartbeat","13_2":"chatroomLogin","13_3":"beKickedFromChatroom","13_4":"chatroomExit","13_6":"sendChatroomMsg","13_7":"onChatroomMsg","13_8":"chatroomQueryMembers","13_9":"chatroomQueryMessageHistory","13_11":"markChatroomMember","13_12":"closeChatroom","13_13":"getChatroom","13_14":"updateChatroom","13_15":"chatroomUpdateMyRoomRole","13_16":"chatroomQueryMembersByAccounts","13_17":"chatroomKickMember","13_19":"chatroomSetMemberTempMute","13_20":"chatroomQueueOffer","13_21":"chatroomQueuePoll","13_22":"chatroomQueueList","13_23":"chatroomQueuePeak","13_24":"chatroomQueueDrop","13_25":"chatroomQueueInit","13_26":"chatroomQueueChange","13_30":"chatroomSetMembersTempMuteByTag","13_31":"chatroomQueryMembersByTag","13_32":"chatroomQueryMembersCountByTag","13_36":"getHistoryMsgsByTags","13_101":"updateChatroomTag"},_h={chatroomLogin:{appkey:1,account:2,deviceId:3,chatroomId:5,appLogin:8,chatroomNick:20,chatroomAvatar:21,chatroomExt:22,chatroomEnterExt:23,session:26,isAnonymous:38,tags:39,notifyTargetTags:40,authType:41,loginExt:42},chatroomIMLogin:{clientType:3,os:4,sdkVersion:6,appLogin:8,protocolVersion:9,pushTokenName:10,pushToken:11,deviceId:13,appkey:18,account:19,browser:24,session:26,deviceInfo:32,token:1e3,customTag:38,customClientType:39,sdkHumanVersion:40,hostEnv:41,userAgent:42,libEnv:44,isReactNative:112,authType:115,loginExt:116},chatroomMsg:{idClient:1,type:2,body:3,ext:4,resend:5,userUpdateTime:6,fromNick:7,fromAvatar:8,fromExt:9,needAntiSpam:10,antiSpamContent:11,skipHistory:12,messageBody:13,antiSpamBusinessId:14,clientAntiSpam:15,antiSpamUsingYidun:16,time:20,from:21,chatroomId:22,fromClientType:23,highPriority:25,callbackExt:27,subType:28,yidunAntiCheating:29,env:30,notifyTargetTags:31,yidunAntiSpamExt:32,yidunAntiSpamRes:33},chatroom:{id:1,name:3,announcement:4,broadcastUrl:5,ext:12,createTime:14,updateTime:15,queuelevel:16,creator:100,onlineMemberNum:101,mute:102},chatroomMember:{chatroomId:1,account:2,type:3,level:4,nick:5,avatar:6,ext:7,online:8,guest:9,enterTime:10,blacked:12,muted:13,valid:14,updateTime:15,tempMuted:16,tempMuteDuration:17},chatroomTagMemberReq:{tag:1,time:2,limit:3},chatroomTagMuteReq:{tag:1,duration:2,needNotify:3,ext:4,notifyTargetTags:5},chatroomCdnInfo:{enable:1,cdnUrls:2,timestamp:3,interval:4,decryptType:5,decryptKey:6,timeout:7},chatRoomTagHistoryMsgRequestTag:{tags:1,types:2,fromTime:3,toTime:4,limit:5,reverse:6},updateTags:{currentTags:1}},Ch=invertSerializeMap(_h),Th={heartbeat:{sid:1,cid:2,service:"chatroom"},chatroomLogin:{sid:13,cid:2,service:"chatroom",params:[{type:"Byte",name:"type"},{type:"Property",name:"chatroomLogin",reflectMapper:_h.chatroomLogin},{type:"Property",name:"chatroomIMLogin",reflectMapper:_h.chatroomIMLogin}],response:[{type:"Property",name:"chatroom",reflectMapper:Ch.chatroom},{type:"Property",name:"chatroomMember",reflectMapper:Ch.chatroomMember},{type:"Property",name:"chatroomCdnInfo",reflectMapper:Ch.chatroomCdnInfo}]},chatroomExit:{sid:13,cid:4,service:"chatroom"},sendChatroomMsg:{sid:13,cid:6,service:"chatroomMsg",params:[{type:"Property",name:"chatroomMsg",reflectMapper:_h.chatroomMsg}],response:[{type:"Property",name:"chatroomMsg",reflectMapper:Ch.chatroomMsg}]},chatroomQueryMessageHistory:{sid:13,cid:9,service:"chatroomMsg",params:[{type:"Long",name:"timetag"},{type:"Int",name:"limit"},{type:"Bool",name:"reverse"},{type:"LongArray",name:"msgTypes"}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:Ch.chatroomMsg}]},getHistoryMsgsByTags:{sid:13,cid:36,service:"chatroomMsg",params:[{type:"Property",name:"chatRoomTagHistoryMsgRequestTag",reflectMapper:_h.chatRoomTagHistoryMsgRequestTag}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:Ch.chatroomMsg}]},getChatroom:{sid:13,cid:13,service:"chatroom",response:[{type:"Property",name:"chatroom",reflectMapper:Ch.chatroom}]},updateChatroom:{sid:13,cid:14,service:"chatroom",params:[{type:"Property",name:"chatroom",reflectMapper:_h.chatroom},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"}]},chatroomUpdateMyRoomRole:{sid:13,cid:15,service:"chatroomMember",params:[{type:"Property",name:"chatroomMember",reflectMapper:_h.chatroomMember},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"},{type:"Bool",name:"needSave"}]},markChatroomMember:{sid:13,cid:11,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Int",name:"type"},{type:"Bool",name:"isAdd"},{type:"Int",name:"level"},{type:"String",name:"ext"}],response:[{type:"Property",name:"chatroomMember",reflectMapper:Ch.chatroomMember}]},chatroomQueryMembers:{sid:13,cid:8,service:"chatroomMember",params:[{type:"Byte",name:"type"},{type:"Long",name:"time"},{type:"Int",name:"limit"}],response:[{type:"PropertyArray",name:"members",reflectMapper:Ch.chatroomMember}]},chatroomQueryMembersByAccounts:{sid:13,cid:16,service:"chatroomMember",params:[{type:"StrArray",name:"accounts"}],response:[{type:"PropertyArray",name:"members",reflectMapper:Ch.chatroomMember}]},chatroomKickMember:{sid:13,cid:17,service:"chatroomMember",params:[{type:"string",name:"account"},{type:"string",name:"ext"}]},chatroomSetMemberTempMute:{sid:13,cid:19,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Long",name:"duration"},{type:"bool",name:"needNotify"},{type:"String",name:"ext"}]},closeChatroom:{sid:13,cid:12,service:"chatroom",params:[{type:"String",name:"ext"}]},chatroomQueryMembersCountByTag:{sid:13,cid:32,service:"chatroomMember",params:[{type:"String",name:"tag"}],response:[{type:"Long",name:"count"}]},chatroomQueryMembersByTag:{sid:13,cid:31,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMemberReq",reflectMapper:_h.chatroomTagMemberReq}],response:[{type:"PropertyArray",name:"members",reflectMapper:Ch.chatroomMember}]},chatroomSetMembersTempMuteByTag:{sid:13,cid:30,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMuteReq",reflectMapper:_h.chatroomTagMuteReq}]},chatroomQueueOffer:{sid:13,cid:20,service:"chatroomQueue",params:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"},{type:"bool",name:"transient"},{type:"String",name:"account"}]},chatroomQueuePoll:{sid:13,cid:21,service:"chatroomQueue",params:[{type:"String",name:"key"}],response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueChange:{sid:13,cid:26,service:"chatroomQueue",params:[{type:"StrStrMap",name:"itemList"},{type:"bool",name:"needNotify"},{type:"String",name:"notifyExtension"}],response:[{type:"StrArray",name:"invalidKeyList"}]},chatroomQueueList:{sid:13,cid:22,service:"chatroomQueue",response:[{type:"KVArray",name:"itemList"}]},chatroomQueuePeak:{sid:13,cid:23,service:"chatroomQueue",response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueDrop:{sid:13,cid:24,service:"chatroomQueue"},chatroomQueueInit:{sid:13,cid:25,service:"chatroomQueue",params:[{type:"Int",name:"maxItemCount"}]},onChatroomMsg:{sid:13,cid:7,service:"chatroomMsg",response:[{type:"Property",name:"chatroomMsg",reflectMapper:Ch.chatroomMsg}]},beKickedFromChatroom:{sid:13,cid:3,service:"auth",response:[{type:"Number",name:"reason"},{type:"String",name:"ext"}]},updateChatroomTag:{sid:13,cid:101,service:"chatroom",response:[{type:"Property",name:"updateTags",reflectMapper:Ch.updateTags}]}};function getIsDataReportEnable(t){var a,u,h=!0;return"boolean"==typeof(null===(a=null==t?void 0:t.reportConfig)||void 0===a?void 0:a.enableCompass)?h=t.reportConfig.enableCompass:"boolean"==typeof(null===(u=null==t?void 0:t.reportConfig)||void 0===u?void 0:u.isDataReportEnable)&&(h=t.reportConfig.isDataReportEnable),h}var Mh={debugLevel:"off",needReconnect:!0,reconnectionAttempts:9007199254740991,autoMarkRead:!0,isAbtestEnable:!0,abtestUrl:"https://abt-online.netease.im/v1/api/abt/client/getExperimentInfo",abtestProjectKey:$f},Eh=function(t){function Chatroom(a,u){var m,g;void 0===u&&(u={}),(m=t.call(this)||this).instanceName="Chatroom",m.status="unconnected",m.account="",m.eventBus=new gi,m.options={},m.chatroom={},m.chatroomMsg={},m.chatroomMember={},m.chatroomQueue={},m.cloudStorage={},m.logger=new Yl(a.debugLevel,a.account),m.setInitOptions(a),registerParser({cmdMap:Sh,cmdConfig:Th}),m.otherOptions=u,m.timerManager=new cp,m.adapters=new Kf(h(m)),m.abtest=new Vf(h(m),{isAbtestEnable:m.options.isAbtestEnable,abtestUrl:m.options.abtestUrl,abtestProjectKey:$f});var b=zf.localStorage.getItem("__NIM_DEVC_ID__");m.options.isFixedDeviceId?(b=zf.localStorage.getItem("__NIM_DEVC_ID__")||Ru(),zf.localStorage.setItem("__NIM_DEVC_ID__",b)):b=Ru(),m.config={timeout:8e3,deviceId:b};var w=zf.getSystemInfo();null===(g=null==u?void 0:u.reportConfig)||void 0===g||g.isDataReportEnable;var x=function getCompassDataEndpoint(t,a){var u,h,m=null===(u=null==a?void 0:a.reportConfig)||void 0===u?void 0:u.compassDataEndpoint,g=null===(h=null==a?void 0:a.reportConfig)||void 0===h?void 0:h.reportConfigUrl;if(m)return m;if(g){var b=g.match(/^https:\/\/([^/]+)\/*/);return Wu(b)&&b.length>=1?"https://"+b[1]:(t.error("Invalid reportConfigUrl: "+g),Wf)}return Wf}(m.logger,m.otherOptions);return m.reporter=new ts({compassDataEndpoint:x,isDataReportEnable:getIsDataReportEnable(m.otherOptions),common:{app_key:a.appkey,dev_id:"",platform:"Web",sdk_ver:"0.19.2",env:"online",os_name:w.os,os_ver:w.osVer,lib_env:w.libEnv,model:w.model,manufactor:w.manufactor,host_env:w.hostEnv,host_env_ver:w.hostEnvVer},request:zf.request,logger:m.logger,autoStart:!0}),zf.setLogger(m.logger),m.auth=new Xp(h(m)),m.clientSocket=new Bp(h(m)),m.chatroom=new Zp(h(m)),m.chatroomMsg=new wh(h(m)),m.chatroomMember=new xh(h(m)),m.chatroomQueue=new kh(h(m)),m.cloudStorage=new bh(h(m),Ot({storageKeyPrefix:m.instanceName},u.cloudStorageConfig)),Chatroom.instance=h(m),m.logger.log("Chatroom init, version ","0.19.2"," sdk version ",91602," appkey ",a.appkey),m}_t(Chatroom,t),Chatroom.getInstance=function getInstance(t,a){if(!Chatroom.instance){if(t)return new Chatroom(t,a);throw new Error("Instance not exist, please input options")}if(t){if(Chatroom.instance.options.account===t.account&&Chatroom.instance.options.appkey===t.appkey)return Chatroom.instance.setOptions(t),Chatroom.instance;throw new Error("Unexpected login")}return Chatroom.instance};var a=Chatroom.prototype;return a.setOptions=function setOptions(t){if("object"==typeof t&&null!==t&&(Object.prototype.hasOwnProperty.call(t,"account")&&t.account!==this.options.account||Object.prototype.hasOwnProperty.call(t,"appkey")&&t.appkey!==this.options.appkey))throw new Error("chatroom::setOptions account and appkey is not allowed to reset");validate({token:{type:"string",required:!1},chatroomId:{type:"string",required:!1},chatroomAddresses:{type:"array",itemType:"string",min:1,required:!1},needReconnect:{type:"boolean",required:!1},reconnectionAttempts:{type:"number",required:!1},isAnonymous:{type:"boolean",required:!1},tags:{type:"array",itemType:"string",required:!1}},t),this.logger.log("chatroom::setOptions options is",t),this.options=Ot(Ot({},this.options),t)},a.setInitOptions=function setInitOptions(t){validate({account:{type:"string"},appkey:{type:"string"},token:{type:"string"},chatroomId:{type:"string"},chatroomAddresses:{type:"array",itemType:"string",min:1},needReconnect:{type:"boolean",required:!1},reconnectionAttempts:{type:"number",required:!1},isAnonymous:{type:"boolean",required:!1},tags:{type:"array",itemType:"string",required:!1}},t),this.logger&&this.logger.log("chatroom::setInitOptions options is",t),this.account=t.account,this.options=Ot(Ot({},Mh),t)},a.connect=function connect(t){return void 0===t&&(t={}),this.auth.login(t)},a.disconnect=function disconnect(){var t,a=this;switch(null===(t=this.cloudStorage)||void 0===t||t.abortUploadTask(),this.status){case"logined":return this.sendCmd("chatroomExit",void 0,{timeout:1e3}).then((function(){a.clientSocket.doDisconnect(Rp.ACTIVE,"UserActiveDisconnect")})).catch((function(t){a.logger.error("Instance::disconnect sendCmd:logout error",t),a.clientSocket.doDisconnect(Rp.ACTIVE,"UserActiveDisconnect")}));case"connected":case"connecting":case"waitReconnect":return this.clientSocket.doDisconnect(Rp.ACTIVE,"UserActiveDisconnect"),Jo.resolve();case"unconnected":case"destroyed":return Jo.resolve()}},a.destroy=function destroy(){var t=this;return Chatroom.instance=null,this.disconnect().then((function(){t.status="destroyed",t.removeAllListeners(),t.eventBus.removeAllListeners(),t.logger.destroy(),t.reporter.destroy(),t.timerManager.destroy(),t.connect=emptyFuncWithPromise,t.disconnect=emptyFuncWithPromise,t.destroy=emptyFuncWithPromise}))},a.sendCmd=function sendCmd(t,a,u){return this.clientSocket.sendCmd(t,a,u)},a.emit=function emit(a){var u=this;try{for(var h,m,g=Zo(),b=arguments.length,w=new Array(b>1?b-1:0),x=1;x<b;x++)w[x-1]=arguments[x];var k=(h=t.prototype.emit).call.apply(h,concat(m=[this,a]).call(m,w)),S=Zo()-g;return S>=10&&this.logger.warn("Core::emit event: "+a+" process takes: "+S+"ms"),k}catch(t){return this.logger.error("Core::emit event: "+a+". Error: "+t),mi((function(){throw u.logger.error("Core::emit throw error in setTimeout. event: "+a+". Error: "+t),t}),0),!1}},Chatroom}(gi);Eh.instance=null,Eh.setAdapters=function setAdapters(t){Ff(zf,t)};var Ph=Math.min,Oh=[].lastIndexOf,Ih=!!Oh&&1/[1].lastIndexOf(1,-0)<0,Ah=arrayMethodIsStrict("lastIndexOf"),jh=Ih||!Ah?function lastIndexOf(t){if(Ih)return k(Oh,this,arguments)||0;var a=toIndexedObject(this),u=lengthOfArrayLike(a),h=u-1;for(arguments.length>1&&(h=Ph(h,toIntegerOrInfinity(arguments[1]))),h<0&&(h=u+h);h>=0;h--)if(h in a&&a[h]===t)return h||0;return-1}:Oh;_export({target:"Array",proto:!0,forced:jh!==[].lastIndexOf},{lastIndexOf:jh});var Rh=entryVirtual("Array").lastIndexOf,Lh=Array.prototype,lastIndexOf=function(t){var a=t.lastIndexOf;return t===Lh||z(Lh,t)&&a===Lh.lastIndexOf?Rh:a},Fh=createCommonjsModule((function(a,u){(function(){var h={function:!0,object:!0}[typeof window]&&window||this,m=u,g=a&&!a.nodeType&&a,b=m&&g&&"object"==typeof t&&t;!b||b.global!==b&&b.window!==b&&b.self!==b||(h=b);var w=Math.pow(2,53)-1,x=/\bOpera/,k=Object.prototype,S=k.hasOwnProperty,_=k.toString;function capitalize(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function format(t){return t=trim(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:capitalize(t)}function forOwn(t,a){for(var u in t)S.call(t,u)&&a(t[u],u,t)}function getClassOf(t){return null==t?capitalize(t):_.call(t).slice(8,-1)}function qualify(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function reduce(t,a){var u=null;return function each(t,a){var u=-1,h=t?t.length:0;if("number"==typeof h&&h>-1&&h<=w)for(;++u<h;)a(t[u],u,t);else forOwn(t,a)}(t,(function(h,m){u=a(u,h,m,t)})),u}function trim(t){return String(t).replace(/^ +| +$/g,"")}var C=function parse(t){var a=h,u=t&&"object"==typeof t&&"String"!=getClassOf(t);u&&(a=t,t=null);var m=a.navigator||{},g=m.userAgent||"";t||(t=g);var b,w,k=u?!!m.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(_.toString()),S="Object",C=u?S:"ScriptBridgingProxyObject",T=u?S:"Environment",M=u&&a.java?"JavaPackage":getClassOf(a.java),E=u?S:"RuntimeObject",P=/\bJava/.test(M)&&a.java,O=P&&getClassOf(a.environment)==T,I=P?"a":"α",A=P?"b":"β",j=a.document||{},R=a.operamini||a.opera,L=x.test(L=u&&R?R["[[Class]]"]:getClassOf(R))?L:R=null,N=t,U=[],D=null,B=t==g,q=B&&R&&"function"==typeof R.version&&R.version(),G=function getLayout(a){return reduce(a,(function(a,u){return a||RegExp("\\b"+(u.pattern||qualify(u))+"\\b","i").exec(t)&&(u.label||u)}))}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),H=function getName(a){return reduce(a,(function(a,u){return a||RegExp("\\b"+(u.pattern||qualify(u))+"\\b","i").exec(t)&&(u.label||u)}))}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),z=getProduct([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),K=function getManufacturer(a){return reduce(a,(function(a,u,h){return a||(u[z]||u[/^[a-z]+(?: +[a-z]+\b)*/i.exec(z)]||RegExp("\\b"+qualify(h)+"(?:\\b|\\w*\\d)","i").exec(t))&&h}))}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),$=function getOS(a){return reduce(a,(function(a,u){var h=u.pattern||qualify(u);return!a&&(a=RegExp("\\b"+h+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(a=function cleanupOS(t,a,u){var h={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return a&&u&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(h=h[/[\d.]+$/.exec(t)])&&(t="Windows "+h),t=String(t),a&&u&&(t=t.replace(RegExp(a,"i"),u)),format(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(a,h,u.label||u)),a}))}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function getProduct(a){return reduce(a,(function(a,u){var h=u.pattern||qualify(u);return!a&&(a=RegExp("\\b"+h+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+h+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+h+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((a=String(u.label&&!RegExp(h,"i").test(u.label)?u.label:a).split("/"))[1]&&!/[\d.]+/.test(a[0])&&(a[0]+=" "+a[1]),u=u.label||u,a=format(a[0].replace(RegExp(h,"i"),u).replace(RegExp("; *(?:"+u+"[_-])?","i")," ").replace(RegExp("("+u+")[-_.]?(\\w)","i"),"$1 $2"))),a}))}function getVersion(a){return reduce(a,(function(a,u){return a||(RegExp(u+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))}if(G&&(G=[G]),/\bAndroid\b/.test($)&&!z&&(b=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(t))&&(z=trim(b[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),K&&!z?z=getProduct([K]):K&&z&&(z=z.replace(RegExp("^("+qualify(K)+")[-_.\\s]","i"),K+" ").replace(RegExp("^("+qualify(K)+")[-_.]?(\\w)","i"),K+" $2")),(b=/\bGoogle TV\b/.exec(z))&&(z=b[0]),/\bSimulator\b/i.test(t)&&(z=(z?z+" ":"")+"Simulator"),"Opera Mini"==H&&/\bOPiOS\b/.test(t)&&U.push("running in Turbo/Uncompressed mode"),"IE"==H&&/\blike iPhone OS\b/.test(t)?(K=(b=parse(t.replace(/like iPhone OS/,""))).manufacturer,z=b.product):/^iP/.test(z)?(H||(H="Safari"),$="iOS"+((b=/ OS ([\d_]+)/i.exec(t))?" "+b[1].replace(/_/g,"."):"")):"Konqueror"==H&&/^Linux\b/i.test($)?$="Kubuntu":K&&"Google"!=K&&(/Chrome/.test(H)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(z))||/\bAndroid\b/.test($)&&/^Chrome/.test(H)&&/\bVersion\//i.test(t)?(H="Android Browser",$=/\bAndroid\b/.test($)?$:"Android"):"Silk"==H?(/\bMobi/i.test(t)||($="Android",U.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&U.unshift("accelerated")):"UC Browser"==H&&/\bUCWEB\b/.test(t)?U.push("speed mode"):"PaleMoon"==H&&(b=/\bFirefox\/([\d.]+)\b/.exec(t))?U.push("identifying as Firefox "+b[1]):"Firefox"==H&&(b=/\b(Mobile|Tablet|TV)\b/i.exec(t))?($||($="Firefox OS"),z||(z=b[1])):!H||(b=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(H))?(H&&!z&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(b+"/")+8))&&(H=null),(b=z||K||$)&&(z||K||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test($))&&(H=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test($)?$:b)+" Browser")):"Electron"==H&&(b=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&U.push("Chromium "+b),q||(q=getVersion(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",qualify(H),"(?:Firefox|Minefield|NetFront)"])),(b=("iCab"==G&&parseFloat(q)>3?"WebKit":/\bOpera\b/.test(H)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(G)&&"WebKit"||!G&&/\bMSIE\b/i.test(t)&&("Mac OS"==$?"Tasman":"Trident")||"WebKit"==G&&/\bPlayStation\b(?! Vita\b)/i.test(H)&&"NetFront")&&(G=[b]),"IE"==H&&(b=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(H+=" Mobile",$="Windows Phone "+(/\+$/.test(b)?b:b+".x"),U.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(H="IE Mobile",$="Windows Phone 8.x",U.unshift("desktop mode"),q||(q=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=H&&"Trident"==G&&(b=/\brv:([\d.]+)/.exec(t))&&(H&&U.push("identifying as "+H+(q?" "+q:"")),H="IE",q=b[1]),B){if(function isHostType(t,a){var u=null!=t?typeof t[a]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(u)||"object"==u&&!t[a])}(a,"global"))if(P&&(N=(b=P.lang.System).getProperty("os.arch"),$=$||b.getProperty("os.name")+" "+b.getProperty("os.version")),O){try{q=a.require("ringo/engine").version.join("."),H="RingoJS"}catch(t){(b=a.system)&&b.global.system==a.system&&(H="Narwhal",$||($=b[0].os||null))}H||(H="Rhino")}else"object"==typeof a.process&&!a.process.browser&&(b=a.process)&&("object"==typeof b.versions&&("string"==typeof b.versions.electron?(U.push("Node "+b.versions.node),H="Electron",q=b.versions.electron):"string"==typeof b.versions.nw&&(U.push("Chromium "+q,"Node "+b.versions.node),H="NW.js",q=b.versions.nw)),H||(H="Node.js",N=b.arch,$=b.platform,q=(q=/[\d.]+/.exec(b.version))?q[0]:null));else getClassOf(b=a.runtime)==C?(H="Adobe AIR",$=b.flash.system.Capabilities.os):getClassOf(b=a.phantom)==E?(H="PhantomJS",q=(b=b.version||null)&&b.major+"."+b.minor+"."+b.patch):"number"==typeof j.documentMode&&(b=/\bTrident\/(\d+)/i.exec(t))?(q=[q,j.documentMode],(b=+b[1]+4)!=q[1]&&(U.push("IE "+q[1]+" mode"),G&&(G[1]=""),q[1]=b),q="IE"==H?String(q[1].toFixed(1)):q[0]):"number"==typeof j.documentMode&&/^(?:Chrome|Firefox)\b/.test(H)&&(U.push("masking as "+H+" "+q),H="IE",q="11.0",G=["Trident"],$="Windows");$=$&&format($)}if(q&&(b=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(q)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(B&&m.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(D=/b/i.test(b)?"beta":"alpha",q=q.replace(RegExp(b+"\\+?$"),"")+("beta"==D?A:I)+(/\d+\+?/.exec(b)||"")),"Fennec"==H||"Firefox"==H&&/\b(?:Android|Firefox OS|KaiOS)\b/.test($))H="Firefox Mobile";else if("Maxthon"==H&&q)q=q.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(z))"Xbox 360"==z&&($=null),"Xbox 360"==z&&/\bIEMobile\b/.test(t)&&U.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(H)&&(!H||z||/Browser|Mobi/.test(H))||"Windows CE"!=$&&!/Mobi/i.test(t))if("IE"==H&&B)try{null===a.external&&U.unshift("platform preview")}catch(t){U.unshift("embedded")}else(/\bBlackBerry\b/.test(z)||/\bBB10\b/.test(t))&&(b=(RegExp(z.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||q)?($=((b=[b,/BB10/.test(t)])[1]?(z=null,K="BlackBerry"):"Device Software")+" "+b[0],q=null):this!=forOwn&&"Wii"!=z&&(B&&R||/Opera/.test(H)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==H&&/\bOS X (?:\d+\.){2,}/.test($)||"IE"==H&&($&&!/^Win/.test($)&&q>5.5||/\bWindows XP\b/.test($)&&q>8||8==q&&!/\bTrident\b/.test(t)))&&!x.test(b=parse.call(forOwn,t.replace(x,"")+";"))&&b.name&&(b="ing as "+b.name+((b=b.version)?" "+b:""),x.test(H)?(/\bIE\b/.test(b)&&"Mac OS"==$&&($=null),b="identify"+b):(b="mask"+b,H=L?format(L.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(b)&&($=null),B||(q=null)),G=["Presto"],U.push(b));else H+=" Mobile";(b=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(b=[parseFloat(b.replace(/\.(\d)$/,".0$1")),b],"Safari"==H&&"+"==b[1].slice(-1)?(H="WebKit Nightly",D="alpha",q=b[1].slice(0,-1)):q!=b[1]&&q!=(b[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(q=null),b[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==b[0]&&537.36==b[2]&&parseFloat(b[1])>=28&&"WebKit"==G&&(G=["Blink"]),B&&(k||b[1])?(G&&(G[1]="like Chrome"),b=b[1]||((b=b[0])<530?1:b<532?2:b<532.05?3:b<533?4:b<534.03?5:b<534.07?6:b<534.1?7:b<534.13?8:b<534.16?9:b<534.24?10:b<534.3?11:b<535.01?12:b<535.02?"13+":b<535.07?15:b<535.11?16:b<535.19?17:b<536.05?18:b<536.1?19:b<537.01?20:b<537.11?"21+":b<537.13?23:b<537.18?24:b<537.24?25:b<537.36?26:"Blink"!=G?"27":"28")):(G&&(G[1]="like Safari"),b=(b=b[0])<400?1:b<500?2:b<526?3:b<533?4:b<534?"4+":b<535?5:b<537?6:b<538?7:b<601?8:b<602?9:b<604?10:b<606?11:b<608?12:"12"),G&&(G[1]+=" "+(b+="number"==typeof b?".x":/[.+]/.test(b)?"":"+")),"Safari"==H&&(!q||parseInt(q)>45)?q=b:"Chrome"==H&&/\bHeadlessChrome/i.test(t)&&U.unshift("headless")),"Opera"==H&&(b=/\bzbov|zvav$/.exec($))?(H+=" ",U.unshift("desktop mode"),"zvav"==b?(H+="Mini",q=null):H+="Mobile",$=$.replace(RegExp(" *"+b+"$"),"")):"Safari"==H&&/\bChrome\b/.exec(G&&G[1])?(U.unshift("desktop mode"),H="Chrome Mobile",q=null,/\bOS X\b/.test($)?(K="Apple",$="iOS 4.3+"):$=null):/\bSRWare Iron\b/.test(H)&&!q&&(q=getVersion("Chrome")),q&&0==q.indexOf(b=/[\d.]+$/.exec($))&&t.indexOf("/"+b+"-")>-1&&($=trim($.replace(b,""))),$&&-1!=$.indexOf(H)&&!RegExp(H+" OS").test($)&&($=$.replace(RegExp(" *"+qualify(H)+" *"),"")),G&&!/\b(?:Avant|Nook)\b/.test(H)&&(/Browser|Lunascape|Maxthon/.test(H)||"Safari"!=H&&/^iOS/.test($)&&/\bSafari\b/.test(G[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(H)&&G[1])&&(b=G[G.length-1])&&U.push(b),U.length&&(U=["("+U.join("; ")+")"]),K&&z&&z.indexOf(K)<0&&U.push("on "+K),z&&U.push((/^on /.test(U[U.length-1])?"":"on ")+z),$&&(b=/ ([\d.+]+)$/.exec($),w=b&&"/"==$.charAt($.length-b[0].length-1),$={architecture:32,family:b&&!w?$.replace(b[0],""):$,version:b?b[1]:null,toString:function(){var t=this.version;return this.family+(t&&!w?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(b=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(N))&&!/\bi686\b/i.test(N)?($&&($.architecture=64,$.family=$.family.replace(RegExp(" *"+b),"")),H&&(/\bWOW64\b/i.test(t)||B&&/\w(?:86|32)$/.test(m.cpuClass||m.platform)&&!/\bWin64; x64\b/i.test(t))&&U.unshift("32-bit")):$&&/^OS X/.test($.family)&&"Chrome"==H&&parseFloat(q)>=39&&($.architecture=64),t||(t=null);var W={};return W.description=t,W.layout=G&&G[0],W.manufacturer=K,W.name=H,W.prerelease=D,W.product=z,W.ua=t,W.version=H&&q,W.os=$||{architecture:null,family:null,version:null,toString:function(){return"null"}},W.parse=parse,W.toString=function toStringPlatform(){return this.description||""},W.version&&U.unshift(q),W.name&&U.unshift(H),$&&H&&($!=String($).split(" ")[0]||$!=H.split(" ")[0]&&!z)&&U.push(z?"("+$+")":"on "+$),U.length&&(W.description=U.join(" ")),W}();m&&g?forOwn(C,(function(t,a){m[a]=t})):h.platform=C}).call(t)})),Nh=Math.floor,mergeSort=function(t,a){var u=t.length,h=Nh(u/2);return u<8?insertionSort(t,a):merge(t,mergeSort(arraySliceSimple(t,0,h),a),mergeSort(arraySliceSimple(t,h),a),a)},insertionSort=function(t,a){for(var u,h,m=t.length,g=1;g<m;){for(h=g,u=t[g];h&&a(t[h-1],u)>0;)t[h]=t[--h];h!==g++&&(t[h]=u)}return t},merge=function(t,a,u,h){for(var m=a.length,g=u.length,b=0,w=0;b<m||w<g;)t[b+w]=b<m&&w<g?h(a[b],u[w])<=0?a[b++]:u[w++]:b<m?a[b++]:u[w++];return t},Uh=mergeSort,Dh=K.match(/firefox\/(\d+)/i),Bh=!!Dh&&+Dh[1],qh=/MSIE|Trident/.test(K),Gh=K.match(/AppleWebKit\/(\d+)\./),Hh=!!Gh&&+Gh[1],zh=[],Kh=M(zh.sort),$h=M(zh.push),Wh=fails((function(){zh.sort(void 0)})),Vh=fails((function(){zh.sort(null)})),Qh=arrayMethodIsStrict("sort"),Jh=!fails((function(){if(Y)return Y<70;if(!(Bh&&Bh>3)){if(qh)return!0;if(Hh)return Hh<603;var t,a,u,h,m="";for(t=65;t<76;t++){switch(a=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:u=3;break;case 68:case 71:u=4;break;default:u=2}for(h=0;h<47;h++)zh.push({k:a+h,v:u})}for(zh.sort((function(t,a){return a.v-t.v})),h=0;h<zh.length;h++)a=zh[h].k.charAt(0),m.charAt(m.length-1)!==a&&(m+=a);return"DGBEFHACIJK"!==m}}));_export({target:"Array",proto:!0,forced:Wh||!Vh||!Qh||!Jh},{sort:function sort(t){void 0!==t&&aCallable(t);var a=toObject(this);if(Jh)return void 0===t?Kh(a):Kh(a,t);var u,h,m=[],g=lengthOfArrayLike(a);for(h=0;h<g;h++)h in a&&$h(m,a[h]);for(Uh(m,function(t){return function(a,u){return void 0===u?-1:void 0===a?1:void 0!==t?+t(a,u)||0:toString$1(a)>toString$1(u)?1:-1}}(t)),u=lengthOfArrayLike(m),h=0;h<u;)a[h]=m[h++];for(;h<g;)deletePropertyOrThrow(a,h++);return a}});var Yh=entryVirtual("Array").sort,Xh=Array.prototype,sort=function(t){var a=t.sort;return t===Xh||z(Xh,t)&&a===Xh.sort?Yh:a},Zh=createCommonjsModule((function(t,a){self,t.exports=function(){var t={d:function d(a,u){for(var h in u)t.o(u,h)&&!t.o(a,h)&&va(a,h,{enumerable:!0,get:u[h]})},o:function o(t,a){return Object.prototype.hasOwnProperty.call(t,a)}},a={};t.d(a,{default:function _default(){return _}});var u=function e(t){for(var a in function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.directUploadAddr="https://wanproxy-web.127.net",this.retryCount=4,this.trunkSize=4194304,this.trunkUploadTimeout=5e4,this.getOffsetTimeout=1e4,this.version="1.0",this.enableCache=!0,this.logger=console,this.onError=function(t){},this.onProgress=function(t){},this.onUploadProgress=function(t){},this.onComplete=function(t){},t)this[a]=t[a]};function n(t,a){var u=void 0!==ha&&sp(t)||t["@@iterator"];if(!u){if(Wu(t)||(u=function(t,a){if(t){var u;if("string"==typeof t)return r(t,a);var h=slice(u=Object.prototype.toString.call(t)).call(u,8,-1);return"Object"===h&&t.constructor&&(h=t.constructor.name),"Map"===h||"Set"===h?ap(t):"Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?r(t,a):void 0}}(t))||a&&t&&"number"==typeof t.length){u&&(t=u);var h=0,m=function i(){};return{s:m,n:function n(){return h>=t.length?{done:!0}:{done:!1,value:t[h++]}},e:function e(t){throw t},f:m}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,b=!0,w=!1;return{s:function s(){u=u.call(t)},n:function n(){var t=u.next();return b=t.done,t},e:function e(t){w=!0,g=t},f:function f(){try{b||null==u.return||u.return()}finally{if(w)throw g}}}}function r(t,a){(null==a||a>t.length)&&(a=t.length);for(var u=0,h=new Array(a);u<a;u++)h[u]=t[u];return h}var h={privateObj:{},setItem:function setItem(t,a){h.privateObj[t]=a},getItem:function getItem(t){return h.privateObj[t]},removeItem:function removeItem(t){delete h.privateObj[t]},getKeys:function getKeys(){return $a(h.privateObj)}},m={getFileKey:function getFileKey(t){var a=t.size.toString(),u=t.lastModified.toString();return"_NosUploader_"+t.name+slice(a).call(a,a.length-5)+slice(u).call(u,u.length-5)},getFileInfo:function getFileInfo(t){var a=h.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch(t){return null}},initFile:function initFile(t,a,u){m.clearExpiredInfo();var g=this.getFileKey(a),b={ctx:void 0!==t.ctx?t.ctx:"",bucket:t.bucketName,obj:t.objectName,token:t.token,modifyAt:Zo(),end:!1};return t.payload&&(b.payload=t.payload),u&&h.setItem(g,Hu(b)),g},setUploadContext:function setUploadContext(t,a,u){var m=this.getFileInfo(t);m&&(m.ctx=a,u&&h.setItem(t,Hu(m)))},setComplete:function setComplete(t,a){var u=this.getFileInfo(t);u&&(u.modifyAt=Zo(),u.end=!0,a&&h.setItem(t,Hu(u)))},getUploadContext:function getUploadContext(t){var a=this.getFileInfo(t);return a?a.ctx:""},removeFileInfo:function removeFileInfo(t){0===indexOf(t).call(t,"_NosUploader_")&&h.removeItem(t)},clearExpiredInfo:function clearExpiredInfo(){var t,a="function"==typeof h.getKeys?h.getKeys():$a(h),u=Zo(),g=[],b=n(a);try{for(b.s();!(t=b.n()).done;){var w=t.value;if(0===indexOf(w).call(w,"_NosUploader_")){var x=m.getFileInfo(w);null===x||u-x.modifyAt>_.expireTime?h.removeItem(w):g.push({fileInfo:x,key:w})}}}catch(t){b.e(t)}finally{b.f()}if(g.length>_.maxFileCache){var k,S,C=n(slice(k=sort(g).call(g,(function(t,a){return a.fileInfo.modifyAt-t.fileInfo.modifyAt}))).call(k,_.maxFileCache));try{for(C.s();!(S=C.n()).done;){var T,M=S.value;0===indexOf(T=M.key).call(T,"_NosUploader_")&&h.removeItem(M.key)}}catch(t){C.e(t)}finally{C.f()}}}},g=m;function c(t){return(c="function"==typeof ha&&"symbol"==typeof Xl?function(t){return typeof t}:function(t){return t&&"function"==typeof ha&&t.constructor===ha&&t!==ha.prototype?"symbol":typeof t})(t)}function s(t,a){return!a||"object"!==c(a)&&"function"!=typeof a?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):a}function f(t){var a="function"==typeof zs?new zs:void 0;return(f=function f(t){var u,h;if(null===t||(h=t,-1===indexOf(u=Function.toString.call(h)).call(u,"[native code]")))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==a){if(a.has(t))return a.get(t);a.set(t,n)}function n(){return l(t,arguments,y(this).constructor)}return n.prototype=lt(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)})(t)}function l(t,a,u){return(l=p()?Zs:function(t,a,u){var h=[null];h.push.apply(h,a);var m=new(bind$1(Function).apply(t,h));return u&&d(m,u.prototype),m}).apply(null,arguments)}function p(){if("undefined"==typeof Reflect||!Zs)return!1;if(Zs.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Zs(Boolean,[],(function(){}))),!0}catch(t){return!1}}function d(t,a){return(d=ht||function(t,a){return t.__proto__=a,t})(t,a)}function y(t){return(y=ht?ba:function(t){return t.__proto__||ba(t)})(t)}var b=function(t){!function(t,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");t.prototype=lt(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&d(t,a)}(r,t);var a,u,h=(a=r,u=p(),function(){var t,h=y(a);if(u){var m=y(this).constructor;t=Zs(h,arguments,m)}else t=h.apply(this,arguments);return s(this,t)});function r(t,a){var u;return function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,r),(u=h.call(this,"NosUploadError:"+t)).errCode=a,u.errMsg=t,u}return r}(f(Error)),w=function e(t,a,u){if("uploading"===t.uploadState){var h=t.config,m=t.param,w=g.getUploadContext(t.fileKey);if(!w)return u(0);var x=new XMLHttpRequest,k=h.directUploadAddr+"/".concat(m.bucketName)+"/".concat(encodeURIComponent(m.objectName))+"?uploadContext"+"&context=".concat(w)+"&version=".concat(h.version);x.onreadystatechange=function(){var m;if("abort"!==t.uploadState&&4===x.readyState){var w,S,_,C;try{C=JSON.parse(x.responseText)}catch(t){C={errMsg:"JsonParseError in getOffset. xhr.status = "+x.status+". xhr.responseText: "+x.responseText,errCode:500}}200===x.status?C.errCode?t.config.onError(new b(C.errMsg,C.errCode)):u(C.offset):x.status.toString().match(/^5/)?e(t,a-1,u):a>0?("function"==typeof(null===(m=h.logger)||void 0===m?void 0:m.error)&&h.logger.error(concat(w="getOffset(".concat(k,") error. retry after 3 seconds. ")).call(w,(new Date).toTimeString())),mi((function(){e(t,a-1,u)}),3500)):x.status?(g.removeFileInfo(t.fileKey),h.onError(new b(concat(S=concat(_="getOffset(".concat(k,") error: ")).call(_,x.status," ")).call(S,x.statusText)))):h.onError(new b("getOffset(".concat(k,") error. no Error Code")))}},x.open("get",k),x.setRequestHeader("x-nos-token",m.token),x.timeout=h.getOffsetTimeout,x.send()}},x=function e(t,a,u,h){if("uploading"===t.uploadState){var m=t.param,w=t.config,x=slice(File.prototype),k=void 0!==m.ctx?m.ctx:"",S=a+w.trunkSize>=t.file.size,_=S?t.file.size:a+w.trunkSize,C=new XMLHttpRequest,T=w.directUploadAddr+"/".concat(m.bucketName)+"/".concat(encodeURIComponent(m.objectName));if(C.upload.onprogress=function(u){if("abort"!==t.uploadState){var h=0;u.lengthComputable?(h=(a+u.loaded)/t.file.size,w.onProgress(h),w.onUploadProgress({loaded:u.loaded,total:t.file.size,percentage:h,percentageText:(100*h).toFixed(2)+"%"})):w.onError(new b("browser does not support query upload progress"))}},C.onreadystatechange=function(){var m,x;if("abort"!==t.uploadState&&4===C.readyState){var k,_,M,E;try{E=JSON.parse(C.responseText)}catch(t){"function"==typeof(null===(m=w.logger)||void 0===m?void 0:m.error)&&w.logger.error("JsonParseError in uploadTrunk. xhr.status = "+C.status+". xhr.responseText: "+C.responseText,t),E={errMsg:"JsonParseError in uploadTrunk. xhr.status = "+C.status+". xhr.responseText: "+C.responseText}}200===C.status?(t.setContext(E.context),S?(h(),t.setComplete()):e(t,E.offset,w.retryCount,h)):C.status.toString().match(/^5/)?u>0?e(t,a,u-1,h):(g.removeFileInfo(t.fileKey),w.onError(new b(E.errMsg,E.errCode))):u>0?("function"==typeof(null===(x=w.logger)||void 0===x?void 0:x.error)&&w.logger.error(concat(k="uploadTrunk(".concat(T,") error. retry after 3 seconds. ")).call(k,(new Date).toTimeString())),mi((function(){e(t,a,u-1,h)}),3500)):C.status?(g.removeFileInfo(t.fileKey),w.onError(new b(concat(_=concat(M="uploadTrunk(".concat(T,") error: ")).call(M,C.status," ")).call(_,C.statusText)))):w.onError(new b("uploadTrunk(".concat(T,") error. no Error Code. Please check your network")))}},C.open("post",T+"?offset=".concat(a)+"&complete=".concat(S)+"&context=".concat(k)+"&version=".concat(w.version)),C.setRequestHeader("x-nos-token",m.token),m.md5&&C.setRequestHeader("content-md5",m.md5),t.file.type&&C.setRequestHeader("content-type",t.file.type),C.timeout=w.trunkUploadTimeout,"undefined"!=typeof FileReader){var M=new FileReader;M.addEventListener("load",(function(t){var a;(null===(a=null==t?void 0:t.target)||void 0===a?void 0:a.result)instanceof ArrayBuffer&&t.target.result.byteLength>0?C.send(t.target.result):w.onError(new b("Read ArrayBuffer failed",194003))})),M.addEventListener("error",(function(t){var a=t.target.error;w.onError(new b("Read ArrayBuffer error. ".concat(a.toString()),194003))})),M.readAsArrayBuffer(x.call(t.file,a,_))}else C.send(x.call(t.file,a,_))}};function v(t,a){for(var u=0;u<a.length;u++){var h=a[u];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),va(t,h.key,h)}}var k=function(){function e(t,a,u){!function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.uploadState="paused",this.config=u,this.file=t,this.param=a,this.fileKey=g.initFile(a,t,this.config.enableCache),this.resume()}var t;return(t=[{key:"resume",value:function value(){var t=this;if("uploading"!==this.uploadState){this.setUploadState("uploading");var a=this.config;w(this,a.retryCount,(function(u){x(t,u,a.retryCount,(function(){t.setUploadState("ended"),"function"==typeof a.onComplete&&a.onComplete(t.param)}))}))}}},{key:"pause",value:function value(){this.setUploadState("paused")}},{key:"abort",value:function value(){"ended"!==this.uploadState&&"abort"!==this.uploadState&&(this.setUploadState("abort"),this.config.onError(new b("Upload Aborted",10499)))}},{key:"setUploadState",value:function value(t){t!==this.uploadState&&(this.uploadState=t)}},{key:"setContext",value:function value(t){g.setUploadContext(this.fileKey,t,this.config.enableCache),this.param.ctx=t}},{key:"setComplete",value:function value(){g.setComplete(this.fileKey,this.config.enableCache),this.setUploadState("ended")}}])&&v(e.prototype,t),e}(),S={maxFileCache:1/0,expireTime:864e5,getFileUploadInformation:function getFileUploadInformation(t){var a=g.getFileKey(t),u=g.getFileInfo(a);return null===u?null:Zo()-u.modifyAt>S.expireTime?(g.removeFileInfo(a),null):{uploadInfo:Ot({bucketName:u.bucket,objectName:u.obj,token:u.token,ctx:u.ctx},u.payload?{payload:u.payload}:{}),complete:u.end}},setMaxFileCache:function setMaxFileCache(t){S.maxFileCache=t},setExpireTime:function setExpireTime(t){S.expireTime=t},printCaches:function printCaches(){if("undefined"!=typeof localStorage)for(var t=0,a=$a(localStorage);t<a.length;t++){var u=a[t],h=g.getFileInfo(u);h&&console.log(h,"modifiedAt",new Date(h.modifyAt).toTimeString())}},createConfig:function createConfig(t){return new u(t)},createTask:function createTask(t,a,u){return new k(t,a,u)}},_=S;return a.default}()})),em=createCommonjsModule((function(t,a){t.exports=function(){function object2String(t){if(t){var a,u="";return forEach$1(a=$a(t)).call(a,(function(a,h){u+=0===h?"?":"&",u+=a+"="+t[a]})),u}return""}var t=function(t){function V2NIMError(a,u,h,m){var g;return(g=t.call(this,h)||this).source=a,g.code=u,g.desc=h,g.detail=m||{},g}return _t(V2NIMError,t),V2NIMError}(nc(Error));function request(a,u){void 0===u&&(u={dataType:"json",method:"GET",timeout:5e3});var h="text"===u.dataType?"text/plain; charset=UTF-8":"application/json; charset=UTF-8",m="GET"===u.method?object2String(u.params):"";return new Jo((function(g,b){if(window.XMLHttpRequest){var w,x=new XMLHttpRequest;if(x.onreadystatechange=function(){if(4===x.readyState)if(200===x.status){try{w=JSON.parse(x.response||"{}")}catch(t){w=x.response}g({status:x.status,data:w})}else mi((function(){b(new t(1,x.status,"readyState: "+x.readyState+"; statusText: "+x.statusText))}),0)},x.open(u.method,""+a+m),x.timeout=u.timeout||5e3,x.setRequestHeader("Content-Type",h),u.headers)for(var k in u.headers)x.setRequestHeader(k,u.headers[k]);x.ontimeout=function(a){b(new t(1,408,a&&a.message?a.message:"request timeout"))},x.send(Hu(u.data))}else b(new t(2,10400,"request no suppout"))}))}return request}()})),tm=console;var rm=null,nm=null,om={setLogger:function setLogger(t){tm=t},platform:"BROWSER",localStorage:window.localStorage,request:em,WebSocket:window.WebSocket,uploadFile:function uploadFile(t){return __awaiter(this,void 0,void 0,rf.mark((function _callee(){var a,u,h,m,g,b;return rf.wrap((function _callee$(w){for(;;)switch(w.prev=w.next){case 0:if(t.fileInput||t.file){w.next=2;break}throw new Error("File not exist");case 2:if(!t.file){w.next=6;break}m=t.file,w.next=20;break;case 6:if("string"!=typeof t.fileInput){w.next=15;break}if(!((g=document.getElementById(t.fileInput))&&g.files&&g.files[0])){w.next=12;break}m=g.files[0],w.next=13;break;case 12:throw new Error("Can not get file from fileInput");case 13:w.next=20;break;case 15:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){w.next=19;break}m=t.fileInput.files[0],w.next=20;break;case 19:throw new Error("Can not get file from fileInput "+t.fileInput);case 20:if(!(t.maxSize&&m.size>t.maxSize)){w.next=22;break}throw new Error("The file exceeds maxSize limit. maxSize: "+t.maxSize+", get "+m.size);case 22:return w.next=24,new Jo((function(a,u){var h=Zh.createConfig({enableCache:!1,directUploadAddr:t.chunkUploadHost,retryCount:0,onError:function onError(t){u(t)},onUploadProgress:t.onUploadProgress||function(){},onComplete:function onComplete(t){a(t)}}),g=Zh.createTask(m,{bucketName:t.nosToken.bucket,objectName:decodeURIComponent(t.nosToken.objectName),token:t.nosToken.token},h);try{t.onUploadStart&&t.onUploadStart(g)}catch(t){tm.error("Adapter uploadFile: options.onUploadStart error",t&&t.message),g.abort(),u(t)}}));case 24:return(b=w.sent).name=m.name,b.size=m.size,b.type=m.type,b.ext=lastIndexOf(a=b.name).call(a,".")>-1?slice(u=b.name).call(u,lastIndexOf(h=b.name).call(h,".")+1).toLowerCase():"",w.abrupt("return",b);case 30:case"end":return w.stop()}}),_callee)})))},getSystemInfo:function getSystemInfo(){var t,a,u=Fh.version||"";if(isElectron())try{var h=navigator.userAgent.match(/Electron\/([\d.]+\d+)/);h&&h[1]&&"string"==typeof h[1]&&(u=h[1])}catch(t){}return{os:(null===(t=Fh.os)||void 0===t?void 0:t.family)||"",osVer:(null===(a=Fh.os)||void 0===a?void 0:a.version)||"",browser:Fh.name||"",browserVer:Fh.version||"",libEnv:"BROWSER",hostEnv:isElectron()?"Electron":isMobile()?"H5":isBrowser()?"BROWSER":"Unset",hostEnvEnum:isElectron()?Df.Electron:isMobile()?Df.H5:isBrowser()?Df.BROWSER:Df.Unset,hostEnvVer:u,userAgent:navigator&&navigator.userAgent,model:u,manufactor:Fh.name||""}},net:{getNetworkStatus:function getNetworkStatus(){return Jo.resolve({net_type:Bf.kStatNetTypeUnkonw,net_connect:"undefined"==typeof navigator||"boolean"!=typeof navigator.onLine||navigator.onLine})},onNetworkStatusChange:function onNetworkStatusChange(t){rm=function onlineListener(){t({isConnected:!0,networkType:Bf.kStatNetTypeUnkonw})},nm=function offlineListener(){t({isConnected:!1,networkType:Bf.kStatNetTypeUnkonw})},window.addEventListener("online",rm),window.addEventListener("offline",nm)},offNetworkStatusChange:function offNetworkStatusChange(){rm&&window.removeEventListener("online",rm),nm&&window.removeEventListener("offline",nm),rm=null,nm=null}}};return Eh.setAdapters(om),Eh}));
|