module.exports = (function() { var __MODS__ = {}; var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; __DEFINE__(1744442642937, function(require, module, exports) { var __TEMP__ = require('tsignaling-wx');var t = __REQUIRE_DEFAULT__(__TEMP__);var __TEMP__ = require('trtc-wx-sdk');var e = __REQUIRE_DEFAULT__(__TEMP__);var __TEMP__ = require('tim-wx-sdk');var n = __REQUIRE_DEFAULT__(__TEMP__);function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t){for(var e=1;e=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;L(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function o(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function c(t,e,n,r,i,a,o){try{var s=t[a](o),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){c(a,r,i,o,s,"next",t)}function s(t){c(a,r,i,o,s,"throw",t)}o(void 0)}))}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function _(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function T(t){var e=y();return function(){var n,r=v(t);if(e){var i=v(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _(t)}(this,n)}}function C(t){return function(t){if(Array.isArray(t))return b(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&K[0]<4?1:+(K[0]+K[1])),!z&&wt&&(!(K=wt.match(/Edge\/(\d+)/))||K[1]>=74)&&(K=wt.match(/Chrome\/(\d+)/))&&(z=+K[1]);var kt=z,At=kt,Nt=N,Ut=k.String,Pt=!!Object.getOwnPropertySymbols&&!Nt((function(){var t=Symbol("symbol detection");return!Ut(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&At&&At<41})),Mt=Pt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,jt=Ct,Vt=yt,Gt=bt,Ht=Object,Bt=Mt?function(t){return"symbol"==typeof t}:function(t){var e=jt("Symbol");return Vt(e)&&Gt(e.prototype,Ht(t))},Ft=String,Kt=function(t){try{return Ft(t)}catch(t){return"Object"}},zt=yt,Jt=Kt,Wt=TypeError,$t=function(t){if(zt(t))return t;throw new Wt(Jt(t)+" is not a function")},qt=$t,Yt=st,Xt=function(t,e){var n=t[e];return Yt(n)?void 0:qt(n)},Qt=V,Zt=yt,te=Et,ee=TypeError,ne={exports:{}},re=k,ie=Object.defineProperty,ae=function(t,e){try{ie(re,t,{value:e,configurable:!0,writable:!0})}catch(n){re[t]=e}return e},oe=ae,se="__core-js_shared__",ce=k[se]||oe(se,{}),le=ce;(ne.exports=function(t,e){return le[t]||(le[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.34.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE",source:"https://github.com/zloirock/core-js"});var ue=ut,he=Object,fe=function(t){return he(ue(t))},de=fe,pe=X({}.hasOwnProperty),ve=Object.hasOwn||function(t,e){return pe(de(t),e)},ge=X,ye=0,Ie=Math.random(),me=ge(1..toString),Ee=function(t){return"Symbol("+(void 0===t?"":t)+")_"+me(++ye+Ie,36)},_e=k,Te=ne.exports,Ce=ve,be=Ee,De=Pt,Re=Mt,we=_e.Symbol,Se=Te("wks"),xe=Re?we.for||we:we&&we.withoutSetter||be,Le=function(t){return Ce(Se,t)||(Se[t]=De&&Ce(we,t)?we[t]:xe("Symbol."+t)),Se[t]},Oe=V,ke=Et,Ae=Bt,Ne=Xt,Ue=function(t,e){var n,r;if("string"===e&&Zt(n=t.toString)&&!te(r=Qt(n,t)))return r;if(Zt(n=t.valueOf)&&!te(r=Qt(n,t)))return r;if("string"!==e&&Zt(n=t.toString)&&!te(r=Qt(n,t)))return r;throw new ee("Can't convert object to primitive value")},Pe=TypeError,Me=Le("toPrimitive"),je=function(t,e){if(!ke(t)||Ae(t))return t;var n,r=Ne(t,Me);if(r){if(void 0===e&&(e="default"),n=Oe(r,t,e),!ke(n)||Ae(n))return n;throw new Pe("Can't convert object to primitive value")}return void 0===e&&(e="number"),Ue(t,e)},Ve=je,Ge=Bt,He=function(t){var e=Ve(t,"string");return Ge(e)?e:e+""},Be=Et,Fe=k.document,Ke=Be(Fe)&&Be(Fe.createElement),ze=function(t){return Ke?Fe.createElement(t):{}},Je=ze,We=!U&&!N((function(){return 7!==Object.defineProperty(Je("div"),"a",{get:function(){return 7}}).a})),$e=U,qe=V,Ye=G,Xe=J,Qe=dt,Ze=He,tn=ve,en=We,nn=Object.getOwnPropertyDescriptor;A.f=$e?nn:function(t,e){if(t=Qe(t),e=Ze(e),en)try{return nn(t,e)}catch(t){}if(tn(t,e))return Xe(!qe(Ye.f,t,e),t[e])};var rn={},an=U&&N((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),on=Et,sn=String,cn=TypeError,ln=function(t){if(on(t))return t;throw new cn(sn(t)+" is not an object")},un=U,hn=We,fn=an,dn=ln,pn=He,vn=TypeError,gn=Object.defineProperty,yn=Object.getOwnPropertyDescriptor,In="enumerable",mn="configurable",En="writable";rn.f=un?fn?function(t,e,n){if(dn(t),e=pn(e),dn(n),"function"==typeof t&&"prototype"===e&&"value"in n&&En in n&&!n[En]){var r=yn(t,e);r&&r[En]&&(t[e]=n.value,n={configurable:mn in n?n[mn]:r[mn],enumerable:In in n?n[In]:r[In],writable:!1})}return gn(t,e,n)}:gn:function(t,e,n){if(dn(t),e=pn(e),dn(n),hn)try{return gn(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new vn("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var _n=rn,Tn=J,Cn=U?function(t,e,n){return _n.f(t,e,Tn(1,n))}:function(t,e,n){return t[e]=n,t},bn={exports:{}},Dn=U,Rn=ve,wn=Function.prototype,Sn=Dn&&Object.getOwnPropertyDescriptor,xn=Rn(wn,"name"),Ln={EXISTS:xn,PROPER:xn&&"something"===function(){}.name,CONFIGURABLE:xn&&(!Dn||Dn&&Sn(wn,"name").configurable)},On=yt,kn=ce,An=X(Function.toString);On(kn.inspectSource)||(kn.inspectSource=function(t){return An(t)});var Nn,Un,Pn,Mn=kn.inspectSource,jn=yt,Vn=k.WeakMap,Gn=jn(Vn)&&/native code/.test(String(Vn)),Hn=ne.exports,Bn=Ee,Fn=Hn("keys"),Kn=function(t){return Fn[t]||(Fn[t]=Bn(t))},zn={},Jn=Gn,Wn=k,$n=Et,qn=Cn,Yn=ve,Xn=ce,Qn=Kn,Zn=zn,tr="Object already initialized",er=Wn.TypeError,nr=Wn.WeakMap;if(Jn||Xn.state){var rr=Xn.state||(Xn.state=new nr);rr.get=rr.get,rr.has=rr.has,rr.set=rr.set,Nn=function(t,e){if(rr.has(t))throw new er(tr);return e.facade=t,rr.set(t,e),e},Un=function(t){return rr.get(t)||{}},Pn=function(t){return rr.has(t)}}else{var ir=Qn("state");Zn[ir]=!0,Nn=function(t,e){if(Yn(t,ir))throw new er(tr);return e.facade=t,qn(t,ir,e),e},Un=function(t){return Yn(t,ir)?t[ir]:{}},Pn=function(t){return Yn(t,ir)}}var ar={set:Nn,get:Un,has:Pn,enforce:function(t){return Pn(t)?Un(t):Nn(t,{})},getterFor:function(t){return function(e){var n;if(!$n(e)||(n=Un(e)).type!==t)throw new er("Incompatible receiver, "+t+" required");return n}}},or=X,sr=N,cr=yt,lr=ve,ur=U,hr=Ln.CONFIGURABLE,fr=Mn,dr=ar.enforce,pr=ar.get,vr=String,gr=Object.defineProperty,yr=or("".slice),Ir=or("".replace),mr=or([].join),Er=ur&&!sr((function(){return 8!==gr((function(){}),"length",{value:8}).length})),_r=String(String).split("String"),Tr=bn.exports=function(t,e,n){"Symbol("===yr(vr(e),0,7)&&(e="["+Ir(vr(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!lr(t,"name")||hr&&t.name!==e)&&(ur?gr(t,"name",{value:e,configurable:!0}):t.name=e),Er&&n&&lr(n,"arity")&&t.length!==n.arity&&gr(t,"length",{value:n.arity});try{n&&lr(n,"constructor")&&n.constructor?ur&&gr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=dr(t);return lr(r,"source")||(r.source=mr(_r,"string"==typeof e?e:"")),t};Function.prototype.toString=Tr((function(){return cr(this)&&pr(this).source||fr(this)}),"toString");var Cr=yt,br=rn,Dr=bn.exports,Rr=ae,wr=function(t,e,n,r){r||(r={});var i=r.enumerable,a=void 0!==r.name?r.name:e;if(Cr(n)&&Dr(n,a,r),r.global)i?t[e]=n:Rr(e,n);else{try{r.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=n:br.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Sr={},xr=Math.ceil,Lr=Math.floor,Or=Math.trunc||function(t){var e=+t;return(e>0?Lr:xr)(e)},kr=function(t){var e=+t;return e!=e||0===e?0:Or(e)},Ar=kr,Nr=Math.max,Ur=Math.min,Pr=function(t,e){var n=Ar(t);return n<0?Nr(n+e,0):Ur(n,e)},Mr=kr,jr=Math.min,Vr=function(t){return t>0?jr(Mr(t),9007199254740991):0},Gr=Vr,Hr=function(t){return Gr(t.length)},Br=dt,Fr=Pr,Kr=Hr,zr=function(t){return function(e,n,r){var i,a=Br(e),o=Kr(a),s=Fr(r,o);if(t&&n!=n){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}},Jr={includes:zr(!0),indexOf:zr(!1)},Wr=ve,$r=dt,qr=Jr.indexOf,Yr=zn,Xr=X([].push),Qr=function(t,e){var n,r=$r(t),i=0,a=[];for(n in r)!Wr(Yr,n)&&Wr(r,n)&&Xr(a,n);for(;e.length>i;)Wr(r,n=e[i++])&&(~qr(a,n)||Xr(a,n));return a},Zr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ti=Qr,ei=Zr.concat("length","prototype");Sr.f=Object.getOwnPropertyNames||function(t){return ti(t,ei)};var ni={};ni.f=Object.getOwnPropertySymbols;var ri=Ct,ii=Sr,ai=ni,oi=ln,si=X([].concat),ci=ri("Reflect","ownKeys")||function(t){var e=ii.f(oi(t)),n=ai.f;return n?si(e,n(t)):e},li=ve,ui=ci,hi=A,fi=rn,di=N,pi=yt,vi=/#|\.prototype\./,gi=function(t,e){var n=Ii[yi(t)];return n===Ei||n!==mi&&(pi(e)?di(e):!!e)},yi=gi.normalize=function(t){return String(t).replace(vi,".").toLowerCase()},Ii=gi.data={},mi=gi.NATIVE="N",Ei=gi.POLYFILL="P",_i=gi,Ti=k,Ci=A.f,bi=Cn,Di=wr,Ri=ae,wi=function(t,e,n){for(var r=ui(e),i=fi.f,a=hi.f,o=0;o9007199254740991)throw ki("Maximum allowed index exceeded");return t},Ni=He,Ui=rn,Pi=J,Mi=function(t,e,n){var r=Ni(e);r in t?Ui.f(t,r,Pi(0,n)):t[r]=n},ji={};ji[Le("toStringTag")]="z";var Vi="[object z]"===String(ji),Gi=Vi,Hi=yt,Bi=et,Fi=Le("toStringTag"),Ki=Object,zi="Arguments"===Bi(function(){return arguments}()),Ji=Gi?Bi:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Ki(t),Fi))?n:zi?Bi(e):"Object"===(r=Bi(e))&&Hi(e.callee)?"Arguments":r},Wi=X,$i=N,qi=yt,Yi=Ji,Xi=Mn,Qi=function(){},Zi=[],ta=Ct("Reflect","construct"),ea=/^\s*(?:class|function)\b/,na=Wi(ea.exec),ra=!ea.test(Qi),ia=function(t){if(!qi(t))return!1;try{return ta(Qi,Zi,t),!0}catch(t){return!1}},aa=function(t){if(!qi(t))return!1;switch(Yi(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return ra||!!na(ea,Xi(t))}catch(t){return!0}};aa.sham=!0;var oa=!ta||$i((function(){var t;return ia(ia.call)||!ia(Object)||!ia((function(){t=!0}))||t}))?aa:ia,sa=Oi,ca=oa,la=Et,ua=Le("species"),ha=Array,fa=function(t){var e;return sa(t)&&(e=t.constructor,(ca(e)&&(e===ha||sa(e.prototype))||la(e)&&null===(e=e[ua]))&&(e=void 0)),void 0===e?ha:e},da=function(t,e){return new(fa(t))(0===e?0:e)},pa=N,va=kt,ga=Le("species"),ya=function(t){return va>=51||!pa((function(){var e=[];return(e.constructor={})[ga]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Ia=xi,ma=N,Ea=Oi,_a=Et,Ta=fe,Ca=Hr,ba=Ai,Da=Mi,Ra=da,wa=ya,Sa=kt,xa=Le("isConcatSpreadable"),La=Sa>=51||!ma((function(){var t=[];return t[xa]=!1,t.concat()[0]!==t})),Oa=function(t){if(!_a(t))return!1;var e=t[xa];return void 0!==e?!!e:Ea(t)};Ia({target:"Array",proto:!0,arity:1,forced:!La||!wa("concat")},{concat:function(t){var e,n,r,i,a,o=Ta(this),s=Ra(o,0),c=0;for(e=-1,r=arguments.length;e1?arguments[1]:void 0;return Za?Qa(this,t,e)||0:Ya(this,t,e)}});var to=$t,eo=P,no=Ja(Ja.bind),ro=function(t,e){return to(t),void 0===e?t:eo?no(t,e):function(){return t.apply(e,arguments)}},io=ro,ao=ot,oo=fe,so=Hr,co=da,lo=X([].push),uo=function(t){var e=1===t,n=2===t,r=3===t,i=4===t,a=6===t,o=7===t,s=5===t||a;return function(c,l,u,h){for(var f,d,p=oo(c),v=ao(p),g=so(v),y=io(l,u),I=0,m=h||co,E=e?m(c,g):n||o?m(c,0):void 0;g>I;I++)if((s||I in v)&&(d=y(f=v[I],I,p),t))if(e)E[I]=d;else if(d)switch(t){case 3:return!0;case 5:return f;case 6:return I;case 2:lo(E,f)}else switch(t){case 4:return!1;case 7:lo(E,f)}return a?-1:r||i?i:E}},ho={forEach:uo(0),map:uo(1),filter:uo(2),some:uo(3),every:uo(4),find:uo(5),findIndex:uo(6),filterReject:uo(7)},fo=ho.filter;xi({target:"Array",proto:!0,forced:!ya("filter")},{filter:function(t){return fo(this,t,arguments.length>1?arguments[1]:void 0)}});var po=Ji,vo=Vi?{}.toString:function(){return"[object "+po(this)+"]"};Vi||wr(Object.prototype,"toString",vo,{unsafe:!0});var go=ho.map;xi({target:"Array",proto:!0,forced:!ya("map")},{map:function(t){return go(this,t,arguments.length>1?arguments[1]:void 0)}});var yo=xi,Io=Date,mo=X(Io.prototype.getTime);yo({target:"Date",stat:!0},{now:function(){return mo(new Io)}});var Eo=U,_o=X,To=V,Co=N,bo=Ha,Do=ni,Ro=G,wo=fe,So=ot,xo=Object.assign,Lo=Object.defineProperty,Oo=_o([].concat),ko=!xo||Co((function(){if(Eo&&1!==xo({b:1},xo(Lo({},"a",{enumerable:!0,get:function(){Lo(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!==xo({},t)[n]||bo(xo({},e)).join("")!==r}))?function(t,e){for(var n=wo(t),r=arguments.length,i=1,a=Do.f,o=Ro.f;r>i;)for(var s,c=So(arguments[i++]),l=a?Oo(bo(c),a(c)):bo(c),u=l.length,h=0;u>h;)s=l[h++],Eo&&!To(o,c,s)||(n[s]=c[s]);return n}:xo,Ao=ko;xi({target:"Object",stat:!0,arity:2,forced:Object.assign!==Ao},{assign:Ao});var No,Uo,Po,Mo,jo="process"===et(k.process),Vo=X,Go=$t,Ho=yt,Bo=String,Fo=TypeError,Ko=function(t,e,n){try{return Vo(Go(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}},zo=ln,Jo=function(t){if("object"==typeof t||Ho(t))return t;throw new Fo("Can't set "+Bo(t)+" as a prototype")},Wo=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Ko(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return zo(n),Jo(r),e?t(n,r):n.__proto__=r,n}}():void 0),$o=rn.f,qo=ve,Yo=Le("toStringTag"),Xo=function(t,e,n){t&&!n&&(t=t.prototype),t&&!qo(t,Yo)&&$o(t,Yo,{configurable:!0,value:e})},Qo=bn.exports,Zo=rn,ts=function(t,e,n){return n.get&&Qo(n.get,e,{getter:!0}),n.set&&Qo(n.set,e,{setter:!0}),Zo.f(t,e,n)},es=Ct,ns=ts,rs=U,is=Le("species"),as=function(t){var e=es(t);rs&&e&&!e[is]&&ns(e,is,{configurable:!0,get:function(){return this}})},os=bt,ss=TypeError,cs=function(t,e){if(os(e,t))return t;throw new ss("Incorrect invocation")},ls=oa,us=Kt,hs=TypeError,fs=ln,ds=function(t){if(ls(t))return t;throw new hs(us(t)+" is not a constructor")},ps=st,vs=Le("species"),gs=P,ys=Function.prototype,Is=ys.apply,ms=ys.call,Es="object"==typeof Reflect&&Reflect.apply||(gs?ms.bind(Is):function(){return ms.apply(Is,arguments)}),_s=Ct("document","documentElement"),Ts=X([].slice),Cs=TypeError,bs=function(t,e){if(ta;a++)if((s=y(t[a]))&&Iu(bu,s))return s;return new Cu(!1)}r=mu(t,i)}for(c=f?t.next:r.next;!(l=du(c,r)).done;){try{s=y(l.value)}catch(t){_u(r,"throw",t)}if("object"==typeof s&&s&&Iu(bu,s))return s}return new Cu(!1)},Ru=Le("iterator"),wu=!1;try{var Su=0,xu={next:function(){return{done:!!Su++}},return:function(){wu=!0}};xu[Ru]=function(){return this},Array.from(xu,(function(){throw 2}))}catch(t){}var Lu=function(t,e){try{if(!e&&!wu)return!1}catch(t){return!1}var n=!1;try{var r={};r[Ru]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n},Ou=wc,ku=Fc.CONSTRUCTOR||!Lu((function(t){Ou.all(t).then(void 0,(function(){}))})),Au=V,Nu=$t,Uu=Kc,Pu=Rc,Mu=Du;xi({target:"Promise",stat:!0,forced:ku},{all:function(t){var e=this,n=Uu.f(e),r=n.resolve,i=n.reject,a=Pu((function(){var n=Nu(e.resolve),a=[],o=0,s=1;Mu(t,(function(t){var c=o++,l=!1;s++,Au(n,e,t).then((function(t){l||(l=!0,a[c]=t,--s||r(a))}),i)})),--s||r(a)}));return a.error&&i(a.value),n.promise}});var ju=xi,Vu=Fc.CONSTRUCTOR,Gu=wc,Hu=Ct,Bu=yt,Fu=wr,Ku=Gu&&Gu.prototype;if(ju({target:"Promise",proto:!0,forced:Vu,real:!0},{catch:function(t){return this.then(void 0,t)}}),Bu(Gu)){var zu=Hu("Promise").prototype.catch;Ku.catch!==zu&&Fu(Ku,"catch",zu,{unsafe:!0})}var Ju=V,Wu=$t,$u=Kc,qu=Rc,Yu=Du;xi({target:"Promise",stat:!0,forced:ku},{race:function(t){var e=this,n=$u.f(e),r=n.reject,i=qu((function(){var i=Wu(e.resolve);Yu(t,(function(t){Ju(i,e,t).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Xu=V,Qu=Kc;xi({target:"Promise",stat:!0,forced:Fc.CONSTRUCTOR},{reject:function(t){var e=Qu.f(this);return Xu(e.reject,void 0,t),e.promise}});var Zu=ln,th=Et,eh=Kc,nh=xi,rh=Fc.CONSTRUCTOR,ih=function(t,e){if(Zu(t),th(e)&&e.constructor===t)return e;var n=eh.f(t);return(0,n.resolve)(e),n.promise};Ct("Promise"),nh({target:"Promise",stat:!0,forced:rh},{resolve:function(t){return ih(this,t)}});var ah="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,oh=k,sh=Es,ch=yt,lh=ah,uh=Dt,hh=Ts,fh=bs,dh=oh.Function,ph=/MSIE .\./.test(uh)||lh&&function(){var t=oh.Bun.version.split(".");return t.length<3||"0"===t[0]&&(t[1]<3||"3"===t[1]&&"0"===t[2])}(),vh=function(t,e){var n=e?2:1;return ph?function(r,i){var a=fh(arguments.length,1)>n,o=ch(r)?r:dh(r),s=a?hh(arguments,n):[],c=a?function(){sh(o,this,s)}:o;return e?t(c,i):t(c)}:t},gh=xi,yh=k,Ih=vh(yh.setInterval,!0);gh({global:!0,bind:!0,forced:yh.setInterval!==Ih},{setInterval:Ih});var mh=xi,Eh=k,_h=vh(Eh.setTimeout,!0);mh({global:!0,bind:!0,forced:Eh.setTimeout!==_h},{setTimeout:_h});var Th=Ji,Ch=String,bh=function(t){if("Symbol"===Th(t))throw new TypeError("Cannot convert a Symbol value to a string");return Ch(t)},Dh=X,Rh=kr,wh=bh,Sh=ut,xh=Dh("".charAt),Lh=Dh("".charCodeAt),Oh=Dh("".slice),kh=function(t){return function(e,n){var r,i,a=wh(Sh(e)),o=Rh(n),s=a.length;return o<0||o>=s?t?"":void 0:(r=Lh(a,o))<55296||r>56319||o+1===s||(i=Lh(a,o+1))<56320||i>57343?t?xh(a,o):r:t?Oh(a,o,o+2):i-56320+(r-55296<<10)+65536}},Ah={codeAt:kh(!1),charAt:kh(!0)},Nh={},Uh=U,Ph=an,Mh=rn,jh=ln,Vh=dt,Gh=Ha;Nh.f=Uh&&!Ph?Object.defineProperties:function(t,e){jh(t);for(var n,r=Vh(e),i=Gh(e),a=i.length,o=0;a>o;)Mh.f(t,n=i[o++],r[n]);return t};var Hh,Bh=ln,Fh=Nh,Kh=Zr,zh=zn,Jh=_s,Wh=ze,$h="prototype",qh="script",Yh=Kn("IE_PROTO"),Xh=function(){},Qh=function(t){return"<"+qh+">"+t+""},Zh=function(t){t.write(Qh("")),t.close();var e=t.parentWindow.Object;return t=null,e},tf=function(){try{Hh=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;tf="undefined"!=typeof document?document.domain&&Hh?Zh(Hh):(e=Wh("iframe"),n="java"+qh+":",e.style.display="none",Jh.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(Qh("document.F=Object")),t.close(),t.F):Zh(Hh);for(var r=Kh.length;r--;)delete tf[$h][Kh[r]];return tf()};zh[Yh]=!0;var ef,nf,rf,af=Object.create||function(t,e){var n;return null!==t?(Xh[$h]=Bh(t),n=new Xh,Xh[$h]=null,n[Yh]=t):n=tf(),void 0===e?n:Fh.f(n,e)},of=!N((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),sf=ve,cf=yt,lf=fe,uf=of,hf=Kn("IE_PROTO"),ff=Object,df=ff.prototype,pf=uf?ff.getPrototypeOf:function(t){var e=lf(t);if(sf(e,hf))return e[hf];var n=e.constructor;return cf(n)&&e instanceof n?n.prototype:e instanceof ff?df:null},vf=N,gf=yt,yf=Et,If=pf,mf=wr,Ef=Le("iterator"),_f=!1;[].keys&&("next"in(rf=[].keys())?(nf=If(If(rf)))!==Object.prototype&&(ef=nf):_f=!0);var Tf=!yf(ef)||vf((function(){var t={};return ef[Ef].call(t)!==t}));Tf&&(ef={}),gf(ef[Ef])||mf(ef,Ef,(function(){return this}));var Cf={IteratorPrototype:ef,BUGGY_SAFARI_ITERATORS:_f},bf=Cf.IteratorPrototype,Df=af,Rf=J,wf=Xo,Sf=Kl,xf=function(){return this},Lf=xi,Of=V,kf=yt,Af=function(t,e,n,r){var i=e+" Iterator";return t.prototype=Df(bf,{next:Rf(+!r,n)}),wf(t,i,!1),Sf[i]=xf,t},Nf=pf,Uf=Wo,Pf=Xo,Mf=Cn,jf=wr,Vf=Kl,Gf=Ln.PROPER,Hf=Ln.CONFIGURABLE,Bf=Cf.IteratorPrototype,Ff=Cf.BUGGY_SAFARI_ITERATORS,Kf=Le("iterator"),zf="keys",Jf="values",Wf="entries",$f=function(){return this},qf=function(t,e,n,r,i,a,o){Af(n,e,r);var s,c,l,u=function(t){if(t===i&&v)return v;if(!Ff&&t&&t in d)return d[t];switch(t){case zf:case Jf:case Wf:return function(){return new n(this,t)}}return function(){return new n(this)}},h=e+" Iterator",f=!1,d=t.prototype,p=d[Kf]||d["@@iterator"]||i&&d[i],v=!Ff&&p||u(i),g="Array"===e&&d.entries||p;if(g&&(s=Nf(g.call(new t)))!==Object.prototype&&s.next&&(Nf(s)!==Bf&&(Uf?Uf(s,Bf):kf(s[Kf])||jf(s,Kf,$f)),Pf(s,h,!0)),Gf&&i===Jf&&p&&p.name!==Jf&&(Hf?Mf(d,"name",Jf):(f=!0,v=function(){return Of(p,this)})),i)if(c={values:u(Jf),keys:a?v:u(zf),entries:u(Wf)},o)for(l in c)(Ff||f||!(l in d))&&jf(d,l,c[l]);else Lf({target:e,proto:!0,forced:Ff||f},c);return d[Kf]!==v&&jf(d,Kf,v,{name:i}),Vf[e]=v,c},Yf=function(t,e){return{value:t,done:e}},Xf=Ah.charAt,Qf=bh,Zf=ar,td=qf,ed=Yf,nd="String Iterator",rd=Zf.set,id=Zf.getterFor(nd);td(String,"String",(function(t){rd(this,{type:nd,string:Qf(t),index:0})}),(function(){var t,e=id(this),n=e.string,r=e.index;return r>=n.length?ed(void 0,!0):(t=Xf(n,r),e.index+=t.length,ed(t,!1))}));var ad=Le,od=af,sd=rn.f,cd=ad("unscopables"),ld=Array.prototype;void 0===ld[cd]&&sd(ld,cd,{configurable:!0,value:od(null)});var ud=function(t){ld[cd][t]=!0},hd=dt,fd=ud,dd=Kl,pd=ar,vd=rn.f,gd=qf,yd=Yf,Id=U,md="Array Iterator",Ed=pd.set,_d=pd.getterFor(md),Td=gd(Array,"Array",(function(t,e){Ed(this,{type:md,target:hd(t),index:0,kind:e})}),(function(){var t=_d(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=void 0,yd(void 0,!0);switch(t.kind){case"keys":return yd(n,!1);case"values":return yd(e[n],!1)}return yd([n,e[n]],!1)}),"values"),Cd=dd.Arguments=dd.Array;if(fd("keys"),fd("values"),fd("entries"),Id&&"values"!==Cd.name)try{vd(Cd,"name",{value:"values"})}catch(t){}var bd={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},Dd=ze("span").classList,Rd=Dd&&Dd.constructor&&Dd.constructor.prototype,wd=Rd===Object.prototype?void 0:Rd,Sd=k,xd=bd,Ld=wd,Od=Td,kd=Cn,Ad=Xo,Nd=Le("iterator"),Ud=Od.values,Pd=function(t,e){if(t){if(t[Nd]!==Ud)try{kd(t,Nd,Ud)}catch(e){t[Nd]=Ud}if(Ad(t,e,!0),xd[e])for(var n in Od)if(t[n]!==Od[n])try{kd(t,n,Od[n])}catch(e){t[n]=Od[n]}}};for(var Md in xd)Pd(Sd[Md]&&Sd[Md].prototype,Md);Pd(Ld,"DOMTokenList");var jd=xi,Vd=Oi,Gd=oa,Hd=Et,Bd=Pr,Fd=Hr,Kd=dt,zd=Mi,Jd=Le,Wd=Ts,$d=ya("slice"),qd=Jd("species"),Yd=Array,Xd=Math.max;jd({target:"Array",proto:!0,forced:!$d},{slice:function(t,e){var n,r,i,a=Kd(this),o=Fd(a),s=Bd(t,o),c=Bd(void 0===e?o:e,o);if(Vd(a)&&(n=a.constructor,(Gd(n)&&(n===Yd||Vd(n.prototype))||Hd(n)&&null===(n=n[qd]))&&(n=void 0),n===Yd||void 0===n))return Wd(a,s,c);for(r=new(void 0===n?Yd:n)(Xd(c-s,0)),i=0;s1?arguments[1]:void 0)};xi({target:"Array",proto:!0,forced:[].forEach!==Zd},{forEach:Zd});var tp=k,ep=bd,np=wd,rp=Zd,ip=Cn,ap=function(t){if(t&&t.forEach!==rp)try{ip(t,"forEach",rp)}catch(e){t.forEach=rp}};for(var op in ep)ep[op]&&ap(tp[op]&&tp[op].prototype);ap(np);var sp=ln,cp=hu,lp=ro,up=V,hp=fe,fp=function(t,e,n,r){try{return r?e(sp(n)[0],n[1]):e(n)}catch(e){cp(t,"throw",e)}},dp=$l,pp=oa,vp=Hr,gp=Mi,yp=su,Ip=tu,mp=Array,Ep=function(t){var e=hp(t),n=pp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=lp(i,r>2?arguments[2]:void 0));var o,s,c,l,u,h,f=Ip(e),d=0;if(!f||this===mp&&dp(f))for(o=vp(e),s=n?new this(o):mp(o);o>d;d++)h=a?i(e[d],d):e[d],gp(s,d,h);else for(u=(l=yp(e,f)).next,s=n?new this:[];!(c=up(u,l)).done;d++)h=a?fp(l,i,[c.value,d],!0):c.value,gp(s,d,h);return s.length=d,s};xi({target:"Array",stat:!0,forced:!Lu((function(t){Array.from(t)}))},{from:Ep});var _p={exports:{}},Tp={},Cp=Pr,bp=Hr,Dp=Mi,Rp=Array,wp=Math.max,Sp=et,xp=dt,Lp=Sr.f,Op=function(t,e,n){for(var r=bp(t),i=Cp(e,r),a=Cp(void 0===n?r:n,r),o=Rp(wp(a-i,0)),s=0;i1?arguments[1]:void 0);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!c(this,t)}}),Rv(a,n?{get:function(t){var e=c(this,t);return e&&e.value},set:function(t,e){return s(this,0===t?0:t,e)}}:{add:function(t){return s(this,t=0===t?0:t,t)}}),Nv&&Dv(a,"size",{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(t,e,n){var r=e+" Iterator",i=Mv(e),a=Mv(r);Ov(t,e,(function(t,e){Pv(this,{type:r,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=a(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?kv("keys"===e?n.key:"values"===e?n.value:[n.key,n.value],!1):(t.target=void 0,kv(void 0,!0))}),n?"entries":"values",!n,!0),Av(e)}};_v("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),jv);var Vv=U,Gv=Oi,Hv=TypeError,Bv=Object.getOwnPropertyDescriptor,Fv=Vv&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,e){if(Gv(t)&&!Bv(t,"length").writable)throw new Hv("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},Kv=Kt,zv=TypeError,Jv=xi,Wv=fe,$v=Pr,qv=kr,Yv=Hr,Xv=Fv,Qv=Ai,Zv=da,tg=Mi,eg=function(t,e){if(!delete t[e])throw new zv("Cannot delete property "+Kv(e)+" of "+Kv(t))},ng=ya("splice"),rg=Math.max,ig=Math.min;Jv({target:"Array",proto:!0,forced:!ng},{splice:function(t,e){var n,r,i,a,o,s,c=Wv(this),l=Yv(c),u=$v(t,l),h=arguments.length;for(0===h?n=r=0:1===h?(n=0,r=l-u):(n=h-2,r=ig(rg(qv(e),0),l-u)),Qv(l+n-r),i=Zv(c,r),a=0;al-r+n;a--)eg(c,a-1)}else if(n>r)for(a=l-r;a>u;a--)s=a+n-1,(o=a+r-1)in c?c[s]=c[o]:eg(c,s);for(a=0;a 标签),请使用真机调试或者扫码预览。",Lg={RECORD:"scope.record",CAMERA:"scope.camera"},Og="https://buy.cloud.tencent.com/avc?addRavLicense=1",kg="https://buy.tencentcloud.com/avc?addRavLicense=1",Ag=1,Ng=9,Ug=17,Pg=18,Mg=21,jg=15,Vg="\t\n\v\f\r                 \u2028\u2029\ufeff",Gg=ut,Hg=bh,Bg=Vg,Fg=X("".replace),Kg=RegExp("^["+Bg+"]+"),zg=RegExp("(^|[^"+Bg+"])["+Bg+"]+$"),Jg=function(t){return function(e){var n=Hg(Gg(e));return 1&t&&(n=Fg(n,Kg,"")),2&t&&(n=Fg(n,zg,"$1")),n}},Wg={start:Jg(1),end:Jg(2),trim:Jg(3)},$g=k,qg=N,Yg=X,Xg=bh,Qg=Wg.trim,Zg=Vg,ty=$g.parseInt,ey=$g.Symbol,ny=ey&&ey.iterator,ry=/^[+-]?0x/i,iy=Yg(ry.exec),ay=8!==ty(Zg+"08")||22!==ty(Zg+"0x16")||ny&&!qg((function(){ty(Object(ny))}))?function(t,e){var n=Qg(Xg(t));return ty(n,e>>>0||(iy(ry,n)?16:10))}:ty;function oy(t){var e=new Date(t);return"".concat(e.getFullYear(),"-")+"".concat(e.getMonth()+1<10?"0".concat(e.getMonth()+1):e.getMonth()+1,"-")+sy(e.getDate()," ")+sy(e.getHours(),":")+sy(e.getMinutes(),":")+sy(e.getSeconds(),"")}function sy(t,e){return"".concat(t<10?"0".concat(t).concat(e):"".concat(t).concat(e))}xi({global:!0,forced:parseInt!==ay},{parseInt:ay});var cy={exports:{}};self;var ly=L(cy.exports=(()=>(()=>{var t={530:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]{Object.defineProperty(e,"__esModule",{value:!0}),e.formatClsLog=void 0;var r=n(928);e.formatClsLog=function(){return function(t,e){try{e({logs:null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,r.isPlainObject)(t[n]))try{e[n]=(0,r.stringifyPlus)(t[n])}catch(t){console.debug(t)}else"time"===n&&(e[n]=new Date(t[n]).toISOString()),e[n]=t[n]+""})),{contents:e,time:t.time}})),source:""})}catch(t){console.debug(t)}}}},597:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatESLog=void 0;var r=n(928);e.formatESLog=function(t){var e=t.table;return function(t,n){try{var i=null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,r.isPlainObject)(t[n]))try{e[n]=(0,r.stringifyPlus)(t[n])}catch(t){console.debug(t)}else e[n]="level"===n?t[n]+"":"time"===n?new Date(t[n]).toISOString():t[n]})),e}));n({table:e,report:i})}catch(t){console.debug(t)}}}},150:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatClsLog=e.formatESLog=void 0;var r=n(314);Object.defineProperty(e,"formatClsLog",{enumerable:!0,get:function(){return r.formatClsLog}});var i=n(597);Object.defineProperty(e,"formatESLog",{enumerable:!0,get:function(){return i.formatESLog}})},757:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createPipeline=void 0;var r=n(928);e.createPipeline=function(t){if(!t||!t.reduce||!t.length)throw new TypeError("createPipeline need at least one function param");return 1===t.length?function(e,n){t[0](e,n||r.noop)}:t.reduce((function(t,e){return function(n,i){return void 0===i&&(i=r.noop),t(n,(function(t){return null==e?void 0:e(t,i)}))}}))}},758:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.limitLengthPipe=e.MAX_LOG_LENGTH=void 0;var r=n(928);e.MAX_LOG_LENGTH=102400,e.limitLengthPipe=function(){return function(t,n){try{var i=(t=t||{}).logs,a=void 0===i?[]:i;t.logs=null==a?void 0:a.map((function(t){var n=e.MAX_LOG_LENGTH,i=t.contents;return Object.keys(i).forEach((function(t){var e=i[t];try{e&&e.length>n&&(i[t]=null==e?void 0:e.substring(0,n))}catch(a){console.debug("size of content > limitSize"),i[t]=(0,r.stringifyPlus)(e).substring(0,n)}})),t})),n(t)}catch(t){console.debug(t)}}}},23:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createThrottlePipe=void 0,e.createThrottlePipe=function(t,e){var n,r=[];return function(i,a){if(Array.isArray(i)?r=r.concat(i):r.push(i),e&&r.length>=e||t.sendNow&&r.length>0)return a(r.splice(0,r.length)),void(n&&clearTimeout(n));n&&clearTimeout(n),n=setTimeout((function(){n=null,r.length>0&&a(r.splice(0,r.length))}),t.delay||1e3)}}},434:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=2?[4,(0,o.startBlocking)()]:[3,3];case 2:return n.sent(),[3,1];case 3:return s++,[4,new Promise((function(e,n){wx.request(r(r({},t),{success:function(t){e(t)},fail:function(t){n(t)}}))}))];case 4:return[2,n.sent()];case 5:return e=n.sent(),[2,Promise.reject(e)];case 6:return s--,(0,o.resolveFirstBlock)(),[7];case 7:return[2]}}))}))}},310:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,a){function o(t){try{c(r.next(t))}catch(t){a(t)}}function s(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}c((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=2?[4,(0,o.startBlocking)()]:[3,2];case 1:return i.sent(),[3,0];case 2:return s++,r=n.method,u=n.headers,f=void 0===u?{}:u,d=n.responseType,p=void 0===d?"json":d,r=(r||"get").toUpperCase(),Object.assign(f,{"Content-type":"application/json"}),(v=new window.XMLHttpRequest).responseType=p,v.timeout=1e4,v.onreadystatechange=function(){4===v.readyState&&(200===v.status?l({data:v.response}):h({code:v.status,msg:v.statusText}))},v.ontimeout=function(t){h({code:v.status,msg:v.statusText})},v.onloadend=function(){v&&(c((function(t){l(t)}),(function(t){h(t)}),{status:v.status,statusText:v.statusText}),v=null)},v.onabort=function(){v&&(h(new Error("Request aborted")),v=null)},v.onerror=function(){h(new Error("Network Error")),v=null},"GET"===r?t="url".concat(-1===t.indexOf("?")?"?":"&").concat(a.default.stringify(e)):"POST"===r&&(e=JSON.stringify(e)),v.open(r,t,!0),Object.keys(f).forEach((function(t){v.setRequestHeader(t,f[t])})),v.send("POST"===r?e:null),[2]}}))}))}))];case 1:return[2,h.sent()];case 2:throw l=h.sent(),new Error(l);case 3:return s--,(0,o.resolveFirstBlock)(),[7];case 4:return[2]}}))}))}},928:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.date2ISOString=e.stringifyPlus=e.noop=e.isBrowser=e.isMiniProgram=e.isPlainObject=e.appendParams=void 0,e.appendParams=function(t,n){void 0===n&&(n={});var r=[];return Object.keys(n).forEach((function(t){var i=n[t];if(void 0!==i){if((0,e.isPlainObject)(i))try{i=JSON.stringify(i)}catch(t){}r.push("".concat(t,"=").concat(encodeURIComponent(i)))}})),r.length?(t.indexOf("?")>-1?"".concat(t,"&"):"".concat(t,"?"))+r.join("&"):t},e.isPlainObject=function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n},e.isMiniProgram=function(){try{return!(!(null===wx||void 0===wx?void 0:wx.request)||!(null===wx||void 0===wx?void 0:wx.connectSocket))}catch(t){return!1}},e.isBrowser=function(){try{return!(0,e.isMiniProgram)()&&"undefined"!=typeof window&&void 0!==window.document}catch(t){return!1}},e.noop=function(){};var n=function(){var t=new WeakSet;return function(e,n){if(n instanceof Error)return"Error.message: ".concat(n.message," \n Error.stack: ").concat(n.stack);if("object"==typeof n&&null!==n){if(t.has(n))return"[Circular ".concat(e||"root","]");t.add(n)}return n}};e.stringifyPlus=function(t){if("string"==typeof t)return t;try{return t instanceof Error?(JSON.stringify(t,n())||"undefined").replace(/"/gim,""):JSON.stringify(t,n())||"undefined"}catch(t){return"error happen when aegis stringify: \n ".concat(t.message," \n ").concat(t.stack)}},e.date2ISOString=function(){var t,e=new Date,n=e.toISOString(),r=e.getTimezoneOffset()/60;return t=r<0?r>-10?"+0".concat(Math.abs(100*r)):"+".concat(Math.abs(100*r)):r>=10?"-".concat(100*r):"-0".concat(100*r),n.replace("Z",t)}},580:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n(928);e.default={stringify:function(t){return t?Object.keys(t).map((function(e){var n=t[e];if((0,r.isPlainObject)(n))n=JSON.stringify(n);else{if("string"!=typeof n&&"number"!=typeof n)return"";n=+n}return encodeURIComponent(e)+"="+encodeURIComponent(n)})).filter((function(t){return t.length>0})).join("&"):""}}},690:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.startBlocking=e.resolveFirstBlock=void 0;var n=[];e.startBlocking=function(){var t,e=new Promise((function(e){t=e}));return n.push({promise:e,resolve:t}),e},e.resolveFirstBlock=function(){n.length&&(n[0].resolve(),n.shift())}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var a=e[r]={exports:{}};return t[r].call(a.exports,a,a.exports,n),a.exports}var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0});var e=n(530),i={debug:console.debug,info:console.info,warn:console.warn,error:console.error,updateGetReportData:function(t){console.debug(t)}},a=null;t.default=function(t){if(!a){var n=t||{},r=n.clsConfig,o=(n.esConfig,r.endpoint),s=r.topicId;if(!o||!s)return console.debug("endpoint and topicId must not be null"),i;a=new e.default(t)}return a}})(),r})())()),uy=U,hy=Ln.EXISTS,fy=X,dy=ts,py=Function.prototype,vy=fy(py.toString),gy=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,yy=fy(gy.exec);uy&&!hy&&dy(py,"name",{configurable:!0,get:function(){try{return yy(gy,vy(this))[1]}catch(t){return""}}});var Iy={UNKNOWN:65535,NO_NETWORK:2805,FAILURE_SWITCH_TO_AUDIO:60001,FAILURE_SWITCH_TO_VIDEO:60002,ERROR_PACKAGE_NOT_PURCHASED:-1001,ERROR_PACKAGE_NOT_SUPPORTED:-1002,ERROR_TIM_VERSION_OUTDATED:-1003,ERROR_PERMISSION_DENIED:-1101,ERROR_GET_DEVICE_LIST_FAIL:-1102,ERROR_INIT_FAIL:-1201,ERROR_PARAM_INVALID:-1202,ERROR_REQUEST_REFUSED:-1203,ERROR_REQUEST_REPEATED:-1204,ERROR_SCENE_NOT_SUPPORTED:-1205,ERROR_SIGNALING_SEND_FAIL:-1401,ERROR_INVALID_INVITEID:8010,ERROR_INVALID_SEND_FAIL:20003,ERROR_BLACKLIST:20007},my="未连接到网络",Ey="You do not have TUICallKit package, please open the free experience in the console: https://console.intl.cloud.tencent.com/im/detail or purchase the official package: ${purchaseAddress}",_y="The package you purchased does not support this ability. You can refer to here to purchase: ${purchaseAddress}",Ty="TIM SDK version is too old. Please upgrade version",Cy="init is not complete, this API needs to be used after init. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887",by="The API is support use in the state of. Please go to: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42",Dy={NO_NETWORK:"未连接到网络",FAILURE_SWITCH_TO_AUDIO:"切换语音通话失败",FAILURE_SWITCH_TO_VIDEO:"切换视频通话失败",ERROR_NULL:"成功",ERROR_PACKAGE_NOT_PURCHASED:"您的应用还未开通音视频通话(TUICallKit)能力,您可以去控制台申请免费体验: https://console.cloud.tencent.com/im/detail 或购买通话能力套餐包: ${purchaseAddress}",ERROR_PACKAGE_NOT_SUPPORTED:"您暂不支持使用该能力,请前往如下购买页购买开通: ${purchaseAddress}",ERROR_TIM_VERSION_OUTDATED:"TIM SDK 版本太旧,请升级版本",ERROR_PERMISSION_DENIED:"摄像头/麦克风权限被拒绝。解决方案请前往: https://cloud.tencent.com/document/product/647/78770",ERROR_GET_DEVICE_LIST_FAIL:"获取设备列表失败",ERROR_INIT_FAIL:"TUICallEngine init 未完成,需要在 init 完成后使用此 API。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887",ERROR_REQUEST_REFUSED:"当前通话状态无法使用该API。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42",ERROR_REQUEST_REPEATED:"当前方法正在执行中,请勿重复调用",ERROR_REQUEST_REPEATED_SWITCH:"与当前通话类型一致,请勿重复切换",ERROR_SCENE_NOT_SUPPORTED:"当前通话场景不支持该功能",ERROR_SIGNALING_SEND_FAIL:"信令发送失败",ERROR_INVALID_INVITEID:"inviteID 无效或邀请已处理。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#e97ea97b-7812-42ed-89b7-2a3840ac0e3f",ERROR_INVALID_SEND_FAIL:"消息发送方或接收方 UserID 无效或不存在。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#661be1b0-f649-4199-a343-958c3f4f4bbb",ERROR_PARAM_INVALID:"参数错误"},Ry=function(t){p(n,m(Error));var e=T(n);function n(t){var r,i=t.message,a=t.code,o=void 0===a?Iy.UNKNOWN:a;return u(this,n),r=e.call(this,"".concat(i).concat(function(t){for(var e=0,n=Object.keys(Dy);e")),r.code=o,r.name="TUICallEngineError",r.message_=i,r}return f(n,[{key:"getCode",value:function(){return this.code}}]),n}(),wy=["inviteID","type"],Sy=function(){function t(e){u(this,t),this.TSignaling=e.TSignaling,this._logger=ly()}var e,n,r,o,s,c,h;return f(t,[{key:"handleNewSignaling",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this._logger.info("TSignaling.handleNewSignaling.start",{text:{data:{data:t,params:e,userData:n}},type:"api"}),i(i({userData:n||""},t),{},{version:4,businessID:"av_call",platform:"MiniApp",data:i({cmd:_g[t.call_type],room_id:t.room_id,message:""},e)})}},{key:"extractCallingInfoFromMessage",value:function(t){if(!t||"TIMCustomElem"!==t.type)return"";var e=JSON.parse(t.payload.data);if(e.businessID!==dg)return"";switch(e.actionType){case cg:var n=JSON.parse(e.data);return n.call_end>0&&!e.groupID?n.call_end:0!==n.call_end&&n.room_id?"发起通话":"结束群聊";case lg:return"取消通话";case ug:return"已接听";case hg:return"拒绝通话";case fg:return"无应答";default:return""}}},{key:"handleError",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.code,n=void 0===e?"":e,r=t.message;if(n)throw new Ry({message:void 0===r?"":r,code:n})}},{key:"_handleInviteData",value:function(t){var e=t.type,n=t.roomID,r=t.userIDList,i=t.hangup,a=t.switchMode,o=t.userData;if(i)return JSON.stringify(this.handleNewSignaling({version:0,call_type:e,call_end:i.callEnd},{cmd:"hangup"}));if(a){var s={version:0,call_type:e,room_id:n},c={cmd:"switchToVideo"};return a===Tg&&(s.switch_to_audio_call="switch_to_audio_call",c.cmd="switchToAudio"),JSON.stringify(this.handleNewSignaling(s,c))}return JSON.stringify(this.handleNewSignaling({version:0,call_type:e,room_id:n},{userIDs:r},o))}},{key:"_handleInviteGroupData",value:function(t){var e=t.type,n=t.roomID,r=t.hangup,i=t.userData;return r?JSON.stringify(this.handleNewSignaling({version:0,call_type:e,call_end:r.call_end},{cmd:"hangup"},i)):JSON.stringify(this.handleNewSignaling({version:0,call_type:e,room_id:n}))}},{key:"invite",value:(h=l(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.invite.start",{text:{data:{params:e}},type:"api"}),n=e.userID,r=e.offlinePushInfo,i=e.hangup,o=e.switchMode,t.prev=2,t.next=5,this.TSignaling.invite({userID:n,data:this._handleInviteData(e),timeout:i?0:30,offlinePushInfo:r});case 5:return t.abrupt("return",t.sent);case 8:if(t.prev=8,t.t0=t.catch(2),this._logger.error("TSignaling.invite.fail",{text:{data:{hangup:i,switchMode:o},error:t.t0},type:"api"}),!i){t.next=13;break}return t.abrupt("return",this.handleError(t.t0,"hangup C2C"));case 13:if(!o){t.next=15;break}return t.abrupt("return",this.handleError(t.t0,o));case 15:return t.abrupt("return",this.handleError(t.t0,"invite"));case 16:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t){return h.apply(this,arguments)})},{key:"inviteGroup",value:(c=l(a().mark((function t(e){var n,r,i,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.inviteGroup.start",{text:{data:{params:e}},type:"api"}),n=e.groupID,r=e.userIDList,i=e.offlinePushInfo,o=e.hangup,s=e.inCallUserIDs,c=void 0===s?[]:s,t.prev=2,t.next=5,this.TSignaling.inviteInGroup({groupID:n,inviteeList:r,timeout:o?0:30,data:this._handleInviteGroupData(e),offlinePushInfo:i,inCallUserIDs:c});case 5:return t.abrupt("return",t.sent);case 8:if(t.prev=8,t.t0=t.catch(2),this._logger.error("TSignaling.inviteGroup.fail",{text:{data:{hangup:o},error:t.t0},type:"api"}),!o){t.next=13;break}return t.abrupt("return",this.handleError(t.t0,"hangup group"));case 13:return t.abrupt("return",this.handleError(t.t0,"inviteGroup"));case 14:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t){return c.apply(this,arguments)})},{key:"accept",value:(s=l(a().mark((function t(e,n){var r,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.accept.start",{text:{data:{params:e,supportParams:n}},type:"api"}),r=e.inviteID,o=e.type,s=E(e,wy),t.prev=2,t.next=5,this.TSignaling.accept({inviteID:r,data:JSON.stringify(this.handleNewSignaling(i({version:0,call_type:o},s),n))});case 5:return t.abrupt("return",t.sent);case 8:return t.prev=8,t.t0=t.catch(2),this._logger.error("TSignaling.accept.fail",{text:{error:t.t0},type:"api"}),t.abrupt("return",this.handleError(t.t0,"accept"));case 12:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t,e){return s.apply(this,arguments)})},{key:"reject",value:(o=l(a().mark((function t(e){var n,r,i,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.reject.start",{text:{data:{params:e}},type:"api"}),n=e.inviteID,r=e.type,i=e.lineBusy,o={version:0,call_type:r},s=null,i?(o.line_busy=i,s=JSON.stringify(this.handleNewSignaling(o,{message:"lineBusy"}))):s=JSON.stringify(this.handleNewSignaling(o)),t.prev=5,t.next=8,this.TSignaling.reject({inviteID:n,data:s});case 8:return t.abrupt("return",t.sent);case 11:if(t.prev=11,t.t0=t.catch(5),this._logger.error("TSignaling.reject.fail",{text:{error:t.t0},type:"api"}),!i){t.next=16;break}return t.abrupt("return",this.handleError(t.t0,"line_busy"));case 16:return t.abrupt("return",this.handleError(t.t0,"reject"));case 17:case"end":return t.stop()}}),t,this,[[5,11]])}))),function(t){return o.apply(this,arguments)})},{key:"cancel",value:(r=l(a().mark((function t(e){var n,r,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.cancel.start",{text:{data:{params:e}},type:"api"}),n=e.inviteID,r=e.callType,t.prev=2,t.next=5,this.TSignaling.cancel({inviteID:n,data:JSON.stringify(this.handleNewSignaling({version:0,call_type:r}))});case 5:return i=t.sent,t.abrupt("return",i);case 9:return t.prev=9,t.t0=t.catch(2),this._logger.error("TSignaling.cancel.fail",{text:{error:t.t0},type:"api"}),t.abrupt("return",this.handleError(t.t0,"cancel"));case 13:case"end":return t.stop()}}),t,this,[[2,9]])}))),function(t){return r.apply(this,arguments)})},{key:"hangup",value:(n=l(a().mark((function t(e){var n,r,i,o,s,c,l,u,h,f,d;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.hangup.start",{text:{data:{params:e}},type:"api"}),n=e.userIDList,r=e.callType,i=e.callEnd,o=void 0===i?0:i,s=e.isGroupCall,c=void 0!==s&&s,l=e.groupID,u=void 0===l?"":l,h={version:0,call_type:r,call_end:o},f={cmd:"hangup"},d=JSON.stringify(this.handleNewSignaling(h,f)),!c||!u){t.next=10;break}return t.next=8,this.TSignaling.inviteInGroup({inviteeList:n,groupID:u,data:d,timeout:0});case 8:t.next=12;break;case 10:return t.next=12,this.TSignaling.invite({userID:n[0],data:d,timeout:0});case 12:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"switchCallMode",value:(e=l(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.switchCallMode.start",{text:{data:{params:e}},type:"api"}),n=e.userID,r=e.callType,i=e.roomID,o=e.mode,t.abrupt("return",this.invite({userID:n,type:r,roomID:i,switchMode:o}));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"destroyed",value:function(){this._logger.info("TSignaling.destroyed.start",{type:"api"}),this.TSignaling=null}},{key:"setLogLevel",value:function(t){this.TSignaling.setLogLevel(t)}}]),t}(),xy=function(){function t(e){u(this,t),this._emitter=e.emitter,this._logger=ly()}return f(t,[{key:"onError",value:function(t){this._logger.error("TUICallEvent.onError",{text:{error:t},type:"event"}),this._emitter.emit(og.ERROR,t)}},{key:"onCallBegin",value:function(t){this._logger.info("TUICallEvent.onCallBegin",{text:{data:t},type:"event"}),this._emitter.emit(og.ON_CALL_BEGIN,t)}},{key:"onCallEnd",value:function(t){this._logger.info("TUICallEvent.onCallEnd",{text:{data:t},type:"event"});var e=t.userID,n=t.callEnd,r=t.message,i=t.roomID,a=t.callMediaType,o=t.callRole,s=t.totalTime;this._emitter.emit(og.CALL_END,{userID:e,callEnd:n,message:r,roomID:i,callMediaType:a,callRole:o,totalTime:s})}},{key:"onInvited",value:function(t){this._logger.info("TUICallEvent.onInvited",{text:{data:t},type:"event"}),this._emitter.emit(og.INVITED,t),this._emitter.emit(og.ON_CALL_RECEIVED,t)}},{key:"onLineBusy",value:function(t){this._logger.info("TUICallEvent.onLineBusy",{text:{data:t},type:"event"});var e=t.inviteID,n=t.invitee,r=t.userID;this._emitter.emit(og.LINE_BUSY,{inviteID:e,invitee:n,userID:r,reason:"line busy"})}},{key:"onReject",value:function(t){var e=t.inviteID,n=t.invitee,r=t.userID;this._emitter.emit(og.REJECT,{inviteID:e,invitee:n,userID:r,reason:"reject"})}},{key:"onNoResp",value:function(t){this._logger.info("TUICallEvent.onNoResp",{text:{data:t},type:"event"});var e=t.groupID,n=void 0===e?"":e,r=t.inviteID,i=t.sponsor,a=t.timeoutUserList,o=t.userIDList;this._emitter.emit(og.NO_RESP,{groupID:n,inviteID:r,sponsor:i,timeoutUserList:a,userIDList:o})}},{key:"onCancel",value:function(t){this._emitter.emit(og.CALLING_CANCEL,t),this._emitter.emit(og.ON_CALL_CANCELED,t)}},{key:"onTimeout",value:function(t){this._logger.info("TUICallEvent.onTimeout",{text:{data:t},type:"event"});var e=t.inviteID,n=t.groupID,r=t.sponsor,i=t.timeoutUserList;this._emitter.emit(og.CALLING_TIMEOUT,{groupID:n,inviteID:e,sponsor:r,timeoutUserList:i})}},{key:"onUserAccept",value:function(t){this._logger.info("TUICallEvent.onUserAccept",{text:{data:t},type:"event"});var e=t.userID,n=t.userList;this._emitter.emit(og.USER_ACCEPT,{userID:e,userList:n})}},{key:"onUserEnter",value:function(t){this._logger.info("TUICallEvent.onUserEnter",{text:{data:t},type:"event"});var e=t.userID,n=t.playerList;this._emitter.emit(og.USER_ENTER,{userID:e,playerList:n})}},{key:"onUserLeave",value:function(t){this._logger.info("TUICallEvent.onUserLeave",{text:{data:t},type:"event"});var e=t.userID,n=t.playerList;this._emitter.emit(og.USER_LEAVE,{userID:e,playerList:n})}},{key:"onUserUpdate",value:function(t){var e=t.pusher,n=t.playerList;this._emitter.emit(og.USER_UPDATE,{pusher:e,playerList:n})}},{key:"onSdkReady",value:function(t){this._logger.info("TUICallEvent.onSdkReady",{text:{data:t},type:"event"}),this._emitter.emit(og.SDK_READY,t)}},{key:"onKickedOut",value:function(t){this._logger.info("TUICallEvent.onKickedOut",{text:{data:t},type:"event"}),this._emitter.emit(og.KICKED_OUT,t)}},{key:"onCallMode",value:function(t){this._logger.info("TUICallEvent.onCallMode",{text:{data:t},type:"event"}),this._emitter.emit(og.CALL_MODE,t)}},{key:"onMessageSentByMe",value:function(t){this._logger.info("TUICallEvent.onMessageSentByMe",{text:{data:t},type:"event"}),this._emitter.emit(og.MESSAGE_SENT_BY_ME,t)}},{key:"destroyed",value:function(){this._logger.info("TUICallEvent.destroyed",{type:"api"}),this._emitter=null}}]),t}(),Ly="1.6.0";_v("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),jv);var Oy=ln,ky=function(){var t=Oy(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},Ay=V,Ny=ve,Uy=bt,Py=ky,My=RegExp.prototype,jy=Ln.PROPER,Vy=wr,Gy=ln,Hy=bh,By=N,Fy=function(t){var e=t.flags;return void 0!==e||"flags"in My||Ny(t,"flags")||!Uy(My,t)?e:Ay(Py,t)},Ky="toString",zy=RegExp.prototype[Ky],Jy=By((function(){return"/a/b"!==zy.call({source:"a",flags:"b"})})),Wy=jy&&zy.name!==Ky;(Jy||Wy)&&Vy(RegExp.prototype,Ky,(function(){var t=Gy(this);return"/"+Hy(t.source)+"/"+Hy(Fy(t))}),{unsafe:!0});var $y,qy,Yy=Vp;xi({target:"Object",stat:!0,forced:Object.isExtensible!==Yy},{isExtensible:Yy}),$y="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};for(var Xy=function(){},Qy=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],Zy=Qy.length-1;Zy;)qy=Qy[Zy],console[qy]||($y[qy]=Xy),Zy-=1;Object.isExtensible($y)&&($y.methods=Qy);var tI,eI,nI=$y,rI=N,iI=k.RegExp,aI=rI((function(){var t=iI("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),oI=aI||rI((function(){return!iI("a","y").sticky})),sI={BROKEN_CARET:aI||rI((function(){var t=iI("^r","gy");return t.lastIndex=2,null!==t.exec("str")})),MISSED_STICKY:oI,UNSUPPORTED_Y:aI},cI=N,lI=k.RegExp,uI=cI((function(){var t=lI(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})),hI=N,fI=k.RegExp,dI=hI((function(){var t=fI("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")})),pI=V,vI=X,gI=bh,yI=ky,II=sI,mI=ne.exports,EI=af,_I=ar.get,TI=uI,CI=dI,bI=mI("native-string-replace",String.prototype.replace),DI=RegExp.prototype.exec,RI=DI,wI=vI("".charAt),SI=vI("".indexOf),xI=vI("".replace),LI=vI("".slice),OI=(eI=/b*/g,pI(DI,tI=/a/,"a"),pI(DI,eI,"a"),0!==tI.lastIndex||0!==eI.lastIndex),kI=II.BROKEN_CARET,AI=void 0!==/()??/.exec("")[1];(OI||AI||kI||TI||CI)&&(RI=function(t){var e,n,r,i,a,o,s,c=this,l=_I(c),u=gI(t),h=l.raw;if(h)return h.lastIndex=c.lastIndex,e=pI(RI,h,u),c.lastIndex=h.lastIndex,e;var f=l.groups,d=kI&&c.sticky,p=pI(yI,c),v=c.source,g=0,y=u;if(d&&(p=xI(p,"y",""),-1===SI(p,"g")&&(p+="g"),y=LI(u,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==wI(u,c.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),n=new RegExp("^(?:"+v+")",p)),AI&&(n=new RegExp("^"+v+"$(?!\\s)",p)),OI&&(r=c.lastIndex),i=pI(DI,d?n:c,y),d?i?(i.input=LI(i.input,g),i[0]=LI(i[0],g),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:OI&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),AI&&i&&i.length>1&&pI(bI,i[0],n,(function(){for(a=1;a2)if(l=Rm(l),43===(e=km(l,0))||45===e){if(88===(n=km(l,2))||120===n)return NaN}else if(48===e){switch(km(l,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+l}for(o=(a=Om(l,2)).length,s=0;si)return NaN;return parseInt(a,r)}return+l},Nm=vm(wm,!Sm(" 0o1")||!Sm("0b1")||Sm("+0x1")),Um=function(t){var e,n=arguments.length<1?0:Sm(function(t){var e=Em(t,"number");return"bigint"==typeof e?e:Am(e)}(t));return Im(xm,e=this)&&_m((function(){Dm(e)}))?ym(Object(n),this,Um):n};Um.prototype=xm,Nm&&(xm.constructor=Um),um({global:!0,constructor:!0,wrap:!0,forced:Nm},{Number:Um});Nm&&function(t,e){for(var n,r=hm?Tm(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;r.length>i;i++)gm(e,n=r[i])&&!gm(t,n)&&bm(t,n,Cm(e,n))}(dm[wm],Sm);var Pm=kr,Mm=bh,jm=ut,Vm=RangeError,Gm=function(t){var e=Mm(jm(this)),n="",r=Pm(t);if(r<0||r===1/0)throw new Vm("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n},Hm=X,Bm=Vr,Fm=bh,Km=ut,zm=Hm(Gm),Jm=Hm("".slice),Wm=Math.ceil,$m=function(t){return function(e,n,r){var i,a,o=Fm(Km(e)),s=Bm(n),c=o.length,l=void 0===r?" ":Fm(r);return s<=c||""===l?o:((a=zm(l,Wm((i=s-c)/l.length))).length>i&&(a=Jm(a,0,i)),t?o+a:a+o)}},qm=X,Ym=N,Xm={start:$m(!1),end:$m(!0)}.start,Qm=RangeError,Zm=isFinite,tE=Math.abs,eE=Date.prototype,nE=eE.toISOString,rE=qm(eE.getTime),iE=qm(eE.getUTCDate),aE=qm(eE.getUTCFullYear),oE=qm(eE.getUTCHours),sE=qm(eE.getUTCMilliseconds),cE=qm(eE.getUTCMinutes),lE=qm(eE.getUTCMonth),uE=qm(eE.getUTCSeconds),hE=Ym((function(){return"0385-07-25T07:06:39.999Z"!==nE.call(new Date(-50000000000001))}))||!Ym((function(){nE.call(new Date(NaN))}))?function(){if(!Zm(rE(this)))throw new Qm("Invalid time value");var t=this,e=aE(t),n=sE(t),r=e<0?"-":e>9999?"+":"";return r+Xm(tE(e),r?6:4,0)+"-"+Xm(lE(t)+1,2,0)+"-"+Xm(iE(t),2,0)+"T"+Xm(oE(t),2,0)+":"+Xm(cE(t),2,0)+":"+Xm(uE(t),2,0)+"."+Xm(n,3,0)+"Z"}:nE;xi({target:"Date",proto:!0,forced:Date.prototype.toISOString!==hE},{toISOString:hE});var fE=X,dE=fe,pE=Math.floor,vE=fE("".charAt),gE=fE("".replace),yE=fE("".slice),IE=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,mE=/\$([$&'`]|\d{1,2})/g,EE=Es,_E=V,TE=X,CE=FI,bE=N,DE=ln,RE=yt,wE=st,SE=kr,xE=Vr,LE=bh,OE=ut,kE=zI,AE=Xt,NE=function(t,e,n,r,i,a){var o=n+t.length,s=r.length,c=mE;return void 0!==i&&(i=dE(i),c=IE),gE(a,c,(function(a,c){var l;switch(vE(c,0)){case"$":return"$";case"&":return t;case"`":return yE(e,0,n);case"'":return yE(e,o);case"<":l=i[yE(c,1,-1)];break;default:var u=+c;if(0===u)return a;if(u>s){var h=pE(u/10);return 0===h?a:h<=s?void 0===r[h-1]?vE(c,1):r[h-1]+vE(c,1):a}l=r[u-1]}return void 0===l?"":l}))},UE=QI,PE=Le("replace"),ME=Math.max,jE=Math.min,VE=TE([].concat),GE=TE([].push),HE=TE("".indexOf),BE=TE("".slice),FE="$0"==="a".replace(/./,"$0"),KE=!!/./[PE]&&""===/./[PE]("a","$0");CE("replace",(function(t,e,n){var r=KE?"$":"$0";return[function(t,n){var r=OE(this),i=wE(t)?void 0:AE(t,PE);return i?_E(i,t,r,n):_E(e,LE(r),t,n)},function(t,i){var a=DE(this),o=LE(t);if("string"==typeof i&&-1===HE(i,r)&&-1===HE(i,"$<")){var s=n(e,a,o,i);if(s.done)return s.value}var c=RE(i);c||(i=LE(i));var l,u=a.global;u&&(l=a.unicode,a.lastIndex=0);for(var h,f=[];null!==(h=UE(a,o))&&(GE(f,h),u);){""===LE(h[0])&&(a.lastIndex=kE(o,xE(a.lastIndex),l))}for(var d,p="",v=0,g=0;g=v&&(p+=BE(o,v,m)+y,v=m+I.length)}return p+BE(o,v)}]}),!!bE((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!FE||KE);var zE,JE=Et,WE=et,$E=Le("match"),qE=function(t){var e;return JE(t)&&(void 0!==(e=t[$E])?!!e:"RegExp"===WE(t))},YE=TypeError,XE=function(t){if(qE(t))throw new YE("The method doesn't accept regular expressions");return t},QE=Le("match"),ZE=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[QE]=!1,"/./"[t](e)}catch(t){}}return!1},t_=xi,e_=Ja,n_=A.f,r_=Vr,i_=bh,a_=XE,o_=ut,s_=ZE,c_=e_("".startsWith),l_=e_("".slice),u_=Math.min,h_=s_("startsWith");function f_(t,e){t=t.split("."),e=e.split(".");for(var n=Math.max(t.length,e.length);t.lengtha)return 1;if(i1?arguments[1]:void 0,e.length)),r=i_(t);return c_?c_(e,r,n):l_(e,n,n+r.length)===r}});var d_="TRTC-ROOM",p_=wx||qq;p_||console.error(d_,"不支持当前小程序环境");var v_,g_=p_.getSystemInfoSync(),y_=g_.safeArea;("iOS 13.3"===g_.system||"iPhoneX"===g_.model&&"iOS 13.3.1"===g_.system)&&console.log("use media audio volume type"),console.log(d_,"SystemInfo",g_),"undefined"!=typeof qq?v_=!0:"undefined"!=typeof wx&&(v_=f_(g_.version,"7.0.8")>=0||f_(g_.version,"2.4.0")>=0&&f_(g_.version,"6.0.0")<0&&f_(g_.SDKVersion,"2.10.0")>=0);var I_=v_,m_="undefined"!=typeof uni,E_=/iOS/i.test(g_.system),__=/Android/i.test(g_.system);/mac/i.test(g_.system);var T_=g_.version,C_=g_.SDKBuild?"".concat(g_.SDKVersion,"-").concat(g_.SDKBuild):g_.SDKVersion;g_.screenHeight,y_.bottom,console.log(d_,"APP_VERSION:",T_," LIB_VERSION:",C_," is new version:",I_);var b_=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"array"===function(t){return Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase()}(t)},D_=function(t){return null!==t&&("number"==typeof t&&!isNaN(t-0)||"object"===s(t)&&t.constructor===Number)},R_=function(t){return"string"==typeof t},w_=function(t){return null!==t&&"object"===s(t)},S_=function(t){return void 0===t},x_=0;Date.now||(Date.now=function(){return(new Date).getTime()});var L_=function(){0===x_&&(x_=Date.now()-1);var t=Date.now()-x_;return t>4294967295?(x_+=4294967295,Date.now()-x_):t},O_=function(t){return t instanceof Error},k_=function(t){return JSON.stringify(t,["message","code"])};function A_(){var t="unknown";return E_&&(t="ios"),__&&(t="android"),t}function N_(t){return U_.apply(this,arguments)}function U_(){return(U_=l(a().mark((function t(e){var n,r,i,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",!1);case 2:return n=e.microphone,r=void 0!==n&&n,i=e.camera,o=void 0!==i&&i,t.prev=3,t.next=6,wx.getSetting();case 6:if(s=t.sent,c=s.authSetting[Lg.RECORD],l=s.authSetting[Lg.CAMERA],!r||!o){t.next=11;break}return t.abrupt("return",c&&l);case 11:if(!r){t.next=13;break}return t.abrupt("return",c);case 13:if(!o){t.next=15;break}return t.abrupt("return",l);case 15:return t.abrupt("return",!1);case 18:return t.prev=18,t.t0=t.catch(3),t.abrupt("return",!1);case 21:case"end":return t.stop()}}),t,null,[[3,18]])})))).apply(this,arguments)}function P_(t){return t===wg.AV_CALL}function M_(){return performance&&performance.now?Math.floor(performance.now()):Date.now()}function j_(t){var e=String(t);return e.startsWith("14")||e.startsWith("16")||e.startsWith("17")}function V_(t){var e=j_(t)?Og:kg;return"".concat(e,"&position=").concat(t,"®ionId=").concat(function(t){return t>=2e7&&t<3e7||t>=172e7&&t<173e7?Ng:t>=3e7&&t<4e7||t>=173e7&&t<174e7?Pg:t>=4e7&&t<5e7||t>=174e7&&t<175e7?Ug:t>=5e7&&t<6e7||t>=175e7&&t<176e7?Mg:t>=7e7&&t<8e7||t>=177e7&&t<178e7?jg:Ag}(t))}var G_=0,H_=new Map;function B_(){var t=new Date;return"TUICallEngine ".concat(t.toLocaleTimeString("en-US",{hour12:!1}),".").concat(function(t){var e;switch(t.toString().length){case 1:e="00".concat(t);break;case 2:e="0".concat(t);break;default:e=t}return e}(t.getMilliseconds()),":")}var F_={_data:[],_length:0,_visible:!1,arguments2String:function(t){var e,n;if(1===t.length)e=B_()+t[0];else{e=B_();for(var r=0,i=t.length;r-10?"+0".concat(Math.abs(100*r)):"+".concat(Math.abs(100*r)):r>=10?"-".concat(100*r):"-0".concat(100*r),n.replace("Z",i)),this.startts&&this.endts&&!this.timespan&&(this.timespan=Math.abs(this.endts-this.startts))}},{key:"setEnd",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.endts=Date.now(),e?this._eventStatController.pushIn(this):setTimeout((function(){t._eventStatController.pushIn(t)}),0)}},{key:"setError",value:function(t,e,n){return this.setNetworkType(n),e?(t.code&&this.setCode(t.code),t.message&&this.setMessage(t.message)):(this.setCode(Iy.NO_NETWORK),this.setMessage(my)),this}},{key:"setCode",value:function(t){return"ECONNABORTED"===t&&(this.codeint=103),D_(t)?this.codeint=t:F_.warn("SSOLogData.setCode value not a number, please check!",t,s(t)),this}},{key:"setMessage",value:function(t){return R_(t)?(this.message=t,this):this}},{key:"setText",value:function(t){return D_(t)?this.text=t.toString():R_(t)&&(this.text=t),this}},{key:"setTalkTime",value:function(t){return this.talktime=t,this}},{key:"setMessageType",value:function(t){return this.msgType=t,this}},{key:"setCallType",value:function(t){return this.calltype=t,this}},{key:"setNetworkType",value:function(t){return S_(t)?F_.warn("SSOLogData.setNetworkType value is undefined, please check!"):this.networktype=t,this}}],[{key:"bindController",value:function(e){t.prototype._eventStatController=e}}]),t}(),z_="sdkConstruct",J_="quality_report",W_=function(){function t(){u(this,t),this._table="timweb-trtccalling",this._report=[]}return f(t,[{key:"pushIn",value:function(t){F_.debug("SSOLogBody.pushIn",this._report.length,t),this._report.push(t)}},{key:"backfill",value:function(t){var e;b_(t)&&0!==t.length&&(F_.debug("SSOLogBody.backfill",this._report.length,t.length),(e=this._report).unshift.apply(e,C(t)))}},{key:"getLogsNumInMemory",value:function(){return this._report.length}},{key:"isEmpty",value:function(){return 0===this._report.length}},{key:"_reset",value:function(){this._report.length=0,this._report=[]}},{key:"getTable",value:function(){return this._table}},{key:"getLogsInMemory",value:function(){var t=this._report.slice();return this._reset(),t}}]),t}(),$_={CURRENT:{COMMON:"https://webim.tim.qq.com"},PRODUCTION:{COMMON:"https://webim.tim.qq.com"}},q_={IM_OPEN_STAT:"imopenstat"},Y_={TIM_WEB_TRTCCALLING_REPORT:"tweb_trtccalling_report"},X_={imopenstat:"v4"},Q_=function(){function t(){u(this,t),this.TAG="trtccalling-ssolog-event",this._reportBody=new W_,this._version=Ly,this.MIN_THRESHOLD=20,this.MAX_THRESHOLD=100,this.WAITING_TIME=6e4,this.INTERVAL=2e4,this._timerID=0,this._resetLastReportTime(),this._startReportTimer(),this._retryCount=0,this.MAX_RETRY_COUNT=3}return f(t,[{key:"reportAtOnce",value:function(){F_.debug("EventStatController.reportAtOnce"),this._report()}},{key:"pushIn",value:function(t){t instanceof K_&&(t.setCommonInfo({SDKAppID:Number(wx.getStorageSync("sdkAppId")),version:this._version,userID:wx.getStorageSync("userId")}),this._reportBody.pushIn(t),this._report())}},{key:"_resetLastReportTime",value:function(){this._lastReportTime=Date.now()}},{key:"_startReportTimer",value:function(){var t=this;this._timerID=setInterval((function(){Date.now()0&&(clearInterval(this._timerID),this._timerID=0)}},{key:"_report",value:function(){var t=this;if(!this._reportBody.isEmpty()){var e=Math.ceil(+new Date/1e3),n=wx.getStorageSync("sdkAppId"),r=this._reportBody.getLogsInMemory(),i={table:this._reportBody.getTable(),report:r},a=$_.CURRENT.COMMON,o=X_.imopenstat,s=q_.IM_OPEN_STAT,c=Y_.TIM_WEB_TRTCCALLING_REPORT,l="".concat(a,"/").concat(o,"/").concat(s,"/").concat(c,"/?sdkappid=").concat(n,"&reqtime=").concat(e);wx.request({url:l,method:"POST",data:JSON.stringify(i),header:{"content-type":"application/json"},success:function(e){t._retryCount>0&&(F_.debug("EventStatController.report retry success"),t._retryCount=0)},fail:function(e){F_.warn("EventStatController.report, error:".concat(k_(e))),t._reportBody.backfill(r),t._reportBody.getLogsNumInMemory()>t.MAX_THRESHOLD||t._retryCount===t.MAX_RETRY_COUNT||0===t._timerID?t._retryCount=0:t._retryCount+=1}})}}},{key:"reset",value:function(){F_.log("EventStatController.reset"),this._stopReportTimer(),this._report()}}]),t}(),Z_=Jr.includes,tT=ud;xi({target:"Array",proto:!0,forced:N((function(){return!Array(1).includes()}))},{includes:function(t){return Z_(this,t,arguments.length>1?arguments[1]:void 0)}}),tT("includes");var eT=xi,nT=XE,rT=ut,iT=bh,aT=ZE,oT=X("".indexOf);eT({target:"String",proto:!0,forced:!aT("includes")},{includes:function(t){return!!~oT(iT(rT(this)),iT(nT(t)),arguments.length>1?arguments[1]:void 0)}});var sT=X,cT=Cv,lT=_p.exports.getWeakData,uT=cs,hT=ln,fT=st,dT=Et,pT=Du,vT=ve,gT=ar.set,yT=ar.getterFor,IT=ho.find,mT=ho.findIndex,ET=sT([].splice),_T=0,TT=function(t){return t.frozen||(t.frozen=new CT)},CT=function(){this.entries=[]},bT=function(t,e){return IT(t.entries,(function(t){return t[0]===e}))};CT.prototype={get:function(t){var e=bT(this,t);if(e)return e[1]},has:function(t){return!!bT(this,t)},set:function(t,e){var n=bT(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=mT(this.entries,(function(e){return e[0]===t}));return~e&&ET(this.entries,e,1),!!~e}};var DT,RT={getConstructor:function(t,e,n,r){var i=t((function(t,i){uT(t,a),gT(t,{type:e,id:_T++,frozen:void 0}),fT(i)||pT(i,t[r],{that:t,AS_ENTRIES:n})})),a=i.prototype,o=yT(e),s=function(t,e,n){var r=o(t),i=lT(hT(e),!0);return!0===i?TT(r).set(e,n):i[r.id]=n,t};return cT(a,{delete:function(t){var e=o(this);if(!dT(t))return!1;var n=lT(t);return!0===n?TT(e).delete(t):n&&vT(n,e.id)&&delete n[e.id]},has:function(t){var e=o(this);if(!dT(t))return!1;var n=lT(t);return!0===n?TT(e).has(t):n&&vT(n,e.id)}}),cT(a,n?{get:function(t){var e=o(this);if(dT(t)){var n=lT(t);return!0===n?TT(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return s(this,t,e)}}:{add:function(t){return s(this,t,!0)}}),i}},wT=Gp,ST=k,xT=X,LT=Cv,OT=_p.exports,kT=_v,AT=RT,NT=Et,UT=ar.enforce,PT=N,MT=Gn,jT=Object,VT=Array.isArray,GT=jT.isExtensible,HT=jT.isFrozen,BT=jT.isSealed,FT=jT.freeze,KT=jT.seal,zT={},JT={},WT=!ST.ActiveXObject&&"ActiveXObject"in ST,$T=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},qT=kT("WeakMap",$T,AT),YT=qT.prototype,XT=xT(YT.set);if(MT)if(WT){DT=AT.getConstructor($T,"WeakMap",!0),OT.enable();var QT=xT(YT.delete),ZT=xT(YT.has),tC=xT(YT.get);LT(YT,{delete:function(t){if(NT(t)&&!GT(t)){var e=UT(this);return e.frozen||(e.frozen=new DT),QT(this,t)||e.frozen.delete(t)}return QT(this,t)},has:function(t){if(NT(t)&&!GT(t)){var e=UT(this);return e.frozen||(e.frozen=new DT),ZT(this,t)||e.frozen.has(t)}return ZT(this,t)},get:function(t){if(NT(t)&&!GT(t)){var e=UT(this);return e.frozen||(e.frozen=new DT),ZT(this,t)?tC(this,t):e.frozen.get(t)}return tC(this,t)},set:function(t,e){if(NT(t)&&!GT(t)){var n=UT(this);n.frozen||(n.frozen=new DT),ZT(this,t)?XT(this,t,e):n.frozen.set(t,e)}else XT(this,t,e);return this}})}else wT&&PT((function(){var t=FT([]);return XT(new qT,t,1),!HT(t)}))&<(YT,{set:function(t,e){var n;return VT(t)&&(HT(t)?n=zT:BT(t)&&(n=JT)),XT(this,t,e),n===zT&&FT(t),n===JT&&KT(t),this}});var eC={exports:{}}; /*! * validate.js 0.13.1 * * (c) 2013-2019 Nicklas Ansman, 2013 Wrapp * Validate.js may be freely distributed under the MIT license. * For all details and documentation: * http://validatejs.org/ */(function(t,e,n){var r=function(t,e,n){n=i.extend({},i.options,n);var a=i.runValidations(t,e,n);if(a.some((function(t){return i.isPromise(t.error)})))throw new Error("Use validate.async if you want support for promises");return r.processValidationResults(a,n)},i=r;i.extend=function(t){return[].slice.call(arguments,1).forEach((function(e){for(var n in e)t[n]=e[n]})),t},i.extend(r,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var t=i.format("%{major}.%{minor}.%{patch}",i.version);return i.isEmpty(i.version.metadata)||(t+="+"+i.version.metadata),t}},Promise:"undefined"!=typeof Promise?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(t,e,n){var r,a,o,s,c,l,u,h=[];for(r in(i.isDomElement(t)||i.isJqueryElement(t))&&(t=i.collectFormValues(t)),e)for(a in o=i.getDeepObjectValue(t,r),s=i.result(e[r],o,t,r,n,e)){if(!(c=i.validators[a]))throw u=i.format("Unknown validator %{name}",{name:a}),new Error(u);l=s[a],(l=i.result(l,o,t,r,n,e))&&h.push({attribute:r,value:o,validator:a,globalOptions:n,attributes:t,options:l,error:c.call(c,o,l,r,t,n)})}return h},processValidationResults:function(t,e){t=i.pruneEmptyErrors(t,e),t=i.expandMultipleErrors(t,e),t=i.convertErrorMessages(t,e);var n=e.format||"grouped";if("function"!=typeof i.formatters[n])throw new Error(i.format("Unknown format %{format}",e));return t=i.formatters[n](t),i.isEmpty(t)?void 0:t},async:function(t,e,n){var r=(n=i.extend({},i.async.options,n)).wrapErrors||function(t){return t};!1!==n.cleanAttributes&&(t=i.cleanAttributes(t,e));var a=i.runValidations(t,e,n);return new i.Promise((function(o,s){i.waitForResults(a).then((function(){var c=i.processValidationResults(a,n);c?s(new r(c,n,t,e)):o(t)}),(function(t){s(t)}))}))},single:function(t,e,n){return n=i.extend({},i.single.options,n,{format:"flat",fullMessages:!1}),i({single:t},{single:e},n)},waitForResults:function(t){return t.reduce((function(t,e){return i.isPromise(e.error)?t.then((function(){return e.error.then((function(t){e.error=t||null}))})):t}),new i.Promise((function(t){t()})))},result:function(t){var e=[].slice.call(arguments,1);return"function"==typeof t&&(t=t.apply(null,e)),t},isNumber:function(t){return"number"==typeof t&&!isNaN(t)},isFunction:function(t){return"function"==typeof t},isInteger:function(t){return i.isNumber(t)&&t%1==0},isBoolean:function(t){return"boolean"==typeof t},isObject:function(t){return t===Object(t)},isDate:function(t){return t instanceof Date},isDefined:function(t){return null!=t},isPromise:function(t){return!!t&&i.isFunction(t.then)},isJqueryElement:function(t){return t&&i.isString(t.jquery)},isDomElement:function(t){return!!t&&!(!t.querySelectorAll||!t.querySelector)&&(!(!i.isObject(document)||t!==document)||("object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName))},isEmpty:function(t){var e;if(!i.isDefined(t))return!0;if(i.isFunction(t))return!1;if(i.isString(t))return i.EMPTY_STRING_REGEXP.test(t);if(i.isArray(t))return 0===t.length;if(i.isDate(t))return!1;if(i.isObject(t)){for(e in t)return!1;return!0}return!1},format:i.extend((function(t,e){return i.isString(t)?t.replace(i.format.FORMAT_REGEXP,(function(t,n,r){return"%"===n?"%{"+r+"}":String(e[r])})):t}),{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(t){return i.isNumber(t)?100*t%1==0?""+t:parseFloat(Math.round(100*t)/100).toFixed(2):i.isArray(t)?t.map((function(t){return i.prettify(t)})).join(", "):i.isObject(t)?i.isDefined(t.toString)?t.toString():JSON.stringify(t):(t=""+t).replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,(function(t,e,n){return e+" "+n.toLowerCase()})).toLowerCase()},stringifyValue:function(t,e){return(e&&e.prettify||i.prettify)(t)},isString:function(t){return"string"==typeof t},isArray:function(t){return"[object Array]"==={}.toString.call(t)},isHash:function(t){return i.isObject(t)&&!i.isArray(t)&&!i.isFunction(t)},contains:function(t,e){return!!i.isDefined(t)&&(i.isArray(t)?-1!==t.indexOf(e):e in t)},unique:function(t){return i.isArray(t)?t.filter((function(t,e,n){return n.indexOf(t)==e})):t},forEachKeyInKeypath:function(t,e,n){if(i.isString(e)){var r,a="",o=!1;for(r=0;ro&&(r=e.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",c.push(i.format(r,{count:o}))),c.length>0?e.message||c:void 0):e.message||this.notValid||"has an incorrect length"}},numericality:function(t,e,n,r,a){if(i.isDefined(t)){var o,s,c=[],l={greaterThan:function(t,e){return t>e},greaterThanOrEqualTo:function(t,e){return t>=e},equalTo:function(t,e){return t===e},lessThan:function(t,e){return to&&(n=e.tooLate||e.message||this.tooLate||"must be no later than %{date}",n=i.format(n,{date:this.format(o,e),value:this.format(t,e)}),r.push(n)),r.length?i.unique(r):void 0)}}),{parse:null,format:null}),date:function(t,e){return e=i.extend({},e,{dateOnly:!0}),i.validators.datetime.call(i.validators.datetime,t,e)},format:function(t,e){(i.isString(e)||e instanceof RegExp)&&(e={pattern:e});var n,r=(e=i.extend({},this.options,e)).message||this.message||"is invalid",a=e.pattern;if(i.isDefined(t))return i.isString(t)?(i.isString(a)&&(a=new RegExp(e.pattern,e.flags)),(n=a.exec(t))&&n[0].length==t.length?void 0:r):r},inclusion:function(t,e){if(i.isDefined(t)&&(i.isArray(e)&&(e={within:e}),e=i.extend({},this.options,e),!i.contains(e.within,t))){var n=e.message||this.message||"^%{value} is not included in the list";return i.format(n,{value:t})}},exclusion:function(t,e){if(i.isDefined(t)&&(i.isArray(e)&&(e={within:e}),e=i.extend({},this.options,e),i.contains(e.within,t))){var n=e.message||this.message||"^%{value} is restricted";return i.isString(e.within[t])&&(t=e.within[t]),i.format(n,{value:t})}},email:i.extend((function(t,e){var n=(e=i.extend({},this.options,e)).message||this.message||"is not a valid email";if(i.isDefined(t))return i.isString(t)&&this.PATTERN.exec(t)?void 0:n}),{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(t,e,n,r,a){if(i.isDefined(t)){i.isString(e)&&(e={attribute:e});var o=(e=i.extend({},this.options,e)).message||this.message||"is not equal to %{attribute}";if(i.isEmpty(e.attribute)||!i.isString(e.attribute))throw new Error("The attribute must be a non empty string");var s=i.getDeepObjectValue(r,e.attribute),c=e.comparator||function(t,e){return t===e},l=e.prettify||a&&a.prettify||i.prettify;return c(t,s,e,n,r)?void 0:i.format(o,{attribute:l(e.attribute)})}},url:function(t,e){if(i.isDefined(t)){var n=(e=i.extend({},this.options,e)).message||this.message||"is not a valid url",r=e.schemes||this.schemes||["http","https"],a=e.allowLocal||this.allowLocal||!1,o=e.allowDataUrl||this.allowDataUrl||!1;if(!i.isString(t))return n;var s="^(?:(?:"+r.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",c="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";return a?c+="?":s+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",s+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+c+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",o&&(s="(?:"+s+")|(?:^data:(?:\\w+\\/[-+.\\w]+(?:;[\\w=]+)*)?(?:;base64)?,[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*$)"),new RegExp(s,"i").exec(t)?void 0:n}},type:i.extend((function(t,e,n,r,a){if(i.isString(e)&&(e={type:e}),i.isDefined(t)){var o,s=i.extend({},this.options,e),c=s.type;if(!i.isDefined(c))throw new Error("No type was specified");if(o=i.isFunction(c)?c:this.types[c],!i.isFunction(o))throw new Error("validate.validators.type.types."+c+" must be a function.");if(!o(t,s,n,r,a)){var l=e.message||this.messages[c]||this.message||s.message||(i.isFunction(c)?"must be of the correct type":"must be of type %{type}");return i.isFunction(l)&&(l=l(t,e,n,r,a)),i.format(l,{attribute:i.prettify(n),type:c})}}}),{types:{object:function(t){return i.isObject(t)&&!i.isArray(t)},array:i.isArray,integer:i.isInteger,number:i.isNumber,string:i.isString,date:i.isDate,boolean:i.isBoolean},messages:{}})},r.formatters={detailed:function(t){return t},flat:i.flattenErrorsToArray,grouped:function(t){var e;for(e in t=i.groupErrorsByAttribute(t))t[e]=i.flattenErrorsToArray(t[e]);return t},constraint:function(t){var e;for(e in t=i.groupErrorsByAttribute(t))t[e]=t[e].map((function(t){return t.validator})).sort();return t}},r.exposeModule(r,this,t,e,n)}).call(x,eC.exports,eC,null);var nC=eC.exports,rC="number",iC="string",aC="object",oC="function",sC="array",cC={createInstance:{sdkAppID:{presence:!0,type:rC},tim:{type:aC}},destroyInstance:{},init:{userID:{presence:!0,type:iC},userSig:{presence:!0,type:iC}},on:{eventCode:{presence:!0,type:iC},handler:{presence:!0,type:oC},context:{presence:!0,type:aC}},off:{eventCode:{presence:!0,type:iC},handler:{presence:!0,type:oC}},call:{userID:{presence:!0,type:iC},type:{presence:!0,type:rC},roomID:{presence:!1,type:rC,numericality:{onlyInteger:!0,greaterThan:0,lessThanOrEqualTo:Rg}}},groupCall:{groupID:{presence:!0,type:iC},type:{presence:!0,type:rC},userIDList:{presence:!0,type:sC},roomID:{presence:!1,type:rC,numericality:{onlyInteger:!0,greaterThan:0,lessThanOrEqualTo:Rg}}},joinInGroupCall:{groupID:{presence:!0,type:iC},type:{presence:!0,type:rC},roomID:{presence:!0,type:rC}},inviteUser:{userIDList:{presence:!0,type:sC}},accept:{},reject:{},hangup:{},switchCallMediaType:{type:{presence:!0,type:rC}},openCamera:{},closeCamera:{},switchCamera:{},openMicrophone:{},closeMicrophone:{},selectAudioPlaybackDevice:{type:{presence:!0,type:iC}},setSelfInfo:{nickName:{presence:!0,type:iC},avatar:{presence:!0,type:iC}}},lC={createInstance:"",destroyInstance:"",init:"",on:"",off:"",call:[sg.IDLE],groupCall:[sg.IDLE],accept:[sg.CALLING],reject:[sg.CALLING],hangup:[sg.CALLING,sg.CONNECTED],switchCallMediaType:[sg.CALLING,sg.CONNECTED],joinInGroupCall:[sg.IDLE],inviteUser:[sg.CALLING,sg.CONNECTED],openCamera:[sg.CALLING,sg.CONNECTED],closeCamera:[sg.CALLING,sg.CONNECTED],switchCamera:[sg.CALLING,sg.CONNECTED],openMicrophone:[sg.CALLING,sg.CONNECTED],closeMicrophone:[sg.CALLING,sg.CONNECTED],selectAudioPlaybackDevice:[sg.CALLING,sg.CONNECTED],setSelfInfo:""},uC={createInstance:!1,destroyInstance:!0,init:!1,off:!0,call:!0,groupCall:!0,joinInGroupCall:!0,inviteUser:!0,accept:!0,reject:!0,hangup:!0,switchCallMediaType:!0,openCamera:!0,closeCamera:!0,switchCamera:!0,openMicrophone:!0,closeMicrophone:!0,selectAudioPlaybackDevice:!0,setSelfInfo:!0},hC=function(t){p(n,m(Error));var e=T(n);function n(t,r,i){var a;return u(this,n),d(_(a=e.call(this,r)),"code",void 0),d(_(a),"message",void 0),d(_(a),"data",void 0),a.code=t,a.message=r,a.data=i,a}return f(n,null,[{key:"error",value:function(t,e,r){return r?new n(t,e,r):new n(t,e)}}]),n}();function fC(t){var e=j_(t)?"".concat(Dy.ERROR_PACKAGE_NOT_PURCHASED):"".concat(Ey);return e=e.replace("${purchaseAddress}",V_(t))}nC.validators.type.types.function=function(t){return t instanceof Function};var dC=function(){function t(){u(this,t),d(this,"paramsMatchedRule",cC),d(this,"statusMatchedRule",lC),d(this,"requireInit",uC)}return f(t,[{key:"getParamsMatchedRule",value:function(t){return this.paramsMatchedRule[t]}},{key:"getStatusMatchedRule",value:function(t){return this.statusMatchedRule[t]}},{key:"getInitReadyRule",value:function(t){return this.requireInit[t]}}]),t}(),pC=function(){function t(){u(this,t),this._logger=ly()}return f(t,[{key:"notify",value:function(t,e,n,r){throw this._logger.error("check:".concat(t.api),{text:{data:t,error:{code:e,message:n}}}),hC.error(e,"[TUICallEngine:".concat(t.api,",").concat(e,"]").concat(n).concat(r))}}]),t}(),vC=f((function t(e){u(this,t),d(this,"api",""),d(this,"attributes",{}),d(this,"callStatus",""),d(this,"capabilityCode",void 0),d(this,"initReady",void 0),this.api=e.api,this.attributes=e.attributes,this.callStatus=e.callStatus,this.capabilityCode=e.capabilityCode,this.initReady=e.initReady,this.sdkAppID=e.sdkAppID})),gC=new WeakMap,yC=function(){function t(){u(this,t),S(this,gC,{writable:!0,value:void 0}),R(this,gC,[])}var e;return f(t,[{key:"addAlertHandler",value:function(t){D(this,gC).push(t)}},{key:"check",value:(e=l(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=0;case 1:if(!(r1&&void 0!==o[1]?o[1]:{},!e.capabilityCode){t.next=21;break}return t.prev=2,t.next=5,n.tim.callExperimentalAPI("isCommercialAbilityEnabled",e.capabilityCode);case 5:!1===t.sent.data.enabled&&this.notification.notify(e,Iy.ERROR_PACKAGE_NOT_SUPPORTED,_y,Dy.ERROR_PACKAGE_NOT_SUPPORTED),t.next=21;break;case 9:if(t.prev=9,t.t0=t.catch(2),wx.$TUICallEngine._callDataReport.setCodeAndMessage(Iy.ERROR_PACKAGE_NOT_SUPPORTED,JSON.stringify(t.t0)),wx.$TUICallEngine._callDataReport.uploadToKibana(),2905!==t.t0.code){t.next=17;break}this.notification.notify(e,Iy.ERROR_TIM_VERSION_OUTDATED,Ty,Dy.ERROR_TIM_VERSION_OUTDATED),t.next=21;break;case 17:throw r=null,i=0,e.capabilityCode===Dg.PRO?(r="".concat((a=e.sdkAppID,s=void 0,s=j_(a)?"".concat(Dy.ERROR_PACKAGE_NOT_SUPPORTED):"".concat(_y),s=s.replace("${purchaseAddress}",V_(a)))," "),i=Iy.ERROR_PACKAGE_NOT_SUPPORTED):(r="".concat(fC(e.sdkAppID)," "),i=Iy.ERROR_PACKAGE_NOT_PURCHASED),new hC(i,r);case 21:case"end":return t.stop()}var a,s}),t,this,[[2,9]])}))),function(t){return e.apply(this,arguments)})}]),r}(),TC=function(t){p(n,IC);var e=T(n);function n(t,r){return u(this,n),e.call(this,t,r)}return f(n,[{key:"check",value:function(t,e){void 0!==t.initReady&&this.rule.getInitReadyRule(t.api)!==t.initReady&&this.notification.notify(t,Iy.ERROR_INIT_FAIL,Cy,Dy.ERROR_INIT_FAIL)}}]),n}(),CC=function(){function t(){u(this,t),d(this,"alertRule",void 0),d(this,"notification",void 0),d(this,"alert",void 0)}return f(t,[{key:"initializeBeans",value:function(){this.alertRule=new dC,this.notification=new pC,this.alert=new yC,this.alert.addAlertHandler(new mC(this.alertRule,this.notification)),this.alert.addAlertHandler(new TC(this.alertRule,this.notification)),this.alert.addAlertHandler(new _C(this.alertRule,this.notification)),this.alert.addAlertHandler(new EC(this.alertRule,this.notification))}},{key:"getAlert",value:function(){return this.alert}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new t,this.instance.initializeBeans()),this.instance}}]),t}();d(CC,"instance",void 0);var bC=X,DC=$t,RC=Et,wC=ve,SC=Ts,xC=P,LC=Function,OC=bC([].concat),kC=bC([].join),AC={},NC=xC?LC.bind:function(t){var e=DC(this),n=e.prototype,r=SC(arguments,1),i=function(){var n=OC(r,SC(arguments));return this instanceof i?function(t,e,n){if(!wC(AC,e)){for(var r=[],i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=t.version,n=void 0===e?"":e,r=t.sdkAppId,i=void 0===r?0:r,a=t.userID,o=void 0===a?"":a,s=A_(),c=m_?"uniminiprogram":"wxminiprogram";this._callData={version:n,platform:s,framework:c,sdkAppId:i,userID:o,roomID:0,inviteID:"",callRole:vg,callScene:"",callType:Ig,inviteeList:[],result:wg.UNKNOWN,totalTime:0,totalScore:0,code:0,message:"",abilityBit:!1,enterRoomTime:"",sendSignalingTime:"",callAcceptTime:"",exitRoomTime:"",callEndTime:"",network:0,audio:0,video:0}}},{key:"reset",value:function(){this.initializeCallData(),this._ssoLog=null}},{key:"clearCallDataAfterUpload",value:function(){var t=this.getCallData(),e=t.version,n=t.sdkAppId,r=t.userID;this.initializeCallData({version:e,sdkAppId:n,userID:r})}},{key:"uploadToKibana",value:function(){try{this._ssoLog.setText(this.packageCallDataToKibana()).setEnd(),this.clearCallDataAfterUpload()}catch(t){}}}]),t}(),jC=function(){function t(e,n){u(this,t),d(this,"_eventEmitter",void 0),d(this,"_callDataReport",void 0),this._eventEmitter=e.emitter,this._callDataReport=n,this.registerListener()}return f(t,[{key:"registerListener",value:function(){this._eventEmitter.on(og.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.on(og.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(og.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(og.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(og.REJECT,this.onReject.bind(this))}},{key:"removeLister",value:function(){this._eventEmitter.off(og.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.off(og.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.off(og.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.off(og.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.off(og.REJECT,this.onReject.bind(this))}},{key:"onCallEnd",value:function(t){var e=t.data.totalTime,n=void 0===e?0:e;this._callDataReport.setTotalTime(n),this._callDataReport.setCallEndTime((new Date).getTime()),this._callDataReport.setResult(wg.NORMAL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()}},{key:"onCallingCancel",value:function(){this._callDataReport.getResult()||this._callDataReport.setResult(wg.CANCEL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()}},{key:"onNoResponse",value:function(){this._callDataReport.setResult(wg.TIMEOUT)}},{key:"onLineBusy",value:function(){this._callDataReport.setResult(wg.BUSYLINE)}},{key:"onReject",value:function(){this._callDataReport.setResult(wg.REJECT)}}]),t}();function VC(t){return GC.apply(this,arguments)}function GC(){return GC=l(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e===pg.AUDIO||e===pg.VIDEO){t.next=2;break}return t.abrupt("return");case 2:return t.abrupt("return",new Promise(function(){var t=l(a().mark((function t(n,r){var i,o,s,c,l,u;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={microphone:!0,camera:e===pg.VIDEO},t.next=3,N_(i);case 3:if((o=t.sent)||e!==pg.AUDIO){t.next=16;break}return t.prev=5,t.next=8,wx.authorize({scope:Lg.RECORD});case 8:t.next=16;break;case 10:t.prev=10,t.t0=t.catch(5),s=Sg.MIC_TITLE,c=Sg.MIC_CONTENT,HC(s,c),r();case 16:if(o||e!==pg.VIDEO){t.next=30;break}return t.prev=17,t.next=20,wx.authorize({scope:Lg.RECORD});case 20:return t.next=22,wx.authorize({scope:Lg.CAMERA});case 22:t.next=30;break;case 24:t.prev=24,t.t1=t.catch(17),l=Sg.CAMERA_TITLE,u=Sg.CAMERA_CONTENT,HC(l,u),r();case 30:n();case 31:case"end":return t.stop()}}),t,null,[[5,10],[17,24]])})));return function(e,n){return t.apply(this,arguments)}}()));case 3:case"end":return t.stop()}}),t)}))),GC.apply(this,arguments)}function HC(t,e){wx.showModal({title:t,content:e,confirmText:Sg.CONFIRM_TEXT,success:function(t){t.confirm&&wx.openSetting()}})}var BC=xi,FC=X,KC=kr,zC=lm,JC=Gm,WC=N,$C=RangeError,qC=String,YC=Math.floor,XC=FC(JC),QC=FC("".slice),ZC=FC(1..toFixed),tb=function(t,e,n){return 0===e?n:e%2==1?tb(t,e-1,n*t):tb(t*t,e/2,n)},eb=function(t,e,n){for(var r=-1,i=n;++r<6;)i+=e*t[r],t[r]=i%1e7,i=YC(i/1e7)},nb=function(t,e){for(var n=6,r=0;--n>=0;)r+=t[n],t[n]=YC(r/e),r=r%e*1e7},rb=function(t){for(var e=6,n="";--e>=0;)if(""!==n||0===e||0!==t[e]){var r=qC(t[e]);n=""===n?r:n+XC("0",7-r.length)+r}return n};BC({target:"Number",proto:!0,forced:WC((function(){return"0.000"!==ZC(8e-5,3)||"1"!==ZC(.9,0)||"1.25"!==ZC(1.255,2)||"1000000000000000128"!==ZC(0xde0b6b3a7640080,0)}))||!WC((function(){ZC({})}))},{toFixed:function(t){var e,n,r,i,a=zC(this),o=KC(t),s=[0,0,0,0,0,0],c="",l="0";if(o<0||o>20)throw new $C("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return qC(a);if(a<0&&(c="-",a=-a),a>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(a*tb(2,69,1))-69)<0?a*tb(2,-e,1):a/tb(2,e,1),n*=4503599627370496,(e=52-e)>0){for(eb(s,0,n),r=o;r>=7;)eb(s,1e7,0),r-=7;for(eb(s,tb(10,r,1),0),r=e-1;r>=23;)nb(s,1<<23),r-=23;nb(s,1<0?c+((i=l.length)<=o?"0."+XC("0",o-i)+l:QC(l,0,i-o)+"."+QC(l,i-o)):c+l}});var ib=function(){function t(){u(this,t)}return f(t,null,[{key:"generateTaskID",value:function(){return this.currentTaskID+=1}},{key:"run",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wg.TIMEOUT,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;n=i(i({},t===wg.INTERVAL?{delay:2e3,count:0,backgroundTask:!0}:t===wg.RAF?{fps:60,delay:16.6,count:0,backgroundTask:!0}:{delay:2e3,count:0,backgroundTask:!0}),n),w_(e)&&(n=i(i({},n),e)),s(t)===wg.FUNCTION&&(e=t,t=wg.TIMEOUT);var r=i({taskID:this.generateTaskID(),loopCount:0,intervalID:null,timeoutID:null,rafID:null,taskName:t,callback:e},n);return this.taskMap.set(r.taskID,r),this[t](r),r.taskID}},{key:"interval",value:function(t){var e=this;return t.intervalID=setInterval((function(){t.callback(),t.loopCount+=1,e.isBreakLoop(t)}),t.delay)}},{key:"timeout",value:function(t){var e=this;return t.timeoutID=setTimeout((function n(){if(t.callback(),t.loopCount+=1,!e.isBreakLoop(t))return t.timeoutID=setTimeout(n,t.delay)}),t.delay)}},{key:"raf",value:function(t){var e=this;t.delay=(1e3/t.fps).toFixed(2);var n,r=M_(),i=function i(){if(document.hidden&&t.backgroundTask){if(n=M_()-r,r=M_(),t.callback(),t.loopCount+=1,e.isBreakLoop(t))return;return t.timeoutID=setTimeout(i,t.delay-Math.floor(n%t.delay))}if((n=M_()-r)>=t.delay&&(r=M_()-Math.floor(n%t.delay),t.callback(),t.loopCount+=1),!e.isBreakLoop(t))return t.rafID=requestAnimationFrame(i)};if(t.rafID=requestAnimationFrame(i),t.backgroundTask){var a=function(){if(document.hidden){var e=M_()-r;e>=t.delay?i():t.timeoutID=setTimeout(i,t.delay-e)}};document.addEventListener("visibilitychange",a),t.onVisibilitychange=a,document.hidden&&a()}return t.taskID}},{key:"hasTask",value:function(t){return this.taskMap.has(t)}},{key:"clearTask",value:function(t){if(!this.taskMap.has(t))return!0;var e=this.taskMap.get(t),n=e.intervalID,r=e.timeoutID,i=e.onVisibilitychange;return n&&clearInterval(n),r&&clearTimeout(r),i&&document.removeEventListener("visibilitychange",i),this.taskMap.delete(t),!0}},{key:"isBreakLoop",value:function(t){return!this.taskMap.has(t.taskID)||0!==t.count&&t.loopCount>=t.count&&(this.clearTask(t.taskID),!0)}}]),t}();d(ib,"taskMap",new Map),d(ib,"currentTaskID",1);var ab={serviceCommand:"".concat(wg.CALLKIT_RECORDS_SVR,".*")},ob="sendTRTCCustomData",sb=function(){function t(e){u(this,t),d(this,"_callRecordData",void 0),d(this,"_tim",void 0),d(this,"_heartbeat",void 0),d(this,"_lastHeartBeatTime",void 0),d(this,"_bodyStatus",void 0),this._tim=e.tim,this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=wg.WAITING,this.initializeCallData(e)}var e,n,r,o;return f(t,[{key:"getCallRecordData",value:function(){return this._callRecordData}},{key:"initializeCallData",value:function(t){var e=t||{},n=e.version,r=void 0===n?"":n,i=e.userID,a=void 0===i?"":i,o={name:g_.platform,version:g_.version},s={version:1,command:wg.EVENT_REPORT,sdk_version:r,seq:0,os_name:wg.MINI_PROGRAM,os_version:o.version||"",device_name:o.name||"",framework:wg.MINI_PROGRAM,call_type:"",media_type:"",client_ts:0,role:vg,user_id:a,room_id:"",call_id:""};this._callRecordData={head:s,body:{event_type:"",code:0,message:"",invitee_list:[]}}}},{key:"reset",value:function(){this.initializeCallData()}},{key:"_setCallType",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{call_type:t}))}},{key:"_setMediaType",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{media_type:UC(t)}))}},{key:"_setCallRole",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{role:t}))}},{key:"_setUserID",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{user_id:t}))}},{key:"_setRoomID",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{room_id:"".concat(t)}))}},{key:"_setInviteID",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{call_id:t}))}},{key:"_setEventType",value:function(t){t&&(this._callRecordData.body=i(i({},this._callRecordData.body),{},{event_type:t}))}},{key:"_setInviteeList",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._callRecordData.body=i(i({},this._callRecordData.body),{},{invitee_list:t})}},{key:"_setSeq",value:function(){var t=this.getCallRecordData().head.seq;this._callRecordData.head=i(i({},this._callRecordData.head),{},{seq:t+1})}},{key:"setBodyStatus",value:function(t){if(t){var e=wg.WAITING;switch(t){case sg.CALLING:e=wg.WAITING;break;case sg.CONNECTED:e=wg.CALLING}this._bodyStatus=e}}},{key:"eventUpload",value:(o=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.eventType,o=e.callType,s=e.mediaType,c=e.callRole,l=e.userID,u=e.roomID,h=e.inviteID,f=e.inviteeList,d=void 0===f?[]:f,r){t.next=3;break}return t.abrupt("return");case 3:return this._callRecordData.head=i(i({},this._callRecordData.head),{},{command:wg.EVENT_REPORT,client_ts:Math.floor(Date.now()/1e3)}),this._setCallType(o),this._setMediaType(s),this._setCallRole(c),this._setUserID(l),this._setRoomID(u),this._setInviteID(h),this._setEventType(r),this._setInviteeList(d),this._setSeq(),p=this.getCallRecordData(),v=p.head,g=p.body,y={head:i(i({},v),{},{role:PC(v.role)}),body:g},I=i(i({},ab),{},{data:JSON.stringify(y)}),t.next=18,null==this||null===(n=this._tim)||void 0===n?void 0:n.callExperimentalAPI(ob,I);case 18:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"eventUploadNotSave",value:(r=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.eventType,o=e.callType,s=e.mediaType,c=e.callRole,l=e.roomID,u=e.inviteID,this._setSeq(),h=this.getCallRecordData(),f=h.head,d=h.body,p={head:i(i({},f),{},{role:PC(c),call_id:u,call_type:o,media_type:UC(s),room_id:"".concat(l),client_ts:Math.floor(Date.now()/1e3)}),body:i(i({},d),{},{event_type:r})},v=i(i({},ab),{},{data:JSON.stringify(p)}),t.next=7,null==this||null===(n=this._tim)||void 0===n?void 0:n.callExperimentalAPI(ob,v);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"heartBeatUpload",value:(n=l(a().mark((function t(){var e,n,r,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._setSeq(),n=this._callRecordData.head,r={head:i(i({},n),{},{role:PC(n.role),clientTs:Date.now(),command:wg.HEART_BEAT}),body:{status:this._bodyStatus}},o=i(i({},ab),{},{data:r}),t.next=6,null==this||null===(e=this._tim)||void 0===e?void 0:e.callExperimentalAPI(ob,o);case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"startHeartbeat",value:function(){-1===this._heartbeat&&(F_.info("start heart beat..."),this.heartBeatUpload(),this._heartbeat=ib.run(wg.TIMEOUT,this.doHeartbeat.bind(this),{delay:2e3,count:0,backgroundTask:!0}))}},{key:"stopHeartbeat",value:function(){-1!==this._heartbeat&&(F_.info("stop heart beat"),ib.clearTask(this._heartbeat),this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=wg.WAITING)}},{key:"doHeartbeat",value:(e=l(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.heartBeatUpload(),e=Date.now(),this._lastHeartBeatTime>0&&e-this._lastHeartBeatTime>1e4&&F_.warn("heartbeat took ".concat(e-this._lastHeartBeatTime)),this._lastHeartBeatTime=e;case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),cb=function(){function t(e,n){u(this,t),d(this,"_eventEmitter",void 0),d(this,"_callRecordDataReport",void 0),d(this,"_isCallAccepted",void 0),this._eventEmitter=e,this._callRecordDataReport=n,this._isCallAccepted=!1,this.registerListener()}return f(t,[{key:"registerListener",value:function(){this._eventEmitter.on(og.ON_CALL_RECEIVED,this.onCallReceived.bind(this)),this._eventEmitter.on(og.USER_ACCEPT,this.onCallAccepted.bind(this)),this._eventEmitter.on(og.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.on(og.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(og.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(og.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(og.REJECT,this.onReject.bind(this))}},{key:"removeLister",value:function(){this._eventEmitter.off(og.ON_CALL_RECEIVED,this.onCallReceived),this._eventEmitter.off(og.USER_ACCEPT,this.onCallAccepted),this._eventEmitter.off(og.CALL_END,this.onCallEnd),this._eventEmitter.off(og.CALLING_CANCEL,this.onCallingCancel),this._eventEmitter.off(og.NO_RESP,this.onNoResponse),this._eventEmitter.off(og.LINE_BUSY,this.onLineBusy),this._eventEmitter.off(og.REJECT,this.onReject)}},{key:"onCallReceived",value:function(){this._callRecordDataReport.startHeartbeat()}},{key:"onCallAccepted",value:function(){var t=this._callRecordDataReport.getCallRecordData().head;if((null==t?void 0:t.role)===wg.INVITER){if(this._isCallAccepted&&t.call_type===wg.GROUP)return;this._isCallAccepted=!0;var e={eventType:wg.CALL_ACCEPTED};this._callRecordDataReport.eventUpload(e),this._callRecordDataReport.setBodyStatus(sg.CONNECTED)}}},{key:"onCallEnd",value:function(){var t={eventType:wg.CALL_END};this._isCallAccepted=!1,this._callRecordDataReport.eventUpload(t),this._callRecordDataReport.stopHeartbeat()}},{key:"onCallingCancel",value:function(t){var e=this._callRecordDataReport.getCallRecordData().head,n=e.role===wg.INVITER?wg.CANCEL_CALL:wg.CALL_CANCELED;this._isCallAccepted=!1;var r=(t.data||{}).reason;((void 0===r?"":r)===wg.NORMAL||e.role===wg.INVITER&&e.call_type===wg.GROUP)&&this._callRecordDataReport.eventUpload({eventType:n}),this._callRecordDataReport.stopHeartbeat()}},{key:"onNoResponse",value:function(){this._uploadInC2C(wg.TIMEOUT)}},{key:"onLineBusy",value:function(){this._uploadInC2C(wg.BUSYLINE)}},{key:"onReject",value:function(){this._uploadInC2C(wg.REJECT)}},{key:"_uploadInC2C",value:function(t){var e=this._callRecordDataReport.getCallRecordData().head;if((null==e?void 0:e.call_type)===wg.SINGLE){var n="";switch(t){case wg.TIMEOUT:n=e.role===wg.INVITER?wg.CALL_MISSED:wg.NOT_ANSWER_CALL;break;case wg.REJECT:n=e.role===wg.INVITER&&wg.CALL_REJECTED;break;case wg.BUSYLINE:n=e.role===wg.INVITER?wg.CALL_BUSY:wg.NOT_ANSWER_CALL;break;default:return}this._callRecordDataReport.eventUpload({eventType:n})}}}]),t}(),lb="TUICallEngine",ub=ly({clsConfig:{endpoint:"https://ap-nanjing.cls.tencentcs.com",topicId:"a1310e66-a3f5-4572-a1c3-7a327a27496d"}}),hb=function(){function r(i){u(this,r),d(this,"_initReady",!1),d(this,"_timExternal",!1),d(this,"_initialCallId",""),this.data={config:{sdkAppID:i.sdkAppID,userID:"",userSig:"",type:1}},this.initData(),this.EVENT=og,this.MEDIA_TYPE=pg,this.CALL_TYPE=pg,this._emitter=new ag,this.TRTC=new e(this,{TUIScene:"TUICallKit"});var a="TUICallKit";try{(wx&&wx._isTIMCallKit||wx&&wx.getStorageSync&&wx.getStorageSync("_isTIMCallKit")||getApp&&getApp()&&getApp().globalData&&getApp().globalData._isTIMCallKit)&&(a="TIMCallKit")}catch(t){console.error(t)}wx.TUIScene=a,this._callDataReport=new MC({version:Ly,sdkAppId:i.sdkAppID}),this._dataReportObserver=new jC({emitter:this._emitter},this._callDataReport),i.tim?(this.tim=i.tim,this._timExternal=!0):wx.$TIM?(this.tim=wx.$TIM,this._timExternal=!0):this.tim=n.create({SDKAppID:i.sdkAppID}),this._callRecordReport=new sb({version:Ly,tim:this.tim}),this._recordReportObserver=new cb(this._emitter,this._callRecordReport),wx.$TSignaling||(wx.$TSignaling=new t({SDKAppID:i.sdkAppID,tim:this.tim,isRejectNotifyAll:!0})),wx.getSystemInfoSync().platform===wg.DEVTOOLS&&F_.warn("".concat(xg)),wx.setStorageSync("sdkAppId",i.sdkAppID),this.TSignalingClient=new Sy({TSignaling:wx.$TSignaling}),this.TRTCCallingDelegate=new xy({emitter:this._emitter}),this._eventStatController=new Q_;var o=new K_(z_);K_.bindController(this._eventStatController),o.setText("version=".concat(Ly)).setEnd(),this._initLogger(i),F_.info("".concat(lb," SDK Version:").concat(Ly,", SDKAppID:").concat(i.sdkAppID))}var o,s,c,h,p,v,g,y,I,m,E,_,T,b,D,R,w,S,x,L,O,k,A,N,U,P,M,j,V,G,H,B,F,K,z,J,W;return f(r,[{key:"destroyInstance",value:function(){if(r.instance){this._callDataReport&&this._callDataReport.reset&&this._callDataReport.reset(),this._dataReportObserver&&this._dataReportObserver.reset&&this._dataReportObserver.removeLister(),this._callRecordReport&&this._callRecordReport.reset(),this._recordReportObserver&&this._recordReportObserver.removeLister(),r.instance.destroyed(),r.instance=null;try{wx.removeStorageSync("sdkAppId"),wx.removeStorageSync("userId")}catch(t){console.error(t)}}}},{key:"_initLogger",value:function(t){var e=this;wx.getSystemInfo({success:function(t){var e=t.brand,n=t.model,r=t.language,i=t.platform,a=t.version;ub.updateGetReportData((function(){return{useragent:{brand:e,model:n,language:r,platform:i,version:a}}}))}}),this._logger=ub,this._logger.updateGetReportData((function(){return{app:"TUICallEngine-mini",version:Ly,platform:wg.MINI_PROGRAM,sdkappid:t.sdkAppID,time:+new Date,userid:e.getUserID(),callinfo:{roomid:e.getRoomID(),inviteid:e.getInitialCallId(),callrole:e.isInviter()?wg.INVITER:wg.INVITEE,groupid:e.getGroupID(),calltype:e.getCallType(),handledInviteeList:e.getHandledInviteeList(),unHandledInviteeList:e.getUnHandledInviteeList()},callkitversion:t.callkitVersion||wg.UNKNOWN,framework:t.frameWork||wg.UNKNOWN,isfromchat:t.chat?"true":"false"}}))}},{key:"setLogLevel",value:function(t){"number"!=typeof t||isNaN(t)?F_.error("".concat(lb,",setLogLevel parameter must be a number(0~4)")):(F_.setLevel(t),this.TSignalingClient.setLogLevel(t),this.TRTC.setLogLevel(t))}},{key:"initData",value:function(){var t={callStatus:sg.IDLE,soundMode:this.data.config.type===pg.AUDIO?bg.EAR:bg.SPEAKER,active:!1,invitation:{inviteID:"",inviter:"",type:"",roomID:""},startTalkTime:0,localUser:null,remoteUsers:[],remoteID:"",timer:null,chatTimeNum:0,chatTime:"00:00:00",screen:"pusher",pusher:{},playerList:[],isInviter:!0,unHandledInviteeList:[],handledInviteeList:[],_inviterInviteID:{},_audioVideoSwitchIdList:[],_acceptedUserObject:{},isGroupCall:!1,groupID:"",switchCallModeStatus:!0,enterRoomStatus:!1,devicePermission:!1};this.data=i(i({},this.data),t)}},{key:"handleNewInvitationReceived",value:(W=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.NEW_INVITATION_RECEIVED",{text:{data:i(i({},e),{},{currentCallStatus:o})},type:"event"}),o=this.getCallStatus(),F_.log("".concat(lb,".onNewInvitationReceived - params:"),e,"currentCallStatus:".concat(o)),s=e.data,c=s.inviter,l=s.inviteeList,u=s.data,h=s.inviteID,f=s.groupID,P_((d=JSON.parse(u)).businessID)){t.next=7;break}return t.abrupt("return");case 7:if(p=(null==d||null===(n=d.data)||void 0===n?void 0:n.initialCallId)||"",this.getUserID()!==c){t.next=10;break}return t.abrupt("return");case 10:if(g={inviter:c,inviteeList:l,inviteID:h,isGroupCall:v=!!f,inviteData:d,groupID:f,initialCallId:p,currentCallStatus:o,inCallUserIDs:(null==d?void 0:d.inCallUserIDs)||[]},"hangup"!==(null==d||null===(r=d.data)||void 0===r?void 0:r.cmd)){t.next=19;break}if(F_.log("".concat(lb,".hangup - params:"),c,d,this.getHandledInviteeList(),this.getUnHandledInviteeList(),o,v),o!==sg.IDLE){t.next=16;break}return t.abrupt("return");case 16:return t.next=18,this.handleHangupSignal(g);case 18:return t.abrupt("return");case 19:if(v||!this.judgeSwitchCallMode(d)){t.next=25;break}if(o===sg.IDLE||d.room_id!==this.data.invitation.roomID){t.next=24;break}return t.next=23,this.handleSwitchCallModeTSignaling(h,d);case 23:this.addAudioVideoSwitchIdList(h);case 24:return t.abrupt("return");case 25:if(o===sg.IDLE){t.next=30;break}return t.next=28,this.TSignalingClient.reject({inviteID:h,type:u.call_type,lineBusy:"line_busy"});case 28:return this.getCallRecordReport().eventUploadNotSave({inviteID:p||h,callRole:wg.INVITEE,eventType:wg.IGNORE_CALL,roomID:d.room_id,mediaType:d.call_type,callType:f?wg.GROUP:wg.SINGLE}),t.abrupt("return");case 30:this.handleInvitedSignal(g);case 31:case"end":return t.stop()}}),t,this)}))),function(t){return W.apply(this,arguments)})},{key:"handleHangupSignal",value:(J=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.inviter,r=e.currentCallStatus,o=e.inviteData,s=e.inviteeList,c=this.isGroupCall(),l=this.isInviter(),r!==sg.CALLING){t.next=11;break}if(u=this.getUnHandledInviteeList(),h=this.getHandledInviteeList(),-1!==u.indexOf(n)&&this.deleteUnHandledInviteeList([n]),-1!==h.indexOf(n)){t.next=9;break}return t.abrupt("return");case 9:t.next=15;break;case 11:if(this.deleteHandledInviteeList([n]),!(-1===(f=this.getHandledInviteeList()).indexOf(n)&&f.length>1)){t.next=15;break}return t.abrupt("return");case 15:if(d=this.generateCallEndData({totalTime:o.call_end||0}),c){t.next=22;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=20,this._resetTUICallEngine();case 20:case 31:t.next=46;break;case 22:if(this.deleteHandledInviteeList([n]),this.data.playerList=this.data.playerList.filter((function(t){return t.userID!==n})),p=this.getHandledInviteeList(),v=this.getUnHandledInviteeList(),!l){t.next=33;break}if(1!==p.length||0!==v.length){t.next=31;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=31,this._resetTUICallEngine();case 33:if(r!==sg.CALLING){t.next=41;break}if(-1!==s.indexOf(this.getUserID())&&this.TRTCCallingDelegate.onUserLeave({userID:n,playerList:this.data.playerList}),0!==p.length||1!==v.length){t.next=41;break}return g=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:this.getUserID(),userID:this.getUserID()},g),{},{reason:wg.NORMAL})),t.next=41,this._resetTUICallEngine();case 41:if(r!==sg.CONNECTED){t.next=46;break}if(1!==p.length||0!==v.length){t.next=46;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=46,this._resetTUICallEngine();case 46:case"end":return t.stop()}}),t,this)}))),function(t){return J.apply(this,arguments)})},{key:"handleSwitchCallModeTSignaling",value:(z=l(a().mark((function t(e,n){var r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={inviteID:e,type:n.call_type},i={cmd:"switchToVideo"},n.call_type===pg.VIDEO&&(r.switch_to_audio_call="switch_to_audio_call",i.cmd="switchToAudio"),t.next=5,this.TSignalingClient.accept(r,i);case 5:o=t.sent,this.setSwitchCallModeStatus(!1),this.handleCallMode(n.call_type,o);case 8:case"end":return t.stop()}}),t,this)}))),function(t,e){return z.apply(this,arguments)})},{key:"judgeSwitchCallMode",value:function(t){return t.switch_to_audio_call&&"switch_to_audio_call"===t.switch_to_audio_call||t.data&&"switchToAudio"===t.data.cmd||t.data&&"switchToVideo"===t.data.cmd}},{key:"handleCallMode",value:function(t,e){F_.log("".concat(lb,".handleCallMode - type"),t);var n=t!==pg.VIDEO;this.setPusherAttributesHandler({enableCamera:n}),n?(this.data.config.type=pg.VIDEO,this.data.invitation.type=pg.VIDEO):(this.data.config.type=pg.AUDIO,this.data.invitation.type=pg.AUDIO),this.TRTCCallingDelegate.onCallMode({type:this.data.config.type,message:e.data.message}),this.setSwitchCallModeStatus(!0)}},{key:"handleInvitedSignal",value:(K=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.inviter,r=e.inviteeList,o=e.isGroupCall,s=e.groupID,c=e.inviteID,l=e.inviteData,u=e.inCallUserIDs,h=void 0===u?[]:u,f=e.initialCallId,d=void 0===f?"":f,this.data.remoteID=n,this.data.config.type=l.call_type,this.data.invitation.inviteID=c,this.data.invitation.inviter=n,this.data.invitation.type=l.call_type,this.data.invitation.roomID=l.room_id,this.data.isInviter=!1,this.data.isGroupCall=o,this.data.roomID=l.room_id,this.addHandledInviteeList([n]),this.addUnHandledInviteeList([].concat(C(r),C(h))),this.addAcceptedUserList(c,[n]),this.addInviterInviteId(c,[n].concat(C(r))),this.setInitialCallId(d),p=h.filter((function(t){return-1===r.indexOf(t)})),o&&(this.data.groupID=s),this.changeCallStatus(sg.CALLING),F_.log("".concat(lb," NEW_INVITATION_RECEIVED invitation: "),this.data.callStatus,this.data.invitation),v={sponsor:n,inviteeList:r,userIDList:[].concat(C(r),C(p)),isFromGroup:o,inviteID:c,groupID:s,inviteData:{version:l.version,callType:l.call_type,roomID:l.room_id},userData:l.userData,calleeIdList:r,callMediaType:l.call_type},this.setPusherAttributesHandler({enableCamera:this.data.config.type===pg.VIDEO}),g=i(i({},g=this.getCallDataReport().getCallData()),{},{userId:this.getUserID(),roomID:l.room_id,inviteID:c,callRole:yg,callType:l.call_type,inviteeList:r}),y={eventType:wg.RECEIVE_CALL,callType:s?wg.GROUP:wg.SINGLE,mediaType:l.call_type,callRole:wg.INVITEE,userID:this.getUserID(),roomID:l.room_id,inviteID:d||c},this.getCallRecordReport().eventUpload(y),this.getCallDataReport().setCallData(g),I=this.generateEventData()||{},this.TRTCCallingDelegate.onInvited(i(i({},I),v)),t.next=30,N_({camera:!0});case 30:this.data.devicePermission=t.sent,this.data.devicePermission&&this.data.config.type===pg.VIDEO&&wx.createLivePusherContext().startPreview();case 32:case"end":return t.stop()}}),t,this)}))),function(t){return K.apply(this,arguments)})},{key:"addInviterInviteId",value:function(t,e){0!==e.length&&(0===(this.data._inviterInviteID[t]||[]).length?this.data._inviterInviteID[t]=e:this.data._inviterInviteID[t]=[].concat(C(this.data._inviterInviteID[t]),C(e)))}},{key:"handleInviteeAccepted",value:(F=l(a().mark((function t(e){var n,r,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITEE_ACCEPTED",{text:{data:i(i({},e),{},{currentCallStatus:this.data.callStatus}),type:"event"}}),F_.log("".concat(lb," onInviteeAccepted - params:"),e),P_(null==(n=JSON.parse(e.data.data))?void 0:n.businessID)){t.next=5;break}return t.abrupt("return");case 5:if(r=e.data.invitee,o=e.data.inviteID,-1!==this.getTotalInviterInviteIdList().indexOf(o)){t.next=9;break}return t.abrupt("return");case 9:if(this.data.callStatus!==sg.IDLE){t.next=11;break}return t.abrupt("return");case 11:if(this.isGroupCall()||!this.judgeSwitchCallMode(n)||this.data.switchCallModeStatus){t.next=14;break}return this.handleCallMode(this.data.invitation.type),t.abrupt("return");case 14:if(s=this.getCallStatus(),r!==this.getUserID()||s!==sg.CALLING){t.next=21;break}return c=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},c)),t.next=20,this._resetTUICallEngine();case 20:return t.abrupt("return");case 21:return this.isInviter()&&this.data.callStatus===sg.CALLING&&this.changeCallStatus(sg.CONNECTED),this.getCallDataReport().setCallAcceptTime((new Date).getTime()),this.addHandledInviteeList([r]),this.deleteUnHandledInviteeList([r]),this.addAcceptedUserList(o,[r]),t.next=28,this.getUserProfile(this.data.unHandledInviteeList.map((function(t){return{userID:t}})));case 28:l=t.sent,this.TRTCCallingDelegate.onUserAccept({userID:r,userList:l});case 30:case"end":return t.stop()}}),t,this)}))),function(t){return F.apply(this,arguments)})},{key:"handleInviteeRejected",value:(B=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITEE_REJECTED",{text:{data:e},type:"event"}),F_.log("".concat(lb," onInviteeRejected - params"),e),r=e.data.inviteID,P_(null==(o=JSON.parse(e.data.data))?void 0:o.businessID)){t.next=6;break}return t.abrupt("return");case 6:if(this.isGroupCall()||this.getSwitchCallModeStatus()||-1===this.getAudioVideoSwitchIdList().indexOf(r)){t.next=10;break}return F_.log("".concat(lb,".onInviteeRejected - Audio and video switching is not available")),this.setSwitchCallModeStatus(!0),t.abrupt("return");case 10:if(s=e.data.invitee,c=e.data.inviter,l=this.getUserID(),u=this.getCallStatus(),-1!==this.getInviterInviteIdList().indexOf(r)){t.next=19;break}if(!this.isInviter()||-1===this.getInviterInviteIdUserList().indexOf(s)){t.next=17;break}return t.abrupt("return");case 17:return this.deleteUnHandledInviteeList([s]),t.abrupt("return");case 19:if(u!==sg.IDLE){t.next=21;break}return t.abrupt("return");case 21:if(h=this.generateEventData(),l!==s||u!==sg.CALLING){t.next=27;break}return this.TRTCCallingDelegate.onCancel(i({inviteID:this.data.invitation.inviteID,invitee:s,userID:s},h)),t.next=26,this._resetTUICallEngine();case 26:return t.abrupt("return");case 27:if(f=this.isGroupCall(),d=this.isInviter(),this.deleteUnHandledInviteeList([s]),p=this.getUnHandledInviteeList(),v=this.getHandledInviteeList(),g=i({inviteID:this.data.invitation.inviteID,invitee:l,userID:l},h),y={inviteID:this.data.invitation.inviteID,invitee:s,userID:s},I=this.data.invitation,u!==sg.CONNECTED){t.next=38;break}if(-1===v.indexOf(s)){t.next=38;break}return t.abrupt("return");case 38:if(!("line_busy"===o.line_busy||""===o.line_busy||null!=o&&null!==(n=o.data)&&void 0!==n&&n.message&&"lineBusy"===o.data.message)){t.next=52;break}if(c===I.inviter&&this.TRTCCallingDelegate.onLineBusy({inviteID:this.data.invitation.inviteID,invitee:s,userID:s}),f){t.next=46;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:wg.BUSYLINE})),t.next=44,this._resetTUICallEngine();case 44:t.next=50;break;case 46:if(0!==p.length||1!==v.length){t.next=50;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:wg.BUSYLINE})),t.next=50,this._resetTUICallEngine();case 50:case 57:t.next=78;break;case 52:if(f){t.next=59;break}return this.TRTCCallingDelegate.onReject(y),this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:wg.REJECT})),t.next=57,this._resetTUICallEngine();case 59:if(this.TRTCCallingDelegate.onReject(y),u!==sg.CALLING){t.next=72;break}if(!d){t.next=68;break}if(0!==p.length||1!==v.length){t.next=66;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:wg.REJECT})),t.next=66,this._resetTUICallEngine();case 66:t.next=72;break;case 68:if(1!==p.length||0!==v.length){t.next=72;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:wg.REJECT})),t.next=72,this._resetTUICallEngine();case 72:if(u!==sg.CONNECTED){t.next=78;break}if(0!==p.length||1!==v.length){t.next=78;break}return m=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(m),t.next=78,this._resetTUICallEngine();case 78:case"end":return t.stop()}}),t,this)}))),function(t){return B.apply(this,arguments)})},{key:"handleInvitationCancelled",value:(H=l(a().mark((function t(e){var n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITATION_CANCELLED",{text:{data:e,type:"event"}}),this.data.invitation.inviteID===e.data.inviteID){t.next=3;break}return t.abrupt("return");case 3:if(P_(null==(n=JSON.parse(e.data.data))?void 0:n.businessID)){t.next=6;break}return t.abrupt("return");case 6:if(this.data.callStatus!==sg.IDLE){t.next=8;break}return t.abrupt("return");case 8:if(-1!==this.getInviterInviteIdList().indexOf(e.data.inviteID)){t.next=10;break}return t.abrupt("return");case 10:return F_.log(lb,"onInvitationCancelled","inviteID:".concat(e.data.inviteID," inviter:").concat(e.data.inviter," data:").concat(e.data.data)),r=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:e.data.inviter,userID:e.data.inviter},r),{},{reason:wg.NORMAL})),t.next=15,this._resetTUICallEngine();case 15:case"end":return t.stop()}}),t,this)}))),function(t){return H.apply(this,arguments)})},{key:"handleInvitationTimeout",value:(G=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m,E,_;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITATION_TIMEOUT",{text:{data:e,type:"event"}}),r=e.data,o=r.inviter,s=r.inviteeList,c=void 0===s?[]:s,l=r.inviteID,u=this.getUserID(),h=this.isGroupCall(),f=this.isInviter(),d=this.getCallStatus(),this.deleteUnHandledInviteeList(c),F_.warn("".concat(lb,".onInvitationTimeout - params:"),e,"currentUserID:".concat(u," isInviter:").concat(f," isGroupCall:").concat(h," \n currentCallStatus:").concat(d," inviteID:").concat(null==this||null===(n=this._newInvitationData)||void 0===n?void 0:n.inviteID)),-1!==this.getInviterInviteIdList().indexOf(l)){t.next=10;break}return t.abrupt("return");case 10:if(d!==sg.IDLE){t.next=12;break}return t.abrupt("return");case 12:if(p=this.getHandledInviteeList(),v=this.getUnHandledInviteeList(),g={groupID:this.data.groupID,inviteID:this.data.invitation.inviteID,sponsor:o,timeoutUserList:c,userIDList:c},y=this.generateEventData(),I=i(i({inviteID:this.data.invitation.inviteID,invitee:u,userID:u},y),{},{reason:wg.TIMEOUT}),h){t.next=23;break}return f?(this.TRTCCallingDelegate.onNoResp(g),this.TRTCCallingDelegate.onCancel(I)):(this.TRTCCallingDelegate.onCancel(I),m=this.getCallRecordReport().getCallRecordData().head,this.getCallRecordReport().eventUpload(i(i({},m),{},{eventType:wg.NOT_ANSWER_CALL,inviteID:this.getInitialCallId()}))),t.next=21,this._resetTUICallEngine();case 21:t.next=48;break;case 23:if(d!==sg.CALLING){t.next=41;break}if(!f){t.next=32;break}if(this.TRTCCallingDelegate.onNoResp(g),0!==v.length){t.next=30;break}return this.TRTCCallingDelegate.onCancel(I),t.next=30,this._resetTUICallEngine();case 30:t.next=41;break;case 32:if(-1!==c.indexOf(u)){t.next=36;break}this.TRTCCallingDelegate.onNoResp(g),t.next=39;break;case 36:return this.TRTCCallingDelegate.onCancel(I),t.next=39,this._resetTUICallEngine();case 39:E=this.getCallRecordReport().getCallRecordData().head,this.getCallRecordReport().eventUpload(i(i({},E),{},{eventType:wg.NOT_ANSWER_CALL,inviteID:this.getInitialCallId()}));case 41:if(d!==sg.CONNECTED){t.next=48;break}if(this.TRTCCallingDelegate.onNoResp(g),1!==p.length||0!==v.length){t.next=48;break}return _=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(_),t.next=48,this._resetTUICallEngine();case 48:case"end":return t.stop()}}),t,this)}))),function(t){return G.apply(this,arguments)})},{key:"handleSDKReady",value:function(){var t=this;this._logger.info("ChatSdkEvent.SDK_READY",{text:{type:"event"}}),F_.log(lb,"TSignaling SDK ready"),this.TSignalingResolve(),this.TRTCCallingDelegate.onSdkReady({message:"SDK ready"}),this.tim.getMyProfile().then((function(e){t.data.localUser=e.data})).catch((function(t){F_.warn("getMyProfile error:",t)}))}},{key:"handleKickedOut",value:(V=l(a().mark((function t(){var e,n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("ChatSdkEvent.KICKED_OUT",{text:{type:"event"}}),this.getCallStatus()!==sg.CONNECTED){t.next=6;break}return e=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(e),t.next=6,this._resetTUICallEngine();case 6:if(this.getCallStatus()!==sg.CALLING){t.next=14;break}return n=this.getUserID(),r=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:n,userID:n},r),{},{reason:wg.BANNED})),t.next=12,this.cancel();case 12:return t.next=14,this._resetTUICallEngine();case 14:this._initReady=!1,this.TRTCCallingDelegate.onKickedOut({message:"kicked out"});case 16:case"end":return t.stop()}}),t,this)}))),function(){return V.apply(this,arguments)})},{key:"_addTSignalingEvent",value:function(){wx.$TSignaling.on(t.EVENT.NEW_INVITATION_RECEIVED,this.handleNewInvitationReceived,this),wx.$TSignaling.on(t.EVENT.INVITEE_ACCEPTED,this.handleInviteeAccepted,this),wx.$TSignaling.on(t.EVENT.INVITEE_REJECTED,this.handleInviteeRejected,this),wx.$TSignaling.on(t.EVENT.INVITATION_CANCELLED,this.handleInvitationCancelled,this),wx.$TSignaling.on(t.EVENT.INVITATION_TIMEOUT,this.handleInvitationTimeout,this),wx.$TSignaling.on(t.EVENT.SDK_READY,this.handleSDKReady,this),wx.$TSignaling.on(t.EVENT.KICKED_OUT,this.handleKickedOut,this),t.EVENT.MESSAGE_SENT_BY_ME&&wx.$TSignaling.on(t.EVENT.MESSAGE_SENT_BY_ME,this.onMessageSentByMe,this)}},{key:"_removeTSignalingEvent",value:function(){wx.$TSignaling.off(t.EVENT.NEW_INVITATION_RECEIVED,this.handleNewInvitationReceived),wx.$TSignaling.off(t.EVENT.INVITEE_ACCEPTED,this.handleInviteeAccepted),wx.$TSignaling.off(t.EVENT.INVITEE_REJECTED,this.handleInviteeRejected),wx.$TSignaling.off(t.EVENT.INVITATION_CANCELLED,this.handleInvitationCancelled),wx.$TSignaling.off(t.EVENT.INVITATION_TIMEOUT,this.handleInvitationTimeout),wx.$TSignaling.off(t.EVENT.SDK_READY,this.handleSDKReady),wx.$TSignaling.off(t.EVENT.KICKED_OUT,this.handleKickedOut),t.EVENT.MESSAGE_SENT_BY_ME&&wx.$TSignaling.off(t.EVENT.MESSAGE_SENT_BY_ME,this.onMessageSentByMe,this)}},{key:"onLocalJoin",value:function(){var t=this.generateEventData();this.TRTCCallingDelegate.onCallBegin(t)}},{key:"onRemoteUserJoin",value:(j=l(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.data,r=n.userID,i=n.userList,o=n.playerList,F_.log(lb,"REMOTE_USER_JOIN",e,r),this.addHandledInviteeList([r]),this.deleteUnHandledInviteeList([r]),this.changeCallStatus(sg.CONNECTED),!(o.length>0)){t.next=11;break}return t.next=8,this.getUserProfile(o);case 8:t.t0=t.sent,t.next=12;break;case 11:t.t0=this.data.playerList;case 12:this.data.playerList=t.t0,this.data.startTalkTime||(this.data.startTalkTime=Date.now()),this.TRTCCallingDelegate.onUserEnter({userID:e.data.userID,playerList:this.data.playerList}),F_.log(lb,"REMOTE_USER_JOIN","playerList:",this.data.playerList,"userList:",i);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return j.apply(this,arguments)})},{key:"onRemoteUserLeave",value:(M=l(a().mark((function t(e){var n,r,i,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.getCallStatus()!==sg.IDLE){t.next=2;break}return t.abrupt("return");case 2:if(n=e.data.userID,F_.log(lb,"REMOTE_USER_LEAVE",e,e.data.userID),this.deleteHandledInviteeList([n]),this.data.playerList=this.data.playerList.filter((function(t){return t.userID!==n})),this.TRTCCallingDelegate.onUserLeave({userID:n,playerList:this.data.playerList}),this.getCallDataReport().setExitRoomTime((new Date).getTime()),this.data.isGroupCall){t.next=17;break}return t.next=11,this.TSignalingClient.hangup({userIDList:[n],callType:this.data.config.type,callEnd:this.generateCallTotalTime()});case 11:return r=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(r),F_.log(lb,"REMOTE_USER_LEAVE","playerList:"),t.next=16,this._resetTUICallEngine();case 16:return t.abrupt("return");case 17:if(i=this.getHandledInviteeList(),o=this.getUnHandledInviteeList(),s=this.getUserID(),1!==i.length||i[0]!==s||0!==o.length){t.next=25;break}return c=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(c),t.next=25,this._resetTUICallEngine();case 25:case"end":return t.stop()}}),t,this)}))),function(t){return M.apply(this,arguments)})},{key:"onLocalNetStateUpdate",value:function(t){var e=t.data.pusher.netStatus;F_.log(lb,"onLocalNetStateUpdate",e),this.data.pusher=t.data.pusher,this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"onRemoteNetStateUpdate",value:(P=l(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.data.playerList,F_.log(lb,"onRemoteNetStateUpdate",n),this.data.playerList=this._updateUserProfile(this.data.playerList,n),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 4:case"end":return t.stop()}}),t,this)}))),function(t){return P.apply(this,arguments)})},{key:"onError",value:function(t){F_.warn(lb,"onError",t),this.TRTCCallingDelegate.onError(t)}},{key:"onRemoteVideoAdd",value:function(t){F_.log("* room REMOTE_VIDEO_ADD",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteVideo:!1})}},{key:"onRemoteVideoRemove",value:function(t){F_.log("* room REMOTE_VIDEO_REMOVE",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteVideo:!0})}},{key:"onRemoteAudioAdd",value:(U=l(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return F_.log("* room REMOTE_AUDIO_ADD",e),t.next=3,this.getUserProfile([e.data.player]);case 3:n=t.sent,this.setPlayerAttributesHandler(n[0],{muteAudio:!1});case 5:case"end":return t.stop()}}),t,this)}))),function(t){return U.apply(this,arguments)})},{key:"onRemoteAudioRemove",value:function(t){F_.log("* room REMOTE_AUDIO_REMOVE",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteAudio:!0})}},{key:"onRemoteAudioVolumeUpdate",value:(N=l(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:F_.log("* room REMOTE_AUDIO_VOLUME_UPDATE",e),n=e.data.playerList,this.data.playerList=this._updateUserProfile(this.data.playerList,n),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 4:case"end":return t.stop()}}),t,this)}))),function(t){return N.apply(this,arguments)})},{key:"onLocalAudioVolumeUpdate",value:function(t){var e=t.data.pusher;this.data.pusher=e,this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"onMessageSentByMe",value:function(t){this.TRTCCallingDelegate.onMessageSentByMe(t)}},{key:"_addTRTCEvent",value:function(){this.TRTC.on(this.TRTC.EVENT.LOCAL_JOIN,this.onLocalJoin,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_USER_JOIN,this.onRemoteUserJoin,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_USER_LEAVE,this.onRemoteUserLeave,this),this.TRTC.on(this.TRTC.EVENT.LOCAL_NET_STATE_UPDATE,this.onLocalNetStateUpdate,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_NET_STATE_UPDATE,this.onRemoteNetStateUpdate,this),this.TRTC.on(this.TRTC.EVENT.ERROR,this.onError,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_VIDEO_ADD,this.onRemoteVideoAdd,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_VIDEO_REMOVE,this.onRemoteVideoRemove,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_ADD,this.onRemoteAudioAdd,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_REMOVE,this.onRemoteAudioRemove,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_VOLUME_UPDATE,this.onRemoteAudioVolumeUpdate,this),this.TRTC.on(this.TRTC.EVENT.LOCAL_AUDIO_VOLUME_UPDATE,this.onLocalAudioVolumeUpdate,this)}},{key:"_removeTRTCEvent",value:function(){this.TRTC.off(this.TRTC.EVENT.LOCAL_JOIN,this.onLocalJoin),this.TRTC.off(this.TRTC.EVENT.REMOTE_USER_JOIN,this.onRemoteUserJoin),this.TRTC.off(this.TRTC.EVENT.REMOTE_USER_LEAVE,this.onRemoteUserLeave),this.TRTC.off(this.TRTC.EVENT.LOCAL_NET_STATE_UPDATE,this.onLocalNetStateUpdate),this.TRTC.off(this.TRTC.EVENT.REMOTE_NET_STATE_UPDATE,this.onRemoteNetStateUpdate),this.TRTC.off(this.TRTC.EVENT.ERROR,this.onError),this.TRTC.off(this.TRTC.EVENT.REMOTE_VIDEO_ADD,this.onRemoteVideoAdd),this.TRTC.off(this.TRTC.EVENT.REMOTE_VIDEO_REMOVE,this.onRemoteVideoRemove),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_ADD,this.onRemoteAudioAdd),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_REMOVE,this.onRemoteAudioRemove),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_VOLUME_UPDATE,this.onRemoteAudioVolumeUpdate),this.TRTC.off(this.TRTC.EVENT.LOCAL_AUDIO_VOLUME_UPDATE,this.onLocalAudioVolumeUpdate)}},{key:"initTRTC",value:function(){var t={beautyLevel:5};this._logger.info("".concat(lb,".initTRTC.start"),{type:"api",data:{pusherConfig:t}});var e=this.TRTC.createPusher(t);this.data.pusher=e.pusherAttributes}},{key:"enterRoom",value:function(t){var e=+new Date;this._logger.info("".concat(lb,".enterRoom.start"),{text:{data:t},type:"api"}),this._addTRTCEvent();var n=t.roomID,r=Object.assign(this.data.config,{roomID:n,enableMic:!0,autopush:!0,enableAgc:!0,enableAns:!0,enableCamera:t.callType===pg.VIDEO});this.data.enterRoomStatus=!0,this.data.pusher=this.TRTC.enterRoom(r);var a=+new Date;this._logger.info("".concat(lb,".enterRoom.success"),{text:{data:i(i({},t),{},{cost:a-e})},type:"api"}),wx.createLivePusherContext().startPreview(),this.getCurrentPusherInstance().start()}},{key:"exitRoom",value:(A=l(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".exitRoom.start"),{type:"api"}),t.next=3,this.getCurrentPusherInstance().stop();case 3:return t.next=5,this.TRTC.exitRoom();case 5:e=t.sent,this.data.pusher=e.pusher,this.data.playerList=e.playerList,this.data.unHandledInviteeList=[],this.data.enterRoomStatus=!1,this.initTRTC(),this._removeTRTCEvent();case 12:case"end":return t.stop()}}),t,this)}))),function(){return A.apply(this,arguments)})},{key:"setPusherAttributesHandler",value:function(t){this._logger.info("".concat(lb,".setPusherAttributesHandler.start"),{text:{data:t},type:"api"}),this.data.pusher=this.TRTC.setPusherAttributes(t),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"setPlayerAttributesHandler",value:(k=l(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._logger.info("".concat(lb,".setPlayerAttributesHandler.start"),{text:{data:n},type:"api"}),r=this.TRTC.setPlayerAttributes(e.streamID,n),F_.warn("setPlayerAttributesHandler",r),this.data.playerList=r.length>0?this._updateUserProfile(this.data.playerList,r):this.data.playerList,this.data.playerList.length>0&&0===r.length&&(this.data.playerList[0].hasAudio=!1,this.data.playerList[0].hasVideo=!1),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 6:case"end":return t.stop()}}),t,this)}))),function(t,e){return k.apply(this,arguments)})},{key:"_mutePlayerAudio",value:function(t){this._logger.info("".concat(lb,"._mutePlayerAudio.start"),{text:{data:t},type:"api"});var e=t.currentTarget.dataset.value;e.hasAudio&&e.muteAudio?this.setPlayerAttributesHandler(e,{muteAudio:!1}):!e.hasAudio||e.muteAudio||this.setPlayerAttributesHandler(e,{muteAudio:!0})}},{key:"_mutePlayerVideo",value:function(t){this._logger.info("".concat(lb,"._mutePlayerVideo.start"),{text:{data:t},type:"api"});var e=t.currentTarget.dataset.value;e.hasVideo&&e.muteVideo?this.setPlayerAttributesHandler(e,{muteVideo:!1}):!e.hasVideo||e.muteVideo||this.setPlayerAttributesHandler(e,{muteVideo:!0})}},{key:"_pusherAudioHandler",value:function(){this._logger.info("".concat(lb,"._pusherAudioHandler.start"),{type:"api",text:{data:{enableMic:this.data.pusher.enableMic}}}),this.data.pusher.enableMic?(this.setPusherAttributesHandler({enableMic:!1}),this.getCurrentPusherInstance().setMICVolume({volume:0})):(this.setPusherAttributesHandler({enableMic:!0}),this.getCurrentPusherInstance().setMICVolume({volume:100}))}},{key:"_pusherVideoHandler",value:function(){this._logger.info("".concat(lb,"._pusherVideoHandler.start"),{type:"api",text:{data:{enableCamera:this.data.pusher.enableCamera}}}),this.data.pusher.enableCamera?this.setPusherAttributesHandler({enableCamera:!1}):this.setPusherAttributesHandler({enableCamera:!0})}},{key:"init",value:(O=l(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return CC.getInstance().getAlert().checkSync(new vC({api:"init",attributes:e})),t.next=3,this.login(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return O.apply(this,arguments)})},{key:"login",value:(L=l(a().mark((function t(e){var n=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.updateGetReportData((function(){return{userid:e.userID}})),this._logger.info("".concat(lb,".login.start"),{type:"api",text:i(i({},e),{},{userSig:""})}),this.data.config.userID=e.userID,this.data.config.userSig=e.userSig,t.abrupt("return",new Promise((function(t,r){wx.$TSignaling.login({userID:e.userID,userSig:e.userSig}).then((function(r){return F_.log(lb,"login","IM login success",r),wx.setStorageSync("userId","".concat(e.userID)),n._callDataReport.setUserID(e.userID),n._initReady=!0,n._resetTUICallEngine(),n._addTSignalingEvent(),n.initTRTC(),n.TSignalingResolve=t,r.data.repeatLogin&&t(null),null})).catch((function(t){n._logger.error("".concat(lb,".login.fail"),{type:"api",text:{error:t}}),F_.error("".concat(lb," init failed', error: ").concat(t)),r(t)}))})));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return L.apply(this,arguments)})},{key:"logout",value:(x=l(a().mark((function t(){var e,n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,".logout.start"),{type:"api",text:{data:{userID:this.data.config.userID,initReady:this._initReady}}}),this._initReady){t.next=3;break}return t.abrupt("return");case 3:return e=this.data.config,n=e.userID,r=e.userSig,t.prev=4,t.next=7,wx.$TSignaling.logout({userID:n,userSig:r});case 7:F_.log(lb,"logout","IM logout success"),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(4),this._logger.error("".concat(lb,".logout.fail"),{type:"api",text:{error:t.t0}}),F_.error(lb,"logout","IM logout failure");case 14:case"end":return t.stop()}}),t,this,[[4,10]])}))),function(){return x.apply(this,arguments)})},{key:"on",value:function(t,e,n){CC.getInstance().getAlert().checkSync(new vC({api:"on",attributes:{eventCode:t,handler:e,context:n}})),this._emitter.on(t,e,n)}},{key:"off",value:function(t,e){CC.getInstance().getAlert().checkSync(new vC({api:"off",attributes:{eventCode:t,handler:e}})),this._emitter.off(t,e)}},{key:"call",value:(S=l(a().mark((function t(e){var n,r,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".call.start"),{type:"api",text:{data:e}}),n=e.userID,r=e.type,t.next=4,CC.getInstance().getAlert().check(new vC({api:"call",attributes:e,initReady:this._initReady,callStatus:this.data.callStatus,capabilityCode:Dg.BASE,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,VC(r);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error("".concat(lb,".call.fail"),{text:{error:t.t0},type:"api"}),t.abrupt("return");case 13:if(this.getUserID()!==n){t.next=17;break}throw this._logger.error("".concat(lb,".call.fail"),{text:{error:"Called id can not be yourself. userId:".concat(this.getUserID(),", inviteeId:").concat(n)},type:"api"}),F_.log("".concat(lb,".call failed. Called id can't be yourself. userId:").concat(this.getUserID(),", inviteeId:").concat(n)),new Error("".concat(lb,".call failed. Called id can't be yourself. userId:").concat(this.getUserID(),", inviteeId:").concat(n));case 17:return this._callDataReport.setAbilityBit(!0),this._callDataReport.setCallScene(wg.SINGLE_CALL),o={callType:wg.SINGLE,mediaType:r,inviteeList:[n]},t.prev=20,s=e.roomID||Math.floor(2147483646*Math.random()+1),this.data.roomID=s,this.data.config.type=r,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=r,this.data.invitation.roomID=s,this.data.isInviter=!0,this.data.remoteID=n,this.changeCallStatus(sg.CALLING),t.next=32,this.TSignalingClient.invite(i(i({},e),{},{roomID:s}));case 32:if(c=t.sent,this.enterRoom({roomID:s,callType:r}),this._callDataReport.setEnterRoomTime((new Date).getTime()),l=i(i({},l=this._callDataReport.getCallData()),{},{userId:n,roomID:s,callRole:gg,callType:r,inviteeList:[n]}),this._callDataReport.setCallData(l),this._callDataReport.setSendSignalingTime((new Date).getTime()),F_.log("".concat(lb," call(userID: ").concat(n,", type: ").concat(r,") success, ").concat(c)),0!==c.code){t.next=51;break}this.data.invitation.inviteID=c.inviteID,this.addInviterInviteId(c.inviteID,[this.data.config.userID,n]),this.addUnHandledInviteeList([n]),this.addHandledInviteeList([this.getUserID()]),this._callDataReport.setInviteID(c.inviteID),this.setInitialCallId(c.inviteID),this._callRecordUpload(i({eventType:wg.START_CALL},o)),this._callRecordReport.startHeartbeat(),t.next=57;break;case 51:return this._callDataReport.setCodeAndMessage(c.code,c.message),this._callDataReport.uploadToKibana(),this._callRecordUpload(i({eventType:wg.CALL_FAILED},o)),this._logger.error("".concat(lb,".call.fail"),{text:{error:c},type:"api"}),t.next=57,this._resetTUICallEngine();case 57:return t.abrupt("return",{data:c.data,pusher:this.data.pusher});case 60:return t.prev=60,t.t1=t.catch(20),t.t1.code===Iy.ERROR_BLACKLIST?(this.TRTCCallingDelegate.onError(Iy.ERROR_BLACKLIST,t.t1.message),this._callDataReport.setCodeAndMessage(Iy.ERROR_BLACKLIST,t.t1.message)):this._callDataReport.setCodeAndMessage(Iy.UNKNOWN,JSON.stringify(t.t1)),this._callDataReport.uploadToKibana(),this._callRecordUpload(i({eventType:wg.CALL_FAILED},o)),this._logger.error("".concat(lb,".call.fail"),{text:{error:t.t1},type:"api"}),F_.error("".concat(lb," call(userID:").concat(n,",type:").concat(r,") failed', error: ").concat(t.t1)),t.next=69,this._resetTUICallEngine();case 69:throw new Error(t.t1);case 70:case"end":return t.stop()}}),t,this,[[4,9],[20,60]])}))),function(t){return S.apply(this,arguments)})},{key:"groupCall",value:(w=l(a().mark((function t(e){var n,r,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".groupCall.start"),{type:"api",text:{data:e}}),n=e.type,r=e.userIDList,t.next=4,CC.getInstance().getAlert().check(new vC({api:"groupCall",attributes:e,initReady:this._initReady,callStatus:this.data.callStatus,capabilityCode:Dg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,VC(n);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error("".concat(lb,".groupCall.fail"),{type:"api",text:{error:t.t0}}),t.abrupt("return");case 13:if(-1===r.indexOf(this.getUserID())){t.next=16;break}throw this._logger.error("".concat(lb,".groupCall.fail"),{type:"api",text:{error:"Called list can not contain yourself"}}),new Error("".concat(lb,".groupCall failed. Called list can't contain yourself. userID:").concat(this.getUserID(),", inviteeIDList:").concat(r));case 16:return this._callDataReport.setCallScene(wg.GROUP_CALL),o=e.roomID||Math.floor(2147483646*Math.random()+1),this.enterRoom({roomID:o,callType:n}),s={callType:wg.GROUP,mediaType:n,inviteeList:e.userIDList},this.data.config.type=e.type,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=n,this.data.invitation.roomID=o,this.data.isInviter=!0,this.data.isGroupCall=!0,this.data.groupID=e.groupID,this.changeCallStatus(sg.CALLING),t.prev=28,t.next=31,this.TSignalingClient.inviteGroup(i(i({},e),{},{roomID:o}));case 31:return c=t.sent,this.data.config.type=e.type,this.data.invitation.inviteID=c.inviteID,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=n,this.data.invitation.roomID=o,this.data.isInviter=!0,this.data.isGroupCall=!0,this.data.groupID=e.groupID,this.data.roomID=o,this.addUnHandledInviteeList(e.userIDList),this.addHandledInviteeList([this.getUserID()]),this.addInviterInviteId(c.inviteID,[this.data.config.userID].concat(C(e.userIDList))),this.setInitialCallId(c.inviteID),this._callRecordUpload(i({eventType:wg.START_CALL},s)),this._callRecordReport.startHeartbeat(),F_.log(lb,"groupCall OK",c),t.abrupt("return",{data:c.data,pusher:this.data.pusher});case 51:return t.prev=51,t.t1=t.catch(28),this._logger.error("".concat(lb,".groupCall.fail"),{type:"api",text:{error:t.t1}}),F_.error(lb,"groupCall failed",t.t1),this._callRecordUpload(i({eventType:wg.CALL_FAILED},s)),t.next=58,this._resetTUICallEngine();case 58:throw new Error(t.t1);case 59:case"end":return t.stop()}}),t,this,[[4,9],[28,51]])}))),function(t){return w.apply(this,arguments)})},{key:"joinInGroupCall",value:(R=l(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".joinInGroupCall.start"),{text:{data:e},type:"api"}),n=e.roomID,r=e.type,i=e.groupID,t.next=4,CC.getInstance().getAlert().check(new vC({api:"joinInGroupCall",attributes:e,initReady:this._initReady,capabilityCode:Dg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,VC(r);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error("".concat(lb,".joinInGroupCall.fail"),{text:{error:t.t0},type:"api"}),t.abrupt("return");case 13:return t.prev=13,this.data.config.type=r,this.data.invitation.type=r,F_.log("".concat(lb,".joinInGroupCall roomID:").concat(n,",type:").concat(r,",userID:").concat(this.getUserID())),this.changeCallStatus(sg.CALLING),this.addHandledInviteeList([this.getUserID()]),this.data.groupID=i,this.data.roomID=n,this.data.isGroupCall=!0,this.data.isInviter=!1,this.enterRoom({roomID:n,callType:r}),this.changeCallStatus(sg.CONNECTED),this.getCallRecordReport().setBodyStatus(sg.CONNECTED),o={eventType:wg.JOIN_IN_GROUP_CALL,callType:wg.GROUP,mediaType:this._callType},this._callRecordUpload(o),this._callRecordReport.startHeartbeat(),t.abrupt("return",this.data.pusher);case 32:return t.prev=32,t.t1=t.catch(13),this._logger.error("".concat(lb,".joinInGroupCall.fail"),{text:{error:t.t1},type:"api"}),t.next=37,this._resetTUICallEngine();case 37:throw new Error("".concat(lb,".joinInGroupCall failed error: ").concat(t.t1));case 38:case"end":return t.stop()}}),t,this,[[4,9],[13,32]])}))),function(t){return R.apply(this,arguments)})},{key:"inviteUser",value:(D=l(a().mark((function t(e){var n,r,i,o,s,c,l,u,h,f=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".inviteUser.start"),{text:{data:e},type:"api"}),t.next=3,CC.getInstance().getAlert().check(new vC({api:"inviteUser",attributes:e,initReady:this._initReady,capabilityCode:Dg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 3:if(n=e.userIDList,r=void 0===n?[]:n,this.isGroupCall()){t.next=8;break}throw this._logger.error("".concat(lb,".inviteUser.fail"),{text:{error:"".concat(lb,".inviteUser - groupID:").concat(this.data.groupID,", roomID:").concat(this.data.roomID,", type:").concat(this.data.callType)},type:"api"}),F_.error("".concat(lb,".inviteUser - groupID:").concat(this.data.groupID,", roomID:").concat(this.data.roomID,", type:").concat(this.data.callType)),new Error("".concat(lb,".inviteUser - groupID:").concat(this.data.groupID,", roomID:").concat(this.data.roomID,", type:").concat(this.data.callType));case 8:if(this.isInviter()||this.data.callStatus===sg.CONNECTED){t.next=12;break}throw this._logger.error("".concat(lb,".inviteUser.fail"),{text:{error:"".concat(lb,".inviteUser - current status:").concat(this.data.callStatus," not support")},type:"api"}),F_.error("".concat(lb,".inviteUser - current status:").concat(this.data.callStatus," not support")),new Error("".concat(lb,".inviteUser - current status:").concat(this.data.callStatus," not support"));case 12:if(0!==r.length){t.next=16;break}throw this._logger.error("".concat(lb,".inviteUser.fail"),{text:{error:"userIDList is empty"},type:"api"}),F_.error("".concat(lb,".inviteUser - userIDList is empty")),new Error("".concat(lb,".inviteUser - userIDList is empty"));case 16:if(i=this.getHandledInviteeList(),o=this.getUnHandledInviteeList(),s=[].concat(C(i),C(o)),0!==(c=r.filter((function(t){return-1===s.indexOf(t)}))).length){t.next=24;break}return this._logger.error("".concat(lb,".inviteUser.fail"),{text:{data:{userIDList:r},error:"userIDList in call list"},type:"api"}),F_.error("".concat(lb,".inviteUser failed - userIDList in call list. userIDList:").concat(JSON.stringify(r))),t.abrupt("return",Promise.reject("".concat(lb,".inviteUser failed - userIDList in call list. userIDList:").concat(JSON.stringify(r))));case 24:return r=c,t.prev=25,l=this.data.handledInviteeList.filter((function(t){return t!==f.getUserID()})),t.next=29,this.TSignalingClient.inviteGroup({groupID:this.data.groupID,userIDList:r,type:this.data.invitation.type,roomID:this.data.roomID,timeout:this.data.callTimeout,inCallUserIDs:[].concat(C(this.data.unHandledInviteeList),C(l)),initialCallId:this.getInitialCallId()});case 29:if(u=t.sent,F_.log("inviteUser res",u),0!==u.code){t.next=38;break}return this.addUnHandledInviteeList(r),this.addInviterInviteId(u.inviteID,[this.data.config.userID].concat(C(r))),h={eventType:wg.INVITE_USER,callType:wg.GROUP,mediaType:this._callType,inviteeList:r},this._callRecordUpload(h),this._callRecordReport.startHeartbeat(),t.abrupt("return",u);case 38:t.next=44;break;case 40:throw t.prev=40,t.t0=t.catch(25),this._logger.error("".concat(lb,".inviteUser.fail"),{text:{error:t.t0},type:"api"}),new Error("".concat(lb,".inviteUser failed, userId:").concat(this.getUserID(),", inviteeIdList:").concat(r,", error: ").concat(t.t0));case 44:case"end":return t.stop()}}),t,this,[[25,40]])}))),function(t){return D.apply(this,arguments)})},{key:"accept",value:(b=l(a().mark((function t(){var e=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".accept.start"),{type:"api"}),t.next=3,CC.getInstance().getAlert().check(new vC({api:"accept",initReady:this._initReady,callStatus:this.data.callStatus,sdkAppID:this.data.config.sdkAppID}));case 3:return t.prev=3,t.next=6,VC(this.data.config.type);case 6:t.next=12;break;case 8:return t.prev=8,t.t0=t.catch(3),this._logger.error("".concat(lb,".accept.fail"),{text:{error:t.t0},type:"api"}),t.abrupt("return");case 12:return t.abrupt("return",new Promise((function(t,n){if(F_.log(lb,"accept() inviteID: ",e.data.invitation.inviteID),e.data.config.type!==pg.VIDEO||e.data.isGroupCall)e.handleAccept(t,n);else if(e.data.devicePermission){wx.createLivePusherContext().stopPreview();var r=setTimeout(l(a().mark((function i(){return a().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:clearTimeout(r),e.handleAccept(t,n);case 2:case"end":return i.stop()}}),i)}))),0)}else e.handleAccept(t,n)})));case 13:case"end":return t.stop()}}),t,this,[[3,8]])}))),function(){return b.apply(this,arguments)})},{key:"handleAccept",value:(T=l(a().mark((function t(e,n){var r,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".handleAccept.start"),{type:"api"}),this._callDataReport.setEnterRoomTime((new Date).getTime()),this.enterRoom({roomID:this.data.invitation.roomID,callType:this.data.config.type}),r=this.data.invitation.inviteID,t.next=6,this.TSignalingClient.accept({inviteID:r,type:this.data.config.type});case 6:0===(i=t.sent).code?(F_.log(lb,"accept OK"),this.addHandledInviteeList([this.getUserID()]),this.deleteUnHandledInviteeList([this.getUserID()]),this.addAcceptedUserList(r,[this.getUserID()]),this._callRecordUpload({eventType:wg.ACCEPT_CALL}),e({message:i.data.message,pusher:this.data.pusher}),this.changeCallStatus(sg.CONNECTED),this.getCallRecordReport().setBodyStatus(sg.CONNECTED)):(this.isGroupCall()&&(this._callDataReport.setCodeAndMessage(Iy.NOT_MEDIA_ACCESS,JSON.stringify(i.data.message)),this._callDataReport.uploadToKibana()),this._logger.error("".concat(lb,".accept.fail"),{text:{error:i},type:"api"}),F_.error(lb,"accept failed",i),n(i),this._resetTUICallEngine());case 8:case"end":return t.stop()}}),t,this)}))),function(t,e){return T.apply(this,arguments)})},{key:"reject",value:(_=l(a().mark((function t(){var e,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".reject.start"),{text:{data:{invitation:this.data.invitation,type:this.data.config.type}},type:"api"}),t.next=3,CC.getInstance().getAlert().checkSync(new vC({api:"reject",callStatus:this.data.callStatus,initReady:this._initReady}));case 3:if(!this.data.invitation.inviteID){t.next=14;break}return t.next=6,this.TSignalingClient.reject({inviteID:this.data.invitation.inviteID,type:this.data.config.type});case 6:return e=t.sent,F_.log(lb,"reject OK",e),n=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:this.getUserID(),userID:this.getUserID()},n),{},{reason:wg.REJECT})),this._callRecordUpload({eventType:wg.REJECT_CALL}),t.next=13,this._resetTUICallEngine();case 13:return t.abrupt("return",e);case 14:return this._logger.error("".concat(lb,".reject.fail"),{text:{error:"未收到邀请,无法拒绝"},type:"api"}),F_.warn("".concat(lb," 未收到邀请,无法拒绝")),t.abrupt("return","未收到邀请,无法拒绝");case 17:case"end":return t.stop()}}),t,this)}))),function(){return _.apply(this,arguments)})},{key:"hangup",value:(E=l(a().mark((function t(){var e,n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m,E,_=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".hangup.start"),{text:{data:{isGroupCall:this.isGroupCall(),isInviter:this.isInviter(),currentUserID:this.getUserID(),totalTime:this.generateCallTotalTime(),callType:this.getCallType()}},type:"api"}),t.next=3,CC.getInstance().getAlert().checkSync(new vC({api:"hangup",callStatus:this.data.callStatus,initReady:this._initReady}));case 3:if(F_.warn("".concat(lb,". - callStatus:").concat(this.data.callStatus," _inviterInviteID:").concat(JSON.stringify(this.data.invitation))),this.data.callStatus!==sg.IDLE){t.next=7;break}throw this._logger.error("".concat(lb,".hangup.fail"),{text:{data:{currentStatus:this.data.callStatus},error:"hangup failed. current status:"},type:"api"}),new Error("".concat(lb,".hangup failed. current status:").concat(this.data.callStatus));case 7:if(this.data.callStatus!==sg.CALLING||0!==this.getInviterInviteIdList().length){t.next=10;break}throw this._logger.error("".concat(lb,".hangup.fail"),{text:{error:"call/groupCall incomplete。please wait cancel"},type:"api"}),new Error("".concat(lb,".call/groupCall incomplete。please wait cancel"));case 10:if(e=this.isGroupCall(),n=this.isInviter(),r=this.getUserID(),o=this.generateCallTotalTime(),s=this.getCallType(),l=this.getInviterInviteIdList(),this.data.callStatus!==sg.CONNECTED){t.next=31;break}if(t.prev=17,0!==l.length){t.next=23;break}return u=this.generateCallEndData({callMediaType:s,totalTime:o}),this.TRTCCallingDelegate.onCallEnd(u),t.next=23,this._resetTUICallEngine();case 23:t.next=31;break;case 25:return t.prev=25,t.t0=t.catch(17),this._logger.error("".concat(lb,".hangup.fail"),{text:{error:t.t0},type:"api"}),t.next=30,this._resetTUICallEngine();case 30:throw new Error(t.t0);case 31:if(h=this.getHandledInviteeList(),f=this.getUnHandledInviteeList(),d=this.generateEventData(),t.prev=34,e){t.next=53;break}if(p=this.generateCallEndData(),!n){t.next=48;break}if(1!==f.length){t.next=45;break}return t.next=41,this.cancel();case 41:c=t.sent,this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},d),{},{reason:wg.NORMAL})),t.next=46;break;case 45:this.TRTCCallingDelegate.onCallEnd(p);case 46:t.next=49;break;case 48:this.TRTCCallingDelegate.onCallEnd(p);case 49:return t.next=51,this._resetTUICallEngine();case 51:t.next=82;break;case 53:if(v=this.getCallStatus(),g={callType:this.getCallType(),isGroupCall:this.isGroupCall(),groupID:this.data.groupID,userIDList:[].concat(C(h.filter((function(t){return t!==r}))),C(f)),callEnd:this.generateCallTotalTime()},!n){t.next=73;break}if(v!==sg.CALLING){t.next=63;break}return t.next=59,this.cancel(this.getInviterInviteIdList());case 59:return c=t.sent,this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},d),{},{reason:wg.NORMAL})),t.next=63,this._resetTUICallEngine();case 63:if(v!==sg.CONNECTED){t.next=71;break}y=a().mark((function t(){var e,n,i,o,s,u,d;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l[I],n=_.getInviterInviteIdUserList(e),!((i=_.getAcceptedUserList(e)).length>0)){t.next=22;break}if(o=i.filter((function(t){return-1!==h.indexOf(t)})),s=n.filter((function(t){return-1!==f.indexOf(t)})),g.userIDList=[].concat(C(o),C(s)).filter((function(t){return t!==r})),F_.warn("inviter emit hangup signal, notify userIDList:".concat(JSON.stringify(g.userIDList))),0===g.userIDList.length){t.next=13;break}return t.next=10,_.TSignalingClient.hangup(g);case 10:c=t.sent,t.next=18;break;case 13:if(!(h.length>1)){t.next=18;break}return g.userIDList=h.filter((function(t){return t!==r})),t.next=17,_.TSignalingClient.hangup(g);case 17:c=t.sent;case 18:u=_.generateCallEndData(),_.TRTCCallingDelegate.onCallEnd(u),t.next=29;break;case 22:if(d=_.getUnHandledInviteeList(),!(n.filter((function(t){return-1!==d.indexOf(t)})).length>0)){t.next=29;break}return F_.warn("inviter emit cancel signal, userIdList:".concat(n)),t.next=28,_.cancel([e]);case 28:c=t.sent;case 29:case"end":return t.stop()}}),t)})),I=0;case 66:if(!(I0)){t.next=22;break}if(o=i.filter((function(t){return-1!==h.indexOf(t)})),s=n.filter((function(t){return-1!==f.indexOf(t)})),g.userIDList=[].concat(C(o),C(s)).filter((function(t){return t!==r})),F_.warn("invitee emit hangup signal, notify userIDList:".concat(JSON.stringify(g.userIDList))),0===g.userIDList.length){t.next=13;break}return t.next=10,_.TSignalingClient.hangup(g);case 10:c=t.sent,t.next=18;break;case 13:if(!(h.length>1)){t.next=18;break}return g.userIDList=h.filter((function(t){return t!==r})),t.next=17,_.TSignalingClient.hangup(g);case 17:c=t.sent;case 18:u=_.generateCallEndData(),_.TRTCCallingDelegate.onCallEnd(u),t.next=29;break;case 22:if(d=_.getUnHandledInviteeList(),!(n.filter((function(t){return-1!==d.indexOf(t)})).length>0)){t.next=29;break}return F_.warn("invitee emit cancel signal, inviteID:".concat(e)),t.next=28,_.cancel([e]);case 28:c=t.sent;case 29:case"end":return t.stop()}}),t)})),E=0;case 75:if(!(E=3600?(r=parseInt(o/3600)<10?"0".concat(parseInt(o/3600)):parseInt(o/3600),i=parseInt(o%60/60)<10?"0".concat(parseInt(o%60/60)):parseInt(o%60/60),(a=o%3600<10?"0".concat(o%3600):o%3600)>60&&(i=parseInt(a/60)<10?"0".concat(parseInt(a/60)):parseInt(a/60),a=a%60<10?"0".concat(a%60):a%60),n="".concat(r,":").concat(i,":").concat(a)):o>=60&&o<3600?(i=parseInt(o/60)<10?"0".concat(parseInt(o/60)):parseInt(o/60),a=o%60<10?"0".concat(o%60):o%60,n="00:".concat(i,":").concat(a)):o<60&&(a=o<10?"0".concat(o):o,n="00:00:".concat(a)),n),e.data.chatTimeNum+=1,e.data.pusher.chatTime=e.data.chatTime,e.data.pusher.chatTimeNum=e.data.chatTimeNum,e.TRTCCallingDelegate.onUserUpdate({pusher:e.data.pusher,playerList:e.data.playerList})}),1e3);break;case sg.IDLE:clearInterval(this.data.timer),this.data.timer=null,this.data.chatTime="00:00:00",this.data.chatTimeNum=0}}},{key:"_resetTUICallEngine",value:(I=l(a().mark((function t(e,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,"._resetTUICallEngine.start"),{text:{data:{callEnd:e,type:n}},type:"api"}),this.changeCallStatus(sg.IDLE),F_.log(lb," _resetTUICallEngine()",this.data.enterRoomStatus),!this.data.enterRoomStatus){t.next=6;break}return t.next=6,this.exitRoom(e,n);case 6:this.data.config.type=pg.AUDIO,this._initialCallId="",this.initData();case 9:case"end":return t.stop()}}),t,this)}))),function(t,e){return I.apply(this,arguments)})},{key:"startRemoteView",value:(y=l(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._logger.info("".concat(lb,".startRemoteView.start"),{text:{data:{userID:e}},type:"api"}),this.data.playerList.forEach((function(t){if(t.userID===e)return t.muteVideo=!1,void F_.log("".concat(lb,", startRemoteView(").concat(e,")"))}));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return y.apply(this,arguments)})},{key:"stopRemoteView",value:function(t){this._logger.info("".concat(lb,".stopRemoteView.start"),{text:{data:{userID:t}},type:"api"}),this.data.playerList.forEach((function(e){if(e.userID===t)return e.muteVideo=!0,void F_.log("".concat(lb,", stopRemoteView(").concat(t,")"))}))}},{key:"openCamera",value:function(){this._logger.info("".concat(lb,".openCamera.start"),{text:{data:{enableCamera:this.data.pusher.enableCamera}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"openCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableCamera||this._pusherVideoHandler(),F_.log("".concat(lb,", openCamera() pusher: ").concat(this.data.pusher))}},{key:"closeCamera",value:function(){this._logger.info("".concat(lb,".closeCamera.start"),{text:{data:{enableCamera:this.data.pusher.enableCamera}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"closeCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableCamera&&this._pusherVideoHandler(),F_.log("".concat(lb,", closeCamera() pusher: ").concat(this.data.pusher))}},{key:"switchCamera",value:function(){this._logger.info("".concat(lb,".switchCamera.start"),{text:{data:{frontCamera:this.data.pusher.frontCamera}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"switchCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.getCurrentPusherInstance().switchCamera(),F_.log("".concat(lb,", switchCamera(), frontCamera").concat(this.data.pusher.frontCamera))}},{key:"openMicrophone",value:function(){this._logger.info("".concat(lb,".openMicrophone.start"),{text:{data:{enableMic:this.data.pusher.enableMic}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"openMicrophone",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableMic||this._pusherAudioHandler(),F_.log("".concat(lb,", openMicrophone() pusher: ").concat(this.data.pusher))}},{key:"closeMicrophone",value:function(){this._logger.info("".concat(lb,".closeMicrophone.start"),{text:{data:{enableMic:this.data.pusher.enableMic}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"closeMicrophone",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableMic&&this._pusherAudioHandler(),F_.log("".concat(lb,", closeMicrophone() pusher: ").concat(this.data.pusher))}},{key:"selectAudioPlaybackDevice",value:function(t){this._logger.info("".concat(lb,".selectAudioPlaybackDevice.start"),{text:{data:{type:t}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"selectAudioPlaybackDevice",callStatus:this.data.callStatus,attributes:{type:t},initReady:this._initReady}));var e=!1;switch(t){case"speaker":e=!0;break;case"ear":e=!1}return this.setHandsFree(e)}},{key:"setHandsFree",value:function(t){return this.data.soundMode=t?"speaker":"ear",F_.log("".concat(lb,", setHandsFree() result: ").concat(this.data.soundMode)),this.data.soundMode}},{key:"switchAudioCall",value:(g=l(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,".switchAudioCall.start"),{type:"api"}),!this.isGroupCall()){t.next=5;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"switchToAudioCall is not applicable to groupCall"},type:"api"}),F_.warn("".concat(lb,".switchToAudioCall is not applicable to groupCall.")),t.abrupt("return");case 5:if(this.data.invitation.type!==pg.AUDIO){t.next=9;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"the call mode is audio call"},type:"api"}),F_.warn("".concat(lb," Now the call mode is audio call.")),t.abrupt("return");case 9:if(this.data.switchCallModeStatus){t.next=13;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"audio and video call switching"},type:"api"}),F_.warn("".concat(lb," audio and video call switching.")),t.abrupt("return");case 13:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!1}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.unHandledInviteeList[0]||this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Tg}));case 16:case"end":return t.stop()}}),t,this)}))),function(){return g.apply(this,arguments)})},{key:"switchCallMediaType",value:(v=l(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".closeMicrophone.start"),{text:{data:{type:e}},type:"api"}),t.next=3,CC.getInstance().getAlert().check(new vC({api:"switchCallMediaType",attributes:{type:e},callStatus:this.data.callStatus,initReady:this._initReady,sdkAppID:this.data.config.sdkAppID}));case 3:if(!this.isGroupCall()){t.next=7;break}throw this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"switchToAudioCall is not applicable to groupCall"},type:"api"}),F_.error("".concat(lb,".switchToAudioCall is not applicable to groupCall.")),new hC(Iy.ERROR_SCENE_NOT_SUPPORTED,"".concat(lb,".switchToAudioCall is not applicable to groupCall."));case 7:if(this.data.switchCallModeStatus){t.next=11;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"audio and video call switching"},type:"api"}),F_.warn("".concat(lb," audio and video call switching.")),t.abrupt("return");case 11:t.t0=e,t.next=t.t0===pg.AUDIO?14:t.t0===pg.VIDEO?17:20;break;case 14:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!1}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.unHandledInviteeList[0]||this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Tg}));case 17:throw this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"Audio switching Video is not supported yet"},type:"api"}),F_.warn("".concat(lb," Audio switching Video is not supported yet")),new Error("".concat(lb," Audio switching Video is not supported yet"));case 20:case"end":return t.stop()}}),t,this)}))),function(t){return v.apply(this,arguments)})},{key:"setSwitchCallModeStatus",value:function(t){this.data.switchCallModeStatus=t}},{key:"switchVideoCall",value:(p=l(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,".switchVideoCall.start"),{type:"api"}),!this.isGroupCall()){t.next=5;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"switchToAudioCall is not applicable to groupCall"},type:"api"}),F_.warn("".concat(lb,".switchToVideoCall is not applicable to groupCall.")),t.abrupt("return");case 5:if(this.data.invitation.type!==pg.VIDEO){t.next=9;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"Now the call mode is video call"},type:"api"}),F_.warn("".concat(lb," Now the call mode is video call.")),t.abrupt("return");case 9:if(this.data.switchCallModeStatus){t.next=13;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"audio and video call switching"},type:"api"}),F_.warn("".concat(lb," audio and video call switching.")),t.abrupt("return");case 13:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!0}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Cg}));case 16:case"end":return t.stop()}}),t,this)}))),function(){return p.apply(this,arguments)})},{key:"setSoundMode",value:function(t){var e=!1,n=!1;switch(t||(n=!0,t=this.data.soundMode),t){case"speaker":e=!0;break;case"ear":e=!1}return this.setHandsFree(n?!e:e)}},{key:"_hangUp",value:function(){this.hangup()}},{key:"getCurrentPusherInstance",value:function(){return this.TRTC.getPusherInstance().context=wx.createLivePusherContext(),this.TRTC.getPusherInstance()}},{key:"_pusherStateChangeHandler",value:function(t){this.TRTC.pusherEventHandler(t)}},{key:"_playerStateChange",value:function(t){this._emitter.emit(og.REMOTE_STATE_UPDATE,t)}},{key:"_playerAudioVolumeNotify",value:function(t){this.data.playerList.length>0&&this.TRTC.playerAudioVolumeNotify(t)}},{key:"_pusherAudioVolumeNotify",value:function(t){this.TRTC.pusherAudioVolumeNotify(t)}},{key:"_updateUserProfile",value:function(t,e){return 0===e.length||0===t.length?e:e.map((function(e){var n=e,r=t.filter((function(t){return t.userID===e.userID}));return n.avatar=r[0]&&r[0].avatar?r[0].avatar:"",n.nick=r[0]&&r[0].nick?r[0].nick:"",n}))}},{key:"_getUserProfile",value:function(t){var e=this;this.tim.getUserProfile({userIDList:t}).then((function(t){F_.log("getUserProfile success",t),F_.log(t.data),e.data.remoteUsers=t.data})).catch((function(t){F_.warn("getUserProfile error:",t)}))}},{key:"getUserProfile",value:(h=l(a().mark((function t(e){var n,r,i,o,s=arguments;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:"array",0!==e.length){t.next=3;break}return t.abrupt("return",[]);case 3:return r=e.map((function(t){return t.userID})),t.next=6,this.tim.getUserProfile({userIDList:r});case 6:i=t.sent,o=null,t.t0=n,t.next="array"===t.t0?11:"map"===t.t0?13:16;break;case 11:return o=e.map((function(t,e){return t.avatar=i.data[e].avatar,t.nick=i.data[e].nick,t})),t.abrupt("break",16);case 13:return o={},e.forEach((function(t,e){t.avatar=i.data[e].avatar,t.nick=i.data[e].nick,o[t.userID]=t})),t.abrupt("break",16);case 16:return t.abrupt("return",o);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return h.apply(this,arguments)})},{key:"setSelfInfo",value:function(t,e){return this._logger.info("".concat(lb,".setSelfInfo.start"),{text:{data:{nickName:t,avatar:e}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"setSelfInfo",attributes:{nickName:t,avatar:e},initReady:this._initReady})),this.tim.updateMyProfile({nick:t,avatar:e})}},{key:"deviceCheck",value:(c=l(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",N_(e));case 1:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)})},{key:"_pusherNetStatus",value:function(t){this.TRTC.pusherNetStatusHandler(t)}},{key:"_playNetStatus",value:function(t){this.TRTC.playerNetStatus(t)}},{key:"_toggleViewSize",value:function(t){var e=t.currentTarget.dataset.screen;return F_.log("get screen",e,t),1===this.data.playerList.length&&e!==this.data.screen&&this.data.invitation.type===pg.VIDEO&&(this.data.screen=e),this.data.screen}},{key:"getTim",value:function(){return this.tim}},{key:"destroyed",value:(s=l(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,".destroyed.start"),{type:"api"}),this.getCallStatus()===sg.IDLE){t.next=4;break}return t.next=4,this.handleExceptionExit();case 4:if(this._resetTUICallEngine(),this._removeTSignalingEvent(),this._removeTRTCEvent(),this._timExternal){t.next=10;break}return t.next=10,this.logout();case 10:this._initReady=!1;case 11:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"handleExceptionExit",value:(o=l(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,".handleExceptionExit.start"),{text:{data:{callStatus:this.getCallStatus()}},type:"api"}),t.prev=1,this.getCallStatus()!==sg.CALLING){t.next=10;break}if(!this.isInviter()){t.next=8;break}return t.next=6,this.hangup();case 6:t.next=10;break;case 8:return t.next=10,this.reject();case 10:if(this.getCallStatus()!==sg.CONNECTED){t.next=13;break}return t.next=13,this.hangup();case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(1),this._logger.error("".concat(lb,".handleExceptionExit.fail"),{text:{data:{error:t.t0}},type:"api"});case 18:case"end":return t.stop()}}),t,this,[[1,15]])}))),function(){return o.apply(this,arguments)})},{key:"_callRecordUpload",value:function(t){var e=i(i({},t),{},{callRole:this.isInviter()?wg.INVITER:wg.INVITEE,userID:this.getUserID(),roomID:this.getRoomID(),inviteID:this.getInitialCallId()});this._callRecordReport.eventUpload(e)}},{key:"generateCallEndData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.roomId,n=t.callMediaType,r=t.callRole,i=t.totalTime,a=t.userId;return e=e||this.getRoomID(),n=n||this.getCallType(),r||(r=this.isInviter()?gg:yg),{roomID:e,callMediaType:n,callRole:r,totalTime:i=S_(i)?this.generateCallTotalTime():i,userID:a=a||this.getUserID(),callEnd:i,message:t.message||""}}},{key:"generateEventData",value:function(){return{callID:this.getInviterInviteIdList()[0],roomID:this.getRoomID(),callRole:this.isInviter()?wg.INVITER:wg.INVITEE,callMediaType:this.getCallType()}}},{key:"setInitialCallId",value:function(t){this._initialCallId=t}},{key:"getInitialCallId",value:function(){return this._initialCallId}},{key:"getConnectStartTime",value:function(){return this.data.startTalkTime}},{key:"generateCallTotalTime",value:function(){return 0===this.getConnectStartTime()?0:Math.round((Date.now()-this.getConnectStartTime())/1e3)}}],[{key:"createInstance",value:function(t){return ub.updateEsConfig({url:"".concat("https://webim.tim.qq.com/v4/imopenstat/tweb_trtccalling_report","?sdkappid=").concat(null==t?void 0:t.sdkAppID),table:"timweb-trtccalling"}),CC.getInstance().getAlert().checkSync(new vC({api:"createInstance",attributes:t})),r.instance||(r.instance=new r(t)),r.instance.initData(),r.instance}}]),r}();d(hb,"instance",null),d(hb,"AUDIO_PLAYBACK_DEVICE",bg),d(hb,"MEDIA_TYPE",pg),d(hb,"EVENT",og),d(hb,"STATUS",sg);if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true });Object.defineProperty(exports, 'AUDIO_PLAYBACK_DEVICE', { enumerable: true, configurable: true, get: function() { return bg; } });Object.defineProperty(exports, 'EVENT', { enumerable: true, configurable: true, get: function() { return og; } });Object.defineProperty(exports, 'MEDIA_TYPE', { enumerable: true, configurable: true, get: function() { return pg; } });Object.defineProperty(exports, 'STATUS', { enumerable: true, configurable: true, get: function() { return sg; } });Object.defineProperty(exports, 'TUICallEngine', { enumerable: true, configurable: true, get: function() { return hb; } });Object.defineProperty(exports, 'default', { enumerable: true, configurable: true, get: function() { return hb; } }); }, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) return __REQUIRE__(1744442642937); })() //miniprogram-npm-outsideDeps=["tsignaling-wx","trtc-wx-sdk","tim-wx-sdk"] //# sourceMappingURL=index.js.map