!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,a=Function.prototype,s=a.call,c=o&&a.bind.bind(s,s),u=o?c:function(e){return function(){return s.apply(e,arguments)}},l=u({}.isPrototypeOf),d=function(e){return e&&e.Math===Math&&e},p=d("object"==typeof globalThis&&globalThis)||d("object"==typeof window&&window)||d("object"==typeof self&&self)||d("object"==typeof t&&t)||d("object"==typeof t&&t)||function(){return this}()||Function("return this")(),f=i,h=Function.prototype,m=h.apply,v=h.call,y="object"==typeof Reflect&&Reflect.apply||(f?v.bind(m):function(){return v.apply(m,arguments)}),g=u,b=g({}.toString),C=g("".slice),S=function(e){return C(b(e),8,-1)},_=S,T=u,w=function(e){if("Function"===_(e))return T(e)},R="object"==typeof document&&document.all,E=void 0===R&&void 0!==R?function(e){return"function"==typeof e||e===R}:function(e){return"function"==typeof e},P={},k=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),A=i,L=Function.prototype.call,x=A?L.bind(L):function(){return L.apply(L,arguments)},I={},D={}.propertyIsEnumerable,O=Object.getOwnPropertyDescriptor,N=O&&!D.call({1:2},1);I.f=N?function(e){var t=O(this,e);return!!t&&t.enumerable}:D;var M,V,U=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},F=n,j=S,B=Object,W=u("".split),G=F((function(){return!B("z").propertyIsEnumerable(0)}))?function(e){return"String"===j(e)?W(e,""):B(e)}:B,Z=function(e){return null==e},Y=Z,H=TypeError,X=function(e){if(Y(e))throw new H("Can't call method on "+e);return e},K=G,J=X,Q=function(e){return K(J(e))},z=E,q=function(e){return"object"==typeof e?null!==e:z(e)},$={},ee=$,te=p,re=E,ne=function(e){return re(e)?e:void 0},ie=function(e,t){return arguments.length<2?ne(ee[e])||ne(te[e]):ee[e]&&ee[e][t]||te[e]&&te[e][t]},oe="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ae=p,se=oe,ce=ae.process,ue=ae.Deno,le=ce&&ce.versions||ue&&ue.version,de=le&&le.v8;de&&(V=(M=de.split("."))[0]>0&&M[0]<4?1:+(M[0]+M[1])),!V&&se&&(!(M=se.match(/Edge\/(\d+)/))||M[1]>=74)&&(M=se.match(/Chrome\/(\d+)/))&&(V=+M[1]);var pe=V,fe=pe,he=n,me=p.String,ve=!!Object.getOwnPropertySymbols&&!he((function(){var e=Symbol("symbol detection");return!me(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&fe&&fe<41})),ye=ve&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ge=ie,be=E,Ce=l,Se=Object,_e=ye?function(e){return"symbol"==typeof e}:function(e){var t=ge("Symbol");return be(t)&&Ce(t.prototype,Se(e))},Te=String,we=function(e){try{return Te(e)}catch(e){return"Object"}},Re=E,Ee=we,Pe=TypeError,ke=function(e){if(Re(e))return e;throw new Pe(Ee(e)+" is not a function")},Ae=ke,Le=Z,xe=function(e,t){var r=e[t];return Le(r)?void 0:Ae(r)},Ie=x,De=E,Oe=q,Ne=TypeError,Me={exports:{}},Ve=!0,Ue=p,Fe=Object.defineProperty,je=p,Be=function(e,t){try{Fe(Ue,e,{value:t,configurable:!0,writable:!0})}catch(r){Ue[e]=t}return t},We="__core-js_shared__",Ge=Me.exports=je[We]||Be(We,{});(Ge.versions||(Ge.versions=[])).push({version:"3.37.1",mode:"pure",copyright:"漏 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ze=Me.exports,Ye=function(e,t){return Ze[e]||(Ze[e]=t||{})},He=X,Xe=Object,Ke=function(e){return Xe(He(e))},Je=Ke,Qe=u({}.hasOwnProperty),ze=Object.hasOwn||function(e,t){return Qe(Je(e),t)},qe=u,$e=0,et=Math.random(),tt=qe(1..toString),rt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+tt(++$e+et,36)},nt=Ye,it=ze,ot=rt,at=ve,st=ye,ct=p.Symbol,ut=nt("wks"),lt=st?ct.for||ct:ct&&ct.withoutSetter||ot,dt=function(e){return it(ut,e)||(ut[e]=at&&it(ct,e)?ct[e]:lt("Symbol."+e)),ut[e]},pt=x,ft=q,ht=_e,mt=xe,vt=function(e,t){var r,n;if("string"===t&&De(r=e.toString)&&!Oe(n=Ie(r,e)))return n;if(De(r=e.valueOf)&&!Oe(n=Ie(r,e)))return n;if("string"!==t&&De(r=e.toString)&&!Oe(n=Ie(r,e)))return n;throw new Ne("Can't convert object to primitive value")},yt=TypeError,gt=dt("toPrimitive"),bt=function(e,t){if(!ft(e)||ht(e))return e;var r,n=mt(e,gt);if(n){if(void 0===t&&(t="default"),r=pt(n,e,t),!ft(r)||ht(r))return r;throw new yt("Can't convert object to primitive value")}return void 0===t&&(t="number"),vt(e,t)},Ct=bt,St=_e,_t=function(e){var t=Ct(e,"string");return St(t)?t:t+""},Tt=q,wt=p.document,Rt=Tt(wt)&&Tt(wt.createElement),Et=function(e){return Rt?wt.createElement(e):{}},Pt=Et,kt=!k&&!n((function(){return 7!==Object.defineProperty(Pt("div"),"a",{get:function(){return 7}}).a})),At=k,Lt=x,xt=I,It=U,Dt=Q,Ot=_t,Nt=ze,Mt=kt,Vt=Object.getOwnPropertyDescriptor;P.f=At?Vt:function(e,t){if(e=Dt(e),t=Ot(t),Mt)try{return Vt(e,t)}catch(e){}if(Nt(e,t))return It(!Lt(xt.f,e,t),e[t])};var Ut=n,Ft=E,jt=/#|\.prototype\./,Bt=function(e,t){var r=Gt[Wt(e)];return r===Yt||r!==Zt&&(Ft(t)?Ut(t):!!t)},Wt=Bt.normalize=function(e){return String(e).replace(jt,".").toLowerCase()},Gt=Bt.data={},Zt=Bt.NATIVE="N",Yt=Bt.POLYFILL="P",Ht=Bt,Xt=ke,Kt=i,Jt=w(w.bind),Qt=function(e,t){return Xt(e),void 0===t?e:Kt?Jt(e,t):function(){return e.apply(t,arguments)}},zt={},qt=k&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),$t=q,er=String,tr=TypeError,rr=function(e){if($t(e))return e;throw new tr(er(e)+" is not an object")},nr=k,ir=kt,or=qt,ar=rr,sr=_t,cr=TypeError,ur=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,dr="enumerable",pr="configurable",fr="writable";zt.f=nr?or?function(e,t,r){if(ar(e),t=sr(t),ar(r),"function"==typeof e&&"prototype"===t&&"value"in r&&fr in r&&!r[fr]){var n=lr(e,t);n&&n[fr]&&(e[t]=r.value,r={configurable:pr in r?r[pr]:n[pr],enumerable:dr in r?r[dr]:n[dr],writable:!1})}return ur(e,t,r)}:ur:function(e,t,r){if(ar(e),t=sr(t),ar(r),ir)try{return ur(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new cr("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var hr=zt,mr=U,vr=k?function(e,t,r){return hr.f(e,t,mr(1,r))}:function(e,t,r){return e[t]=r,e},yr=p,gr=y,br=w,Cr=E,Sr=P.f,_r=Ht,Tr=$,wr=Qt,Rr=vr,Er=ze,Pr=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 gr(e,this,arguments)};return t.prototype=e.prototype,t},kr=function(e,t){var r,n,i,o,a,s,c,u,l,d=e.target,p=e.global,f=e.stat,h=e.proto,m=p?yr:f?yr[d]:yr[d]&&yr[d].prototype,v=p?Tr:Tr[d]||Rr(Tr,d,{})[d],y=v.prototype;for(o in t)n=!(r=_r(p?o:d+(f?".":"#")+o,e.forced))&&m&&Er(m,o),s=v[o],n&&(c=e.dontCallGetSet?(l=Sr(m,o))&&l.value:m[o]),a=n&&c?c:t[o],(r||h||typeof s!=typeof a)&&(u=e.bind&&n?wr(a,yr):e.wrap&&n?Pr(a):h&&Cr(a)?br(a):a,(e.sham||a&&a.sham||s&&s.sham)&&Rr(u,"sham",!0),Rr(v,o,u),h&&(Er(Tr,i=d+"Prototype")||Rr(Tr,i,{}),Rr(Tr[i],o,a),e.real&&y&&(r||!y[o])&&Rr(y,o,a)))},Ar=u([].slice),Lr=u,xr=ke,Ir=q,Dr=ze,Or=Ar,Nr=i,Mr=Function,Vr=Lr([].concat),Ur=Lr([].join),Fr={},jr=Nr?Mr.bind:function(e){var t=xr(this),r=t.prototype,n=Or(arguments,1),i=function(){var r=Vr(n,Or(arguments));return this instanceof i?function(e,t,r){if(!Dr(Fr,t)){for(var n=[],i=0;i0?$r:qr)(t)},tn=function(e){var t=+e;return t!=t||0===t?0:en(t)},rn=tn,nn=Math.min,on=function(e){var t=rn(e);return t>0?nn(t,9007199254740991):0},an=on,sn=function(e){return an(e.length)},cn=TypeError,un=function(e){if(e>9007199254740991)throw cn("Maximum allowed index exceeded");return e},ln=k,dn=zt,pn=U,fn=function(e,t,r){ln?dn.f(e,t,pn(0,r)):e[t]=r},hn={};hn[dt("toStringTag")]="z";var mn="[object z]"===String(hn),vn=mn,yn=E,gn=S,bn=dt("toStringTag"),Cn=Object,Sn="Arguments"===gn(function(){return arguments}()),_n=vn?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:Sn?gn(t):"Object"===(n=gn(t))&&yn(t.callee)?"Arguments":n},Tn=u,wn=E,Rn=Me.exports,En=Tn(Function.toString);wn(Rn.inspectSource)||(Rn.inspectSource=function(e){return En(e)});var Pn=Rn.inspectSource,kn=u,An=n,Ln=E,xn=_n,In=Pn,Dn=function(){},On=ie("Reflect","construct"),Nn=/^\s*(?:class|function)\b/,Mn=kn(Nn.exec),Vn=!Nn.test(Dn),Un=function(e){if(!Ln(e))return!1;try{return On(Dn,[],e),!0}catch(e){return!1}},Fn=function(e){if(!Ln(e))return!1;switch(xn(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Vn||!!Mn(Nn,In(e))}catch(e){return!0}};Fn.sham=!0;var jn=!On||An((function(){var e;return Un(Un.call)||!Un(Object)||!Un((function(){e=!0}))||e}))?Fn:Un,Bn=zr,Wn=jn,Gn=q,Zn=dt("species"),Yn=Array,Hn=function(e){var t;return Bn(e)&&(t=e.constructor,(Wn(t)&&(t===Yn||Bn(t.prototype))||Gn(t)&&null===(t=t[Zn]))&&(t=void 0)),void 0===t?Yn:t},Xn=function(e,t){return new(Hn(e))(0===t?0:t)},Kn=n,Jn=pe,Qn=dt("species"),zn=function(e){return Jn>=51||!Kn((function(){var t=[];return(t.constructor={})[Qn]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},qn=kr,$n=n,ei=zr,ti=q,ri=Ke,ni=sn,ii=un,oi=fn,ai=Xn,si=zn,ci=pe,ui=dt("isConcatSpreadable"),li=ci>=51||!$n((function(){var e=[];return e[ui]=!1,e.concat()[0]!==e})),di=function(e){if(!ti(e))return!1;var t=e[ui];return void 0!==t?!!t:ei(e)};qn({target:"Array",proto:!0,arity:1,forced:!li||!si("concat")},{concat:function(e){var t,r,n,i,o,a=ri(this),s=ai(a,0),c=0;for(t=-1,n=arguments.length;ts;)if((a=i[s++])!=a)return!0}else for(;o>s;s++)if((e||s in i)&&i[s]===r)return e||s||0;return!e&&-1}},Ri={includes:wi(!0),indexOf:wi(!1)},Ei=Ri.includes;kr({target:"Array",proto:!0,forced:n((function(){return!Array(1).includes()}))},{includes:function(e){return Ei(this,e,arguments.length>1?arguments[1]:void 0)}});var Pi=Zr("Array","includes"),ki=q,Ai=S,Li=dt("match"),xi=function(e){var t;return ki(e)&&(void 0!==(t=e[Li])?!!t:"RegExp"===Ai(e))},Ii=TypeError,Di=function(e){if(xi(e))throw new Ii("The method doesn't accept regular expressions");return e},Oi=_n,Ni=String,Mi=function(e){if("Symbol"===Oi(e))throw new TypeError("Cannot convert a Symbol value to a string");return Ni(e)},Vi=dt("match"),Ui=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[Vi]=!1,"/./"[e](t)}catch(e){}}return!1},Fi=kr,ji=Di,Bi=X,Wi=Mi,Gi=Ui,Zi=u("".indexOf);Fi({target:"String",proto:!0,forced:!Gi("includes")},{includes:function(e){return!!~Zi(Wi(Bi(this)),Wi(ji(e)),arguments.length>1?arguments[1]:void 0)}});var Yi=Zr("String","includes"),Hi=l,Xi=Pi,Ki=Yi,Ji=Array.prototype,Qi=String.prototype,zi=function(e){var t=e.includes;return e===Ji||Hi(Ji,e)&&t===Ji.includes?Xi:"string"==typeof e||e===Qi||Hi(Qi,e)&&t===Qi.includes?Ki:t},qi=Qt,$i=G,eo=Ke,to=sn,ro=Xn,no=u([].push),io=function(e){var t=1===e,r=2===e,n=3===e,i=4===e,o=6===e,a=7===e,s=5===e||o;return function(c,u,l,d){for(var p,f,h=eo(c),m=$i(h),v=to(m),y=qi(u,l),g=0,b=d||ro,C=t?b(c,v):r||a?b(c,0):void 0;v>g;g++)if((s||g in m)&&(f=y(p=m[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:no(C,p)}else switch(e){case 4:return!1;case 7:no(C,p)}return o?-1:n||i?i:C}},oo={forEach:io(0),map:io(1),filter:io(2),some:io(3),every:io(4),find:io(5),findIndex:io(6),filterReject:io(7)},ao=n,so=function(e,t){var r=[][e];return!!r&&ao((function(){r.call(null,t||function(){return 1},1)}))},co=oo.forEach,uo=so("forEach")?[].forEach:function(e){return co(this,e,arguments.length>1?arguments[1]:void 0)};kr({target:"Array",proto:!0,forced:[].forEach!==uo},{forEach:uo});var lo=Zr("Array","forEach"),po=_n,fo=ze,ho=l,mo=lo,vo=Array.prototype,yo={DOMTokenList:!0,NodeList:!0},go=function(e){var t=e.forEach;return e===vo||ho(vo,e)&&t===vo.forEach||fo(yo,po(e))?mo:t},bo="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,Co=TypeError,So=function(e,t){if(er,a=wo(n)?n:Ao(n),s=o?Po(arguments,r):[],c=o?function(){To(a,this,s)}:a;return t?e(c,i):e(c)}:e},Io=kr,Do=p,Oo=xo(Do.setInterval,!0);Io({global:!0,bind:!0,forced:Do.setInterval!==Oo},{setInterval:Oo});var No=kr,Mo=p,Vo=xo(Mo.setTimeout,!0);No({global:!0,bind:!0,forced:Mo.setTimeout!==Vo},{setTimeout:Vo});var Uo=$.setInterval,Fo=$.setTimeout,jo=kr,Bo=Ri.indexOf,Wo=so,Go=w([].indexOf),Zo=!!Go&&1/Go([1],1,-0)<0;jo({target:"Array",proto:!0,forced:Zo||!Wo("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return Zo?Go(this,e,t)||0:Bo(this,e,t)}});var Yo=Zr("Array","indexOf"),Ho=l,Xo=Yo,Ko=Array.prototype,Jo=function(e){var t=e.indexOf;return e===Ko||Ho(Ko,e)&&t===Ko.indexOf?Xo:t},Qo=kr,zo=on,qo=Mi,$o=Di,ea=X,ta=Ui,ra=w("".slice),na=Math.min;Qo({target:"String",proto:!0,forced:!ta("startsWith")},{startsWith:function(e){var t=qo(ea(this));$o(e);var r=zo(na(arguments.length>1?arguments[1]:void 0,t.length)),n=qo(e);return ra(t,r,r+n.length)===n}});var ia=Zr("String","startsWith"),oa=l,aa=ia,sa=String.prototype,ca=function(e){var t=e.startsWith;return"string"==typeof e||e===sa||oa(sa,e)&&t===sa.startsWith?aa:t},ua=oo.filter;kr({target:"Array",proto:!0,forced:!zn("filter")},{filter:function(e){return ua(this,e,arguments.length>1?arguments[1]:void 0)}});var la=Zr("Array","filter"),da=l,pa=la,fa=Array.prototype,ha=function(e){var t=e.filter;return e===fa||da(fa,e)&&t===fa.filter?pa:t},ma=function(e,t){return ma=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])},ma(e,t)};function va(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}ma(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var ya=function(){return ya=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=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 _a(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.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 a}function Ta(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i=r&&parseInt(n[r],10)}function Pa(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 ka(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(wa=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Aa(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Ra=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function La(){if("object"==typeof window){if(wa)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function xa(e,t){Ra&&console.warn(e+" is deprecated, please use "+t+" instead.")}function Ia(e){return"[object Object]"===Object.prototype.toString.call(e)}function Da(e){return Ia(e)?Object.keys(e).reduce((function(t,r){const n=Ia(e[r]),i=n?Da(e[r]):e[r],o=n&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[r]:i})}),{}):e}function Oa(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((n=>{n.endsWith("Id")?Oa(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((t=>{Oa(e,e.get(t),r)}))})))}function Na(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&&Oa(e,r,i)}))})),i}const Ma=La;function Va(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 a=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||a)){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 a=(r=r.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!a&&r.length&&t.includes("back")&&(a=r[r.length-1]),a&&(e.video.deviceId=o.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=n(e.video),Ma("chrome: "+JSON.stringify(e)),i(e)}))}e.video=n(e.video)}return Ma("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 Ua(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function Fa(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 Pa(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function ja(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 Ba(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 Wa(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=>Na(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}),Pa(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Na(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 Ga(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 Za(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Ga(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})}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");if(this.getSenders().find((e=>e.track===t)))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[r.id];if(i)i.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]=function(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})}(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};const s=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=s.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 Ya(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 Ha(e,t){Pa(e,"negotiationneeded",(e=>{const r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))}var Xa=Object.freeze({__proto__:null,shimMediaStream:Ua,shimOnTrack:Fa,shimGetSendersWithDtmf:ja,shimGetStats:Ba,shimSenderReceiverGetStats:Wa,shimAddTrackRemoveTrackWithNative:Ga,shimAddTrackRemoveTrack:Za,shimPeerConnection:Ya,fixNegotiationNeeded:Ha,shimGetUserMedia:Va,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 Ka(e,t){const r=e&&e.navigator,n=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,n){xa("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 Ja(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 Qa(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 za(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 qa(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}),Pa(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function $a(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){xa("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function es(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function ts(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 rs(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 ns(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 is(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 os=Object.freeze({__proto__:null,shimOnTrack:Ja,shimPeerConnection:Qa,shimSenderGetStats:za,shimReceiverGetStats:qa,shimRemoveStream:$a,shimRTCDataChannel:es,shimAddTransceiver:ts,shimGetParameters:rs,shimCreateOffer:ns,shimCreateAnswer:is,shimGetUserMedia:Ka,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 as(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 ss(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 cs(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,a=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 s=function(e,t,r){const n=i.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=s,s=function(e,t,r){const n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=s,s=function(e,t,r){const n=a.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=s}function us(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(ls(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))}function ls(e){return e&&void 0!==e.video?Object.assign({},e,{video:Da(e.video)}):e}function ds(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){const t=[];for(let r=0;rt.generateCertificate})}function ps(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 fs(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 hs(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var ms=Object.freeze({__proto__:null,shimLocalStreamsAPI:as,shimRemoteStreamsAPI:ss,shimCallbacksAPI:cs,shimGetUserMedia:us,shimConstraints:ls,shimRTCIceServerUrls:ds,shimTrackEventTransceiver:ps,shimCreateOfferLegacy:fs,shimAudioContext:hs}),vs={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;e0?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{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{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"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),s=a.length>0&&a[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]===s&&(c=u[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(t.rtx={ssrc:c}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:s,mechanism:o?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&s&&r.push({ssrc:s});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 a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[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(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function Cs(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||Pa(e,"icecandidate",(e=>{if(e.candidate){const t=ys.parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function Ss(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=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(function(e){if(!e||!e.sdp)return!1;const t=ys.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=ys.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){const e=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}(arguments[0]),r=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}(e),n=function(e,r){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const i=ys.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}(arguments[0],e);let i;i=0===r&&0===n?Number.POSITIVE_INFINITY:0===r||0===n?Math.max(r,n):Math.min(r,n);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>i}),this._sctp=o}return r.apply(this,arguments)}}function _s(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},Pa(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function Ts(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 ws(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 Rs(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 Es(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]);return("offer"===e.type?this.createOffer:this.createAnswer).apply(this).then((e=>r.apply(this,[e])))})}var Ps=Object.freeze({__proto__:null,shimRTCIceCandidate:bs,shimRTCIceCandidateRelayProtocol:Cs,shimMaxMessageSize:Ss,shimSendThrowTypeError:_s,shimConnectionState:Ts,removeExtmapAllowMixed:ws,shimAddIceCandidateNullOrEmpty:Rs,shimParameterlessSetLocalDescription:Es});const ks=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=La,n=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator||!e.navigator.userAgent)return t.browser="Not a browser.",t;const{navigator:r}=e;if(r.mozGetUserMedia)t.browser="firefox",t.version=Ea(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=Ea(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=Ea(r.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),i={browserDetails:n,commonShim:Ps,extractVersion:Ea,disableLog:ka,disableWarnings:Aa,sdp:gs};switch(n.browser){case"chrome":if(!Xa||!Ya||!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=Xa,Rs(e,n),Es(e),Va(e,n),Ua(e),Ya(e,n),Fa(e),Za(e,n),ja(e),Ba(e),Wa(e),Ha(e,n),bs(e),Cs(e),Ts(e),Ss(e,n),_s(e),ws(e,n);break;case"firefox":if(!os||!Qa||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),i;r("adapter.js shimming firefox."),i.browserShim=os,Rs(e,n),Es(e),Ka(e,n),Qa(e,n),Ja(e),$a(e),za(e),qa(e),es(e),ts(e),rs(e),ns(e),is(e),bs(e),Ts(e),Ss(e,n),_s(e);break;case"safari":if(!ms||!t.shimSafari)return r("Safari shim is not included in this adapter release."),i;r("adapter.js shimming safari."),i.browserShim=ms,Rs(e,n),Es(e),ds(e),fs(e),cs(e),as(e),ss(e),ps(e),us(e),hs(e),bs(e),Cs(e),Ss(e,n),_s(e),ws(e,n);break;default:r("Unsupported browser!")}return i}({window:"undefined"==typeof window?void 0:window});let As=(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 Ls={exports:{}};!function(e){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),a=Math.max(i,o),s=0,c=e.map([t,r],(function(t){var r=a-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&&(s=a-Math.min(i,o)),a-=1;a>=s;){if(c[0][a]>c[1][a])return 1;if(c[0][a]===c[1][a]){if(a===s)return 0;a-=1}else if(c[0][a]1?i-1:0),a=1;a0){var a=Object.keys(r),c=s.default.find(a,(function(e){return t.isOS(e)}));if(c){var u=this.satisfies(r[c]);if(void 0!==u)return u}var l=s.default.find(a,(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=s.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=s.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(s.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,a=[{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=a,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),a=[{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=a,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),a=[{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=a,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),a=[{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=a,e.exports=t.default}})}(Ls);var xs=r(Ls.exports),Is={},Ds={},Os=ze,Ns=Q,Ms=Ri.indexOf,Vs=Ds,Us=u([].push),Fs=function(e,t){var r,n=Ns(e),i=0,o=[];for(r in n)!Os(Vs,r)&&Os(n,r)&&Us(o,r);for(;t.length>i;)Os(n,r=t[i++])&&(~Ms(o,r)||Us(o,r));return o},js=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Bs=Fs,Ws=js,Gs=Object.keys||function(e){return Bs(e,Ws)},Zs=k,Ys=qt,Hs=zt,Xs=rr,Ks=Q,Js=Gs;Is.f=Zs&&!Ys?Object.defineProperties:function(e,t){Xs(e);for(var r,n=Ks(t),i=Js(t),o=i.length,a=0;o>a;)Hs.f(e,r=i[a++],n[r]);return e};var Qs,zs=ie("document","documentElement"),qs=rt,$s=Ye("keys"),ec=function(e){return $s[e]||($s[e]=qs(e))},tc=rr,rc=Is,nc=js,ic=Ds,oc=zs,ac=Et,sc="prototype",cc="script",uc=ec("IE_PROTO"),lc=function(){},dc=function(e){return"<"+cc+">"+e+""},pc=function(e){e.write(dc("")),e.close();var t=e.parentWindow.Object;return e=null,t},fc=function(){try{Qs=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;fc="undefined"!=typeof document?document.domain&&Qs?pc(Qs):(t=ac("iframe"),r="java"+cc+":",t.style.display="none",oc.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(dc("document.F=Object")),e.close(),e.F):pc(Qs);for(var n=nc.length;n--;)delete fc[sc][nc[n]];return fc()};ic[uc]=!0;var hc=Object.create||function(e,t){var r;return null!==e?(lc[sc]=tc(e),r=new lc,lc[sc]=null,r[uc]=e):r=fc(),void 0===t?r:rc.f(r,t)},mc={},vc=Fs,yc=js.concat("length","prototype");mc.f=Object.getOwnPropertyNames||function(e){return vc(e,yc)};var gc={},bc=S,Cc=Q,Sc=mc.f,_c=Ar,Tc="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];gc.f=function(e){return Tc&&"Window"===bc(e)?function(e){try{return Sc(e)}catch(e){return _c(Tc)}}(e):Sc(Cc(e))};var wc={};wc.f=Object.getOwnPropertySymbols;var Rc=vr,Ec=function(e,t,r,n){return n&&n.enumerable?e[t]=r:Rc(e,t,r),e},Pc=zt,kc=function(e,t,r){return Pc.f(e,t,r)},Ac={},Lc=dt;Ac.f=Lc;var xc,Ic,Dc,Oc=$,Nc=ze,Mc=Ac,Vc=zt.f,Uc=function(e){var t=Oc.Symbol||(Oc.Symbol={});Nc(t,e)||Vc(t,e,{value:Mc.f(e)})},Fc=x,jc=ie,Bc=dt,Wc=Ec,Gc=function(){var e=jc("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=Bc("toPrimitive");t&&!t[n]&&Wc(t,n,(function(e){return Fc(r,this)}),{arity:1})},Zc=_n,Yc=mn?{}.toString:function(){return"[object "+Zc(this)+"]"},Hc=mn,Xc=zt.f,Kc=vr,Jc=ze,Qc=Yc,zc=dt("toStringTag"),qc=function(e,t,r,n){var i=r?e:e&&e.prototype;i&&(Jc(i,zc)||Xc(i,zc,{configurable:!0,value:t}),n&&!Hc&&Kc(i,"toString",Qc))},$c=E,eu=p.WeakMap,tu=$c(eu)&&/native code/.test(String(eu)),ru=p,nu=q,iu=vr,ou=ze,au=Me.exports,su=ec,cu=Ds,uu="Object already initialized",lu=ru.TypeError,du=ru.WeakMap;if(tu||au.state){var pu=au.state||(au.state=new du);pu.get=pu.get,pu.has=pu.has,pu.set=pu.set,xc=function(e,t){if(pu.has(e))throw new lu(uu);return t.facade=e,pu.set(e,t),t},Ic=function(e){return pu.get(e)||{}},Dc=function(e){return pu.has(e)}}else{var fu=su("state");cu[fu]=!0,xc=function(e,t){if(ou(e,fu))throw new lu(uu);return t.facade=e,iu(e,fu,t),t},Ic=function(e){return ou(e,fu)?e[fu]:{}},Dc=function(e){return ou(e,fu)}}var hu={set:xc,get:Ic,has:Dc,enforce:function(e){return Dc(e)?Ic(e):xc(e,{})},getterFor:function(e){return function(t){var r;if(!nu(t)||(r=Ic(t)).type!==e)throw new lu("Incompatible receiver, "+e+" required");return r}}},mu=kr,vu=p,yu=x,gu=u,bu=k,Cu=ve,Su=n,_u=ze,Tu=l,wu=rr,Ru=Q,Eu=_t,Pu=Mi,ku=U,Au=hc,Lu=Gs,xu=mc,Iu=gc,Du=wc,Ou=P,Nu=zt,Mu=Is,Vu=I,Uu=Ec,Fu=kc,ju=Ye,Bu=Ds,Wu=rt,Gu=dt,Zu=Ac,Yu=Uc,Hu=Gc,Xu=qc,Ku=hu,Ju=oo.forEach,Qu=ec("hidden"),zu="Symbol",qu="prototype",$u=Ku.set,el=Ku.getterFor(zu),tl=Object[qu],rl=vu.Symbol,nl=rl&&rl[qu],il=vu.RangeError,ol=vu.TypeError,al=vu.QObject,sl=Ou.f,cl=Nu.f,ul=Iu.f,ll=Vu.f,dl=gu([].push),pl=ju("symbols"),fl=ju("op-symbols"),hl=ju("wks"),ml=!al||!al[qu]||!al[qu].findChild,vl=function(e,t,r){var n=sl(tl,t);n&&delete tl[t],cl(e,t,r),n&&e!==tl&&cl(tl,t,n)},yl=bu&&Su((function(){return 7!==Au(cl({},"a",{get:function(){return cl(this,"a",{value:7}).a}})).a}))?vl:cl,gl=function(e,t){var r=pl[e]=Au(nl);return $u(r,{type:zu,tag:e,description:t}),bu||(r.description=t),r},bl=function(e,t,r){e===tl&&bl(fl,t,r),wu(e);var n=Eu(t);return wu(r),_u(pl,n)?(r.enumerable?(_u(e,Qu)&&e[Qu][n]&&(e[Qu][n]=!1),r=Au(r,{enumerable:ku(0,!1)})):(_u(e,Qu)||cl(e,Qu,ku(1,Au(null))),e[Qu][n]=!0),yl(e,n,r)):cl(e,n,r)},Cl=function(e,t){wu(e);var r=Ru(t),n=Lu(r).concat(wl(r));return Ju(n,(function(t){bu&&!yu(Sl,r,t)||bl(e,t,r[t])})),e},Sl=function(e){var t=Eu(e),r=yu(ll,this,t);return!(this===tl&&_u(pl,t)&&!_u(fl,t))&&(!(r||!_u(this,t)||!_u(pl,t)||_u(this,Qu)&&this[Qu][t])||r)},_l=function(e,t){var r=Ru(e),n=Eu(t);if(r!==tl||!_u(pl,n)||_u(fl,n)){var i=sl(r,n);return!i||!_u(pl,n)||_u(r,Qu)&&r[Qu][n]||(i.enumerable=!0),i}},Tl=function(e){var t=ul(Ru(e)),r=[];return Ju(t,(function(e){_u(pl,e)||_u(Bu,e)||dl(r,e)})),r},wl=function(e){var t=e===tl,r=ul(t?fl:Ru(e)),n=[];return Ju(r,(function(e){!_u(pl,e)||t&&!_u(tl,e)||dl(n,pl[e])})),n};Cu||(rl=function(){if(Tu(nl,this))throw new ol("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?Pu(arguments[0]):void 0,t=Wu(e),r=function(e){var n=void 0===this?vu:this;n===tl&&yu(r,fl,e),_u(n,Qu)&&_u(n[Qu],t)&&(n[Qu][t]=!1);var i=ku(1,e);try{yl(n,t,i)}catch(e){if(!(e instanceof il))throw e;vl(n,t,i)}};return bu&&ml&&yl(tl,t,{configurable:!0,set:r}),gl(t,e)},Uu(nl=rl[qu],"toString",(function(){return el(this).tag})),Uu(rl,"withoutSetter",(function(e){return gl(Wu(e),e)})),Vu.f=Sl,Nu.f=bl,Mu.f=Cl,Ou.f=_l,xu.f=Iu.f=Tl,Du.f=wl,Zu.f=function(e){return gl(Gu(e),e)},bu&&Fu(nl,"description",{configurable:!0,get:function(){return el(this).description}})),mu({global:!0,constructor:!0,wrap:!0,forced:!Cu,sham:!Cu},{Symbol:rl}),Ju(Lu(hl),(function(e){Yu(e)})),mu({target:zu,stat:!0,forced:!Cu},{useSetter:function(){ml=!0},useSimple:function(){ml=!1}}),mu({target:"Object",stat:!0,forced:!Cu,sham:!bu},{create:function(e,t){return void 0===t?Au(e):Cl(Au(e),t)},defineProperty:bl,defineProperties:Cl,getOwnPropertyDescriptor:_l}),mu({target:"Object",stat:!0,forced:!Cu},{getOwnPropertyNames:Tl}),Hu(),Xu(rl,zu),Bu[Qu]=!0;var Rl=ve&&!!Symbol.for&&!!Symbol.keyFor,El=kr,Pl=ie,kl=ze,Al=Mi,Ll=Ye,xl=Rl,Il=Ll("string-to-symbol-registry"),Dl=Ll("symbol-to-string-registry");El({target:"Symbol",stat:!0,forced:!xl},{for:function(e){var t=Al(e);if(kl(Il,t))return Il[t];var r=Pl("Symbol")(t);return Il[t]=r,Dl[r]=t,r}});var Ol=kr,Nl=ze,Ml=_e,Vl=we,Ul=Rl,Fl=Ye("symbol-to-string-registry");Ol({target:"Symbol",stat:!0,forced:!Ul},{keyFor:function(e){if(!Ml(e))throw new TypeError(Vl(e)+" is not a symbol");if(Nl(Fl,e))return Fl[e]}});var jl=zr,Bl=E,Wl=S,Gl=Mi,Zl=u([].push),Yl=kr,Hl=ie,Xl=y,Kl=x,Jl=u,Ql=n,zl=E,ql=_e,$l=Ar,ed=function(e){if(Bl(e))return e;if(jl(e)){for(var t=e.length,r=[],n=0;n=t.length)return e.target=void 0,Vp(void 0,!0);switch(e.kind){case"keys":return Vp(r,!1);case"values":return Vp(t[r],!1)}return Vp([r,t[r]],!1)}),"values");Op.Arguments=Op.Array;Dp(),Dp(),Dp();var Bp={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},Wp=p,Gp=qc,Zp=Rd;for(var Yp in Bp)Gp(Wp[Yp],Yp),Zp[Yp]=Zp.Array;var Hp=wd,Xp=dt,Kp=zt.f,Jp=Xp("metadata"),Qp=Function.prototype;void 0===Qp[Jp]&&Kp(Qp,Jp,{value:null}),Uc("asyncDispose"),Uc("dispose"),Uc("metadata");var zp=Hp,qp=u,$p=ie("Symbol"),ef=$p.keyFor,tf=qp($p.prototype.valueOf),rf=$p.isRegisteredSymbol||function(e){try{return void 0!==ef(tf(e))}catch(e){return!1}};kr({target:"Symbol",stat:!0},{isRegisteredSymbol:rf});for(var nf=Ye,of=ie,af=u,sf=_e,cf=dt,uf=of("Symbol"),lf=uf.isWellKnownSymbol,df=of("Object","getOwnPropertyNames"),pf=af(uf.prototype.valueOf),ff=nf("wks"),hf=0,mf=df(uf),vf=mf.length;hf=s?e?"":void 0:(n=Rf(o,a))<55296||n>56319||a+1===s||(i=Rf(o,a+1))<56320||i>57343?e?wf(o,a):n:e?Ef(o,a,a+2):i-56320+(n-55296<<10)+65536}},kf={codeAt:Pf(!1),charAt:Pf(!0)},Af=kf.charAt,Lf=Mi,xf=hu,If=Lp,Df=xp,Of="String Iterator",Nf=xf.set,Mf=xf.getterFor(Of);If(String,"String",(function(e){Nf(this,{type:Of,string:Lf(e),index:0})}),(function(){var e,t=Mf(this),r=t.string,n=t.index;return n>=r.length?Df(void 0,!0):(e=Af(r,n),t.index+=e.length,Df(e,!1))}));var Vf=Ac.f("iterator");function Uf(e){return Uf="function"==typeof bf&&"symbol"==typeof Vf?function(e){return typeof e}:function(e){return e&&"function"==typeof bf&&e.constructor===bf&&e!==bf.prototype?"symbol":typeof e},Uf(e)}kr({target:"Object",stat:!0,sham:!k},{create:hc});var Ff=$.Object,jf=function(e,t){return Ff.create(e,t)},Bf=kr,Wf=zr,Gf=jn,Zf=q,Yf=Ci,Hf=sn,Xf=Q,Kf=fn,Jf=dt,Qf=Ar,zf=zn("slice"),qf=Jf("species"),$f=Array,eh=Math.max;Bf({target:"Array",proto:!0,forced:!zf},{slice:function(e,t){var r,n,i,o=Xf(this),a=Hf(o),s=Yf(e,a),c=Yf(void 0===t?a:t,a);if(Wf(o)&&(r=o.constructor,(Gf(r)&&(r===$f||Wf(r.prototype))||Zf(r)&&null===(r=r[qf]))&&(r=void 0),r===$f||void 0===r))return Qf(o,s,c);for(n=new(void 0===r?$f:r)(eh(c-s,0)),i=0;ss;)void 0!==(r=i(n,t=o[s++]))&&Nh(a,t,r);return a}});var Mh=$.Object.getOwnPropertyDescriptors,Vh={exports:{}},Uh=kr,Fh=k,jh=Is.f;Uh({target:"Object",stat:!0,forced:Object.defineProperties!==jh,sham:!Fh},{defineProperties:jh});var Bh=$.Object,Wh=Vh.exports=function(e,t){return Bh.defineProperties(e,t)};Bh.defineProperties.sham&&(Wh.sham=!0);var Gh=Vh.exports,Zh=Ac.f("toPrimitive"),Yh=y,Hh=Q,Xh=tn,Kh=sn,Jh=so,Qh=Math.min,zh=[].lastIndexOf,qh=!!zh&&1/[1].lastIndexOf(1,-0)<0,$h=Jh("lastIndexOf"),em=qh||!$h?function(e){if(qh)return Yh(zh,this,arguments)||0;var t=Hh(this),r=Kh(t);if(0===r)return-1;var n=r-1;for(arguments.length>1&&(n=Qh(n,Xh(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:zh;kr({target:"Array",proto:!0,forced:em!==[].lastIndexOf},{lastIndexOf:em});var tm=Zr("Array","lastIndexOf"),rm=l,nm=tm,im=Array.prototype,om=function(e){var t=e.lastIndexOf;return e===im||rm(im,e)&&t===im.lastIndexOf?nm:t},am=k,sm=u,cm=x,um=n,lm=Gs,dm=wc,pm=I,fm=Ke,hm=G,mm=Object.assign,vm=Object.defineProperty,ym=sm([].concat),gm=!mm||um((function(){if(am&&1!==mm({b:1},mm(vm({},"a",{enumerable:!0,get:function(){vm(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!==mm({},e)[r]||lm(mm({},t)).join("")!==n}))?function(e,t){for(var r=fm(e),n=arguments.length,i=1,o=dm.f,a=pm.f;n>i;)for(var s,c=hm(arguments[i++]),u=o?ym(lm(c),o(c)):lm(c),l=u.length,d=0;l>d;)s=u[d++],am&&!cm(a,c,s)||(r[s]=c[s]);return r}:mm,bm=gm;kr({target:"Object",stat:!0,arity:2,forced:Object.assign!==bm},{assign:bm});var Cm=$.Object.assign,Sm={exports:{}},_m=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),Tm=n,wm=q,Rm=S,Em=_m,Pm=Object.isExtensible,km=Tm((function(){Pm(1)}))||Em?function(e){return!!wm(e)&&((!Em||"ArrayBuffer"!==Rm(e))&&(!Pm||Pm(e)))}:Pm,Am=!n((function(){return Object.isExtensible(Object.preventExtensions({}))})),Lm=kr,xm=u,Im=Ds,Dm=q,Om=ze,Nm=zt.f,Mm=mc,Vm=gc,Um=km,Fm=Am,jm=!1,Bm=rt("meta"),Wm=0,Gm=function(e){Nm(e,Bm,{value:{objectID:"O"+Wm++,weakData:{}}})},Zm=Sm.exports={enable:function(){Zm.enable=function(){},jm=!0;var e=Mm.f,t=xm([].splice),r={};r[Bm]=1,e(r).length&&(Mm.f=function(r){for(var n=e(r),i=0,o=n.length;io;o++)if((s=y(e[o]))&&vv(_v,s))return s;return new Sv(!1)}n=yv(e,i)}for(c=p?e.next:n.next;!(u=dv(c,n)).done;){try{s=y(u.value)}catch(e){bv(n,"throw",e)}if("object"==typeof s&&s&&vv(_v,s))return s}return new Sv(!1)},wv=l,Rv=TypeError,Ev=function(e,t){if(wv(t,e))return e;throw new Rv("Incorrect invocation")},Pv=kr,kv=p,Av=Sm.exports,Lv=n,xv=vr,Iv=Tv,Dv=Ev,Ov=E,Nv=q,Mv=Z,Vv=qc,Uv=zt.f,Fv=oo.forEach,jv=k,Bv=hu.set,Wv=hu.getterFor,Gv=function(e,t,r){var n,i=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),a=i?"set":"add",s=kv[e],c=s&&s.prototype,u={};if(jv&&Ov(s)&&(o||c.forEach&&!Lv((function(){(new s).entries().next()})))){var l=(n=t((function(t,r){Bv(Dv(t,l),{type:e,collection:new s}),Mv(r)||Iv(r,t[a],{that:t,AS_ENTRIES:i})}))).prototype,d=Wv(e);Fv(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"===e||"set"===e;!(e in c)||o&&"clear"===e||xv(l,e,(function(r,n){var i=d(this).collection;if(!t&&o&&!Nv(r))return"get"===e&&void 0;var a=i[e](0===r?0:r,n);return t?this:a}))})),o||Uv(l,"size",{configurable:!0,get:function(){return d(this).collection.size}})}else n=r.getConstructor(t,e,i,a),Av.enable();return Vv(n,e,!1,!0),u[e]=n,Pv({global:!0,forced:!0},u),o||r.setStrong(n,e,i),n},Zv=Ec,Yv=ie,Hv=kc,Xv=k,Kv=dt("species"),Jv=function(e){var t=Yv(e);Xv&&t&&!t[Kv]&&Hv(t,Kv,{configurable:!0,get:function(){return this}})},Qv=hc,zv=kc,qv=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:Zv(e,n,t[n],r);return e},$v=Qt,ey=Ev,ty=Z,ry=Tv,ny=Lp,iy=xp,oy=Jv,ay=k,sy=Sm.exports.fastKey,cy=hu.set,uy=hu.getterFor,ly={getConstructor:function(e,t,r,n){var i=e((function(e,i){ey(e,o),cy(e,{type:t,index:Qv(null),first:void 0,last:void 0,size:0}),ay||(e.size=0),ty(i)||ry(i,e[n],{that:e,AS_ENTRIES:r})})),o=i.prototype,a=uy(t),s=function(e,t,r){var n,i,o=a(e),s=c(e,t);return s?s.value=r:(o.last=s={index:i=sy(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=s),n&&(n.next=s),ay?o.size++:e.size++,"F"!==i&&(o.index[i]=s)),e},c=function(e,t){var r,n=a(e),i=sy(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key===t)return r};return qv(o,{clear:function(){for(var e=a(this),t=e.first;t;)t.removed=!0,t.previous&&(t.previous=t.previous.next=void 0),t=t.next;e.first=e.last=void 0,e.index=Qv(null),ay?e.size=0:this.size=0},delete:function(e){var t=this,r=a(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),ay?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=a(this),n=$v(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)}}),qv(o,r?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),ay&&zv(o,"size",{configurable:!0,get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=uy(t),o=uy(n);ny(e,t,(function(e,t){cy(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)?iy("keys"===t?r.key:"values"===t?r.value:[r.key,r.value],!1):(e.target=void 0,iy(void 0,!0))}),r?"entries":"values",!r,!0),oy(t)}};Gv("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),ly);var dy=we,py=TypeError,fy=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"add"in e&&"delete"in e&&"keys"in e)return e;throw new py(dy(e)+" is not a set")},hy=function(e,t){return 1===t?function(t,r){return t[e](r)}:function(t,r,n){return t[e](r,n)}},my=hy,vy=ie("Set"),yy=vy.prototype,gy={Set:vy,add:my("add",1),has:my("has",1),remove:my("delete",1),proto:yy},by=x,Cy=function(e,t,r){for(var n,i,o=r?e:e.iterator,a=e.next;!(n=by(a,o)).done;)if(void 0!==(i=t(n.value)))return i},Sy=Cy,_y=function(e,t,r){return r?Sy(e.keys(),t,!0):e.forEach(t)},Ty=_y,wy=gy.Set,Ry=gy.add,Ey=function(e){var t=new wy;return Ty(e,(function(e){Ry(t,e)})),t},Py=function(e){return e.size},ky=ke,Ay=rr,Ly=x,xy=tn,Iy=function(e){return{iterator:e,next:e.next,done:!1}},Dy="Invalid size",Oy=RangeError,Ny=TypeError,My=Math.max,Vy=function(e,t){this.set=e,this.size=My(t,0),this.has=ky(e.has),this.keys=ky(e.keys)};Vy.prototype={getIterator:function(){return Iy(Ay(Ly(this.keys,this.set)))},includes:function(e){return Ly(this.has,this.set,e)}};var Uy=function(e){Ay(e);var t=+e.size;if(t!=t)throw new Ny(Dy);var r=xy(t);if(r<0)throw new Oy(Dy);return new Vy(e,r)},Fy=fy,jy=Ey,By=Py,Wy=Uy,Gy=_y,Zy=Cy,Yy=gy.has,Hy=gy.remove,Xy=function(e){var t=Fy(this),r=Wy(e),n=jy(t);return By(t)<=r.size?Gy(t,(function(e){r.includes(e)&&Hy(n,e)})):Zy(r.getIterator(),(function(e){Yy(t,e)&&Hy(n,e)})),n},Ky=function(){return!1},Jy=Xy;kr({target:"Set",proto:!0,real:!0,forced:!Ky()},{difference:Jy});var Qy=fy,zy=Py,qy=Uy,$y=_y,eg=Cy,tg=gy.Set,rg=gy.add,ng=gy.has,ig=function(e){var t=Qy(this),r=qy(e),n=new tg;return zy(t)>r.size?eg(r.getIterator(),(function(e){ng(t,e)&&rg(n,e)})):$y(t,(function(e){r.includes(e)&&rg(n,e)})),n},og=n,ag=ig;kr({target:"Set",proto:!0,real:!0,forced:!Ky()||og((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:ag});var sg=fy,cg=gy.has,ug=Py,lg=Uy,dg=_y,pg=Cy,fg=uv,hg=function(e){var t=sg(this),r=lg(e);if(ug(t)<=r.size)return!1!==dg(t,(function(e){if(r.includes(e))return!1}),!0);var n=r.getIterator();return!1!==pg(n,(function(e){if(cg(t,e))return fg(n,"normal",!1)}))},mg=hg;kr({target:"Set",proto:!0,real:!0,forced:!Ky()},{isDisjointFrom:mg});var vg=fy,yg=Py,gg=_y,bg=Uy,Cg=function(e){var t=vg(this),r=bg(e);return!(yg(t)>r.size)&&!1!==gg(t,(function(e){if(!r.includes(e))return!1}),!0)},Sg=Cg;kr({target:"Set",proto:!0,real:!0,forced:!Ky()},{isSubsetOf:Sg});var _g=fy,Tg=gy.has,wg=Py,Rg=Uy,Eg=Cy,Pg=uv,kg=function(e){var t=_g(this),r=Rg(e);if(wg(t)1?arguments[1]:void 0,s=void 0!==a,c=s?Xg(a,o>2?arguments[2]:void 0):void 0,u=new e,l=0;return Qg(i,(function(e){var n=s?c(e,l++):e;r?t(u,Kg(n)[0],n[1]):t(u,n)})),u}};kr({target:"Set",stat:!0,forced:!0},{from:zg(gy.Set,gy.add,!1)});var qg=rr,$g=function(e,t,r){return function(){for(var n=new e,i=arguments.length,o=0;o1?arguments[1]:void 0);return!1!==ab(t,(function(e){if(!r(e,e,t))return!1}),!0)}});var sb=_n,cb=ze,ub=Z,lb=Rd,db=dt("iterator"),pb=Object,fb=E,hb=function(e){if(ub(e))return!1;var t=pb(e);return void 0!==t[db]||"@@iterator"in t||cb(lb,sb(t))},mb=q,vb=ie("Set"),yb=function(e){return function(e){return mb(e)&&"number"==typeof e.size&&fb(e.has)&&fb(e.keys)}(e)?e:hb(e)?new vb(e):e},gb=x,bb=yb,Cb=Xy;kr({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return gb(Cb,this,bb(e))}});var Sb=Qt,_b=fy,Tb=_y,wb=gy.Set,Rb=gy.add;kr({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=_b(this),r=Sb(e,arguments.length>1?arguments[1]:void 0),n=new wb;return Tb(t,(function(e){r(e,e,t)&&Rb(n,e)})),n}});var Eb=Qt,Pb=fy,kb=_y;kr({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=Pb(this),r=Eb(e,arguments.length>1?arguments[1]:void 0),n=kb(t,(function(e){if(r(e,e,t))return{value:e}}),!0);return n&&n.value}});var Ab=x,Lb=yb,xb=ig;kr({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return Ab(xb,this,Lb(e))}});var Ib=x,Db=yb,Ob=hg;kr({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return Ib(Ob,this,Db(e))}});var Nb=x,Mb=yb,Vb=Cg;kr({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return Nb(Vb,this,Mb(e))}});var Ub=x,Fb=yb,jb=kg;kr({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return Ub(jb,this,Fb(e))}});var Bb=kr,Wb=u,Gb=fy,Zb=_y,Yb=Mi,Hb=Wb([].join),Xb=Wb([].push);Bb({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=Gb(this),r=void 0===e?",":Yb(e),n=[];return Zb(t,(function(e){Xb(n,e)})),Hb(n,r)}});var Kb=Qt,Jb=fy,Qb=_y,zb=gy.Set,qb=gy.add;kr({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=Jb(this),r=Kb(e,arguments.length>1?arguments[1]:void 0),n=new zb;return Qb(t,(function(e){qb(n,r(e,e,t))})),n}});var $b=ke,eC=fy,tC=_y,rC=TypeError;kr({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=eC(this),r=arguments.length<2,n=r?void 0:arguments[1];if($b(e),tC(t,(function(i){r?(r=!1,n=i):n=e(n,i,i,t)})),r)throw new rC("Reduce of empty set with no initial value");return n}});var nC=Qt,iC=fy,oC=_y;kr({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=iC(this),r=nC(e,arguments.length>1?arguments[1]:void 0);return!0===oC(t,(function(e){if(r(e,e,t))return!0}),!0)}});var aC=x,sC=yb,cC=Vg;kr({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return aC(cC,this,sC(e))}});var uC=x,lC=yb,dC=Zg;kr({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return uC(dC,this,lC(e))}});var pC=Hg;Gv("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),ly);var fC=hy,hC=ie("Map"),mC={Map:hC,set:fC("set",2),get:fC("get",1),has:fC("has",1),remove:fC("delete",1),proto:hC.prototype},vC=kr,yC=ke,gC=X,bC=Tv,CC=Ve,SC=mC.Map,_C=mC.has,TC=mC.get,wC=mC.set,RC=u([].push);vC({target:"Map",stat:!0,forced:CC},{groupBy:function(e,t){gC(e),yC(t);var r=new SC,n=0;return bC(e,(function(e){var i=t(e,n++);_C(r,i)?RC(TC(r,i),e):wC(r,i,[e])})),r}});var EC=$.Map;kr({target:"Map",stat:!0,forced:!0},{from:zg(mC.Map,mC.set,!0)});kr({target:"Map",stat:!0,forced:!0},{of:$g(mC.Map,mC.set,!0)});var PC=we,kC=TypeError,AC=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"get"in e&&"set"in e&&"delete"in e&&"entries"in e)return e;throw new kC(PC(e)+" is not a map")},LC=AC,xC=mC.remove;kr({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=LC(this),r=!0,n=0,i=arguments.length;n1?arguments[1]:void 0);return!1!==jC(t,(function(e,n){if(!r(e,n,t))return!1}),!0)}});var BC=Qt,WC=AC,GC=VC,ZC=mC.Map,YC=mC.set;kr({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=WC(this),r=BC(e,arguments.length>1?arguments[1]:void 0),n=new ZC;return GC(t,(function(e,i){r(e,i,t)&&YC(n,i,e)})),n}});var HC=Qt,XC=AC,KC=VC;kr({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=XC(this),r=HC(e,arguments.length>1?arguments[1]:void 0),n=KC(t,(function(e,n){if(r(e,n,t))return{value:e}}),!0);return n&&n.value}});var JC=Qt,QC=AC,zC=VC;kr({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=QC(this),r=JC(e,arguments.length>1?arguments[1]:void 0),n=zC(t,(function(e,n){if(r(e,n,t))return{key:n}}),!0);return n&&n.key}});var qC=function(e,t){return e===t||e!=e&&t!=t},$C=AC,eS=VC;kr({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===eS($C(this),(function(t){if(qC(t,e))return!0}),!0)}});var tS=x,rS=Tv,nS=E,iS=ke,oS=mC.Map;kr({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new(nS(this)?this:oS);iS(t);var n=iS(r.set);return rS(e,(function(e){tS(n,r,t(e),e)})),r}});var aS=AC,sS=VC;kr({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=sS(aS(this),(function(t,r){if(t===e)return{key:r}}),!0);return t&&t.key}});var cS=Qt,uS=AC,lS=VC,dS=mC.Map,pS=mC.set;kr({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=uS(this),r=cS(e,arguments.length>1?arguments[1]:void 0),n=new dS;return lS(t,(function(e,i){pS(n,r(e,i,t),e)})),n}});var fS=Qt,hS=AC,mS=VC,vS=mC.Map,yS=mC.set;kr({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=hS(this),r=fS(e,arguments.length>1?arguments[1]:void 0),n=new vS;return mS(t,(function(e,i){yS(n,i,r(e,i,t))})),n}});var gS=AC,bS=Tv,CS=mC.set;kr({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=gS(this),r=arguments.length,n=0;n1?arguments[1]:void 0);return!0===PS(t,(function(e,n){if(r(e,n,t))return!0}),!0)}});var kS=ke,AS=AC,LS=TypeError,xS=mC.get,IS=mC.has,DS=mC.set;kr({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=AS(this),n=arguments.length;kS(t);var i=IS(r,e);if(!i&&n<3)throw new LS("Updating absent value");var o=i?xS(r,e):kS(n>2?arguments[2]:void 0)(e,r);return DS(r,e,t(o,e,r)),r}});var OS=x,NS=ke,MS=E,VS=rr,US=TypeError,FS=function(e,t){var r,n=VS(this),i=NS(n.get),o=NS(n.has),a=NS(n.set),s=arguments.length>2?arguments[2]:void 0;if(!MS(t)&&!MS(s))throw new US("At least one callback required");return OS(o,n,e)?(r=OS(i,n,e),MS(t)&&(r=t(r),OS(a,n,e,r))):MS(s)&&(r=s(),OS(a,n,e,r)),r};kr({target:"Map",proto:!0,real:!0,forced:!0},{upsert:FS}),kr({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:FS});var jS=EC,BS=kr,WS=Date,GS=u(WS.prototype.getTime);BS({target:"Date",stat:!0},{now:function(){return GS(new WS)}});var ZS=$.Date.now,YS=ke,HS=Ke,XS=G,KS=sn,JS=TypeError,QS="Reduce of empty array with no initial value",zS=function(e){return function(t,r,n,i){var o=HS(t),a=XS(o),s=KS(o);if(YS(r),0===s&&n<2)throw new JS(QS);var c=e?s-1:0,u=e?-1:1;if(n<2)for(;;){if(c in a){i=a[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw new JS(QS)}for(;e?c>=0:s>c;c+=u)c in a&&(i=r(i,a[c],c,o));return i}},qS={left:zS(!1),right:zS(!0)},$S="process"===S(p.process),e_=qS.left;kr({target:"Array",proto:!0,forced:!$S&&pe>79&&pe<83||!so("reduce")},{reduce:function(e){var t=arguments.length;return e_(this,e,t,t>1?arguments[1]:void 0)}});var t_=Zr("Array","reduce"),r_=l,n_=t_,i_=Array.prototype,o_=function(e){var t=e.reduce;return e===i_||r_(i_,e)&&t===i_.reduce?n_:t},a_=kf.codeAt;kr({target:"String",proto:!0},{codePointAt:function(e){return a_(this,e)}});var s_=Zr("String","codePointAt"),c_=l,u_=s_,l_=String.prototype,d_=function(e){var t=e.codePointAt;return"string"==typeof e||e===l_||c_(l_,e)&&t===l_.codePointAt?u_:t},p_=kr,f_=u,h_=Ci,m_=RangeError,v_=String.fromCharCode,y_=String.fromCodePoint,g_=f_([].join);p_({target:"String",stat:!0,arity:1,forced:!!y_&&1!==y_.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],h_(t,1114111)!==t)throw new m_(t+" is not a valid code point");r[i]=t<65536?v_(t):v_(55296+((t-=65536)>>10),t%1024+56320)}return g_(r,"")}});var b_=$.String.fromCodePoint,C_=tn,S_=Mi,__=X,T_=RangeError,w_=u,R_=on,E_=Mi,P_=X,k_=w_((function(e){var t=S_(__(this)),r="",n=C_(e);if(n<0||n===1/0)throw new T_("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r})),A_=w_("".slice),L_=Math.ceil,x_=function(e){return function(t,r,n){var i,o,a=E_(P_(t)),s=R_(r),c=a.length,u=void 0===n?" ":E_(n);return s<=c||""===u?a:((o=k_(u,L_((i=s-c)/u.length))).length>i&&(o=A_(o,0,i)),e?a+o:o+a)}},I_=u,D_=n,O_={start:x_(!1),end:x_(!0)}.start,N_=RangeError,M_=isFinite,V_=Math.abs,U_=Date.prototype,F_=U_.toISOString,j_=I_(U_.getTime),B_=I_(U_.getUTCDate),W_=I_(U_.getUTCFullYear),G_=I_(U_.getUTCHours),Z_=I_(U_.getUTCMilliseconds),Y_=I_(U_.getUTCMinutes),H_=I_(U_.getUTCMonth),X_=I_(U_.getUTCSeconds),K_=D_((function(){return"0385-07-25T07:06:39.999Z"!==F_.call(new Date(-50000000000001))}))||!D_((function(){F_.call(new Date(NaN))}))?function(){if(!M_(j_(this)))throw new N_("Invalid time value");var e=this,t=W_(e),r=Z_(e),n=t<0?"-":t>9999?"+":"";return n+O_(V_(t),n?6:4,0)+"-"+O_(H_(e)+1,2,0)+"-"+O_(B_(e),2,0)+"T"+O_(G_(e),2,0)+":"+O_(Y_(e),2,0)+":"+O_(X_(e),2,0)+"."+O_(r,3,0)+"Z"}:F_,J_=x,Q_=Ke,z_=bt,q_=K_,$_=S;kr({target:"Date",proto:!0,forced:n((function(){return null!==new Date(NaN).toJSON()||1!==J_(Date.prototype.toJSON,{toISOString:function(){return 1}})}))},{toJSON:function(e){var t=Q_(this),r=z_(t,"number");return"number"!=typeof r||isFinite(r)?"toISOString"in t||"Date"!==$_(t)?t.toISOString():J_(q_,t):null}});var eT=$,tT=y;eT.JSON||(eT.JSON={stringify:JSON.stringify});var rT=function(e,t,r){return tT(eT.JSON.stringify,null,arguments)},nT=rT,iT=ze,oT=xh,aT=P,sT=zt,cT=q,uT=vr,lT=Error,dT=u("".replace),pT=String(new lT("zxcasd").stack),fT=/\n\s*at [^:]*:[^\n]*/,hT=fT.test(pT),mT=U,vT=!n((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",mT(1,7)),7!==e.stack)})),yT=vr,gT=function(e,t){if(hT&&"string"==typeof e&&!lT.prepareStackTrace)for(;t--;)e=dT(e,fT,"");return e},bT=vT,CT=Error.captureStackTrace,ST=Mi,_T=kr,TT=l,wT=jd,RT=fp,ET=function(e,t,r){for(var n=oT(t),i=sT.f,o=aT.f,a=0;a2&<(r,arguments[2]);var i=[];return IT(e,MT,{that:i}),kT(r,"errors",i),r};RT?RT(VT,NT):ET(VT,NT,{name:!0});var UT=VT.prototype=PT(NT.prototype,{constructor:AT(1,VT),message:AT(1,""),name:AT(1,"AggregateError")});_T({global:!0,constructor:!0,arity:2},{AggregateError:VT});var FT,jT,BT,WT,GT=jn,ZT=we,YT=TypeError,HT=rr,XT=function(e){if(GT(e))return e;throw new YT(ZT(e)+" is not a constructor")},KT=Z,JT=dt("species"),QT=function(e,t){var r,n=HT(e).constructor;return void 0===n||KT(r=HT(n)[JT])?t:XT(r)},zT=/(?:ipad|iphone|ipod).*applewebkit/i.test(oe),qT=p,$T=y,ew=Qt,tw=E,rw=ze,nw=n,iw=zs,ow=Ar,aw=Et,sw=So,cw=zT,uw=$S,lw=qT.setImmediate,dw=qT.clearImmediate,pw=qT.process,fw=qT.Dispatch,hw=qT.Function,mw=qT.MessageChannel,vw=qT.String,yw=0,gw={},bw="onreadystatechange";nw((function(){FT=qT.location}));var Cw=function(e){if(rw(gw,e)){var t=gw[e];delete gw[e],t()}},Sw=function(e){return function(){Cw(e)}},_w=function(e){Cw(e.data)},Tw=function(e){qT.postMessage(vw(e),FT.protocol+"//"+FT.host)};lw&&dw||(lw=function(e){sw(arguments.length,1);var t=tw(e)?e:hw(e),r=ow(arguments,1);return gw[++yw]=function(){$T(t,void 0,r)},jT(yw),yw},dw=function(e){delete gw[e]},uw?jT=function(e){pw.nextTick(Sw(e))}:fw&&fw.now?jT=function(e){fw.now(Sw(e))}:mw&&!cw?(WT=(BT=new mw).port2,BT.port1.onmessage=_w,jT=ew(WT.postMessage,WT)):qT.addEventListener&&tw(qT.postMessage)&&!qT.importScripts&&FT&&"file:"!==FT.protocol&&!nw(Tw)?(jT=Tw,qT.addEventListener("message",_w,!1)):jT=bw in aw("script")?function(e){iw.appendChild(aw("script"))[bw]=function(){iw.removeChild(this),Cw(e)}}:function(e){setTimeout(Sw(e),0)});var ww={set:lw,clear:dw},Rw=p,Ew=k,Pw=Object.getOwnPropertyDescriptor,kw=function(){this.head=null,this.tail=null};kw.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var Aw,Lw,xw,Iw,Dw,Ow=kw,Nw=/ipad|iphone|ipod/i.test(oe)&&"undefined"!=typeof Pebble,Mw=/web0s(?!.*chrome)/i.test(oe),Vw=p,Uw=function(e){if(!Ew)return Rw[e];var t=Pw(Rw,e);return t&&t.value},Fw=Qt,jw=ww.set,Bw=Ow,Ww=zT,Gw=Nw,Zw=Mw,Yw=$S,Hw=Vw.MutationObserver||Vw.WebKitMutationObserver,Xw=Vw.document,Kw=Vw.process,Jw=Vw.Promise,Qw=Uw("queueMicrotask");if(!Qw){var zw=new Bw,qw=function(){var e,t;for(Yw&&(e=Kw.domain)&&e.exit();t=zw.get();)try{t()}catch(e){throw zw.head&&Aw(),e}e&&e.enter()};Ww||Yw||Zw||!Hw||!Xw?!Gw&&Jw&&Jw.resolve?((Iw=Jw.resolve(void 0)).constructor=Jw,Dw=Fw(Iw.then,Iw),Aw=function(){Dw(qw)}):Yw?Aw=function(){Kw.nextTick(qw)}:(jw=Fw(jw,Vw),Aw=function(){jw(qw)}):(Lw=!0,xw=Xw.createTextNode(""),new Hw(qw).observe(xw,{characterData:!0}),Aw=function(){xw.data=Lw=!Lw}),Qw=function(e){zw.head||Aw(),zw.add(e)}}var $w=Qw,eR=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},tR=p.Promise,rR="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,nR=!rR&&!$S&&"object"==typeof window&&"object"==typeof document,iR=p,oR=tR,aR=E,sR=Ht,cR=Pn,uR=dt,lR=nR,dR=rR,pR=pe,fR=oR&&oR.prototype,hR=uR("species"),mR=!1,vR=aR(iR.PromiseRejectionEvent),yR=sR("Promise",(function(){var e=cR(oR),t=e!==String(oR);if(!t&&66===pR)return!0;if(!fR.catch||!fR.finally)return!0;if(!pR||pR<51||!/native code/.test(e)){var r=new oR((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[hR]=n,!(mR=r.then((function(){}))instanceof n))return!0}return!t&&(lR||dR)&&!vR})),gR={CONSTRUCTOR:yR,REJECTION_EVENT:vR,SUBCLASSING:mR},bR={},CR=ke,SR=TypeError,_R=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw new SR("Bad Promise constructor");t=e,r=n})),this.resolve=CR(t),this.reject=CR(r)};bR.f=function(e){return new _R(e)};var TR,wR,RR=kr,ER=$S,PR=p,kR=x,AR=Ec,LR=qc,xR=Jv,IR=ke,DR=E,OR=q,NR=Ev,MR=QT,VR=ww.set,UR=$w,FR=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}},jR=eR,BR=Ow,WR=hu,GR=tR,ZR=bR,YR="Promise",HR=gR.CONSTRUCTOR,XR=gR.REJECTION_EVENT,KR=WR.getterFor(YR),JR=WR.set,QR=GR&&GR.prototype,zR=GR,qR=QR,$R=PR.TypeError,eE=PR.document,tE=PR.process,rE=ZR.f,nE=rE,iE=!!(eE&&eE.createEvent&&PR.dispatchEvent),oE="unhandledrejection",aE=function(e){var t;return!(!OR(e)||!DR(t=e.then))&&t},sE=function(e,t){var r,n,i,o=t.value,a=1===t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(a||(2===t.rejection&&pE(t),t.rejection=1),!0===s?r=o:(l&&l.enter(),r=s(o),l&&(l.exit(),i=!0)),r===e.promise?u(new $R("Promise-chain cycle")):(n=aE(r))?kR(n,r,c,u):c(r)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},cE=function(e,t){e.notified||(e.notified=!0,UR((function(){for(var r,n=e.reactions;r=n.get();)sE(r,e);e.notified=!1,t&&!e.rejection&&lE(e)})))},uE=function(e,t,r){var n,i;iE?((n=eE.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),PR.dispatchEvent(n)):n={promise:t,reason:r},!XR&&(i=PR["on"+e])?i(n):e===oE&&FR("Unhandled promise rejection",r)},lE=function(e){kR(VR,PR,(function(){var t,r=e.facade,n=e.value;if(dE(e)&&(t=jR((function(){ER?tE.emit("unhandledRejection",n,r):uE(oE,r,n)})),e.rejection=ER||dE(e)?2:1,t.error))throw t.value}))},dE=function(e){return 1!==e.rejection&&!e.parent},pE=function(e){kR(VR,PR,(function(){var t=e.facade;ER?tE.emit("rejectionHandled",t):uE("rejectionhandled",t,e.value)}))},fE=function(e,t,r){return function(n){e(t,n,r)}},hE=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,cE(e,!0))},mE=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new $R("Promise can't be resolved itself");var n=aE(t);n?UR((function(){var r={done:!1};try{kR(n,t,fE(mE,r,e),fE(hE,r,e))}catch(t){hE(r,t,e)}})):(e.value=t,e.state=1,cE(e,!1))}catch(t){hE({done:!1},t,e)}}};HR&&(qR=(zR=function(e){NR(this,qR),IR(e),kR(TR,this);var t=KR(this);try{e(fE(mE,t),fE(hE,t))}catch(e){hE(t,e)}}).prototype,(TR=function(e){JR(this,{type:YR,done:!1,notified:!1,parent:!1,reactions:new BR,rejection:!1,state:0,value:void 0})}).prototype=AR(qR,"then",(function(e,t){var r=KR(this),n=rE(MR(this,zR));return r.parent=!0,n.ok=!DR(e)||e,n.fail=DR(t)&&t,n.domain=ER?tE.domain:void 0,0===r.state?r.reactions.add(n):UR((function(){sE(n,r)})),n.promise})),wR=function(){var e=new TR,t=KR(e);this.promise=e,this.resolve=fE(mE,t),this.reject=fE(hE,t)},ZR.f=rE=function(e){return e===zR||undefined===e?new wR(e):nE(e)}),RR({global:!0,constructor:!0,wrap:!0,forced:HR},{Promise:zR}),LR(zR,YR,!1,!0),xR(YR);var vE=dt("iterator"),yE=!1;try{var gE=0,bE={next:function(){return{done:!!gE++}},return:function(){yE=!0}};bE[vE]=function(){return this},Array.from(bE,(function(){throw 2}))}catch(e){}var CE=tR,SE=function(e,t){try{if(!t&&!yE)return!1}catch(e){return!1}var r=!1;try{var n={};n[vE]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},_E=gR.CONSTRUCTOR||!SE((function(e){CE.all(e).then(void 0,(function(){}))})),TE=x,wE=ke,RE=bR,EE=eR,PE=Tv;kr({target:"Promise",stat:!0,forced:_E},{all:function(e){var t=this,r=RE.f(t),n=r.resolve,i=r.reject,o=EE((function(){var r=wE(t.resolve),o=[],a=0,s=1;PE(e,(function(e){var c=a++,u=!1;s++,TE(r,t,e).then((function(e){u||(u=!0,o[c]=e,--s||n(o))}),i)})),--s||n(o)}));return o.error&&i(o.value),r.promise}});var kE=kr,AE=gR.CONSTRUCTOR;tR&&tR.prototype,kE({target:"Promise",proto:!0,forced:AE,real:!0},{catch:function(e){return this.then(void 0,e)}});var LE=x,xE=ke,IE=bR,DE=eR,OE=Tv;kr({target:"Promise",stat:!0,forced:_E},{race:function(e){var t=this,r=IE.f(t),n=r.reject,i=DE((function(){var i=xE(t.resolve);OE(e,(function(e){LE(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var NE=bR;kr({target:"Promise",stat:!0,forced:gR.CONSTRUCTOR},{reject:function(e){var t=NE.f(this);return(0,t.reject)(e),t.promise}});var ME=rr,VE=q,UE=bR,FE=function(e,t){if(ME(e),VE(t)&&t.constructor===e)return t;var r=UE.f(e);return(0,r.resolve)(t),r.promise},jE=kr,BE=tR,WE=gR.CONSTRUCTOR,GE=FE,ZE=ie("Promise"),YE=!WE;jE({target:"Promise",stat:!0,forced:true},{resolve:function(e){return GE(YE&&this===ZE?BE:this,e)}});var HE=x,XE=ke,KE=bR,JE=eR,QE=Tv;kr({target:"Promise",stat:!0,forced:_E},{allSettled:function(e){var t=this,r=KE.f(t),n=r.resolve,i=r.reject,o=JE((function(){var r=XE(t.resolve),i=[],o=0,a=1;QE(e,(function(e){var s=o++,c=!1;a++,HE(r,t,e).then((function(e){c||(c=!0,i[s]={status:"fulfilled",value:e},--a||n(i))}),(function(e){c||(c=!0,i[s]={status:"rejected",reason:e},--a||n(i))}))})),--a||n(i)}));return o.error&&i(o.value),r.promise}});var zE=x,qE=ke,$E=ie,eP=bR,tP=eR,rP=Tv,nP="No one promise resolved";kr({target:"Promise",stat:!0,forced:_E},{any:function(e){var t=this,r=$E("AggregateError"),n=eP.f(t),i=n.resolve,o=n.reject,a=tP((function(){var n=qE(t.resolve),a=[],s=0,c=1,u=!1;rP(e,(function(e){var l=s++,d=!1;c++,zE(n,t,e).then((function(e){d||u||(u=!0,i(e))}),(function(e){d||u||(d=!0,a[l]=e,--c||o(new r(a,nP)))}))})),--c||o(new r(a,nP))}));return a.error&&o(a.value),n.promise}});var iP=bR;kr({target:"Promise",stat:!0},{withResolvers:function(){var e=iP.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}});var oP=kr,aP=tR,sP=n,cP=ie,uP=E,lP=QT,dP=FE,pP=aP&&aP.prototype;oP({target:"Promise",proto:!0,real:!0,forced:!!aP&&sP((function(){pP.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=lP(this,cP("Promise")),r=uP(e);return this.then(r?function(r){return dP(t,e()).then((function(){return r}))}:e,r?function(r){return dP(t,e()).then((function(){throw r}))}:e)}});var fP=$.Promise,hP=y,mP=Ar,vP=bR,yP=ke,gP=eR;kr({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=mP(arguments,1),r=vP.f(this),n=gP((function(){return hP(yP(e),void 0,t)}));return(n.error?r.reject:r.resolve)(n.value),r.promise}});var bP=fP,CP="\t\n\v\f\r 聽釟€鈥€鈥佲€傗€冣€勨€呪€嗏€団€堚€夆€娾€仧銆€\u2028\u2029\ufeff",SP=X,_P=Mi,TP=CP,wP=u("".replace),RP=RegExp("^["+TP+"]+"),EP=RegExp("(^|[^"+TP+"])["+TP+"]+$"),PP=function(e){return function(t){var r=_P(SP(t));return 1&e&&(r=wP(r,RP,"")),2&e&&(r=wP(r,EP,"$1")),r}},kP={start:PP(1),end:PP(2),trim:PP(3)},AP=p,LP=n,xP=u,IP=Mi,DP=kP.trim,OP=CP,NP=AP.parseInt,MP=AP.Symbol,VP=MP&&MP.iterator,UP=/^[+-]?0x/i,FP=xP(UP.exec),jP=8!==NP(OP+"08")||22!==NP(OP+"0x16")||VP&&!LP((function(){NP(Object(VP))}))?function(e,t){var r=DP(IP(e));return NP(r,t>>>0||(FP(UP,r)?16:10))}:NP;kr({global:!0,forced:parseInt!==jP},{parseInt:jP});var BP=$.parseInt,WP=oo.map;kr({target:"Array",proto:!0,forced:!zn("map")},{map:function(e){return WP(this,e,arguments.length>1?arguments[1]:void 0)}});var GP=Zr("Array","map"),ZP=l,YP=GP,HP=Array.prototype,XP=function(e){var t=e.map;return e===HP||ZP(HP,e)&&t===HP.map?YP:t},KP=Zr("Array","entries"),JP=_n,QP=ze,zP=l,qP=KP,$P=Array.prototype,ek={DOMTokenList:!0,NodeList:!0},tk=function(e){var t=e.entries;return e===$P||zP($P,e)&&t===$P.entries||QP(ek,JP(e))?qP:t},rk=k,nk=zr,ik=TypeError,ok=Object.getOwnPropertyDescriptor,ak=rk&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),sk=we,ck=TypeError,uk=kr,lk=Ke,dk=Ci,pk=tn,fk=sn,hk=ak?function(e,t){if(nk(e)&&!ok(e,"length").writable)throw new ik("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},mk=un,vk=Xn,yk=fn,gk=function(e,t){if(!delete e[t])throw new ck("Cannot delete property "+sk(t)+" of "+sk(e))},bk=zn("splice"),Ck=Math.max,Sk=Math.min;uk({target:"Array",proto:!0,forced:!bk},{splice:function(e,t){var r,n,i,o,a,s,c=lk(this),u=fk(c),l=dk(e,u),d=arguments.length;for(0===d?r=n=0:1===d?(r=0,n=u-l):(r=d-2,n=Sk(Ck(pk(t),0),u-l)),mk(u+r-n),i=vk(c,n),o=0;ou-n+r;o--)gk(c,o-1)}else if(r>n)for(o=u-n;o>l;o--)s=o+r-1,(a=o+n-1)in c?c[s]=c[a]:gk(c,s);for(o=0;o1?arguments[1]:void 0)}});var xk=Zr("Array","find"),Ik=l,Dk=xk,Ok=Array.prototype,Nk=function(e){var t=e.find;return e===Ok||Ik(Ok,e)&&t===Ok.find?Dk:t},Mk={exports:{}};!function(e){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,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,o||e,a),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}jf&&(n.prototype=jf(null),(new n).__proto__||(r=!1)),s.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?oh(n).call(n,1):n);return ah?vi(i).call(i,ah(e)):i},s.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,a=new Array(o);i>>8,r[2*n+1]=a%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>=1}else{for(i=1,n=0;n>=1}0==--d&&(d=Math.pow(2,f),f++),delete s[l]}else for(i=a[l],n=0;n>=1;0==--d&&(d=Math.pow(2,f),f++),a[u]=p++,l=String(c)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(n=0;n>=1}else{for(i=1,n=0;n>=1}0==--d&&(d=Math.pow(2,f),f++),delete s[l]}else for(i=a[l],n=0;n>=1;0==--d&&(d=Math.pow(2,f),f++)}for(i=2,n=0;n>=1;for(;;){if(m<<=1,v==t-1){h.push(r(m));break}v++}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,a,s,c,u,l,d=[],p=4,f=4,h=3,m="",v=[],y={val:n(0),position:r,index:1};for(i=0;i<3;i+=1)d[i]=i;for(a=0,c=Math.pow(2,2),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;switch(a){case 0:for(a=0,c=Math.pow(2,8),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;l=e(a);break;case 1:for(a=0,c=Math.pow(2,16),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;l=e(a);break;case 2:return""}for(d[3]=l,o=l,v.push(l);;){if(y.index>t)return"";for(a=0,c=Math.pow(2,h),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;switch(l=a){case 0:for(a=0,c=Math.pow(2,8),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;d[f++]=e(a),l=f-1,p--;break;case 1:for(a=0,c=Math.pow(2,16),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;d[f++]=e(a),l=f-1,p--;break;case 2:return v.join("")}if(0==p&&(p=Math.pow(2,h),h++),d[l])m=d[l];else{if(l!==f)return null;m=o+o.charAt(0)}v.push(m),d[f++]=o+m.charAt(0),o=m,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)&&fh(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 or}});var e=r(729),t=r.n(e),i="LEBP2PInnerEvent",o="LEBP2PEvent",a={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 s(e,t){var r=vh(e);if(ah){var n=ah(e);t&&(n=ha(n).call(n,(function(t){return Rh(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;tthis.config.detectSensitivity&&(this.stallState=P.STALL,this.emit("stall"))},t.prototype.startTimer=function(){var e=this;this.timer=Uo((function(){e.check()}),this.config.detectSensitivity)},t.prototype.clearTimer=function(){this.timer&&(clearInterval(this.timer),this.timer=null)},t}(e.EventEmitter);function O(e,t){var r=vh(e);if(ah){var n=ah(e);t&&(n=ha(n).call(n,(function(t){return Rh(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t=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=Fo((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 W(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var G=function(e){function t(){for(var t=[],r=0;r0}}),n}return va(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(V.REQUEST).set(1),this.statsVar.loadStartTime=ZS();var r=this.loadFromCdn(this.streamUrl);return r&&this.statsStartStream(r),this.clearP2PTimer(),this.p2pTimer=Uo((function(){t.loadFromP2P()}),5e3),bP.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())return this.reportUnit.string(V.ROLLBACK_REASON).set("".concat(a.ERR_LOAD_REACH_MAX_RETRY)),void Fo((function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:a.ERR_LOAD_REACH_MAX_RETRY,msg:"宸茶揪鏈€澶DN閲嶈瘯娆℃暟: ".concat(t.cdnRetryCtrl.totalRetryTimes)})}));this.cdnRetryCtrl.retry();var r=ge.create(),n=this.subscriber.subscribeLEB({pullStreamUrl:this.config.pullStreamUrl,stopStreamUrl:this.config.stopStreamUrl,streamUrl:e,srcPid:r,param:{uuid:q(),playid:ee()}});return n.on(le,(function(e){var r;"video"===e.track.kind&&t.cdnRetryCtrl.reset(),t.sourceType!==ye.CDN&&(t.sourceType=ye.CDN,null===(r=t.bus)||void 0===r||r.emit(o,{code:a.INF_PLAY_EVT_STREAM_SWITCH,msg:"鍒囨崲鍒癈DN鎷夋祦",data:{source:"CDN"}})),t.onNewSourceTrack(e)})).once(de,(function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:a.INF_PLAY_EVT_SERVER_CONNECTED,msg:"宸茬粡杩炴帴鍒癱dn鏈嶅姟鍣�"})})).once(ue,(function(){var e;t.reloadCDNAsync({from:"cdn",reason:"".concat(r,"-DISCONNECT")}),null===(e=t.bus)||void 0===e||e.emit(o,{code:a.INF_PLAY_EVT_SERVER_RECONNECT,msg:"杩炴帴cdn鏈嶅姟鍣ㄥけ璐ワ紝宸插惎鍔ㄨ嚜鍔ㄩ噸杩炴仮澶�"})})).once(fe,(function(){t.reloadCDNAsync({from:"cdn",reason:"".concat(r,"-FAILED")})})).once(pe,(function(e){t.reloadCDNAsync({from:"cdn",reason:"".concat(r,"-ERROR")})})).once(se,(function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:a.INF_PLAY_EVT_STREAM_CLOSED,msg:"娴佽鍏抽棴浜�"})})),n},t.prototype.loadFromP2P=function(e){var t=this;if(this.subscriber){var r=this.subscriber.subscribeP2P(e);return r?(r.on(le,(function(e){var r;t.sourceType!==ye.P2P&&(t.sourceType=ye.P2P,null===(r=t.bus)||void 0===r||r.emit(o,{code:a.INF_PLAY_EVT_STREAM_SWITCH,msg:"鍒囨崲鍒癙2P鎷夋祦",data:{source:"P2P"}})),t.onNewSourceTrack(e)})).once(ue,(function(){t.reloadCDNAsync({from:"p2p",reason:"p2p-DISCONNECT"})})).once(he,(function(){t.reloadCDNAsync({from:"p2p",reason:"p2p-STUCK"})})).once(se,(function(){})),r):void 0}},t.prototype.onNewSourceTrack=function(e){var t=this;return new bP((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,n=e.reason;"p2p"===r&&(this.reportUnit.number(V.BACK_CDN_STREAM).plus(1),this.reportUnit.string(V.BACK_CDN_STREAM_REASON).set(n));var i="p2p"===r?0:this.cdnRetryCtrl.retryDelay;Fo((function(){t.loadFromCdn(t.streamUrl)}),i)},t.prototype.statsStartStream=function(e){var t=this;e.on(ce,(function(){t.statsVar.loadok||t.reportUnit.string(V.ROLLBACK_REASON).set("".concat(a.ERR_LOAD_TIMEOUT)),Fo((function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:a.ERR_LOAD_TIMEOUT,msg:"鎷夋祦瓒呮椂"})}))})).on(le,(function(e){"video"===e.track.kind&&(t.statsVar.loadok||(t.reportUnit.number(V.LOAD_OK_TIME).set(ZS()-t.statsVar.loadStartTime),t.statsVar.loadok=!0))})).on(i,(function(e){var r;e.code>=1e3&&e.code<2e3&&t.reportUnit.string(V.ROLLBACK_REASON).set("".concat(e.code)),null===(r=t.bus)||void 0===r||r.emit(o,e)}))},t.prototype.clearP2PTimer=function(){this.p2pTimer&&(clearInterval(this.p2pTimer),this.p2pTimer=null)},t}(A);function Ce(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Se=function(e){function t(){for(var t,r=[],n=0;n1?t[1]:null}))).call(t,(function(e){return null!==e})),o=[];return go(r).call(r,(function(e){var t=e;if(zi(e).call(e,"a=fmtp:111")&&(t="".concat(e,";stereo=1")),zi(e).call(e,"a=fmtp")){var r=/a=fmtp:(\d+)\s/.exec(e);r&&r.length>1&&zi(i).call(i,r[1])&&(t="".concat(e,";sps-pps-idr-in-keyframe=1"))}o.push(t)})),o.join("\r\n")}(e.sdp||""),t.rtcPC.setLocalDescription(e)})).then((function(){return t.rtcPC.localDescription})).catch((function(t){return bP.reject({code:a.ERR_PLAY_WEBRTC_FAIL,msg:"createOffer fail, offer: ".concat(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 bP.reject({code:a.ERR_PLAY_WEBRTC_FAIL,msg:"setRemoteDescription fail, answer: ".concat(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}(A);function He(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(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;re.targetPid},enumerable:!1,configurable:!0}),fh(t.prototype,"readyForOffer",{get:function(){return!this.makingOffer&&("stable"===this.pc.rtcPC.signalingState||this.isSettingRemoteAnswerPending)},enumerable:!1,configurable:!0}),fh(t.prototype,"offerCollision",{get:function(){return!this.readyForOffer},enumerable:!1,configurable:!0}),fh(t.prototype,"ignoreOffer",{get:function(){return!this.politeRole&&this.offerCollision},enumerable:!1,configurable:!0}),t}(A);function Qe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ze=0,qe=function(e){function t(t,r){var n,i=this;return Qe(i=e.call(this)||this,"tagName","LEBConnection"),Qe(i,"pc",void 0),Qe(i,"initConfig",void 0),Qe(i,"svrSig",""),Qe(i,"closed",!1),Qe(i,"sessionId",ZS()),Qe(i,"destroyed",!1),i.initConfig=t,i.tagName=vi(n="".concat(i.tagName,"_")).call(n,i.initConfig.srcPid),i.pc=new Ye({pid:t.srcPid},r),i.pc.rtcPC.onconnectionstatechange=function(){var e=i.pc.rtcPC.connectionState;i.emit(e)},i.pc.rtcPC.oniceconnectionstatechange=function(){i.pc.rtcPC.connectionState},i}return va(t,e),fh(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 ba(this,void 0,void 0,(function(){var e,t,r,n,o;return Ca(this,(function(s){switch(s.label){case 0:e={offerToReceiveAudio:!0,offerToReceiveVideo:!0,voiceActivityDetection:!1},s.label=1;case 1:return s.trys.push([1,7,,8]),[4,this.pc.createOffer(e)];case 2:return t=s.sent(),this.emit(i,{code:a.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=s.sent(),[3,6];case 4:return[4,this.fetchStream(t)];case 5:n=s.sent(),s.label=6;case 6:return r=n,this.svrSig=r.svrsig,this.emit(i,{code:a.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=s.sent(),this.emit(i,o),this.emit("error",{errcode:0,errmsg:"leb pull stream fetch error: ".concat(o)}),[3,8];case 8:return[2]}}))}))},t.prototype.fetchStream=function(e){return ba(this,void 0,void 0,(function(){var t,r,n,i;return Ca(this,(function(o){var s,c,u,l,d;switch(o.label){case 0:t={streamurl:"".concat(this.initConfig.streamUrl),sessionid:this.sessionId,clientinfo:this.initConfig.param.uuid,localsdp:e,seipass:1},r=vi(s=vi(c=vi(u=vi(l=vi(d="".concat(this.initConfig.pullStreamUrl,"?from=")).call(d,this.initConfig.srcPid,"&uuid=")).call(l,this.initConfig.param.uuid,"&playid=")).call(u,this.initConfig.param.playid,"&sessionid=")).call(c,this.sessionId,"&reqCounter=")).call(s,ze+=1),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(r,{method:"POST",body:nT(t),headers:{"Content-Type":"application/json"}})];case 2:return[4,o.sent().json()];case 3:return[2,(n=o.sent()).errcode||!n.svrsig?bP.reject({code:a.ERR_PLAY_REQUEST_PULL_FAIL,msg:"鎷夋祦鎺モ紳鍚庡彴杩斿洖鎶ラ敊",data:n}):n];case 4:return i=o.sent(),[2,bP.reject({code:a.ERR_FETCH_REQUEST_FAIL,msg:"鎷夋祦鎺モ紳缃戠粶寮傚父",data:{from:"PULL_STREAM",url:r,error:i}})];case 5:return[2]}}))}))},t.prototype.fetchStreamSdp=function(e){return ba(this,void 0,void 0,(function(){var t,r,n,i,o,s,c,u;return Ca(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:nT(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,s=n.remoteSdp,c=n.svrsig,200!==i?[2,bP.reject({code:a.ERR_PLAY_REQUEST_PULL_FAIL,msg:"鎷夋祦鎺モ紳鍚庡彴杩斿洖鎶ラ敊",data:n})]:[2,{remotesdp:s,svrsig:c,errcode:0,errmsg:o}];case 4:return u=l.sent(),[2,bP.reject({code:a.ERR_FETCH_REQUEST_FAIL,msg:"鎷夋祦鎺モ紳缃戠粶寮傚父",data:{from:"PULL_STREAM",url:this.initConfig.streamUrl,error:u}})];case 5:return[2]}}))}))},t.prototype.close=function(){return ba(this,void 0,void 0,(function(){return Ca(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 ba(this,void 0,void 0,(function(){var e,t,r;return Ca(this,(function(n){var o,s;switch(n.label){case 0:if(this.isSdpStreamUrl&&!this.svrSig)return[2];e={streamurl:this.initConfig.streamUrl,svrsig:this.svrSig},t=vi(o="".concat(this.initConfig.stopStreamUrl,"?from=")).call(o,this.initConfig.srcPid),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(t,{method:"post",body:nT(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:vi(s="leb stop stream response error: errcode: ".concat(r.errcode,", errmsg: ")).call(s,r.errmsg)}),this.emit(i,{code:a.ERR_PLAY_REQUEST_STOP_FAIL,msg:"鍋滄祦鎺モ紳鍚庡彴杩斿洖鎶ラ敊",data:{url:t}})),[3,5];case 4:return n.sent(),this.emit(i,{code:a.ERR_FETCH_REQUEST_FAIL,msg:"鍋滄祦鎺モ紳缃戠粶寮傚父",data:{from:"STOP_STREAM",url:t}}),[3,5];case 5:return[2]}}))}))},t}(A);function $e(e,t){var r=vh(e);if(ah){var n=ah(e);t&&(n=ha(n).call(n,(function(t){return Rh(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;tthis.config.maxConnecting)){var e=this.config.maxConnected-this.connected.size;if(e)for(var t,r=tk(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("conn_try").plus(1),this.reportUnit.number("conn_try_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=Sa(this.connected),i=n.next();!i.done;i=n.next()){var o=_a(i.value,2),a=o[0],s=o[1];if(!zi(e).call(e,a))return s}}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),Fo((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=Fo((function(){t.reportUnit.number("init_pc_timeout").plus(1),r()}),1e4),i=e.getConnection();i.on("connected",(function(){t.reportUnit.number("conn_succ").plus(1),t.reportUnit.number("conn_succ_total").plus(1),clearTimeout(n),t.connecting.delete(e.pid),t.connected.set(e.pid,e)})),i.on("closed",(function(){clearTimeout(n),r()})),i.on("disconnected",(function(){r()})),i.on("failed",(function(){r()}))},t.prototype.clearTimer=function(){this.tickTimer&&(clearTimeout(this.tickTimer),this.tickTimer=null)},t}(A);function ut(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var lt=function(e){function t(){for(var t=[],r=0;r((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?Ta([],_a(this.peers),!1)[this.peers.size-1]:null},e.prototype.getOldestPid=function(){return this.peers.size?Ta([],_a(this.peers),!1)[0]:null},e}();function mt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var vt=function(){function e(){mt(this,"path","signal"),mt(this,"peerManager",null),mt(this,"peerBuilder",null),mt(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 yt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var gt=function(){function e(){yt(this,"path","SubscribeTrack"),yt(this,"server",null),yt(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 bt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ct,St=function(e){function t(){for(var t=[],r=0;rthis.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:Ek(t=this.chunks).call(t,0,r-e)},t.prototype.dropOutdateChunk=function(e){for(var t=this.getHead();t&&t.timestamp1&&s.driverTrack.writeVideoFrameToTrack({timestamp:0}),s.driverTrack.writeVideoFrameToTrack({timestamp:0})}),30);var u=t.getTransceivers();try{for(var l=Sa(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(At("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,m=t.getSenders(),v=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(!s.videoEncodedFrameCache)throw Error("provideVideoTrack missing param");if(!r){var n=1;s.videoEncodedFrameCache.remove(n),r=!0}var i=s.videoEncodedFrameCache.shift();i&&(e.data=Tt.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=s.statUnit)||void 0===r||r.number("uploadBytes").plus(e.data.byteLength),null===(n=s.statUnit)||void 0===n||n.number("uploadVideoBytes").plus(e.data.byteLength),s.reportUnit.number(V.UPLOAD_BYTES).plus(e.data.byteLength),t.enqueue(e)}})).pipeTo(t.writable,{signal:y.videoAbortController.signal}).catch((function(e){})),"break"},y=this;try{for(var g=Sa(m),b=g.next();!b.done&&"break"!==v(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}(A);function xt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var It=function(){function e(){xt(this,"config",null),xt(this,"coolingPeers",new pC)}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),Fo((function(){r.coolingPeers.delete(e)}),null===(t=this.config)||void 0===t?void 0:t.coolingTime)},e.prototype.getList=function(){return Ta([],_a(this.coolingPeers),!1)},e}();function Dt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ot,Nt=function(){function e(){Dt(this,"lastWriteAudioTimestamp",0),Dt(this,"lastWriteVideoTimestamp",0),Dt(this,"p2pVideoRecvEnough",!1),Dt(this,"_prepareToStopCdn",!1),Dt(this,"_cdnStoppingReady",!1),Dt(this,"_lastestCdnKeyTimestamp",0),Dt(this,"_lastRecvCdnVideoTimestamp",0),Dt(this,"_lastRecvCdnAudioTimestamp",0)}return fh(e.prototype,"lastRecvCdnVideoTimestamp",{get:function(){return this._lastRecvCdnVideoTimestamp},set:function(e){this._lastRecvCdnVideoTimestamp=e},enumerable:!1,configurable:!0}),fh(e.prototype,"lastRecvCdnAudioTimestamp",{get:function(){return this._lastRecvCdnAudioTimestamp},set:function(e){this._lastRecvCdnAudioTimestamp=e},enumerable:!1,configurable:!0}),fh(e.prototype,"prepareToStopCdn",{get:function(){return this._prepareToStopCdn},set:function(e){this._prepareToStopCdn=e},enumerable:!1,configurable:!0}),fh(e.prototype,"cdnStoppingReady",{get:function(){return this._cdnStoppingReady},set:function(e){this._cdnStoppingReady=e},enumerable:!1,configurable:!0}),fh(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 Mt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(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"}(Ot||(Ot={}));var Vt=function(){function e(){Mt(this,"cnt",0),Mt(this,"frameRateRecords",[]),Mt(this,"config",{maxFrameRateRecordsLen:10}),Mt(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===Ot.smooth?this.smooth(this.frameRateRecords):e===Ot.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=Uo((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=oh(e).call(e,3);return Math.floor(o_(t).call(t,(function(e,t){return e+t}))/t.length)},e.prototype.recentAvg=function(e){if(e.length<3)return null;var t=oh(e).call(e,e.length-3);return Math.floor(o_(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 Ut(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ft=function(){function e(){Ut(this,"audioClockRate",0),Ut(this,"videoClockRate",0),Ut(this,"videoMimeType",""),Ut(this,"audioMimeType",""),Ut(this,"frameRate",new Vt)}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;go(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=Sa(e),o=i.next();!o.done;o=i.next()){var a,s,c=o.value,u=Nk(c).call(c,(function(e){return"codec"===e.type}));u&&"number"==typeof u.clockRate&&(ca(a=u.mimeType).call(a,"audio")?(t.audioClockRate=u.clockRate,t.audioMimeType=u.mimeType):ca(s=u.mimeType).call(s,"video")&&(t.videoClockRate=u.clockRate,t.videoMimeType=u.mimeType))}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}))},e}();function jt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uf(e)||null===e)return e;var r=e[Zh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:String(t)}(t))in e?fh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Bt=function(e){function t(){for(var t=[],r=0;r5&&!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,a=o.videoClockRate,s=o.audioClockRate,c=i/s-n/a;return r.syncController.lastWriteAudioTimestamp/s-c=r&&BP(n[r],10)},vA=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 a=Sa(o),s=a.next();!s.done;s=a.next()){var c=_a(s.value.split("="),2),u=c[0],l=c[1];if(u===t)return l}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}return null},yA=function(e,t,r){var n,i,o=/^(?:webrtc:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)(?:[^?#]*)(?:\?*)([^?#]*)/.exec(e);if(o){var a,s,c=o[1],u=[],l=vi(a="".concat(t,"=")).call(a,r);try{for(var d=Sa(c.split("&")),p=d.next();!p.done;p=d.next()){var f,h=_a(p.value.split("="),2),m=h[0],v=h[1];if(m===t)null!==r&&u.push(l);else u.push(vi(f="".concat(m,"=")).call(f,v))}}catch(e){n={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}return null===r||zi(u).call(u,l)||u.push(l),vi(s="".concat(e.replace(c,""))).call(s,u.join("&"))}return e},gA={},bA=[["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"]],CA=bA[0];try{for(var SA=Sa(bA),_A=SA.next();!_A.done;_A=SA.next()){var TA=_A.value;if(TA[1]in document){rA=TA;break}}}catch(e){eA={error:e}}finally{try{_A&&!_A.done&&(tA=SA.return)&&tA.call(SA)}finally{if(eA)throw eA.error}}if(rA)for(var wA=0;wA1?t[1]:null}))).call(t,(function(e){return null!==e})),o=[];return go(r).call(r,(function(e){var t=e;if(zi(e).call(e,"a=fmtp:111")&&(t="".concat(e,";stereo=1")),zi(e).call(e,"a=fmtp")){var r=/a=fmtp:(\d+)\s/.exec(e);r&&r.length>1&&zi(i).call(i,r[1])&&(t="".concat(e,";sps-pps-idr-in-keyframe=1"))}o.push(t)})),function(e){var t;if(!sA)return e;var r=e.split("\r\n"),n=[],i=[];go(r).call(r,(function(e){var t=e.toLowerCase();zi(t).call(t,"a=rtpmap")&&zi(t).call(t,"h264")&&n.push(e)})),n.length>1&&i.push.apply(i,Ta([],_a(oh(n).call(n,1)),!1));var o=ha(t=XP(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})),a=[];return go(r).call(r,(function(e){var t,r=e;if(zi(e).call(e,"a=setup")&&(r="a=setup:passive"),(zi(e).call(e,"m=audio")||zi(e).call(e,"m=video"))&&(r=ha(t=e.split(" ")).call(t,(function(e,t){return t<3||!zi(o).call(o,e)})).join(" ")),zi(e).call(e,"a=fmtp")||zi(e).call(e,"a=rtcp-fb")||zi(e).call(e,"a=rtpmap")){var n=/a=(?:fmtp|rtcp-fb|rtpmap):(\d+)\s/.exec(e);if(n&&n.length>1&&zi(o).call(o,n[1]))return}a.push(r)})),a.join("\r\n")}(o.join("\r\n"))},kA=function(e){var t,r,n="",i="";return go(t=e.split("\r\n")).call(t,(function(e){var t=/(?:a=ice-ufrag:)(.+)/.exec(e);if(t)n=t[1];else{var r=/(?:a=ice-pwd:)(.+)/.exec(e);r&&(i=r[1])}})),vi(r="".concat(n,"_")).call(r,i)};kr({target:"Array",stat:!0},{isArray:zr});var AA=$.Array.isArray,LA=Zr("Array","keys"),xA=_n,IA=ze,DA=l,OA=LA,NA=Array.prototype,MA={DOMTokenList:!0,NodeList:!0},VA=function(e){var t=e.keys;return e===NA||DA(NA,e)&&t===NA.keys||IA(MA,xA(e))?OA:t},UA={exports:{}},FA={};Object.defineProperty(FA,"__esModule",{value:!0});var jA=function(e){this.bitReservoir=e,this.originalBitReservoir=e};FA.ExpGolombDecoder=jA,jA.prototype.byteAlign=function(){var e=8*Math.ceil((this.originalBitReservoir.length-this.bitReservoir.length)/8),t=this.originalBitReservoir.length-e,r=this.bitReservoir.length-t;return this.readRawBits(r)},jA.prototype.countLeadingZeros=function(){for(var e=0;e1&&(n=t.slice(1).map(parseFloat)),{propertyName:r,indexArray:n}};var XA={};Object.defineProperty(XA,"__esModule",{value:!0});XA.getProperty=function(e,t,r,n){var i=e[r]||t[r];return n.length?n.reduce((function(e,t){return Array.isArray(e)||Object.isObject(e)?e[t]:e}),i):i};XA.writeProperty=function(e,t,r,n,i){var o=e[r]||t[r],a=n[n.length-1];if(!o){if(!n.length)return void(e[r]=i);o=e[r]=[]}n.slice(0,-1).reduce((function(e,t){return e[t],Array.isArray(e[t])||(e[t]=[]),e[t]}),o)[a]=i};XA.indexArrayMerge=function(e,t){return e.slice(-t.length).map((function(e,r){return isNaN(t[r])?e:t[r]}))},Object.defineProperty(WA,"__esModule",{value:!0});var KA=FA,JA=GA,QA=YA,zA=HA,qA=XA,$A=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;nt||r[n]>t}};eL.not=function(e){return function(t,r,n){return!e(t,r,n)}};eL.some=function(e){return function(t,r,n){return e.some((function(e){return e(t,r,n)}))}};eL.every=function(e){return function(t,r,n){return e.every((function(e){return e(t,r,n)}))}};eL.whenMoreData=function(){for(var e=arguments.length,t=Array(e),r=0;r255;)l-=255,t.writeUnsignedByte(255);t.writeUnsignedByte(l);for(var d=c.payloadSize;d>255;)d-=255,t.writeUnsignedByte(255);t.writeUnsignedByte(d);var p=u[c.payloadType];if(p&&p.codec){var f=new r.ExpGolombEncoder;p.codec.encode({expGolomb:f,input:c,options:i,path:a,indexes:o});var h=f.bitReservoir;h.length%8!=0&&(h=(0,s.appendRBSPTrailingBits)(h)),t.writeRawBits(8*c.payloadSize,h)}else c.data?t.writeRawBits(8*c.payloadSize,(0,s.typedArrayToBitString)(c.data)):t.writeRawBits(8*c.payloadSize,"")}},d=(0,n.startArray)("sei_message",(0,o.whileMoreData)(l));t.default=d,e.exports=t.default}(UA,UA.exports);var oL=r(UA.exports),aL=function(e){return oL.decode(e)},sL=function(){function e(){this.isLoggingEnabled=!1}return e.prototype.log=function(){for(var e=[],t=0;t0&&0===t.getUint8(n-1)?4:3)?n:n-1;r.push({startOffset:i,startCodeSize:c}),n+=2}for(var o=[],a=0;a0){var a,s=o[0].rtpTimestamp,c=Ta([],_a(VA(a=this.seiDataMap).call(a)),!1);go(c).call(c,(function(e){var r=90*n,i=s-e;if(i>=0&&i<=r){var o=t.seiDataMap.get(e)||[];go(o).call(o,(function(e){var r;null===(r=t.onReceiveSEI)||void 0===r||r.call(t,e)})),t.seiDataMap.delete(e)}else i>r&&t.seiDataMap.delete(e)}))}}this.ticker.tick(this.handleSeiData)}else cL.log("sei data handler stop")},e}(),yL=xd.PROPER,gL=n,bL=CP,CL=kP.trim;kr({target:"String",proto:!0,forced:function(e){return gL((function(){return!!bL[e]()||"鈥嬄呩爭"!=="鈥嬄呩爭"[e]()||yL&&bL[e].name!==e}))}("trim")},{trim:function(){return CL(this)}});var SL=Zr("String","trim"),_L=l,TL=SL,wL=String.prototype,RL=function(e){var t=e.trim;return"string"==typeof e||e===wL||_L(wL,e)&&t===wL.trim?TL:t},EL=function(){function e(){this.timeMark=null,this.commonData=null,this.reportData=null,this.tempData=null,this.onReport=null,this.timeMark=new jS,this.commonData={},this.initCommonData(),this.reportData=ya({},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=ya({},this.commonData)},e.prototype.setHandler=function(e){this.onReport=e},e.prototype.markTime=function(e){this.timeMark.set(e,(new Date).getTime())},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 jS,this.commonData={},this.initCommonData(),this.reportData=ya({},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,t;this.commonData.str_app_version="TXLivePlayer-".concat(Hk),this.commonData.bytes_version="TXLivePlayer-".concat(Hk);var r=window.navigator.userAgent,n=xs.parse(r),i=n.platform,o=n.os,a=n.browser;this.commonData.str_device_type=i.model||i.vendor||"",this.commonData.str_os_info=RL(e=vi(t="".concat(o.name||""," ")).call(t,o.version||"")).call(e),this.commonData.str_browser_model=a.name||"",this.commonData.str_browser_version=a.version||"",this.commonData.str_user_agent=r,this.commonData.u32_link_type=4,this.commonData.u32_channel_type=3},e}(),PL=function(e,t){for(var r=[],n=2;nl&&this.fetchSignalDomain(e,Jk[0]),void(this.baseUrl=vi(c="".concat(n,"://")).call(c,u))}}this.baseUrl=i?vi(t="".concat(n,"://")).call(t,i):"",this.fetchSignalDomain(e,Jk[0])}else{var d;this.baseUrl=i?vi(d="".concat(n,"://")).call(d,i):""}},e.prototype.getSignalDomain=function(){return this.baseUrl},e.prototype.fetchSignalDomain=function(e,t){return ba(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,l;return Ca(this,(function(d){switch(d.label){case 0:if(!e||!t)return[2];r="https://".concat(t,"/signal_query"),d.label=1;case 1:return d.trys.push([1,3,,4]),[4,PL(r,{domain:e,requestid:As(16),client_type:"Web",client_info:window.navigator.userAgent})];case 2:if(n=d.sent(),i=n.errcode,o=n.data,0===i){a=o.signal_domain,s=o.cache_time,c={},(u=window.localStorage.getItem(Kk))&&(c=JSON.parse(u)),c[e]={signal:a,expire:(new Date).getTime()+1e3*s};try{window.localStorage.setItem(Kk,nT(c))}catch(e){}}return[3,4];case 3:return d.sent(),-1!==(l=Jo(Jk).call(Jk,t))&&this.fetchSignalDomain(e,Jk[l+1]),[3,4];case 4:return[2]}}))}))},e}(),AL=window.LEBP2P||Yk,LL=function(){function e(){var e,t,r,n,i,o,a,s,c,u,l;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,disconnectTimeout:null,statsInterval:null,reportInterval:null},this.connectTimeout=3,this.connectRetry={maxNum:1,curNum:0,delay:1,playing:!1},this.streamDecodeFail={maxNum:3,curNum:0},this.streamReceiveFail={maxNum:5,curNum:0},this.streamPlaying={threshold:5,status:Bk.INIT},this.docOrigOverflow=null,this.receiveConfig={video:!0,audio:!0},this.seiConfig={enable:!1,fallback:!1,maxDelayTime:100},this.listener={onPlayEvent:null,onPlayStats:null,onPlayReport:null,onPlaySEI: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 EL,this.signal=new kL,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(a=this.onBeforeUnload).call(a,this),this.onPagehide=Jr(s=this.onPagehide).call(s,this),this.onP2PEvent=Jr(c=this.onP2PEvent).call(c,this),this.onReceiveSEI=Jr(u=this.onReceiveSEI).call(u,this),window.addEventListener("beforeunload",this.onBeforeUnload),window.addEventListener("pagehide",this.onPagehide);var d=ks.browserDetails,p=d.browser,f=d.version;cL.log(vi(l="browser is ".concat(p,", version is ")).call(l,f))}return e.checkSupport=function(e){ba(void 0,void 0,void 0,(function(){var e,t,r;return Ca(this,(function(n){var i;switch(n.label){case 0:return e=!1,go(i=["RTCPeerConnection","webkitRTCPeerConnection"]).call(i,(function(t){e||t in window&&(e=!0)})),oA||(cA&&lA||uA&&lA&&(0===(t=pA()).length||t[0]<11||11===t[0]&&t[1]<1||11===t[0]&&1===t[1]&&t[2]<2))&&(e=!1),[4,ba(void 0,void 0,void 0,(function(){var e,t,r,n;return Ca(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=Jo(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:oA,tbsVersion:oA?mA(navigator.userAgent,nA,1):null,isFirefox:aA,isSafari:uA,isIOS:lA,iOSVersion:lA?pA().join("."):null,h264Support:r}]}}))})).then((function(t){var r=t.support,n=t.h264Support;null==e||e({support:r,h264Support:n,p2pSupport:AL.support()})}))},e.prototype.setConfig=function(e){var t=e.connectRetryCount,r=e.connectRetryDelay,n=e.connectTimeout,i=e.receiveVideo,o=e.receiveAudio,a=e.receiveSEI,s=e.showLog,c=e.p2pEnable,u=e.p2pConfig,l=e.signalDomain,d=e.signalTimeout,p=e.maxDecodeFailCount,f=e.maxReceiveFailCount,h=e.minDecodeFramerate;if(void 0!==t&&("number"==typeof t&&t>=0?this.connectRetry.maxNum=t:cL.warn("connectRetryCount must be a number greater than or equal to 0")),void 0!==r&&("number"==typeof r&&r>=0?this.connectRetry.delay=r:cL.warn("connectRetryDelay must be a number greater than or equal to 0")),void 0!==n&&("number"==typeof n&&n>=0?this.connectTimeout=n:cL.warn("connectTimeout must be a number greater than or equal to 0")),void 0!==i&&(this.receiveConfig.video=!!i),void 0!==o&&(this.receiveConfig.audio=!!o),void 0!==a)if("boolean"==typeof a)this.seiConfig={enable:a,fallback:!1,maxDelayTime:100};else{var m=null!=a?a:{},v=m.fallback,y=void 0!==v&&v,g=m.maxDelayTime,b=void 0===g?100:g;this.seiConfig={enable:!0,fallback:y,maxDelayTime:b}}if(void 0!==s&&cL.enableLogging(!!s),void 0!==c&&(this.p2pMode.enable=!!c),void 0!==u){var C=null!=u?u:{},S=C.cloudAppid,_=C.appKey,T=C.appSecret,w=C.xp2pAppid,R=C.xp2pDomain;this.p2pMode.config=ya(ya({},this.p2pMode.config),{cloudAppid:S,appKey:_,appSecret:T,xp2pAppid:w,xp2pDomain:R})}if(void 0!==l)if("string"==typeof l)this.signal.setSignalConfig({domain:l});else{var E,P=null!=l?l:{},k=P.protocol,A=P.domain,L=P.query;this.signal.setSignalConfig({protocol:zi(E=["https","http"]).call(E,k)?k:"https",domain:A,query:L})}void 0!==d&&("number"==typeof d&&d>=0?this.signal.setSignalConfig({timeout:d}):cL.warn("signalTimeout must be a number greater than or equal to 0")),void 0!==p&&("number"==typeof p&&p>=0?this.streamDecodeFail.maxNum=p:cL.warn("maxDecodeFailCount must be a number greater than or equal to 0")),void 0!==f&&("number"==typeof f&&f>=0?this.streamReceiveFail.maxNum=f:cL.warn("maxReceiveFailCount must be a number greater than or equal to 0")),void 0!==h&&("number"==typeof h&&h>=0?this.streamPlaying.threshold=h:cL.warn("minDecodeFramerate must be a number greater than or equal to 0"))},e.prototype.setPlayListener=function(e){var t=this,r=["onPlayEvent","onPlayStats","onPlayReport","onPlaySEI"];go(r).call(r,(function(r){var n=e[r];void 0!==n&&("function"==typeof n?(t.listener[r]=n,"onPlayReport"===r&&t.report.setHandler(n)):cL.warn("".concat(r," must be function")))}))},e.prototype.setPlayerView=function(e){if(this.playerView)cL.warn("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",Qk),t.appendChild(r),this.playerView=r}else cL.warn("Require container element id or HTMLDivElement")}},e.prototype.startPlay=function(e){var t,r,n,i,o=this;if(this.playerView){var a=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!==a)if(this.isVideoExisted)cL.warn("Video is existed, please stop playing first");else if(this.receiveConfig.video||this.receiveConfig.audio){var s=(new Date).getTime();this.report.clearData(),this.report.setData("u64_timestamp",s),this.report.setTempData("pull_start_time",s),this.report.markTime("pull_start"),this.report.setData("bytes_stream_id",a,!0),this.report.setData("str_stream_url",e,!0);var c=function(e){var t=/^(?:webrtc:\/\/)([0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)(?:[^?#]*)(?:\?*)(?:[^?#]*)/.exec(e);return t?t[1]:null}(e);if(this.signal.updateSignalDomain(c),this.rawUrl=e,this.playUrl=function(e){var t=vA(e,"tabr_bitrates"),r=vA(e,"tabr_start_bitrate"),n=vA(e,"tabr_control"),i=e;return t&&r&&(i=yA(i,"tabr_control",null),i=yA(i,"webrtc_tabr_level","auto"===n?"server_control":"client_control")),i}(e),this.streamReceiveFail.curNum=0,this.streamDecodeFail.curNum=0,this.streamPlaying.status=Bk.INIT,this.abrClient.seq=0,this.p2pMode.source="",this.p2pMode.enable){if(this.p2pConnection)return void cL.warn("p2p connection is existed, please stop playing first");if(AL.support()&&this.receiveConfig.video&&this.receiveConfig.audio&&!function(e){var t=vA(e,"tabr_bitrates"),r=vA(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,Wk.PLAY_EVT_P2P_START_SUCCESS);var u=this.signal.getSignalDomain();return this.p2pConnection=AL.create(ya(ya({},this.p2pMode.config),{connectRetryCount:this.connectRetry.maxNum,connectRetryDelay:1e3*this.connectRetry.delay,pullStreamDomain:u,stopStreamDomain:u})),this.p2pConnection.on(AL.Event,this.onP2PEvent),void this.p2pConnection.load(this.playUrl).then((function(e){var t=e.srcObject;o.stream=t,o.onAddStream(o.stream)}))}cL.error("p2p mode start failed"),null===(i=(n=this.listener).onPlayEvent)||void 0===i||i.call(n,Wk.PLAY_ERR_P2P_START_FAIL)}this.report.setData("u32_isp2p",0,!0),this.webrtcConnection||(this.webrtcConnection=new vL,this.webrtcConnection.init({onAddTrack:this.onAddTrack,onSetLocalDescription:this.onSetLocalDescription,onConnect:this.onConnect,onDisconnect:this.onDisconnect,onError:this.onError,onReceiveSEI:this.onReceiveSEI})),this.webrtcConnection.initWebRTCConnect({config:{connection:{isReceiveSEI:this.seiConfig.enable&&this.receiveConfig.video,isCreateSEIDataChannel:this.seiConfig.fallback,maxSEIDelayTime:this.seiConfig.maxDelayTime},offer:{offerToReceiveVideo:this.receiveConfig.video,offerToReceiveAudio:this.receiveConfig.audio}}})}else cL.warn("Both receiveVideo and receiveAudio are false");else cL.warn("Play url is not correct")}else cL.warn("Please set player view first")},e.prototype.stopPlay=function(){return ba(this,arguments,void 0,(function(e){var t,r,n;return void 0===e&&(e=!0),Ca(this,(function(i){switch(i.label){case 0:return this.isVideoExisted?(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.timer.reportInterval&&(window.clearInterval(this.timer.reportInterval),this.timer.reportInterval=null),this.playUrl&&this.svrSig&&(this.signal.fetchStopStream({streamurl:this.playUrl,svrsig:this.svrSig}).catch((function(e){cL.warn("request stopStream error,",e)})),this.playUrl=null,this.svrSig=null),[4,this.startReport("stop")]):(cL.warn("Video is not existed"),[2]);case 1:var o;if(i.sent(),this.p2pConnection?(this.p2pConnection.destroy(),this.p2pConnection=null):this.webrtcConnection.disconnect(),e)null===(t=this.stream)||void 0===t||go(o=t.getTracks()).call(o,(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,Wk.PLAY_EVT_PLAY_STOP),[2]}}))}))},e.prototype.switchStream=function(e){return ba(this,void 0,void 0,(function(){var t,r,n,i,o;return Ca(this,(function(a){switch(a.label){case 0:if(s=this.rawUrl,c=e,u=function(e){var t=vA(e,"tabr_bitrates"),r=vA(e,"tabr_start_bitrate"),n=vA(e,"tabr_control");return!(!t||!r||"auto"===n)},!u(s)||!u(c)||yA(s,"tabr_start_bitrate",null)!==yA(c,"tabr_start_bitrate",null))return[3,5];if(!this.svrSig)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),t=vA(e,"tabr_start_bitrate"),cL.log("abr control: switch ".concat(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=a.sent().seq,this.abrClient.seq=Math.max(this.abrClient.seq,r),this.abrClient.curBitrate=t,[3,4];case 3:return n=a.sent(),cL.error("abr control switch failed",n),null===(o=(i=this.listener).onPlayEvent)||void 0===o||o.call(i,Wk.PLAY_ERR_REQUEST_ABR_FAIL,{message:n.message}),[3,4];case 4:return[3,7];case 5:return[4,this.stopPlay()];case 6:a.sent(),this.startPlay(e),a.label=7;case 7:return[2]}var s,c,u}))}))},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 ba(this,void 0,void 0,(function(){var e;return Ca(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(),cL.warn("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):cL.warn("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 ba(this,void 0,void 0,(function(){return Ca(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.timer.reportInterval&&(window.clearInterval(this.timer.reportInterval),this.timer.reportInterval=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)go(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=gA;try{e.requestFullscreen?this.playerView[e.requestFullscreen]({navigationUI:"hide"}):EA(this.playerView)?this.playerView.webkitEnterFullScreen():this.enterFullWindow()}catch(e){cL.warn("enter full screen failed, ",e)}},e.prototype.exitFullscreen=function(){var e,t=gA;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 cL.warn("exit full screen failed, ",null==e?void 0:e.message)}))}else EA(this.playerView)?this.playerView.webkitExitFullScreen():this.exitFullWindow()}catch(e){cL.warn("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",Qk)},e.prototype.onAddStream=function(e){return ba(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,c,u,l=this;return Ca(this,(function(d){switch(d.label){case 0:if(null===(s=(a=this.listener).onPlayEvent)||void 0===s||s.call(a,Wk.PLAY_EVT_STREAM_BEGIN),!this.playerView)return[2];if(t=function(){l.playerView.removeEventListener("loadedmetadata",t),l.playerView.removeEventListener("canplay",t),l.report.markTime("video_play"),l.receiveConfig.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.receiveConfig.audio?l.report.measureTime("u32_first_audio_render_time","pull_start","video_play"):l.report.setData("u32_first_audio_render_time",0),l.startReport("start"),l.timer.reportInterval&&(window.clearInterval(l.timer.reportInterval),l.timer.reportInterval=null),l.timer.reportInterval=Uo((function(){l.startReport("interval")}),5e3)},this.playerView.addEventListener("loadedmetadata",t),this.playerView.addEventListener("canplay",t),this.playerView.srcObject=e,this.isVideoExisted=!0,!this.playerView.autoplay&&!this.connectRetry.playing)return[2];r=function(e){var t,r,n;cL.error("video play failed,",e),l.isVideoExisted&&(zi(t=e.toString()).call(t,"NotAllowedError")?Fo((function(){var t;null===(t=l.getConnectionStats())||void 0===t||t.then((function(t){var r,n,i,o,a=function(e){if(e){var t=null,r=null;go(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);null===(n=(r=l.listener).onPlayEvent)||void 0===n||n.call(r,Wk.PLAY_ERR_PLAY_FAIL,{message:e.toString(),videoActive:(null===(i=null==a?void 0:a.video)||void 0===i?void 0:i.bytesReceived)>0,audioActive:(null===(o=null==a?void 0:a.audio)||void 0===o?void 0:o.bytesReceived)>0})}))}),1e3):null===(n=(r=l.listener).onPlayEvent)||void 0===n||n.call(r,Wk.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(),n=pA(),dA&&n.length>0&&13===n[0]?(this.playerView.pause(),i=function(){return ba(l,void 0,void 0,(function(){var e,t,n;return Ca(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.playerView.play()];case 1:return i.sent(),cL.log("video play ok ios"),null===(n=(t=this.listener).onPlayEvent)||void 0===n||n.call(t,Wk.PLAY_EVT_PLAY_BEGIN),[3,3];case 2:return e=i.sent(),r(e),[3,3];case 3:return[2]}}))}))},Fo((function(){i()}),200)):(cL.log("video play ok"),null===(u=(c=this.listener).onPlayEvent)||void 0===u||u.call(c,Wk.PLAY_EVT_PLAY_BEGIN)),[3,4];case 3:return o=d.sent(),r(o),[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=new MediaStream),this.stream.addTrack(e)},e.prototype.onSetLocalDescription=function(e){return ba(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,c,u,l,d,p,f,h,m,v,y=this;return Ca(this,(function(g){var b,C,S,_,T;switch(g.label){case 0:return g.trys.push([0,5,,6]),t=As(),r=kA(e.sdp),n=Jo(b=e.sdp.toLowerCase()).call(b,"h264")>-1,i=xs.parse(window.navigator.userAgent),o=i.browser,a=i.os,s=vi(C=vi(S=vi(_="".concat(a.name||"other"," ")).call(_,a.version,";")).call(S,o.name||"other"," ")).call(C,o.version),null===(h=(f=this.listener).onPlayEvent)||void 0===h||h.call(f,Wk.PLAY_EVT_REQUEST_PULL_BEGIN,{localSdp:e,iceInfo:r,sessionId:t}),this.report.setData("str_session_id",t,!0),this.report.setData("bytes_token",t,!0),this.report.setData("str_ice_info",r,!0),this.report.markTime("request_start"),cL.log("H264 is ".concat(n?"":"not ","supported")),cL.log("traceId is webrtc_user=".concat(r)),cL.log("request pullStream start"),c=null,ca(T=this.playUrl).call(T,"webrtc")?[4,this.signal.fetchPullStream({streamurl:this.playUrl,sessionid:t,clientinfo:s,localsdp:e})]:[3,2];case 1:return c=g.sent(),[3,4];case 2:return[4,this.signal.fetchStreamSdp({streamurl:this.playUrl,sessionid:t,localsdp:e})];case 3:c=g.sent(),g.label=4;case 4:return cL.log("request pullStream success"),this.report.markTime("request_end"),this.report.measureTime("u32_signal_time","request_start","request_end"),u=c.remoteSdp,l=c.svrSig,d=function(e){var t,r,n=e.split("\r\n");try{for(var i=Sa(n),o=i.next();!o.done;o=i.next()){var a=o.value;if(ca(a).call(a,"i="))return a.replace("i=","")}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return""}(u.sdp),null===(v=(m=this.listener).onPlayEvent)||void 0===v||v.call(m,Wk.PLAY_EVT_REQUEST_PULL_SUCCESS,{remoteSdp:u}),this.report.setData("bytes_server_label",d,!0),this.webrtcConnection.connect(u),this.svrSig=l,this.timer.disconnectTimeout&&window.clearTimeout(this.timer.disconnectTimeout),this.timer.disconnectTimeout=Fo((function(){cL.warn("connect timeout, try reconnect"),y.webrtcConnection.disconnect({code:Fk.NEED_RECONNECT,msg:"Connection disconnected, please try again"})}),1e3*this.connectTimeout),[3,6];case 5:return p=g.sent(),cL.error("request pullStream error,",p),p.name===$k?(this.report.markTime("request_end"),this.report.measureTime("u32_signal_time","request_start","request_end"),this.webrtcConnection.disconnect(),this.onPlayError(Wk.PLAY_ERR_REQUEST_PULL_FAIL,{message:p.message})):(cL.warn("request signal ".concat("AbortError"===p.name?"timeout":"failed",", try reconnect")),this.webrtcConnection.disconnect({code:Fk.NEED_RECONNECT,msg:"request signal failed, please try again"})),[3,6];case 6:return[2]}}))}))},e.prototype.onConnect=function(e){var t,r,n=this;e.code===Uk.SUCCESS&&(this.stream&&this.onAddStream(this.stream),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,Wk.PLAY_EVT_SERVER_CONNECTED),this.abrClient.curBitrate&&this.svrSig&&(cL.log("abr control: reconnect ".concat(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){cL.warn("abr control reconnect failed",e)}))))},e.prototype.onDisconnect=function(e){var t=this;if(this.lastStatsReport=null,this.streamReceiveFail.curNum=0,this.streamDecodeFail.curNum=0,this.streamPlaying.status=Bk.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),this.timer.reportInterval&&(window.clearInterval(this.timer.reportInterval),this.timer.reportInterval=null),e.code===Fk.NEED_RECONNECT){var r;if(0===this.connectRetry.curNum&&(this.connectRetry.playing=this.isPlaying()),this.playUrl&&this.svrSig&&(this.signal.fetchStopStream({streamurl:this.playUrl,svrsig:this.svrSig}).catch((function(e){cL.warn("request stopStream error,",e)})),this.svrSig=null),this.stream)go(r=this.stream.getTracks()).call(r,(function(e){e.stop()})),this.stream=null;this.isVideoExisted&&this.playerView&&(this.playerView.pause(),this.playerView.srcObject=null,this.playerView.load(),this.isVideoExisted=!1),this.timer.retryTimeout&&(window.clearTimeout(this.timer.retryTimeout),this.timer.retryTimeout=null),this.timer.retryTimeout=Fo((function(){var e,r,n;t.connectRetry.curNum+=1;var i=t.connectRetry,o=i.curNum,a=i.maxNum;cL.log(vi(e="current retry num: ".concat(o,", max retry num: ")).call(e,a)),o<=a?(cL.log("start connection retry"),null===(n=(r=t.listener).onPlayEvent)||void 0===n||n.call(r,Wk.PLAY_EVT_SERVER_RECONNECT),t.startPlay(t.rawUrl)):(cL.error("stop connection retry, connection is disconnected"),t.onPlayError(Wk.PLAY_ERR_SERVER_DISCONNECT),t.connectRetry.curNum=0,t.connectRetry.playing=!1),t.timer.retryTimeout=null}),1e3*this.connectRetry.delay)}},e.prototype.onError=function(e){this.onPlayError(Wk.PLAY_ERR_WEBRTC_FAIL,{message:e})},e.prototype.startStat=function(){return ba(this,void 0,void 0,(function(){var e,t=this;return Ca(this,(function(r){switch(r.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=r.sent())&&(this.report.setTempData("start_stats",e),this.report.setTempData("last_stats",e),this.report.setTempData("last_time",(new Date).getTime()),this.onStats(e)),this.timer.statsInterval=Uo((function(){var e;null===(e=t.getConnectionStats())||void 0===e||e.then((function(e){e&&t.onStats(e)}))}),1e3),[2]}}))}))},e.prototype.onStats=function(e){var t,r,n,i,o,a,s,c,u,l,d=function(e,t){var r,n,i,o,a;if(void 0===t&&(t=null),t){var s=null,c=null,u=null,l=null,d=null;go(e).call(e,(function(e){"track"===e.type&&("video"===e.kind||e.frameWidth?s=e.id:("audio"===e.kind||e.audioLevel)&&(u=e.id)),"inbound-rtp"===e.type&&("video"===e.kind||"video"===e.mediaType?c=e.id:"audio"!==e.kind&&"audio"!==e.mediaType||(l=e.id)),"candidate-pair"===e.type&&e.selected?d=e.id:"transport"===e.type&&e.selectedCandidatePairId&&(d=e.selectedCandidatePairId)}));var p=e.get(s),f=e.get(c),h=t.get(s),m=t.get(c),v=0;void 0!==(null==f?void 0:f.timestamp)&&void 0!==(null==m?void 0:m.timestamp)&&(v=(f.timestamp-m.timestamp)/1e3);var y=void 0;if((null==f?void 0:f.codecId)&&(x=e.get(f.codecId))){var g,b,C=x.mimeType,S=x.payloadType,_=x.sdpFmtpLine;y=(null==C?void 0:C.replace("video/",""))||"",S&&_&&(y=vi(g=vi(b="".concat(y," (")).call(b,S,", ")).call(g,_,")"))}var T=void 0;void 0!==(null==f?void 0:f.framesPerSecond)?T=f.framesPerSecond:void 0!==(null==f?void 0:f.framerateMean)?T=f.framerateMean:void 0!==(null==f?void 0:f.framesReceived)&&void 0!==(null==m?void 0:m.framesReceived)&&v?T=(f.framesReceived-m.framesReceived)/v:void 0!==(null==p?void 0:p.framesReceived)&&void 0!==(null==h?void 0:h.framesReceived)&&v&&(T=(p.framesReceived-h.framesReceived)/v);var w=void 0;void 0!==(null==f?void 0:f.framesDecoded)&&void 0!==(null==m?void 0:m.framesDecoded)&&v&&(w=(f.framesDecoded-m.framesDecoded)/v);var R=void 0;void 0!==(null==f?void 0:f.bytesReceived)&&void 0!==(null==m?void 0:m.bytesReceived)&&v&&(R=8*(f.bytesReceived-m.bytesReceived)/v);var E=void 0;void 0!==(null==f?void 0:f.jitterBufferDelay)&&void 0!==(null==f?void 0:f.jitterBufferEmittedCount)&&void 0!==(null==m?void 0:m.jitterBufferDelay)&&void 0!==(null==m?void 0:m.jitterBufferEmittedCount)&&(f.jitterBufferEmittedCount-m.jitterBufferEmittedCount?E=(f.jitterBufferDelay-m.jitterBufferDelay)/(f.jitterBufferEmittedCount-m.jitterBufferEmittedCount)*1e3:f.jitterBufferEmittedCount&&(E=f.jitterBufferDelay/f.jitterBufferEmittedCount*1e3));var P=void 0;void 0!==(null==f?void 0:f.totalDecodeTime)&&void 0!==(null==f?void 0:f.framesDecoded)&&void 0!==(null==m?void 0:m.totalDecodeTime)&&void 0!==(null==m?void 0:m.framesDecoded)&&(f.framesDecoded-m.framesDecoded?P=(f.totalDecodeTime-m.totalDecodeTime)/(f.framesDecoded-m.framesDecoded)*1e3:f.framesDecoded&&(P=f.totalDecodeTime/f.framesDecoded*1e3));var k=e.get(u),A=e.get(l),L=t.get(l);void 0!==(null==A?void 0:A.timestamp)&&void 0!==(null==L?void 0:L.timestamp)&&(v=(A.timestamp-L.timestamp)/1e3);var x,I,D,O=void 0;if((null==A?void 0:A.codecId)&&(x=e.get(A.codecId)))C=x.mimeType,S=x.payloadType,_=x.sdpFmtpLine,O=(null==C?void 0:C.replace("audio/",""))||"",S&&_&&(O=vi(I=vi(D="".concat(O," (")).call(D,S,", ")).call(I,_,")"));var N=void 0;void 0!==(null==A?void 0:A.audioLevel)?N=null==A?void 0:A.audioLevel:void 0!==(null==k?void 0:k.audioLevel)&&(N=null==k?void 0:k.audioLevel);var M=void 0;void 0!==(null==A?void 0:A.bytesReceived)&&void 0!==(null==L?void 0:L.bytesReceived)&&v&&(M=8*(A.bytesReceived-L.bytesReceived)/v);var V=void 0;void 0!==(null==A?void 0:A.jitterBufferDelay)&&void 0!==(null==A?void 0:A.jitterBufferEmittedCount)&&void 0!==(null==L?void 0:L.jitterBufferDelay)&&void 0!==(null==L?void 0:L.jitterBufferEmittedCount)&&(A.jitterBufferEmittedCount-L.jitterBufferEmittedCount?V=(A.jitterBufferDelay-L.jitterBufferDelay)/(A.jitterBufferEmittedCount-L.jitterBufferEmittedCount)*1e3:A.jitterBufferEmittedCount&&(V=A.jitterBufferDelay/A.jitterBufferEmittedCount*1e3));var U=e.get(d),F=void 0;void 0!==(null==U?void 0:U.currentRoundTripTime)&&(F=1e3*U.currentRoundTripTime);var j=void 0,B=void 0,W=void 0,G=void 0;void 0===(null==f?void 0:f.packetsLost)&&void 0===(null==A?void 0:A.packetsLost)||(j=((null==f?void 0:f.packetsLost)||0)+((null==A?void 0:A.packetsLost)||0)),void 0===(null==f?void 0:f.packetsReceived)&&void 0===(null==A?void 0:A.packetsReceived)||(B=((null==f?void 0:f.packetsReceived)||0)+((null==A?void 0:A.packetsReceived)||0)),void 0===(null==m?void 0:m.packetsLost)&&void 0===(null==L?void 0:L.packetsLost)||(W=((null==m?void 0:m.packetsLost)||0)+((null==L?void 0:L.packetsLost)||0)),void 0===(null==m?void 0:m.packetsReceived)&&void 0===(null==L?void 0:L.packetsReceived)||(G=((null==m?void 0:m.packetsReceived)||0)+((null==L?void 0:L.packetsReceived)||0));var Z=void 0;if(void 0!==j&&void 0!==B&&void 0!==W&&void 0!==G){var Y=j-W,H=B-G;Z=Y<=0||H<0?0:Y/(Y+H)*100}var X=RA.UNKNOWN;return void 0===F&&void 0===Z||(Z>50||F>500?X=RA.VERY_BAD:Z>30||F>350?X=RA.BAD:Z>20||F>200?X=RA.POOR:Z>10||F>100?X=RA.GOOD:(Z>=0||F>=0)&&(X=RA.EXCELLENT)),{timestamp:(null==f?void 0:f.timestamp)||(null==A?void 0:A.timestamp),video:{codec:y,bitrate:R&&Number(R.toFixed(2)),framesPerSecond:T&&Math.round(T),framesDecodedPerSecond:w&&Math.round(w),frameWidth:null!==(r=null==f?void 0:f.frameWidth)&&void 0!==r?r:null==p?void 0:p.frameWidth,frameHeight:null!==(n=null==f?void 0:f.frameHeight)&&void 0!==n?n:null==p?void 0:p.frameHeight,framesDecoded:null!==(i=null==f?void 0:f.framesDecoded)&&void 0!==i?i:null==p?void 0:p.framesDecoded,framesDropped:null!==(o=null==f?void 0:f.framesDropped)&&void 0!==o?o:null==p?void 0:p.framesDropped,framesReceived:null!==(a=null==f?void 0:f.framesReceived)&&void 0!==a?a:null==p?void 0:p.framesReceived,packetsLost:null==f?void 0:f.packetsLost,packetsReceived:null==f?void 0:f.packetsReceived,nackCount:null==f?void 0:f.nackCount,firCount:null==f?void 0:f.firCount,pliCount:null==f?void 0:f.pliCount,jitterBufferDelay:E&&Number(E.toFixed(2)),frameDecodeAvgTime:P&&Number(P.toFixed(2))},audio:{codec:O,audioLevel:N,bitrate:M&&Number(M.toFixed(2)),packetsLost:null==A?void 0:A.packetsLost,packetsReceived:null==A?void 0:A.packetsReceived,jitterBufferDelay:V&&Number(V.toFixed(2))},network:{roundTripTime:F,quality:X}}}}(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,m=f.uploadAuidoBytesTotal,v=f.uploadVideoBytesTotal,y=f.cdnDownloadBytesTotal,g=f.cdnDownloadAuidoBytesTotal,b=f.cdnDownloadVideoBytesTotal,C=f.p2pDownloadBytesTotal,S=f.p2pDownloadAuidoBytesTotal,_=f.p2pDownloadVideoBytesTotal;p.p2p={uploadBytes:h,uploadAuidoBytes:m,uploadVideoBytes:v,cdnDownloadBytes:y,cdnDownloadAuidoBytes:g,cdnDownloadVideoBytes:b,p2pDownloadBytes:C,p2pDownloadAuidoBytes:S,p2pDownloadVideoBytes:_}}if(null===(i=(n=this.listener).onPlayStats)||void 0===i||i.call(n,ya(ya({},d),p)),d.video.bitrate||d.audio.bitrate)this.streamReceiveFail.curNum=0,this.connectRetry.curNum=0;else if(this.streamReceiveFail.curNum+=1,this.streamReceiveFail.curNum>=this.streamReceiveFail.maxNum)return null===(a=(o=this.listener).onPlayEvent)||void 0===a||a.call(o,Wk.PLAY_EVT_STREAM_EMPTY),cL.warn("stream is empty, try reconnect"),void this.webrtcConnection.disconnect({code:Fk.NEED_RECONNECT,msg:"stream is empty, please try again"})}if((null==d?void 0:d.video)&&this.receiveConfig.video&&this.isVideoExisted){var T=d.video,w=T.bitrate,R=T.framesPerSecond,E=T.framesDecoded,P=T.framesDecodedPerSecond;if(!w||R&&E?this.streamDecodeFail.curNum=0:(this.streamDecodeFail.curNum+=1,this.streamDecodeFail.curNum===this.streamDecodeFail.maxNum&&(cL.error("video decoding failed"),this.onPlayError(Wk.PLAY_ERR_DECODE_FAIL,{message:"decode failed",bitrate:w,framesPerSecond:R}))),P>=0||R>=0)if(P<=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!==Bk.WAITING&&(this.streamPlaying.status=Bk.WAITING,this.report.setTempData("freeze_start_time",(new Date).getTime()),null===(c=(s=this.listener).onPlayEvent)||void 0===c||c.call(s,Wk.PLAY_EVT_PLAY_WAITING_BEGIN))}else{if(this.streamPlaying.status===Bk.WAITING){var A=this.report.getTempData("freeze_start_time"),L=(new Date).getTime(),x=L-A,I=this.report.getTempData("video_freeze")||{},D=I.count,O=void 0===D?0:D,N=I.totalTime,M=void 0===N?0:N,V=I.maxTime,U=void 0===V?0:V,F=I.endTimes,j=void 0===F?[]:F;O+=1,M+=x,U=Math.max(x,U),j=Ta(Ta([],_a(j),!1),[L],!1),this.report.setTempData("video_freeze",{count:O,totalTime:M,maxTime:U,endTimes:j}),null===(l=(u=this.listener).onPlayEvent)||void 0===l||l.call(u,Wk.PLAY_EVT_PLAY_WAITING_STOP)}this.streamPlaying.status=Bk.PLAYING}}},e.prototype.startReport=function(e){return ba(this,arguments,void 0,(function(e,t){var r,n,i,o,a,s,c,u,l,d,p,f,h,m,v,y,g,b,C,S,_,T,w,R,E,P,k,A,L,x,I,D,O,N,M,V;return void 0===t&&(t=""),Ca(this,(function(U){switch(U.label){case 0:return r=(new Date).getTime(),n=this.report.getTempData("pull_start_time"),"stop"===e?(i=this.report.getTempData("u32_first_i_frame")||0,this.report.setData("u64_timestamp",r),this.report.setData("u64_begin_timestamp",n),this.report.setData("u32_result",Math.round((r-n)/1e3)),this.report.setData("u32_first_i_frame",i),this.report.setData("u32_first_frame_black",i>1e4?1:0),o=this.report.getTempData("video_freeze")||{},a=o.count,h=void 0===a?0:a,s=o.totalTime,c=void 0===s?0:s,u=o.maxTime,l=void 0===u?0:u,this.report.setData("u64_block_count",h),this.report.setData("u32_video_block_time",c),this.report.setData("u64_block_duration_max",l),this.report.setData("u32_avg_block_time",c&&h?Math.round(c/h):0),this.report.setData("u32_delay_report",t?1:0)):"interval"===e&&(this.report.setData("u64_timestamp",r),this.report.setData("u64_playtime",r-n),d=(this.report.getTempData("video_freeze")||{}).endTimes,p=void 0===d?[]:d,f=this.report.getTempData("last_time")||0,h=ha(p).call(p,(function(e){return e>=f&&e1e3&&f<2e3){var C;if(this.lastStatsReport=null,this.timer.statsInterval&&(window.clearInterval(this.timer.statsInterval),this.timer.statsInterval=null),this.timer.reportInterval&&(window.clearInterval(this.timer.reportInterval),this.timer.reportInterval=null),this.stream)go(C=this.stream.getTracks()).call(C,(function(e){e.stop()})),this.stream=null;this.isVideoExisted&&this.playerView&&(this.playerView.pause(),this.playerView.srcObject=null,this.playerView.load(),this.isVideoExisted=!1),this.p2pConnection.destroy(),this.p2pConnection=null}},e.prototype.onReceiveSEI=function(e){var t,r;null===(r=(t=this.listener).onPlaySEI)||void 0===r||r.call(t,e)},e.version=Hk,e}();return LL}));