tcplayer.js 4.8.0-beta.4 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/examples/vod/{tcplayer-vod-all-skip.html → tcplayer-skip.html} +47 -31
- package/dist/examples/vod/tcplayer-vod-all.html +228 -0
- package/dist/examples/vod/tcplayer-vod-event.html +7 -4
- package/dist/examples/vod/tcplayer-vod-ghost-watermark.html +6 -2
- package/dist/examples/vod/tcplayer-vod-vr.html +138 -0
- package/dist/examples/webrtc/tcplayer-src-webrtc-abr-new.html +109 -0
- package/dist/examples/webrtc/tcplayer-src-webrtc-abr.html +1 -2
- package/dist/examples/webrtc/tcplayer-src-webrtc.html +9 -84
- package/dist/libs/TXLivePlayer-1.3.4.min.js +1 -0
- package/dist/libs/tcpcrypto.1.0.0.js +2 -0
- package/dist/plugins/tcplayer-safe-check-plugin.1.0.0.js +2 -0
- package/dist/plugins/tcplayer-vr-plugin.1.0.0.js +2 -0
- package/dist/tcplayer.css +154 -2
- package/dist/tcplayer.min.css +1 -1
- package/dist/tcplayer.v5.0.0.min.js +26 -0
- package/package.json +2 -2
- package/dist/examples/vod/video.html +0 -15
- package/dist/libs/TXLivePlayer-1.3.0.min.js +0 -1
- package/dist/tcplayer.v4.8.0.min.js +0 -22
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).TXLivePlayer=t()}(this,(function(){"use strict";function e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}}))})),Object.freeze(e)}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n=function(e){try{return!!e()}catch(e){return!0}},i=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),o=i,s=Function.prototype,a=s.bind,c=s.call,u=o&&a.bind(c,c),l=o?function(e){return e&&u(e)}:function(e){return e&&function(){return c.apply(e,arguments)}},d=l({}.isPrototypeOf),p=function(e){return e&&e.Math==Math&&e},f=p("object"==typeof globalThis&&globalThis)||p("object"==typeof window&&window)||p("object"==typeof self&&self)||p("object"==typeof t&&t)||function(){return this}()||Function("return this")(),h=i,v=Function.prototype,m=v.apply,y=v.call,g="object"==typeof Reflect&&Reflect.apply||(h?y.bind(m):function(){return y.apply(m,arguments)}),b=function(e){return"function"==typeof e},C={},T=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),S=i,_=Function.prototype.call,E=S?_.bind(_):function(){return _.apply(_,arguments)},R={},P={}.propertyIsEnumerable,w=Object.getOwnPropertyDescriptor,k=w&&!P.call({1:2},1);R.f=k?function(e){var t=w(this,e);return!!t&&t.enumerable}:P;var A,O,D=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},L=l,M=L({}.toString),I=L("".slice),x=function(e){return I(M(e),8,-1)},N=n,F=x,U=Object,V=l("".split),j=N((function(){return!U("z").propertyIsEnumerable(0)}))?function(e){return"String"==F(e)?V(e,""):U(e)}:U,B=TypeError,W=function(e){if(null==e)throw B("Can't call method on "+e);return e},Y=j,q=W,G=function(e){return Y(q(e))},z=b,H=function(e){return"object"==typeof e?null!==e:z(e)},Q={},K=Q,J=f,Z=b,X=function(e){return Z(e)?e:void 0},$=function(e,t){return arguments.length<2?X(K[e])||X(J[e]):K[e]&&K[e][t]||J[e]&&J[e][t]},ee=$("navigator","userAgent")||"",te=f,re=ee,ne=te.process,ie=te.Deno,oe=ne&&ne.versions||ie&&ie.version,se=oe&&oe.v8;se&&(O=(A=se.split("."))[0]>0&&A[0]<4?1:+(A[0]+A[1])),!O&&re&&(!(A=re.match(/Edge\/(\d+)/))||A[1]>=74)&&(A=re.match(/Chrome\/(\d+)/))&&(O=+A[1]);var ae=O,ce=ae,ue=n,le=!!Object.getOwnPropertySymbols&&!ue((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ce&&ce<41})),de=le&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,pe=$,fe=b,he=d,ve=Object,me=de?function(e){return"symbol"==typeof e}:function(e){var t=pe("Symbol");return fe(t)&&he(t.prototype,ve(e))},ye=String,ge=function(e){try{return ye(e)}catch(e){return"Object"}},be=b,Ce=ge,Te=TypeError,Se=function(e){if(be(e))return e;throw Te(Ce(e)+" is not a function")},_e=Se,Ee=function(e,t){var r=e[t];return null==r?void 0:_e(r)},Re=E,Pe=b,we=H,ke=TypeError,Ae={exports:{}},Oe=f,De=Object.defineProperty,Le=function(e,t){try{De(Oe,e,{value:t,configurable:!0,writable:!0})}catch(r){Oe[e]=t}return t},Me="__core-js_shared__",Ie=f[Me]||Le(Me,{}),xe=Ie;(Ae.exports=function(e,t){return xe[e]||(xe[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.23.3",mode:"pure",copyright:"漏 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE",source:"https://github.com/zloirock/core-js"});var Ne=W,Fe=Object,Ue=function(e){return Fe(Ne(e))},Ve=Ue,je=l({}.hasOwnProperty),Be=Object.hasOwn||function(e,t){return je(Ve(e),t)},We=l,Ye=0,qe=Math.random(),Ge=We(1..toString),ze=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Ge(++Ye+qe,36)},He=f,Qe=Ae.exports,Ke=Be,Je=ze,Ze=le,Xe=de,$e=Qe("wks"),et=He.Symbol,tt=et&&et.for,rt=Xe?et:et&&et.withoutSetter||Je,nt=function(e){if(!Ke($e,e)||!Ze&&"string"!=typeof $e[e]){var t="Symbol."+e;Ze&&Ke(et,e)?$e[e]=et[e]:$e[e]=Xe&&tt?tt(t):rt(t)}return $e[e]},it=E,ot=H,st=me,at=Ee,ct=function(e,t){var r,n;if("string"===t&&Pe(r=e.toString)&&!we(n=Re(r,e)))return n;if(Pe(r=e.valueOf)&&!we(n=Re(r,e)))return n;if("string"!==t&&Pe(r=e.toString)&&!we(n=Re(r,e)))return n;throw ke("Can't convert object to primitive value")},ut=TypeError,lt=nt("toPrimitive"),dt=function(e,t){if(!ot(e)||st(e))return e;var r,n=at(e,lt);if(n){if(void 0===t&&(t="default"),r=it(n,e,t),!ot(r)||st(r))return r;throw ut("Can't convert object to primitive value")}return void 0===t&&(t="number"),ct(e,t)},pt=me,ft=function(e){var t=dt(e,"string");return pt(t)?t:t+""},ht=H,vt=f.document,mt=ht(vt)&&ht(vt.createElement),yt=function(e){return mt?vt.createElement(e):{}},gt=yt,bt=!T&&!n((function(){return 7!=Object.defineProperty(gt("div"),"a",{get:function(){return 7}}).a})),Ct=T,Tt=E,St=R,_t=D,Et=G,Rt=ft,Pt=Be,wt=bt,kt=Object.getOwnPropertyDescriptor;C.f=Ct?kt:function(e,t){if(e=Et(e),t=Rt(t),wt)try{return kt(e,t)}catch(e){}if(Pt(e,t))return _t(!Tt(St.f,e,t),e[t])};var At=n,Ot=b,Dt=/#|\.prototype\./,Lt=function(e,t){var r=It[Mt(e)];return r==Nt||r!=xt&&(Ot(t)?At(t):!!t)},Mt=Lt.normalize=function(e){return String(e).replace(Dt,".").toLowerCase()},It=Lt.data={},xt=Lt.NATIVE="N",Nt=Lt.POLYFILL="P",Ft=Lt,Ut=Se,Vt=i,jt=l(l.bind),Bt=function(e,t){return Ut(e),void 0===t?e:Vt?jt(e,t):function(){return e.apply(t,arguments)}},Wt={},Yt=T&&n((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),qt=H,Gt=String,zt=TypeError,Ht=function(e){if(qt(e))return e;throw zt(Gt(e)+" is not an object")},Qt=T,Kt=bt,Jt=Yt,Zt=Ht,Xt=ft,$t=TypeError,er=Object.defineProperty,tr=Object.getOwnPropertyDescriptor,rr="enumerable",nr="configurable",ir="writable";Wt.f=Qt?Jt?function(e,t,r){if(Zt(e),t=Xt(t),Zt(r),"function"==typeof e&&"prototype"===t&&"value"in r&&ir in r&&!r.writable){var n=tr(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:nr in r?r.configurable:n.configurable,enumerable:rr in r?r.enumerable:n.enumerable,writable:!1})}return er(e,t,r)}:er:function(e,t,r){if(Zt(e),t=Xt(t),Zt(r),Kt)try{return er(e,t,r)}catch(e){}if("get"in r||"set"in r)throw $t("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var or=Wt,sr=D,ar=T?function(e,t,r){return or.f(e,t,sr(1,r))}:function(e,t,r){return e[t]=r,e},cr=f,ur=g,lr=l,dr=b,pr=C.f,fr=Ft,hr=Q,vr=Bt,mr=ar,yr=Be,gr=function(e){var t=function(r,n,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,i)}return ur(e,this,arguments)};return t.prototype=e.prototype,t},br=function(e,t){var r,n,i,o,s,a,c,u,l=e.target,d=e.global,p=e.stat,f=e.proto,h=d?cr:p?cr[l]:(cr[l]||{}).prototype,v=d?hr:hr[l]||mr(hr,l,{})[l],m=v.prototype;for(i in t)r=!fr(d?i:l+(p?".":"#")+i,e.forced)&&h&&yr(h,i),s=v[i],r&&(a=e.dontCallGetSet?(u=pr(h,i))&&u.value:h[i]),o=r&&a?a:t[i],r&&typeof s==typeof o||(c=e.bind&&r?vr(o,cr):e.wrap&&r?gr(o):f&&dr(o)?lr(o):o,(e.sham||o&&o.sham||s&&s.sham)&&mr(c,"sham",!0),mr(v,i,c),f&&(yr(hr,n=l+"Prototype")||mr(hr,n,{}),mr(hr[n],i,o),e.real&&m&&!m[i]&&mr(m,i,o)))},Cr=l([].slice),Tr=l,Sr=Se,_r=H,Er=Be,Rr=Cr,Pr=i,wr=Function,kr=Tr([].concat),Ar=Tr([].join),Or={},Dr=function(e,t,r){if(!Er(Or,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";Or[t]=wr("C,a","return new C("+Ar(n,",")+")")}return Or[t](e,r)},Lr=Pr?wr.bind:function(e){var t=Sr(this),r=t.prototype,n=Rr(arguments,1),i=function(){var r=kr(n,Rr(arguments));return this instanceof i?Dr(t,r.length,r):t.apply(e,r)};return _r(r)&&(i.prototype=r),i},Mr=Lr;br({target:"Function",proto:!0,forced:Function.bind!==Mr},{bind:Mr});var Ir=Q,xr=function(e){return Ir[e+"Prototype"]},Nr=xr("Function").bind,Fr=d,Ur=Nr,Vr=Function.prototype,jr=function(e){var t=e.bind;return e===Vr||Fr(Vr,e)&&t===Vr.bind?Ur:t},Br=Math.ceil,Wr=Math.floor,Yr=Math.trunc||function(e){var t=+e;return(t>0?Wr:Br)(t)},qr=function(e){var t=+e;return t!=t||0===t?0:Yr(t)},Gr=qr,zr=Math.max,Hr=Math.min,Qr=function(e,t){var r=Gr(e);return r<0?zr(r+t,0):Hr(r,t)},Kr=qr,Jr=Math.min,Zr=function(e){return e>0?Jr(Kr(e),9007199254740991):0},Xr=Zr,$r=function(e){return Xr(e.length)},en=G,tn=Qr,rn=$r,nn=function(e){return function(t,r,n){var i,o=en(t),s=rn(o),a=tn(n,s);if(e&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},on={includes:nn(!0),indexOf:nn(!1)},sn=on.includes;br({target:"Array",proto:!0,forced:n((function(){return!Array(1).includes()}))},{includes:function(e){return sn(this,e,arguments.length>1?arguments[1]:void 0)}});var an=xr("Array").includes,cn=H,un=x,ln=nt("match"),dn=function(e){var t;return cn(e)&&(void 0!==(t=e[ln])?!!t:"RegExp"==un(e))},pn=TypeError,fn=function(e){if(dn(e))throw pn("The method doesn't accept regular expressions");return e},hn={};hn[nt("toStringTag")]="z";var vn="[object z]"===String(hn),mn=vn,yn=b,gn=x,bn=nt("toStringTag"),Cn=Object,Tn="Arguments"==gn(function(){return arguments}()),Sn=mn?gn:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Cn(e),bn))?r:Tn?gn(t):"Object"==(n=gn(t))&&yn(t.callee)?"Arguments":n},_n=Sn,En=String,Rn=function(e){if("Symbol"===_n(e))throw TypeError("Cannot convert a Symbol value to a string");return En(e)},Pn=nt("match"),wn=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[Pn]=!1,"/./"[e](t)}catch(e){}}return!1},kn=br,An=fn,On=W,Dn=Rn,Ln=wn,Mn=l("".indexOf);kn({target:"String",proto:!0,forced:!Ln("includes")},{includes:function(e){return!!~Mn(Dn(On(this)),Dn(An(e)),arguments.length>1?arguments[1]:void 0)}});var In=xr("String").includes,xn=d,Nn=an,Fn=In,Un=Array.prototype,Vn=String.prototype,jn=function(e){var t=e.includes;return e===Un||xn(Un,e)&&t===Un.includes?Nn:"string"==typeof e||e===Vn||xn(Vn,e)&&t===Vn.includes?Fn:t},Bn={},Wn=b,Yn=Ie,qn=l(Function.toString);Wn(Yn.inspectSource)||(Yn.inspectSource=function(e){return qn(e)});var Gn,zn,Hn,Qn=Yn.inspectSource,Kn=b,Jn=Qn,Zn=f.WeakMap,Xn=Kn(Zn)&&/native code/.test(Jn(Zn)),$n=Ae.exports,ei=ze,ti=$n("keys"),ri=function(e){return ti[e]||(ti[e]=ei(e))},ni={},ii=Xn,oi=f,si=l,ai=H,ci=ar,ui=Be,li=Ie,di=ri,pi=ni,fi="Object already initialized",hi=oi.TypeError,vi=oi.WeakMap;if(ii||li.state){var mi=li.state||(li.state=new vi),yi=si(mi.get),gi=si(mi.has),bi=si(mi.set);Gn=function(e,t){if(gi(mi,e))throw new hi(fi);return t.facade=e,bi(mi,e,t),t},zn=function(e){return yi(mi,e)||{}},Hn=function(e){return gi(mi,e)}}else{var Ci=di("state");pi[Ci]=!0,Gn=function(e,t){if(ui(e,Ci))throw new hi(fi);return t.facade=e,ci(e,Ci,t),t},zn=function(e){return ui(e,Ci)?e[Ci]:{}},Hn=function(e){return ui(e,Ci)}}var Ti={set:Gn,get:zn,has:Hn,enforce:function(e){return Hn(e)?zn(e):Gn(e,{})},getterFor:function(e){return function(t){var r;if(!ai(t)||(r=zn(t)).type!==e)throw hi("Incompatible receiver, "+e+" required");return r}}},Si=T,_i=Be,Ei=Function.prototype,Ri=Si&&Object.getOwnPropertyDescriptor,Pi=_i(Ei,"name"),wi={EXISTS:Pi,PROPER:Pi&&"something"===function(){}.name,CONFIGURABLE:Pi&&(!Si||Si&&Ri(Ei,"name").configurable)},ki={},Ai=Be,Oi=G,Di=on.indexOf,Li=ni,Mi=l([].push),Ii=function(e,t){var r,n=Oi(e),i=0,o=[];for(r in n)!Ai(Li,r)&&Ai(n,r)&&Mi(o,r);for(;t.length>i;)Ai(n,r=t[i++])&&(~Di(o,r)||Mi(o,r));return o},xi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ni=Ii,Fi=xi,Ui=Object.keys||function(e){return Ni(e,Fi)},Vi=T,ji=Yt,Bi=Wt,Wi=Ht,Yi=G,qi=Ui;ki.f=Vi&&!ji?Object.defineProperties:function(e,t){Wi(e);for(var r,n=Yi(t),i=qi(t),o=i.length,s=0;o>s;)Bi.f(e,r=i[s++],n[r]);return e};var Gi,zi=$("document","documentElement"),Hi=Ht,Qi=ki,Ki=xi,Ji=ni,Zi=zi,Xi=yt,$i=ri("IE_PROTO"),eo=function(){},to=function(e){return"<script>"+e+"</"+"script>"},ro=function(e){e.write(to("")),e.close();var t=e.parentWindow.Object;return e=null,t},no=function(){try{Gi=new ActiveXObject("htmlfile")}catch(e){}var e,t;no="undefined"!=typeof document?document.domain&&Gi?ro(Gi):((t=Xi("iframe")).style.display="none",Zi.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(to("document.F=Object")),e.close(),e.F):ro(Gi);for(var r=Ki.length;r--;)delete no.prototype[Ki[r]];return no()};Ji[$i]=!0;var io,oo,so,ao=Object.create||function(e,t){var r;return null!==e?(eo.prototype=Hi(e),r=new eo,eo.prototype=null,r[$i]=e):r=no(),void 0===t?r:Qi.f(r,t)},co=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),uo=Be,lo=b,po=Ue,fo=co,ho=ri("IE_PROTO"),vo=Object,mo=vo.prototype,yo=fo?vo.getPrototypeOf:function(e){var t=po(e);if(uo(t,ho))return t[ho];var r=t.constructor;return lo(r)&&t instanceof r?r.prototype:t instanceof vo?mo:null},go=ar,bo=function(e,t,r,n){return n&&n.enumerable?e[t]=r:go(e,t,r),e},Co=n,To=b,So=ao,_o=yo,Eo=bo,Ro=nt("iterator"),Po=!1;[].keys&&("next"in(so=[].keys())?(oo=_o(_o(so)))!==Object.prototype&&(io=oo):Po=!0);var wo=null==io||Co((function(){var e={};return io[Ro].call(e)!==e}));To((io=wo?{}:So(io))[Ro])||Eo(io,Ro,(function(){return this}));var ko={IteratorPrototype:io,BUGGY_SAFARI_ITERATORS:Po},Ao=Sn,Oo=vn?{}.toString:function(){return"[object "+Ao(this)+"]"},Do=vn,Lo=Wt.f,Mo=ar,Io=Be,xo=Oo,No=nt("toStringTag"),Fo=function(e,t,r,n){if(e){var i=r?e:e.prototype;Io(i,No)||Lo(i,No,{configurable:!0,value:t}),n&&!Do&&Mo(i,"toString",xo)}},Uo=ko.IteratorPrototype,Vo=ao,jo=D,Bo=Fo,Wo=Bn,Yo=function(){return this},qo=b,Go=String,zo=TypeError,Ho=l,Qo=Ht,Ko=function(e){if("object"==typeof e||qo(e))return e;throw zo("Can't set "+Go(e)+" as a prototype")},Jo=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Ho(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return Qo(r),Ko(n),t?e(r,n):r.__proto__=n,r}}():void 0),Zo=br,Xo=E,$o=function(e,t,r,n){var i=t+" Iterator";return e.prototype=Vo(Uo,{next:jo(+!n,r)}),Bo(e,i,!1,!0),Wo[i]=Yo,e},es=yo,ts=Fo,rs=bo,ns=Bn,is=wi.PROPER,os=ko.BUGGY_SAFARI_ITERATORS,ss=nt("iterator"),as="keys",cs="values",us="entries",ls=function(){return this},ds=function(e,t,r,n,i,o,s){$o(r,t,n);var a,c,u,l=function(e){if(e===i&&v)return v;if(!os&&e in f)return f[e];switch(e){case as:case cs:case us:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",p=!1,f=e.prototype,h=f[ss]||f["@@iterator"]||i&&f[i],v=!os&&h||l(i),m="Array"==t&&f.entries||h;if(m&&(a=es(m.call(new e)))!==Object.prototype&&a.next&&(ts(a,d,!0,!0),ns[d]=ls),is&&i==cs&&h&&h.name!==cs&&(p=!0,v=function(){return Xo(h,this)}),i)if(c={values:l(cs),keys:o?v:l(as),entries:l(us)},s)for(u in c)(os||p||!(u in f))&&rs(f,u,c[u]);else Zo({target:t,proto:!0,forced:os||p},c);return s&&f[ss]!==v&&rs(f,ss,v,{name:i}),ns[t]=v,c},ps=G,fs=Bn,hs=Ti;Wt.f;var vs=ds,ms="Array Iterator",ys=hs.set,gs=hs.getterFor(ms);vs(Array,"Array",(function(e,t){ys(this,{type:ms,target:ps(e),index:0,kind:t})}),(function(){var e=gs(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),fs.Arguments=fs.Array;var bs={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},Cs=f,Ts=Sn,Ss=ar,_s=Bn,Es=nt("toStringTag");for(var Rs in bs){var Ps=Cs[Rs],ws=Ps&&Ps.prototype;ws&&Ts(ws)!==Es&&Ss(ws,Es,Rs),_s[Rs]=_s.Array}var ks=x,As=Array.isArray||function(e){return"Array"==ks(e)},Os=l,Ds=n,Ls=b,Ms=Sn,Is=Qn,xs=function(){},Ns=[],Fs=$("Reflect","construct"),Us=/^\s*(?:class|function)\b/,Vs=Os(Us.exec),js=!Us.exec(xs),Bs=function(e){if(!Ls(e))return!1;try{return Fs(xs,Ns,e),!0}catch(e){return!1}},Ws=function(e){if(!Ls(e))return!1;switch(Ms(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return js||!!Vs(Us,Is(e))}catch(e){return!0}};Ws.sham=!0;var Ys=!Fs||Ds((function(){var e;return Bs(Bs.call)||!Bs(Object)||!Bs((function(){e=!0}))||e}))?Ws:Bs,qs=As,Gs=Ys,zs=H,Hs=nt("species"),Qs=Array,Ks=function(e){var t;return qs(e)&&(t=e.constructor,(Gs(t)&&(t===Qs||qs(t.prototype))||zs(t)&&null===(t=t[Hs]))&&(t=void 0)),void 0===t?Qs:t},Js=function(e,t){return new(Ks(e))(0===t?0:t)},Zs=Bt,Xs=j,$s=Ue,ea=$r,ta=Js,ra=l([].push),na=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,o=6==e,s=7==e,a=5==e||o;return function(c,u,l,d){for(var p,f,h=$s(c),v=Xs(h),m=Zs(u,l),y=ea(v),g=0,b=d||ta,C=t?b(c,y):r||s?b(c,0):void 0;y>g;g++)if((a||g in v)&&(f=m(p=v[g],g,h),e))if(t)C[g]=f;else if(f)switch(e){case 3:return!0;case 5:return p;case 6:return g;case 2:ra(C,p)}else switch(e){case 4:return!1;case 7:ra(C,p)}return o?-1:n||i?i:C}},ia={forEach:na(0),map:na(1),filter:na(2),some:na(3),every:na(4),find:na(5),findIndex:na(6),filterReject:na(7)},oa=n,sa=function(e,t){var r=[][e];return!!r&&oa((function(){r.call(null,t||function(){return 1},1)}))},aa=ia.forEach,ca=sa("forEach")?[].forEach:function(e){return aa(this,e,arguments.length>1?arguments[1]:void 0)};br({target:"Array",proto:!0,forced:[].forEach!=ca},{forEach:ca});var ua=xr("Array").forEach,la=Sn,da=Be,pa=d,fa=ua,ha=Array.prototype,va={DOMTokenList:!0,NodeList:!0},ma=function(e){var t=e.forEach;return e===ha||pa(ha,e)&&t===ha.forEach||da(va,la(e))?fa:t},ya=TypeError,ga=function(e,t){if(e<t)throw ya("Not enough arguments");return e},ba=f,Ca=g,Ta=b,Sa=Cr,_a=ga,Ea=/MSIE .\./.test(ee),Ra=ba.Function,Pa=function(e){return Ea?function(t,r){var n=_a(arguments.length,1)>2,i=Ta(t)?t:Ra(t),o=n?Sa(arguments,2):void 0;return e(n?function(){Ca(i,this,o)}:i,r)}:e},wa={setTimeout:Pa(ba.setTimeout),setInterval:Pa(ba.setInterval)},ka=wa.setInterval;br({global:!0,bind:!0,forced:f.setInterval!==ka},{setInterval:ka});var Aa=wa.setTimeout;br({global:!0,bind:!0,forced:f.setTimeout!==Aa},{setTimeout:Aa});var Oa=Q.setTimeout,Da=br,La=l,Ma=Zr,Ia=Rn,xa=fn,Na=W,Fa=wn,Ua=La("".startsWith),Va=La("".slice),ja=Math.min;Da({target:"String",proto:!0,forced:!Fa("startsWith")},{startsWith:function(e){var t=Ia(Na(this));xa(e);var r=Ma(ja(arguments.length>1?arguments[1]:void 0,t.length)),n=Ia(e);return Ua?Ua(t,n,r):Va(t,r,r+n.length)===n}});var Ba=xr("String").startsWith,Wa=d,Ya=Ba,qa=String.prototype,Ga=function(e){var t=e.startsWith;return"string"==typeof e||e===qa||Wa(qa,e)&&t===qa.startsWith?Ya:t},za=Q.setInterval,Ha=n,Qa=ae,Ka=nt("species"),Ja=function(e){return Qa>=51||!Ha((function(){var t=[];return(t.constructor={})[Ka]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Za=ia.filter;br({target:"Array",proto:!0,forced:!Ja("filter")},{filter:function(e){return Za(this,e,arguments.length>1?arguments[1]:void 0)}});var Xa=xr("Array").filter,$a=d,ec=Xa,tc=Array.prototype,rc=function(e){var t=e.filter;return e===tc||$a(tc,e)&&t===tc.filter?ec:t},nc=function(e,t){return nc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},nc(e,t)};function ic(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}nc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var oc=function(){return oc=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},oc.apply(this,arguments)};function sc(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function ac(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function cc(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function uc(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function lc(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function dc(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}let pc=!0,fc=!0;function hc(e,t,r){const n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)}function vc(e,t,r){if(!e.RTCPeerConnection)return;const n=e.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=r(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,o),i.apply(this,[e,o])};const o=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(r))return o.apply(this,arguments);const n=this._eventMap[t].get(r);return this._eventMap[t].delete(r),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function mc(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(pc=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function yc(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(fc=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function gc(){if("object"==typeof window){if(pc)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function bc(e,t){fc&&console.warn(e+" is deprecated, please use "+t+" instead.")}function Cc(e){return"[object Object]"===Object.prototype.toString.call(e)}function Tc(e){return Cc(e)?Object.keys(e).reduce((function(t,r){const n=Cc(e[r]),i=n?Tc(e[r]):e[r],o=n&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[r]:i})}),{}):e}function Sc(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((n=>{n.endsWith("Id")?Sc(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((t=>{Sc(e,e.get(t),r)}))})))}function _c(e,t,r){const n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((r=>{r.type===n&&r.trackId===t.id&&Sc(e,r,i)}))})),i}const Ec=gc;function Rc(e,t){const r=e&&e.navigator;if(!r.mediaDevices)return;const n=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((r=>{if("require"===r||"advanced"===r||"mediaSource"===r)return;const n="object"==typeof e[r]?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];let e={};"number"==typeof n.ideal?(e[i("min",r)]=n.ideal,t.optional.push(e),e={},e[i("max",r)]=n.ideal,t.optional.push(e)):(e[i("",r)]=n.ideal,t.optional.push(e))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach((e=>{void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||s)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return r.mediaDevices.enumerateDevices().then((r=>{let s=(r=r.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!s&&r.length&&t.includes("back")&&(s=r[r.length-1]),s&&(e.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=n(e.video),Ec("chrome: "+JSON.stringify(e)),i(e)}))}e.video=n(e.video)}return Ec("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(r.getUserMedia=function(e,t,n){i(e,(e=>{r.webkitGetUserMedia(e,t,(e=>{n&&n(o(e))}))}))}.bind(r),r.mediaDevices.getUserMedia){const e=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(t){return i(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(o(e))))))}}}function Pc(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function wc(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.track.id)):{track:r.track};const i=new Event("track");i.track=r.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)})),t.stream.getTracks().forEach((r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.id)):{track:r};const i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else vc(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function kc(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){let i=r.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Ac(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,n]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach((e=>{const r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{r[t]=e.stat(t)})),t[r.id]=r})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const n=function(e){r(o(i(e)))};return t.apply(this,[n,e])}return new Promise(((e,r)=>{t.apply(this,[function(t){e(o(i(t)))},r])})).then(r,n)}}function Oc(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>_c(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),vc(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>_c(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,r,n;return this.getSenders().forEach((r=>{r.track===e&&(t?n=!0:t=r)})),this.getReceivers().forEach((t=>(t.track===e&&(r?n=!0:r=t),t.track===e))),n||t&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Dc(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();r.apply(this,arguments);const n=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(n)};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const r=this._shimmedLocalStreams[t].indexOf(e);-1!==r&&this._shimmedLocalStreams[t].splice(r,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),i.apply(this,arguments)}}function Lc(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Dc(e);const r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=r.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const r=new e.MediaStream(t.getTracks());this._streams[t.id]=r,this._reverseStreams[r.id]=t,t=r}n.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}function s(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:r})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,r){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const i=this.getSenders().find((e=>e.track===t));if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[r.id];if(o)o.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new e.MediaStream([t]);this._streams[r.id]=n,this._reverseStreams[n.id]=r,this.addStream(n)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[t=>{const r=o(this,t);e[0].apply(null,[r])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):r.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=n[t]}));const a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=s(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((r=>{this._streams[r].getTracks().find((t=>e.track===t))&&(t=this._streams[r])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Mc(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}))}function Ic(e,t){vc(e,"negotiationneeded",(e=>{const r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))}var xc=Object.freeze({__proto__:null,shimMediaStream:Pc,shimOnTrack:wc,shimGetSendersWithDtmf:kc,shimGetStats:Ac,shimSenderReceiverGetStats:Oc,shimAddTrackRemoveTrackWithNative:Dc,shimAddTrackRemoveTrack:Lc,shimPeerConnection:Mc,fixNegotiationNeeded:Ic,shimGetUserMedia:Rc,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then((t=>{const n=r.video&&r.video.width,i=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(r.video.mandatory.maxWidth=n),i&&(r.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}});function Nc(e,t){const r=e&&e.navigator,n=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,n){bc("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const e=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},t=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(r){return"object"==typeof r&&"object"==typeof r.audio&&(r=JSON.parse(JSON.stringify(r)),e(r.audio,"autoGainControl","mozAutoGainControl"),e(r.audio,"noiseSuppression","mozNoiseSuppression")),t(r)},n&&n.prototype.getSettings){const t=n.prototype.getSettings;n.prototype.getSettings=function(){const r=t.apply(this,arguments);return e(r,"mozAutoGainControl","autoGainControl"),e(r,"mozNoiseSuppression","noiseSuppression"),r}}if(n&&n.prototype.applyConstraints){const t=n.prototype.applyConstraints;n.prototype.applyConstraints=function(r){return"audio"===this.kind&&"object"==typeof r&&(r=JSON.parse(JSON.stringify(r)),e(r,"autoGainControl","mozAutoGainControl"),e(r,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[r])}}}}function Fc(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Uc(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}));const r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return n.apply(this,[e||null]).then((e=>{if(t.version<53&&!i)try{e.forEach((e=>{e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,n)=>{e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(i,o)}}function Vc(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function jc(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),vc(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Bc(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){bc("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function Wc(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function Yc(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const r=e.length>0;r&&e.forEach((e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const n=t.apply(this,arguments);if(r){const{sender:t}=n,r=t.getParameters();(!("encodings"in r)||1===r.encodings.length&&0===Object.keys(r.encodings[0]).length)&&(r.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(r).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return n})}function qc(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function Gc(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function zc(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var Hc=Object.freeze({__proto__:null,shimOnTrack:Fc,shimPeerConnection:Uc,shimSenderGetStats:Vc,shimReceiverGetStats:jc,shimRemoveStream:Bc,shimRTCDataChannel:Wc,shimAddTransceiver:Yc,shimGetParameters:qc,shimCreateOffer:Gc,shimCreateAnswer:zc,shimGetUserMedia:Nc,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}});function Qc(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((r=>t.call(this,r,e))),e.getVideoTracks().forEach((r=>t.call(this,r,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...r){return r&&r.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const r=e.getTracks();this.getSenders().forEach((e=>{r.includes(e.track)&&this.removeTrack(e)}))})}}function Kc(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}))}),t.apply(e,arguments)}}}function Jc(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,r=t.createOffer,n=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i};let a=function(e,t,r){const n=i.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=a,a=function(e,t,r){const n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=a,a=function(e,t,r){const n=s.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=a}function Zc(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,r=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>r(Xc(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))}function Xc(e){return e&&void 0!==e.video?Object.assign({},e,{video:Tc(e.video)}):e}function $c(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){const t=[];for(let r=0;r<e.iceServers.length;r++){let n=e.iceServers[r];void 0===n.urls&&n.url?(bc("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,t.push(n)):t.push(e.iceServers[r])}e.iceServers=t}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function eu(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function tu(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const r=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function ru(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var nu=Object.freeze({__proto__:null,shimLocalStreamsAPI:Qc,shimRemoteStreamsAPI:Kc,shimCallbacksAPI:Jc,shimGetUserMedia:Zc,shimConstraints:Xc,shimRTCIceServerUrls:$c,shimTrackEventTransceiver:eu,shimCreateOfferLegacy:tu,shimAudioContext:ru}),iu={exports:{}};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const r=t.splitSections(e);return r&&r[0]},t.getMediaSections=function(e){const r=t.splitSections(e);return r.shift(),r},t.matchPrefix=function(e,r){return t.splitLines(e).filter((e=>0===e.indexOf(r)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const r={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":r.relatedAddress=t[e+1];break;case"rport":r.relatedPort=parseInt(t[e+1],10);break;case"tcptype":r.tcpType=t[e+1];break;case"ufrag":r.ufrag=t[e+1],r.usernameFragment=t[e+1];break;default:void 0===r[t[e]]&&(r[t[e]]=t[e+1])}return r},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const r=e.component;"rtp"===r?t.push(1):"rtcp"===r?t.push(2):t.push(r),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let r;const n=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<n.length;e++)r=n[e].trim().split("="),t[r[0].trim()]=r[1];return t},t.writeFmtp=function(e){let t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const n=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),r={ssrc:parseInt(e.substring(7,t),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substring(t+1,n),r.value=e.substring(n+1)):r.attribute=e.substring(t+1),r},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const r=t.matchPrefix(e,"a=mid:")[0];if(r)return r.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,r){return{role:"auto",fingerprints:t.matchPrefix(e+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,r){return t.matchPrefix(e+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,r){const n=t.matchPrefix(e+r,"a=ice-ufrag:")[0],i=t.matchPrefix(e+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" ");r.profile=n[2];for(let i=3;i<n.length;i++){const o=n[i],s=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){const n=t.parseRtpMap(s),i=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(n.parameters=i.length?t.parseFmtp(i[0]):{},n.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{r.headerExtensions.push(t.parseExtmap(e))}));const i=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return r.codecs.forEach((e=>{i.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),r},t.writeRtpDescription=function(e,r){let n="";n+="m="+e+" ",n+=r.codecs.length>0?"9":"0",n+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=r.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach((e=>{n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));let i=0;return r.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((e=>{n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){const r=[],n=t.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),s=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),a=s.length>0&&s[0].ssrc;let c;const u=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));u.length>0&&u[0].length>1&&u[0][0]===a&&(c=u[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:a,codecPayloadType:parseInt(e.parameters.apt,10)};a&&c&&(t.rtx={ssrc:c}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&a&&r.push({ssrc:a});let l=t.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substring(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substring(5),10)*.95-16e3:void 0,r.forEach((e=>{e.maxBitrate=l}))),r},t.parseRtcpParameters=function(e){const r={},n=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return r.mux=o.length>0,r},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let r;const n=t.matchPrefix(e,"a=msid:");if(1===n.length)return r=n[0].substring(7).split(" "),{stream:r[0],track:r[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(e){const r=t.parseMLine(e),n=t.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substring(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:r.fmt,maxMessageSize:i};const s=t.matchPrefix(e,"a=sctpmap:");if(s.length>0){const e=s[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,r,n){let i;const o=void 0!==r?r:2;i=e||t.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,r){const n=t.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const r=t.splitLines(e)[0].substring(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(e){const r=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const r=t.splitLines(e);for(let e=0;e<r.length;e++)if(r[e].length<2||"="!==r[e].charAt(1))return!1;return!0},e.exports=t}(iu);var ou=iu.exports,su=Object.freeze(e({__proto__:null,default:ou},[iu.exports]));function au(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substring(2)),e.candidate&&e.candidate.length){const r=new t(e),n=ou.parseCandidate(e.candidate),i=Object.assign(r,n);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,vc(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function cu(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||vc(e,"icecandidate",(e=>{if(e.candidate){const t=ou.parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function uu(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const r=function(e){if(!e||!e.sdp)return!1;const t=ou.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=ou.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},n=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const r=parseInt(t[1],10);return r!=r?-1:r},i=function(e){let r=65536;return"firefox"===t.browser&&(r=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),r},o=function(e,r){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const i=ou.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substring(19),10):"firefox"===t.browser&&-1!==r&&(n=2147483637),n},s=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(r(arguments[0])){const e=n(arguments[0]),t=i(e),r=o(arguments[0],e);let s;s=0===t&&0===r?Number.POSITIVE_INFINITY:0===t||0===r?Math.max(t,r):Math.min(t,r);const a={};Object.defineProperty(a,"maxMessageSize",{get:()=>s}),this._sctp=a}return s.apply(this,arguments)}}function lu(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const r=e.send;e.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}const r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=r.apply(this,arguments);return t(e,this),e},vc(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function du(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const r=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}function pu(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const r=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:r}):t.sdp=r}return r.apply(this,arguments)}}function fu(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function hu(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.setLocalDescription;r&&0!==r.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return r.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return r.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then((e=>r.apply(this,[e])))})}var vu=Object.freeze({__proto__:null,shimRTCIceCandidate:au,shimRTCIceCandidateRelayProtocol:cu,shimMaxMessageSize:uu,shimSendThrowTypeError:lu,shimConnectionState:du,removeExtmapAllowMixed:pu,shimAddIceCandidateNullOrEmpty:fu,shimParameterlessSetLocalDescription:hu});const mu=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=gc,n=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:r}=e;if(r.mozGetUserMedia)t.browser="firefox",t.version=hc(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=hc(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=hc(r.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),i={browserDetails:n,commonShim:vu,extractVersion:hc,disableLog:mc,disableWarnings:yc,sdp:su};switch(n.browser){case"chrome":if(!xc||!Mc||!t.shimChrome)return r("Chrome shim is not included in this adapter release."),i;if(null===n.version)return r("Chrome shim can not determine version, not shimming."),i;r("adapter.js shimming chrome."),i.browserShim=xc,fu(e,n),hu(e),Rc(e,n),Pc(e),Mc(e,n),wc(e),Lc(e,n),kc(e),Ac(e),Oc(e),Ic(e,n),au(e),cu(e),du(e),uu(e,n),lu(e),pu(e,n);break;case"firefox":if(!Hc||!Uc||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),i;r("adapter.js shimming firefox."),i.browserShim=Hc,fu(e,n),hu(e),Nc(e,n),Uc(e,n),Fc(e),Bc(e),Vc(e),jc(e),Wc(e),Yc(e),qc(e),Gc(e),zc(e),au(e),du(e),uu(e,n),lu(e);break;case"safari":if(!nu||!t.shimSafari)return r("Safari shim is not included in this adapter release."),i;r("adapter.js shimming safari."),i.browserShim=nu,fu(e,n),hu(e),$c(e),tu(e),Jc(e),Qc(e),Kc(e),eu(e),Zc(e),ru(e),au(e),cu(e),uu(e,n),lu(e),pu(e,n);break;default:r("Unsupported browser!")}return i}({window:"undefined"==typeof window?void 0:window});let yu=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"");var gu={exports:{}};!function(e,t){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(r),s=Math.max(i,o),a=0,c=e.map([t,r],(function(t){var r=s-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(c[0][s]>c[1][s])return 1;if(c[0][s]===c[1][s]){if(s===a)return 0;s-=1}else if(c[0][s]<c[1][s])return-1}},e.map=function(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n},e.find=function(e,t){var r,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,n=e.length;r<n;r+=1){var i=e[r];if(t(i,r))return i}},e.assign=function(e){for(var t,r,n=e,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var a=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){n[t]=e[t]}))};for(t=0,r=o.length;t<r;t+=1)a();return e},e.getBrowserAlias=function(e){return n.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return n.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,r){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,r){t.__esModule=!0,t.default=void 0;var n,i=(n=r(91))&&n.__esModule?n:{default:n},o=r(18);function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=function(){function e(){}var t,r,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,n=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],(r=null)&&s(t.prototype,r),n&&s(t,n),e}();t.default=a,e.exports=t.default},91:function(e,t,r){t.__esModule=!0,t.default=void 0;var n=c(r(92)),i=c(r(93)),o=c(r(94)),s=c(r(95)),a=c(r(17));function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},n=0,i={},o=0;if(Object.keys(e).forEach((function(t){var s=e[t];"string"==typeof s?(i[t]=s,o+=1):"object"==typeof s&&(r[t]=s,n+=1)})),n>0){var s=Object.keys(r),c=a.default.find(s,(function(e){return t.isOS(e)}));if(c){var u=this.satisfies(r[c]);if(void 0!==u)return u}var l=a.default.find(s,(function(e){return t.isPlatform(e)}));if(l){var d=this.satisfies(r[l]);if(void 0!==d)return d}}if(o>0){var p=Object.keys(i),f=a.default.find(p,(function(e){return t.isBrowser(e,!0)}));if(void 0!==f)return this.compareVersion(i[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(a.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,r){t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,r){t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:o.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:o.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:o.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,r){t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,r){t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=s,e.exports=t.default}})}(gu);var bu=r(gu.exports);br({target:"Object",stat:!0,sham:!T},{create:ao});var Cu=Q.Object,Tu=function(e,t){return Cu.create(e,t)},Su=ft,_u=Wt,Eu=D,Ru=function(e,t,r){var n=Su(t);n in e?_u.f(e,n,Eu(0,r)):e[n]=r},Pu=br,wu=As,ku=Ys,Au=H,Ou=Qr,Du=$r,Lu=G,Mu=Ru,Iu=nt,xu=Cr,Nu=Ja("slice"),Fu=Iu("species"),Uu=Array,Vu=Math.max;Pu({target:"Array",proto:!0,forced:!Nu},{slice:function(e,t){var r,n,i,o=Lu(this),s=Du(o),a=Ou(e,s),c=Ou(void 0===t?s:t,s);if(wu(o)&&(r=o.constructor,(ku(r)&&(r===Uu||wu(r.prototype))||Au(r)&&null===(r=r[Fu]))&&(r=void 0),r===Uu||void 0===r))return xu(o,a,c);for(n=new(void 0===r?Uu:r)(Vu(c-a,0)),i=0;a<c;a++,i++)a in o&&Mu(n,i,o[a]);return n.length=i,n}});var ju=xr("Array").slice,Bu=d,Wu=ju,Yu=Array.prototype,qu=function(e){var t=e.slice;return e===Yu||Bu(Yu,e)&&t===Yu.slice?Wu:t},Gu={},zu=Ii,Hu=xi.concat("length","prototype");Gu.f=Object.getOwnPropertyNames||function(e){return zu(e,Hu)};var Qu={},Ku=Qr,Ju=$r,Zu=Ru,Xu=Array,$u=Math.max,el=x,tl=G,rl=Gu.f,nl=function(e,t,r){for(var n=Ju(e),i=Ku(t,n),o=Ku(void 0===r?n:r,n),s=Xu($u(o-i,0)),a=0;i<o;i++,a++)Zu(s,a,e[i]);return s.length=a,s},il="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Qu.f=function(e){return il&&"Window"==el(e)?function(e){try{return rl(e)}catch(e){return nl(il)}}(e):rl(tl(e))};var ol={};ol.f=Object.getOwnPropertySymbols;var sl={},al=nt;sl.f=al;var cl=Q,ul=Be,ll=sl,dl=Wt.f,pl=E,fl=$,hl=nt,vl=bo,ml=br,yl=f,gl=E,bl=l,Cl=T,Tl=le,Sl=n,_l=Be,El=d,Rl=Ht,Pl=G,wl=ft,kl=Rn,Al=D,Ol=ao,Dl=Ui,Ll=Gu,Ml=Qu,Il=ol,xl=C,Nl=Wt,Fl=ki,Ul=R,Vl=bo,jl=Ae.exports,Bl=ni,Wl=ze,Yl=nt,ql=sl,Gl=function(e){var t=cl.Symbol||(cl.Symbol={});ul(t,e)||dl(t,e,{value:ll.f(e)})},zl=function(){var e=fl("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=hl("toPrimitive");t&&!t[n]&&vl(t,n,(function(e){return pl(r,this)}),{arity:1})},Hl=Fo,Ql=Ti,Kl=ia.forEach,Jl=ri("hidden"),Zl="Symbol",Xl=Ql.set,$l=Ql.getterFor(Zl),ed=Object.prototype,td=yl.Symbol,rd=td&&td.prototype,nd=yl.TypeError,id=yl.QObject,od=xl.f,sd=Nl.f,ad=Ml.f,cd=Ul.f,ud=bl([].push),ld=jl("symbols"),dd=jl("op-symbols"),pd=jl("wks"),fd=!id||!id.prototype||!id.prototype.findChild,hd=Cl&&Sl((function(){return 7!=Ol(sd({},"a",{get:function(){return sd(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=od(ed,t);n&&delete ed[t],sd(e,t,r),n&&e!==ed&&sd(ed,t,n)}:sd,vd=function(e,t){var r=ld[e]=Ol(rd);return Xl(r,{type:Zl,tag:e,description:t}),Cl||(r.description=t),r},md=function(e,t,r){e===ed&&md(dd,t,r),Rl(e);var n=wl(t);return Rl(r),_l(ld,n)?(r.enumerable?(_l(e,Jl)&&e[Jl][n]&&(e[Jl][n]=!1),r=Ol(r,{enumerable:Al(0,!1)})):(_l(e,Jl)||sd(e,Jl,Al(1,{})),e[Jl][n]=!0),hd(e,n,r)):sd(e,n,r)},yd=function(e,t){Rl(e);var r=Pl(t),n=Dl(r).concat(Td(r));return Kl(n,(function(t){Cl&&!gl(gd,r,t)||md(e,t,r[t])})),e},gd=function(e){var t=wl(e),r=gl(cd,this,t);return!(this===ed&&_l(ld,t)&&!_l(dd,t))&&(!(r||!_l(this,t)||!_l(ld,t)||_l(this,Jl)&&this[Jl][t])||r)},bd=function(e,t){var r=Pl(e),n=wl(t);if(r!==ed||!_l(ld,n)||_l(dd,n)){var i=od(r,n);return!i||!_l(ld,n)||_l(r,Jl)&&r[Jl][n]||(i.enumerable=!0),i}},Cd=function(e){var t=ad(Pl(e)),r=[];return Kl(t,(function(e){_l(ld,e)||_l(Bl,e)||ud(r,e)})),r},Td=function(e){var t=e===ed,r=ad(t?dd:Pl(e)),n=[];return Kl(r,(function(e){!_l(ld,e)||t&&!_l(ed,e)||ud(n,ld[e])})),n};Tl||(td=function(){if(El(rd,this))throw nd("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?kl(arguments[0]):void 0,t=Wl(e),r=function(e){this===ed&&gl(r,dd,e),_l(this,Jl)&&_l(this[Jl],t)&&(this[Jl][t]=!1),hd(this,t,Al(1,e))};return Cl&&fd&&hd(ed,t,{configurable:!0,set:r}),vd(t,e)},Vl(rd=td.prototype,"toString",(function(){return $l(this).tag})),Vl(td,"withoutSetter",(function(e){return vd(Wl(e),e)})),Ul.f=gd,Nl.f=md,Fl.f=yd,xl.f=bd,Ll.f=Ml.f=Cd,Il.f=Td,ql.f=function(e){return vd(Yl(e),e)},Cl&&sd(rd,"description",{configurable:!0,get:function(){return $l(this).description}})),ml({global:!0,constructor:!0,wrap:!0,forced:!Tl,sham:!Tl},{Symbol:td}),Kl(Dl(pd),(function(e){Gl(e)})),ml({target:Zl,stat:!0,forced:!Tl},{useSetter:function(){fd=!0},useSimple:function(){fd=!1}}),ml({target:"Object",stat:!0,forced:!Tl,sham:!Cl},{create:function(e,t){return void 0===t?Ol(e):yd(Ol(e),t)},defineProperty:md,defineProperties:yd,getOwnPropertyDescriptor:bd}),ml({target:"Object",stat:!0,forced:!Tl},{getOwnPropertyNames:Cd}),zl(),Hl(td,Zl),Bl[Jl]=!0;var Sd=le&&!!Symbol.for&&!!Symbol.keyFor,_d=br,Ed=$,Rd=Be,Pd=Rn,wd=Ae.exports,kd=Sd,Ad=wd("string-to-symbol-registry"),Od=wd("symbol-to-string-registry");_d({target:"Symbol",stat:!0,forced:!kd},{for:function(e){var t=Pd(e);if(Rd(Ad,t))return Ad[t];var r=Ed("Symbol")(t);return Ad[t]=r,Od[r]=t,r}});var Dd=br,Ld=Be,Md=me,Id=ge,xd=Sd,Nd=(0,Ae.exports)("symbol-to-string-registry");Dd({target:"Symbol",stat:!0,forced:!xd},{keyFor:function(e){if(!Md(e))throw TypeError(Id(e)+" is not a symbol");if(Ld(Nd,e))return Nd[e]}});var Fd=br,Ud=$,Vd=g,jd=E,Bd=l,Wd=n,Yd=As,qd=b,Gd=H,zd=me,Hd=Cr,Qd=le,Kd=Ud("JSON","stringify"),Jd=Bd(/./.exec),Zd=Bd("".charAt),Xd=Bd("".charCodeAt),$d=Bd("".replace),ep=Bd(1..toString),tp=/[\uD800-\uDFFF]/g,rp=/^[\uD800-\uDBFF]$/,np=/^[\uDC00-\uDFFF]$/,ip=!Qd||Wd((function(){var e=Ud("Symbol")();return"[null]"!=Kd([e])||"{}"!=Kd({a:e})||"{}"!=Kd(Object(e))})),op=Wd((function(){return'"\\udf06\\ud834"'!==Kd("\udf06\ud834")||'"\\udead"'!==Kd("\udead")})),sp=function(e,t){var r=Hd(arguments),n=t;if((Gd(t)||void 0!==e)&&!zd(e))return Yd(t)||(t=function(e,t){if(qd(n)&&(t=jd(n,this,e,t)),!zd(t))return t}),r[1]=t,Vd(Kd,null,r)},ap=function(e,t,r){var n=Zd(r,t-1),i=Zd(r,t+1);return Jd(rp,e)&&!Jd(np,i)||Jd(np,e)&&!Jd(rp,n)?"\\u"+ep(Xd(e,0),16):e};Kd&&Fd({target:"JSON",stat:!0,arity:3,forced:ip||op},{stringify:function(e,t,r){var n=Hd(arguments),i=Vd(ip?sp:Kd,null,n);return op&&"string"==typeof i?$d(i,tp,ap):i}});var cp=ol,up=Ue;br({target:"Object",stat:!0,forced:!le||n((function(){cp.f(1)}))},{getOwnPropertySymbols:function(e){var t=cp.f;return t?t(up(e)):[]}});var lp=Q.Object.getOwnPropertySymbols,dp=TypeError,pp=function(e){if(e>9007199254740991)throw dp("Maximum allowed index exceeded");return e},fp=br,hp=n,vp=As,mp=H,yp=Ue,gp=$r,bp=pp,Cp=Ru,Tp=Js,Sp=Ja,_p=ae,Ep=nt("isConcatSpreadable"),Rp=_p>=51||!hp((function(){var e=[];return e[Ep]=!1,e.concat()[0]!==e})),Pp=Sp("concat"),wp=function(e){if(!mp(e))return!1;var t=e[Ep];return void 0!==t?!!t:vp(e)};fp({target:"Array",proto:!0,arity:1,forced:!Rp||!Pp},{concat:function(e){var t,r,n,i,o,s=yp(this),a=Tp(s,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(wp(o=-1===t?s:arguments[t]))for(i=gp(o),bp(c+i),r=0;r<i;r++,c++)r in o&&Cp(a,c,o[r]);else bp(c+1),Cp(a,c++,o);return a.length=c,a}});var kp=xr("Array").concat,Ap=d,Op=kp,Dp=Array.prototype,Lp=function(e){var t=e.concat;return e===Dp||Ap(Dp,e)&&t===Dp.concat?Op:t},Mp={exports:{}},Ip=br,xp=T,Np=Wt.f;Ip({target:"Object",stat:!0,forced:Object.defineProperty!==Np,sham:!xp},{defineProperty:Np});var Fp=Q.Object,Up=Mp.exports=function(e,t,r){return Fp.defineProperty(e,t,r)};Fp.defineProperty.sham&&(Up.sham=!0);var Vp=Mp.exports,jp=Ue,Bp=Ui;br({target:"Object",stat:!0,forced:n((function(){Bp(1)}))},{keys:function(e){return Bp(jp(e))}});var Wp=Q.Object.keys,Yp={exports:{}},qp=br,Gp=n,zp=G,Hp=C.f,Qp=T,Kp=Gp((function(){Hp(1)}));qp({target:"Object",stat:!0,forced:!Qp||Kp,sham:!Qp},{getOwnPropertyDescriptor:function(e,t){return Hp(zp(e),t)}});var Jp=Q.Object,Zp=Yp.exports=function(e,t){return Jp.getOwnPropertyDescriptor(e,t)};Jp.getOwnPropertyDescriptor.sham&&(Zp.sham=!0);var Xp=Yp.exports,$p=$,ef=Gu,tf=ol,rf=Ht,nf=l([].concat),of=$p("Reflect","ownKeys")||function(e){var t=ef.f(rf(e)),r=tf.f;return r?nf(t,r(e)):t},sf=of,af=G,cf=C,uf=Ru;br({target:"Object",stat:!0,sham:!T},{getOwnPropertyDescriptors:function(e){for(var t,r,n=af(e),i=cf.f,o=sf(n),s={},a=0;o.length>a;)void 0!==(r=i(n,t=o[a++]))&&uf(s,t,r);return s}});var lf=Q.Object.getOwnPropertyDescriptors,df={exports:{}},pf=br,ff=T,hf=ki.f;pf({target:"Object",stat:!0,forced:Object.defineProperties!==hf,sham:!ff},{defineProperties:hf});var vf=Q.Object,mf=df.exports=function(e,t){return vf.defineProperties(e,t)};vf.defineProperties.sham&&(mf.sham=!0);var yf=df.exports,gf=g,bf=G,Cf=qr,Tf=$r,Sf=sa,_f=Math.min,Ef=[].lastIndexOf,Rf=!!Ef&&1/[1].lastIndexOf(1,-0)<0,Pf=Sf("lastIndexOf"),wf=Rf||!Pf?function(e){if(Rf)return gf(Ef,this,arguments)||0;var t=bf(this),r=Tf(t),n=r-1;for(arguments.length>1&&(n=_f(n,Cf(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:Ef;br({target:"Array",proto:!0,forced:wf!==[].lastIndexOf},{lastIndexOf:wf});var kf=xr("Array").lastIndexOf,Af=d,Of=kf,Df=Array.prototype,Lf=function(e){var t=e.lastIndexOf;return e===Df||Af(Df,e)&&t===Df.lastIndexOf?Of:t},Mf=br,If=on.indexOf,xf=sa,Nf=l([].indexOf),Ff=!!Nf&&1/Nf([1],1,-0)<0,Uf=xf("indexOf");Mf({target:"Array",proto:!0,forced:Ff||!Uf},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return Ff?Nf(this,e,t)||0:If(this,e,t)}});var Vf=xr("Array").indexOf,jf=d,Bf=Vf,Wf=Array.prototype,Yf=function(e){var t=e.indexOf;return e===Wf||jf(Wf,e)&&t===Wf.indexOf?Bf:t},qf=T,Gf=l,zf=E,Hf=n,Qf=Ui,Kf=ol,Jf=R,Zf=Ue,Xf=j,$f=Object.assign,eh=Object.defineProperty,th=Gf([].concat),rh=!$f||Hf((function(){if(qf&&1!==$f({b:1},$f(eh({},"a",{enumerable:!0,get:function(){eh(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=$f({},e)[r]||Qf($f({},t)).join("")!=n}))?function(e,t){for(var r=Zf(e),n=arguments.length,i=1,o=Kf.f,s=Jf.f;n>i;)for(var a,c=Xf(arguments[i++]),u=o?th(Qf(c),o(c)):Qf(c),l=u.length,d=0;l>d;)a=u[d++],qf&&!zf(s,c,a)||(r[a]=c[a]);return r}:$f,nh=rh;br({target:"Object",stat:!0,arity:2,forced:Object.assign!==nh},{assign:nh});var ih=Q.Object.assign,oh={exports:{}},sh=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),ah=n,ch=H,uh=x,lh=sh,dh=Object.isExtensible,ph=ah((function(){dh(1)}))||lh?function(e){return!!ch(e)&&((!lh||"ArrayBuffer"!=uh(e))&&(!dh||dh(e)))}:dh,fh=!n((function(){return Object.isExtensible(Object.preventExtensions({}))})),hh=br,vh=l,mh=ni,yh=H,gh=Be,bh=Wt.f,Ch=Gu,Th=Qu,Sh=ph,_h=fh,Eh=!1,Rh=ze("meta"),Ph=0,wh=function(e){bh(e,Rh,{value:{objectID:"O"+Ph++,weakData:{}}})},kh=oh.exports={enable:function(){kh.enable=function(){},Eh=!0;var e=Ch.f,t=vh([].splice),r={};r[Rh]=1,e(r).length&&(Ch.f=function(r){for(var n=e(r),i=0,o=n.length;i<o;i++)if(n[i]===Rh){t(n,i,1);break}return n},hh({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Th.f}))},fastKey:function(e,t){if(!yh(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!gh(e,Rh)){if(!Sh(e))return"F";if(!t)return"E";wh(e)}return e[Rh].objectID},getWeakData:function(e,t){if(!gh(e,Rh)){if(!Sh(e))return!0;if(!t)return!1;wh(e)}return e[Rh].weakData},onFreeze:function(e){return _h&&Eh&&Sh(e)&&!gh(e,Rh)&&wh(e),e}};mh[Rh]=!0;var Ah=Bn,Oh=nt("iterator"),Dh=Array.prototype,Lh=Sn,Mh=Ee,Ih=Bn,xh=nt("iterator"),Nh=function(e){if(null!=e)return Mh(e,xh)||Mh(e,"@@iterator")||Ih[Lh(e)]},Fh=E,Uh=Se,Vh=Ht,jh=ge,Bh=Nh,Wh=TypeError,Yh=function(e,t){var r=arguments.length<2?Bh(e):t;if(Uh(r))return Vh(Fh(r,e));throw Wh(jh(e)+" is not iterable")},qh=E,Gh=Ht,zh=Ee,Hh=Bt,Qh=E,Kh=Ht,Jh=ge,Zh=function(e){return void 0!==e&&(Ah.Array===e||Dh[Oh]===e)},Xh=$r,$h=d,ev=Yh,tv=Nh,rv=function(e,t,r){var n,i;Gh(e);try{if(!(n=zh(e,"return"))){if("throw"===t)throw r;return r}n=qh(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return Gh(n),r},nv=TypeError,iv=function(e,t){this.stopped=e,this.result=t},ov=iv.prototype,sv=function(e,t,r){var n,i,o,s,a,c,u,l=r&&r.that,d=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_ITERATOR),f=!(!r||!r.INTERRUPTED),h=Hh(t,l),v=function(e){return n&&rv(n,"normal",e),new iv(!0,e)},m=function(e){return d?(Kh(e),f?h(e[0],e[1],v):h(e[0],e[1])):f?h(e,v):h(e)};if(p)n=e;else{if(!(i=tv(e)))throw nv(Jh(e)+" is not iterable");if(Zh(i)){for(o=0,s=Xh(e);s>o;o++)if((a=m(e[o]))&&$h(ov,a))return a;return new iv(!1)}n=ev(e,i)}for(c=n.next;!(u=Qh(c,n)).done;){try{a=m(u.value)}catch(e){rv(n,"throw",e)}if("object"==typeof a&&a&&$h(ov,a))return a}return new iv(!1)},av=d,cv=TypeError,uv=function(e,t){if(av(t,e))return e;throw cv("Incorrect invocation")},lv=br,dv=f,pv=oh.exports,fv=n,hv=ar,vv=sv,mv=uv,yv=b,gv=H,bv=Fo,Cv=Wt.f,Tv=ia.forEach,Sv=T,_v=Ti.set,Ev=Ti.getterFor,Rv=function(e,t,r){var n,i=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),s=i?"set":"add",a=dv[e],c=a&&a.prototype,u={};if(Sv&&yv(a)&&(o||c.forEach&&!fv((function(){(new a).entries().next()})))){var l=(n=t((function(t,r){_v(mv(t,l),{type:e,collection:new a}),null!=r&&vv(r,t[s],{that:t,AS_ENTRIES:i})}))).prototype,d=Ev(e);Tv(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in c)||o&&"clear"==e||hv(l,e,(function(r,n){var i=d(this).collection;if(!t&&o&&!gv(r))return"get"==e&&void 0;var s=i[e](0===r?0:r,n);return t?this:s}))})),o||Cv(l,"size",{configurable:!0,get:function(){return d(this).collection.size}})}else n=r.getConstructor(t,e,i,s),pv.enable();return bv(n,e,!1,!0),u[e]=n,lv({global:!0,forced:!0},u),o||r.setStrong(n,e,i),n},Pv=bo,wv=$,kv=Wt,Av=T,Ov=nt("species"),Dv=function(e){var t=wv(e),r=kv.f;Av&&t&&!t[Ov]&&r(t,Ov,{configurable:!0,get:function(){return this}})},Lv=Wt.f,Mv=ao,Iv=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:Pv(e,n,t[n],r);return e},xv=Bt,Nv=uv,Fv=sv,Uv=ds,Vv=Dv,jv=T,Bv=oh.exports.fastKey,Wv=Ti.set,Yv=Ti.getterFor,qv={getConstructor:function(e,t,r,n){var i=e((function(e,i){Nv(e,o),Wv(e,{type:t,index:Mv(null),first:void 0,last:void 0,size:0}),jv||(e.size=0),null!=i&&Fv(i,e[n],{that:e,AS_ENTRIES:r})})),o=i.prototype,s=Yv(t),a=function(e,t,r){var n,i,o=s(e),a=c(e,t);return a?a.value=r:(o.last=a={index:i=Bv(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=a),n&&(n.next=a),jv?o.size++:e.size++,"F"!==i&&(o.index[i]=a)),e},c=function(e,t){var r,n=s(e),i=Bv(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return Iv(o,{clear:function(){for(var e=s(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,jv?e.size=0:this.size=0},delete:function(e){var t=this,r=s(t),n=c(t,e);if(n){var i=n.next,o=n.previous;delete r.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),r.first==n&&(r.first=i),r.last==n&&(r.last=o),jv?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=s(this),n=xv(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),Iv(o,r?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return a(this,0===e?0:e,t)}}:{add:function(e){return a(this,e=0===e?0:e,e)}}),jv&&Lv(o,"size",{get:function(){return s(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=Yv(t),o=Yv(n);Uv(e,t,(function(e,t){Wv(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),Vv(t)}};Rv("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),qv);var Gv=l,zv=qr,Hv=Rn,Qv=W,Kv=Gv("".charAt),Jv=Gv("".charCodeAt),Zv=Gv("".slice),Xv=function(e){return function(t,r){var n,i,o=Hv(Qv(t)),s=zv(r),a=o.length;return s<0||s>=a?e?"":void 0:(n=Jv(o,s))<55296||n>56319||s+1===a||(i=Jv(o,s+1))<56320||i>57343?e?Kv(o,s):n:e?Zv(o,s,s+2):i-56320+(n-55296<<10)+65536}},$v={codeAt:Xv(!1),charAt:Xv(!0)},em=$v.charAt,tm=Rn,rm=Ti,nm=ds,im="String Iterator",om=rm.set,sm=rm.getterFor(im);nm(String,"String",(function(e){om(this,{type:im,string:tm(e),index:0})}),(function(){var e,t=sm(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=em(r,n),t.index+=e.length,{value:e,done:!1})}));var am=Q.Set,cm=Ys,um=ge,lm=TypeError,dm=function(e){if(cm(e))return e;throw lm(um(e)+" is not a constructor")},pm=Bt,fm=E,hm=Se,vm=dm,mm=sv,ym=[].push,gm=function(e){var t,r,n,i,o=arguments.length,s=o>1?arguments[1]:void 0;return vm(this),(t=void 0!==s)&&hm(s),null==e?new this:(r=[],t?(n=0,i=pm(s,o>2?arguments[2]:void 0),mm(e,(function(e){fm(ym,r,i(e,n++))}))):mm(e,ym,{that:r}),new this(r))};br({target:"Set",stat:!0,forced:!0},{from:gm});var bm=Cr,Cm=function(){return new this(bm(arguments))};br({target:"Set",stat:!0,forced:!0},{of:Cm});var Tm=E,Sm=Se,_m=Ht,Em=function(){for(var e=_m(this),t=Sm(e.add),r=0,n=arguments.length;r<n;r++)Tm(t,e,arguments[r]);return e};br({target:"Set",proto:!0,real:!0,forced:!0},{addAll:Em});var Rm=E,Pm=Se,wm=Ht,km=function(){for(var e,t=wm(this),r=Pm(t.delete),n=!0,i=0,o=arguments.length;i<o;i++)e=Rm(r,t,arguments[i]),n=n&&e;return!!n};br({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:km});var Am=Yh,Om=Ht,Dm=Bt,Lm=Am,Mm=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=Om(this),r=Lm(t),n=Dm(e,arguments.length>1?arguments[1]:void 0);return!Mm(r,(function(e,r){if(!n(e,e,t))return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var Im=Ht,xm=dm,Nm=nt("species"),Fm=function(e,t){var r,n=Im(e).constructor;return void 0===n||null==(r=Im(n)[Nm])?t:xm(r)},Um=$,Vm=E,jm=Se,Bm=Ht,Wm=Fm,Ym=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){var t=Bm(this),r=new(Wm(t,Um("Set")))(t),n=jm(r.delete);return Ym(e,(function(e){Vm(n,r,e)})),r}});var qm=$,Gm=E,zm=Se,Hm=Ht,Qm=Bt,Km=Fm,Jm=Am,Zm=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=Hm(this),r=Jm(t),n=Qm(e,arguments.length>1?arguments[1]:void 0),i=new(Km(t,qm("Set"))),o=zm(i.add);return Zm(r,(function(e){n(e,e,t)&&Gm(o,i,e)}),{IS_ITERATOR:!0}),i}});var Xm=Ht,$m=Bt,ey=Am,ty=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=Xm(this),r=ey(t),n=$m(e,arguments.length>1?arguments[1]:void 0);return ty(r,(function(e,r){if(n(e,e,t))return r(e)}),{IS_ITERATOR:!0,INTERRUPTED:!0}).result}});var ry=$,ny=E,iy=Se,oy=Ht,sy=Fm,ay=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){var t=oy(this),r=new(sy(t,ry("Set"))),n=iy(t.has),i=iy(r.add);return ay(e,(function(e){ny(n,t,e)&&ny(i,r,e)})),r}});var cy=E,uy=Se,ly=Ht,dy=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){var t=ly(this),r=uy(t.has);return!dy(e,(function(e,n){if(!0===cy(r,t,e))return n()}),{INTERRUPTED:!0}).stopped}});var py=$,fy=E,hy=Se,vy=b,my=Ht,yy=Yh,gy=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){var t=yy(this),r=my(e),n=r.has;return vy(n)||(r=new(py("Set"))(e),n=hy(r.has)),!gy(t,(function(e,t){if(!1===fy(n,r,e))return t()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var by=E,Cy=Se,Ty=Ht,Sy=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){var t=Ty(this),r=Cy(t.has);return!Sy(e,(function(e,n){if(!1===by(r,t,e))return n()}),{INTERRUPTED:!0}).stopped}});var _y=br,Ey=Ht,Ry=Rn,Py=Am,wy=sv,ky=l([].join),Ay=[].push;_y({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=Ey(this),r=Py(t),n=void 0===e?",":Ry(e),i=[];return wy(r,Ay,{that:i,IS_ITERATOR:!0}),ky(i,n)}});var Oy=$,Dy=Bt,Ly=E,My=Se,Iy=Ht,xy=Fm,Ny=Am,Fy=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=Iy(this),r=Ny(t),n=Dy(e,arguments.length>1?arguments[1]:void 0),i=new(xy(t,Oy("Set"))),o=My(i.add);return Fy(r,(function(e){Ly(o,i,n(e,e,t))}),{IS_ITERATOR:!0}),i}});var Uy=Se,Vy=Ht,jy=Am,By=sv,Wy=TypeError;br({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=Vy(this),r=jy(t),n=arguments.length<2,i=n?void 0:arguments[1];if(Uy(e),By(r,(function(r){n?(n=!1,i=r):i=e(i,r,r,t)}),{IS_ITERATOR:!0}),n)throw Wy("Reduce of empty set with no initial value");return i}});var Yy=Ht,qy=Bt,Gy=Am,zy=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=Yy(this),r=Gy(t),n=qy(e,arguments.length>1?arguments[1]:void 0);return zy(r,(function(e,r){if(n(e,e,t))return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var Hy=$,Qy=E,Ky=Se,Jy=Ht,Zy=Fm,Xy=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){var t=Jy(this),r=new(Zy(t,Hy("Set")))(t),n=Ky(r.delete),i=Ky(r.add);return Xy(e,(function(e){Qy(n,r,e)||Qy(i,r,e)})),r}});var $y=$,eg=Se,tg=Ht,rg=Fm,ng=sv;br({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){var t=tg(this),r=new(rg(t,$y("Set")))(t);return ng(e,eg(r.add),{that:r}),r}});var ig=am;Rv("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),qv);var og=Q.Map;br({target:"Map",stat:!0,forced:!0},{from:gm}),br({target:"Map",stat:!0,forced:!0},{of:Cm}),br({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:km});var sg=E,ag=Se,cg=Ht,ug=function(e,t){var r=cg(this),n=ag(r.get),i=ag(r.has),o=ag(r.set),s=sg(i,r,e)&&"update"in t?t.update(sg(n,r,e),e,r):t.insert(e,r);return sg(o,r,e,s),s};br({target:"Map",proto:!0,real:!0,forced:!0},{emplace:ug});var lg=Yh,dg=Ht,pg=Bt,fg=lg,hg=sv;br({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=dg(this),r=fg(t),n=pg(e,arguments.length>1?arguments[1]:void 0);return!hg(r,(function(e,r,i){if(!n(r,e,t))return i()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var vg=$,mg=Bt,yg=E,gg=Se,bg=Ht,Cg=Fm,Tg=lg,Sg=sv;br({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=bg(this),r=Tg(t),n=mg(e,arguments.length>1?arguments[1]:void 0),i=new(Cg(t,vg("Map"))),o=gg(i.set);return Sg(r,(function(e,r){n(r,e,t)&&yg(o,i,e,r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}});var _g=Ht,Eg=Bt,Rg=lg,Pg=sv;br({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=_g(this),r=Rg(t),n=Eg(e,arguments.length>1?arguments[1]:void 0);return Pg(r,(function(e,r,i){if(n(r,e,t))return i(r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});var wg=Ht,kg=Bt,Ag=lg,Og=sv;br({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=wg(this),r=Ag(t),n=kg(e,arguments.length>1?arguments[1]:void 0);return Og(r,(function(e,r,i){if(n(r,e,t))return i(e)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});var Dg=br,Lg=E,Mg=Se,Ig=Yh,xg=sv,Ng=l([].push);Dg({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){Mg(t);var r=Ig(e),n=new this,i=Mg(n.has),o=Mg(n.get),s=Mg(n.set);return xg(r,(function(e){var r=t(e);Lg(i,n,r)?Ng(Lg(o,n,r),e):Lg(s,n,r,[e])}),{IS_ITERATOR:!0}),n}});var Fg=Ht,Ug=lg,Vg=function(e,t){return e===t||e!=e&&t!=t},jg=sv;br({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return jg(Ug(Fg(this)),(function(t,r,n){if(Vg(r,e))return n()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var Bg=E,Wg=sv,Yg=Se;br({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new this;Yg(t);var n=Yg(r.set);return Wg(e,(function(e){Bg(n,r,t(e),e)})),r}});var qg=Ht,Gg=lg,zg=sv;br({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){return zg(Gg(qg(this)),(function(t,r,n){if(r===e)return n(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});var Hg=$,Qg=Bt,Kg=E,Jg=Se,Zg=Ht,Xg=Fm,$g=lg,eb=sv;br({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=Zg(this),r=$g(t),n=Qg(e,arguments.length>1?arguments[1]:void 0),i=new(Xg(t,Hg("Map"))),o=Jg(i.set);return eb(r,(function(e,r){Kg(o,i,n(r,e,t),r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}});var tb=$,rb=Bt,nb=E,ib=Se,ob=Ht,sb=Fm,ab=lg,cb=sv;br({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=ob(this),r=ab(t),n=rb(e,arguments.length>1?arguments[1]:void 0),i=new(sb(t,tb("Map"))),o=ib(i.set);return cb(r,(function(e,r){nb(o,i,e,n(r,e,t))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}});var ub=Se,lb=Ht,db=sv;br({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=lb(this),r=ub(t.set),n=arguments.length,i=0;i<n;)db(arguments[i++],r,{that:t,AS_ENTRIES:!0});return t}});var pb=Ht,fb=Se,hb=lg,vb=sv,mb=TypeError;br({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=pb(this),r=hb(t),n=arguments.length<2,i=n?void 0:arguments[1];if(fb(e),vb(r,(function(r,o){n?(n=!1,i=o):i=e(i,o,r,t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),n)throw mb("Reduce of empty map with no initial value");return i}});var yb=Ht,gb=Bt,bb=lg,Cb=sv;br({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=yb(this),r=bb(t),n=gb(e,arguments.length>1?arguments[1]:void 0);return Cb(r,(function(e,r,i){if(n(r,e,t))return i()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var Tb=E,Sb=Ht,_b=Se,Eb=TypeError;br({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=Sb(this),n=_b(r.get),i=_b(r.has),o=_b(r.set),s=arguments.length;_b(t);var a=Tb(i,r,e);if(!a&&s<3)throw Eb("Updating absent value");var c=a?Tb(n,r,e):_b(s>2?arguments[2]:void 0)(e,r);return Tb(o,r,e,t(c,e,r)),r}});var Rb=E,Pb=Se,wb=b,kb=Ht,Ab=TypeError,Ob=function(e,t){var r,n=kb(this),i=Pb(n.get),o=Pb(n.has),s=Pb(n.set),a=arguments.length>2?arguments[2]:void 0;if(!wb(t)&&!wb(a))throw Ab("At least one callback required");return Rb(o,n,e)?(r=Rb(i,n,e),wb(t)&&(r=t(r),Rb(s,n,e,r))):wb(a)&&(r=a(),Rb(s,n,e,r)),r};br({target:"Map",proto:!0,real:!0,forced:!0},{upsert:Ob}),br({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:Ob});var Db=og,Lb=$v.codeAt;br({target:"String",proto:!0},{codePointAt:function(e){return Lb(this,e)}});var Mb=xr("String").codePointAt,Ib=d,xb=Mb,Nb=String.prototype,Fb=function(e){var t=e.codePointAt;return"string"==typeof e||e===Nb||Ib(Nb,e)&&t===Nb.codePointAt?xb:t},Ub=br,Vb=l,jb=Qr,Bb=RangeError,Wb=String.fromCharCode,Yb=String.fromCodePoint,qb=Vb([].join);Ub({target:"String",stat:!0,arity:1,forced:!!Yb&&1!=Yb.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],jb(t,1114111)!==t)throw Bb(t+" is not a valid code point");r[i]=t<65536?Wb(t):Wb(55296+((t-=65536)>>10),t%1024+56320)}return qb(r,"")}});var Gb=Q.String.fromCodePoint,zb=br,Hb=Date,Qb=l(Hb.prototype.getTime);zb({target:"Date",stat:!0},{now:function(){return Qb(new Hb)}});var Kb=Q.Date.now,Jb=Q,Zb=g;Jb.JSON||(Jb.JSON={stringify:JSON.stringify});var Xb=function(e,t,r){return Zb(Jb.JSON.stringify,null,arguments)},$b=Xb,eC=Be,tC=of,rC=C,nC=Wt,iC=Error,oC=l("".replace),sC=String(iC("zxcasd").stack),aC=/\n\s*at [^:]*:[^\n]*/,cC=aC.test(sC),uC=H,lC=ar,dC=Rn,pC=D,fC=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",pC(1,7)),7!==e.stack)})),hC=br,vC=d,mC=yo,yC=Jo,gC=function(e,t,r){for(var n=tC(t),i=nC.f,o=rC.f,s=0;s<n.length;s++){var a=n[s];eC(e,a)||r&&eC(r,a)||i(e,a,o(t,a))}},bC=ao,CC=ar,TC=D,SC=function(e,t){if(cC&&"string"==typeof e&&!iC.prepareStackTrace)for(;t--;)e=oC(e,aC,"");return e},_C=function(e,t){uC(t)&&"cause"in t&&lC(e,"cause",t.cause)},EC=sv,RC=function(e,t){return void 0===e?arguments.length<2?"":t:dC(e)},PC=fC,wC=nt("toStringTag"),kC=Error,AC=[].push,OC=function(e,t){var r,n=arguments.length>2?arguments[2]:void 0,i=vC(DC,this);yC?r=yC(new kC,i?mC(this):DC):(r=i?this:bC(DC),CC(r,wC,"Error")),void 0!==t&&CC(r,"message",RC(t)),PC&&CC(r,"stack",SC(r.stack,1)),_C(r,n);var o=[];return EC(e,AC,{that:o}),CC(r,"errors",o),r};yC?yC(OC,kC):gC(OC,kC,{name:!0});var DC=OC.prototype=bC(kC.prototype,{constructor:TC(1,OC),message:TC(1,""),name:TC(1,"AggregateError")});hC({global:!0,constructor:!0,arity:2},{AggregateError:OC});var LC,MC,IC,xC,NC="process"==x(f.process),FC=/(?:ipad|iphone|ipod).*applewebkit/i.test(ee),UC=f,VC=g,jC=Bt,BC=b,WC=Be,YC=n,qC=zi,GC=Cr,zC=yt,HC=ga,QC=FC,KC=NC,JC=UC.setImmediate,ZC=UC.clearImmediate,XC=UC.process,$C=UC.Dispatch,eT=UC.Function,tT=UC.MessageChannel,rT=UC.String,nT=0,iT={},oT="onreadystatechange";try{LC=UC.location}catch(e){}var sT=function(e){if(WC(iT,e)){var t=iT[e];delete iT[e],t()}},aT=function(e){return function(){sT(e)}},cT=function(e){sT(e.data)},uT=function(e){UC.postMessage(rT(e),LC.protocol+"//"+LC.host)};JC&&ZC||(JC=function(e){HC(arguments.length,1);var t=BC(e)?e:eT(e),r=GC(arguments,1);return iT[++nT]=function(){VC(t,void 0,r)},MC(nT),nT},ZC=function(e){delete iT[e]},KC?MC=function(e){XC.nextTick(aT(e))}:$C&&$C.now?MC=function(e){$C.now(aT(e))}:tT&&!QC?(xC=(IC=new tT).port2,IC.port1.onmessage=cT,MC=jC(xC.postMessage,xC)):UC.addEventListener&&BC(UC.postMessage)&&!UC.importScripts&&LC&&"file:"!==LC.protocol&&!YC(uT)?(MC=uT,UC.addEventListener("message",cT,!1)):MC=oT in zC("script")?function(e){qC.appendChild(zC("script")).onreadystatechange=function(){qC.removeChild(this),sT(e)}}:function(e){setTimeout(aT(e),0)});var lT,dT,pT,fT,hT,vT,mT,yT,gT={set:JC,clear:ZC},bT=f,CT=/ipad|iphone|ipod/i.test(ee)&&void 0!==bT.Pebble,TT=/web0s(?!.*chrome)/i.test(ee),ST=f,_T=Bt,ET=C.f,RT=gT.set,PT=FC,wT=CT,kT=TT,AT=NC,OT=ST.MutationObserver||ST.WebKitMutationObserver,DT=ST.document,LT=ST.process,MT=ST.Promise,IT=ET(ST,"queueMicrotask"),xT=IT&&IT.value;xT||(lT=function(){var e,t;for(AT&&(e=LT.domain)&&e.exit();dT;){t=dT.fn,dT=dT.next;try{t()}catch(e){throw dT?fT():pT=void 0,e}}pT=void 0,e&&e.enter()},PT||AT||kT||!OT||!DT?!wT&&MT&&MT.resolve?((mT=MT.resolve(void 0)).constructor=MT,yT=_T(mT.then,mT),fT=function(){yT(lT)}):AT?fT=function(){LT.nextTick(lT)}:(RT=_T(RT,ST),fT=function(){RT(lT)}):(hT=!0,vT=DT.createTextNode(""),new OT(lT).observe(vT,{characterData:!0}),fT=function(){vT.data=hT=!hT}));var NT=xT||function(e){var t={fn:e,next:void 0};pT&&(pT.next=t),dT||(dT=t,fT()),pT=t},FT=f,UT=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},VT=function(){this.head=null,this.tail=null};VT.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var jT=VT,BT=f.Promise,WT="object"==typeof window&&"object"!=typeof Deno,YT=f,qT=BT,GT=b,zT=Ft,HT=Qn,QT=nt,KT=WT,JT=ae,ZT=qT&&qT.prototype,XT=QT("species"),$T=!1,eS=GT(YT.PromiseRejectionEvent),tS=zT("Promise",(function(){var e=HT(qT),t=e!==String(qT);if(!t&&66===JT)return!0;if(!ZT.catch||!ZT.finally)return!0;if(JT>=51&&/native code/.test(e))return!1;var r=new qT((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[XT]=n,!($T=r.then((function(){}))instanceof n)||!t&&KT&&!eS})),rS={CONSTRUCTOR:tS,REJECTION_EVENT:eS,SUBCLASSING:$T},nS={},iS=Se,oS=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=iS(t),this.reject=iS(r)};nS.f=function(e){return new oS(e)};var sS,aS,cS=br,uS=NC,lS=f,dS=E,pS=bo,fS=Fo,hS=Dv,vS=Se,mS=b,yS=H,gS=uv,bS=Fm,CS=gT.set,TS=NT,SS=function(e,t){var r=FT.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},_S=UT,ES=jT,RS=Ti,PS=BT,wS=nS,kS="Promise",AS=rS.CONSTRUCTOR,OS=rS.REJECTION_EVENT,DS=RS.getterFor(kS),LS=RS.set,MS=PS&&PS.prototype,IS=PS,xS=MS,NS=lS.TypeError,FS=lS.document,US=lS.process,VS=wS.f,jS=VS,BS=!!(FS&&FS.createEvent&&lS.dispatchEvent),WS="unhandledrejection",YS=function(e){var t;return!(!yS(e)||!mS(t=e.then))&&t},qS=function(e,t){var r,n,i,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{a?(s||(2===t.rejection&&KS(t),t.rejection=1),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),i=!0)),r===e.promise?u(NS("Promise-chain cycle")):(n=YS(r))?dS(n,r,c,u):c(r)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},GS=function(e,t){e.notified||(e.notified=!0,TS((function(){for(var r,n=e.reactions;r=n.get();)qS(r,e);e.notified=!1,t&&!e.rejection&&HS(e)})))},zS=function(e,t,r){var n,i;BS?((n=FS.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),lS.dispatchEvent(n)):n={promise:t,reason:r},!OS&&(i=lS["on"+e])?i(n):e===WS&&SS("Unhandled promise rejection",r)},HS=function(e){dS(CS,lS,(function(){var t,r=e.facade,n=e.value;if(QS(e)&&(t=_S((function(){uS?US.emit("unhandledRejection",n,r):zS(WS,r,n)})),e.rejection=uS||QS(e)?2:1,t.error))throw t.value}))},QS=function(e){return 1!==e.rejection&&!e.parent},KS=function(e){dS(CS,lS,(function(){var t=e.facade;uS?US.emit("rejectionHandled",t):zS("rejectionhandled",t,e.value)}))},JS=function(e,t,r){return function(n){e(t,n,r)}},ZS=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,GS(e,!0))},XS=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw NS("Promise can't be resolved itself");var n=YS(t);n?TS((function(){var r={done:!1};try{dS(n,t,JS(XS,r,e),JS(ZS,r,e))}catch(t){ZS(r,t,e)}})):(e.value=t,e.state=1,GS(e,!1))}catch(t){ZS({done:!1},t,e)}}};AS&&(xS=(IS=function(e){gS(this,xS),vS(e),dS(sS,this);var t=DS(this);try{e(JS(XS,t),JS(ZS,t))}catch(e){ZS(t,e)}}).prototype,(sS=function(e){LS(this,{type:kS,done:!1,notified:!1,parent:!1,reactions:new ES,rejection:!1,state:0,value:void 0})}).prototype=pS(xS,"then",(function(e,t){var r=DS(this),n=VS(bS(this,IS));return r.parent=!0,n.ok=!mS(e)||e,n.fail=mS(t)&&t,n.domain=uS?US.domain:void 0,0==r.state?r.reactions.add(n):TS((function(){qS(n,r)})),n.promise})),aS=function(){var e=new sS,t=DS(e);this.promise=e,this.resolve=JS(XS,t),this.reject=JS(ZS,t)},wS.f=VS=function(e){return e===IS||undefined===e?new aS(e):jS(e)}),cS({global:!0,constructor:!0,wrap:!0,forced:AS},{Promise:IS}),fS(IS,kS,!1,!0),hS(kS);var $S=nt("iterator"),e_=!1;try{var t_=0,r_={next:function(){return{done:!!t_++}},return:function(){e_=!0}};r_[$S]=function(){return this},Array.from(r_,(function(){throw 2}))}catch(e){}var n_=BT,i_=function(e,t){if(!t&&!e_)return!1;var r=!1;try{var n={};n[$S]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},o_=rS.CONSTRUCTOR||!i_((function(e){n_.all(e).then(void 0,(function(){}))})),s_=E,a_=Se,c_=nS,u_=UT,l_=sv;br({target:"Promise",stat:!0,forced:o_},{all:function(e){var t=this,r=c_.f(t),n=r.resolve,i=r.reject,o=u_((function(){var r=a_(t.resolve),o=[],s=0,a=1;l_(e,(function(e){var c=s++,u=!1;a++,s_(r,t,e).then((function(e){u||(u=!0,o[c]=e,--a||n(o))}),i)})),--a||n(o)}));return o.error&&i(o.value),r.promise}});var d_=br,p_=rS.CONSTRUCTOR;BT&&BT.prototype,d_({target:"Promise",proto:!0,forced:p_,real:!0},{catch:function(e){return this.then(void 0,e)}});var f_=E,h_=Se,v_=nS,m_=UT,y_=sv;br({target:"Promise",stat:!0,forced:o_},{race:function(e){var t=this,r=v_.f(t),n=r.reject,i=m_((function(){var i=h_(t.resolve);y_(e,(function(e){f_(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var g_=E,b_=nS;br({target:"Promise",stat:!0,forced:rS.CONSTRUCTOR},{reject:function(e){var t=b_.f(this);return g_(t.reject,void 0,e),t.promise}});var C_=Ht,T_=H,S_=nS,__=function(e,t){if(C_(e),T_(t)&&t.constructor===e)return t;var r=S_.f(e);return(0,r.resolve)(t),r.promise},E_=br,R_=BT,P_=rS.CONSTRUCTOR,w_=__,k_=$("Promise"),A_=!P_;E_({target:"Promise",stat:!0,forced:true},{resolve:function(e){return w_(A_&&this===k_?R_:this,e)}});var O_=E,D_=Se,L_=nS,M_=UT,I_=sv;br({target:"Promise",stat:!0},{allSettled:function(e){var t=this,r=L_.f(t),n=r.resolve,i=r.reject,o=M_((function(){var r=D_(t.resolve),i=[],o=0,s=1;I_(e,(function(e){var a=o++,c=!1;s++,O_(r,t,e).then((function(e){c||(c=!0,i[a]={status:"fulfilled",value:e},--s||n(i))}),(function(e){c||(c=!0,i[a]={status:"rejected",reason:e},--s||n(i))}))})),--s||n(i)}));return o.error&&i(o.value),r.promise}});var x_=E,N_=Se,F_=$,U_=nS,V_=UT,j_=sv,B_="No one promise resolved";br({target:"Promise",stat:!0},{any:function(e){var t=this,r=F_("AggregateError"),n=U_.f(t),i=n.resolve,o=n.reject,s=V_((function(){var n=N_(t.resolve),s=[],a=0,c=1,u=!1;j_(e,(function(e){var l=a++,d=!1;c++,x_(n,t,e).then((function(e){d||u||(u=!0,i(e))}),(function(e){d||u||(d=!0,s[l]=e,--c||o(new r(s,B_)))}))})),--c||o(new r(s,B_))}));return s.error&&o(s.value),n.promise}});var W_=br,Y_=BT,q_=n,G_=$,z_=b,H_=Fm,Q_=__,K_=Y_&&Y_.prototype;W_({target:"Promise",proto:!0,real:!0,forced:!!Y_&&q_((function(){K_.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=H_(this,G_("Promise")),r=z_(e);return this.then(r?function(r){return Q_(t,e()).then((function(){return r}))}:e,r?function(r){return Q_(t,e()).then((function(){throw r}))}:e)}});var J_=Q.Promise,Z_=nS,X_=UT;br({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=Z_.f(this),r=X_(e);return(r.error?t.reject:t.resolve)(r.value),t.promise}});var $_=J_,eE="\t\n\v\f\r 聽釟€鈥€鈥佲€傗€冣€勨€呪€嗏€団€堚€夆€娾€仧銆€\u2028\u2029\ufeff",tE=W,rE=Rn,nE=l("".replace),iE="[\t\n\v\f\r 聽釟€鈥€鈥佲€傗€冣€勨€呪€嗏€団€堚€夆€娾€仧銆€\u2028\u2029\ufeff]",oE=RegExp("^"+iE+iE+"*"),sE=RegExp(iE+iE+"*$"),aE=function(e){return function(t){var r=rE(tE(t));return 1&e&&(r=nE(r,oE,"")),2&e&&(r=nE(r,sE,"")),r}},cE={start:aE(1),end:aE(2),trim:aE(3)},uE=f,lE=n,dE=l,pE=Rn,fE=cE.trim,hE=eE,vE=uE.parseInt,mE=uE.Symbol,yE=mE&&mE.iterator,gE=/^[+-]?0x/i,bE=dE(gE.exec),CE=8!==vE(hE+"08")||22!==vE(hE+"0x16")||yE&&!lE((function(){vE(Object(yE))}))?function(e,t){var r=fE(pE(e));return vE(r,t>>>0||(bE(gE,r)?16:10))}:vE;br({global:!0,forced:parseInt!=CE},{parseInt:CE});var TE=Q.parseInt,SE=xr("Array").entries,_E=Sn,EE=Be,RE=d,PE=SE,wE=Array.prototype,kE={DOMTokenList:!0,NodeList:!0},AE=function(e){var t=e.entries;return e===wE||RE(wE,e)&&t===wE.entries||EE(kE,_E(e))?PE:t},OE=ge,DE=TypeError,LE=br,ME=Ue,IE=Qr,xE=qr,NE=$r,FE=pp,UE=Js,VE=Ru,jE=function(e,t){if(!delete e[t])throw DE("Cannot delete property "+OE(t)+" of "+OE(e))},BE=Ja("splice"),WE=Math.max,YE=Math.min;LE({target:"Array",proto:!0,forced:!BE},{splice:function(e,t){var r,n,i,o,s,a,c=ME(this),u=NE(c),l=IE(e,u),d=arguments.length;for(0===d?r=n=0:1===d?(r=0,n=u-l):(r=d-2,n=YE(WE(xE(t),0),u-l)),FE(u+r-n),i=UE(c,n),o=0;o<n;o++)(s=l+o)in c&&VE(i,o,c[s]);if(i.length=n,r<n){for(o=l;o<u-n;o++)a=o+r,(s=o+n)in c?c[a]=c[s]:jE(c,a);for(o=u;o>u-n+r;o--)jE(c,o-1)}else if(r>n)for(o=u-n;o>l;o--)a=o+r-1,(s=o+n-1)in c?c[a]=c[s]:jE(c,a);for(o=0;o<r;o++)c[o+l]=arguments[o+2];return c.length=u-n+r,i}});var qE=xr("Array").splice,GE=d,zE=qE,HE=Array.prototype,QE=function(e){var t=e.splice;return e===HE||GE(HE,e)&&t===HE.splice?zE:t},KE=Se,JE=Ue,ZE=j,XE=$r,$E=TypeError,eR=function(e){return function(t,r,n,i){KE(r);var o=JE(t),s=ZE(o),a=XE(o),c=e?a-1:0,u=e?-1:1;if(n<2)for(;;){if(c in s){i=s[c],c+=u;break}if(c+=u,e?c<0:a<=c)throw $E("Reduce of empty array with no initial value")}for(;e?c>=0:a>c;c+=u)c in s&&(i=r(i,s[c],c,o));return i}},tR={left:eR(!1),right:eR(!0)}.left,rR=ae,nR=NC;br({target:"Array",proto:!0,forced:!sa("reduce")||!nR&&rR>79&&rR<83},{reduce:function(e){var t=arguments.length;return tR(this,e,t,t>1?arguments[1]:void 0)}});var iR=xr("Array").reduce,oR=d,sR=iR,aR=Array.prototype,cR=function(e){var t=e.reduce;return e===aR||oR(aR,e)&&t===aR.reduce?sR:t},uR=br,lR=ia.find,dR="find",pR=!0;dR in[]&&Array(1).find((function(){pR=!1})),uR({target:"Array",proto:!0,forced:pR},{find:function(e){return lR(this,e,arguments.length>1?arguments[1]:void 0)}});var fR=xr("Array").find,hR=d,vR=fR,mR=Array.prototype,yR=function(e){var t=e.find;return e===mR||hR(mR,e)&&t===mR.find?vR:t},gR={exports:{}};!function(e,t){self,e.exports=function(){var e={729:function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||e,s),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Tu&&(n.prototype=Tu(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?qu(n).call(n,1):n);return lp?Lp(i).call(i,lp(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,i,o,s){var a=r?r+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,i),!0;case 5:return l.fn.call(l.context,t,n,i,o),!0;case 6:return l.fn.call(l.context,t,n,i,o,s),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var p,f=l.length;for(u=0;u<f;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,n);break;case 4:l[u].fn.call(l[u].context,t,n,i);break;default:if(!c)for(p=1,c=new Array(d-1);p<d;p++)c[p-1]=arguments[p];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||i&&!a[c].once||n&&a[c].context!==n)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},961:function(e,t,r){var n,i=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",n={};function i(e,t){if(!n[e]){n[e]={};for(var r=0;r<e.length;r++)n[e][e.charAt(r)]=r}return n[e][t]}var o={compressToBase64:function(e){if(null==e)return"";var r=o._compress(e,6,(function(e){return t.charAt(e)}));switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:o._decompress(e.length,32,(function(r){return i(t,e.charAt(r))}))},compressToUTF16:function(t){return null==t?"":o._compress(t,15,(function(t){return e(t+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:o._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=o.compress(e),r=new Uint8Array(2*t.length),n=0,i=t.length;n<i;n++){var s=t.charCodeAt(n);r[2*n]=s>>>8,r[2*n+1]=s%256}return r},decompressFromUint8Array:function(t){if(null==t)return o.decompress(t);for(var r=new Array(t.length/2),n=0,i=r.length;n<i;n++)r[n]=256*t[2*n]+t[2*n+1];var s=[];return ma(r).call(r,(function(t){s.push(e(t))})),o.decompress(s.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":o._compress(e,6,(function(e){return r.charAt(e)}))},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),o._decompress(e.length,32,(function(t){return i(r,e.charAt(t))})))},compress:function(t){return o._compress(t,16,(function(t){return e(t)}))},_compress:function(e,t,r){if(null==e)return"";var n,i,o,s={},a={},c="",u="",l="",d=2,p=3,f=2,h=[],v=0,m=0;for(o=0;o<e.length;o+=1)if(c=e.charAt(o),Object.prototype.hasOwnProperty.call(s,c)||(s[c]=p++,a[c]=!0),u=l+c,Object.prototype.hasOwnProperty.call(s,u))l=u;else{if(Object.prototype.hasOwnProperty.call(a,l)){if(l.charCodeAt(0)<256){for(n=0;n<f;n++)v<<=1,m==t-1?(m=0,h.push(r(v)),v=0):m++;for(i=l.charCodeAt(0),n=0;n<8;n++)v=v<<1|1&i,m==t-1?(m=0,h.push(r(v)),v=0):m++,i>>=1}else{for(i=1,n=0;n<f;n++)v=v<<1|i,m==t-1?(m=0,h.push(r(v)),v=0):m++,i=0;for(i=l.charCodeAt(0),n=0;n<16;n++)v=v<<1|1&i,m==t-1?(m=0,h.push(r(v)),v=0):m++,i>>=1}0==--d&&(d=Math.pow(2,f),f++),delete a[l]}else for(i=s[l],n=0;n<f;n++)v=v<<1|1&i,m==t-1?(m=0,h.push(r(v)),v=0):m++,i>>=1;0==--d&&(d=Math.pow(2,f),f++),s[u]=p++,l=String(c)}if(""!==l){if(Object.prototype.hasOwnProperty.call(a,l)){if(l.charCodeAt(0)<256){for(n=0;n<f;n++)v<<=1,m==t-1?(m=0,h.push(r(v)),v=0):m++;for(i=l.charCodeAt(0),n=0;n<8;n++)v=v<<1|1&i,m==t-1?(m=0,h.push(r(v)),v=0):m++,i>>=1}else{for(i=1,n=0;n<f;n++)v=v<<1|i,m==t-1?(m=0,h.push(r(v)),v=0):m++,i=0;for(i=l.charCodeAt(0),n=0;n<16;n++)v=v<<1|1&i,m==t-1?(m=0,h.push(r(v)),v=0):m++,i>>=1}0==--d&&(d=Math.pow(2,f),f++),delete a[l]}else for(i=s[l],n=0;n<f;n++)v=v<<1|1&i,m==t-1?(m=0,h.push(r(v)),v=0):m++,i>>=1;0==--d&&(d=Math.pow(2,f),f++)}for(i=2,n=0;n<f;n++)v=v<<1|1&i,m==t-1?(m=0,h.push(r(v)),v=0):m++,i>>=1;for(;;){if(v<<=1,m==t-1){h.push(r(v));break}m++}return h.join("")},decompress:function(e){return null==e?"":""==e?null:o._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(t,r,n){var i,o,s,a,c,u,l,d=[],p=4,f=4,h=3,v="",m=[],y={val:n(0),position:r,index:1};for(i=0;i<3;i+=1)d[i]=i;for(s=0,c=Math.pow(2,2),u=1;u!=c;)a=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),s|=(a>0?1:0)*u,u<<=1;switch(s){case 0:for(s=0,c=Math.pow(2,8),u=1;u!=c;)a=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),s|=(a>0?1:0)*u,u<<=1;l=e(s);break;case 1:for(s=0,c=Math.pow(2,16),u=1;u!=c;)a=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),s|=(a>0?1:0)*u,u<<=1;l=e(s);break;case 2:return""}for(d[3]=l,o=l,m.push(l);;){if(y.index>t)return"";for(s=0,c=Math.pow(2,h),u=1;u!=c;)a=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),s|=(a>0?1:0)*u,u<<=1;switch(l=s){case 0:for(s=0,c=Math.pow(2,8),u=1;u!=c;)a=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),s|=(a>0?1:0)*u,u<<=1;d[f++]=e(s),l=f-1,p--;break;case 1:for(s=0,c=Math.pow(2,16),u=1;u!=c;)a=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),s|=(a>0?1:0)*u,u<<=1;d[f++]=e(s),l=f-1,p--;break;case 2:return m.join("")}if(0==p&&(p=Math.pow(2,h),h++),d[l])v=d[l];else{if(l!==f)return null;v=o+o.charAt(0)}m.push(v),d[f++]=o+v.charAt(0),o=v,0==--p&&(p=Math.pow(2,h),h++)}}};return o}();void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Vp(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var n={};return function(){r.d(n,{default:function(){return Qt}});var e=r(729),t=r.n(e),i="LEBP2PInnerEvent",o="LEBP2PEvent",s={ERR_LOAD_TIMEOUT:1003,ERR_LOAD_REACH_MAX_RETRY:1004,ERR_PLAY_WEBRTC_FAIL:1005,ERR_FETCH_REQUEST_FAIL:1006,ERR_PLAY_REQUEST_PULL_FAIL:1007,ERR_PLAY_REQUEST_STOP_FAIL:1008,INF_PLAY_EVT_SERVER_CONNECTED:3001,INF_PLAY_EVT_SERVER_RECONNECT:3002,INF_PLAY_EVT_REQUEST_PULL_BEGIN:3003,INF_PLAY_EVT_REQUEST_PULL_SUCCESS:3004,INF_PLAY_EVT_STREAM_FIRST_AUDIO_FRAME:3005,INF_PLAY_EVT_STREAM_FIRST_VIDEO_FRAME:3006,INF_PLAY_EVT_STREAM_CLOSED:3007,INF_PLAY_EVT_STREAM_SWITCH:3008};function a(e,t){var r=Wp(e);if(lp){var n=lp(e);t&&(n=rc(n).call(n,(function(t){return Xp(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?ma(r=a(Object(i),!0)).call(r,(function(t){u(e,t,i[t])})):lf?yf(e,lf(i)):ma(n=a(Object(i))).call(n,(function(t){Vp(e,t,Xp(i,t))}))}return e}function u(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var l,d={streamUrl:"",streamId:function(){return function(e){var t=e.split("?")[0];return qu(t).call(t,Lf(t).call(t,"/")+1,Yf(t).call(t,"?"))}(this.streamUrl)},pullStreamDomain:"https://overseas-webrtc.liveplay.myqcloud.com",stopStreamDomain:"https://overseas-webrtc.liveplay.myqcloud.com",get pullStreamUrl(){return this.pullStreamDomain+"/webrtc/v1/pullstream"},get stopStreamUrl(){return this.stopStreamDomain+"/webrtc/v1/stopstream"}},p=c(c(c(c(c(c(c(c({},{cloudAppid:0,xp2pAppid:0,token:"",xp2pDomain:""}),d),{confBaseUrl:"https://conf.qvb.qcloud.com/api/v3/live/h5/",reportUrl:"https://log.qvb.qcloud.com/reporter/vlive",signal:"wss://signal.qvb.qcloud.com/",stun:"127.0.0.1"}),{trackerUrl:"https://tracker-00.qvb.qcloud.com/api/tracker/v2/htbt",trackerInterval:5e3,trackerVersion:"v1"}),{maxCandidate:5,maxConnected:5,maxConnecting:5,tickInterval:1e4}),{stuckFrameRateRatio:.6}),{subscribeCoolingTime:2e4}),{connectRetryCount:3,connectRetryDelay:1e3}),f=function(){function e(){var e,t,r;e=this,t="config",r=ih({},p),t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}return e.prototype.update=function(e){ih(this.config,e)},e.prototype.get=function(e){return this.config[e]},e.prototype.set=function(e,t){this.config[e]=t},e}();function h(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.base=0]="base",e[e.number=1]="number",e[e.boolean=2]="boolean",e[e.string=3]="string",e[e.array=4]="array",e[e.object=5]="object"}(l||(l={}));var v=function(){function e(e){var t=e.initVal,r=e.defaultVal;h(this,"type",l.base),h(this,"val",void 0),this.val=void 0===t?r:t}return e.prototype.set=function(e){return this.val=e,this},Vp(e.prototype,"value",{get:function(){return this.val},enumerable:!1,configurable:!0}),e.prototype.isString=function(){return this.type===l.string},e.prototype.isBoolean=function(){return this.type===l.boolean},e.prototype.isNumber=function(){return this.type===l.number},e}(),m=function(e){function t(t){var r=this;return h(r=e.call(this,{initVal:t,defaultVal:0})||this,"type",l.number),r}return ic(t,e),t.prototype.plus=function(e){this.val+=e},t.prototype.minus=function(e){this.val-=e},t}(v),y=function(e){function t(t){var r=this;return h(r=e.call(this,{initVal:t,defaultVal:!1})||this,"type",l.boolean),r}return ic(t,e),t}(v),g=function(e){function t(t){var r=this;return h(r=e.call(this,{initVal:t,defaultVal:""})||this,"type",l.string),r}return ic(t,e),t.prototype.append=function(e){this.val+=e},t}(v),b=function(e){function t(t){var r=this;return h(r=e.call(this,{initVal:t,defaultVal:[]})||this,"type",l.array),r}return ic(t,e),t}(v),C=function(e){function t(t){var r=this;return h(r=e.call(this,{initVal:t,defaultVal:{}})||this,"type",l.object),r}return ic(t,e),t}(v),T=function(){function e(){}return e.create=function(e,t){switch(e){case l.number:return new m(t);case l.boolean:return new y(t);case l.string:return new g(t);case l.array:return new b(t);case l.object:return new C(t)}},e}();function S(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _=function(){function e(){S(this,"config",{deleteZeroNumber:!0,fieldsReportedWithZeroNumber:[],fieldsReservedValueAfterReport:[]}),S(this,"registeredReportCallback",new ig),S(this,"storedFields",new Db),S(this,"preHooks",new Db)}return e.prototype.destroy=function(){this.config=null,this.reset()},e.prototype.configure=function(e){this.config=e},e.prototype.reset=function(){this.registeredReportCallback.clear(),this.preHooks.clear()},e.prototype.string=function(e){return this.findOrCreate(l.string,e)},e.prototype.number=function(e){return this.findOrCreate(l.number,e)},e.prototype.bool=function(e){return this.findOrCreate(l.boolean,e)},e.prototype.array=function(e){return this.findOrCreate(l.array,e)},e.prototype.object=function(e){return this.findOrCreate(l.object,e)},e.prototype.deleteField=function(e){this.storedFields.delete(e)},e.prototype.generate=function(){var e,t,r=this;ma(e=this.preHooks).call(e,(function(e){e()}));var n={};return ma(t=this.storedFields).call(t,(function(e,t){var i,o;r.config&&(!r.config.deleteZeroNumber||jn(i=r.config.fieldsReportedWithZeroNumber).call(i,t)||e.isBoolean()||e.isString()||e.value)&&(n[t]=e.value,jn(o=r.config.fieldsReservedValueAfterReport).call(o,t)||r.storedFields.delete(t))})),n},e.prototype.registerPreHook=function(e,t){this.preHooks.has(e)||this.preHooks.set(e,t)},e.prototype.deletePreHook=function(e){this.preHooks.delete(e)},e.prototype.findOrCreate=function(e,t,r){var n=this.storedFields.get(t);return n?(n.type!==e&&(n=T.create(e,r),this.storedFields.set(t,n)),n):(n=T.create(e,r),this.storedFields.set(t,n),n)},e}(),E=function(){function e(){S(this,"reportUnits",new Db)}return e.prototype.registerReportUint=function(e,t){this.reportUnits.has(e)||this.reportUnits.set(e,t)},e.prototype.deleteReportUint=function(e){this.reportUnits.delete(e)},e.prototype.generate=function(){var e,t={};return ma(e=this.reportUnits).call(e,(function(e){ih(t,e.generate())})),t},e}();function R(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var P=0,w=function(e){function t(){var t=this;return R(t=e.call(this)||this,"tagName","Base"),R(t,"objId",0),R(t,"reporter",null),R(t,"bus",null),t.objId=P,P+=1,t}return ic(t,e),Vp(t.prototype,"objName",{get:function(){return this.tagName+"_"+this.objId},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){this.reporter=null,this.removeAllListeners()},t.prototype.setReporter=function(e){return e&&(this.reporter=e),this},t.prototype.setBus=function(e){return this.bus=e,this},t}(t());function k(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var A=function(e){function t(){var t=this;return k(t=e.call(this)||this,"tagName","MediaStreamProcessor"),k(t,"mediaStream",void 0),k(t,"trackGenerator",void 0),k(t,"vwriter",void 0),k(t,"destroyed",!1),t.mediaStream=new MediaStream,t.trackGenerator=new MediaStreamTrackGenerator({kind:"video"}),t.vwriter=t.trackGenerator.writable.getWriter(),t.mediaStream.addTrack(t.trackGenerator),t}return ic(t,e),t.prototype.destroy=function(){this.destroyed=!0,this.vwriter.abort(),this.stopTrack()},t.prototype.getMediaObj=function(){return this.mediaStream},t.prototype.addMediaStreamTrack=function(e){"video"===e.kind?this.onNewVideoTrack(e):"audio"===e.kind&&this.onNewAudioTrack(e)},t.prototype.onNewVideoTrack=function(e){var t=this,r=new MediaStreamTrackProcessor({track:e}),n=new MediaStreamTrackGenerator({kind:"video"}),i=new TransformStream({transform:function(e,r){t.destroyed||t.vwriter.write(e)}});r.readable.pipeThrough(i).pipeTo(n.writable)},t.prototype.onNewAudioTrack=function(e){this.replaceTrack(this.mediaStream,e)},t.prototype.replaceTrack=function(e,t){var r,n,i=e.getTracks();try{for(var o=uc(i),s=o.next();!s.done;s=o.next()){var a=s.value;t.kind===a.kind&&e.removeTrack(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}e.addTrack(t)},t.prototype.stopTrack=function(){var e;ma(e=this.mediaStream.getTracks()).call(e,(function(e){e.stop()}))},t}(w);function O(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var D=function(){function e(e,t,r,n){O(this,"config",void 0),O(this,"requestInfo",void 0),O(this,"init",void 0),O(this,"callbacks",void 0),O(this,"retryTimes",0),O(this,"timeoutTimer",null),O(this,"abortController",null),O(this,"stats",{}),O(this,"res",null),this.config=e,this.requestInfo=t,this.init=r,this.callbacks=n,this.load()}return e.prototype.destroy=function(){this.clearCallbacks(),this.clearTimer(),this.abort()},e.prototype.stat=function(){},e.prototype.abort=function(){var e;this.clearTimer(),null===(e=this.abortController)||void 0===e||e.abort()},e.prototype.load=function(){this.abort(),this.setupRequest()},e.prototype.retry=function(){if(this.abort(),this.retryTimes>=this.config.retry)return this.callbacks.onTimeout(),void this.destroy();this.retryTimes+=1,this.load()},e.prototype.setupRequest=function(){var e=this;this.abortController=new AbortController,this.init.signal=this.abortController.signal,this.res=fetch(this.requestInfo,this.init),this.setupResponse(this.res),this.clearTimer(),this.timeoutTimer=Oa((function(){e.retry()}),this.config.timeout||5e3)},e.prototype.setupResponse=function(e){var t=this;e.then((function(e){return t.clearTimer(),e})).then((function(e){return e.ok?"text"===t.config.resType?e.text():"arraybuffer"===t.config.resType?e.arrayBuffer():e.json():(t.callbacks.onError({status:e.status}),void t.destroy())})).then((function(e){t.callbacks.onSuccess({resData:e}),t.destroy()})).catch((function(e){t.callbacks.onError({status:0}),t.destroy()}))},e.prototype.clearTimer=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)},e.prototype.clearCallbacks=function(){this.callbacks={onError:function(){},onSuccess:function(){},onTimeout:function(){}}},e}();function L(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var M=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return L(n=e.apply(this,dc([],lc(t)))||this,"req",null),L(n,"config",null),n}return ic(t,e),t.prototype.configure=function(e){this.config=e},t.prototype.destroy=function(){this.abort()},t.prototype.load=function(){var e,t,r;if(this.abort(),this.config){var n=this.createUrl();this.req=new D({retry:2,timeout:5e3,resType:"text"},n,{method:"GET"},{onError:jr(e=this.onError).call(e,this),onSuccess:jr(t=this.onSuccess).call(t,this),onTimeout:jr(r=this.onTimeout).call(r,this)})}},t.prototype.onTimeout=function(){this.emit("EVENT_CONF_LOADER_TIMEOUT")},t.prototype.onSuccess=function(e){var t=e.resData;this.emit("EVENT_CONF_LOADER_LOADED",function(e){for(var t="",r=[99,117,105],n=0;n<e.length;n++){var i=Fb(e).call(e,n)^r[n%r.length];t+=Gb(i)}return JSON.parse(t)}(t))},t.prototype.onError=function(e){e.status,this.emit("EVENT_CONF_LOADER_ERROR")},t.prototype.createUrl=function(){if(!this.config)throw Error("[ConfLoader] [createUrl] empty conf");return""+this.config.confBaseUrl+this.config.streamId+"?domain="+this.config.domain+"&d=0×tamp="+Kb()},t.prototype.abort=function(){this.req&&(this.req.destroy(),this.req=null)},t}(e.EventEmitter);function I(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var x=function(){function e(){I(this,"config",null),I(this,"confLoader",new M),I(this,"confTimer",null)}return e.prototype.destroy=function(){this.stop(),this.config=null,this.confLoader.destroy()},e.prototype.configure=function(e){this.config=e,this.confLoader.configure(e)},e.prototype.start=function(){var e=this;if(this.config&&!this.confTimer&&this.config.confInterval){var t=Math.max(this.config.confInterval,6e4);this.confTimer=za((function(){e.confLoader.load()}),t)}},e.prototype.stop=function(){this.clearTimer()},e.prototype.restart=function(){this.stop(),this.start()},Vp(e.prototype,"loader",{get:function(){return this.config?this.confLoader:null},enumerable:!1,configurable:!0}),e.prototype.clearTimer=function(){this.confTimer&&(clearTimeout(this.confTimer),this.confTimer=null)},e}(),N=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n,i,o,s=this;return n=s=e.apply(this,dc([],lc(t)))||this,i="confService",o=new x,i in n?Vp(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o,s}return ic(t,e),t.prototype.destroy=function(){this.confService.destroy()},t.prototype.configure=function(e){this.confService.configure(e);var t=this.confService.loader;t&&this.setupLoader(t)},t.prototype.start=function(){this.confService.start()},t.prototype.load=function(){this.confService.loader&&this.confService.loader.load()},t.prototype.setupLoader=function(e){var t=this;e.on("EVENT_CONF_LOADER_LOADED",(function(e){t.emit("EVENT_CONF_LOADED",e)})),e.on("EVENT_CONF_LOADER_TIMEOUT",(function(){})),e.on("EVENT_CONF_LOADER_ERROR",(function(){}))},t}(e.EventEmitter);function F(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var U=function(){function e(){F(this,"config",null),F(this,"backgroundReportFlag",!1),F(this,"currentReportReq",null)}return e.prototype.destroy=function(){this.config=null,this.clearReportReq()},e.prototype.configure=function(e){this.config=e},e.prototype.enableBackgroundReport=function(){this.backgroundReportFlag=!0},e.prototype.disableBackgroundReport=function(){this.backgroundReportFlag=!1},e.prototype.reportString=function(e){var t=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=[99,117,105],i=0;i<e.length;i++)r[i]=Fb(e).call(e,i)^n[i%n.length];return r}(e);this.report(t)},e.prototype.report=function(e){this.config&&(this.backgroundReportFlag?this.sendBackground(this.config.reportUrl,e):this.sendWithFetch(this.config.reportUrl,e))},e.prototype.sendBackground=function(e,t){var r;null!==(r=navigator)&&void 0!==r&&r.sendBeacon&&navigator.sendBeacon(e,t)},e.prototype.sendWithFetch=function(e,t){this.currentReportReq=new D({retry:2,timeout:6e3,resType:"text"},e,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:t},{onError:function(){},onSuccess:function(){},onTimeout:function(){}})},e.prototype.clearReportReq=function(){this.currentReportReq&&(this.currentReportReq.destroy(),this.currentReportReq=null)},e}();function V(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var j=function(){function e(){V(this,"beforeUnloadListener",null),V(this,"beforeUnloadCallback",null),V(this,"collectCallback",null),V(this,"reportTimer",null),V(this,"reporter",new U),V(this,"config",null)}return e.prototype.destroy=function(){var e;this.stop(),this.collectCallback=null,this.config=null,this.removeBeforeUnloadReport(),null===(e=this.reporter)||void 0===e||e.destroy(),this.reporter=null},e.prototype.configure=function(e){var t;this.config=e,null===(t=this.reporter)||void 0===t||t.configure(e)},e.prototype.setCollectCallback=function(e){this.collectCallback=e},e.prototype.start=function(){var e,t=this;this.reportTimer||(this.reportTimer=za((function(){t.autoCollectAndReport()}),Math.max((null===(e=this.config)||void 0===e?void 0:e.interval)||0,6e4)))},e.prototype.stop=function(){this.clearTimer()},e.prototype.restart=function(){this.stop(),this.start()},e.prototype.backgroundAutoReport=function(){var e,t;null===(e=this.reporter)||void 0===e||e.enableBackgroundReport(),this.autoCollectAndReport(),null===(t=this.reporter)||void 0===t||t.disableBackgroundReport()},e.prototype.autoCollectAndReport=function(){var e;if(this.collectCallback){var t=this.collectCallback(),r=$b(t);null===(e=this.reporter)||void 0===e||e.reportString(r)}},e.prototype.manualReport=function(e){var t,r=$b(e);null===(t=this.reporter)||void 0===t||t.reportString(r)},e.prototype.enableBeforeUnloadReport=function(e){var t=this;this.removeBeforeUnloadReport(),this.beforeUnloadCallback=e||null,this.beforeUnloadListener=function(){t.beforeUnloadCallback&&t.beforeUnloadCallback(),t.backgroundAutoReport()},window.addEventListener("beforeunload",this.beforeUnloadListener)},e.prototype.removeBeforeUnloadReport=function(){this.beforeUnloadListener&&(this.beforeUnloadCallback=null,window.removeEventListener("beforeunload",this.beforeUnloadListener),this.beforeUnloadListener=null)},e.prototype.clearTimer=function(){this.reportTimer&&(clearInterval(this.reportTimer),this.reportTimer=null)},e}(),B=function(){var e="qvb_leb_uuid",t=localStorage.getItem(e);return t||(t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),localStorage.setItem(e,t)),t},W="",Y=function(){return W};B();var q="1.0.5";function G(e,t){var r=Wp(e);if(lp){var n=lp(e);t&&(n=rc(n).call(n,(function(t){return Xp(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?ma(r=G(Object(i),!0)).call(r,(function(t){H(e,t,i[t])})):lf?yf(e,lf(i)):ma(n=G(Object(i))).call(n,(function(t){Vp(e,t,Xp(i,t))}))}return e}function H(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Q,K=z(z(z(z({},{}),{}),{CDN_BYTES:"cdn_bytes",P2P_BYTES:"p2p_bytes"}),{appid:"appid",platform:"platform",type:"type",partner:"partner",uuid:"str_user_id",playid:"str_play_id"});function J(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.beforeunload=0]="beforeunload",e[e.destroy=1]="destroy",e[e.rollback=2]="rollback"}(Q||(Q={}));var Z,X=function(){function e(){var e;J(this,"reportService",new j),J(this,"dataCollecor",new E),J(this,"basicReportUnit",new _),J(this,"config",null),J(this,"startTime",Kb()),this.basicReportUnit.configure({deleteZeroNumber:!0,fieldsReportedWithZeroNumber:[],fieldsReservedValueAfterReport:[]}),this.reportService.setCollectCallback(jr(e=this.collectCallback).call(e,this))}return e.prototype.destroy=function(){this.tryToSetCloseReason(Q.destroy),this.reportService.backgroundAutoReport(),this.reportService.destroy()},e.prototype.configure=function(e){return this.config=e,this.reportService.configure(e),this},e.prototype.init=function(){var e=this;this.reportService.enableBeforeUnloadReport((function(){e.tryToSetCloseReason(Q.beforeunload)}))},e.prototype.start=function(){this.reportService.start()},e.prototype.registerReportUint=function(e,t){this.dataCollecor.registerReportUint(e,t)},e.prototype.deleteReportUint=function(e){this.dataCollecor.deleteReportUint(e)},e.prototype.tryToSetCloseReason=function(e){e!==Q.beforeunload?e!==Q.rollback?e===Q.destroy&&(this.basicReportUnit.string("exit_reason").value||this.basicReportUnit.string("exit_reason").set("destroy")):this.basicReportUnit.string("exit_reason").set("rollback"):this.basicReportUnit.string("exit_reason").set("close")},e.prototype.initBasicReportField=function(){if(!this.config)throw Error("report missing config");var e=this.basicReportUnit;return e.number(K.appid).set(this.config.cloudAppid),e.number(K.partner).set(this.config.xp2pAppid),e.number(K.platform).set(31),e.string(K.uuid).set(B()),e.string(K.playid).set(Y()),e.string("referer").set(window.location.href),e.string("user_agent").set(window.navigator.userAgent),e.number("cur_time").set(Kb()),e.string("version").set(q),e.number("data_time").set(Math.round(Kb()/1e3)),e.number("data_type").set(2),e.string("channel").set(this.config.streamId()),e.string("url").set(this.config.streamUrl),e.string("str_video_type").set("webrtc"),e.generate()},e.prototype.collectCallback=function(){var e=this.initBasicReportField();return this.basicReportUnit.number("play_started").set(Math.floor(Kb()-this.startTime)/1e3),e.i=this.dataCollecor.generate(),e},e}();function $(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.new=0]="new",e[e.connecting=1]="connecting",e[e.connected=2]="connected",e[e.disconnected=3]="disconnected",e[e.closed=4]="closed",e[e.fail=5]="fail",e[e.timeout=6]="timeout"}(Z||(Z={}));var ee,te="closed",re="timeout",ne="disconnect",ie="track",oe="connected",se="error",ae="failed",ce="stuck",ue=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return $(n=e.apply(this,dc([],lc(t)))||this,"videoEncodedFrameCache",null),$(n,"audioEncodedFrameCache",null),$(n,"sourceConfig",null),$(n,"peer",null),$(n,"statUnit",null),$(n,"reportUnit",new _),$(n,"timeoutTimer",null),$(n,"closed",!1),$(n,"peerManager",null),$(n,"syncController",null),$(n,"streamInfo",null),n}return ic(t,e),t.prototype.destroy=function(){this.peerManager=null,this.syncController=null,this.peer=null,this.streamInfo=null,e.prototype.destroy.call(this)},t.prototype.load=function(){this.setTimeout()},t.prototype.close=function(){var e,t=this;if(!this.sourceConfig)throw new Error;this.peerManager&&(this.closed=!0,this.clearTimeout(),null===(e=this.peerManager.getPeer(this.sourceConfig.srcPid))||void 0===e||e.getConnection().destroy(),Oa((function(){t.destroy()})))},t.prototype.isLeb=function(){return!1},t.prototype.setPeerManager=function(e){return this.peerManager=e,this},t.prototype.setStatUnit=function(e){return this.statUnit=e,this},Vp(t.prototype,"pid",{get:function(){var e;return null===(e=this.sourceConfig)||void 0===e?void 0:e.srcPid},enumerable:!1,configurable:!0}),t.prototype.setReporter=function(t){return null==t||t.registerReportUint(this.objName,this.reportUnit),e.prototype.setReporter.call(this,t)},t.prototype.setEncodedVideoChunkCache=function(e){return this.videoEncodedFrameCache=e,this},t.prototype.setEncodedAudioChunkCache=function(e){return this.audioEncodedFrameCache=e,this},t.prototype.setSyncController=function(e){return this.syncController=e,this},t.prototype.setStreamInfo=function(e){return this.streamInfo=e,this},t.prototype.setTimeout=function(){var e=this;this.timeoutTimer=Oa((function(){e.emit(re)}),5e3)},t.prototype.clearTimeout=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)},t.prototype.listenConnection=function(e){var t,r=this,n={srcPid:null===(t=this.sourceConfig)||void 0===t?void 0:t.srcPid};e.on("closed",(function(){r.emit(te,n)})),e.on("failed",(function(){r.emit(ae,n)})),e.on("disconnected",(function(){r.emit(ne,n)})),e.on("connected",(function(){r.emit(oe,n)})),e.on("error",(function(e){r.emit(se,e)})),e.on(i,(function(e){r.emit(i,e)})),e.pc.setOnTrackCallback((function(t){r.clearTimeout(),r.onTrack(t,e)}))},t.prototype.onTrack=function(e,t){},t.prototype.emitTrack=function(e,t){var r;this.emit(ie,{srcPid:null===(r=this.sourceConfig)||void 0===r?void 0:r.srcPid,track:e,rtcPeerConnction:t.getRTCPeerConnection()})},t}(w);function le(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.P2P="P2P",e.CDN="CDN",e.None="None"}(ee||(ee={}));var de=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return le(n=e.apply(this,dc([],lc(t)))||this,"tagName","Dispatch"),le(n,"mediaStreamProcessor",null),le(n,"streamUrl",""),le(n,"cdnPid",""),le(n,"p2pTimer",null),le(n,"subscriber",null),le(n,"config",null),le(n,"sourceType",ee.None),le(n,"reportUnit",new _),le(n,"statsVar",{loadok:!1,loadStartTime:0}),le(n,"cdnRetryCtrl",{totalRetryTimes:3,leftRetryTimes:3,retryDelay:0,reset:function(){this.leftRetryTimes=this.totalRetryTimes},retry:function(){this.leftRetryTimes-=1},allowedToRetry:function(){return this.leftRetryTimes>0}}),n}return ic(t,e),t.prototype.destroy=function(){this.clearP2PTimer()},t.prototype.setMediaStreamProcessor=function(e){this.mediaStreamProcessor=e},t.prototype.setSubscriber=function(e){this.subscriber=e},t.prototype.setReporter=function(t){return null==t||t.registerReportUint(this.objName,this.reportUnit),e.prototype.setReporter.call(this,t)},t.prototype.configure=function(e){this.config=e,this.configCdnRetryCtrl(e)},t.prototype.load=function(e){var t=this;this.streamUrl=e,this.reportUnit.number("request").set(1),this.statsVar.loadStartTime=Kb();var r=this.loadFromCdn(this.streamUrl);return r&&this.statsStartStream(r),this.clearP2PTimer(),this.p2pTimer=za((function(){t.loadFromP2P()}),5e3),$_.resolve()},t.prototype.configCdnRetryCtrl=function(e){this.cdnRetryCtrl.totalRetryTimes=e.connectRetryCount,this.cdnRetryCtrl.leftRetryTimes=e.connectRetryCount,this.cdnRetryCtrl.retryDelay=e.connectRetryDelay},t.prototype.loadFromCdn=function(e){var t=this;if(!this.subscriber)throw Error("missing subscriber");if(!this.config)throw Error("missing config");if(this.cdnRetryCtrl.allowedToRetry()){this.cdnRetryCtrl.retry();var r=function(){function e(){}return e.create=function(){return"lebcdn_"+Kb()},e.isCdnPid=function(e){return Ga(e).call(e,"lebcdn_")},e}().create(),n=this.subscriber.subscribeLEB({pullStreamUrl:this.config.pullStreamUrl,stopStreamUrl:this.config.stopStreamUrl,streamUrl:e,srcPid:r,param:{uuid:B(),playid:Y()}});return n.on(ie,(function(e){var r;"video"===e.track.kind&&t.cdnRetryCtrl.reset(),t.sourceType!==ee.CDN&&(t.sourceType=ee.CDN,null===(r=t.bus)||void 0===r||r.emit(o,{code:s.INF_PLAY_EVT_STREAM_SWITCH,msg:"鍒囨崲鍒癈DN鎷夋祦",data:{source:"CDN"}})),t.onNewSourceTrack(e)})).once(oe,(function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:s.INF_PLAY_EVT_SERVER_CONNECTED,msg:"宸茬粡杩炴帴鍒癱dn鏈嶅姟鍣�"})})).once(ne,(function(){var e;t.reloadCDNAsync({from:"cdn",reason:r+"-DISCONNECT"}),null===(e=t.bus)||void 0===e||e.emit(o,{code:s.INF_PLAY_EVT_SERVER_RECONNECT,msg:"杩炴帴cdn鏈嶅姟鍣ㄥけ璐ワ紝宸插惎鍔ㄨ嚜鍔ㄩ噸杩炴仮澶�"})})).once(ae,(function(){t.reloadCDNAsync({from:"cdn",reason:r+"-FAILED"})})).once(se,(function(e){t.reloadCDNAsync({from:"cdn",reason:r+"-ERROR"})})).once(te,(function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:s.INF_PLAY_EVT_STREAM_CLOSED,msg:"娴佽鍏抽棴浜�"})})),n}Oa((function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:s.ERR_LOAD_REACH_MAX_RETRY,msg:"宸茶揪鏈€澶DN閲嶈瘯娆℃暟: "+t.cdnRetryCtrl.totalRetryTimes})}))},t.prototype.loadFromP2P=function(e){var t=this;if(this.subscriber){var r=this.subscriber.subscribeP2P(e);return r?(r.on(ie,(function(e){var r;t.sourceType!==ee.P2P&&(t.sourceType=ee.P2P,null===(r=t.bus)||void 0===r||r.emit(o,{code:s.INF_PLAY_EVT_STREAM_SWITCH,msg:"鍒囨崲鍒癙2P鎷夋祦",data:{source:"P2P"}})),t.onNewSourceTrack(e)})).once(ne,(function(){t.reloadCDNAsync({from:"p2p",reason:"p2p-DISCONNECT"})})).once(ce,(function(){t.reloadCDNAsync({from:"p2p",reason:"p2p-STUCK"})})).once(te,(function(){})),r):void 0}},t.prototype.onNewSourceTrack=function(e){var t=this;return new $_((function(t){t(e)})).then((function(){if(!t.mediaStreamProcessor)throw Error("miss mediaStreamProcessor");t.mediaStreamProcessor.addMediaStreamTrack(e.track)})).catch((function(e){e.fatal}))},t.prototype.reloadCDNAsync=function(e){var t=this,r=e.from;e.reason;var n="p2p"===r?0:this.cdnRetryCtrl.retryDelay;Oa((function(){t.loadFromCdn(t.streamUrl)}),n)},t.prototype.statsStartStream=function(e){var t=this;e.on(re,(function(){t.statsVar.loadok||t.reportUnit.string("exit_reason").set("play_timeout"),Oa((function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:s.ERR_LOAD_TIMEOUT,msg:"鎷夋祦瓒呮椂"})}))})).on(ie,(function(e){"video"===e.track.kind&&(t.statsVar.loadok||(t.reportUnit.number("loadok_t").set(Kb()-t.statsVar.loadStartTime),t.statsVar.loadok=!0))})).on(i,(function(e){var r;null===(r=t.bus)||void 0===r||r.emit(o,e)}))},t.prototype.clearP2PTimer=function(){this.p2pTimer&&(clearInterval(this.p2pTimer),this.p2pTimer=null)},t}(w);function pe(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var fe=function(e){function t(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this;return pe(i=e.apply(this,dc([],lc(r)))||this,"serverName","DefaultServer"),pe(i,"transport",null),pe(i,"router",new Db),pe(i,"triggerHandler",jr(t=i.triggerAPI).call(t,i)),i}return ic(t,e),t.prototype.destroy=function(){var t;null===(t=this.transport)||void 0===t||t.removeListener(this.serverName,this.triggerHandler),e.prototype.destroy.call(this)},t.prototype.setTransport=function(e){this.transport=e,e.on(this.serverName,this.triggerHandler)},t.prototype.registerAPI=function(e,t){this.router.set(e,t)},t.prototype.deleteAPI=function(e){this.router.delete(e)},t.prototype.triggerAPI=function(e){var t=this.router.get(""+e.path);t&&t(e)},t}(w),he=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n,i,o,s=this;return o="P2PServer",(i="serverName")in(n=s=e.apply(this,dc([],lc(t)))||this)?Vp(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o,s}return ic(t,e),t}(fe);function ve(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var me=0,ye=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return ve(n=e.apply(this,dc([],lc(t)))||this,"tagName","TempClient"),ve(n,"transport",null),ve(n,"localPid",""),n}return ic(t,e),t.prototype.setTransport=function(e){this.transport=e},t.prototype.setLocalPid=function(e){this.localPid=e},t.prototype.destroy=function(){this.transport=null,e.prototype.destroy.call(this)},t.prototype.request=function(e){var t;null===(t=this.transport)||void 0===t||t.send({host:e.host,path:""+e.path,from:e.from||this.localPid,to:e.to,type:e.type||"app",payload:e.payload,requestId:"req_"+Kb()+"_"+(me+=1)})},t}(w);function ge(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var be=function(e){function t(t,r){var n=this;return ge(n=e.call(this)||this,"tag","WS"),ge(n,"url",""),ge(n,"id",""),ge(n,"options",{retry:0}),ge(n,"ws",null),n.url=t,n.options=r,n.init(),n}return ic(t,e),t.prototype.destroy=function(){var t;null===(t=this.ws)||void 0===t||t.close(),this.ws=null,this.id="",e.prototype.destroy.call(this)},t.prototype.send=function(e,t){var r;null===(r=this.ws)||void 0===r||r.send("S "+e+" "+t)},t.prototype.init=function(){var e,t,r,n;WebSocket&&(this.ws=new WebSocket(this.url),this.ws.onopen=jr(e=this.onOpen).call(e,this),this.ws.onmessage=jr(t=this.onMessage).call(t,this),this.ws.onclose=jr(r=this.onClose).call(r,this),this.ws.onerror=jr(n=this.onError).call(n,this))},t.prototype.onOpen=function(){},t.prototype.onMessage=function(e){var t=e.data.substring(0,1);if("C"===t)this.id=e.data.substring(2),this.emit("EVENT_WS_ID",this.id);else if("S"===t){var r=e.data.substring(29);this.emit("EVENT_WS_MESSAGE",r)}},t.prototype.onClose=function(){},t.prototype.onError=function(){},t}(w),Ce=r(961),Te=r.n(Ce);function Se(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _e=function(){function e(){Se(this,"totalBlock",0),Se(this,"recvBlock",0),Se(this,"blocks",new Db)}return e.prototype.getFullContent=function(){if(!this.complete())return null;for(var e="",t=0;t<this.totalBlock;t+=1)e+=this.blocks.get(t);return e},e.prototype.set=function(e,t,r){this.blocks.has(e)||(this.blocks.set(e,t),this.totalBlock=r,this.recvBlock+=1)},e.prototype.complete=function(){return this.totalBlock===this.recvBlock},e}(),Ee=function(){function e(){Se(this,"messages",new Db)}return e.prototype.set=function(e,t){var r=t.curIndex,n=t.total,i=t.block,o=this.messages.get(e);o||(o=new _e,this.messages.set(e,o)),o.set(r,i,n)},e.prototype.get=function(e){var t;return null===(t=this.messages.get(e))||void 0===t?void 0:t.getFullContent()},e.prototype.delete=function(e){this.messages.delete(e)},e}(),Re=function(){function e(){}return e.split=function(e){for(var t=Kb(),r=[],n=5e3,i=Math.ceil(e.length/n),o=0;o<i;o++){var s=t+"-"+o+"-"+i+"#";r.push(""+s+qu(e).call(e,o*n,(o+1)*n))}return r},e.extract=function(e){var t=Yf(e).call(e,"#"),r=qu(e).call(e,0,t+1),n=qu(e).call(e,t+1),i=lc(r.split("-"),3),o=i[0],s=i[1],a=i[2];return{key:o,index:TE(s,10),total:TE(a,10),content:n}},e}();function Pe(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var we="EVENT_SIGNAL_ID",ke="EVENT_SIGNAL_MESSAGE",Ae=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return Pe(n=e.apply(this,dc([],lc(t)))||this,"id",""),Pe(n,"tag","Signal"),Pe(n,"messageCache",new Ee),Pe(n,"ws",null),Pe(n,"url",""),n}return ic(t,e),t.prototype.connect=function(e){this.url=e,this.init()},t.prototype.destroy=function(){this.ws&&this.ws.destroy(),this.ws=null,this.id="",e.prototype.destroy.call(this)},t.prototype.ready=function(){return!!this.id},t.prototype.send=function(e,t){var r,n=this,i=Te().compressToBase64(t);ma(r=Re.split(i)).call(r,(function(t){var r;null===(r=n.ws)||void 0===r||r.send(e,t)}))},t.prototype.init=function(){var e=this;this.ws||(this.ws=new be(this.url,{retry:0}),this.ws.on("EVENT_WS_ID",(function(t){e.id=t,e.emit("EVENT_SIGNAL_ID",t)})),this.ws.on("EVENT_WS_MESSAGE",(function(t){var r=Re.extract(t);e.messageCache.set(r.key,{curIndex:r.index,total:r.total,block:r.content});var n=e.messageCache.get(r.key);if(n){e.messageCache.delete(r.key);var i=Te().decompressFromBase64(n);e.emit("EVENT_SIGNAL_MESSAGE",i)}})))},t}(w),Oe=function(){function e(){var e,t,r;e=this,t="rules",r=new ig,t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}return e.prototype.destroy=function(){this.rules.clear()},e.prototype.addRule=function(e){this.rules.add(e)},e.prototype.match=function(e){var t,r;try{for(var n=uc(this.rules),i=n.next();!i.done;i=n.next())if(i.value.match(e))return!0}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!1},e}(),De=function(){function e(){}return e.prototype.destroy=function(){},e.prototype.score=function(){return 0},e}();function Le(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Me=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return Le(n=e.apply(this,dc([],lc(t)))||this,"tagName","Peer"),Le(n,"pid",""),Le(n,"refreshTime",Kb()),Le(n,"info",null),Le(n,"scorer",new De),Le(n,"filter",new Oe),Le(n,"connection",null),n}return ic(t,e),t.prototype.setPid=function(e){this.pid=e},t.prototype.setConnection=function(e){this.connection=e},t.prototype.getConnection=function(){if(!this.connection)throw Error("empty conn");return this.connection},t.prototype.setFilter=function(e){this.filter=e},t.prototype.setScorer=function(e){this.scorer=e},t.prototype.destroy=function(){var t;this.scorer.destroy(),rc(this).destroy(),null===(t=this.connection)||void 0===t||t.destroy(),this.connection=null,e.prototype.destroy.call(this)},t.prototype.fresh=function(){return Kb()-this.refreshTime<6e4},t}(w);function Ie(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var xe=function(e){function t(t,r){var n,i,o=t.pid,s=this;return Ie(s=e.call(this)||this,"rtcPC",void 0),Ie(s,"pid",""),Ie(s,"onIceCandidateCallback",null),s.pid=o,s.tagName="PeerConnection_"+o,s.rtcPC=new RTCPeerConnection(r),s.rtcPC.onicecandidate=jr(n=s.onIceCandidate).call(n,s),s.rtcPC.oniceconnectionstatechange=jr(i=s.onIceConnectionStateChange).call(i,s),s}return ic(t,e),t.prototype.destroy=function(){this.rtcPC.close(),this.onIceCandidateCallback=null,e.prototype.destroy.call(this)},t.prototype.setOnTrackCallback=function(e){this.rtcPC.ontrack=e},t.prototype.clearOnTrackCallbak=function(){this.rtcPC.ontrack=null},t.prototype.setOnIceCandidateCallback=function(e){this.onIceCandidateCallback=e},t.prototype.createOffer=function(e){var t=this;return this.rtcPC.createOffer(e).then((function(e){return t.rtcPC.setLocalDescription(e)})).then((function(){return t.rtcPC.localDescription})).catch((function(t){return $_.reject({code:s.ERR_PLAY_WEBRTC_FAIL,msg:"createOffer fail, offer: "+e})}))},t.prototype.recvOffer=function(e){return this.rtcPC.setRemoteDescription(new RTCSessionDescription(e))},t.prototype.createAnswer=function(){var e=this;return this.rtcPC.createAnswer().then((function(t){return e.rtcPC.setLocalDescription(t)})).then((function(){return e.rtcPC.localDescription}))},t.prototype.recvAnswer=function(e){return this.rtcPC.setRemoteDescription(new RTCSessionDescription(e)).catch((function(t){return $_.reject({code:s.ERR_PLAY_WEBRTC_FAIL,msg:"setRemoteDescription fail, answer: "+e.sdp})}))},t.prototype.recvCandidate=function(e){if(e)return this.rtcPC.addIceCandidate(new RTCIceCandidate(e))},t.prototype.onIceCandidate=function(e){var t=null==e?void 0:e.candidate;null!=t&&t.candidate&&this.onIceCandidateCallback&&this.onIceCandidateCallback(t.toJSON())},t.prototype.onIceConnectionStateChange=function(){this.rtcPC.iceConnectionState,"failed"===this.rtcPC.iceConnectionState&&this.rtcPC.restartIce()},t}(w);function Ne(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Fe=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return Ne(n=e.apply(this,dc([],lc(t)))||this,"tagName","DataChannel"),Ne(n,"rtcDataChannel",null),Ne(n,"config",null),Ne(n,"pc",null),n}return ic(t,e),t.prototype.configure=function(e){return this.config=e,this},t.prototype.destroy=function(){var e;null===(e=this.rtcDataChannel)||void 0===e||e.close(),this.rtcDataChannel=null,this.pc=null},t.prototype.setRTCPeerConnection=function(e){return this.pc=e,this},t.prototype.init=function(){if(!this.config||!this.pc)throw Error("missing param");return this.rtcDataChannel=this.pc.createDataChannel(this.config.label,{id:this.config.id,negotiated:!0}),this.setCallback(this.rtcDataChannel),this},t.prototype.setCallback=function(e){var t=this;e.onopen=function(){t.emit("open")},e.onmessage=function(e){t.emit(e.data)},e.onerror=function(e){t.emit("error")},e.onclosing=function(){t.emit("closing")},e.onclose=function(){t.emit("close")}},t}(w);function Ue(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ve=function(e){function t(t,r){var n=this;return Ue(n=e.call(this)||this,"tagName","P2PConnection"),Ue(n,"pc",void 0),Ue(n,"connInit",void 0),Ue(n,"makingOffer",!1),Ue(n,"isSettingRemoteAnswerPending",!1),Ue(n,"closed",!1),Ue(n,"connectTimer",null),Ue(n,"nego",!1),Ue(n,"dc",void 0),Ue(n,"destroyed",!1),n.connInit=t,n.tagName="P2PConnection_"+n.connInit.targetPid,n.pc=new xe({pid:t.targetPid},r),n.dc=new Fe,n}return ic(t,e),t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dc.destroy(),this.pc.destroy(),this.close(),e.prototype.destroy.call(this))},t.prototype.getRTCPeerConnection=function(){return this.pc.rtcPC},t.prototype.init=function(){var e,t=this;this.on("EVENT_P2P_SIGNAL_RECV",jr(e=this.recvSignalMessage).call(e,this)),this.pc.setOnIceCandidateCallback((function(e){t.sendSignal({from:t.connInit.localPid,to:t.connInit.targetPid,type:"iceCandidate",payload:e})})),this.pc.rtcPC.onnegotiationneeded=function(){return ac(t,void 0,void 0,(function(){return cc(this,(function(e){switch(e.label){case 0:return this.nego=!0,[4,this.connect()];case 1:return e.sent(),this.nego=!1,[2]}}))}))},this.pc.rtcPC.onconnectionstatechange=function(){var e=t.pc.rtcPC.connectionState;t.emit(e)},this.dc.setRTCPeerConnection(this.pc.rtcPC).configure({label:"base",id:0}).init().on("error",(function(){t.emit("disconnected")}))},t.prototype.recvSignalMessage=function(e){return ac(this,void 0,void 0,(function(){var t;return cc(this,(function(r){switch(r.label){case 0:switch(e.type){case"answer":return[3,1];case"offer":return[3,5];case"iceCandidate":return[3,10]}return[3,13];case 1:return r.trys.push([1,3,,4]),this.isSettingRemoteAnswerPending=!0,[4,this.pc.recvAnswer(e.payload)];case 2:return r.sent(),this.isSettingRemoteAnswerPending=!1,[3,4];case 3:return r.sent(),[3,4];case 4:case 9:return[3,13];case 5:return r.trys.push([5,8,,9]),this.ignoreOffer?[2]:[4,this.pc.recvOffer(e.payload)];case 6:return r.sent(),[4,this.pc.rtcPC.setLocalDescription()];case 7:return r.sent(),(t=this.pc.rtcPC.localDescription)?(this.sendSignal({from:this.connInit.localPid,to:this.connInit.targetPid,type:"answer",payload:t}),[3,9]):[2];case 8:return r.sent(),[3,9];case 10:return r.trys.push([10,12,,13]),[4,this.pc.recvCandidate(e.payload)];case 11:return r.sent(),[3,13];case 12:return r.sent(),this.ignoreOffer,[3,13];case 13:return[2]}}))}))},t.prototype.connect=function(){return ac(this,void 0,void 0,(function(){var e,t;return cc(this,(function(r){switch(r.label){case 0:if(!this.nego)return[2];e={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this.makingOffer=!0,r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this.pc.createOffer(e)];case 2:return(t=r.sent())?(this.sendSignal({from:this.connInit.localPid,to:this.connInit.targetPid,type:"offer",payload:t}),[3,5]):[2];case 3:return r.sent(),[3,5];case 4:return this.makingOffer=!1,[7];case 5:return[2]}}))}))},t.prototype.close=function(){this.closed||(this.closed=!0,this.emit("closed"))},t.prototype.sendSignal=function(e){this.emit("EVENT_P2P_SIGNAL_SEND",e)},Vp(t.prototype,"politeRole",{get:function(){var e=this.connInit;return e.localPid>e.targetPid},enumerable:!1,configurable:!0}),Vp(t.prototype,"readyForOffer",{get:function(){return!this.makingOffer&&("stable"===this.pc.rtcPC.signalingState||this.isSettingRemoteAnswerPending)},enumerable:!1,configurable:!0}),Vp(t.prototype,"offerCollision",{get:function(){return!this.readyForOffer},enumerable:!1,configurable:!0}),Vp(t.prototype,"ignoreOffer",{get:function(){return!this.politeRole&&this.offerCollision},enumerable:!1,configurable:!0}),t}(w);function je(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Be=0,We=function(e){function t(t,r){var n=this;return je(n=e.call(this)||this,"tagName","LEBConnection"),je(n,"pc",void 0),je(n,"initConfig",void 0),je(n,"svrSig",""),je(n,"closed",!1),je(n,"sessionId",Kb()),je(n,"destroyed",!1),n.initConfig=t,n.tagName=n.tagName+"_"+n.initConfig.srcPid,n.pc=new xe({pid:t.srcPid},r),n.pc.rtcPC.onconnectionstatechange=function(){var e=n.pc.rtcPC.connectionState;n.emit(e)},n.pc.rtcPC.oniceconnectionstatechange=function(){n.pc.rtcPC.connectionState},n}return ic(t,e),Vp(t.prototype,"isSdpStreamUrl",{get:function(){return/^https?:\/\/.+\.sdp/.test(this.initConfig.streamUrl)},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.close(),this.pc.destroy(),e.prototype.destroy.call(this))},t.prototype.getRTCPeerConnection=function(){return this.pc.rtcPC},t.prototype.connect=function(){return ac(this,void 0,void 0,(function(){var e,t,r,n,o;return cc(this,(function(a){switch(a.label){case 0:e={offerToReceiveAudio:!0,offerToReceiveVideo:!0,voiceActivityDetection:!1},a.label=1;case 1:return a.trys.push([1,7,,8]),[4,this.pc.createOffer(e)];case 2:return t=a.sent(),this.emit(i,{code:s.INF_PLAY_EVT_REQUEST_PULL_BEGIN,msg:"寮€濮嬫媺娴佹椂瑙﹀彂",data:{localsdp:null==t?void 0:t.sdp,sessionid:this.sessionId}}),this.isSdpStreamUrl?[4,this.fetchStreamSdp(t)]:[3,4];case 3:return n=a.sent(),[3,6];case 4:return[4,this.fetchStream(t)];case 5:n=a.sent(),a.label=6;case 6:return r=n,this.svrSig=r.svrsig,this.emit(i,{code:s.INF_PLAY_EVT_REQUEST_PULL_SUCCESS,msg:"鎷夋祦鎴愬姛鍚庤Е鍙�",data:{localsdp:null==t?void 0:t.sdp,remotesdp:r.remotesdp.sdp,sessionid:this.sessionId}}),this.pc.recvAnswer(r.remotesdp),[3,8];case 7:return o=a.sent(),this.emit(i,o),this.emit("error",{errcode:0,errmsg:"leb pull stream fetch error: "+o}),[3,8];case 8:return[2]}}))}))},t.prototype.fetchStream=function(e){return ac(this,void 0,void 0,(function(){var t,r,n,i;return cc(this,(function(o){switch(o.label){case 0:t={streamurl:""+this.initConfig.streamUrl,sessionid:this.sessionId,clientinfo:this.initConfig.param.uuid,localsdp:e,seipass:1},r=this.initConfig.pullStreamUrl+"?from="+this.initConfig.srcPid+"&uuid="+this.initConfig.param.uuid+"&playid="+this.initConfig.param.playid+"&sessionid="+this.sessionId+"&reqCounter="+(Be+=1),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(r,{method:"POST",body:$b(t),headers:{"Content-Type":"application/json"}})];case 2:return[4,o.sent().json()];case 3:return[2,(n=o.sent()).errcode||!n.svrsig?$_.reject({code:s.ERR_PLAY_REQUEST_PULL_FAIL,msg:"鎷夋祦鎺モ紳鍚庡彴杩斿洖鎶ラ敊",data:n}):n];case 4:return i=o.sent(),[2,$_.reject({code:s.ERR_FETCH_REQUEST_FAIL,msg:"鎷夋祦鎺モ紳缃戠粶寮傚父",data:{from:"PULL_STREAM",url:r,error:i}})];case 5:return[2]}}))}))},t.prototype.fetchStreamSdp=function(e){return ac(this,void 0,void 0,(function(){var t,r,n,i,o,a,c,u;return cc(this,(function(l){switch(l.label){case 0:return t={version:"v1.0",sessionid:this.sessionId,localSdp:e},[4,fetch(this.initConfig.streamUrl,{method:"POST",body:$b(t),headers:{"Content-Type":"application/json"}})];case 1:r=l.sent(),l.label=2;case 2:return l.trys.push([2,4,,5]),[4,r.json()];case 3:return n=l.sent(),i=n.code,o=n.message,a=n.remoteSdp,c=n.svrsig,200!==i?[2,$_.reject({code:s.ERR_PLAY_REQUEST_PULL_FAIL,msg:"鎷夋祦鎺モ紳鍚庡彴杩斿洖鎶ラ敊",data:n})]:[2,{remotesdp:a,svrsig:c,errcode:0,errmsg:o}];case 4:return u=l.sent(),[2,$_.reject({code:s.ERR_FETCH_REQUEST_FAIL,msg:"鎷夋祦鎺モ紳缃戠粶寮傚父",data:{from:"PULL_STREAM",url:this.initConfig.streamUrl,error:u}})];case 5:return[2]}}))}))},t.prototype.close=function(){return ac(this,void 0,void 0,(function(){return cc(this,(function(e){switch(e.label){case 0:return this.closed?[3,2]:(this.closed=!0,this.emit("closed"),[4,this.closeLeb()]);case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},t.prototype.closeLeb=function(){return ac(this,void 0,void 0,(function(){var e,t,r;return cc(this,(function(n){switch(n.label){case 0:if(this.isSdpStreamUrl&&!this.svrSig)return[2];e={streamurl:this.initConfig.streamUrl,svrsig:this.svrSig},t=this.initConfig.stopStreamUrl+"?from="+this.initConfig.srcPid,n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(t,{method:"post",body:$b(e),headers:{"Content-Type":"application/json"}})];case 2:return[4,n.sent().json()];case 3:return(r=n.sent()).errcode&&(this.emit("error",{errcode:1,errmsg:"leb stop stream response error: errcode: "+r.errcode+", errmsg: "+r.errmsg}),this.emit(i,{code:s.ERR_PLAY_REQUEST_STOP_FAIL,msg:"鍋滄祦鎺モ紳鍚庡彴杩斿洖鎶ラ敊",data:{url:t}})),[3,5];case 4:return n.sent(),this.emit(i,{code:s.ERR_FETCH_REQUEST_FAIL,msg:"鍋滄祦鎺モ紳缃戠粶寮傚父",data:{from:"STOP_STREAM",url:t}}),[3,5];case 5:return[2]}}))}))},t}(w);function Ye(e,t){var r=Wp(e);if(lp){var n=lp(e);t&&(n=rc(n).call(n,(function(t){return Xp(e,t).enumerable}))),r.push.apply(r,n)}return r}function qe(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?ma(r=Ye(Object(i),!0)).call(r,(function(t){Ge(e,t,i[t])})):lf?yf(e,lf(i)):ma(n=Ye(Object(i))).call(n,(function(t){Vp(e,t,Xp(i,t))}))}return e}function Ge(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ze=function(){function e(){}return e.prototype.create=function(e){var t=this.createPeer({pid:e.srcPid}),r=this.createConnection(e);return t.setConnection(r),t},e.prototype.createConnection=function(e){return new We(e,{iceServers:[],encodedInsertableStreams:!0})},e.prototype.createPeer=function(e){var t=e.pid,r=new Me;return r.setPid(t),r},e}(),He=function(){function e(){Ge(this,"client",null),Ge(this,"server",null),Ge(this,"localPid",""),Ge(this,"config",null)}return e.prototype.create=function(e){var t=this.createConnection(e),r=this.createPeer({pid:e.targetPid});return r.setConnection(t),r},e.prototype.setClient=function(e){return this.client=e,this},e.prototype.setServer=function(e){return this.server=e,this},e.prototype.setLocalPid=function(e){return this.localPid=e,this},e.prototype.configure=function(e){this.config=e},e.prototype.createConnection=function(e){var t=this;if(!this.server)throw Error("P2PPeerBuilder empty server");if(!this.config)throw Error("P2PPeerBuilder empty config");var r=new Ve({targetPid:e.targetPid,localPid:this.localPid},{iceServers:[{urls:["stun:"+this.config.stun]}],encodedInsertableStreams:!0});return r.on("EVENT_P2P_SIGNAL_SEND",(function(e){if(!t.server||!t.client||!t.localPid)throw Error("P2PPeerBuilder param error");var r=qe(qe({},e),{},{from:t.localPid,path:"signal",host:t.server.serverName});t.client.request(r)})),r.init(),r},e.prototype.createPeer=function(e){var t=e.pid,r=new Me;return r.setPid(t),r},e}();function Qe(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ic(t,e),t.prototype.send=function(e){},t.prototype.recv=function(e){},t}(t()),Je=function(e){function t(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this;return Qe(i=e.apply(this,dc([],lc(r)))||this,"signal",null),Qe(i,"recvHandler",jr(t=i.recv).call(t,i)),i}return ic(t,e),t.prototype.destroy=function(){var e;null===(e=this.signal)||void 0===e||e.removeListener(ke,this.recvHandler),this.signal=null,this.removeAllListeners()},t.prototype.setSignal=function(e){this.signal=e,e.on(ke,this.recvHandler)},t.prototype.send=function(e){var t;null===(t=this.signal)||void 0===t||t.send(e.to,$b(e))},t.prototype.recv=function(e){var t;try{t=JSON.parse(e)}catch(e){return}this.emit(t.host,t)},t}(Ke);function Ze(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Xe=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return Ze(n=e.apply(this,dc([],lc(t)))||this,"tagName","PeerPool"),Ze(n,"candidate",new Db),Ze(n,"connected",new Db),Ze(n,"connecting",new Db),Ze(n,"config",null),Ze(n,"tickTimer",null),Ze(n,"reportUnit",new _),n}return ic(t,e),t.prototype.configure=function(e){this.config=e},t.prototype.setReporter=function(t){var r=this;return null==t||t.registerReportUint(this.objName,this.reportUnit),this.reportUnit.registerPreHook(this.objName,(function(){var e=r.stats();r.reportUnit.number("connected").set(e.connected),r.reportUnit.number("connecting").set(e.connecting),r.reportUnit.number("candidate").set(e.candidate)})),e.prototype.setReporter.call(this,t)},t.prototype.init=function(){var e;if(!this.config)throw Error("missing config");this.clearTimer(),this.tickTimer=za(jr(e=this.tick).call(e,this),this.config.tickInterval)},t.prototype.destroy=function(){var t,r,n;this.clearTimer(),ma(t=this.connecting).call(t,(function(e){e.destroy()})),this.connecting.clear(),ma(r=this.candidate).call(r,(function(e){e.destroy()})),this.candidate.clear(),ma(n=this.connected).call(n,(function(e){e.destroy()})),this.connected.clear(),this.config=null,e.prototype.destroy.call(this)},t.prototype.stats=function(){return{connected:this.connected.size,connecting:this.connecting.size,candidate:this.candidate.size}},t.prototype.addCandidate=function(e){this.get(e.pid)||(this.reportUnit.number("candidate_total").plus(1),this.candidate.set(e.pid,e),this.tick())},t.prototype.addConnecting=function(e){this.get(e.pid)||(this.reportUnit.number("connecting_total").plus(1),this.connecting.set(e.pid,e),this.setupConnection(e))},t.prototype.tick=function(){if(this.config&&!(this.connecting.size>this.config.maxConnecting)){var e=this.config.maxConnected-this.connected.size;if(e)for(var t,r=AE(t=this.candidate).call(t),n=function(){var e=r.next();return e.done?null:e.value[1]},i=e;i>0;){var o=n();if(!o)return void this.emit("EVENT_LESS_CANDIDATE",{lackCnt:e});o.fresh()?this.connecting.has(o.pid)||this.connected.has(o.pid)||(this.reportUnit.number("connect_total").plus(1),this.candidate.delete(o.pid),this.prepareConnectCandiate(o),i-=1):this.remove(o.pid)}}},t.prototype.bestOne=function(e){var t,r;try{for(var n=uc(this.connected),i=n.next();!i.done;i=n.next()){var o=lc(i.value,2),s=o[0],a=o[1];if(!jn(e).call(e,s))return a}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return null},t.prototype.get=function(e){return this.candidate.get(e)||this.connected.get(e)||this.connecting.get(e)},t.prototype.getConnected=function(e){return this.connected.get(e)},t.prototype.remove=function(e){var t=this.get(e);t&&(this.connecting.delete(e),this.connected.delete(e),this.candidate.delete(e),Oa((function(){t.destroy()})))},t.prototype.prepareConnectCandiate=function(e){this.setupConnection(e),this.connected.delete(e.pid),this.connecting.set(e.pid,e),e.getConnection().connect()},t.prototype.setupConnection=function(e){var t=this,r=function(r){t.remove(e.pid)},n=Oa((function(){r()}),1e4),i=e.getConnection();i.on("connected",(function(){t.reportUnit.number("conn_connected_total").plus(1),clearTimeout(n),t.connecting.delete(e.pid),t.connected.set(e.pid,e)})),i.on("closed",(function(){t.reportUnit.number("conn_closed_total").plus(1),clearTimeout(n),r()})),i.on("disconnected",(function(){t.reportUnit.number("conn_disconnected_total").plus(1),r()})),i.on("failed",(function(){t.reportUnit.number("conn_failed_total").plus(1),r()}))},t.prototype.clearTimer=function(){this.tickTimer&&(clearTimeout(this.tickTimer),this.tickTimer=null)},t}(w);function $e(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var et=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return $e(n=e.apply(this,dc([],lc(t)))||this,"tagName","PeerManager"),$e(n,"peerPool",new Xe),$e(n,"peerCache",null),$e(n,"peerBuilder",null),$e(n,"reportUnit",new _),$e(n,"config",null),n}return ic(t,e),t.prototype.destroy=function(){this.peerPool&&this.peerPool.destroy(),this.peerBuilder=null,e.prototype.destroy.call(this)},t.prototype.configure=function(e){this.config=e,this.peerPool.configure(e)},t.prototype.setReporter=function(t){return null==t||t.registerReportUint(this.objName,this.reportUnit),this.peerPool.setReporter(t),e.prototype.setReporter.call(this,t)},t.prototype.init=function(){var e=this;this.peerPool.on("EVENT_LESS_CANDIDATE",(function(t){if(t.lackCnt,!e.peerCache)throw Error("missing param");var r=e.peerCache.getPid();e.addPeerId(r)})),this.peerPool.init()},t.prototype.setPeerBuilder=function(e){return this.peerBuilder=e,this},t.prototype.setPeerCache=function(e){return this.peerCache=e,this},t.prototype.setSortStrategy=function(){},t.prototype.setKickStrategy=function(){},t.prototype.addPeerId=function(e){if(e&&!this.peerPool.get(e)&&this.peerBuilder&&this.config){var t=this.peerBuilder.create({targetPid:e});this.addPeer(t)}},t.prototype.addPeer=function(e){this.peerPool.addCandidate(e)},t.prototype.addConnectingPeer=function(e){this.peerPool.addConnecting(e)},t.prototype.getPeer=function(e){return this.peerPool.get(e)},t.prototype.getConnectedPeer=function(e){return this.peerPool.getConnected(e)},t.prototype.getBestPeer=function(e){var t=e.excludePeerId;return this.peerPool.bestOne(t)},t}(w);function tt(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rt=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return tt(n=e.apply(this,dc([],lc(t)))||this,"pid",""),tt(n,"streamId",""),tt(n,"timer",null),tt(n,"config",null),n}return ic(t,e),t.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.removeAllListeners(),this.timer=null},t.prototype.configure=function(e){this.config=e},t.prototype.setPid=function(e){return this.pid=e,this},t.prototype.setStreamId=function(e){return this.streamId=e,this},t.prototype.start=function(){var e=this;if(!this.config)throw Error("missing config");!this.timer&&this.config.trackerInterval&&(this.timer=za((function(){e.request()}),this.config.trackerInterval))},t.prototype.ready=function(){return this.pid&&this.streamId},t.prototype.request=function(){var e=this;if(!this.config)throw Error("missing config");if(this.ready()){var t=this.config.trackerUrl+"?pid="+this.pid+"&channel="+this.streamId+"_"+this.config.trackerVersion+"&streamId=0&mode=bat";fetch(t).then((function(e){return e.text()})).then((function(e){return JSON.parse(e)})).then((function(t){e.parsePeer(t)})).catch((function(e){}))}},t.prototype.parsePeer=function(e){var t,r=this;ma(t=e.peers).call(t,(function(e){var t=e.pid;r.emit("EVENT_NEW_PEER",{pid:t})}))},t}(t());function nt(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var it=function(){function e(){nt(this,"defaultMaxCandidateSize",100),nt(this,"localPid",""),nt(this,"peers",new ig),nt(this,"tracker",new rt),nt(this,"config",null)}return e.prototype.destroy=function(){this.tracker.destroy(),this.peers.clear(),this.config=null},e.prototype.setStreamId=function(e){return this.tracker.setStreamId(e),this},e.prototype.setPeerId=function(e){return this.tracker.setPid(e),this},e.prototype.start=function(){this.tracker.start()},e.prototype.configure=function(e){this.config=e,this.tracker.configure(this.config)},e.prototype.init=function(){var e=this;if(!this.config)throw Error("miss config");this.tracker.on("EVENT_NEW_PEER",(function(t){var r=t.pid;e.addPid(r)}))},e.prototype.addPid=function(e){var t;if(this.peers.has(e)&&this.peers.delete(e),this.peers.add(e),this.peers.size>((null===(t=this.config)||void 0===t?void 0:t.maxCandidateSize)||this.defaultMaxCandidateSize)){var r=this.getOldestPid();r&&this.peers.delete(r)}},e.prototype.getPid=function(){var e=this.getFreshPid();return e&&this.peers.delete(e),e},e.prototype.getFreshPid=function(){return this.peers.size?dc([],lc(this.peers))[this.peers.size-1]:null},e.prototype.getOldestPid=function(){return this.peers.size?dc([],lc(this.peers))[0]:null},e}();function ot(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var st=function(){function e(){ot(this,"path","signal"),ot(this,"peerManager",null),ot(this,"peerBuilder",null),ot(this,"server",null)}return e.prototype.destroy=function(){this.server&&(this.server.deleteAPI(this.path),this.server=null)},e.prototype.setPeerManager=function(e){return this.peerManager=e,this},e.prototype.setPeerBuilder=function(e){return this.peerBuilder=e,this},e.prototype.setServer=function(e){var t;return this.server=e,this.server.registerAPI(this.path,jr(t=this.handler).call(t,this)),this},e.prototype.handler=function(e){var t;if(this.peerBuilder&&this.peerManager){var r=null===(t=this.peerManager)||void 0===t?void 0:t.getPeer(e.from);"offer"===e.type&&(r||(r=this.peerBuilder.create({targetPid:e.from}),this.peerManager.addConnectingPeer(r))),r&&r.getConnection().emit("EVENT_P2P_SIGNAL_RECV",e)}},e}();function at(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ct=function(){function e(){at(this,"path","SubscribeTrack"),at(this,"server",null),at(this,"subscriber",null)}return e.prototype.destroy=function(){var e;null===(e=this.server)||void 0===e||e.deleteAPI(this.path),this.server=null,this.subscriber=null},e.prototype.setServer=function(e){var t;return this.server=e,this.server.registerAPI(this.path,jr(t=this.handler).call(t,this)),this},e.prototype.setSubscriber=function(e){this.subscriber=e},e.prototype.handler=function(e){if(this.subscriber){var t=e.from;"subscribe"===e.payload?this.subscriber.onSubscribe(t):"cancelSubscribe"===e.payload&&this.subscriber.onCancelSubscribe(t)}},e}();function ut(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var lt,dt=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return ut(n=e.apply(this,dc([],lc(t)))||this,"chunks",[]),ut(n,"rtcEncodedStreams",null),ut(n,"aborted",!1),ut(n,"lastTimestamp",0),ut(n,"maxCache",200),n}return ic(t,e),t.prototype.destroy=function(){this.lastTimestamp=0,this.chunks=[],e.prototype.removeAllListeners.call(this)},t.prototype.configure=function(e){var t=e.max;this.maxCache=t},t.prototype.reset=function(){this.chunks=[]},t.prototype.getHead=function(){return this.chunks[0]},t.prototype.shift=function(){return this.chunks.shift()},t.prototype.removeHead=function(){return this.chunks.shift()},Vp(t.prototype,"size",{get:function(){return this.chunks.length},enumerable:!1,configurable:!0}),t.prototype.cache=function(e){this.lastTimestamp=e.timestamp;var t={type:e.type,timestamp:e.timestamp,data:new Uint8Array(e.data).buffer,chunk:e.chunk};this.chunks.push(t),this.chunks.length>this.maxCache&&this.removeHead(),this.emit("new_chunk",t)},t.prototype.remove=function(e){for(var t;this.chunks.length>e;)this.chunks.shift();var r=this.chunks.length;return r<=e?0:QE(t=this.chunks).call(t,0,r-e)},t.prototype.dropOutdateChunk=function(e){for(var t=this.getHead();t&&t.timestamp<e;)this.removeHead(),t=this.getHead()},t}(e.EventEmitter);function pt(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.key=31]="key",e[e.delta=32]="delta",e[e.empty=33]="empty"}(lt||(lt={}));var ft=function(){function e(){}return e.encode=function(e){var t=e.chunkData.byteLength+4+1,r=new vt({totalBytes:t});return r.setArraybuffer(e.chunkData),r.setUint32(e.timestamp),r.setUnit8(lt[e.type]),r.getArraybuffer()},e.decode=function(e){var t=new ht(e),r=t.getArraybuffer(e.byteLength-5);return{timestamp:t.getUint32(),type:lt[t.getUint8()],chunkData:r}},e}(),ht=function(){function e(e){pt(this,"u8a",void 0),pt(this,"dataview",void 0),pt(this,"bytesOffset",0),pt(this,"totalBytes",0),this.u8a=new Uint8Array(e),this.dataview=new DataView(e),this.totalBytes=e.byteLength}return e.prototype.getUint8=function(){var e=this.dataview.getUint8(this.bytesOffset);return this.bytesOffset+=1,e},e.prototype.getUint32=function(){var e=this.dataview.getUint32(this.bytesOffset);return this.bytesOffset+=4,e},e.prototype.getArraybuffer=function(e,t){var r;void 0===t&&(t=0);var n=qu(r=this.u8a).call(r,t,e);return this.bytesOffset+=t+e,n.buffer},e}(),vt=function(){function e(e){var t=e.totalBytes;pt(this,"totalBytes",0),pt(this,"u8a",void 0),pt(this,"dataview",void 0),pt(this,"bytesOffset",0),this.totalBytes=t,this.u8a=new Uint8Array(t),this.dataview=new DataView(this.u8a.buffer)}return e.prototype.setUnit8=function(e){this.dataview.setUint8(this.bytesOffset,e),this.bytesOffset+=1},e.prototype.setUint32=function(e){this.dataview.setUint32(this.bytesOffset,e),this.bytesOffset+=4},e.prototype.setArraybuffer=function(e){this.u8a.set(new Uint8Array(e),this.bytesOffset),this.bytesOffset+=e.byteLength},e.prototype.getArraybuffer=function(){return this.u8a.buffer},e}();function mt(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yt=function(){function e(){mt(this,"videoTrack",new MediaStreamTrackGenerator({kind:"video"})),mt(this,"audioTrack",new MediaStreamTrackGenerator({kind:"audio"})),mt(this,"videoWriter",this.videoTrack.writable.getWriter()),mt(this,"audioWriter",this.audioTrack.writable.getWriter()),mt(this,"timer",null)}return e.prototype.destroy=function(){this.timer&&(clearInterval(this.timer),this.timer=null)},e.prototype.getVideoTrack=function(){return this.videoTrack},e.prototype.getAudioTrack=function(){return this.audioTrack},e.prototype.writeAudioDataToTrack=function(){var e=this.createAudioData();this.audioWriter.write(e).catch((function(e){}))},e.prototype.writeVideoFrameToTrack=function(e){var t=e.timestamp,r=this.createVideoFrame({timestamp:t});return this.videoWriter.write(r).catch((function(e){})),r},e.prototype.createAudioData=function(){var e={timestamp:Kb(),data:new ArrayBuffer(10),sampleRate:48e3,format:"u8",numberOfFrames:1,numberOfChannels:1};return new AudioData(e)},e.prototype.createVideoFrame=function(e){for(var t=e.timestamp,r={format:"I420",codedHeight:16,codedWidth:16,colorSpace:new VideoColorSpace({matrix:"bt709",primaries:"bt709",transfer:"bt709"}),displayHeight:16,displayWidth:16,timestamp:t},n=new Uint8Array(r.codedWidth*r.codedHeight*4),i=0;i<r.codedWidth;i++)for(var o=0;o<r.codedHeight;o++){var s=4*(o*r.codedWidth+i);n[s]=127,n[s+1]=255,n[s+2]=212,n[s+3]=255}return new VideoFrame(n,r)},e}();function gt(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bt=function(e,t){var r,n,i,o=null===(i=RTCRtpReceiver.getCapabilities(t))||void 0===i?void 0:i.codecs,s=[];if(!o)return s;try{for(var a=uc(o),c=a.next();!c.done;c=a.next()){var u=c.value;u.mimeType===e&&s.push(u)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return s},Ct=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return gt(n=e.apply(this,dc([],lc(t)))||this,"tagName","StreamTrackProvider"),gt(n,"targetPid",""),gt(n,"srcPid",""),gt(n,"peerManager",null),gt(n,"driverTrack",new yt),gt(n,"videoEncodedFrameCache",null),gt(n,"audioEncodedFrameCache",null),gt(n,"statUnit",null),gt(n,"reportUnit",new _),gt(n,"audioAbortController",new AbortController),gt(n,"videoAbortController",new AbortController),gt(n,"newVideoChunkHandler",null),gt(n,"videoEmitChunkTimer",null),n}return ic(t,e),t.prototype.destroy=function(){var t;this.clearTimer(),this.onCancelSubscribe(),this.driverTrack.destroy(),this.peerManager=null,this.audioAbortController.abort("StreamTrackProvider_abort_audio"),this.videoAbortController.abort("StreamTrackProvider_abort_video"),this.newVideoChunkHandler&&(null===(t=this.videoEncodedFrameCache)||void 0===t||t.off("new_chunk",this.newVideoChunkHandler)),this.videoEncodedFrameCache=null,this.audioEncodedFrameCache=null,e.prototype.destroy.call(this)},t.prototype.setStatUnit=function(e){return this.statUnit=e,this},t.prototype.setPeerManager=function(e){return this.peerManager=e,this},t.prototype.setVideoEncodedFrameCache=function(e){return this.videoEncodedFrameCache=e,this},t.prototype.setAudioEncodedFrameCache=function(e){return this.audioEncodedFrameCache=e,this},t.prototype.setTargetPid=function(e){return this.targetPid=e,this},t.prototype.setSrcPid=function(e){return this.srcPid=e,this},t.prototype.setReporter=function(t){return null==t||t.registerReportUint(this.objName,this.reportUnit),e.prototype.setReporter.call(this,t)},t.prototype.onSubscribe=function(){var e,t,r=null===(e=this.peerManager)||void 0===e?void 0:e.getPeer(this.targetPid),n=null===(t=this.peerManager)||void 0===t?void 0:t.getPeer(this.srcPid);if(!r)return!1;if(!n)return!1;var i=r.getConnection().getRTCPeerConnection(),o=n.getConnection().getRTCPeerConnection();return"closed"!==i.signalingState&&(this.listenConnection(r.getConnection()),this.provideVideoTrack(o,i),this.provideAudioTrack(o,i),!0)},t.prototype.onCancelSubscribe=function(){var e,t=null===(e=this.peerManager)||void 0===e?void 0:e.getPeer(this.targetPid);if(!t)return!1;t.getConnection().destroy()},t.prototype.updateTrack=function(e,t){var r,n,i;this.srcPid=t;var o=null===(i=this.peerManager)||void 0===i?void 0:i.getPeer(this.targetPid);if(!o)return!1;if("video"!==e.kind){var s=o.getConnection().getRTCPeerConnection().getSenders();try{for(var a=uc(s),c=a.next();!c.done;c=a.next()){var u,l=c.value;if(e.kind===(null===(u=l.track)||void 0===u?void 0:u.kind)){l.replaceTrack(e);break}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!0}},t.prototype.provideAudioTrack=function(e,t){var r,n,i,o,s,a,c=this,u=e.getReceivers();try{for(var l=uc(u),d=l.next();!d.done;d=l.next()){var p=d.value;if("audio"===p.track.kind){t.addTrack(p.track);break}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}var f=t.getTransceivers();try{for(var h=uc(f),v=h.next();!v.done;v=h.next()){var m,y=v.value;if("audio"===(null===(m=y.sender.track)||void 0===m?void 0:m.kind)){y.setCodecPreferences(bt("audio/opus","audio"));break}}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}var g,b=t.getSenders(),C=function(e){if("audio"!==(null===(g=e.track)||void 0===g?void 0:g.kind))return"continue";var t=!1,r=e.createEncodedStreams();return r.readable.pipeThrough(new TransformStream({transform:function(e,r){if(c.audioEncodedFrameCache){if(!t){var n=1;c.audioEncodedFrameCache.remove(n),t=!0}var i=c.audioEncodedFrameCache.shift();i&&(e.data=ft.encode({chunkData:i.data,timestamp:i.timestamp,type:"key"}),r.enqueue(e))}}})).pipeThrough(new TransformStream({transform:function(e,t){var r,n;null===(r=c.statUnit)||void 0===r||r.number("uploadBytes").plus(e.data.byteLength),null===(n=c.statUnit)||void 0===n||n.number("uploadAuidoBytes").plus(e.data.byteLength),c.reportUnit.number("uploadBytes").plus(e.data.byteLength),c.reportUnit.number("uploadAuidoBytes").plus(e.data.byteLength),t.enqueue(e)}})).pipeTo(r.writable,{signal:T.audioAbortController.signal}).catch((function(e){})),"break"},T=this;try{for(var S=uc(b),_=S.next();!_.done&&"break"!==C(_.value);_=S.next());}catch(e){s={error:e}}finally{try{_&&!_.done&&(a=S.return)&&a.call(S)}finally{if(s)throw s.error}}},t.prototype.provideVideoTrack=function(e,t){var r,n,i,o,s,a=this,c=this.driverTrack.getVideoTrack();t.addTrack(c),this.newVideoChunkHandler=function(){a.driverTrack.writeVideoFrameToTrack({timestamp:0})},null===(s=this.videoEncodedFrameCache)||void 0===s||s.on("new_chunk",this.newVideoChunkHandler),this.clearTimer(),this.videoEmitChunkTimer=za((function(){a.videoEncodedFrameCache&&a.videoEncodedFrameCache.size>1&&a.driverTrack.writeVideoFrameToTrack({timestamp:0}),a.driverTrack.writeVideoFrameToTrack({timestamp:0})}),30);var u=t.getTransceivers();try{for(var l=uc(u),d=l.next();!d.done;d=l.next()){var p,f=d.value;if("video"===(null===(p=f.sender.track)||void 0===p?void 0:p.kind)){f.setCodecPreferences(bt("video/H264","video"));break}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}var h,v=t.getSenders(),m=function(e){if("video"!==(null===(h=e.track)||void 0===h?void 0:h.kind))return"continue";var t=e.createEncodedStreams(),r=!1;return t.readable.pipeThrough(new TransformStream({transform:function(e,t){if(!a.videoEncodedFrameCache)throw Error("provideVideoTrack missing param");if(!r){var n=1;a.videoEncodedFrameCache.remove(n),r=!0}var i=a.videoEncodedFrameCache.shift();i&&(e.data=ft.encode({chunkData:i.data,timestamp:i.timestamp,type:i.type}),t.enqueue(e))}})).pipeThrough(new TransformStream({transform:function(e,t){var r,n;null===(r=a.statUnit)||void 0===r||r.number("uploadBytes").plus(e.data.byteLength),null===(n=a.statUnit)||void 0===n||n.number("uploadVideoBytes").plus(e.data.byteLength),a.reportUnit.number("uploadBytes").plus(e.data.byteLength),a.reportUnit.number("uploadVideoBytes").plus(e.data.byteLength),t.enqueue(e)}})).pipeTo(t.writable,{signal:y.videoAbortController.signal}).catch((function(e){})),"break"},y=this;try{for(var g=uc(v),b=g.next();!b.done&&"break"!==m(b.value);b=g.next());}catch(e){i={error:e}}finally{try{b&&!b.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}},t.prototype.listenConnection=function(e){var t=this;e.on("disconnected",(function(){t.emit("EVENT_RPOVIDER_DISCONNECT")})),e.on("failed",(function(){t.emit("EVENT_RPOVIDER_FAILED")}))},t.prototype.clearTimer=function(){this.videoEmitChunkTimer&&(clearInterval(this.videoEmitChunkTimer),this.videoEmitChunkTimer=null)},t}(w);function Tt(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var St=function(){function e(){Tt(this,"config",null),Tt(this,"coolingPeers",new ig)}return e.prototype.configure=function(e){this.config=e},e.prototype.destroy=function(){this.coolingPeers.clear()},e.prototype.add=function(e){var t,r=this;if(!this.config)throw Error("PeerCooler missing param");this.coolingPeers.add(e),Oa((function(){r.coolingPeers.delete(e)}),null===(t=this.config)||void 0===t?void 0:t.coolingTime)},e.prototype.getList=function(){return dc([],lc(this.coolingPeers))},e}();function _t(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Et,Rt=function(){function e(){_t(this,"lastWriteAudioTimestamp",0),_t(this,"lastWriteVideoTimestamp",0),_t(this,"p2pVideoRecvEnough",!1),_t(this,"_prepareToStopCdn",!1),_t(this,"_cdnStoppingReady",!1),_t(this,"_lastestCdnKeyTimestamp",0),_t(this,"_lastRecvCdnVideoTimestamp",0),_t(this,"_lastRecvCdnAudioTimestamp",0)}return Vp(e.prototype,"lastRecvCdnVideoTimestamp",{get:function(){return this._lastRecvCdnVideoTimestamp},set:function(e){this._lastRecvCdnVideoTimestamp=e},enumerable:!1,configurable:!0}),Vp(e.prototype,"lastRecvCdnAudioTimestamp",{get:function(){return this._lastRecvCdnAudioTimestamp},set:function(e){this._lastRecvCdnAudioTimestamp=e},enumerable:!1,configurable:!0}),Vp(e.prototype,"prepareToStopCdn",{get:function(){return this._prepareToStopCdn},set:function(e){this._prepareToStopCdn=e},enumerable:!1,configurable:!0}),Vp(e.prototype,"cdnStoppingReady",{get:function(){return this._cdnStoppingReady},set:function(e){this._cdnStoppingReady=e},enumerable:!1,configurable:!0}),Vp(e.prototype,"lastestCdnKeyTimestamp",{get:function(){return this._lastestCdnKeyTimestamp},set:function(e){this._lastestCdnKeyTimestamp=e},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._prepareToStopCdn=!1,this._cdnStoppingReady=!1,this._lastestCdnKeyTimestamp=0,this._lastRecvCdnVideoTimestamp=0,this._lastRecvCdnAudioTimestamp=0,this.lastWriteAudioTimestamp=0,this.lastWriteVideoTimestamp=0,this.p2pVideoRecvEnough=!1},e}();function Pt(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.smooth=0]="smooth",e[e.recentAvg=1]="recentAvg",e[e.latestOne=2]="latestOne"}(Et||(Et={}));var wt=function(){function e(){Pt(this,"cnt",0),Pt(this,"frameRateRecords",[]),Pt(this,"config",{maxFrameRateRecordsLen:10}),Pt(this,"timer",null)}return e.prototype.configure=function(e){this.config=e},e.prototype.destroy=function(){this.clearTimer()},e.prototype.reset=function(){this.frameRateRecords=[],this.clearTimer()},e.prototype.getFrameRate=function(e){return this.frameRateRecords.length?e===Et.smooth?this.smooth(this.frameRateRecords):e===Et.recentAvg?this.recentAvg(this.frameRateRecords):this.latestOne(this.frameRateRecords):null},e.prototype.sample=function(){this.start(),this.cnt+=1},e.prototype.start=function(){this.setTimer()},e.prototype.stop=function(){this.clearTimer()},e.prototype.setTimer=function(){var e=this;this.timer||(this.timer=za((function(){e.frameRateRecords.push(e.cnt),e.frameRateRecords.length>e.config.maxFrameRateRecordsLen&&e.frameRateRecords.shift(),e.cnt=0}),1e3))},e.prototype.clearTimer=function(){this.timer&&(clearInterval(this.timer),this.timer=null)},e.prototype.smooth=function(e){if(e.length<5)return null;var t=qu(e).call(e,3);return Math.floor(cR(t).call(t,(function(e,t){return e+t}))/t.length)},e.prototype.recentAvg=function(e){if(e.length<3)return null;var t=qu(e).call(e,e.length-3);return Math.floor(cR(t).call(t,(function(e,t){return e+t}))/t.length)},e.prototype.latestOne=function(e){return e.length?e[this.frameRateRecords.length-1]:null},e}();function kt(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var At=function(){function e(){kt(this,"audioClockRate",0),kt(this,"videoClockRate",0),kt(this,"frameRate",new wt)}return e.prototype.reset=function(){this.audioClockRate=0,this.videoClockRate=0},e.prototype.ready=function(){return this.audioClockRate&&this.videoClockRate},e.prototype.sample=function(e){var t,r=this;ma(t=e.getReceivers()).call(t,(function(e){r.sampleClockRate(e)}))},e.prototype.sampleClockRate=function(e){var t=this;e.getStats().then((function(e){var r,n;try{for(var i=uc(e),o=i.next();!o.done;o=i.next()){var s,a,c=o.value,u=yR(c).call(c,(function(e){return"codec"===e.type}));u&&"number"==typeof u.clockRate&&(Ga(s=u.mimeType).call(s,"audio")?t.audioClockRate=u.clockRate:Ga(a=u.mimeType).call(a,"video")&&(t.videoClockRate=u.clockRate))}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}))},e}();function Ot(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Dt=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return Ot(n=e.apply(this,dc([],lc(t)))||this,"tagName","LEBSource"),Ot(n,"sourceConfig",null),Ot(n,"stopWriting",!1),Ot(n,"videoAbortController",new AbortController),Ot(n,"audioAbortController",new AbortController),n}return ic(t,e),t.prototype.configure=function(e){return this.sourceConfig=e,this},t.prototype.isLeb=function(){return!0},t.prototype.load=function(){if(!this.sourceConfig)throw new Error;if(!this.peerManager)throw new Error("miss peerManager");e.prototype.load.call(this);var t=(new ze).create(ih({targetPid:this.sourceConfig.srcPid},this.sourceConfig));this.peer=t,this.peerManager.addPeer(t),this.listenConnection(t.getConnection())},t.prototype.close=function(){this.closed||(this.audioAbortController.abort("LEBSource_abort_audio"),this.videoAbortController.abort("LEBSource_abort_video"),e.prototype.close.call(this))},t.prototype.onTrack=function(e,t){var r=this;if(!this.videoEncodedFrameCache||!this.audioEncodedFrameCache)throw Error("miss cache");var n=e.track,o=e.receiver.createEncodedStreams();if(o){if(!this.syncController)throw Error("missing param");if(!this.streamInfo)throw Error("missing param");var a=o.readable.pipeThrough(new TransformStream({transform:function(t,n){if(!r.closed){if(!r.syncController)throw Error("missing param");if(!r.stopWriting){var o,a,c;if(!r.stopWriting&&r.syncController.prepareToStopCdn&&"video"===e.track.kind&&"key"===t.type)return r.syncController.cdnStoppingReady=!0,r.syncController.lastestCdnKeyTimestamp=t.timestamp,r.stopWriting=!0,void(null===(o=r.streamInfo)||void 0===o||o.frameRate.stop());r.syncController&&("audio"===e.track.kind?(null!==(a=r.syncController)&&void 0!==a&&a.lastRecvCdnAudioTimestamp||r.emit(i,{code:s.INF_PLAY_EVT_STREAM_FIRST_AUDIO_FRAME,msg:"鏀跺埌浜嗙涓€涓煶棰戝抚"}),r.syncController.lastRecvCdnAudioTimestamp=t.timestamp):(null!==(c=r.syncController)&&void 0!==c&&c.lastRecvCdnVideoTimestamp||r.emit(i,{code:s.INF_PLAY_EVT_STREAM_FIRST_VIDEO_FRAME,msg:"鏀跺埌浜嗙涓€涓棰戝抚"}),r.syncController.lastRecvCdnVideoTimestamp=t.timestamp)),n.enqueue(t)}}}})).pipeThrough(new TransformStream({transform:function(e,t){var n,i;null===(n=r.statUnit)||void 0===n||n.number("cdnDownloadBytes").plus(e.data.byteLength),null===(i=r.reportUnit)||void 0===i||i.number("cdn_bytes").plus(e.data.byteLength),t.enqueue(e)}}));"video"===n.kind?a.pipeThrough(new TransformStream({transform:function(e,t){var n;r.reportUnit.number("cdnDownloadVideoBytes").plus(e.data.byteLength),null===(n=r.statUnit)||void 0===n||n.number("cdnDownloadVideoBytes").plus(e.data.byteLength),t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){var n,i;null===(n=r.streamInfo)||void 0===n||n.frameRate.sample(),null===(i=r.videoEncodedFrameCache)||void 0===i||i.cache(e),t.enqueue(e)}})).pipeTo(o.writable,{signal:this.videoAbortController.signal}).catch((function(e){})):a.pipeThrough(new TransformStream({transform:function(e,t){var n;r.reportUnit.number("cdnDownloadAuidoBytes").plus(e.data.byteLength),null===(n=r.statUnit)||void 0===n||n.number("cdnDownloadAuidoBytes").plus(e.data.byteLength),t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){var n;null===(n=r.audioEncodedFrameCache)||void 0===n||n.cache(e),t.enqueue(e)}})).pipeTo(o.writable,{signal:this.audioAbortController.signal}).catch((function(e){})),this.emitTrack(n,t)}},t}(ue);function Lt(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Mt=function(){function e(){Lt(this,"targetWritableStream",null),Lt(this,"targetWriter",null),Lt(this,"proxiedWritableStream",null),Lt(this,"getNextChunkCb",null)}return e.prototype.destroy=function(){var e;this.targetWritableStream=null,null===(e=this.targetWriter)||void 0===e||e.abort(),this.targetWriter=null,this.proxiedWritableStream=null,this.getNextChunkCb=null},e.prototype.setTargetWriableStream=function(e){return this.targetWritableStream=e,this.targetWriter=e.getWriter(),this},e.prototype.setGetNextChunkCb=function(e){this.getNextChunkCb=e},e.prototype.getStream=function(){var e=this;if(this.proxiedWritableStream)return this.proxiedWritableStream;var t=new CountQueuingStrategy({highWaterMark:10});return this.proxiedWritableStream=new WritableStream({write:function(t){e.writeChunk()},close:function(){},abort:function(e){}},t),this.proxiedWritableStream},e.prototype.write=function(){this.writeChunk()},e.prototype.writeChunk=function(){if(!this.getNextChunkCb)throw Error("missing param");for(var e=this.getNextChunkCb();e;){var t;null===(t=this.targetWriter)||void 0===t||t.write(e).catch((function(e){})),e=this.getNextChunkCb()}},e}();function It(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var xt,Nt=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return It(n=e.apply(this,dc([],lc(t)))||this,"tagName","P2PSource"),It(n,"sourceConfig",null),It(n,"p2pClient",null),It(n,"videoReady",!1),It(n,"p2pAudioCache",new dt),It(n,"p2pVideoCache",new dt),It(n,"audioProxyStream",new Mt),It(n,"videoProxyStream",new Mt),It(n,"recvFrameRate",new wt),It(n,"audioAbortController",new AbortController),It(n,"videoAbortController",new AbortController),n}return ic(t,e),t.prototype.configure=function(e){return this.sourceConfig=e,this},t.prototype.setClient=function(e){return this.p2pClient=e,this},t.prototype.setPeerManager=function(e){return this.peerManager=e,this},t.prototype.destroy=function(){this.p2pAudioCache.destroy(),this.p2pVideoCache.destroy(),this.audioProxyStream.destroy(),this.videoProxyStream.destroy(),this.audioAbortController.abort("P2PSource_abort_audio"),this.videoAbortController.abort("P2PSource_abort_video"),e.prototype.destroy.call(this)},t.prototype.isLeb=function(){return!1},t.prototype.load=function(){if(!this.sourceConfig)throw new Error("missing p2p source config");if(this.peerManager&&this.p2pClient){var t=this.peerManager.getPeer(this.sourceConfig.srcPid);if(t){this.peer=t;var r=t.getConnection();r&&(e.prototype.load.call(this),this.p2pClient.request({host:"P2PServer",to:this.sourceConfig.srcPid,path:"SubscribeTrack",payload:"subscribe",type:"app"}),this.listenConnection(r))}}},t.prototype.close=function(){if(!this.sourceConfig)throw new Error("missing p2p source config");this.p2pClient&&(this.closed||(this.p2pClient.request({host:"P2PServer",to:this.sourceConfig.srcPid,path:"SubscribeTrack",payload:"cancelSubscribe",type:"app"}),e.prototype.close.call(this)))},t.prototype.onTrack=function(e,t){var r=e.track;"video"===r.kind?this.onVideoTrack(e,t):"audio"===r.kind&&this.onAudioTrack(e,t)},t.prototype.onAudioTrack=function(e,t){var r=this,n=e.receiver.createEncodedStreams();this.audioProxyStream.setTargetWriableStream(n.writable).setGetNextChunkCb((function(){var e;if(r.syncController&&r.p2pAudioCache&&r.videoReady&&r.streamInfo&&r.streamInfo.ready()&&null!==(e=r.syncController)&&void 0!==e&&e.cdnStoppingReady&&r.syncController.p2pVideoRecvEnough){var t=r.p2pAudioCache.getHead();return t?(r.p2pAudioCache.removeHead(),r.syncController.lastWriteAudioTimestamp=t.timestamp,r.videoProxyStream.write(),t.chunk):void 0}})),n.readable.pipeThrough(new TransformStream({transform:function(e,t){r.closed||t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){var n,i,o;null===(n=r.reportUnit)||void 0===n||n.number("p2p_bytes").plus(e.data.byteLength),null===(i=r.statUnit)||void 0===i||i.number("p2pDownloadBytes").plus(e.data.byteLength),null===(o=r.statUnit)||void 0===o||o.number("p2pDownloadAuidoBytes").plus(e.data.byteLength),t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){if(0!==e.data.byteLength){if(r.syncController){var n=ft.decode(e.data);n.timestamp<r.syncController.lastRecvCdnAudioTimestamp||(e.data=n.chunkData,r.p2pAudioCache.cache({data:n.chunkData,timestamp:n.timestamp,type:n.type,chunk:e}),t.enqueue({}))}}else t.enqueue(e)}})).pipeTo(this.audioProxyStream.getStream(),{signal:this.audioAbortController.signal}).catch((function(e){})),this.emitTrack(e.track,t)},t.prototype.onVideoTrack=function(e,t){var r=this,n=e.receiver,i=1,o=0,s=n.createEncodedStreams();this.videoProxyStream.setTargetWriableStream(s.writable).setGetNextChunkCb((function(){if(r.syncController&&r.p2pVideoCache&&r.streamInfo&&r.streamInfo.ready()&&(r.p2pVideoCache.size>5&&!r.syncController.p2pVideoRecvEnough&&(r.syncController.p2pVideoRecvEnough=!0),r.syncController.lastWriteAudioTimestamp)){var e=r.p2pVideoCache.getHead();if(e){var t=r.syncController,n=t.lastRecvCdnVideoTimestamp,i=t.lastRecvCdnAudioTimestamp,o=r.streamInfo,s=o.videoClockRate,a=o.audioClockRate,c=i/a-n/s;return r.syncController.lastWriteAudioTimestamp/a-c<e.timestamp/s+.1?void 0:(r.p2pVideoCache.removeHead(),e.chunk)}}})),s.readable.pipeThrough(new TransformStream({transform:function(e,t){r.closed||t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){if(!r.streamInfo||!r.sourceConfig)throw Error("missing param");r.recvFrameRate.sample();var n=r.recvFrameRate.getFrameRate(Et.recentAvg),i=r.streamInfo.frameRate.getFrameRate(Et.smooth);null!==n&&null!==i&&n<i*r.sourceConfig.stuckFrameRateRatio&&2===(o+=1)?r.emit(ce):t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){var n,i,o;null===(n=r.reportUnit)||void 0===n||n.number("p2p_bytes").plus(e.data.byteLength),null===(i=r.statUnit)||void 0===i||i.number("p2pDownloadBytes").plus(e.data.byteLength),null===(o=r.statUnit)||void 0===o||o.number("p2pDownloadVideoBytes").plus(e.data.byteLength),t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(n,o){if(r.syncController){if(n.data.byteLength){var s=ft.decode(n.data);if("key"===s.type&&(i-=1),n.data=s.chunkData,r.syncController.prepareToStopCdn||"key"!==s.type||0!==i||(r.syncController.prepareToStopCdn=!0),!r.syncController.cdnStoppingReady)return;if(s.timestamp<r.syncController.lastestCdnKeyTimestamp)return;s.timestamp,r.syncController.lastestCdnKeyTimestamp,r.videoReady||(r.videoReady=!0,r.emitTrack(e.track,t)),r.p2pVideoCache.cache({data:s.chunkData,timestamp:s.timestamp,type:s.type,chunk:n})}o.enqueue(n)}}})).pipeTo(this.videoProxyStream.getStream(),{signal:this.videoAbortController.signal}).catch((function(e){}))},t}(ue);!function(e){e[e.LEB=0]="LEB",e[e.P2P=1]="P2P"}(xt||(xt={}));var Ft,Ut=function(){function e(){}return e.create=function(e){switch(e){case xt.LEB:return new Dt;case xt.P2P:return new Nt}},e}();function Vt(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.IDEL=0]="IDEL",e[e.WAITING=1]="WAITING",e[e.COMPLETE=2]="COMPLETE"}(Ft||(Ft={}));var jt=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return Vt(n=e.apply(this,dc([],lc(t)))||this,"tagName","Subscriber"),Vt(n,"parent",{pid:""}),Vt(n,"child",{pid:""}),Vt(n,"subscribeStatus",{status:Ft.IDEL,pid:""}),Vt(n,"config",null),Vt(n,"p2pClient",null),Vt(n,"peerManager",null),Vt(n,"videoEncodedFrameCache",new dt),Vt(n,"audioEncodedFrameCache",new dt),Vt(n,"statUnit",null),Vt(n,"peerCooler",new St),Vt(n,"syncController",new Rt),Vt(n,"streamInfo",new At),Vt(n,"sampleTimer",null),Vt(n,"reportUnit",new _),Vt(n,"lebSource",null),Vt(n,"p2pSource",null),n}return ic(t,e),t.prototype.destroy=function(){this.peerManager=null,this.reporter=null,this.p2pClient=null,this.peerCooler.destroy(),this.cancelsubscribe(),this.removeChild(this.child.pid),this.clearSampleTimer(),this.closeSource(xt.LEB),this.closeSource(xt.P2P),e.prototype.destroy.call(this)},t.prototype.configure=function(e){return this.config=e,this.peerCooler.configure({coolingTime:this.config.subscribeCoolingTime}),this},t.prototype.setPeerManager=function(e){return this.peerManager=e,this},t.prototype.setReporter=function(t){return null==t||t.registerReportUint(this.objName,this.reportUnit),e.prototype.setReporter.call(this,t)},t.prototype.setClient=function(e){return this.p2pClient=e,this},t.prototype.setStatUnit=function(e){this.statUnit=e},Vp(t.prototype,"currentSourcePeerconnection",{get:function(){var e,t;return this.parent.pid&&(null===(e=this.peerManager)||void 0===e||null===(t=e.getPeer(this.parent.pid))||void 0===t?void 0:t.getConnection().getRTCPeerConnection())||null},enumerable:!1,configurable:!0}),t.prototype.subscribeLEB=function(e){var t=this;if(!this.peerManager||!this.statUnit)throw Error("subscribeLEB missing param");this.syncController.reset(),this.streamInfo.reset(),this.streamInfo.frameRate.reset(),this.reportUnit.number("src_cdn_sub").plus(1);var r=Ut.create(xt.LEB);return this.lebSource=r,r.configure(e).setSyncController(this.syncController).setReporter(this.reporter).setPeerManager(this.peerManager).setEncodedVideoChunkCache(this.videoEncodedFrameCache).setEncodedAudioChunkCache(this.audioEncodedFrameCache).setStatUnit(this.statUnit).setStreamInfo(this.streamInfo).on(ie,(function(e){"video"===e.track.kind&&(t.reportUnit.number("src_cdn_succ").plus(1),t.updateParent({pid:e.srcPid,source:r}),t.updateChildTrack(e.track,{srcPid:e.srcPid}),t.sampleTimer||(t.sampleTimer=za((function(){t.streamInfo.ready()?t.clearSampleTimer():t.streamInfo.sample(e.rtcPeerConnction)}),1e3)))})).once(re,(function(){t.reportUnit.number("src_cdn_timeout").plus(1),t.closeSource(xt.LEB)})).once(ae,(function(e){e.srcPid,t.reportUnit.number("src_cdn_failed").plus(1),t.closeSource(xt.LEB)})).once(ne,(function(e){e.srcPid,t.reportUnit.number("src_cdn_disconnect").plus(1),t.closeSource(xt.LEB)})).once(se,(function(e){e.srcPid,t.reportUnit.number("src_cdn_error").plus(1),t.closeSource(xt.LEB)})).load(),r},t.prototype.subscribeP2P=function(e){var t=this;if(!(this.p2pClient&&this.peerManager&&this.statUnit&&this.config))throw Error("[Subscriber] [subscribeP2P] missing param");if(!0===this.allowSubscribe()){var r=e||this.selectAvaliableSubscribePeer();if(r){var n=Ut.create(xt.P2P);return this.p2pSource=n,this.parent.pid&&this.parent.source&&this.parent.source.setSyncController(this.syncController),this.reportUnit.number("src_p2p_sub").plus(1),n.configure({srcPid:r,stuckFrameRateRatio:this.config.stuckFrameRateRatio}).setReporter(this.reporter).setClient(this.p2pClient).setPeerManager(this.peerManager).setStatUnit(this.statUnit).setSyncController(this.syncController).setStreamInfo(this.streamInfo).on(ie,(function(e){"video"===e.track.kind&&t.updateParent({pid:e.srcPid,source:n})})).once(re,(function(){t.reportUnit.number("src_p2p_timeout").plus(1),t.peerCooler.add(r),t.closeSource(xt.P2P),t.unmarkSubscribeP2P()})).once(ae,(function(e){e.srcPid,t.reportUnit.number("src_p2p_failed").plus(1),t.closeSource(xt.P2P),t.unmarkSubscribeP2P()})).once(ne,(function(){t.reportUnit.number("src_p2p_disconnect").plus(1),t.closeSource(xt.P2P),t.unmarkSubscribeP2P()})).once(se,(function(){t.reportUnit.number("src_p2p_error").plus(1),t.closeSource(xt.P2P),t.unmarkSubscribeP2P()})).once(ce,(function(){t.reportUnit.number("src_p2p_stuck").plus(1),t.closeSource(xt.P2P),t.unmarkSubscribeP2P()})).on(ie,(function(e){"video"===e.track.kind&&(t.reportUnit.number("src_p2p_succ").plus(1),t.subscribeStatus.status=Ft.COMPLETE)})).load(),this.markSubscribeP2P(),n}}},t.prototype.cancelsubscribe=function(){this.parent.pid&&this.parent.source&&(this.parent.source.close(),this.parent.pid="",this.parent.source=void 0)},t.prototype.onSubscribe=function(e){var t=this;if(this.reportUnit.number("on_sub").plus(1),!this.peerManager||!this.statUnit)throw Error("[Subscriber] [onSubscribe] missing param");if(!0===this.allowToBeSubscribed()){var r=new Ct,n=r.setSrcPid(this.parent.pid).setTargetPid(e).setReporter(this.reporter).setPeerManager(this.peerManager).setVideoEncodedFrameCache(this.videoEncodedFrameCache).setAudioEncodedFrameCache(this.audioEncodedFrameCache).setStatUnit(this.statUnit).onSubscribe();r.on("EVENT_RPOVIDER_DISCONNECT",(function(){t.removeChild(e)})).on("EVENT_RPOVIDER_FAILED",(function(){t.removeChild(e)})),n?(this.setChild(e,r),this.reportUnit.number("on_p2p_sub_succ").plus(1)):r.destroy()}},t.prototype.onCancelSubscribe=function(e){this.reportUnit.number("on_p2p_cancel_sub").plus(1),this.removeChild(e)},t.prototype.getParentId=function(){return this.parent.pid},t.prototype.getChildId=function(){return this.child.pid},t.prototype.allowToBeSubscribed=function(){var e;return this.parent.pid&&this.parent.source?""!==this.child.pid?"鏈夊瓙鑺傜偣":!!(null===(e=this.parent.source)||void 0===e?void 0:e.isLeb())||"鐖惰妭鐐逛笉鏄痗dn":"鏃犱笂娓歌妭鐐�"},t.prototype.allowSubscribe=function(){var e;return this.child.pid?"鏈夊瓙鑺傜偣":this.streamInfo.ready()?this.subscribeStatus.status===Ft.WAITING?"姝e湪璁㈤槄涓�":this.subscribeStatus.status===Ft.COMPLETE?"宸茬粡璁㈤槄":!(this.parent.pid&&(null===(e=this.parent.source)||void 0===e||!e.isLeb()))||"鐖惰妭鐐逛笉鏄痗dn":"娴佷俊鎭湭閲囬泦鍒�"},t.prototype.selectAvaliableSubscribePeer=function(){var e,t="";if(this.parent.pid&&null!==(e=this.parent.source)&&void 0!==e&&e.isLeb()){var r,n=this.peerCooler.getList(),i=null===(r=this.peerManager)||void 0===r?void 0:r.getBestPeer({excludePeerId:dc([this.parent.pid],lc(n))});i&&(t=i.pid)}return t},t.prototype.closeSource=function(e){var t,r;e===xt.LEB&&(null===(t=this.lebSource)||void 0===t||t.close(),this.lebSource=null),e===xt.P2P&&(null===(r=this.p2pSource)||void 0===r||r.close(),this.p2pSource=null)},t.prototype.removeChild=function(e){var t;this.child.pid&&e!==this.child.pid||(this.child.pid="",null===(t=this.child.provider)||void 0===t||t.destroy(),this.child.provider=void 0)},t.prototype.setChild=function(e,t){this.child.pid=e,this.child.provider=t},t.prototype.updateParent=function(e){e.pid!==this.parent.pid&&this.cancelsubscribe(),e.source&&(this.parent.pid=e.pid,this.parent.source=e.source)},t.prototype.updateChildTrack=function(e,t){this.child.pid&&this.child.provider&&this.child.provider.updateTrack(e,t.srcPid)},t.prototype.markSubscribeP2P=function(){this.subscribeStatus.status=Ft.WAITING},t.prototype.unmarkSubscribeP2P=function(){this.subscribeStatus.status=Ft.IDEL},t.prototype.clearSampleTimer=function(){this.sampleTimer&&(clearTimeout(this.sampleTimer),this.sampleTimer=null)},t}(w);function Bt(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Wt=function(e){function t(){var t=this;return Bt(t=e.call(this)||this,"tagName","StreamSourceModule"),Bt(t,"config",null),Bt(t,"reporter",null),Bt(t,"dispatch",new de),Bt(t,"signal",new Ae),Bt(t,"p2pServer",new he),Bt(t,"p2pClient",new ye),Bt(t,"signalTransport",new Je),Bt(t,"p2pPeerBuilder",new He),Bt(t,"peerManager",new et),Bt(t,"peerCache",new it),Bt(t,"signalApi",new st),Bt(t,"subscribeTrackApi",new ct),Bt(t,"subscriber",new jt),t.signal.on(we,(function(e){if(!t.config)throw Error("missing config");t.p2pClient.setLocalPid(e),t.p2pPeerBuilder.setLocalPid(e),t.peerCache.setPeerId(e).setStreamId(t.config.streamId()),t.peerCache.start()})),t.signalTransport.setSignal(t.signal),t.p2pClient.setTransport(t.signalTransport),t.p2pServer.setTransport(t.signalTransport),t.p2pPeerBuilder.setClient(t.p2pClient).setServer(t.p2pServer),t.peerManager.setPeerCache(t.peerCache).setPeerBuilder(t.p2pPeerBuilder),t.subscriber.setClient(t.p2pClient).setPeerManager(t.peerManager),t.subscribeTrackApi.setSubscriber(t.subscriber),t.dispatch.setSubscriber(t.subscriber),t.initApi(),t}return ic(t,e),Vp(t.prototype,"currentSourcePeerconnection",{get:function(){return this.subscriber.currentSourcePeerconnection},enumerable:!1,configurable:!0}),t.prototype.setMediaStreamProcessor=function(e){return this.dispatch.setMediaStreamProcessor(e),this},t.prototype.setReporter=function(e){return this.reporter=e,this.subscriber.setReporter(e),this.dispatch.setReporter(e),this.peerManager.setReporter(e),this},t.prototype.setStatUnit=function(e){return this.subscriber.setStatUnit(e),this},t.prototype.setBus=function(t){return e.prototype.setBus.call(this,t),this.dispatch.setBus(t),this},t.prototype.destroy=function(){this.dispatch.destroy(),this.peerCache.destroy(),this.peerManager.destroy(),this.p2pClient.destroy(),this.p2pServer.destroy(),this.signal.destroy(),this.signalApi.destroy(),this.subscribeTrackApi.destroy(),this.subscriber.destroy(),e.prototype.destroy.call(this)},t.prototype.configure=function(e){return this.config=e,this.peerCache.configure(this.config),this.peerManager.configure(this.config),this.p2pPeerBuilder.configure(this.config),this.dispatch.configure(e),this.subscriber.configure(e),this},t.prototype.init=function(){if(!this.config)throw Error("missing config");this.peerCache.init(),this.peerManager.init(),this.signal.connect(this.config.signal),this.dispatch.init()},t.prototype.load=function(e){var t=e.streamUrl;if(!this.config)throw Error("missing config");return this.dispatch.load(t)},t.prototype.initApi=function(){this.signalApi.setPeerBuilder(this.p2pPeerBuilder).setPeerManager(this.peerManager).setServer(this.p2pServer),this.subscribeTrackApi.setServer(this.p2pServer)},t}(w),Yt=function(){var e,t,r;return!!(MediaStreamTrack&&MediaStream&&MediaStreamTrack&&null!==(e=RTCPeerConnection)&&void 0!==e&&e.prototype.getReceivers&&null!==(t=RTCPeerConnection)&&void 0!==t&&t.prototype.getSenders&&null!==(r=RTCRtpReceiver)&&void 0!==r&&r.prototype.createEncodedStreams&&HTMLCanvasElement.prototype.captureStream&&MediaStreamTrackGenerator&&MediaStreamTrackProcessor)},qt=function(){function e(){var e,t,r;r=null,(t="video")in(e=this)?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}return e.prototype.destroy=function(){this.video&&(this.video.srcObject=null,this.video=null)},e.prototype.setVideoSrcObj=function(e){if(!this.video)throw Error("miss video");var t=this.video;t.onwaiting=function(){},t.ontimeupdate=function(){},t.onplay=function(){},t.onplaying=function(){},t.onpause=function(){},t.srcObject=e,t.onseeking=function(e){},t.onseeked=function(e){}},e.prototype.play=function(){var e;null===(e=this.video)||void 0===e||e.play()},e.prototype.setVideo=function(e){this.video=e},e}();function Gt(e,t){var r=Wp(e);if(lp){var n=lp(e);t&&(n=rc(n).call(n,(function(t){return Xp(e,t).enumerable}))),r.push.apply(r,n)}return r}function zt(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?ma(r=Gt(Object(i),!0)).call(r,(function(t){Ht(e,t,i[t])})):lf?yf(e,lf(i)):ma(n=Gt(Object(i))).call(n,(function(t){Vp(e,t,Xp(i,t))}))}return e}function Ht(e,t,r){return t in e?Vp(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Qt=function(e){function t(){var t=this;return Ht(t=e.call(this)||this,"player",new qt),Ht(t,"mediaStreamProcessor",new A),Ht(t,"source",new Wt),Ht(t,"reporter",new X),Ht(t,"stats",new _),Ht(t,"statsTotal",new _),Ht(t,"config",new f),Ht(t,"conf",new N),W=Kb()+"_"+B().split("-")[0],t.stats.configure({deleteZeroNumber:!1,fieldsReportedWithZeroNumber:[],fieldsReservedValueAfterReport:[]}),t.statsTotal.configure({deleteZeroNumber:!1,fieldsReportedWithZeroNumber:[],fieldsReservedValueAfterReport:["uploadBytesTotal","uploadAuidoBytesTotal","uploadVideoBytesTotal","cdnDownloadBytesTotal","cdnDownloadAuidoBytesTotal","cdnDownloadVideoBytesTotal","p2pDownloadBytesTotal","p2pDownloadAuidoBytesTotal","p2pDownloadVideoBytesTotal"]}),t.source.setMediaStreamProcessor(t.mediaStreamProcessor).setReporter(t.reporter).setStatUnit(t.stats).setBus(t),t.source.configure(t.config.config),t.reporter.configure(t.config.config).init(),t.conf.on("EVENT_CONF_LOADED",(function(e){t.config.update(e)})).once("EVENT_CONF_LOADED",(function(){t.source.init()})),t.reporter.start(),t}return ic(t,e),t.support=function(){return Yt()},t.create=function(e){var r=new t;return r.configure(e),r},Vp(t,"Event",{get:function(){return o},enumerable:!1,configurable:!0}),Vp(t,"EventCode",{get:function(){return s},enumerable:!1,configurable:!0}),Vp(t,"version",{get:function(){return q},enumerable:!1,configurable:!0}),Vp(t,"uuid",{get:function(){return B()},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.removeAllListeners(),this.reporter.destroy(),this.conf.destroy(),this.source.destroy(),this.mediaStreamProcessor.destroy(),this.player.destroy()},t.prototype.load=function(e){return ac(this,void 0,void 0,(function(){var t=this;return cc(this,(function(r){return[2,(this.config.update({streamUrl:e}),this.source.load({streamUrl:e}).then((function(){t.conf.configure({confBaseUrl:t.config.config.confBaseUrl,confInterval:0,domain:t.config.config.xp2pDomain,streamId:t.config.config.streamId()}),t.conf.load()})),{srcObject:this.mediaStreamProcessor.getMediaObj()})]}))}))},t.prototype.setVideoHtmlElement=function(e){this.player.setVideo(e),this.player.setVideoSrcObj(this.mediaStreamProcessor.getMediaObj())},t.prototype.getSDKStats=function(){return this.stats.number("uploadBytes").plus(0),this.stats.number("uploadAuidoBytes").plus(0),this.stats.number("uploadVideoBytes").plus(0),this.stats.number("cdnDownloadBytes").plus(0),this.stats.number("cdnDownloadAuidoBytes").plus(0),this.stats.number("cdnDownloadVideoBytes").plus(0),this.stats.number("p2pDownloadBytes").plus(0),this.stats.number("p2pDownloadAuidoBytes").plus(0),this.stats.number("p2pDownloadVideoBytes").plus(0),this.statsTotal.number("uploadBytesTotal").plus(this.stats.number("uploadBytes").value),this.statsTotal.number("uploadAuidoBytesTotal").plus(this.stats.number("uploadAuidoBytes").value),this.statsTotal.number("uploadVideoBytesTotal").plus(this.stats.number("uploadVideoBytes").value),this.statsTotal.number("cdnDownloadBytesTotal").plus(this.stats.number("cdnDownloadBytes").value),this.statsTotal.number("cdnDownloadAuidoBytesTotal").plus(this.stats.number("cdnDownloadAuidoBytes").value),this.statsTotal.number("cdnDownloadVideoBytesTotal").plus(this.stats.number("cdnDownloadVideoBytes").value),this.statsTotal.number("p2pDownloadBytesTotal").plus(this.stats.number("p2pDownloadBytes").value),this.statsTotal.number("p2pDownloadAuidoBytesTotal").plus(this.stats.number("p2pDownloadAuidoBytes").value),this.statsTotal.number("p2pDownloadVideoBytesTotal").plus(this.stats.number("p2pDownloadVideoBytes").value),zt(zt({},this.stats.generate()),this.statsTotal.generate())},t.prototype.getStats=function(){var e=this.source.currentSourcePeerconnection;return null==e?void 0:e.getStats()},Vp(t.prototype,"playId",{get:function(){return Y()},enumerable:!1,configurable:!0}),t.prototype.configure=function(e){this.config.update(e)},t}(e.EventEmitter)}(),n.default}()}(gR);var bR,CR,TR,SR,_R,ER,RR=r(gR.exports),PR="1.3.0",wR=["overseas-webrtc.liveplay.myqcloud.com","oswebrtc-lint.liveplay.myqcloud.com"],kR="TX_LIVE_PLAYER_SIGNAL_DATA",AR=["webrtc-signal-scheduler.tlivesource.com","bak-webrtc-signal-scheduler.tlivesource.com"],OR="max-width:100%;max-height:100%;object-fit:contain;display:block;margin:0 auto;";!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(bR||(bR={})),function(e){e[e.FAILURE=-1]="FAILURE",e[e.SUCCESS=0]="SUCCESS"}(CR||(CR={})),function(e){e[e.NEED_RECONNECT=-1]="NEED_RECONNECT",e[e.MANUAL_CLOSE=0]="MANUAL_CLOSE"}(TR||(TR={})),function(e){e[e.SEND=0]="SEND",e[e.RECEIVE=1]="RECEIVE"}(SR||(SR={})),function(e){e[e.INIT=0]="INIT",e[e.PLAYING=1]="PLAYING",e[e.WAITING=2]="WAITING"}(_R||(_R={})),function(e){e[e.PLAY_EVT_STREAM_BEGIN=1001]="PLAY_EVT_STREAM_BEGIN",e[e.PLAY_EVT_SERVER_CONNECTED=1002]="PLAY_EVT_SERVER_CONNECTED",e[e.PLAY_EVT_PLAY_BEGIN=1003]="PLAY_EVT_PLAY_BEGIN",e[e.PLAY_EVT_PLAY_STOP=1004]="PLAY_EVT_PLAY_STOP",e[e.PLAY_EVT_SERVER_RECONNECT=1005]="PLAY_EVT_SERVER_RECONNECT",e[e.PLAY_EVT_STREAM_EMPTY=1006]="PLAY_EVT_STREAM_EMPTY",e[e.PLAY_EVT_REQUEST_PULL_BEGIN=1007]="PLAY_EVT_REQUEST_PULL_BEGIN",e[e.PLAY_EVT_REQUEST_PULL_SUCCESS=1008]="PLAY_EVT_REQUEST_PULL_SUCCESS",e[e.PLAY_EVT_PLAY_WAITING_BEGIN=1009]="PLAY_EVT_PLAY_WAITING_BEGIN",e[e.PLAY_EVT_PLAY_WAITING_STOP=1010]="PLAY_EVT_PLAY_WAITING_STOP",e[e.PLAY_ERR_WEBRTC_FAIL=-2001]="PLAY_ERR_WEBRTC_FAIL",e[e.PLAY_ERR_REQUEST_PULL_FAIL=-2002]="PLAY_ERR_REQUEST_PULL_FAIL",e[e.PLAY_ERR_PLAY_FAIL=-2003]="PLAY_ERR_PLAY_FAIL",e[e.PLAY_ERR_SERVER_DISCONNECT=-2004]="PLAY_ERR_SERVER_DISCONNECT",e[e.PLAY_ERR_DECODE_FAIL=-2005]="PLAY_ERR_DECODE_FAIL",e[e.PLAY_ERR_REQUEST_ABR_FAIL=-2006]="PLAY_ERR_REQUEST_ABR_FAIL",e[e.PLAY_EVT_P2P_START_SUCCESS=3001]="PLAY_EVT_P2P_START_SUCCESS",e[e.PLAY_EVT_P2P_SOURCE_SWITCH=3002]="PLAY_EVT_P2P_SOURCE_SWITCH",e[e.PLAY_ERR_P2P_START_FAIL=-4001]="PLAY_ERR_P2P_START_FAIL"}(ER||(ER={}));var DR,LR,MR,IR=/tbs\/(\d+) /i,xR=/OS (\d+)_(\d+)_?(\d+)?/,NR=IR.test(navigator.userAgent),FR=/firefox\/(\d+)\./i.test(navigator.userAgent),UR=FR,VR=/UCBrowser\/(\d+)\./i.test(navigator.userAgent),jR=/safari\/(\d+)\./i.test(navigator.userAgent)&&!/chrome\/(\d+)\./i.test(navigator.userAgent),BR=/iPhone|iPad|iOS/i.test(navigator.userAgent),WR=BR,YR=function(){var e=navigator.userAgent.match(xR);return e&&[TE(e[1],10),TE(e[2],10),TE(e[3]||"0",10)]||[]},qR=function(e,t,r){var n=e.match(t);return n&&n.length>=r&&TE(n[r],10)},GR=function(e,t){var r,n,i=/^(?:webrtc:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)(?:[^?#]*)(?:\?*)([^?#]*)/.exec(e);if(i){var o=i[1].split("&");try{for(var s=uc(o),a=s.next();!a.done;a=s.next()){var c=lc(a.value.split("="),2),u=c[0],l=c[1];if(u===t)return l}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}return null},zR=function(e,t,r){var n,i,o=/^(?:webrtc:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)(?:[^?#]*)(?:\?*)([^?#]*)/.exec(e);if(o){var s=o[1],a=[],c=t+"="+r;try{for(var u=uc(s.split("&")),l=u.next();!l.done;l=u.next()){var d=lc(l.value.split("="),2),p=d[0],f=d[1];p===t?null!==r&&a.push(c):a.push(p+"="+f)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return null===r||jn(a).call(a,c)||a.push(c),""+e.replace(s,"")+a.join("&")}return e},HR={},QR=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],KR=QR[0];try{for(var JR=uc(QR),ZR=JR.next();!ZR.done;ZR=JR.next()){var XR=ZR.value;if(XR[1]in document){MR=XR;break}}}catch(e){DR={error:e}}finally{try{ZR&&!ZR.done&&(LR=JR.return)&&LR.call(JR)}finally{if(DR)throw DR.error}}if(MR)for(var $R=0;$R<MR.length;$R++)HR[KR[$R]]=MR[$R];var eP,tP=function(e){if("function"==typeof e.webkitEnterFullScreen){var t=navigator.userAgent||"";if(/Android/.test(t)||!/Chrome|Mac OS X 10.5/.test(t))return!0}return!1};!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.EXCELLENT=1]="EXCELLENT",e[e.GOOD=2]="GOOD",e[e.POOR=3]="POOR",e[e.BAD=4]="BAD",e[e.VERY_BAD=5]="VERY_BAD"}(eP||(eP={}));var rP=ia.map;br({target:"Array",proto:!0,forced:!Ja("map")},{map:function(e){return rP(this,e,arguments.length>1?arguments[1]:void 0)}});var nP=xr("Array").map,iP=d,oP=nP,sP=Array.prototype,aP=function(e){var t=e.map;return e===sP||iP(sP,e)&&t===sP.map?oP:t},cP=function(e){var t,r=e.split("\r\n"),n=[];ma(r).call(r,(function(e){var t=e.toLowerCase();jn(t).call(t,"a=rtpmap")&&jn(t).call(t,"h264")&&n.push(e)}));var i=rc(t=aP(n).call(n,(function(e){var t=/a=rtpmap:(\d+)\s/.exec(e);return t&&t.length>1?t[1]:null}))).call(t,(function(e){return null!==e})),o=[];return ma(r).call(r,(function(e){var t=e;if(jn(e).call(e,"a=fmtp:111")&&(t=e+";stereo=1"),jn(e).call(e,"a=fmtp")){var r=/a=fmtp:(\d+)\s/.exec(e);r&&r.length>1&&jn(i).call(i,r[1])&&(t=e+";sps-pps-idr-in-keyframe=1")}o.push(t)})),function(e){var t;if(!UR)return e;var r=e.split("\r\n"),n=[],i=[];ma(r).call(r,(function(e){var t=e.toLowerCase();jn(t).call(t,"a=rtpmap")&&jn(t).call(t,"h264")&&n.push(e)})),n.length>1&&i.push.apply(i,dc([],lc(qu(n).call(n,1))));var o=rc(t=aP(i).call(i,(function(e){var t=/a=rtpmap:(\d+)\s/.exec(e);return t&&t.length>1?t[1]:null}))).call(t,(function(e){return null!==e})),s=[];return ma(r).call(r,(function(e){var t,r=e;if(jn(e).call(e,"a=setup")&&(r="a=setup:passive"),(jn(e).call(e,"m=audio")||jn(e).call(e,"m=video"))&&(r=rc(t=e.split(" ")).call(t,(function(e,t){return t<3||!jn(o).call(o,e)})).join(" ")),jn(e).call(e,"a=fmtp")||jn(e).call(e,"a=rtcp-fb")||jn(e).call(e,"a=rtpmap")){var n=/a=(?:fmtp|rtcp-fb|rtpmap):(\d+)\s/.exec(e);if(n&&n.length>1&&jn(o).call(o,n[1]))return}s.push(r)})),s.join("\r\n")}(o.join("\r\n"))},uP=function(e){var t,r="",n="";return ma(t=e.split("\r\n")).call(t,(function(e){var t=/(?:a=ice-ufrag:)(.+)/.exec(e);if(t)r=t[1];else{var i=/(?:a=ice-pwd:)(.+)/.exec(e);i&&(n=i[1])}})),r+"_"+n},lP=function(){function e(){this.consoleEnabled=!1}return e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.consoleEnabled&&console.log.apply(console,dc([],lc(e)))},e.prototype.enableConsole=function(e){this.consoleEnabled=e},e}(),dP=new lP,pP=function(){function e(){var e,t,r,n,i,o;this.peerConnection=null,this.clientSideDescription=null,this.serverSideDescription=null,this.connectStatus=bR.DISCONNECTED,this.connectDirection=SR.RECEIVE,this.negotiating=!1,this.onAddTrack=null,this.onConnect=null,this.onDisconnect=null,this.onSetLocalDescription=null,this.onError=null,this.onTrack=jr(e=this.onTrack).call(e,this),this.onIceConnectionStateChange=jr(t=this.onIceConnectionStateChange).call(t,this),this.onIceCandidate=jr(r=this.onIceCandidate).call(r,this),this.onSignalingStateChange=jr(n=this.onSignalingStateChange).call(n,this),this.onConnectionStateChange=jr(i=this.onConnectionStateChange).call(i,this),this.onNegotiationNeeded=jr(o=this.onNegotiationNeeded).call(o,this)}return e.prototype.init=function(e){var t=void 0===e?{}:e,r=t.onAddTrack,n=void 0===r?null:r,i=t.onConnect,o=void 0===i?null:i,s=t.onDisconnect,a=void 0===s?null:s,c=t.onSetLocalDescription,u=void 0===c?null:c,l=t.onError,d=void 0===l?null:l;this.onAddTrack=n,this.onConnect=o,this.onDisconnect=a,this.onSetLocalDescription=u,this.onError=d},e.prototype.initWebRTCConnect=function(e){var t=void 0===e?{}:e,r=t.config,n=t.direction,i=void 0===n?SR.RECEIVE:n,o=t.stream;return ac(this,void 0,void 0,(function(){return cc(this,(function(e){switch(e.label){case 0:return dP.log("CloudWebRTC init"),this.peerConnection?(dP.log("Call disconnected before connect"),[2]):(this.connectDirection=i,[4,this.createWebRTCConnect(r,o)]);case 1:return e.sent(),[2]}}))}))},e.prototype.connect=function(e){e&&this.onAnswer(e)},e.prototype.disconnect=function(e){var t,r=void 0===e?{}:e,n=r.msg,i=void 0===n?"":n,o=r.code,s=void 0===o?TR.MANUAL_CLOSE:o;dP.log("connection disconnect->",s,i),this.connectStatus!==bR.DISCONNECTED&&(this.connectStatus=bR.DISCONNECTED,this.negotiating=!1,this.peerConnection&&(this.peerConnection.removeEventListener("track",this.onTrack),this.peerConnection.removeEventListener("iceconnectionstatechange",this.onIceConnectionStateChange),this.peerConnection.removeEventListener("icecandidate",this.onIceCandidate),this.peerConnection.removeEventListener("signalingstatechange",this.onSignalingStateChange),this.peerConnection.removeEventListener("connectionstatechange",this.onConnectionStateChange),this.peerConnection.removeEventListener("negotiationneeded",this.onNegotiationNeeded),this.peerConnection.close(),this.peerConnection=null),this.clientSideDescription=null,this.serverSideDescription=null,s===TR.NEED_RECONNECT&&dP.log("Please try to reconnect"),null===(t=this.onDisconnect)||void 0===t||t.call(this,{code:s,msg:i}))},e.prototype.getClientSideDescription=function(){return this.clientSideDescription||dP.log("webrtc is not initialized"),this.clientSideDescription},e.prototype.getConnectStatus=function(){return this.connectStatus},e.prototype.getStats=function(){return ac(this,void 0,void 0,(function(){return cc(this,(function(e){switch(e.label){case 0:return this.peerConnection?[4,this.peerConnection.getStats(null)]:[2];case 1:return[2,e.sent()]}}))}))},e.prototype.createWebRTCConnect=function(e,t){var r,n;return ac(this,void 0,void 0,(function(){var i,o=this;return cc(this,(function(s){switch(s.label){case 0:try{i=oc({iceServers:[],sdpSemantics:"unified-plan",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",tcpCandidatePolicy:"disable",IceTransportsType:"nohost"},null!==(r=e.connection)&&void 0!==r?r:{}),this.peerConnection=new RTCPeerConnection(i)}catch(e){var a;return dP.log(e),"ReferenceError"===e.name&&jn(a=e.message).call(a,"RTCPeerConnection")&&(dP.log("Not support WebRTC"),null===(n=this.onError)||void 0===n||n.call(this,"WebRTC is not supported")),[2]}var c;if(this.connectStatus=bR.CONNECTING,this.negotiating=!1,this.peerConnection.addEventListener("track",this.onTrack),this.peerConnection.addEventListener("iceconnectionstatechange",this.onIceConnectionStateChange),this.peerConnection.addEventListener("icecandidate",this.onIceCandidate),this.peerConnection.addEventListener("signalingstatechange",this.onSignalingStateChange),this.peerConnection.addEventListener("connectionstatechange",this.onConnectionStateChange),this.peerConnection.addEventListener("negotiationneeded",this.onNegotiationNeeded),this.connectDirection===SR.SEND&&t instanceof MediaStream)ma(c=t.getTracks()).call(c,(function(e){o.peerConnection.addTrack(e,t)}));return this.connectDirection!==SR.RECEIVE?[3,2]:[4,this.createOffer(e.offer)];case 1:s.sent(),s.label=2;case 2:return[2]}}))}))},e.prototype.onTrack=function(e){var t;dP.log("onTrack",e),dP.log("on "+e.track.kind+" track",e.streams,e.track),null===(t=this.onAddTrack)||void 0===t||t.call(this,e.track)},e.prototype.onIceConnectionStateChange=function(e){var t;switch(dP.log("onIceConnectionStateChange",this.peerConnection.iceConnectionState,e),this.peerConnection.iceConnectionState){case"failed":case"disconnected":dP.log("Connection disconnected, please try again"),this.disconnect({code:TR.NEED_RECONNECT,msg:"Connection disconnected, please try again"});break;case"connected":case"completed":if(!UR)return;if(this.connectStatus===bR.CONNECTED)return;dP.log("iceConnection connected"),this.connectStatus=bR.CONNECTED,null===(t=this.onConnect)||void 0===t||t.call(this,{code:CR.SUCCESS,msg:"Connection connected"})}},e.prototype.onIceCandidate=function(e){dP.log("onIceCandidate",e)},e.prototype.onSignalingStateChange=function(e){dP.log("onSignalingStateChange",this.peerConnection.signalingState,e)},e.prototype.onConnectionStateChange=function(e){var t;switch(dP.log("onConnectionStateChange",this.peerConnection.connectionState,e),this.peerConnection.connectionState){case"failed":case"disconnected":dP.log("Connection disconnected, please try again"),this.disconnect({code:TR.NEED_RECONNECT,msg:"Connection disconnected, please try again"});break;case"connected":if(this.connectStatus===bR.CONNECTED)return;dP.log("connection connected"),this.connectStatus=bR.CONNECTED,null===(t=this.onConnect)||void 0===t||t.call(this,{code:CR.SUCCESS,msg:"Connection connected"})}},e.prototype.onNegotiationNeeded=function(e){if(dP.log("onNegotiationNeeded",e),this.connectDirection!==SR.RECEIVE)try{if(this.negotiating||"stable"!==this.peerConnection.signalingState)return;this.negotiating=!0,this.createOffer()}catch(e){dP.log("onNegotiationNeeded error",e)}finally{this.negotiating=!1}},e.prototype.createOffer=function(e){var t;return void 0===e&&(e={}),ac(this,void 0,void 0,(function(){var r,n,i,o,s,a,c;return cc(this,(function(u){switch(u.label){case 0:r=e.offerToReceiveVideo,n=e.offerToReceiveAudio,i=sc(e,["offerToReceiveVideo","offerToReceiveAudio"]),o=oc({voiceActivityDetection:!1},i),this.connectDirection===SR.RECEIVE&&(s=!!this.peerConnection.addTransceiver,dP.log("peerConnection "+(s?"":"no")+" addTransceiver"),s?(n&&this.peerConnection.addTransceiver("audio",{direction:"recvonly"}),r&&this.peerConnection.addTransceiver("video",{direction:"recvonly"})):o=oc(oc({},o),{offerToReceiveVideo:r,offerToReceiveAudio:n})),u.label=1;case 1:return u.trys.push([1,4,,5]),a=this.onOffer,[4,this.peerConnection.createOffer(o)];case 2:return[4,a.apply(this,[u.sent()])];case 3:return u.sent(),[3,5];case 4:return c=u.sent(),dP.log("create offer error",c),this.disconnect({code:TR.NEED_RECONNECT,msg:"create offer is failed"}),null===(t=this.onError)||void 0===t||t.call(this,"create offer is failed"),[3,5];case 5:return[2]}}))}))},e.prototype.onOffer=function(e){var t,r;return ac(this,void 0,void 0,(function(){var n,i;return cc(this,(function(o){switch(o.label){case 0:dP.log("peerConnection set local sdp"),n=e.sdp,n=this.connectDirection===SR.RECEIVE?cP(n):aP(s=n.split("\r\n")).call(s,(function(e){return jn(e).call(e,"a=fmtp:111")?e+";stereo=1":e})).join("\r\n"),e.sdp=n,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.peerConnection.setLocalDescription(e)];case 2:return o.sent(),this.clientSideDescription=this.peerConnection.localDescription,null===(t=this.onSetLocalDescription)||void 0===t||t.call(this,this.clientSideDescription),[3,4];case 3:return i=o.sent(),dP.log("setLocalDescription error",i,this.clientSideDescription),null===(r=this.onError)||void 0===r||r.call(this,"set local sdp is failed"),[3,4];case 4:return[2]}var s}))}))},e.prototype.onAnswer=function(e){var t;return ac(this,void 0,void 0,(function(){var r;return cc(this,(function(n){switch(n.label){case 0:dP.log("peerConnection set remote sdp"),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.peerConnection.setRemoteDescription(new RTCSessionDescription(e))];case 2:return n.sent(),this.serverSideDescription=this.peerConnection.remoteDescription,[3,4];case 3:return r=n.sent(),dP.log("setRemoteDescription error",r,e),null===(t=this.onError)||void 0===t||t.call(this,"set remote sdp is failed"),[3,4];case 4:return[2]}}))}))},e}(),fP=wi.PROPER,hP=n,vP=eE,mP=cE.trim;br({target:"String",proto:!0,forced:function(e){return hP((function(){return!!vP[e]()||"鈥嬄呩爭"!=="鈥嬄呩爭"[e]()||fP&&vP[e].name!==e}))}("trim")},{trim:function(){return mP(this)}});var yP=xr("String").trim,gP=d,bP=yP,CP=String.prototype,TP=function(e){var t=e.trim;return"string"==typeof e||e===CP||gP(CP,e)&&t===CP.trim?bP:t},SP=function(){function e(){this.timeMark=null,this.commonData=null,this.reportData=null,this.tempData=null,this.onReport=null,this.timeMark=new Db,this.commonData={},this.initCommonData(),this.reportData=oc({},this.commonData),this.tempData={}}return e.prototype.setData=function(e,t,r){void 0===r&&(r=!1),this.reportData[e]=t,r&&(this.commonData[e]=t)},e.prototype.setTempData=function(e,t){this.tempData[e]=t},e.prototype.getTempData=function(e){return this.tempData[e]},e.prototype.startReport=function(e){var t;switch(e){case"start":this.setData("uint32_data_type",1),this.setData("uint32_command",40101);break;case"interval":this.setData("uint32_data_type",2),this.setData("uint32_command",40100);break;case"stop":this.setData("uint32_data_type",1),this.setData("uint32_command",40102)}var r=(new Date).getTime();this.setData("uint64_data_time",Math.round(r/1e3)),null===(t=this.onReport)||void 0===t||t.call(this,this.reportData),this.reportData=oc({},this.commonData)},e.prototype.setHandler=function(e){this.onReport=e},e.prototype.markTime=function(e){var t=window.performance?window.performance.now():(new Date).getTime();this.timeMark.set(e,t)},e.prototype.measureTime=function(e,t,r,n){if(void 0===n&&(n=!1),this.timeMark.has(t)&&this.timeMark.has(r)){var i=Math.round(this.timeMark.get(r)-this.timeMark.get(t));this.setData(e,i),n&&this.setTempData(e,i)}},e.prototype.clearData=function(){this.timeMark?this.timeMark.clear():this.timeMark=new Db,this.commonData={},this.initCommonData(),this.reportData=oc({},this.commonData),this.tempData={}},e.prototype.destroy=function(){var e;null===(e=this.timeMark)||void 0===e||e.clear(),this.timeMark=null,this.commonData=null,this.reportData=null,this.tempData=null,this.onReport=null},e.prototype.initCommonData=function(){var e;this.commonData.str_app_version="TXLivePlayer-1.3.0",this.commonData.bytes_version="TXLivePlayer-1.3.0";var t=window.navigator.userAgent,r=bu.parse(t),n=r.platform,i=r.os,o=r.browser;this.commonData.str_device_type=n.model||n.vendor||"",this.commonData.str_os_info=TP(e=(i.name||"")+" "+(i.version||"")).call(e),this.commonData.str_browser_model=o.name||"",this.commonData.str_browser_version=o.version||"",this.commonData.str_user_agent=t,this.commonData.u32_link_type=4,this.commonData.u32_channel_type=3},e}(),_P=function(e,t){return fetch(e,{body:$b(t),cache:"no-cache",credentials:"same-origin",headers:{"content-type":"application/json"},method:"POST",mode:"cors"}).then((function(e){if(200!==e.status)throw new Error("status Code:"+e.status);return e.json()}))},EP=function(){function e(){this.baseUrl="",this.signalDomainConfig={protocol:"https",domain:"",query:!0}}return e.prototype.setSignalConfig=function(e){var t=e.protocol,r=void 0===t?"https":t,n=e.domain,i=void 0===n?"":n,o=e.query,s=void 0===o||o;this.signalDomainConfig.protocol=r,this.signalDomainConfig.domain=i,this.signalDomainConfig.query=s},e.prototype.fetchPullStream=function(e){var t;return ac(this,void 0,void 0,(function(){var r,n,i,o,s,a,c,u,l=this;return cc(this,(function(d){switch(d.label){case 0:return r=function(e,t){return ac(l,void 0,void 0,(function(){var r,n,i,o,s;return cc(this,(function(a){switch(a.label){case 0:return[4,_P(e+"/webrtc/v1/pullstream",t)];case 1:if(r=a.sent(),n=r.errcode,i=r.errmsg,o=r.remotesdp,s=r.svrsig,0!==n)throw new Error("errCode:"+n+", errMsg:"+i);return[2,{url:e,remoteSdp:o,svrSig:s}]}}))}))},this.baseUrl?[4,r(this.baseUrl,e)]:[3,2];case 1:return n=d.sent(),a=n.url,[2,c=sc(n,["url"])];case 2:i=this.signalDomainConfig.protocol,d.label=3;case 3:return d.trys.push([3,5,,6]),o=aP(wR).call(wR,(function(t){return r(i+"://"+t,e)})),[4,$_.any(o)];case 4:return s=d.sent(),a=s.url,c=sc(s,["url"]),this.baseUrl=a,[2,c];case 5:throw u=d.sent(),(null===(t=null==u?void 0:u.errors)||void 0===t?void 0:t[0])||u;case 6:return[2]}}))}))},e.prototype.fetchStopStream=function(e){return ac(this,void 0,void 0,(function(){var t,r,n,i;return cc(this,(function(o){switch(o.label){case 0:if(!this.baseUrl)throw new Error("signal domain name is empty");return t=this.baseUrl+"/webrtc/v1/stopstream",[4,_P(t,e)];case 1:if(r=o.sent(),n=r.errcode,i=r.errmsg,0!==n)throw new Error("stop stream failed, errCode:"+n+", errmsg:"+i);return[2,r]}}))}))},e.prototype.fetchStreamSdp=function(e){return ac(this,void 0,void 0,(function(){var t,r,n,i,o,s,a;return cc(this,(function(c){switch(c.label){case 0:return t=e.streamurl,r=e.sessionid,n=e.localsdp,[4,_P(t,{version:"v1.0",sessionId:r,localSdp:n})];case 1:if(i=c.sent(),o=i.code,s=i.message,a=i.remoteSdp,200!==o)throw new Error("errCode:"+o+", errMsg:"+s);return[2,{remoteSdp:a,svrSig:null}]}}))}))},e.prototype.fetchAbrControl=function(e){return ac(this,void 0,void 0,(function(){var t,r,n,i;return cc(this,(function(o){switch(o.label){case 0:if(!this.baseUrl)throw new Error("signal domain name is empty");return t=this.baseUrl+"/webrtc/v1/tabrctl",[4,_P(t,e)];case 1:if(r=o.sent(),n=r.errcode,i=r.seq,0!==n)throw new Error("errCode:"+n+", errMsg:"+(403===n?"not allowed error":"error"));return[2,{seq:i}]}}))}))},e.prototype.updateSignalDomain=function(e){var t=this.signalDomainConfig,r=t.protocol,n=t.domain,i=t.query;if(e&&i){var o=window.localStorage.getItem(kR);if(o){var s=JSON.parse(o)[e];if(s){var a=s.signal,c=s.expire;return(new Date).getTime()>c&&this.fetchSignalDomain(e,AR[0]),void(this.baseUrl=r+"://"+a)}}this.baseUrl=n?r+"://"+n:"",this.fetchSignalDomain(e,AR[0])}else this.baseUrl=n?r+"://"+n:""},e.prototype.getSignalDomain=function(){return this.baseUrl},e.prototype.fetchSignalDomain=function(e,t){return ac(this,void 0,void 0,(function(){var r,n,i,o,s,a,c,u,l;return cc(this,(function(d){switch(d.label){case 0:if(!e||!t)return[2];r="https://"+t+"/signal_query",d.label=1;case 1:return d.trys.push([1,3,,4]),[4,_P(r,{domain:e,requestid:yu(16),client_type:"Web",client_info:window.navigator.userAgent})];case 2:if(n=d.sent(),i=n.errcode,o=n.data,0===i){s=o.signal_domain,a=o.cache_time,c={},(u=window.localStorage.getItem(kR))&&(c=JSON.parse(u)),c[e]={signal:s,expire:(new Date).getTime()+1e3*a};try{window.localStorage.setItem(kR,$b(c))}catch(e){}}return[3,4];case 3:return d.sent(),-1!==(l=Yf(AR).call(AR,t))&&this.fetchSignalDomain(e,AR[l+1]),[3,4];case 4:return[2]}}))}))},e}(),RP=function(){function e(){var e,t,r,n,i,o,s,a,c;this.playerView=null,this.playUrl=null,this.rawUrl=null,this.isVideoExisted=!1,this.webrtcConnection=null,this.svrSig=null,this.stream=null,this.timer={retryTimeout:null,statsInterval:null,disconnectTimeout:null},this.connectRetry={maxNum:3,curNum:0,delay:1,playing:!1},this.streamDecodeFail={maxNum:3,curNum:0},this.streamReceiveFail={maxNum:5,curNum:0},this.streamPlaying={threshold:5,status:_R.INIT},this.docOrigOverflow=null,this.offerToReceive={video:!0,audio:!0},this.listener={onPlayEvent:null,onPlayStats:null,onPlayReport:null},this.lastStatsReport=null,this.report=null,this.signal=null,this.abrClient={curBitrate:"",seq:0},this.p2pMode={enable:!1,config:{cloudAppid:0,xp2pAppid:"",appKey:"",appSecret:"",xp2pDomain:""},source:""},this.p2pConnection=null,this.report=new SP,this.signal=new EP,this.onAddTrack=jr(e=this.onAddTrack).call(e,this),this.onSetLocalDescription=jr(t=this.onSetLocalDescription).call(t,this),this.onConnect=jr(r=this.onConnect).call(r,this),this.onDisconnect=jr(n=this.onDisconnect).call(n,this),this.onError=jr(i=this.onError).call(i,this),this.onStats=jr(o=this.onStats).call(o,this),this.onBeforeUnload=jr(s=this.onBeforeUnload).call(s,this),this.onPagehide=jr(a=this.onPagehide).call(a,this),this.onP2PEvent=jr(c=this.onP2PEvent).call(c,this),window.addEventListener("beforeunload",this.onBeforeUnload),window.addEventListener("pagehide",this.onPagehide);var u=mu.browserDetails,l=u.browser,d=u.version;dP.log("browser is "+l+", version is "+d)}return e.checkSupport=function(e){ac(void 0,void 0,void 0,(function(){var e,t,r;return cc(this,(function(n){var i;switch(n.label){case 0:return e=!1,ma(i=["RTCPeerConnection","webkitRTCPeerConnection"]).call(i,(function(t){e||t in window&&(e=!0)})),NR||(VR&&BR||jR&&BR&&(0===(t=YR()).length||t[0]<11||11===t[0]&&t[1]<1||11===t[0]&&1===t[1]&&t[2]<2))&&(e=!1),[4,ac(void 0,void 0,void 0,(function(){var e,t,r,n;return cc(this,(function(i){var o;switch(i.label){case 0:return i.trys.push([0,2,,3]),e=new RTCPeerConnection({iceServers:[],sdpSemantics:"unified-plan"}),t={},e.addTransceiver?(e.addTransceiver("audio",{direction:"recvonly"}),e.addTransceiver("video",{direction:"recvonly"})):t={offerToReceiveVideo:!0,offerToReceiveAudio:!0},[4,e.createOffer(t)];case 1:return r=i.sent(),n=Yf(o=r.sdp.toLowerCase()).call(o,"h264")>-1,e.close(),[2,n];case 2:return i.sent(),[2,!1];case 3:return[2]}}))}))];case 1:return r=n.sent(),[2,{support:e,isTbs:NR,tbsVersion:NR?qR(navigator.userAgent,IR,1):null,isFirefox:FR,isSafari:jR,isIOS:BR,iOSVersion:BR?YR().join("."):null,h264Support:r}]}}))})).then((function(t){var r=t.support,n=t.h264Support;null==e||e({support:r,h264Support:n,p2pSupport:RR.support()})}))},e.prototype.setConfig=function(e){var t=e.connectRetryCount,r=e.connectRetryDelay,n=e.receiveVideo,i=e.receiveAudio,o=e.showLog,s=e.p2pEnable,a=e.p2pConfig,c=e.signalDomain,u=e.maxDecodeFailCount,l=e.maxReceiveFailCount,d=e.minDecodeFramerate;if(void 0!==t&&("number"==typeof t&&t>=0?this.connectRetry.maxNum=t:dP.log("connectRetryCount must be a number greater than or equal to 0")),void 0!==r&&("number"==typeof r&&r>=0?this.connectRetry.delay=r:dP.log("connectRetryDelay must be a number greater than or equal to 0")),void 0!==n&&(this.offerToReceive.video=!!n),void 0!==i&&(this.offerToReceive.audio=!!i),void 0!==o&&dP.enableConsole(!!o),void 0!==s&&(this.p2pMode.enable=!!s),void 0!==a){var p=null!=a?a:{},f=p.cloudAppid,h=p.appKey,v=p.appSecret,m=p.xp2pAppid,y=p.xp2pDomain;this.p2pMode.config=oc(oc({},this.p2pMode.config),{cloudAppid:f,appKey:h,appSecret:v,xp2pAppid:m,xp2pDomain:y})}if(void 0!==c)if("string"==typeof c)this.signal.setSignalConfig({domain:c});else{var g,b=null!=c?c:{},C=b.protocol,T=b.domain,S=b.query;this.signal.setSignalConfig({protocol:jn(g=["https","http"]).call(g,C)?C:"https",domain:T,query:S})}void 0!==u&&("number"==typeof u&&u>=0?this.streamDecodeFail.maxNum=u:dP.log("maxDecodeFailCount must be a number greater than or equal to 0")),void 0!==l&&("number"==typeof l&&l>=0?this.streamReceiveFail.maxNum=l:dP.log("maxReceiveFailCount must be a number greater than or equal to 0")),void 0!==d&&("number"==typeof d&&d>=0?this.streamPlaying.threshold=d:dP.log("minDecodeFramerate must be a number greater than or equal to 0"))},e.prototype.setPlayListener=function(e){var t=e.onPlayEvent,r=e.onPlayStats,n=e.onPlayReport;void 0!==t&&("function"==typeof t?this.listener.onPlayEvent=t:dP.log("onPlayEvent must be function")),void 0!==r&&("function"==typeof r?this.listener.onPlayStats=r:dP.log("onPlayStats must be function")),void 0!==n&&("function"==typeof n?(this.listener.onPlayReport=n,this.report.setHandler(n)):dP.log("onPlayReport must be function"))},e.prototype.setPlayerView=function(e){if(this.playerView)dP.log("player view is existed");else{var t="string"==typeof e?document.getElementById(e):e;if(t&&(t instanceof HTMLDivElement||t instanceof HTMLVideoElement))if(t instanceof HTMLVideoElement)this.playerView=t;else{var r=document.createElement("video");r.autoplay=!0,r.muted=!0,r.controls=!0,r.playsInline=!0,r.setAttribute("webkit-playsinline",""),r.setAttribute("x5-playsinline",""),r.setAttribute("style",OR),t.appendChild(r),this.playerView=r}else dP.log("Require container element id or HTMLDivElement")}},e.prototype.startPlay=function(e){var t,r,n,i,o=this;if(this.playerView){var s=function(e){var t=/^(?:webrtc:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)([^?#]*)(?:\?*)(?:[^?#]*)/.exec(e);if(t)return t[1];var r=/^(?:https?:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)([^?#]*)(?:\.sdp)(?:\?*)(?:[^?#]*)/.exec(e);return r?r[1]:null}(e);if(null!==s)if(this.isVideoExisted)dP.log("Video is existed, please stop playing first");else if(this.offerToReceive.video||this.offerToReceive.audio){var a=(new Date).getTime();this.report.clearData(),this.report.setData("u64_timestamp",a),this.report.setTempData("pull_start_time",a),this.report.markTime("pull_start"),this.report.setData("bytes_stream_id",s,!0),this.report.setData("str_stream_url",e,!0);var c,u=(c=/^(?:webrtc:\/\/)([0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)(?:[^?#]*)(?:\?*)(?:[^?#]*)/.exec(e))?c[1]:null;if(this.signal.updateSignalDomain(u),this.rawUrl=e,this.playUrl=function(e){var t=GR(e,"tabr_bitrates"),r=GR(e,"tabr_start_bitrate"),n=GR(e,"tabr_control"),i=e;return t&&r&&(i=zR(i,"tabr_control",null),i=zR(i,"webrtc_tabr_level","auto"===n?"server_control":"client_control")),i}(e),this.streamReceiveFail.curNum=0,this.streamDecodeFail.curNum=0,this.streamPlaying.status=_R.INIT,this.abrClient.seq=0,this.p2pMode.source="",this.p2pMode.enable){if(this.p2pConnection)return void dP.log("p2p connection is existed, please stop playing first");if(RR.support()&&this.offerToReceive.video&&this.offerToReceive.audio&&!function(e){var t=GR(e,"tabr_bitrates"),r=GR(e,"tabr_start_bitrate");return!(!t||!r)}(e)){this.report.setData("u32_isp2p",1,!0),null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,ER.PLAY_EVT_P2P_START_SUCCESS);var l=this.signal.getSignalDomain();return this.p2pConnection=RR.create(oc(oc({},this.p2pMode.config),{connectRetryCount:this.connectRetry.maxNum,connectRetryDelay:1e3*this.connectRetry.delay,pullStreamDomain:l,stopStreamDomain:l})),this.p2pConnection.on(RR.Event,this.onP2PEvent),void this.p2pConnection.load(this.playUrl).then((function(e){var t=e.srcObject;o.stream=t,o.onAddStream(o.stream)}))}dP.log("p2p mode start failed"),null===(i=(n=this.listener).onPlayEvent)||void 0===i||i.call(n,ER.PLAY_ERR_P2P_START_FAIL)}this.report.setData("u32_isp2p",0,!0),this.webrtcConnection||(this.webrtcConnection=new pP,this.webrtcConnection.init({onAddTrack:this.onAddTrack,onSetLocalDescription:this.onSetLocalDescription,onConnect:this.onConnect,onDisconnect:this.onDisconnect,onError:this.onError})),this.webrtcConnection.initWebRTCConnect({config:{connection:{},offer:{offerToReceiveVideo:this.offerToReceive.video,offerToReceiveAudio:this.offerToReceive.audio}}})}else dP.log("Both receiveVideo and receiveAudio are false");else dP.log("Play url is not correct")}else dP.log("Please set player view first")},e.prototype.stopPlay=function(e){var t,r,n;return void 0===e&&(e=!0),ac(this,void 0,void 0,(function(){var i;return cc(this,(function(o){switch(o.label){case 0:if(!this.isVideoExisted)return dP.log("Video is not existed"),[2];if(this.isVideoExisted=!1,this.timer.disconnectTimeout&&(window.clearTimeout(this.timer.disconnectTimeout),this.timer.disconnectTimeout=null),this.timer.retryTimeout&&(window.clearTimeout(this.timer.retryTimeout),this.timer.retryTimeout=null),this.abrClient.curBitrate="",this.connectRetry.curNum=0,this.connectRetry.playing=!1,this.timer.statsInterval&&(window.clearInterval(this.timer.statsInterval),this.timer.statsInterval=null),!this.playUrl||!this.svrSig)return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.signal.fetchStopStream({streamurl:this.playUrl,svrsig:this.svrSig})];case 2:return o.sent(),[3,4];case 3:return i=o.sent(),dP.log(i.message||""),[3,4];case 4:this.playUrl=null,this.svrSig=null,o.label=5;case 5:return[4,this.startReport("stop")];case 6:var s;if(o.sent(),this.p2pConnection?(this.p2pConnection.destroy(),this.p2pConnection=null):this.webrtcConnection.disconnect(),e)null===(t=this.stream)||void 0===t||ma(s=t.getTracks()).call(s,(function(e){e.stop()}));return this.stream=null,this.playerView&&(this.playerView.pause(),e&&(this.playerView.srcObject=null,this.playerView.load())),null===(n=(r=this.listener).onPlayEvent)||void 0===n||n.call(r,ER.PLAY_EVT_PLAY_STOP),[2]}}))}))},e.prototype.switchStream=function(e){return ac(this,void 0,void 0,(function(){var t,r,n;return cc(this,(function(i){switch(i.label){case 0:if(o=this.rawUrl,s=e,!(a=function(e){var t=GR(e,"tabr_bitrates"),r=GR(e,"tabr_start_bitrate"),n=GR(e,"tabr_control");return!(!t||!r||"auto"===n)})(o)||!a(s)||zR(o,"tabr_start_bitrate",null)!==zR(s,"tabr_start_bitrate",null))return[3,5];if(!this.svrSig)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),t=GR(e,"tabr_start_bitrate"),dP.log("abr control: switch "+t),this.abrClient.seq=this.abrClient.seq+1,[4,this.signal.fetchAbrControl({svrsig:this.svrSig,seq:this.abrClient.seq,bitrate_name:t})];case 2:return r=i.sent().seq,this.abrClient.seq=Math.max(this.abrClient.seq,r),this.abrClient.curBitrate=t,[3,4];case 3:return n=i.sent(),dP.log(n.message),this.onPlayError(ER.PLAY_ERR_REQUEST_ABR_FAIL,{message:n.message}),[3,4];case 4:return[3,7];case 5:return[4,this.stopPlay()];case 6:i.sent(),this.startPlay(e),i.label=7;case 7:return[2]}var o,s,a}))}))},e.prototype.isPlaying=function(){return this.isVideoExisted&&this.isVideoPlaying()},e.prototype.pause=function(){this.playerView&&this.isVideoExisted&&this.isVideoPlaying()&&this.playerView.pause()},e.prototype.resume=function(){return ac(this,void 0,void 0,(function(){var e;return cc(this,(function(t){switch(t.label){case 0:if(!this.playerView||!this.isVideoExisted||this.isVideoPlaying())return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.playerView.play()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),dP.log("resume failed",e),[3,4];case 4:return[2]}}))}))},e.prototype.setMute=function(e){this.playerView&&(this.playerView.muted=!!e)},e.prototype.setVolume=function(e){"number"==typeof e&&e>=0&&e<=100?this.playerView&&(this.playerView.volume=e/100):dP.log("volume must be a number between 0 and 100")},e.prototype.setControls=function(e){this.playerView&&(this.playerView.controls=!!e)},e.prototype.setFullscreen=function(e){this.playerView&&(e?this.requestFullscreen():this.exitFullscreen())},e.prototype.getVideoElement=function(){return this.playerView},e.prototype.destroy=function(){return ac(this,void 0,void 0,(function(){return cc(this,(function(e){switch(e.label){case 0:return window.removeEventListener("pagehide",this.onPagehide),window.removeEventListener("beforeunload",this.onBeforeUnload),this.timer.disconnectTimeout&&(window.clearTimeout(this.timer.disconnectTimeout),this.timer.disconnectTimeout=null),this.timer.retryTimeout&&(window.clearTimeout(this.timer.retryTimeout),this.timer.retryTimeout=null),this.timer.statsInterval&&(window.clearInterval(this.timer.statsInterval),this.timer.statsInterval=null),this.isVideoExisted&&(this.webrtcConnection||this.p2pConnection)?[4,this.startReport("stop")]:[3,2];case 1:e.sent(),e.label=2;case 2:var t;if(this.stream)ma(t=this.stream.getTracks()).call(t,(function(e){e.stop()})),this.stream=null;return this.playerView&&(this.playerView.pause(),this.playerView.srcObject=null,this.playerView.parentElement.removeChild(this.playerView),this.playerView=null),this.p2pConnection&&(this.p2pConnection.destroy(),this.p2pConnection=null),this.webrtcConnection&&(this.webrtcConnection.disconnect(),this.webrtcConnection=null),this.lastStatsReport=null,this.report&&(this.report.destroy(),this.report=null),this.signal=null,[2]}}))}))},e.prototype.isVideoPlaying=function(){return!(!this.playerView||!1!==this.playerView.paused)},e.prototype.requestFullscreen=function(){var e=HR;try{e.requestFullscreen?this.playerView[e.requestFullscreen]({navigationUI:"hide"}):tP(this.playerView)?this.playerView.webkitEnterFullScreen():this.enterFullWindow()}catch(e){dP.log("enter full screen failed, ",e)}},e.prototype.exitFullscreen=function(){var e,t=HR;try{if(t.requestFullscreen){var r=document[t.exitFullscreen]();null===(e=null==r?void 0:r.catch)||void 0===e||e.call(r,(function(e){return dP.log("exit full screen failed, ",null==e?void 0:e.message)}))}else tP(this.playerView)?this.playerView.webkitExitFullScreen():this.exitFullWindow()}catch(e){dP.log("exit full screen failed, ",e)}},e.prototype.enterFullWindow=function(){this.docOrigOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden",this.playerView.setAttribute("style","position:fixed;overflow:hidden;z-index:9999;left:0;top:0;bottom:0;right:0;width:100% !important;height:100% !important;padding-top:0 !important;background-color:#000;")},e.prototype.exitFullWindow=function(){document.documentElement.style.overflow=this.docOrigOverflow,this.playerView.setAttribute("style",OR)},e.prototype.onAddStream=function(e){var t,r,n,i;return ac(this,void 0,void 0,(function(){var o,s,a,c,u,l=this;return cc(this,(function(d){switch(d.label){case 0:if(null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,ER.PLAY_EVT_STREAM_BEGIN),!this.playerView)return[2];if(o=function(){l.playerView.removeEventListener("canplay",o),l.report.markTime("video_play"),l.offerToReceive.video?(l.report.measureTime("u32_first_video_decode_time","pull_start","video_play"),l.report.measureTime("u32_first_i_frame","pull_start","video_play",!0)):(l.report.setData("u32_first_video_decode_time",0),l.report.setData("u32_first_i_frame",0),l.report.setTempData("u32_first_i_frame",0)),l.offerToReceive.audio?l.report.measureTime("u32_first_audio_render_time","pull_start","video_play"):l.report.setData("u32_first_audio_render_time",0),l.playerView.autoplay||l.connectRetry.playing||l.startReport("start")},this.playerView.addEventListener("canplay",o),this.playerView.srcObject=e,this.isVideoExisted=!0,!this.playerView.autoplay&&!this.connectRetry.playing)return[2];s=function(e){var t;dP.log("play failed",e),jn(t=e.toString()).call(t,"NotAllowedError")?Oa((function(){var t;null===(t=l.getConnectionStats())||void 0===t||t.then((function(t){var r,n,i=function(e){if(e){var t=null,r=null;ma(e).call(e,(function(e){"inbound-rtp"===e.type&&("video"===e.kind||"video"===e.mediaType?t=e.id:"audio"!==e.kind&&"audio"!==e.mediaType||(r=e.id))}));var n=e.get(t),i=e.get(r);return{video:{bytesReceived:null==n?void 0:n.bytesReceived},audio:{bytesReceived:null==i?void 0:i.bytesReceived}}}}(t);l.onPlayError(ER.PLAY_ERR_PLAY_FAIL,{message:e.toString(),videoActive:(null===(r=null==i?void 0:i.video)||void 0===r?void 0:r.bytesReceived)>0,audioActive:(null===(n=null==i?void 0:i.audio)||void 0===n?void 0:n.bytesReceived)>0})}))}),1e3):l.onPlayError(ER.PLAY_ERR_PLAY_FAIL,{message:e.toString()})},d.label=1;case 1:return d.trys.push([1,3,,4]),[4,this.playerView.play()];case 2:return d.sent(),a=YR(),WR&&a.length>0&&13===a[0]?(this.playerView.pause(),c=function(){return ac(l,void 0,void 0,(function(){var e,t,r;return cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.playerView.play()];case 1:return n.sent(),dP.log("play ok ios"),null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,ER.PLAY_EVT_PLAY_BEGIN),this.startReport("start"),[3,3];case 2:return e=n.sent(),s(e),[3,3];case 3:return[2]}}))}))},Oa((function(){c()}),200)):(dP.log("play ok"),null===(i=(n=this.listener).onPlayEvent)||void 0===i||i.call(n,ER.PLAY_EVT_PLAY_BEGIN),this.startReport("start")),[3,4];case 3:return u=d.sent(),s(u),[3,4];case 4:return[2]}}))}))},e.prototype.onAddTrack=function(e){"video"===e.kind?(this.report.markTime("video_down"),this.report.measureTime("u32_first_frame_down","pull_start","video_down")):"audio"===e.kind&&(this.report.markTime("audio_down"),this.report.measureTime("u32_first_audio_frame_down","pull_start","audio_down")),this.stream?this.stream.addTrack(e):(this.stream=new MediaStream,this.stream.addTrack(e),this.onAddStream(this.stream)),dP.log("track length: "+this.stream.getTracks().length)},e.prototype.onSetLocalDescription=function(e){var t,r,n,i;return ac(this,void 0,void 0,(function(){var o,s,a,c,u,l,d,p,f,h=this;return cc(this,(function(v){var m;switch(v.label){case 0:return v.trys.push([0,5,,6]),o=yu(),s=bu.parse(window.navigator.userAgent),a=s.browser,c=s.os,u=(c.name||"other")+" "+c.version+";"+(a.name||"other")+" "+a.version,null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,ER.PLAY_EVT_REQUEST_PULL_BEGIN,{localSdp:e}),this.report.setData("str_session_id",o,!0),this.report.setData("bytes_token",o,!0),this.report.setData("str_ice_info",uP(e.sdp),!0),this.report.markTime("request_start"),l=null,Ga(m=this.playUrl).call(m,"webrtc")?[4,this.signal.fetchPullStream({streamurl:this.playUrl,sessionid:o,clientinfo:u,localsdp:e})]:[3,2];case 1:return l=v.sent(),[3,4];case 2:return[4,this.signal.fetchStreamSdp({streamurl:this.playUrl,sessionid:o,localsdp:e})];case 3:l=v.sent(),v.label=4;case 4:return this.report.markTime("request_end"),this.report.measureTime("u32_signal_time","request_start","request_end"),d=l.remoteSdp,p=l.svrSig,null===(i=(n=this.listener).onPlayEvent)||void 0===i||i.call(n,ER.PLAY_EVT_REQUEST_PULL_SUCCESS,{remoteSdp:d}),this.webrtcConnection.connect(d),this.svrSig=p,this.timer.disconnectTimeout&&window.clearTimeout(this.timer.disconnectTimeout),this.timer.disconnectTimeout=Oa((function(){dP.log("connect timeout, try reconnect"),h.webrtcConnection.disconnect({code:TR.NEED_RECONNECT,msg:"Connection disconnected, please try again"})}),5e3),[3,6];case 5:return f=v.sent(),dP.log(f.message),this.webrtcConnection.disconnect(),this.onPlayError(ER.PLAY_ERR_REQUEST_PULL_FAIL,{message:f.message}),[3,6];case 6:return[2]}}))}))},e.prototype.onConnect=function(e){var t,r,n=this;dP.log("TXLivePlayer onConnect",e),e.code===CR.SUCCESS&&(this.timer.disconnectTimeout&&(window.clearTimeout(this.timer.disconnectTimeout),this.timer.disconnectTimeout=null),this.startStat(),null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,ER.PLAY_EVT_SERVER_CONNECTED),this.abrClient.curBitrate&&this.svrSig&&(dP.log("abr control: reconnect "+this.abrClient.curBitrate),this.abrClient.seq=this.abrClient.seq+1,this.signal.fetchAbrControl({svrsig:this.svrSig,seq:this.abrClient.seq,bitrate_name:this.abrClient.curBitrate}).then((function(e){var t=e.seq;n.abrClient.seq=Math.max(n.abrClient.seq,t)})).catch((function(e){dP.log(e.message)}))))},e.prototype.onDisconnect=function(e){return ac(this,void 0,void 0,(function(){var t,r=this;return cc(this,(function(n){switch(n.label){case 0:if(this.lastStatsReport=null,this.streamReceiveFail.curNum=0,this.streamDecodeFail.curNum=0,this.streamPlaying.status=_R.INIT,this.timer.disconnectTimeout&&(window.clearTimeout(this.timer.disconnectTimeout),this.timer.disconnectTimeout=null),this.timer.statsInterval&&(window.clearInterval(this.timer.statsInterval),this.timer.statsInterval=null),dP.log("TXLivePlayer onDisconnect",e),e.code!==TR.NEED_RECONNECT)return[3,6];if(this.connectRetry.playing=this.isPlaying(),!this.playUrl||!this.svrSig)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.signal.fetchStopStream({streamurl:this.playUrl,svrsig:this.svrSig})];case 2:return n.sent(),[3,4];case 3:return t=n.sent(),dP.log(t.message||""),[3,4];case 4:this.svrSig=null,n.label=5;case 5:var i;if(this.stream)ma(i=this.stream.getTracks()).call(i,(function(e){e.stop()})),this.stream=null;this.isVideoExisted&&this.playerView&&(this.playerView.pause(),this.isVideoExisted=!1),this.timer.retryTimeout&&(window.clearTimeout(this.timer.retryTimeout),this.timer.retryTimeout=null),this.timer.retryTimeout=Oa((function(){var e,t;r.connectRetry.curNum+=1;var n=r.connectRetry,i=n.curNum,o=n.maxNum;i<=o?(dP.log("current retry num: "+i+", max retry num: "+o),null===(t=(e=r.listener).onPlayEvent)||void 0===t||t.call(e,ER.PLAY_EVT_SERVER_RECONNECT),r.startPlay(r.rawUrl)):(r.onPlayError(ER.PLAY_ERR_SERVER_DISCONNECT),r.connectRetry.curNum=0,r.connectRetry.playing=!1),r.timer.retryTimeout=null}),1e3*this.connectRetry.delay),n.label=6;case 6:return[2]}}))}))},e.prototype.onError=function(e){this.onPlayError(ER.PLAY_ERR_WEBRTC_FAIL,{message:e})},e.prototype.startStat=function(){return ac(this,void 0,void 0,(function(){var e,t,r=this;return cc(this,(function(n){switch(n.label){case 0:return this.report.markTime("server_connected"),this.report.measureTime("u32_connect_server_time","pull_start","server_connected"),this.timer.statsInterval&&(window.clearInterval(this.timer.statsInterval),this.timer.statsInterval=null),[4,this.getConnectionStats()];case 1:return(e=n.sent())&&(this.report.setTempData("start_stats",e),this.report.setTempData("last_stats",e),this.report.setTempData("last_time",(new Date).getTime()),this.onStats(e)),t=0,this.timer.statsInterval=za((function(){var e;null===(e=r.getConnectionStats())||void 0===e||e.then((function(e){e&&r.onStats(e),(t+=1)%5==0&&r.startReport("interval")}))}),1e3),[2]}}))}))},e.prototype.onStats=function(e){var t,r,n,i,o,s,a,c,u,l,d=function(e,t){var r,n,i;if(void 0===t&&(t=null),t){var o=null,s=null,a=null,c=null,u=null;ma(e).call(e,(function(e){"track"===e.type&&("video"===e.kind||e.frameWidth?o=e.id:("audio"===e.kind||e.audioLevel)&&(a=e.id)),"inbound-rtp"===e.type&&("video"===e.kind||"video"===e.mediaType?s=e.id:"audio"!==e.kind&&"audio"!==e.mediaType||(c=e.id)),"candidate-pair"===e.type&&e.selected?u=e.id:"transport"===e.type&&e.selectedCandidatePairId&&(u=e.selectedCandidatePairId)}));var l=e.get(o),d=e.get(s),p=t.get(o),f=t.get(s),h=0;void 0!==(null==d?void 0:d.timestamp)&&void 0!==(null==f?void 0:f.timestamp)&&(h=(d.timestamp-f.timestamp)/1e3);var v=void 0;if((null==d?void 0:d.codecId)&&(k=e.get(d.codecId))){var m=k.mimeType,y=k.payloadType,g=k.sdpFmtpLine;v=(null==m?void 0:m.replace("video/",""))||"",y&&g&&(v=v+" ("+y+", "+g+")")}var b=void 0;void 0!==(null==d?void 0:d.framesPerSecond)?b=d.framesPerSecond:void 0!==(null==d?void 0:d.framerateMean)?b=d.framerateMean:void 0!==(null==d?void 0:d.framesReceived)&&void 0!==(null==f?void 0:f.framesReceived)&&h?b=(d.framesReceived-f.framesReceived)/h:void 0!==(null==l?void 0:l.framesReceived)&&void 0!==(null==p?void 0:p.framesReceived)&&h&&(b=(l.framesReceived-p.framesReceived)/h);var C=void 0;void 0!==(null==d?void 0:d.framesDecoded)&&void 0!==(null==f?void 0:f.framesDecoded)&&h&&(C=(d.framesDecoded-f.framesDecoded)/h);var T=void 0;void 0!==(null==d?void 0:d.bytesReceived)&&void 0!==(null==f?void 0:f.bytesReceived)&&h&&(T=8*(d.bytesReceived-f.bytesReceived)/h);var S=void 0;void 0!==(null==l?void 0:l.jitterBufferDelay)&&void 0!==(null==l?void 0:l.jitterBufferEmittedCount)&&void 0!==(null==p?void 0:p.jitterBufferDelay)&&void 0!==(null==p?void 0:p.jitterBufferEmittedCount)&&(S=l.jitterBufferEmittedCount-p.jitterBufferEmittedCount?(l.jitterBufferDelay-p.jitterBufferDelay)/(l.jitterBufferEmittedCount-p.jitterBufferEmittedCount)*1e3:l.jitterBufferDelay/l.jitterBufferEmittedCount*1e3);var _=void 0;void 0!==(null==d?void 0:d.totalDecodeTime)&&void 0!==(null==l?void 0:l.framesDecoded)&&void 0!==(null==f?void 0:f.totalDecodeTime)&&void 0!==(null==p?void 0:p.framesDecoded)&&(_=l.framesDecoded-p.framesDecoded?(d.totalDecodeTime-f.totalDecodeTime)/(l.framesDecoded-p.framesDecoded)*1e3:d.totalDecodeTime/l.framesDecoded*1e3);var E=e.get(a),R=e.get(c),P=t.get(a),w=t.get(c);void 0!==(null==R?void 0:R.timestamp)&&void 0!==(null==w?void 0:w.timestamp)&&(h=(R.timestamp-w.timestamp)/1e3);var k,A=void 0;(null==R?void 0:R.codecId)&&(k=e.get(R.codecId))&&(m=k.mimeType,y=k.payloadType,g=k.sdpFmtpLine,A=(null==m?void 0:m.replace("audio/",""))||"",y&&g&&(A=A+" ("+y+", "+g+")"));var O=void 0;void 0!==(null==E?void 0:E.audioLevel)?O=null==E?void 0:E.audioLevel:void 0!==(null==R?void 0:R.audioLevel)&&(O=null==R?void 0:R.audioLevel);var D=void 0;void 0!==(null==R?void 0:R.bytesReceived)&&void 0!==(null==w?void 0:w.bytesReceived)&&h&&(D=8*(R.bytesReceived-w.bytesReceived)/h);var L=void 0;void 0!==(null==E?void 0:E.jitterBufferDelay)&&void 0!==(null==E?void 0:E.jitterBufferEmittedCount)&&void 0!==(null==P?void 0:P.jitterBufferDelay)&&void 0!==(null==P?void 0:P.jitterBufferEmittedCount)&&(L=E.jitterBufferEmittedCount-P.jitterBufferEmittedCount?(E.jitterBufferDelay-P.jitterBufferDelay)/(E.jitterBufferEmittedCount-P.jitterBufferEmittedCount)*1e3:E.jitterBufferDelay/E.jitterBufferEmittedCount*1e3);var M=e.get(u),I=void 0;void 0!==(null==M?void 0:M.currentRoundTripTime)&&(I=1e3*M.currentRoundTripTime);var x=void 0,N=void 0,F=void 0,U=void 0;void 0===(null==d?void 0:d.packetsLost)&&void 0===(null==R?void 0:R.packetsLost)||(x=((null==d?void 0:d.packetsLost)||0)+((null==R?void 0:R.packetsLost)||0)),void 0===(null==d?void 0:d.packetsReceived)&&void 0===(null==R?void 0:R.packetsReceived)||(N=((null==d?void 0:d.packetsReceived)||0)+((null==R?void 0:R.packetsReceived)||0)),void 0===(null==f?void 0:f.packetsLost)&&void 0===(null==w?void 0:w.packetsLost)||(F=((null==f?void 0:f.packetsLost)||0)+((null==w?void 0:w.packetsLost)||0)),void 0===(null==f?void 0:f.packetsReceived)&&void 0===(null==w?void 0:w.packetsReceived)||(U=((null==f?void 0:f.packetsReceived)||0)+((null==w?void 0:w.packetsReceived)||0));var V=void 0;if(void 0!==x&&void 0!==N&&void 0!==F&&void 0!==U){var j=x-F,B=N-U;V=j<=0||B<0?0:j/(j+B)*100}var W=eP.UNKNOWN;return void 0===I&&void 0===V||(V>50||I>500?W=eP.VERY_BAD:V>30||I>350?W=eP.BAD:V>20||I>200?W=eP.POOR:V>10||I>100?W=eP.GOOD:(V>=0||I>=0)&&(W=eP.EXCELLENT)),{timestamp:(null==d?void 0:d.timestamp)||(null==R?void 0:R.timestamp),video:{codec:v,bitrate:T&&Number(T.toFixed(2)),framesPerSecond:b&&Math.round(b),framesDecodedPerSecond:C&&Math.round(C),frameWidth:null!==(r=null==d?void 0:d.frameWidth)&&void 0!==r?r:null==l?void 0:l.frameWidth,frameHeight:null!==(n=null==d?void 0:d.frameHeight)&&void 0!==n?n:null==l?void 0:l.frameHeight,framesDecoded:null==d?void 0:d.framesDecoded,framesDropped:null==l?void 0:l.framesDropped,framesReceived:null!==(i=null==d?void 0:d.framesReceived)&&void 0!==i?i:null==l?void 0:l.framesReceived,packetsLost:null==d?void 0:d.packetsLost,packetsReceived:null==d?void 0:d.packetsReceived,nackCount:null==d?void 0:d.nackCount,firCount:null==d?void 0:d.firCount,pliCount:null==d?void 0:d.pliCount,jitterBufferDelay:S&&Number(S.toFixed(2)),frameDecodeAvgTime:_&&Number(_.toFixed(2))},audio:{codec:A,audioLevel:O,bitrate:D&&Number(D.toFixed(2)),packetsLost:null==R?void 0:R.packetsLost,packetsReceived:null==R?void 0:R.packetsReceived,jitterBufferDelay:L&&Number(L.toFixed(2))},network:{roundTripTime:I,quality:W}}}}(e,this.lastStatsReport);if(this.lastStatsReport=e,d){d.video.frameWidth=d.video.frameWidth||(null===(t=this.playerView)||void 0===t?void 0:t.videoWidth)||void 0,d.video.frameHeight=d.video.frameHeight||(null===(r=this.playerView)||void 0===r?void 0:r.videoHeight)||void 0;var p={};if(this.p2pConnection){var f=this.p2pConnection.getSDKStats(),h=f.uploadBytesTotal,v=f.uploadAuidoBytesTotal,m=f.uploadVideoBytesTotal,y=f.cdnDownloadBytesTotal,g=f.cdnDownloadAuidoBytesTotal,b=f.cdnDownloadVideoBytesTotal,C=f.p2pDownloadBytesTotal,T=f.p2pDownloadAuidoBytesTotal,S=f.p2pDownloadVideoBytesTotal;p.p2p={uploadBytes:h,uploadAuidoBytes:v,uploadVideoBytes:m,cdnDownloadBytes:y,cdnDownloadAuidoBytes:g,cdnDownloadVideoBytes:b,p2pDownloadBytes:C,p2pDownloadAuidoBytes:T,p2pDownloadVideoBytes:S}}null===(i=(n=this.listener).onPlayStats)||void 0===i||i.call(n,oc(oc({},d),p))}if((null==d?void 0:d.video)&&this.offerToReceive.video){var _=d.video,E=_.bitrate,R=_.framesPerSecond,P=_.framesDecoded,w=_.framesDecodedPerSecond;if(E&&R&&(this.connectRetry.curNum=0),!this.isVideoExisted)return;if(E&&R?this.streamReceiveFail.curNum=0:(this.streamReceiveFail.curNum+=1,this.streamReceiveFail.curNum>=this.streamReceiveFail.maxNum&&(null===(s=(o=this.listener).onPlayEvent)||void 0===s||s.call(o,ER.PLAY_EVT_STREAM_EMPTY),this.streamReceiveFail.curNum=0)),E&&R&&!P?(this.streamDecodeFail.curNum+=1,this.streamDecodeFail.curNum===this.streamDecodeFail.maxNum&&this.onPlayError(ER.PLAY_ERR_DECODE_FAIL,{message:"decode failed",bitrate:E,framesPerSecond:R})):this.streamDecodeFail.curNum=0,w>=0||R>=0)if(w<=this.streamPlaying.threshold||R<=this.streamPlaying.threshold){var k=this.report.getTempData("freeze_interval_count")||0;this.report.setTempData("freeze_interval_count",k+1),this.streamPlaying.status!==_R.WAITING&&(this.streamPlaying.status=_R.WAITING,this.report.setTempData("freeze_start_time",(new Date).getTime()),null===(c=(a=this.listener).onPlayEvent)||void 0===c||c.call(a,ER.PLAY_EVT_PLAY_WAITING_BEGIN))}else{if(this.streamPlaying.status===_R.WAITING){var A=this.report.getTempData("freeze_start_time"),O=(new Date).getTime(),D=O-A,L=this.report.getTempData("video_freeze")||{},M=L.count,I=void 0===M?0:M,x=L.totalTime,N=void 0===x?0:x,F=L.maxTime,U=void 0===F?0:F,V=L.endTimes,j=void 0===V?[]:V;I+=1,N+=D,U=Math.max(D,U),j=dc(dc([],lc(j)),[O]),this.report.setTempData("video_freeze",{count:I,totalTime:N,maxTime:U,endTimes:j}),null===(l=(u=this.listener).onPlayEvent)||void 0===l||l.call(u,ER.PLAY_EVT_PLAY_WAITING_STOP)}this.streamPlaying.status=_R.PLAYING}}},e.prototype.startReport=function(e,t){var r,n;return void 0===t&&(t=""),ac(this,void 0,void 0,(function(){var i,o,s,a,c,u,l,d,p,f,h,v,m,y,g,b,C,T,S,_,E,R,P,w,k,A,O,D,L,M,I,x,N,F;return cc(this,(function(U){switch(U.label){case 0:return i=(new Date).getTime(),o=this.report.getTempData("pull_start_time"),"stop"===e?(s=this.report.getTempData("u32_first_i_frame")||0,this.report.setData("u64_timestamp",i),this.report.setData("u64_begin_timestamp",o),this.report.setData("u32_result",Math.round((i-o)/1e3)),this.report.setData("u32_first_i_frame",s),this.report.setData("u32_first_frame_black",s>1e4?1:0),a=this.report.getTempData("video_freeze")||{},c=a.count,m=void 0===c?0:c,u=a.totalTime,l=void 0===u?0:u,d=a.maxTime,p=void 0===d?0:d,this.report.setData("u64_block_count",m),this.report.setData("u32_video_block_time",l),this.report.setData("u64_block_duration_max",p),this.report.setData("u32_avg_block_time",l&&m?Math.round(l/m):0),this.report.setData("u32_delay_report",t?1:0)):"interval"===e&&(this.report.setData("u64_timestamp",i),this.report.setData("u64_playtime",i-o),f=(this.report.getTempData("video_freeze")||{}).endTimes,h=void 0===f?[]:f,v=this.report.getTempData("last_time")||0,m=rc(h).call(h,(function(e){return e>=v&&e<i})).length,this.report.setData("u32_video_block_count",m),this.report.setTempData("last_time",i),y=this.report.getTempData("freeze_interval_count")||0,this.report.setData("u32_block_usage",y/5*1e3),this.report.setTempData("freeze_interval_count",0)),g=null,"stop"!==e||"pagehide"!==t?[3,1]:(g=this.report.getTempData("last_stats"),[3,3]);case 1:return[4,this.getConnectionStats()];case 2:g=U.sent(),U.label=3;case 3:return g&&(b=function(e){var t=null;ma(e).call(e,(function(r){var n;"candidate-pair"===r.type&&r.selected?t=r.remoteCandidateId:"transport"===r.type&&r.selectedCandidatePairId&&(t=null===(n=e.get(r.selectedCandidatePairId))||void 0===n?void 0:n.remoteCandidateId)}));var r=e.get(t)||{},n=r.address,i=void 0===n?"":n,o=r.port;return{address:i,port:void 0===o?"":o}}(g),C=b.address,T=b.port,this.report.setData("u32_server_ip",C+(T?":":"")+T),"stop"===e?(S=this.report.getTempData("start_stats"),_=function(e,t){var r=null,n=null,i=null;ma(e).call(e,(function(e){"track"!==e.type||"video"!==e.kind&&!e.frameWidth||(r=e.id),"inbound-rtp"===e.type&&("video"===e.kind||"video"===e.mediaType?n=e.id:"audio"!==e.kind&&"audio"!==e.mediaType||(i=e.id))}));var o=e.get(r),s=e.get(n),a=e.get(i),c=null==t?void 0:t.get(n),u=0;void 0!==(null==s?void 0:s.timestamp)&&void 0!==(null==c?void 0:c.timestamp)&&(u=(s.timestamp-c.timestamp)/1e3);var l=0;void 0!==(null==s?void 0:s.packetsLost)&&void 0!==(null==s?void 0:s.packetsReceived)&&(l=s.packetsLost/(s.packetsLost+s.packetsReceived)*1e3);var d=0;void 0!==(null==a?void 0:a.packetsLost)&&void 0!==(null==a?void 0:a.packetsReceived)&&(d=a.packetsLost/(a.packetsLost+a.packetsReceived)*1e3);var p=0;return void 0!==(null==s?void 0:s.framesDecoded)&&void 0!==(null==c?void 0:c.framesDecoded)&&u&&(p=Math.round((s.framesDecoded-c.framesDecoded)/u)),{width:(null==o?void 0:o.frameWidth)||0,height:(null==o?void 0:o.frameHeight)||0,videoFractionLost:Number(l.toFixed(2)),audioFractionLost:Number(d.toFixed(2)),framerateMean:p}}(g,S),E=_.width,R=_.height,N=_.videoFractionLost,D=_.audioFractionLost,P=_.framerateMean,this.report.setData("u32_video_width",E||(null===(r=this.playerView)||void 0===r?void 0:r.videoWidth)),this.report.setData("u32_video_height",R||(null===(n=this.playerView)||void 0===n?void 0:n.videoHeight)),this.report.setData("u32_video_drop_usage",N),this.report.setData("u32_audio_drop_usage",D),this.report.setData("u32_video_avg_fps",P)):"interval"===e&&(w=this.report.getTempData("last_stats"),k=function(e,t){var r=null,n=null,i=null,o=null;ma(e).call(e,(function(e){"track"===e.type&&("video"===e.kind||e.frameWidth)&&(r=e.id),"inbound-rtp"===e.type&&("video"===e.kind||"video"===e.mediaType?n=e.id:"audio"!==e.kind&&"audio"!==e.mediaType||(i=e.id)),"candidate-pair"===e.type&&e.selected?o=e.id:"transport"===e.type&&e.selectedCandidatePairId&&(o=e.selectedCandidatePairId)}));var s=e.get(r),a=e.get(n),c=null==t?void 0:t.get(r),u=null==t?void 0:t.get(n),l=0;void 0!==(null==a?void 0:a.timestamp)&&void 0!==(null==u?void 0:u.timestamp)&&(l=(a.timestamp-u.timestamp)/1e3);var d=0;void 0!==(null==a?void 0:a.packetsLost)&&void 0!==(null==u?void 0:u.packetsLost)&&(d=a.packetsLost-u.packetsLost);var p=0;void 0!==(null==s?void 0:s.framesReceived)&&void 0!==(null==c?void 0:c.framesReceived)&&l?p=(s.framesReceived-c.framesReceived)/l:void 0!==(null==a?void 0:a.framerateMean)&&void 0!==(null==u?void 0:u.framerateMean)&&(p=(a.framerateMean+u.framerateMean)/2);var f=0;void 0!==(null==a?void 0:a.framesDecoded)&&void 0!==(null==u?void 0:u.framesDecoded)&&l&&(f=(a.framesDecoded-u.framesDecoded)/l);var h=0;void 0!==(null==a?void 0:a.bytesReceived)&&void 0!==(null==u?void 0:u.bytesReceived)&&l&&(h=8*(a.bytesReceived-u.bytesReceived)/l/1024);var v=0;void 0!==(null==a?void 0:a.packetsLost)&&void 0!==(null==a?void 0:a.packetsReceived)&&void 0!==(null==u?void 0:u.packetsLost)&&void 0!==(null==u?void 0:u.packetsReceived)&&(v=(C=a.packetsLost-u.packetsLost)/(C+(a.packetsReceived-u.packetsReceived))*1e3);var m=e.get(i),y=null==t?void 0:t.get(i);void 0!==(null==m?void 0:m.timestamp)&&void 0!==(null==y?void 0:y.timestamp)&&(l=(m.timestamp-y.timestamp)/1e3);var g=0;void 0!==(null==m?void 0:m.packetsLost)&&void 0!==(null==y?void 0:y.packetsLost)&&(g=m.packetsLost-y.packetsLost);var b=0;void 0!==(null==m?void 0:m.bytesReceived)&&void 0!==(null==y?void 0:y.bytesReceived)&&l&&(b=8*(m.bytesReceived-y.bytesReceived)/l/1024);var C,T=0;void 0!==(null==m?void 0:m.packetsLost)&&void 0!==(null==m?void 0:m.packetsReceived)&&void 0!==(null==y?void 0:y.packetsLost)&&void 0!==(null==y?void 0:y.packetsReceived)&&(T=(C=m.packetsLost-y.packetsLost)/(C+(m.packetsReceived-y.packetsReceived))*1e3);var S=e.get(o),_=null==t?void 0:t.get(o),E=0;return void 0!==(null==S?void 0:S.totalRoundTripTime)&&void 0!==(null==S?void 0:S.responsesReceived)&&void 0!==(null==_?void 0:_.totalRoundTripTime)&&void 0!==(null==_?void 0:_.responsesReceived)&&(E=(S.totalRoundTripTime-_.totalRoundTripTime)/(S.responsesReceived-_.responsesReceived)*1e3),{videoPacketsLost:Math.max(d,0),videoReceiveFps:Math.round(p),videoDecodeFps:Math.round(f),videoBitrate:Number(h.toFixed(2)),videoFractionLost:Math.max(Number(v.toFixed(2)),0),audioPacketsLost:Math.max(g,0),audioBitrate:Number(b.toFixed(2)),audioFractionLost:Math.max(Number(T.toFixed(2)),0),roundTripTime:Math.round(E)}}(g,w),A=k.audioPacketsLost,O=k.audioBitrate,D=k.audioFractionLost,L=k.videoReceiveFps,M=k.videoDecodeFps,I=k.videoBitrate,x=k.videoPacketsLost,N=k.videoFractionLost,F=k.roundTripTime,this.report.setData("u32_audio_drop",A),this.report.setData("u32_audio_drop_usage",D),this.report.setData("u32_avg_audio_bitrate",O),this.report.setData("u32_video_drop",x),this.report.setData("u32_video_drop_usage",N),this.report.setData("u32_video_recv_fps",L),this.report.setData("u32_fps",M),this.report.setData("u32_avg_video_bitrate",I),this.report.setData("u32_avg_net_speed",Number((I+O).toFixed(2))),this.report.setData("u64_rtt",F),this.report.setTempData("last_stats",g))),this.report.startReport(e),[2]}}))}))},e.prototype.onPlayError=function(e,t){var r,n;return ac(this,void 0,void 0,(function(){var i;return cc(this,(function(o){return i=(t||{}).message,null===(n=(r=this.listener).onPlayEvent)||void 0===n||n.call(r,e,t),this.report.setData("u64_err_code",e),this.report.setData("str_err_info",i||""),e===ER.PLAY_ERR_SERVER_DISCONNECT?this.startReport("stop"):this.startReport("start"),[2]}))}))},e.prototype.onBeforeUnload=function(){window.removeEventListener("pagehide",this.onPagehide),this.isVideoExisted&&(this.webrtcConnection||this.p2pConnection)&&this.report&&this.startReport("stop","beforeunload")},e.prototype.onPagehide=function(){this.isVideoExisted&&(this.webrtcConnection||this.p2pConnection)&&this.report&&this.startReport("stop","pagehide")},e.prototype.getConnectionStats=function(){return this.p2pConnection?this.p2pConnection.getStats():this.webrtcConnection?this.webrtcConnection.getStats():void 0},e.prototype.onP2PEvent=function(e){var t,r,n,i,o,s,a,c,u,l,d,p=e.code,f=e.msg,h=e.data;switch(dP.log("P2P Event, code: "+p+", msg: "+f+", data:",h),p){case RR.EventCode.INF_PLAY_EVT_STREAM_FIRST_AUDIO_FRAME:this.report.markTime("audio_down"),this.report.measureTime("u32_first_audio_frame_down","pull_start","audio_down");break;case RR.EventCode.INF_PLAY_EVT_STREAM_FIRST_VIDEO_FRAME:this.report.markTime("video_down"),this.report.measureTime("u32_first_frame_down","pull_start","video_down");break;case RR.EventCode.INF_PLAY_EVT_REQUEST_PULL_BEGIN:var v={type:"offer",sdp:h.localsdp},m=h.sessionid;null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,ER.PLAY_EVT_REQUEST_PULL_BEGIN,{localSdp:v}),this.report.setData("str_session_id",m,!0),this.report.setData("bytes_token",m,!0),this.report.setData("str_ice_info",uP(v.sdp),!0),this.report.markTime("request_start");break;case RR.EventCode.INF_PLAY_EVT_REQUEST_PULL_SUCCESS:var y={type:"answer",sdp:h.remotesdp};null===(i=(n=this.listener).onPlayEvent)||void 0===i||i.call(n,ER.PLAY_EVT_REQUEST_PULL_SUCCESS,{remoteSdp:y}),this.report.markTime("request_end"),this.report.measureTime("u32_signal_time","request_start","request_end");break;case RR.EventCode.ERR_PLAY_REQUEST_PULL_FAIL:this.onPlayError(ER.PLAY_ERR_REQUEST_PULL_FAIL,{message:f});break;case RR.EventCode.ERR_FETCH_REQUEST_FAIL:"PULL_STREAM"===h.from&&this.onPlayError(ER.PLAY_ERR_REQUEST_PULL_FAIL,{message:f});break;case RR.EventCode.INF_PLAY_EVT_SERVER_CONNECTED:this.startStat(),null===(s=(o=this.listener).onPlayEvent)||void 0===s||s.call(o,ER.PLAY_EVT_SERVER_CONNECTED);break;case RR.EventCode.INF_PLAY_EVT_SERVER_RECONNECT:this.connectRetry.playing=this.isPlaying(),null===(c=(a=this.listener).onPlayEvent)||void 0===c||c.call(a,ER.PLAY_EVT_SERVER_RECONNECT);break;case RR.EventCode.ERR_LOAD_REACH_MAX_RETRY:this.onPlayError(ER.PLAY_ERR_SERVER_DISCONNECT);break;case RR.EventCode.ERR_PLAY_WEBRTC_FAIL:this.onPlayError(ER.PLAY_ERR_WEBRTC_FAIL,{message:f});break;case RR.EventCode.INF_PLAY_EVT_STREAM_SWITCH:var g=null===(u=h.source)||void 0===u?void 0:u.toLowerCase();this.p2pMode.source=g,null===(d=(l=this.listener).onPlayEvent)||void 0===d||d.call(l,ER.PLAY_EVT_P2P_SOURCE_SWITCH,{source:g})}if(p>1e3&&p<2e3){var b;if(this.lastStatsReport=null,this.timer.statsInterval&&(window.clearInterval(this.timer.statsInterval),this.timer.statsInterval=null),this.stream)ma(b=this.stream.getTracks()).call(b,(function(e){e.stop()})),this.stream=null;this.isVideoExisted&&this.playerView&&(this.playerView.pause(),this.isVideoExisted=!1),this.p2pConnection.destroy(),this.p2pConnection=null}},e.version=PR,e}();return RP}));
|