!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.QPlayer=t()}(this,function(){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;ro[0]&&t[1]i;)V(n,r=t[i++])&&(~Le(a,r)||a.push(r));return a},Re=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ce=Re.concat("length","prototype"),De={f:Object.getOwnPropertyNames||function(e){return Ie(e,Ce)}},Ue={f:Object.getOwnPropertySymbols},Pe=h.Reflect,ke=Pe&&Pe.ownKeys||function(e){var t=De.f(S(e)),r=Ue.f;return r?t.concat(r(e)):t},Oe=function(e,t){for(var r=ke(t),n=T.f,i=Ee.f,a=0;adocument.F=Object"),e.close(),ot=e.F;r--;)delete ot[it][Re[r]];return ot()},st=Object.create||function(e,t){var r;return null!==e?(at[it]=S(e),r=new at,at[it]=null,r[nt]=e):r=ot(),void 0===t?r:et(r,t)};Q[nt]=!0;var lt=T.f,ut=O("toStringTag"),dt=function(e,t,r){e&&!V(e=r?e:e.prototype,ut)&<(e,ut,{configurable:!0,value:t})},ft={},ct=Je.IteratorPrototype,ht=function(){return this},pt=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),n=e instanceof Array}catch(e){}return function(e,t){return function(e,t){if(S(e),!g(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(e,t),n?r.call(e,t):e.__proto__=t,e}}():void 0),mt=O("iterator"),gt=Je.IteratorPrototype,yt=Je.BUGGY_SAFARI_ITERATORS,vt="values",_t="entries",bt=function(){return this},St=function(e,t,r,n,i,a,o){var s,l,u;l=n,u=t+" Iterator",(s=r).prototype=st(ct,{next:A(1,l)}),dt(s,u,!1),ft[u]=ht;var d,f,c,h=function(e){if(e===i&&v)return v;if(!yt&&e in g)return g[e];switch(e){case"keys":case vt:case _t:return function(){return new r(this,e)}}return function(){return new r(this)}},p=t+" Iterator",m=!1,g=e.prototype,y=g[mt]||g["@@iterator"]||i&&g[i],v=!yt&&y||h(i),_="Array"==t&&g.entries||y;if(_&&(d=Xe(_.call(new e)),gt!==Object.prototype&&d.next&&(Xe(d)!==gt&&(pt?pt(d,gt):"function"!=typeof d[mt]&&x(d,mt,bt)),dt(d,p,!0))),i==vt&&y&&y.name!==vt&&(m=!0,v=function(){return y.call(this)}),g[mt]!==v&&x(g,mt,v),ft[t]=v,i)if(f={values:h(vt),keys:a?v:h("keys"),entries:h(_t)},o)for(c in f)!yt&&!m&&c in g||ae(g,c,f[c]);else qe({target:t,proto:!0,forced:yt||m},f);return f},Et="String Iterator",wt=ie.set,Tt=ie.getterFor(Et);St(String,"String",function(e){wt(this,{type:Et,string:String(e),index:0})},function(){var e,t,r,n,i,a,o,s,l=Tt(this),u=l.string,d=l.index;return d>=u.length?{value:void 0,done:!0}:(t=d,r=!0,a=String(pe(u)),o=he(t),s=a.length,e=o<0||s<=o?r?"":void 0:(n=a.charCodeAt(o))<55296||56319=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");ft.Arguments=ft.Array,It("keys"),It("values"),It("entries");var Pt=O("iterator"),kt=O("toStringTag"),Ot=Ut.values;for(var Mt in At){var Ft=h[Mt],Bt=Ft&&Ft.prototype;if(Bt){if(Bt[Pt]!==Ot)try{x(Bt,Pt,Ot)}catch(e){Bt[Pt]=Ot}if(Bt[kt]||x(Bt,kt,Mt),At[Mt])for(var Nt in Ut)if(Bt[Nt]!==Ut[Nt])try{x(Bt,Nt,Ut[Nt])}catch(e){Bt[Nt]=Ut[Nt]}}}var zt,jt,Gt,Ht=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},qt=O("iterator"),Vt=Array.prototype,Wt=function(n,i,e){if(Ht(n),void 0===i)return n;switch(e){case 0:return function(){return n.call(i)};case 1:return function(e){return n.call(i,e)};case 2:return function(e,t){return n.call(i,e,t)};case 3:return function(e,t,r){return n.call(i,e,t,r)}}return function(){return n.apply(i,arguments)}},Yt=O("iterator"),Kt=function(t,e,r,n){try{return n?e(S(r)[0],r[1]):e(r)}catch(e){var i=t.return;throw void 0!==i&&S(i.call(t)),e}},Xt=s(function(e){var c={};(e.exports=function(e,t,r,n,i){var a,o,s,l,u,d,f=Wt(t,r,n?2:1);if(i)a=e;else{if("function"!=typeof(o=function(e){if(null!=e)return e[Yt]||e["@@iterator"]||ft[B(e)]}(e)))throw TypeError("Target is not iterable");if(void 0!==(d=o)&&(ft.Array===d||Vt[qt]===d)){for(s=0,l=Te(e.length);sr;)t.push(arguments[r++]);return or[++ar]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},zt(ar),ar},tr=function(e){delete or[e]},"process"==i(rr)?zt=function(e){rr.nextTick(ur(e))}:ir&&ir.now?zt=function(e){ir.now(ur(e))}:nr?(Gt=(jt=new nr).port2,jt.port1.onmessage=dr,zt=Wt(Gt.postMessage,Gt,1)):!h.addEventListener||"function"!=typeof postMessage||h.importScripts||p(fr)?zt=sr in _("script")?function(e){rt.appendChild(_("script"))[sr]=function(){rt.removeChild(this),lr(e)}}:function(e){setTimeout(ur(e),0)}:(zt=fr,h.addEventListener("message",dr,!1)));var cr,hr,pr,mr,gr,yr,vr,_r={set:er,clear:tr},br=h.navigator,Sr=br&&br.userAgent||"",Er=Ee.f,wr=_r.set,Tr=h.MutationObserver||h.WebKitMutationObserver,Ar=h.process,xr=h.Promise,Lr="process"==i(Ar),Ir=Er(h,"queueMicrotask"),Rr=Ir&&Ir.value;Rr||(cr=function(){var e,t;for(Lr&&(e=Ar.domain)&&e.exit();hr;){t=hr.fn,hr=hr.next;try{t()}catch(e){throw hr?mr():pr=void 0,e}}pr=void 0,e&&e.enter()},mr=Lr?function(){Ar.nextTick(cr)}:Tr&&!/(iphone|ipod|ipad).*applewebkit/i.test(Sr)?(gr=!0,yr=document.createTextNode(""),new Tr(cr).observe(yr,{characterData:!0}),function(){yr.data=gr=!gr}):xr&&xr.resolve?(vr=xr.resolve(void 0),function(){vr.then(cr)}):function(){wr.call(h,cr)});var Cr,Dr,Ur,Pr,kr,Or=Rr||function(e){var t={fn:e,next:void 0};pr&&(pr.next=t),hr||(hr=t,mr()),pr=t},Mr=function(e){var r,n;this.promise=new e(function(e,t){if(void 0!==r||void 0!==n)throw TypeError("Bad Promise constructor");r=e,n=t}),this.resolve=Ht(r),this.reject=Ht(n)},Fr={f:function(e){return new Mr(e)}},Br=function(e,t){if(S(e),g(t)&&t.constructor===e)return t;var r=Fr.f(e);return(0,r.resolve)(t),r.promise},Nr=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},zr=h,jr=function(e){return"function"==typeof e?e:void 0},Gr=function(e,t){return arguments.length<2?jr(zr[e])||jr(h[e]):zr[e]&&zr[e][t]||h[e]&&h[e][t]},Hr=O("species"),qr="Promise",Vr=_r.set,Wr=O("species"),Yr=ie.get,Kr=ie.set,Xr=ie.getterFor(qr),Zr=h[qr],Qr=h.TypeError,Jr=h.document,$r=h.process,en=h.fetch,tn=$r&&$r.versions,rn=tn&&tn.v8||"",nn=Fr.f,an=nn,on="process"==i($r),sn=!!(Jr&&Jr.createEvent&&h.dispatchEvent),ln="unhandledrejection",un=Ge(qr,function(){var e=Zr.resolve(1),t=function(){},r=(e.constructor={})[Wr]=function(e){e(t,t)};return!((on||"function"==typeof PromiseRejectionEvent)&&e.then(t)instanceof r&&0!==rn.indexOf("6.6")&&-1===Sr.indexOf("Chrome/66"))}),dn=un||!function(e,t){if(!t)return!1;var r=!1;try{var n={};n[Zt]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}(function(e){Zr.all(e).catch(function(){})}),fn=function(e){var t;return!(!g(e)||"function"!=typeof(t=e.then))&&t},cn=function(d,f,r){if(!f.notified){f.notified=!0;var n=f.reactions;Or(function(){for(var l=f.value,u=1==f.state,e=0,t=function(e){var t,r,n,i=u?e.ok:e.fail,a=e.resolve,o=e.reject,s=e.domain;try{i?(u||(2===f.rejection&&gn(d,f),f.rejection=1),!0===i?t=l:(s&&s.enter(),t=i(l),s&&(s.exit(),n=!0)),t===e.promise?o(Qr("Promise-chain cycle")):(r=fn(t))?r.call(t,a,o):a(t)):o(l)}catch(e){s&&!n&&s.exit(),o(e)}};n.length>e;)t(n[e++]);f.reactions=[],f.notified=!1,r&&!f.rejection&&pn(d,f)})}},hn=function(e,t,r){var n,i;sn?((n=Jr.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),h.dispatchEvent(n)):n={promise:t,reason:r},(i=h["on"+e])?i(n):e===ln&&function(e,t){var r=h.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}("Unhandled promise rejection",r)},pn=function(r,n){Vr.call(h,function(){var e,t=n.value;if(mn(n)&&(e=Nr(function(){on?$r.emit("unhandledRejection",t,r):hn(ln,r,t)}),n.rejection=on||mn(n)?2:1,e.error))throw e.value})},mn=function(e){return 1!==e.rejection&&!e.parent},gn=function(e,t){Vr.call(h,function(){on?$r.emit("rejectionHandled",e):hn("rejectionhandled",e,t.value)})},yn=function(t,r,n,i){return function(e){t(r,n,e,i)}},vn=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,cn(e,t,!0))},_n=function(r,n,e,t){if(!n.done){n.done=!0,t&&(n=t);try{if(r===e)throw Qr("Promise can't be resolved itself");var i=fn(e);i?Or(function(){var t={done:!1};try{i.call(e,yn(_n,r,t,n),yn(vn,r,t,n))}catch(e){vn(r,t,e,n)}}):(n.value=e,n.state=1,cn(r,n,!1))}catch(e){vn(r,{done:!1},e,n)}}};un&&(Zr=function(e){!function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}(this,Zr,qr),Ht(e),Cr.call(this);var t=Yr(this);try{e(yn(_n,this,t),yn(vn,this,t))}catch(e){vn(this,t,e)}},(Cr=function(e){Kr(this,{type:qr,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(e,t,r){for(var n in t)ae(e,n,t[n],r);return e}(Zr.prototype,{then:function(e,t){var r=Xr(this),n=nn(Jt(this,Zr));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=on?$r.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&cn(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),Dr=function(){var e=new Cr,t=Yr(e);this.promise=e,this.resolve=yn(_n,e,t),this.reject=yn(vn,e,t)},Fr.f=nn=function(e){return e===Zr||e===Ur?new Dr(e):an(e)},"function"==typeof en&&qe({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return Br(Zr,en.apply(h,arguments))}})),qe({global:!0,wrap:!0,forced:un},{Promise:Zr}),dt(Zr,qr,!1),Pr=Gr(qr),kr=T.f,m&&Pr&&!Pr[Hr]&&kr(Pr,Hr,{configurable:!0,get:function(){return this}}),Ur=zr[qr],qe({target:qr,stat:!0,forced:un},{reject:function(e){var t=nn(this);return t.reject.call(void 0,e),t.promise}}),qe({target:qr,stat:!0,forced:un},{resolve:function(e){return Br(this,e)}}),qe({target:qr,stat:!0,forced:dn},{all:function(e){var s=this,t=nn(s),l=t.resolve,u=t.reject,r=Nr(function(){var n=Ht(s.resolve),i=[],a=0,o=1;Xt(e,function(e){var t=a++,r=!1;i.push(void 0),o++,n.call(s,e).then(function(e){r||(r=!0,i[t]=e,--o||l(i))},u)}),--o||l(i)});return r.error&&u(r.value),t.promise},race:function(e){var r=this,n=nn(r),i=n.reject,t=Nr(function(){var t=Ht(r.resolve);Xt(e,function(e){t.call(r,e).then(n.resolve,i)})});return t.error&&i(t.value),n.promise}}),qe({target:"Promise",proto:!0,real:!0},{finally:function(t){var r=Jt(this,Gr("Promise")),e="function"==typeof t;return this.then(e?function(e){return Br(r,t()).then(function(){return e})}:t,e?function(e){return Br(r,t()).then(function(){throw e})}:t)}});zr.Promise;var bn=function(e,t){var r=this;if(!(r instanceof bn))return new bn(e,t);pt&&(r=pt(new Error(t),Xe(r)));var n=[];return Xt(e,n.push,n),r.errors=n,void 0!==t&&x(r,"message",String(t)),r};bn.prototype=st(Error.prototype,{constructor:{value:bn,configurable:!0,writable:!0},name:{value:"AggregateError",configurable:!0,writable:!0}}),qe({global:!0},{AggregateError:bn}),qe({target:"Promise",stat:!0},{allSettled:function(e){var s=this,t=Fr.f(s),l=t.resolve,r=t.reject,n=Nr(function(){var n=Ht(s.resolve),i=[],a=0,o=1;Xt(e,function(e){var t=a++,r=!1;i.push(void 0),o++,n.call(s,e).then(function(e){r||(r=!0,i[t]={status:"fulfilled",value:e},--o||l(i))},function(e){r||(r=!0,i[t]={status:"rejected",reason:e},--o||l(i))})}),--o||l(i)});return n.error&&r(n.value),t.promise}}),qe({target:"Promise",stat:!0},{try:function(e){var t=Fr.f(this),r=Nr(e);return(r.error?t.reject:t.resolve)(r.value),t.promise}});var Sn="No one promise resolved";qe({target:"Promise",stat:!0},{any:function(e){var l=this,t=Fr.f(l),u=t.resolve,d=t.reject,r=Nr(function(){var n=Ht(l.resolve),i=[],a=0,o=1,s=!1;Xt(e,function(e){var t=a++,r=!1;i.push(void 0),o++,n.call(l,e).then(function(e){r||s||(s=!0,u(e))},function(e){r||s||(r=!0,i[t]=e,--o||d(new(Gr("AggregateError"))(i,Sn)))})}),--o||d(new(Gr("AggregateError"))(i,Sn))});return r.error&&d(r.value),t.promise}});var En,wn,Tn,An,xn,Ln,In,Rn,Cn,Dn=Array.isArray||function(e){return"Array"==i(e)},Un=O("species"),Pn=function(e,t){var r;return Dn(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!Dn(r.prototype)?g(r)&&null===(r=r[Un])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)},kn=(Tn=1==(En=5),An=2==En,xn=3==En,Ln=4==En,In=6==En,Rn=5==En||In,Cn=wn||Pn,function(e,t,r){for(var n,i,a=Ve(e),o=_e(a),s=Wt(t,r,3),l=Te(o.length),u=0,d=Tn?Cn(e,l):An?Cn(e,0):void 0;uo;)a.call(e,n=i[o++])&&t.push(n);return t}(t=be(t)),i=0,a=n.length;ii;)V(gi,t=r[i++])||V(Q,t)||n.push(t);return n},Ci=function(e){for(var t,r=e===_i,n=li(r?yi:be(e)),i=[],a=0;n.length>a;)!V(gi,t=n[a++])||r&&!V(_i,t)||i.push(gi[t]);return i};U||(ae((ui=function(){if(this instanceof ui)throw TypeError("Symbol is not a constructor");var e=void 0===arguments[0]?void 0:String(arguments[0]),t=D(e),r=function(e){this===_i&&r.call(yi,e),V(this,ri)&&V(this[ri],t)&&(this[ri][t]=!1),Ei(this,t,A(1,e))};return m&&Si&&Ei(_i,t,{configurable:!0,set:r}),wi(t,e)})[ci],"toString",function(){return ai(this).tag}),ye.f=Li,T.f=Ai,Ee.f=Ii,De.f=ti.f=Ri,Ue.f=Ci,m&&(si(ui[ci],"description",{configurable:!0,get:function(){return ai(this).description}}),ae(_i,"propertyIsEnumerable",Li,{unsafe:!0})),Xn.f=function(e){return wi(O(e),e)}),qe({global:!0,wrap:!0,forced:!U,sham:!U},{Symbol:ui});for(var Di=$e(vi),Ui=0;Di.length>Ui;)Qn(Di[Ui++]);qe({target:ni,stat:!0,forced:!U},{for:function(e){return V(mi,e+="")?mi[e]:mi[e]=ui(e)},keyFor:function(e){if(!Ti(e))throw TypeError(e+" is not a symbol");for(var t in mi)if(mi[t]===e)return t},useSetter:function(){Si=!0},useSimple:function(){Si=!1}}),qe({target:"Object",stat:!0,forced:!U,sham:!m},{create:function(e,t){return void 0===t?st(e):xi(st(e),t)},defineProperty:Ai,defineProperties:xi,getOwnPropertyDescriptor:Ii}),qe({target:"Object",stat:!0,forced:!U},{getOwnPropertyNames:Ri,getOwnPropertySymbols:Ci}),qe({target:"Object",stat:!0,forced:p(function(){Ue.f(1)})},{getOwnPropertySymbols:function(e){return Ue.f(Ve(e))}}),di&&qe({target:"JSON",stat:!0,forced:!U||p(function(){var e=ui();return"[null]"!=fi([e])||"{}"!=fi({a:e})||"{}"!=fi(Object(e))})},{stringify:function(e){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=t=n[1],(g(t)||void 0!==e)&&!Ti(e))return Dn(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!Ti(t))return t}),n[1]=t,fi.apply(di,n)}}),ui[ci][hi]||x(ui[ci],hi,ui[ci].valueOf),dt(ui,ni),Q[ri]=!0,Qn("asyncIterator");var Pi=T.f,ki=h.Symbol;if(m&&"function"==typeof ki&&(!("description"in ki.prototype)||void 0!==ki().description)){var Oi={},Mi=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof Mi?new ki(e):void 0===e?ki():ki(e);return""===e&&(Oi[t]=!0),t};Oe(Mi,ki);var Fi=Mi.prototype=ki.prototype;Fi.constructor=Mi;var Bi=Fi.toString,Ni="Symbol(test)"==String(ki("test")),zi=/^Symbol\((.*)\)[^)]+$/;Pi(Fi,"description",{configurable:!0,get:function(){var e=g(this)?this.valueOf():this,t=Bi.call(e);if(V(Oi,e))return"";var r=Ni?t.slice(7,-1):t.replace(zi,"$1");return""===r?void 0:r}}),qe({global:!0,forced:!0},{Symbol:Mi})}Qn("hasInstance"),Qn("isConcatSpreadable"),Qn("iterator"),Qn("match"),Qn("matchAll"),Qn("replace"),Qn("search"),Qn("species"),Qn("split"),Qn("toPrimitive"),Qn("toStringTag"),Qn("unscopables"),dt(Math,"Math",!0),dt(h.JSON,"JSON",!0);zr.Symbol;Qn("dispose"),Qn("observable"),Qn("patternMatch"),Qn("replaceAll"),function(n){function t(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!1),t.dispatchEvent(r)}function r(e){return function(t,r){return e!==o.exit||n[i.element]?(n.addEventListener(i.events.change,function e(){t(),n.removeEventListener(i.events.change,e,!1)},!1),void n.addEventListener(i.events.error,function e(){r(new TypeError),n.removeEventListener(i.events.error,e,!1)},!1)):void setTimeout(function(){r(new TypeError)},1)}}var i,e,a={w3:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}},o=a.w3;for(e in a)if(a[e].enabled in n){i=a[e];break}o.enabled in n||!i||(n.addEventListener(i.events.change,function(e){e.stopPropagation(),e.stopImmediatePropagation(),n[o.enabled]=n[i.enabled],n[o.element]=n[i.element],t(o.events.change,e.target)},!1),n.addEventListener(i.events.error,function(e){t(o.events.error,e.target)},!1),n[o.enabled]=n[i.enabled],n[o.element]=n[i.element],n[o.exit]=function(){var e=n[i.exit]();return!e&&Promise?new Promise(r(o.exit)):e},Element.prototype[o.request]=function(){var e=this[i.request].apply(this,arguments);return!e&&Promise?new Promise(r(o.request)):e})}(document),e(s(function(e,t){!function(s){var l={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(l.arrayBuffer)var t=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(e){return e&&-1 "+n)),a.apply(l.console,e)}:o)})}(e,"debug","log","info","warn","error");try{s.log()}catch(e){s=i}}else s=i},t.logger=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(6).getSelfScope().Number;(t.Number=n).isFinite=n.isFinite||function(e){return"number"==typeof e&&isFinite(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",KEY_SYSTEM_ERROR:"keySystemError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},t.ErrorDetails={KEY_SYSTEM_NO_KEYS:"keySystemNoKeys",KEY_SYSTEM_NO_ACCESS:"keySystemNoAccess",KEY_SYSTEM_NO_SESSION:"keySystemNoSession",KEY_SYSTEM_LICENSE_REQUEST_FAILED:"keySystemLicenseRequestFailed",MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException"}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(3),a=r(1),o={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},s=function(){function e(e){for(var t=[],r=1;r=r.start(n)&&t<=r.end(n))return!0}catch(e){}return!1},e.bufferInfo=function(e,t,r){try{if(e){var n=e.buffered,i=[],a=void 0;for(a=0;ad&&(l[u-1].end=e[s].end):l.push(e[s])}else l.push(e[s])}for(n=s=0,i=a=t;s>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(r);break;case 12:case 13:n=e[s++],o+=String.fromCharCode((31&r)<<6|63&n);break;case 14:n=e[s++],i=e[s++],o+=String.fromCharCode((15&r)<<12|(63&n)<<6|(63&i)<<0)}}return o},s}(),i=n._utf8ArrayToStr;t.utf8ArrayToStr=i,t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaSource=function(){if("undefined"!=typeof window)return window.MediaSource||window.WebKitMediaSource}},function(e,o,s){(function(g){var n,e=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(o,"__esModule",{value:!0});var y=s(1),t=s(4),l=s(3),c=s(0),a=s(14),v=s(25),_=window.performance,b={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},i={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"},r=function(r){function m(e){var t=r.call(this,e,y.default.MANIFEST_LOADING,y.default.LEVEL_LOADING,y.default.AUDIO_TRACK_LOADING,y.default.SUBTITLE_TRACK_LOADING)||this;return t.loaders={},t}return e(m,r),Object.defineProperty(m,"ContextType",{get:function(){return b},enumerable:!0,configurable:!0}),Object.defineProperty(m,"LevelType",{get:function(){return i},enumerable:!0,configurable:!0}),m.canHaveQualityLevels=function(e){return e!==b.AUDIO_TRACK&&e!==b.SUBTITLE_TRACK},m.mapContextToLevelType=function(e){switch(e.type){case b.AUDIO_TRACK:return i.AUDIO;case b.SUBTITLE_TRACK:return i.SUBTITLE;default:return i.MAIN}},m.getResponseUrl=function(e,t){var r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r},m.prototype.createInternalLoader=function(e){var t=this.hls.config,r=t.pLoader,n=t.loader,i=new(r||n)(t);return e.loader=i,this.loaders[e.type]=i},m.prototype.getInternalLoader=function(e){return this.loaders[e.type]},m.prototype.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},m.prototype.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},m.prototype.destroy=function(){this.destroyInternalLoaders(),r.prototype.destroy.call(this)},m.prototype.onManifestLoading=function(e){this.load(e.url,{type:b.MANIFEST,level:0,id:null})},m.prototype.onLevelLoading=function(e){this.load(e.url,{type:b.LEVEL,level:e.level,id:e.id})},m.prototype.onAudioTrackLoading=function(e){this.load(e.url,{type:b.AUDIO_TRACK,level:null,id:e.id})},m.prototype.onSubtitleTrackLoading=function(e){this.load(e.url,{type:b.SUBTITLE_TRACK,level:null,id:e.id})},m.prototype.load=function(e,t){var r=this.hls.config;c.logger.debug("Loading playlist of type "+t.type+", level: "+t.level+", id: "+t.id);var n,i,a,o,s=this.getInternalLoader(t);if(s){var l=s.context;if(l&&l.url===e)return c.logger.trace("playlist request ongoing"),!1;c.logger.warn("aborting previous loader for type: "+t.type),s.abort()}switch(t.type){case b.MANIFEST:n=r.manifestLoadingMaxRetry,i=r.manifestLoadingTimeOut,a=r.manifestLoadingRetryDelay,o=r.manifestLoadingMaxRetryTimeout;break;case b.LEVEL:n=0,i=r.levelLoadingTimeOut;break;default:n=r.levelLoadingMaxRetry,i=r.levelLoadingTimeOut,a=r.levelLoadingRetryDelay,o=r.levelLoadingMaxRetryTimeout}s=this.createInternalLoader(t),t.url=e,t.responseType=t.responseType||"";var u={timeout:i,maxRetry:n,retryDelay:a,maxRetryDelay:o},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return c.logger.debug("Calling internal loader delegate for URL: "+e),s.load(t,u,d),!0},m.prototype.loadsuccess=function(e,t,r,n){if(void 0===n&&(n=null),r.isSidxRequest)return this._handleSidxRequest(e,r),void this._handlePlaylistLoaded(e,t,r,n);this.resetInternalLoader(r.type);var i=e.data;t.tload=_.now(),0===i.indexOf("#EXTM3U")?0>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},m.findBox=function(e,t){var r,n,i,a,o,s,l,u=[];if(e.data?(s=e.start,a=e.end,e=e.data):(s=0,a=e.byteLength),!t.length)return null;for(r=s;r>>31)return void console.warn("SIDX has hierarchical references (not supported)");var p=m.readUint32(a,f);f+=4,t.push({referenceSize:h,subsegmentDuration:p,info:{duration:p/s,start:l,end:l+h-1}}),l+=h,i=f+=4}return{earliestPresentationTime:0,timescale:s,version:o,referencesCount:u,references:t,moovEndOffset:n}},m.parseInitSegment=function(e){var f=[];return m.findBox(e,["moov","trak"]).forEach(function(e){var t=m.findBox(e,["tkhd"])[0];if(t){var r=t.data[t.start],n=0===r?12:20,i=m.readUint32(t,n),a=m.findBox(e,["mdia","mdhd"])[0];if(a){n=0===(r=a.data[a.start])?12:20;var o=m.readUint32(a,n),s=m.findBox(e,["mdia","hdlr"])[0];if(s){var l={soun:"audio",vide:"video"}[m.bin2str(s.data.subarray(s.start+8,s.start+12))];if(l){var u=m.findBox(e,["mdia","minf","stbl","stsd"]);if(u.length){u=u[0];var d=m.bin2str(u.data.subarray(u.start+12,u.start+16));c.logger.log("MP4Demuxer:"+l+":"+d+" found")}f[i]={timescale:o,type:l},f[l]={timescale:o,id:i}}}}}}),f},m.getStartDTS=function(i,e){var t,r,n;return t=m.findBox(e,["moof","traf"]),r=[].concat.apply([],t.map(function(n){return m.findBox(n,["tfhd"]).map(function(e){var t,r;return t=m.readUint32(e,4),r=i[t].timescale||9e4,m.findBox(n,["tfdt"]).map(function(e){var t,r;return t=e.data[e.start],r=m.readUint32(e,4),1===t&&(r*=Math.pow(2,32),r+=m.readUint32(e,8)),r})[0]/r})})),n=Math.min.apply(null,r),isFinite(n)?n:0},m.offsetStartDTS=function(n,e,o){m.findBox(e,["moof","traf"]).map(function(r){return m.findBox(r,["tfhd"]).map(function(e){var t=m.readUint32(e,4),a=n[t].timescale||9e4;m.findBox(r,["tfdt"]).map(function(e){var t=e.data[e.start],r=m.readUint32(e,4);if(0===t)m.writeUint32(e,4,r-o*a);else{r*=Math.pow(2,32),r+=m.readUint32(e,8),r-=o*a,r=Math.max(r,0);var n=Math.floor(r/(s+1)),i=Math.floor(r%(s+1));m.writeUint32(e,4,n),m.writeUint32(e,8,i)}})})})},m.prototype.append=function(e,t,r,n){var i=this.initData;i||(this.resetInitSegment(e,this.audioCodec,this.videoCodec,!1),i=this.initData);var a,o=this.initPTS;if(void 0===o){var s=m.getStartDTS(i,e);this.initPTS=o=s-t,this.observer.trigger(l.default.INIT_PTS_FOUND,{initPTS:o})}m.offsetStartDTS(i,e,o),a=m.getStartDTS(i,e),this.remuxer.remux(i.audio,i.video,null,null,a,r,n,e)},m.prototype.destroy=function(){},m}();t.default=n},function(e,i,a){(function(r){Object.defineProperty(i,"__esModule",{value:!0});var e=a(7),n=a(16),t=function(){function t(){var e;this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[],this.programDateTime=null,this.rawProgramDateTime=null,this._elementaryStreams=((e={})[t.ElementaryStreamTypes.AUDIO]=!1,e[t.ElementaryStreamTypes.VIDEO]=!1,e)}return Object.defineProperty(t,"ElementaryStreamTypes",{get:function(){return{AUDIO:"audio",VIDEO:"video"}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return!this._url&&this.relurl&&(this._url=e.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(e){this._url=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"byteRange",{get:function(){if(!this._byteRange&&!this.rawByteRange)return[];if(this._byteRange)return this._byteRange;var e=[];if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var r=this.lastByteRangeEndOffset;e[0]=r||0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[0],this._byteRange=e}return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"byteRangeStartOffset",{get:function(){return this.byteRange[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"byteRangeEndOffset",{get:function(){return this.byteRange[1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"decryptdata",{get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"endProgramDateTime",{get:function(){if(!r.isFinite(this.programDateTime))return null;var e=r.isFinite(this.duration)?this.duration:0;return this.programDateTime+1e3*e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"encrypted",{get:function(){return!(!this.decryptdata.isQiniuDRM||null!==this.decryptdata.key)||!(!this.decryptdata||null===this.decryptdata.uri||null!==this.decryptdata.key)},enumerable:!0,configurable:!0}),t.prototype.addElementaryStream=function(e){this._elementaryStreams[e]=!0},t.prototype.hasElementaryStream=function(e){return!0===this._elementaryStreams[e]},t.prototype.createInitializationVector=function(e){for(var t=new Uint8Array(16),r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t},t.prototype.fragmentDecryptdataFromLevelkey=function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&((r=new n.default).method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r},t}();i.default=t}).call(this,a(2).Number)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(7),i=function(){function e(){this.method=null,this.key=null,this.iv=null,this._uri=null,this.isQiniuDRM=!1}return Object.defineProperty(e.prototype,"uri",{get:function(){return!this._uri&&this.reluri&&(this._uri=n.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri},enumerable:!0,configurable:!0}),e}();t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};t.isCodecType=function(e,t){var r=n[t];return!!r&&!0===r[e.slice(0,4)]},t.isCodecSupportedInMp4=function(e,t){return window.MediaSource.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"')}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var m,w=r(1),T=r(3),g=r(19),A=r(36),x=r(14),L=r(37),I=r(42),R=r(43),C=r(46),n=r(6),i=r(0),a=n.getSelfScope();try{m=a.performance.now.bind(a.performance)}catch(e){i.logger.debug("Unable to use Performance API on this environment"),m=a.Date.now}var o=function(){function e(e,t,r,n){this.observer=e,this.typeSupported=t,this.config=r,this.vendor=n}return e.prototype.destroy=function(){var e=this.demuxer;e&&e.destroy()},e.prototype.push=function(e,r,n,i,a,o,s,l,u,d,f,c){var h=this;if(0>>6),!((a=(60&t[r+2])>>>2)>f.length-1))return s=(1&t[r+2])<<2,s|=(192&t[r+3])>>>6,c.logger.log("manifest codec:"+n+",ADTS data:type:"+i+",sampleingIndex:"+a+"["+f[a]+"Hz],channelConfig:"+s),o=/firefox/i.test(u)?6<=a?(i=5,l=new Array(4),a-3):(i=2,l=new Array(2),a):-1!==u.indexOf("android")?(i=2,l=new Array(2),a):(i=5,l=new Array(4),n&&(-1!==n.indexOf("mp4a.40.29")||-1!==n.indexOf("mp4a.40.5"))||!n&&6<=a?a-3:((n&&-1!==n.indexOf("mp4a.40.2")&&(6<=a&&1===s||/vivaldi/i.test(u))||!n&&1===s)&&(i=2,l=new Array(2)),a)),l[0]=i<<3,l[0]|=(14&a)>>1,l[1]|=(1&a)<<7,l[1]|=s<<3,5===i&&(l[1]|=(14&o)>>1,l[2]=(1&o)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:f[a],channelCount:s,codec:"mp4a.40."+i,manifestCodec:d};e.trigger(p.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+a})}function i(e,t){return 255===e[t]&&240==(246&e[t+1])}function l(e,t){return 1&e[t+1]?7:9}function u(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function d(e){return 9216e4/e}function f(e,t,r,n,i){var a,o,s=e.length;if(a=l(e,t),o=u(e,t),0<(o-=a)&&t+a+o<=s)return{headerLength:a,frameLength:o,stamp:r+n*i}}t.getAudioConfig=o,t.isHeaderPattern=i,t.getHeaderLength=l,t.getFullFrameLength=u,t.isHeader=function(e,t){return!!(t+1t.length)){var a=this.parseHeader(t,r);if(a&&r+a.frameLength<=t.length){var o=n+i*(9e4*a.samplesPerFrame/a.sampleRate),s={unit:t.subarray(r,r+a.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(s),e.len+=a.frameLength,{sample:s,length:a.frameLength}}}},parseHeader:function(e,t){var r=e[t+1]>>3&3,n=e[t+1]>>1&3,i=e[t+2]>>4&15,a=e[t+2]>>2&3,o=e[t+2]>>1&1;if(1!==r&&0!==i&&15!==i&&3!==a){var s=3===r?3-n:3===n?3:4,l=1e3*m.BitratesMap[14*s+i-1],u=3===r?0:2===r?1:2,d=m.SamplingRateMap[3*u+a],f=e[t+3]>>6==3?1:2,c=m.SamplesCoefficients[r][n],h=m.BytesInSlot[n],p=8*c*h;return{sampleRate:d,channelCount:f,frameLength:parseInt(c*l/d+o,10)*h,samplesPerFrame:p}}},isHeaderPattern:function(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])},isHeader:function(e,t){return!!(t+1e.endSN)return 0;for(u=c-e.startSN,(d=e.fragments)[u]=t,f=u;0t)return n;return 0},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"maxAutoLevel",{get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"nextAutoLevel",{get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"audioTracks",{get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"audioTrack",{get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"liveSyncPosition",{get:function(){return this.streamController.liveSyncPosition},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"subtitleTracks",{get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"subtitleTrack",{get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"subtitleDisplay",{get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)},enumerable:!0,configurable:!0}),S}(r(22).Observer);t.default=d},function(e,t,n){(function(D){Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),U=n(15),P=n(26),k=n(16),O=n(27),M=n(0),l=n(17),u=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,f=/#EXT-X-MEDIA:(.*)/g,F=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),B=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,N=/\.(mp4|m4s|m4v|m4a)$/i,e=function(){function d(){}return d.findGroup=function(e,t){if(!e)return null;for(var r=null,n=0;nn.MAX_SAFE_INTEGER?1/0:t},r.prototype.hexadecimalInteger=function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),n=0;nn.MAX_SAFE_INTEGER?1/0:t},r.prototype.decimalFloatingPoint=function(e){return parseFloat(this[e])},r.prototype.enumeratedString=function(e){return this[e]},r.prototype.decimalResolution=function(e){var t=i.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},r.parseAttrList=function(e){var t,r={};for(a.lastIndex=0;null!==(t=a.exec(e));){var n=t[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),r[t[1]]=n}return r},r}();t.default=e}).call(this,r(2).Number)},function(e,i,s){(function(h){var n,t=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(i,"__esModule",{value:!0});var o=s(1),e=s(4),a=s(3),p=s(0),r=function(n){function e(e){var t=n.call(this,e,o.default.FRAG_LOADING)||this;return t.loaders={},t}return t(e,n),e.prototype.destroy=function(){var e=this.loaders;for(var t in e){var r=e[t];r&&r.destroy()}this.loaders={},n.prototype.destroy.call(this)},e.prototype.onFragLoading=function(e){var t=e.frag,r=t.type,n=this.loaders,i=this.hls.config,a=i.fLoader,o=i.loader;t.loaded=0;var s,l,u,d=n[r];d&&(p.logger.warn("abort previous fragment loader for type: "+r),d.abort()),d=n[r]=t.loader=i.fLoader?new a(i):new o(i),s={url:t.url,frag:t,responseType:"arraybuffer",progressData:!1};var f=t.byteRangeStartOffset,c=t.byteRangeEndOffset;h.isFinite(f)&&h.isFinite(c)&&(s.rangeStart=f,s.rangeEnd=c),l={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:i.fragLoadingMaxRetryTimeout},u={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},d.load(s,l,u)},e.prototype.loadsuccess=function(e,t,r,n){void 0===n&&(n=null);var i=e.data,a=r.frag;a.loader=void 0,this.loaders[a.type]=void 0,this.hls.trigger(o.default.FRAG_LOADED,{payload:i,frag:a,stats:t,networkDetails:n})},e.prototype.loaderror=function(e,t,r){void 0===r&&(r=null);var n=t.frag,i=n.loader;i&&i.abort(),this.loaders[n.type]=void 0,this.hls.trigger(o.default.ERROR,{type:a.ErrorTypes.NETWORK_ERROR,details:a.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t.frag,response:e,networkDetails:r})},e.prototype.loadtimeout=function(e,t,r){void 0===r&&(r=null);var n=t.frag,i=n.loader;i&&i.abort(),this.loaders[n.type]=void 0,this.hls.trigger(o.default.ERROR,{type:a.ErrorTypes.NETWORK_ERROR,details:a.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t.frag,networkDetails:r})},e.prototype.loadprogress=function(e,t,r,n){void 0===n&&(n=null);var i=t.frag;i.loaded=e.loaded,this.hls.trigger(o.default.FRAG_LOAD_PROGRESS,{frag:i,stats:e,networkDetails:n})},e}(e.default);i.default=r}).call(this,s(2).Number)},function(e,t,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var d=r(1),a=r(4),o=r(3),f=r(0),s=function(r){function e(e){var t=r.call(this,e,d.default.KEY_LOADING)||this;return t.loaders={},t.decryptkey=null,t.decrypturl=null,t.qiniuDRMKey=e.config.qiniuDRMKey,t}return i(e,r),e.prototype.destroy=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},a.default.prototype.destroy.call(this)},e.prototype.onKeyLoading=function(e){if(this.qiniuDRMKey)this.loadQiniuDRMKey(e);else{var t=e.frag,r=t.type,n=this.loaders[r],i=t.decryptdata,a=i.uri;if(a!==this.decrypturl||null===this.decryptkey){var o,s,l,u=this.hls.config;n&&(f.logger.warn("abort previous key loader for type:"+r),n.abort()),t.loader=this.loaders[r]=new u.loader(u),this.decrypturl=a,this.decryptkey=null,o={url:a,frag:t,responseType:"arraybuffer"},s={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout},l={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},t.loader.load(o,s,l)}else this.decryptkey&&(i.key=this.decryptkey,this.hls.trigger(d.default.KEY_LOADED,{frag:t}))}},e.prototype.loadsuccess=function(e,t,r){var n=r.frag;this.decryptkey=n.decryptdata.key=new Uint8Array(e.data),n.loader=void 0,this.loaders[n.type]=void 0,this.hls.trigger(d.default.KEY_LOADED,{frag:n})},e.prototype.loaderror=function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(d.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:e})},e.prototype.loadtimeout=function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(d.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},e.prototype.loadQiniuDRMKey=function(e){var t=e.frag;this.decryptkey=t.decryptdata.key=new Uint8Array(this.qiniuDRMKey),t.loader=void 0,this.loaders[t.type]=void 0,this.hls.trigger(d.default.KEY_LOADED,{frag:t})},e}(a.default);t.default=s},function(e,l,b){(function(u){var n,t=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(l,"__esModule",{value:!0});var p=b(10),c=b(8),h=b(31),m=b(1),r=b(9),d=b(15),i=b(13),f=b(23),a=b(50),o=b(3),g=b(0),y=b(51),v=b(52),s=b(53),_=b(54),e=function(n){function e(e,t){var r=n.call(this,e,m.default.MEDIA_ATTACHED,m.default.MEDIA_DETACHING,m.default.MANIFEST_LOADING,m.default.MANIFEST_PARSED,m.default.LEVEL_LOADED,m.default.KEY_LOADED,m.default.FRAG_LOADED,m.default.FRAG_LOAD_EMERGENCY_ABORTED,m.default.FRAG_PARSING_INIT_SEGMENT,m.default.FRAG_PARSING_DATA,m.default.FRAG_PARSED,m.default.ERROR,m.default.AUDIO_TRACK_SWITCHING,m.default.AUDIO_TRACK_SWITCHED,m.default.BUFFER_CREATED,m.default.BUFFER_APPENDED,m.default.BUFFER_FLUSHED)||this;return r.fragmentTracker=t,r.config=e.config,r.audioCodecSwap=!1,r._state=_.State.STOPPED,r.stallReported=!1,r.gapController=null,r.lastAutoLevelEnabled=r.hls.autoLevelEnabled,r}return t(e,n),e.prototype.onHandlerDestroying=function(){this.stopLoad(),n.prototype.onHandlerDestroying.call(this)},e.prototype.onHandlerDestroyed=function(){this.state=_.State.STOPPED,this.fragmentTracker=null,n.prototype.onHandlerDestroyed.call(this)},e.prototype.startLoad=function(e){if(this.levels){var t=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var n=r.startLevel;-1===n&&(n=0,this.bitrateTest=!0),this.level=r.nextLoadLevel=n,this.loadedmetadata=!1}0f&&(u.currentTime=f),this.nextLoadPosition=f}if(e.PTSKnown&&n=e.startSN&&c<=e.endSN){var h=a[c-e.startSN];i.cc===h.cc&&(s=h,g.logger.log("live playlist, switching playlist, load frag with next SN: "+s.sn))}s||(s=p.default.search(a,function(e){return i.cc-e.cc}))&&g.logger.log("live playlist, switching playlist, load frag with same CC: "+s.sn)}s||(s=a[Math.min(o-1,Math.round(o/2))],g.logger.log("live playlist, switching playlist, unknown, load middle frag : "+s.sn))}return s},e.prototype._findFragment=function(e,t,r,n,i,a,o){var s,l=this.hls.config;if(ia-l.maxFragLookUpTolerance?0:l.maxFragLookUpTolerance;s=v.findFragmentByPTS(t,n,i,u)}else s=n[r-1];if(s){var d=s.sn-o.startSN,f=t&&s.level===t.level,c=n[d-1],h=n[d+1];if(t&&s.sn===t.sn)if(f&&!s.backtracked)if(s.snl.maxBufferHole&&t.dropped&&d?(s=c,g.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this")):(s=h,g.logger.log("SN just loaded, load next one: "+s.sn,s))}else s=null;else s.backtracked&&(h&&h.backtracked?(g.logger.warn("Already backtracked from fragment "+h.sn+", will not backtrack to fragment "+s.sn+". Loading fragment "+h.sn),s=h):(g.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),s.dropped=0,c?(s=c).backtracked=!0:d&&(s=null)))}return s},e.prototype._loadKey=function(e){this.state=_.State.KEY_LOADING,this.hls.trigger(m.default.KEY_LOADING,{frag:e})},e.prototype._loadFragment=function(e){var t=this.fragmentTracker.getState(e);this.fragCurrent=e,this.startFragRequested=!0,u.isFinite(e.sn)&&!e.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),e.backtracked||t===r.FragmentState.NOT_LOADED||t===r.FragmentState.PARTIAL?(e.autoLevel=this.hls.autoLevelEnabled,e.bitrateTest=this.bitrateTest,this.hls.trigger(m.default.FRAG_LOADING,{frag:e}),this.demuxer||(this.demuxer=new h.default(this.hls,"main")),this.state=_.State.FRAG_LOADING):t===r.FragmentState.APPENDING&&this._reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e)},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(e){if(this.state!==e){var t=this.state;this._state=e,g.logger.log("main stream:"+t+"->"+e),this.hls.trigger(m.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},enumerable:!0,configurable:!0}),e.prototype.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,i.default.LevelType.MAIN)},Object.defineProperty(e.prototype,"currentLevel",{get:function(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextBufferedFrag",{get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null},enumerable:!0,configurable:!0}),e.prototype.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.endPTS+.5):null},Object.defineProperty(e.prototype,"nextLevel",{get:function(){var e=this.nextBufferedFrag;return e?e.level:-1},enumerable:!0,configurable:!0}),e.prototype._checkFragmentChanged=function(){var e,t,r=this.media;if(r&&r.readyState&&(!1===r.seeking||1===r.readyState)&&((t=r.currentTime)>this.lastCurrentTime&&(this.lastCurrentTime=t),c.BufferHelper.isBuffered(r,t)?e=this.getBufferedFrag(t):c.BufferHelper.isBuffered(r,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var n=e;if(this.hls.autoLevelEnabled!==this.lastAutoLevelEnabled&&(this.hls.trigger(m.default.LEVEL_SWITCHED,{level:n.level}),this.lastAutoLevelEnabled=this.hls.autoLevelEnabled),n!==this.fragPlaying){this.hls.trigger(m.default.FRAG_CHANGED,{frag:n});var i=n.level;this.lastAutoLevelEnabled=this.hls.autoLevelEnabled,this.fragPlaying&&this.fragPlaying.level===i&&this.fragPlaying.autoLevel===n.autoLevel||this.hls.trigger(m.default.LEVEL_SWITCHED,{level:i}),this.fragPlaying=n}}},e.prototype.immediateLevelSwitch=function(){if(g.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,t=void 0;e?(t=e.paused,e.pause()):t=!0,this.previouslyPaused=t}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,u.POSITIVE_INFINITY)},e.prototype.immediateLevelSwitchEnd=function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,c.BufferHelper.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())},e.prototype.nextLevelSwitch=function(){var e=this.media;if(e&&e.readyState){var t,r=void 0,n=void 0;if((t=this.getBufferedFrag(e.currentTime))&&1=e&&(t.maxMaxBufferLength/=2,g.logger.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},e.prototype._checkBuffer=function(){var e=this.media;if(e&&0!==e.readyState){var t=(this.mediaBuffer?this.mediaBuffer:e).buffered;!this.loadedmetadata&&t.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,t)}},e.prototype.onFragLoadEmergencyAborted=function(){this.state=_.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},e.prototype.onBufferFlushed=function(){var e=this.mediaBuffer?this.mediaBuffer:this.media;e&&this.fragmentTracker.detectEvictedFragments(d.default.ElementaryStreamTypes.VIDEO,e.buffered),this.state=_.State.IDLE,this.fragPrevious=null},e.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},e.prototype.computeLivePosition=function(e,t){var r=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*t.targetduration;return e+Math.max(0,t.totalduration-r)},e.prototype._seekToStartPos=function(){var e=this.media,t=e.currentTime,r=e.seeking?t:this.startPosition;t!==r&&(g.logger.log("target start position not buffered, seek to buffered.start(0) "+r+" from current time "+t+" "),e.currentTime=r)},e.prototype._getAudioCodec=function(e){var t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&(g.logger.log("swapping playlist audio codec"),t&&(t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),t},Object.defineProperty(e.prototype,"liveSyncPosition",{get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e},enumerable:!0,configurable:!0}),e}(_.default);l.default=e}).call(this,b(2).Number)},function(e,n,i){(function(y){Object.defineProperty(n,"__esModule",{value:!0});var u=i(32),d=i(1),f=i(18),v=i(0),c=i(3),e=i(12),t=i(6),h=i(22),p=t.getSelfScope(),m=e.getMediaSource(),r=function(){function e(r,e){var n=this;this.hls=r,this.id=e;var t=this.observer=new h.Observer,i=r.config,a=function(e,t){(t=t||{}).frag=n.frag,t.id=n.id,r.trigger(e,t)};t.on(d.default.FRAG_DECRYPTED,a),t.on(d.default.FRAG_PARSING_INIT_SEGMENT,a),t.on(d.default.FRAG_PARSING_DATA,a),t.on(d.default.FRAG_PARSED,a),t.on(d.default.ERROR,a),t.on(d.default.FRAG_PARSING_METADATA,a),t.on(d.default.FRAG_PARSING_USERDATA,a),t.on(d.default.INIT_PTS_FOUND,a);var o={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},s=navigator.vendor;if(i.enableWorker&&"undefined"!=typeof Worker){v.logger.log("demuxing in webworker");var l=void 0;try{l=this.w=u(48),this.onwmsg=this.onWorkerMessage.bind(this),l.addEventListener("message",this.onwmsg),l.onerror=function(e){r.trigger(d.default.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:e.message+" ("+e.filename+":"+e.lineno+")"}})},l.postMessage({cmd:"init",typeSupported:o,vendor:s,id:e,config:JSON.stringify(i)})}catch(r){v.logger.warn("Error in worker:",r),v.logger.error("Error while initializing DemuxerWorker, fallback on DemuxerInline"),l&&p.URL.revokeObjectURL(l.objectURL),this.demuxer=new f.default(t,o,i,s),this.w=void 0}}else this.demuxer=new f.default(t,o,i,s)}return e.prototype.destroy=function(){var e=this.w;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.w=null;else{var t=this.demuxer;t&&(t.destroy(),this.demuxer=null)}var r=this.observer;r&&(r.removeAllListeners(),this.observer=null)},e.prototype.push=function(e,t,r,n,i,a,o,s){var l=this.w,u=y.isFinite(i.startPTS)?i.startPTS:i.start,d=i.decryptdata,f=this.frag,c=!(f&&i.cc===f.cc),h=!(f&&i.level===f.level),p=f&&i.sn===f.sn+1,m=!h&&p;if(c&&v.logger.log(this.id+":discontinuity detected"),h&&v.logger.log(this.id+":switch detected"),this.frag=i,l)l.postMessage({cmd:"demux",data:e,decryptdata:d,initSegment:t,audioCodec:r,videoCodec:n,timeOffset:u,discontinuity:c,trackSwitch:h,contiguous:m,duration:a,accurateTimeOffset:o,defaultInitPTS:s},e instanceof ArrayBuffer?[e]:[]);else{var g=this.demuxer;g&&g.push(e,d,t,r,n,u,c,h,m,a,o,s)}},e.prototype.onWorkerMessage=function(e){var t=e.data,r=this.hls;switch(t.event){case"init":p.URL.revokeObjectURL(this.w.objectURL);break;case d.default.FRAG_PARSING_DATA:t.data.data1=new Uint8Array(t.data1),t.data2&&(t.data.data2=new Uint8Array(t.data2));default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data)}},e}();n.default=r}).call(this,i(2).Number)},function(e,t,h){function l(r){var n={};function i(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=r,i.c=n,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var e=i(i.s=ENTRY_MODULE);return e.default||e}var p="[\\.|\\-|\\+|\\w|/|@]+",m="\\((/\\*.*?\\*/)?s?.*?("+p+").*?\\)";function g(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function c(e,t,r){var n={};n[r]=[];var i,a=t.toString(),o=a.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return n;for(var s,l=o[1],u=new RegExp("(\\\\n|\\W)"+g(l)+m,"g");s=u.exec(a);)"dll-reference"!==s[3]&&n[r].push(s[3]);for(u=new RegExp("\\("+g(l)+'\\("(dll-reference\\s('+p+'))"\\)\\)'+m,"g");s=u.exec(a);)e[s[2]]||(n[r].push(s[1]),e[s[2]]=h(s[1]).m),n[s[2]]=n[s[2]]||[],n[s[2]].push(s[4]);for(var d=Object.keys(n),f=0;f>>8^255&g^99,e[h]=g,t[g]=h;var y=c[h],v=c[y],_=c[v],b=257*c[g]^16843008*g;n[h]=b<<24|b>>>8,i[h]=b<<16|b>>>16,a[h]=b<<8|b>>>24,o[h]=b,b=16843009*_^65537*v^257*y^16843008*h,l[g]=b<<24|b>>>8,u[g]=b<<16|b>>>16,d[g]=b<<8|b>>>24,f[g]=b,h?(h=y^c[c[c[_^y]]],p^=c[c[p]]):h=p=1}},e.prototype.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,n=0;n>4){if((s=i+5+e[i+4])===i+188)continue}else s=i+4;switch(o){case m:a&&(_&&(l=T(_))&&void 0!==l.pts&&A(l,!1),_={data:[],size:0}),_&&(_.data.push(e.subarray(s,i+188)),_.size+=i+188-s);break;case g:a&&(b&&(l=T(b))&&void 0!==l.pts&&(h.isAAC&&!h.g711Config?x(l):h.g711Config?L(l):I(l)),b={data:[],size:0}),b&&(b.data.push(e.subarray(s,i+188)),b.size+=i+188-s);break;case y:a&&(S&&(l=T(S))&&void 0!==l.pts&&R(l),S={data:[],size:0}),S&&(S.data.push(e.subarray(s,i+188)),S.size+=i+188-s);break;case 0:a&&(s+=e[s]+1),v=this._pmtId=E(e,s);break;case v:a&&(s+=e[s]+1);var D=w(e,s,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);0<(m=D.avc)&&(c.pid=m),0<(g=D.audio)&&(h.pid=g,h.isAAC=D.isAAC,h.g711Config=D.g711Config),0<(y=D.id3)&&(p.pid=y),d&&!f&&(k.logger.log("reparse from beginning"),d=!1,i=C-188),f=this.pmtParsed=!0;break;case 17:case 8191:break;default:d=!0}}else this.observer.trigger(P.default.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_&&(l=T(_))&&void 0!==l.pts?(A(l,!0),c.pesData=null):c.pesData=_,b&&(l=T(b))&&void 0!==l.pts?(h.isAAC&!h.g711Config?x(l):h.g711Config?L(l,!0):I(l),h.pesData=null):(b&&b.size&&k.logger.log("last AAC PES packet truncated,might overlap between fragments"),h.pesData=b),S&&(l=T(S))&&void 0!==l.pts?(R(l),p.pesData=null):p.pesData=S,null==this.sampleAes?this.remuxer.remux(h,c,p,this._txtTrack,t,r,n):this.decryptAndRemux(h,c,p,this._txtTrack,t,r,n)},U.prototype.decryptAndRemux=function(e,t,r,n,i,a,o){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,function(){s.decryptAndRemuxAvc(e,t,r,n,i,a,o)})}else this.decryptAndRemuxAvc(e,t,r,n,i,a,o)},U.prototype.decryptAndRemuxAvc=function(e,t,r,n,i,a,o){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,function(){s.remuxer.remux(e,t,r,n,i,a,o)})}else this.remuxer.remux(e,t,r,n,i,a,o)},U.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},U.prototype._parsePAT=function(e,t){return(31&e[t+10])<<8|e[t+11]},U.prototype._parsePMT=function(e,t,r,n){var i,a,o={audio:-1,avc:-1,id3:-1,isAAC:!0};for(i=t+3+((15&e[t+1])<<8|e[t+2])-4,t+=12+((15&e[t+10])<<8|e[t+11]);te.size-6)return null;192&(r=t[7])&&(4294967295<(o=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2)&&(o-=8589934592),64&r?(4294967295<(s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)&&(s-=8589934592),54e5=e[r-1].pts)e.push(t);else for(var n=r-1;0<=n;n--)if(t.ptse||(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord()),this.word<<=e,this.bitsAvailable-=e},e.prototype.readBits=function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return 32>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},e.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},e.prototype.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},e.prototype.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},e.prototype.readBoolean=function(){return 1===this.readBits(1)},e.prototype.readUByte=function(){return this.readBits(8)},e.prototype.readUShort=function(){return this.readBits(16)},e.prototype.readUInt=function(){return this.readBits(32)},e.prototype.skipScalingList=function(e){var t,r=8,n=8;for(t=0;t=e.length)return void r();if(!(e[t].unit.length<32)){var n=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,n),!n)return}}},e.prototype.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),n=0,i=32;i<=e.length-16;i+=160,n+=16)r.set(e.subarray(i,i+16),n);return r},e.prototype.getAvcDecryptedUnit=function(e,t){t=new Uint8Array(t);for(var r=0,n=32;n<=e.length-16;n+=160,r+=16)e.set(t.subarray(r,r+16),n);return e},e.prototype.decryptAvcSample=function(t,r,n,i,a,o){var s=this.discardEPB(a.data),e=this.getAvcEncryptedData(s),l=this;this.decryptBuffer(e.buffer,function(e){a.data=l.getAvcDecryptedUnit(s,e),o||l.decryptAvcSamples(t,r,n+1,i)})},e.prototype.decryptAvcSamples=function(e,t,r,n){for(;;t++,r=0){if(t>=e.length)return void n();for(var i=e[t].units;!(r>=i.length);r++){var a=i[r];if(!(a.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,n,a,o),!o)return}}}},e}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(41),a=function(){function e(e){this.Module=e}return e.prototype.getPCMData=function(e){if(this.config)return this.config.ulaw?i.decodeUlaw(e.data):i.decodeAlaw(e.data);n.logger.warn("can not find g711 config")},e.prototype.appendPCMSamples=function(e,t,r,n,i){var a;this.overlap_pcm?((a=new Uint8Array(t.length+this.overlap_pcm.length)).set(this.overlap_pcm,0),a.set(t,this.overlap_pcm.length),r-=this.overlap_pcm.length/2*9e4/e.samplerate):a=t;var o=a.length%2048,s=a.subarray(0,a.length-o);this.overlap_pcm=a.subarray(a.length-o,a.length),this._encodePCMtoAAC(s,e,r)},e.prototype._encodePCMtoAAC=function(e,t,r,n,i){var a=this.Module,o=e,s=a._malloc(o.length*o.BYTES_PER_ELEMENT);a.HEAPU8.set(o,s);var l=new Uint8Array(o.length),u=a._malloc(l.length*o.BYTES_PER_ELEMENT);a.HEAPU8.set(l,u);var d=new Uint32Array(Math.round(o.length/1024)),f=a._malloc(d.length*d.BYTES_PER_ELEMENT);a.HEAPU32.set(d,f);var c=new Uint32Array(1);c[0]=this.config.sampleRate;for(var h=a.ccall("pcm2aac","number",["number","number","number","number","number"],[c[0],s,o.length,u,f]),p=0;p>1,a[1]|=(1&i)<<7,a[1]|=8,e.config=a,e.channelCount=1,e.samplerate=this.config.sampleRate,e.codec="mp4a.40.2",e.manifestCodec=r,e.isAAC=!0},e.prototype._getFrameDuration=function(){return 9216e4/this.config.sampleRate},e}();t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var a=[-5504,-5248,-6016,-5760,-4480,-4224,-4992,-4736,-7552,-7296,-8064,-7808,-6528,-6272,-7040,-6784,-2752,-2624,-3008,-2880,-2240,-2112,-2496,-2368,-3776,-3648,-4032,-3904,-3264,-3136,-3520,-3392,-22016,-20992,-24064,-23040,-17920,-16896,-19968,-18944,-30208,-29184,-32256,-31232,-26112,-25088,-28160,-27136,-11008,-10496,-12032,-11520,-8960,-8448,-9984,-9472,-15104,-14592,-16128,-15616,-13056,-12544,-14080,-13568,-344,-328,-376,-360,-280,-264,-312,-296,-472,-456,-504,-488,-408,-392,-440,-424,-88,-72,-120,-104,-24,-8,-56,-40,-216,-200,-248,-232,-152,-136,-184,-168,-1376,-1312,-1504,-1440,-1120,-1056,-1248,-1184,-1888,-1824,-2016,-1952,-1632,-1568,-1760,-1696,-688,-656,-752,-720,-560,-528,-624,-592,-944,-912,-1008,-976,-816,-784,-880,-848,5504,5248,6016,5760,4480,4224,4992,4736,7552,7296,8064,7808,6528,6272,7040,6784,2752,2624,3008,2880,2240,2112,2496,2368,3776,3648,4032,3904,3264,3136,3520,3392,22016,20992,24064,23040,17920,16896,19968,18944,30208,29184,32256,31232,26112,25088,28160,27136,11008,10496,12032,11520,8960,8448,9984,9472,15104,14592,16128,15616,13056,12544,14080,13568,344,328,376,360,280,264,312,296,472,456,504,488,408,392,440,424,88,72,120,104,24,8,56,40,216,200,248,232,152,136,184,168,1376,1312,1504,1440,1120,1056,1248,1184,1888,1824,2016,1952,1632,1568,1760,1696,688,656,752,720,560,528,624,592,944,912,1008,976,816,784,880,848],o=[-32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956,-23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764,-15996,-15484,-14972,-14460,-13948,-13436,-12924,-12412,-11900,-11388,-10876,-10364,-9852,-9340,-8828,-8316,-7932,-7676,-7420,-7164,-6908,-6652,-6396,-6140,-5884,-5628,-5372,-5116,-4860,-4604,-4348,-4092,-3900,-3772,-3644,-3516,-3388,-3260,-3132,-3004,-2876,-2748,-2620,-2492,-2364,-2236,-2108,-1980,-1884,-1820,-1756,-1692,-1628,-1564,-1500,-1436,-1372,-1308,-1244,-1180,-1116,-1052,-988,-924,-876,-844,-812,-780,-748,-716,-684,-652,-620,-588,-556,-524,-492,-460,-428,-396,-372,-356,-340,-324,-308,-292,-276,-260,-244,-228,-212,-196,-180,-164,-148,-132,-120,-112,-104,-96,-88,-80,-72,-64,-56,-48,-40,-32,-24,-16,-8,0,32124,31100,30076,29052,28028,27004,25980,24956,23932,22908,21884,20860,19836,18812,17788,16764,15996,15484,14972,14460,13948,13436,12924,12412,11900,11388,10876,10364,9852,9340,8828,8316,7932,7676,7420,7164,6908,6652,6396,6140,5884,5628,5372,5116,4860,4604,4348,4092,3900,3772,3644,3516,3388,3260,3132,3004,2876,2748,2620,2492,2364,2236,2108,1980,1884,1820,1756,1692,1628,1564,1500,1436,1372,1308,1244,1180,1116,1052,988,924,876,844,812,780,748,716,684,652,620,588,556,524,492,460,428,396,372,356,340,324,308,292,276,260,244,228,212,196,180,164,148,132,120,112,104,96,88,80,72,64,56,48,40,32,24,16,8,0];t.decodeAlaw=function(e){for(var t=new Uint8Array(2*e.length),r=0,n=0;r>8,r+=1,n+=2}return t},t.decodeUlaw=function(e){for(var t=new Uint8Array(2*e.length),r=0,n=0;r>8,r+=1,n+=2}return t}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var p=r(11),i=r(0),m=r(21),n=function(){function e(e,t,r){this.observer=e,this.config=r,this.remuxer=t}return e.prototype.resetInitSegment=function(e,t,r,n){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:t,duration:n,inputTimeScale:9e4}},e.prototype.resetTimeStamp=function(){},e.probe=function(e){var t,r,n=p.default.getID3Data(e,0);if(n&&void 0!==p.default.getTimeStamp(n))for(t=n.length,r=Math.min(e.length-1,t+100);t.1*p&&J.logger.log("Invalid frame delta "+Math.round(T+p)+" at PTS "+Math.round(P/90)+" (should be "+Math.round(p)+")."),A.pts=A.dts=w,w+=p,E++}I=0;for(var C=v.length;I>24&255,t[1]=n>>16&255,t[2]=n>>8&255,t[3]=255&n,t.set(e,4),i=0,n=8;i>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))},c.mdia=function(e){return c.box(c.types.mdia,c.mdhd(e.timescale,e.duration),c.hdlr(e.type),c.minf(e))},c.mfhd=function(e){return c.box(c.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},c.minf=function(e){return"audio"===e.type?c.box(c.types.minf,c.box(c.types.smhd,c.SMHD),c.DINF,c.stbl(e)):c.box(c.types.minf,c.box(c.types.vmhd,c.VMHD),c.DINF,c.stbl(e))},c.moof=function(e,t,r){return c.box(c.types.moof,c.mfhd(e),c.traf(r,t))},c.moov=function(e){for(var t=e.length,r=[];t--;)r[t]=c.trak(e[t]);return c.box.apply(null,[c.types.moov,c.mvhd(e[0].timescale,e[0].duration)].concat(r).concat(c.mvex(e)))},c.mvex=function(e){for(var t=e.length,r=[];t--;)r[t]=c.trex(e[t]);return c.box.apply(null,[c.types.mvex].concat(r))},c.mvhd=function(e,t){t*=e;var r=Math.floor(t/(s+1)),n=Math.floor(t%(s+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return c.box(c.types.mvhd,i)},c.sdtp=function(e){var t,r,n=e.samples||[],i=new Uint8Array(4+n.length);for(r=0;r>>8&255),i.push(255&n),i=i.concat(Array.prototype.slice.call(r));for(t=0;t>>8&255),a.push(255&n),a=a.concat(Array.prototype.slice.call(r));var o=c.box(c.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|e.sps.length].concat(i).concat([e.pps.length]).concat(a))),s=e.width,l=e.height,u=e.pixelRatio[0],d=e.pixelRatio[1];return c.box(c.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,255&s,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,c.box(c.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),c.box(c.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,d>>24,d>>16&255,d>>8&255,255&d])))},c.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},c.mp4a=function(e){var t=e.samplerate;return c.box(c.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]),c.box(c.types.esds,c.esds(e)))},c.mp3=function(e){var t=e.samplerate;return c.box(c.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]))},c.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?c.box(c.types.stsd,c.STSD,c.mp4a(e)):c.box(c.types.stsd,c.STSD,c.mp3(e)):c.box(c.types.stsd,c.STSD,c.avc1(e))},c.tkhd=function(e){var t=e.id,r=e.duration*e.timescale,n=e.width,i=e.height,a=Math.floor(r/(s+1)),o=Math.floor(r%(s+1));return c.box(c.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,o>>24,o>>16&255,o>>8&255,255&o,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,i>>8&255,255&i,0,0]))},c.traf=function(e,t){var r=c.sdtp(e),n=e.id,i=Math.floor(t/(s+1)),a=Math.floor(t%(s+1));return c.box(c.types.traf,c.box(c.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),c.box(c.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a])),c.trun(e,r.length+16+20+8+16+8+8),r)},c.trak=function(e){return e.duration=e.duration||4294967295,c.box(c.types.trak,c.tkhd(e),c.mdia(e))},c.trex=function(e){var t=e.id;return c.box(c.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},c.trun=function(e,t){var r,n,i,a,o,s,l=e.samples||[],u=l.length,d=12+16*u,f=new Uint8Array(d);for(t+=8+d,f.set([0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,255&u,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),r=0;r>>24&255,i>>>16&255,i>>>8&255,255&i,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,s>>>24&255,s>>>16&255,s>>>8&255,255&s],12+16*r);return c.box(c.types.trun,f)},c.initSegment=function(e){c.types||c.init();var t,r=c.moov(e);return(t=new Uint8Array(c.FTYP.byteLength+r.byteLength)).set(c.FTYP),t.set(r,c.FTYP.byteLength),t},c}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var d=r(1),n=function(){function e(e){this.observer=e}return e.prototype.destroy=function(){},e.prototype.resetTimeStamp=function(){},e.prototype.resetInitSegment=function(){},e.prototype.remux=function(e,t,r,n,i,a,o,s){var l=this.observer,u="";e&&(u+="audio"),t&&(u+="video"),l.trigger(d.default.FRAG_PARSING_DATA,{data1:s,startPTS:i,startDTS:i,type:u,hasAudio:!!e,hasVideo:!!t,nb:1,dropped:0}),l.trigger(d.default.FRAG_PARSED)},e}();t.default=n},function(e,t,r){var n=Object.prototype.hasOwnProperty,h="~";function i(){}function a(e,t,r,n,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new function(e,t,r){this.fn=e,this.context=t,this.once=r||!1}(r,n||e,i),o=h?h+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],a]:e._events[o].push(a):(e._events[o]=a,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(h=!1)),o.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(h?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},o.prototype.listeners=function(e){var t=h?h+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,i=r.length,a=new Array(i);nr&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.once=function(e,t){if(!l(t))throw TypeError("listener must be a function");var r=!1;function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var r,n,i,a;if(!l(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(r=this._events[e]).length,n=-1,r===t||l(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=i;0r.startCC||e&&e.cct?-1:0})},t.shouldAlignOnDiscontinuities=s,t.findDiscontinuousReferenceFrag=l,t.adjustPts=u,t.alignStream=function(e,t,r){n(e,r,t),!r.PTSKnown&&t&&d(r,t.details)},t.alignDiscontinuities=n,t.alignPDT=d}).call(this,f(2).Number)},function(e,t,r){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var o=r(10);function s(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0);var n=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=e?1:r.start-n>e&&r.start?-1:0}function l(e,t,r){var n=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.endProgramDateTime-n>e}t.findFragmentByPDT=function(e,t,r){if(!Array.isArray(e)||!e.length||!a.isFinite(t))return null;if(t=e[e.length-1].endProgramDateTime)return null;r=r||0;for(var n=0;n1e3*r.highBufferWatchdogPeriod&&(this.stalled=null,this._tryNudgeBuffer())},e.prototype._reportStall=function(e){var t=this.hls,r=this.media;this.stallReported||(this.stallReported=!0,d.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer"),t.trigger(u.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:e}))},e.prototype._trySkipBufferHole=function(e){for(var t=this.hls,r=this.media,n=r.currentTime,i=0,a=0;a500*r.duration/s){var l=e.levels,u=Math.max(1,a.bw?a.bw/8:1e3*a.loaded/o),d=l[r.level],f=d.realBitrate?Math.max(d.realBitrate,d.bitrate):d.bitrate,c=a.total?a.total:Math.max(a.loaded,Math.round(r.duration*f/8)),h=t.currentTime,p=(c-a.loaded)/u,m=(b.BufferHelper.bufferInfo(t,h,e.config.maxBufferHole).end-h)/s;if(m<2*r.duration/s&&m=this.minWeight_},e.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.prototype.destroy=function(){},e}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=0,this.totalWeight_=0}return e.prototype.sample=function(e,t){var r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e},e.prototype.getTotalWeight=function(){return this.totalWeight_},e.prototype.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/e}return this.estimate_},e}();t.default=n},function(e,r,s){(function(n){var i,t=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var l=s(1),a=s(4),u=s(0),d=s(3),o=s(12).getMediaSource(),e=function(r){function e(e){var t=r.call(this,e,l.default.MEDIA_ATTACHING,l.default.MEDIA_DETACHING,l.default.MANIFEST_PARSED,l.default.BUFFER_RESET,l.default.BUFFER_APPENDING,l.default.BUFFER_CODECS,l.default.BUFFER_EOS,l.default.BUFFER_FLUSHING,l.default.LEVEL_PTS_UPDATED,l.default.LEVEL_UPDATED)||this;return t._msDuration=null,t._levelDuration=null,t._levelTargetDuration=10,t._live=null,t._objectUrl=null,t.bufferCodecEventsExpected=0,t.onsbue=t.onSBUpdateEnd.bind(t),t.onsbe=t.onSBUpdateError.bind(t),t.pendingTracks={},t.tracks={},t}return t(e,r),e.prototype.destroy=function(){a.default.prototype.destroy.call(this)},e.prototype.onLevelPtsUpdated=function(e){var t=e.type,r=this.tracks.audio;if("audio"===t&&r&&"audio/mpeg"===r.container){var n=this.sourceBuffer.audio;if(.1s.start(0)&&this.removeBufferRange(o,r[o],0,i)}}},e.prototype.onLevelUpdated=function(e){var t=e.details;0this._msDuration&&this._levelDuration>e||!n.isFinite(e))&&(u.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},e.prototype.doFlush=function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,r=this.sourceBuffer;try{for(var n in r)t+=r[n].buffered.length}catch(e){u.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(l.default.BUFFER_FLUSHED)}},e.prototype.doAppending=function(){var e=this.hls,t=this.segments,r=this.sourceBuffer;if(Object.keys(r).length){if(this.media.error)return this.segments=[],void u.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(t&&t.length){var n=t.shift();try{var i=r[n.type];i?i.updating?t.unshift(n):(i.ended=!1,this.parent=n.parent,i.appendBuffer(n.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(r){u.logger.error("error while trying to append buffer:"+r.message),t.unshift(n);var a={type:d.ErrorTypes.MEDIA_ERROR,parent:n.parent};22!==r.code?(this.appendError?this.appendError++:this.appendError=1,a.details=d.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry?(u.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],a.fatal=!0):a.fatal=!1):(this.segments=[],a.details=d.ErrorDetails.BUFFER_FULL_ERROR,a.fatal=!1),e.trigger(l.default.ERROR,a)}}}},e.prototype.flushBuffer=function(e,t,r){var n,i=this.sourceBuffer;if(Object.keys(i).length){if(u.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounterthis.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},i.prototype.getMaxLevel=function(r){var n=this;if(!this.levels)return-1;var e=this.levels.filter(function(e,t){return i.isLevelAllowed(t,n.restrictedLevels)&&t<=r});return i.getMaxLevelByMediaSize(e,this.mediaWidth,this.mediaHeight)},i.prototype._startCapping=function(){this.timer||(this.autoLevelCapping=n.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},i.prototype._stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=n.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},Object.defineProperty(i.prototype,"mediaWidth",{get:function(){var e,t=this.media;return t&&(e=t.width||t.clientWidth||t.offsetWidth,e*=i.contentScaleFactor),e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mediaHeight",{get:function(){var e,t=this.media;return t&&(e=t.height||t.clientHeight||t.offsetHeight,e*=i.contentScaleFactor),e},enumerable:!0,configurable:!0}),Object.defineProperty(i,"contentScaleFactor",{get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e},enumerable:!0,configurable:!0}),i.isLevelAllowed=function(e,t){return void 0===t&&(t=[]),-1===t.indexOf(e)},i.getMaxLevelByMediaSize=function(e,t,r){if(!e||e&&!e.length)return-1;for(var n=e.length-1,i=0;i=t||a.height>=r)&&(o=a,!(s=e[i+1])||o.width!==s.width||o.height!==s.height)){n=i;break}}var o,s;return n},i}(o(4).default);r.default=t}).call(this,o(2).Number)},function(e,t,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var d=r(1),a=r(4),f=r(0),c=window.performance,o=function(t){function e(e){return t.call(this,e,d.default.MEDIA_ATTACHING)||this}return i(e,t),e.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},e.prototype.onMediaAttaching=function(e){var t=this.hls.config;t.capLevelOnFPSDrop&&("function"==typeof(this.video=e.media instanceof window.HTMLVideoElement?e.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),t.fpsDroppedMonitoringPeriod))},e.prototype.checkFPS=function(e,t,r){var n=c.now();if(t){if(this.lastTime){var i=n-this.lastTime,a=r-this.lastDroppedFrames,o=t-this.lastDecodedFrames,s=1e3*a/i,l=this.hls;if(l.trigger(d.default.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:r}),0l.config.fpsDroppedMonitoringThreshold*o){var u=l.currentLevel;f.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),0=u)&&(u-=1,l.trigger(d.default.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:l.currentLevel}),l.autoLevelCapping=u,l.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=t}},e.prototype.checkFPSInterval=function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},e}(a.default);t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var d=r(0),f=window.performance,i=window.XMLHttpRequest,n=function(){function e(e){e&&e.xhrSetup&&(this.xhrSetup=e.xhrSetup)}return e.prototype.destroy=function(){this.abort(),this.loader=null},e.prototype.abort=function(){var e=this.loader;e&&4!==e.readyState&&(this.stats.aborted=!0,e.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},e.prototype.load=function(e,t,r){this.context=e,this.config=t,this.callbacks=r,this.stats={trequest:f.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()},e.prototype.loadInternal=function(){var e,t=this.context;e=this.loader=new i;var r=this.stats;r.tfirst=0,r.loaded=0;var n=this.xhrSetup;try{if(n)try{n(e,t.url)}catch(r){e.open("GET",t.url,!0),n(e,t.url)}e.readyState||e.open("GET",t.url,!0)}catch(r){return void this.callbacks.onError({code:e.status,text:r.message},t,e)}t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),e.send()},e.prototype.readystatechange=function(e){var t=e.currentTarget,r=t.readyState,n=this.stats,i=this.context,a=this.config;if(!n.aborted&&2<=r)if(window.clearTimeout(this.requestTimeout),0===n.tfirst&&(n.tfirst=Math.max(f.now(),n.trequest)),4===r){var o=t.status;if(200<=o&&o<300){n.tload=Math.max(n.tfirst,f.now());var s=void 0,l=void 0;l="arraybuffer"===i.responseType?(s=t.response).byteLength:(s=t.responseText).length,n.loaded=n.total=l;var u={url:t.responseURL,data:s};this.callbacks.onSuccess(u,n,i,t)}else n.retry>=a.maxRetry||400<=o&&o<499?(d.logger.error(o+" while loading "+i.url),this.callbacks.onError({code:o,text:t.statusText},i,t)):(d.logger.warn(o+" while loading "+i.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,a.maxRetryDelay),n.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),a.timeout)},e.prototype.loadtimeout=function(){d.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},e.prototype.loadprogress=function(e){var t=e.currentTarget,r=this.stats;r.loaded=e.loaded,e.lengthComputable&&(r.total=e.total);var n=this.callbacks.onProgress;n&&n(r,this.context,null,t)},e}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n="undefined"!=typeof window&&window.navigator&&window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess.bind(window.navigator):null;t.requestMediaKeySystemAccess=n}]).default)}),Wi=e(Vi),Yi=(Vi.Hls,function(){function e(e,t,r){this.category=e,this.code=t,this.name=t.toString(),this.message=r;try{throw new Error(this.toString())}catch(e){this.stack=e.stack}}return e.prototype.toString=function(){return"QPlayError."+this.category+"."+this.code+": "+this.message},e}());(Gi=ji||(ji={})).COMMON="COMMON",Gi.HLS="HLS",Gi.NATIVE="NATIVE",Gi.MP4="MP4",(qi=Hi||(Hi={}))[qi.UNSUPPORT=1e4]="UNSUPPORT",qi[qi.UNKNOWN_FORMAT=10001]="UNKNOWN_FORMAT",qi[qi.CAN_NOT_FETCH=10002]="CAN_NOT_FETCH",qi[qi.FULLSCRREN_NOTSUPPORT=10003]="FULLSCRREN_NOTSUPPORT",qi[qi.VIDEO_SOURCE_STALLED=10004]="VIDEO_SOURCE_STALLED",qi[qi.VIDEO_ELEMENT_ERROR=10005]="VIDEO_ELEMENT_ERROR",qi[qi.VIDEO_PLAY_FAILD=10006]="VIDEO_PLAY_FAILD",qi[qi.INVALID_CONFIG=10007]="INVALID_CONFIG",qi[qi.UNEXPECTED_ERROR=10008]="UNEXPECTED_ERROR",qi[qi.HLS_FATAL_ERROR=10009]="HLS_FATAL_ERROR",qi[qi.CAN_NOT_FETCH_WASM=10010]="CAN_NOT_FETCH_WASM",qi[qi.MP4_DRM_KEY_ERROR=10011]="MP4_DRM_KEY_ERROR";var Ki,Xi="object"==typeof Reflect?Reflect:null,Zi=Xi&&"function"==typeof Xi.apply?Xi.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};Ki=Xi&&"function"==typeof Xi.ownKeys?Xi.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Qi=Number.isNaN||function(e){return e!=e};function Ji(){Ji.init.call(this)}var $i=Ji;(Ji.EventEmitter=Ji).prototype._events=void 0,Ji.prototype._eventsCount=0,Ji.prototype._maxListeners=void 0;var ea=10;function ta(e){return void 0===e._maxListeners?Ji.defaultMaxListeners:e._maxListeners}function ra(e,t,r,n){var i,a,o,s;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),0<(i=ta(e))&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function na(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=function(){for(var e=[],t=0;tua.VERBOSE)){var r="%c"+this.name+"-verbose";console.info.apply(console,[r,"color: #66ccff;"].concat(e))}},e.prototype.debug=function(){for(var e=[],t=0;tua.DEBUG)){var r="%c"+this.name+"-debug";console.info.apply(console,[r,"color: #A28148; font-weight: bold;"].concat(e))}},e.prototype.warning=function(){for(var e=[],t=0;tua.WARNING)){var r="%c"+this.name+"-WARNING";console.warn.apply(console,[r,"color: #E44F44; font-weight: bold;"].concat(e))}},e.prototype.setLevel=function(e){for(var t in ua)if(ua[t]===e)return void(this.level=t);this.level="DEBUG"},e}())("QPLAYER"),fa=function(n){function i(e,t){var r=n.call(this,e,t,["#hls:mainfest-parsed"])||this;if(r.supportFeatures={bitrate:!0},r.config=t,!i.isSupport())throw new Yi(ji.HLS,Hi.UNSUPPORT,"not support hls");return r.initHLS(),r}return t(i,n),i.isSupport=function(e){return(!(e&&e.hls&&e.hls.isG711)||"object"==typeof window.WebAssembly&&"function"==typeof window.WebAssembly.Memory)&&Wi.isSupported()},i.probe=function(e,t){return!!e.split("?")[0].endsWith("m3u8")||("application/x-mpegurl"===t||"vnd.apple.mpegURL"===t)},i.prototype.toggleAutoQualityControl=function(){this.hls.autoLevelEnabled?this.hls.nextLevel=this.hls.currentLevel:this.hls.nextLevel=-1,this.emit("@auto-quality-switch-change",this.hls.autoLevelEnabled)},Object.defineProperty(i.prototype,"currentQuality",{get:function(){var t=-1===this.hls.currentLevel?this.hls.firstLevel:this.hls.currentLevel;return{quality:this.qualityList.find(function(e){return e.id===t})||null,isAuto:this.hls.autoLevelEnabled}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"qualityList",{get:function(){var r=this;return this.hls.levels.sort().map(function(e,t){return{id:t,name:r.config.qualityName?r.config.qualityName[t]:r.getHLSLevelName(e),bitrate:e.bitrate,url:e.url[0],type:"hls"}})},enumerable:!0,configurable:!0}),i.prototype.changeQuality=function(e){this.hls.autoLevelEnabled&&-1!==e&&this.emit("@auto-quality-switch-change",!1),this.hls.currentLevel=e},i.playConfigToEngineConfig=function(e,t){return a({url:e},t.hls)},i.prototype.reload=function(){this.hls.destroy(),this.initHLS()},i.prototype.destroy=function(){this.hls.destroy(),this.removeAllListeners()},i.prototype.getHLSLevelName=function(e){return e.name?e.name:e.height?e.height+"p":e.bitrate?Math.round(e.bitrate/1e3)+"kbps":"unkonwn"},i.prototype.initHLS=function(){var r=this,e={debug:"WARNING"!==da.level&&"DISABLE"!==da.level,qiniuDRMKey:this.config.DRMKey?this.config.DRMKey:void 0,g711WasmModule:this.config.g711WasmModule,enableWorker:!this.config.g711WasmModule},n=!0,i=!0;this.hls=new Wi(e),this.hls.loadSource(this.config.url),this.hls.attachMedia(this.render.video),this.hls.once(Wi.Events.MANIFEST_PARSED,function(){da.verbose("hls: mainfest parsed"),r.emit("#hls:mainfest-parsed"),r.emit("@get-quality-list",r.qualityList)}),this.hls.on(Wi.Events.LEVEL_SWITCHING,function(e,t){r.hls.autoLevelEnabled||(r.render.isLoading=!0,r.render.setLoadingStateLock(!0)),n?n=!1:r.emit("@quality-switching",t.level)}),this.hls.on(Wi.Events.LEVEL_SWITCHED,function(e,t){r.render.setLoadingStateLock(!1),r.render.isLoading=!1,i?i=!1:r.emit("@quality-switched",r.currentQuality.quality.id)}),this.hls.on(Wi.Events.ERROR,function(e,t){switch(console.log("handle hls error!",t),r.render.isLoading=!1,t.type){case Wi.ErrorTypes.NETWORK_ERROR:if(t.response&&400i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function Ra(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=function(){for(var e=[],t=0;t=e.start(r)&&t<=e.end(r))return!0;return!1}function Oa(e,t){if(0===e.length)return[t];for(var r=0,n=e;r=i.start&&t.end<=i.end)return e;if(t.start>i.end||t.endi.end?t.end:i.end;return i.start=a,i.end=o,e}return e}function Ma(e,t){if(e.length!==t.length)return!1;for(var r=0;r=this.getEndPosition()},i.prototype.readAnyInt=function(e,t){var r=0;if(this.position+e<=this.buffer.byteLength){switch(e){case 1:r=t?this.dataview.getInt8(this.position):this.dataview.getUint8(this.position);break;case 2:r=t?this.dataview.getInt16(this.position):this.dataview.getUint16(this.position);break;case 3:if(t)throw"No method for reading signed 24 bits values";r=this.dataview.getUint8(this.position)<<16,r|=this.dataview.getUint8(this.position)<<8,r|=this.dataview.getUint8(this.position);break;case 4:r=t?this.dataview.getInt32(this.position):this.dataview.getUint32(this.position);break;case 8:if(t)throw"No method for reading signed 64 bits values";r=this.dataview.getUint32(this.position)<<32,r|=this.dataview.getUint32(this.position);break;default:throw"readInt method not implemented for size: "+e}return this.position+=e,r}throw"Not enough bytes in buffer"},i.prototype.readUint8=function(){return this.readAnyInt(1,!1)},i.prototype.readUint16=function(){return this.readAnyInt(2,!1)},i.prototype.readUint24=function(){return this.readAnyInt(3,!1)},i.prototype.readUint32=function(){return this.readAnyInt(4,!1)},i.prototype.readUint64=function(){return this.readAnyInt(8,!1)},i.prototype.readString=function(e){if(this.position+e<=this.buffer.byteLength){for(var t="",r=0;rthis._byteLength&&(this._byteLength=t);else{for(r<1&&(r=1);r=this._byteLength},u.prototype.mapUint8Array=function(e){this._realloc(1*e);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);return this.position+=1*e,t},u.prototype.readInt32Array=function(e,t){e=null==e?this.byteLength-this.position/4:e;var r=new Int32Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readInt16Array=function(e,t){e=null==e?this.byteLength-this.position/2:e;var r=new Int16Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readInt8Array=function(e){e=null==e?this.byteLength-this.position:e;var t=new Int8Array(e);return u.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT),this.position+=t.byteLength,t},u.prototype.readUint32Array=function(e,t){e=null==e?this.byteLength-this.position/4:e;var r=new Uint32Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readUint16Array=function(e,t){e=null==e?this.byteLength-this.position/2:e;var r=new Uint16Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readUint8Array=function(e){e=null==e?this.byteLength-this.position:e;var t=new Uint8Array(e);return u.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT),this.position+=t.byteLength,t},u.prototype.readFloat64Array=function(e,t){e=null==e?this.byteLength-this.position/8:e;var r=new Float64Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readFloat32Array=function(e,t){e=null==e?this.byteLength-this.position/4:e;var r=new Float32Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readInt32=function(e){var t=this._dataView.getInt32(this.position,null==e?this.endianness:e);return this.position+=4,t},u.prototype.readInt16=function(e){var t=this._dataView.getInt16(this.position,null==e?this.endianness:e);return this.position+=2,t},u.prototype.readInt8=function(){var e=this._dataView.getInt8(this.position);return this.position+=1,e},u.prototype.readUint32=function(e){var t=this._dataView.getUint32(this.position,null==e?this.endianness:e);return this.position+=4,t},u.prototype.readUint16=function(e){var t=this._dataView.getUint16(this.position,null==e?this.endianness:e);return this.position+=2,t},u.prototype.readUint8=function(){var e=this._dataView.getUint8(this.position);return this.position+=1,e},u.prototype.readFloat32=function(e){var t=this._dataView.getFloat32(this.position,null==e?this.endianness:e);return this.position+=4,t},u.prototype.readFloat64=function(e){var t=this._dataView.getFloat64(this.position,null==e?this.endianness:e);return this.position+=8,t},u.endianness=0>16),this.writeUint8((65280&e)>>8),this.writeUint8(255&e)},u.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e),this.writeUint32(t),this.seek(r)},u.prototype.mapInt32Array=function(e,t){this._realloc(4*e);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);return u.arrayToNative(r,null==t?this.endianness:t),this.position+=4*e,r},u.prototype.mapInt16Array=function(e,t){this._realloc(2*e);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);return u.arrayToNative(r,null==t?this.endianness:t),this.position+=2*e,r},u.prototype.mapInt8Array=function(e){this._realloc(1*e);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);return this.position+=1*e,t},u.prototype.mapUint32Array=function(e,t){this._realloc(4*e);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);return u.arrayToNative(r,null==t?this.endianness:t),this.position+=4*e,r},u.prototype.mapUint16Array=function(e,t){this._realloc(2*e);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);return u.arrayToNative(r,null==t?this.endianness:t),this.position+=2*e,r},u.prototype.mapFloat64Array=function(e,t){this._realloc(8*e);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);return u.arrayToNative(r,null==t?this.endianness:t),this.position+=8*e,r},u.prototype.mapFloat32Array=function(e,t){this._realloc(4*e);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);return u.arrayToNative(r,null==t?this.endianness:t),this.position+=4*e,r};var o=function(e){this.buffers=[],this.bufferIndex=-1,e&&(this.insertBuffer(e),this.bufferIndex=0)};(o.prototype=new u(new ArrayBuffer,0,u.BIG_ENDIAN)).initialized=function(){var e;return-1i.byteLength){this.buffers.splice(n,1),n--;continue}c.warn("MultiBufferStream","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}else e.fileStart+e.byteLength<=i.fileStart||(e.fileStart+e.byteLength>i.fileStart+i.byteLength&&r.push(this.reduceBuffer(e,i.fileStart-e.fileStart,e.fileStart+e.byteLength-i.fileStart)),e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)),c.debug("MultiBufferStream","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")"),this.buffers.splice(n,0,e),0===n&&(this.buffer=e);t=!1;break}if(e.fileStart"+this.buffer.byteLength+")"),!0}return!1},o.prototype.cleanBufferRange=function(e,t){for(var r,n=[],i=0;i=t?[]:e>=r.fileStart+r.byteLength?[]:r.fileStart>=e&&r.fileStart+r.byteLength<=t?[r.fileStart,r.fileStart+r.byteLength]:r.fileStart<=e&&r.fileStart+r.byteLength>=t?[e,t]:r.fileStart<=e?[e,r.fileStart+r.byteLength]:[r.fileStart,t];if(0!==o.length)if(o[0]!==a.fileStart||o[1]!==a.fileStart+a.byteLength)if(o[0]!==a.fileStart)if(o[1]!==a.fileStart+a.byteLength){var s=this.reduceBuffer(a,o[1]-a.fileStart,a.fileStart+a.byteLength-o[1]);this.buffers[i]=this.reduceBuffer(a,0,o[0]-a.fileStart),n.push(s)}else this.buffers[i]=this.reduceBuffer(a,0,o[0]-a.fileStart);else this.buffers[i]=this.reduceBuffer(a,o[1]-a.fileStart,a.fileStart+a.byteLength-o[1]);else this.buffers[i]=new Uint8Array(0).buffer}var l=[];for(i=0;i=t?(c.debug("MultiBufferStream","Found position in existing buffer #"+a),a):-1},o.prototype.findEndContiguousBuf=function(e){var t,r,n,i=void 0!==e?e:this.bufferIndex;if(r=this.buffers[i],this.buffers.length>i+1)for(t=i+1;t>3;return 31===n&&2<=r.data.length&&(n=32+((7&r.data[0])<<3)+((224&r.data[1])>>5)),n}return null},o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,4,e)},o.DecoderConfigDescriptor.prototype=new o.Descriptor,o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8(),this.streamType=e.readUint8(),this.bufferSize=e.readUint24(),this.maxBitrate=e.readUint32(),this.avgBitrate=e.readUint32(),this.size-=13,this.parseRemainingDescriptors(e)},o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,5,e)},o.DecoderSpecificInfo.prototype=new o.Descriptor,o.SLConfigDescriptor=function(e){o.Descriptor.call(this,6,e)},o.SLConfigDescriptor.prototype=new o.Descriptor,this};t.MPEG4DescriptorParser=s;var S={ERR_INVALID_DATA:-1,ERR_NOT_ENOUGH_DATA:0,OK:1,BASIC_BOXES:["mdat","idat","free","skip","meco","strk"],FULL_BOXES:["hmhd","nmhd","iods","xml ","bxml","ipro","mere"],CONTAINER_BOXES:[["moov",["trak","pssh"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl",["sgpd","sbgp"]],["mvex",["trex"]],["moof",["traf"]],["traf",["trun","sgpd","sbgp"]],["vttc"],["tref"],["iref"],["mfra",["tfra"]],["meco"],["hnti"],["hinf"],["strk"],["strd"],["sinf"],["rinf"],["schi"],["trgr"],["udta",["kind"]],["iprp",["ipma"]],["ipco"]],boxCodes:[],fullBoxCodes:[],containerBoxCodes:[],sampleEntryCodes:{},sampleGroupEntryCodes:[],trackGroupTypes:[],UUIDBoxes:{},UUIDs:[],initialize:function(){S.FullBox.prototype=new S.Box,S.ContainerBox.prototype=new S.Box,S.SampleEntry.prototype=new S.Box,S.TrackGroupTypeBox.prototype=new S.FullBox,S.BASIC_BOXES.forEach(function(e){S.createBoxCtor(e)}),S.FULL_BOXES.forEach(function(e){S.createFullBoxCtor(e)}),S.CONTAINER_BOXES.forEach(function(e){S.createContainerBoxCtor(e[0],null,e[1])})},Box:function(e,t,r){this.type=e,this.size=t,this.uuid=r},FullBox:function(e,t,r){S.Box.call(this,e,t,r),this.flags=0,this.version=0},ContainerBox:function(e,t,r){S.Box.call(this,e,t,r),this.boxes=[]},SampleEntry:function(e,t,r,n){S.ContainerBox.call(this,e,t),this.hdr_size=r,this.start=n},SampleGroupEntry:function(e){this.grouping_type=e},TrackGroupTypeBox:function(e,t){S.FullBox.call(this,e,t)},createBoxCtor:function(t,e){S.boxCodes.push(t),S[t+"Box"]=function(e){S.Box.call(this,t,e)},S[t+"Box"].prototype=new S.Box,e&&(S[t+"Box"].prototype.parse=e)},createFullBoxCtor:function(t,r){S[t+"Box"]=function(e){S.FullBox.call(this,t,e)},S[t+"Box"].prototype=new S.FullBox,S[t+"Box"].prototype.parse=function(e){this.parseFullHeader(e),r&&r.call(this,e)}},addSubBoxArrays:function(e){if(e)for(var t=(this.subBoxNames=e).length,r=0;re.getEndPosition()?(e.seek(o),c.info("BoxParser","Not enough data in stream to parse the entire '"+u+"' box"),{code:S.ERR_NOT_ENOUGH_DATA,type:u,size:l,hdr_size:s,start:o}):t?{code:S.OK,type:u,size:l,hdr_size:s,start:o}:(S[u+"Box"]?n=new S[u+"Box"](l):"uuid"!==u?(c.warn("BoxParser","Unknown box type: '"+u+"'"),(n=new S.Box(u,l)).has_unparsed_data=!0):S.UUIDBoxes[a]?n=new S.UUIDBoxes[a](l):(c.warn("BoxParser","Unknown uuid type: '"+a+"'"),(n=new S.Box(u,l)).uuid=a,n.has_unparsed_data=!0),n.hdr_size=s,n.start=o,n.write===S.Box.prototype.write&&"mdat"!==n.type&&(c.info("BoxParser","'"+d+"' box writing not yet implemented, keeping unparsed data in memory for later write"),n.parseDataAndRewind(e)),n.parse(e),(i=e.getPosition()-(n.start+n.size))<0?(c.warn("BoxParser","Parsing of box '"+d+"' did not read the entire indicated box data size (missing "+-i+" bytes), seeking forward"),e.seek(n.start+n.size)):0>10&31,t[1]=this.language>>5&31,t[2]=31&this.language,this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96)},S.SAMPLE_ENTRY_TYPE_VISUAL="Visual",S.SAMPLE_ENTRY_TYPE_AUDIO="Audio",S.SAMPLE_ENTRY_TYPE_HINT="Hint",S.SAMPLE_ENTRY_TYPE_METADATA="Metadata",S.SAMPLE_ENTRY_TYPE_SUBTITLE="Subtitle",S.SAMPLE_ENTRY_TYPE_SYSTEM="System",S.SAMPLE_ENTRY_TYPE_TEXT="Text",S.SampleEntry.prototype.parseHeader=function(e){e.readUint8Array(6),this.data_reference_index=e.readUint16(),this.hdr_size+=8},S.SampleEntry.prototype.parse=function(e){this.parseHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size)},S.SampleEntry.prototype.parseDataAndRewind=function(e){this.parse(e),this.hdr_size-=8,e.position-=this.size-this.hdr_size},S.SampleEntry.prototype.parseFooter=function(e){S.ContainerBox.prototype.parse.call(this,e)},S.createMediaSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_HINT),S.createMediaSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_METADATA),S.createMediaSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_SUBTITLE),S.createMediaSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_SYSTEM),S.createMediaSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_TEXT),S.createMediaSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_VISUAL,function(e){this.parseHeader(e),e.readUint16(),e.readUint16(),e.readUint32Array(3),this.width=e.readUint16(),this.height=e.readUint16(),this.horizresolution=e.readUint32(),this.vertresolution=e.readUint32(),e.readUint32(),this.frame_count=e.readUint16();var t=Math.min(31,e.readUint8());this.compressorname=e.readString(t),t<31&&e.readString(31-t),this.depth=e.readUint16(),e.readUint16(),this.parseFooter(e)}),S.createMediaSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_AUDIO,function(e){this.parseHeader(e),e.readUint32Array(2),this.channel_count=e.readUint16(),this.samplesize=e.readUint16(),e.readUint16(),e.readUint16(),this.samplerate=e.readUint32()/65536,this.parseFooter(e)}),S.createSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_VISUAL,"avc1"),S.createSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_VISUAL,"av01"),S.createSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_VISUAL,"hvc1"),S.createSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_VISUAL,"hev1"),S.createSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_AUDIO,"mp4a"),S.createSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_AUDIO,"ac-3"),S.createSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_AUDIO,"ec-3"),S.createEncryptedSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_VISUAL,"encv"),S.createEncryptedSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_AUDIO,"enca"),S.createEncryptedSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_SUBTITLE,"encu"),S.createEncryptedSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_SYSTEM,"encs"),S.createEncryptedSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_TEXT,"enct"),S.createEncryptedSampleEntryCtor(S.SAMPLE_ENTRY_TYPE_METADATA,"encm"),S.createFullBoxCtor("CoLL",function(e){this.maxCLL=e.readUint16(),this.maxFALL=e.readUint16()}),S.createFullBoxCtor("SmDm",function(e){this.primaryRChromaticity_x=e.readUint16(),this.primaryRChromaticity_y=e.readUint16(),this.primaryGChromaticity_x=e.readUint16(),this.primaryGChromaticity_y=e.readUint16(),this.primaryBChromaticity_x=e.readUint16(),this.primaryBChromaticity_y=e.readUint16(),this.whitePointChromaticity_x=e.readUint16(),this.whitePointChromaticity_y=e.readUint16(),this.luminanceMax=e.readUint32(),this.luminanceMin=e.readUint32()}),S.TrackGroupTypeBox.prototype.parse=function(e){this.parseFullHeader(e),this.track_group_id=e.readUint32()},S.TrackReferenceTypeBox=function(e,t,r,n){S.Box.call(this,e,t),this.hdr_size=r,this.start=n},S.TrackReferenceTypeBox.prototype=new S.Box,S.TrackReferenceTypeBox.prototype.parse=function(e){this.track_ids=e.readUint32Array((this.size-this.hdr_size)/4)},S.createBoxCtor("av1C",function(e){var t=e.readUint8();if(t>>7&!1)c.error("av1C marker problem");else if(this.version=127&t,1===this.version)if(t=e.readUint8(),this.seq_profile=t>>5&7,this.seq_level_idx_0=31&t,t=e.readUint8(),this.seq_tier_0=t>>7&1,this.high_bitdepth=t>>6&1,this.twelve_bit=t>>5&1,this.monochrome=t>>4&1,this.chroma_subsampling_x=t>>3&1,this.chroma_subsampling_y=t>>2&1,this.chroma_sample_position=3&t,t=e.readUint8(),this.reserved_1=t>>5&7,0===this.reserved_1){if(this.initial_presentation_delay_present=t>>4&1,1===this.initial_presentation_delay_present)this.initial_presentation_delay_minus_one=15&t;else if(this.reserved_2=15&t,0!==this.reserved_2)return void c.error("av1C reserved_2 parsing problem");var r=this.size-this.hdr_size-4;this.configOBUs=e.readUint8Array(r)}else c.error("av1C reserved_1 parsing problem");else c.error("av1C version "+this.version+" not supported")}),S.createBoxCtor("avcC",function(e){var t,r;for(this.configurationVersion=e.readUint8(),this.AVCProfileIndication=e.readUint8(),this.profile_compatibility=e.readUint8(),this.AVCLevelIndication=e.readUint8(),this.lengthSizeMinusOne=3&e.readUint8(),this.nb_SPS_nalus=31&e.readUint8(),r=this.size-this.hdr_size-6,this.SPS=[],t=0;t>7}else"rICC"===this.colour_type?this.ICC_profile=e.readUint8Array(this.size-4):"prof"===this.colour_type&&(this.ICC_profile=e.readUint8Array(this.size-4))}),S.createFullBoxCtor("cprt",function(e){this.parseLanguage(e),this.notice=e.readCString()}),S.createFullBoxCtor("cslg",function(e){0===this.version&&(this.compositionToDTSShift=e.readInt32(),this.leastDecodeToDisplayDelta=e.readInt32(),this.greatestDecodeToDisplayDelta=e.readInt32(),this.compositionStartTime=e.readInt32(),this.compositionEndTime=e.readInt32())}),S.createFullBoxCtor("ctts",function(e){var t,r;if(t=e.readUint32(),this.sample_counts=[],this.sample_offsets=[],0===this.version)for(r=0;r>6,this.bsid=t>>1&31,this.bsmod=(1&t)<<2|r>>6&3,this.acmod=r>>3&7,this.lfeon=r>>2&1,this.bit_rate_code=3&r|n>>5&7}),S.createBoxCtor("dec3",function(e){var t=e.readUint16();this.data_rate=t>>3,this.num_ind_sub=7&t,this.ind_subs=[];for(var r=0;r>6,n.bsid=i>>1&31,n.bsmod=(1&i)<<4|a>>4&15,n.acmod=a>>1&7,n.lfeon=1&a,n.num_dep_sub=o>>1&15,0>12,e.readUint8Array(20)),t.push(r[i]),128&n)break}this.numMetadataBlocks=t.length+" ("+t.join(", ")+")"}),S.createBoxCtor("dimm",function(e){this.bytessent=e.readUint64()}),S.createBoxCtor("dmax",function(e){this.time=e.readUint32()}),S.createBoxCtor("dmed",function(e){this.bytessent=e.readUint64()}),S.createFullBoxCtor("dref",function(e){var t,r;this.entries=[];for(var n=e.readUint32(),i=0;i>6,this.general_tier_flag=(32&i)>>5,this.general_profile_idc=31&i,this.general_profile_compatibility=e.readUint32(),this.general_constraint_indicator=e.readUint8Array(6),this.general_level_idc=e.readUint8(),this.min_spatial_segmentation_idc=4095&e.readUint16(),this.parallelismType=3&e.readUint8(),this.chroma_format_idc=3&e.readUint8(),this.bit_depth_luma_minus8=7&e.readUint8(),this.bit_depth_chroma_minus8=7&e.readUint8(),this.avgFrameRate=e.readUint16(),i=e.readUint8(),this.constantFrameRate=i>>6,this.numTemporalLayers=(13&i)>>3,this.temporalIdNested=(4&i)>>2,this.lengthSizeMinusOne=3&i,this.nalu_arrays=[];var a=e.readUint8();for(t=0;t>7,o.nalu_type=63&i;var s=e.readUint16();for(r=0;r>4&15,this.length_size=15&t,t=e.readUint8(),this.base_offset_size=t>>4&15,1===this.version||2===this.version?this.index_size=15&t:this.index_size=0,this.items=[];var r=0;if(this.version<2)r=e.readUint16();else{if(2!==this.version)throw"version of iloc box not supported";r=e.readUint32()}for(var n=0;n>7==1,1&this.flags?o.property_index=(127&a)<<8|e.readUint8():o.property_index=127&a}}}),S.createFullBoxCtor("iref",function(e){var t,r;for(this.references=[];e.getPosition()>7,n.assignment_type=127&i,n.assignment_type){case 0:n.grouping_type=e.readString(4);break;case 1:n.grouping_type=e.readString(4),n.grouping_type_parameter=e.readUint32();break;case 2:case 3:break;case 4:n.sub_track_id=e.readUint32();break;default:c.warn("BoxParser","Unknown leva assignement type")}}}),S.createBoxCtor("maxr",function(e){this.period=e.readUint32(),this.bytes=e.readUint32()}),S.createBoxCtor("mdcv",function(e){this.display_primaries=[],this.display_primaries[0]={},this.display_primaries[0].x=e.readUint16(),this.display_primaries[0].y=e.readUint16(),this.display_primaries[1]={},this.display_primaries[1].x=e.readUint16(),this.display_primaries[1].y=e.readUint16(),this.display_primaries[2]={},this.display_primaries[2].x=e.readUint16(),this.display_primaries[2].y=e.readUint16(),this.white_point={},this.white_point.x=e.readUint16(),this.white_point.y=e.readUint16(),this.max_display_mastering_luminance=e.readUint32(),this.min_display_mastering_luminance=e.readUint32()}),S.createFullBoxCtor("mdhd",function(e){1==this.version?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.timescale=e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.timescale=e.readUint32(),this.duration=e.readUint32()),this.parseLanguage(e),e.readUint16()}),S.createFullBoxCtor("mehd",function(e){1&this.flags&&(c.warn("BoxParser","mehd box incorrectly uses flags set to 1, converting version to 1"),this.version=1),1==this.version?this.fragment_duration=e.readUint64():this.fragment_duration=e.readUint32()}),S.createFullBoxCtor("meta",function(e){this.boxes=[],S.ContainerBox.prototype.parse.call(this,e)}),S.createFullBoxCtor("mfhd",function(e){this.sequence_number=e.readUint32()}),S.createFullBoxCtor("mfro",function(e){this._size=e.readUint32()}),S.createFullBoxCtor("mvhd",function(e){1==this.version?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.timescale=e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.timescale=e.readUint32(),this.duration=e.readUint32()),this.rate=e.readUint32(),this.volume=e.readUint16()>>8,e.readUint16(),e.readUint32Array(2),this.matrix=e.readUint32Array(9),e.readUint32Array(6),this.next_track_id=e.readUint32()}),S.createBoxCtor("npck",function(e){this.packetssent=e.readUint32()}),S.createBoxCtor("nump",function(e){this.packetssent=e.readUint64()}),S.createFullBoxCtor("padb",function(e){var t=e.readUint32();this.padbits=[];for(var r=0;r>7,this.avgRateFlag=t>>6&1,this.durationFlag&&(this.duration=e.readUint32()),this.avgRateFlag&&(this.accurateStatisticsFlag=e.readUint8(),this.avgBitRate=e.readUint16(),this.avgFrameRate=e.readUint16()),this.dependency=[];for(var r=e.readUint8(),n=0;n>7,this.num_leading_samples=127&t}),S.createSampleGroupCtor("rash",function(e){if(this.operation_point_count=e.readUint16(),this.description_length!==2+(1===this.operation_point_count?2:6*this.operation_point_count)+9)c.warn("BoxParser","Mismatch in "+this.grouping_type+" sample group length"),this.data=e.readUint8Array(this.description_length-2);else{if(1===this.operation_point_count)this.target_rate_share=e.readUint16();else{this.target_rate_share=[],this.available_bitrate=[];for(var t=0;t>4,this.skip_byte_block=15&t,this.isProtected=e.readUint8(),this.Per_Sample_IV_Size=e.readUint8(),this.KID=S.parseHex16(e),this.constant_IV_size=0,this.constant_IV=0,1===this.isProtected&&0===this.Per_Sample_IV_Size&&(this.constant_IV_size=e.readUint8(),this.constant_IV=e.readUint8Array(this.constant_IV_size))}),S.createSampleGroupCtor("stsa",function(e){c.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),S.createSampleGroupCtor("sync",function(e){var t=e.readUint8();this.NAL_unit_type=63&t}),S.createSampleGroupCtor("tele",function(e){var t=e.readUint8();this.level_independently_decodable=t>>7}),S.createSampleGroupCtor("tsas",function(e){c.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),S.createSampleGroupCtor("tscl",function(e){c.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),S.createSampleGroupCtor("vipr",function(e){c.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),S.createFullBoxCtor("sbgp",function(e){this.grouping_type=e.readString(4),1===this.version?this.grouping_type_parameter=e.readUint32():this.grouping_type_parameter=0,this.entries=[];for(var t=e.readUint32(),r=0;r>6,this.sample_depends_on[n]=t>>4&3,this.sample_is_depended_on[n]=t>>2&3,this.sample_has_redundancy[n]=3&t}),S.createFullBoxCtor("senc"),S.createFullBoxCtor("sgpd",function(e){this.grouping_type=e.readString(4),c.debug("BoxParser","Found Sample Groups of type "+this.grouping_type),1===this.version?this.default_length=e.readUint32():this.default_length=0,2<=this.version&&(this.default_group_description_index=e.readUint32()),this.entries=[];for(var t=e.readUint32(),r=0;r>31&1,n.referenced_size=2147483647&i,n.subsegment_duration=e.readUint32(),i=e.readUint32(),n.starts_with_SAP=i>>31&1,n.SAP_type=i>>28&7,n.SAP_delta_time=268435455&i}this.first_offset+=e.position}),S.SingleItemTypeReferenceBox=function(e,t,r,n){S.Box.call(this,e,t),this.hdr_size=r,this.start=n},S.SingleItemTypeReferenceBox.prototype=new S.Box,S.SingleItemTypeReferenceBox.prototype.parse=function(e){this.from_item_ID=e.readUint16();var t=e.readUint16();this.references=[];for(var r=0;r>4&15,this.sample_sizes[t+1]=15&n}else if(8===this.field_size)for(t=0;t>4&15,this.default_skip_byte_block=15&t}this.default_isProtected=e.readUint8(),this.default_Per_Sample_IV_Size=e.readUint8(),this.default_KID=S.parseHex16(e),1===this.default_isProtected&&0===this.default_Per_Sample_IV_Size&&(this.default_constant_IV_size=e.readUint8(),this.default_constant_IV=e.readUint8Array(this.default_constant_IV_size))}),S.createFullBoxCtor("tfdt",function(e){1==this.version?this.baseMediaDecodeTime=e.readUint64():this.baseMediaDecodeTime=e.readUint32()}),S.createFullBoxCtor("tfhd",function(e){var t=0;this.track_id=e.readUint32(),this.size-this.hdr_size>t&&this.flags&S.TFHD_FLAG_BASE_DATA_OFFSET?(this.base_data_offset=e.readUint64(),t+=8):this.base_data_offset=0,this.size-this.hdr_size>t&&this.flags&S.TFHD_FLAG_SAMPLE_DESC?(this.default_sample_description_index=e.readUint32(),t+=4):this.default_sample_description_index=0,this.size-this.hdr_size>t&&this.flags&S.TFHD_FLAG_SAMPLE_DUR?(this.default_sample_duration=e.readUint32(),t+=4):this.default_sample_duration=0,this.size-this.hdr_size>t&&this.flags&S.TFHD_FLAG_SAMPLE_SIZE?(this.default_sample_size=e.readUint32(),t+=4):this.default_sample_size=0,this.size-this.hdr_size>t&&this.flags&S.TFHD_FLAG_SAMPLE_FLAGS?(this.default_sample_flags=e.readUint32(),t+=4):this.default_sample_flags=0}),S.createFullBoxCtor("tfra",function(e){this.track_ID=e.readUint32(),e.readUint24();var t=e.readUint8();this.length_size_of_traf_num=t>>4&3,this.length_size_of_trun_num=t>>2&3,this.length_size_of_sample_num=3&t,this.entries=[];for(var r=e.readUint32(),n=0;n>8,e.readUint16(),this.matrix=e.readInt32Array(9),this.width=e.readUint32(),this.height=e.readUint32()}),S.createBoxCtor("tmax",function(e){this.time=e.readUint32()}),S.createBoxCtor("tmin",function(e){this.time=e.readUint32()}),S.createBoxCtor("totl",function(e){this.bytessent=e.readUint32()}),S.createBoxCtor("tpay",function(e){this.bytessent=e.readUint32()}),S.createBoxCtor("tpyl",function(e){this.bytessent=e.readUint64()}),S.createTrackGroupCtor("msrc"),S.trefBox.prototype.parse=function(e){for(var t,r;e.getPosition()t&&this.flags&S.TRUN_FLAGS_DATA_OFFSET?(this.data_offset=e.readInt32(),t+=4):this.data_offset=0,this.size-this.hdr_size>t&&this.flags&S.TRUN_FLAGS_FIRST_FLAG?(this.first_sample_flags=e.readUint32(),t+=4):this.first_sample_flags=0,this.sample_duration=[],this.sample_size=[],this.sample_flags=[],this.sample_composition_time_offset=[],this.size-this.hdr_size>t)for(var r=0;r>4,this.chromaSubsampling=t>>1&7,this.videoFullRangeFlag=1&t,this.colourPrimaries=e.readUint8(),this.transferCharacteristics=e.readUint8(),this.matrixCoefficients=e.readUint8()):(this.profile=e.readUint8(),this.level=e.readUint8(),t=e.readUint8(),this.bitDepth=t>>4&15,this.colorSpace=15&t,t=e.readUint8(),this.chromaSubsampling=t>>4&15,this.transferFunction=t>>1&7,this.videoFullRangeFlag=1&t),this.codecIntializationDataSize=e.readUint16(),this.codecIntializationData=e.readUint8Array(this.codecIntializationDataSize)}),S.createBoxCtor("vttC",function(e){this.text=e.readString(this.size-this.hdr_size)}),S.SampleEntry.prototype.isVideo=function(){return!1},S.SampleEntry.prototype.isAudio=function(){return!1},S.SampleEntry.prototype.isSubtitle=function(){return!1},S.SampleEntry.prototype.isMetadata=function(){return!1},S.SampleEntry.prototype.isHint=function(){return!1},S.SampleEntry.prototype.getCodec=function(){return this.type.replace(".","")},S.SampleEntry.prototype.getWidth=function(){return""},S.SampleEntry.prototype.getHeight=function(){return""},S.SampleEntry.prototype.getChannelCount=function(){return""},S.SampleEntry.prototype.getSampleRate=function(){return""},S.SampleEntry.prototype.getSampleSize=function(){return""},S.VisualSampleEntry.prototype.isVideo=function(){return!0},S.VisualSampleEntry.prototype.getWidth=function(){return this.width},S.VisualSampleEntry.prototype.getHeight=function(){return this.height},S.AudioSampleEntry.prototype.isAudio=function(){return!0},S.AudioSampleEntry.prototype.getChannelCount=function(){return this.channel_count},S.AudioSampleEntry.prototype.getSampleRate=function(){return this.samplerate},S.AudioSampleEntry.prototype.getSampleSize=function(){return this.samplesize},S.SubtitleSampleEntry.prototype.isSubtitle=function(){return!0},S.MetadataSampleEntry.prototype.isMetadata=function(){return!0},S.decimalToHex=function(e,t){var r=Number(e).toString(16);for(t=null==t?t=2:t;r.length>=1;t+=S.decimalToHex(n,0),t+=".",0===this.hvcC.general_tier_flag?t+="L":t+="H",t+=this.hvcC.general_level_idc;var i=!1,a="";for(e=5;0<=e;e--)(this.hvcC.general_constraint_indicator[e]||i)&&(a="."+S.decimalToHex(this.hvcC.general_constraint_indicator[e],0)+a,i=!0);t+=a}return t},S.mp4aSampleEntry.prototype.getCodec=function(){var e=S.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI(),r=this.esds.esd.getAudioConfig();return e+"."+S.decimalToHex(t)+(r?"."+r:"")}return e},S.stxtSampleEntry.prototype.getCodec=function(){var e=S.SampleEntry.prototype.getCodec.call(this);return this.mime_format?e+"."+this.mime_format:e},S.av01SampleEntry.prototype.getCodec=function(){var e,t=S.SampleEntry.prototype.getCodec.call(this);return 2===this.av1C.seq_profile&&1===this.av1C.high_bitdepth?e=1===this.av1C.twelve_bit?12:10:this.av1C.seq_profile<=2&&(e=1===this.av1C.high_bitdepth?10:8),t+"."+this.av1C.seq_profile+"."+this.av1C.seq_level_idx_0+(this.av1C.seq_tier_0?"H":"M")+"."+e+"."+this.av1C.monochrome+"."+this.av1C.chroma_subsampling_x+this.av1C.chroma_subsampling_y+this.av1C.chroma_sample_position},S.Box.prototype.writeHeader=function(e,t){this.size+=8,this.size>a&&(this.size+=8),"uuid"===this.type&&(this.size+=16),c.debug("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.getPosition()+(t||"")),this.size>a?e.writeUint32(1):(this.sizePosition=e.getPosition(),e.writeUint32(this.size)),e.writeString(this.type,null,4),"uuid"===this.type&&e.writeUint8Array(this.uuid),this.size>a&&e.writeUint64(this.size)},S.FullBox.prototype.writeHeader=function(e){this.size+=4,S.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags),e.writeUint8(this.version),e.writeUint24(this.flags)},S.Box.prototype.write=function(e){"mdat"===this.type?this.data&&(this.size=this.data.length,this.writeHeader(e),e.writeUint8Array(this.data)):(this.size=this.data?this.data.length:0,this.writeHeader(e),this.data&&e.writeUint8Array(this.data))},S.ContainerBox.prototype.write=function(e){this.size=0,this.writeHeader(e);for(var t=0;t=r.samples.length&&(a=!0),n.rapAlignement&&r.nextSample-n.lastSegmentSampleIndex>=n.nb_samples&&(!o||o.is_sync)&&(a=!0),n.rapAlignement||r.nextSample%n.nb_samples!=0||(a=!0),a&&(c.info("ISOFile","Sending fragmented data on track #"+n.id+" for samples ["+Math.max(0,r.nextSample-n.nb_samples)+","+(r.nextSample-1)+"]"),c.info("ISOFile","Sample data size in memory: "+this.getAllocatedSampleDataSize()),n.lastSegmentSampleIndex=r.nextSample,this.onSegment&&this.onSegment(n.id,n.user,n.segmentStream.buffer,r.nextSample,e&&r.nextSample>=r.samples.length),n.segmentStream=null,n!==this.fragmentedTracks[t]))break}e&&r.nextSample===r.samples.length&&(this.onSegment&&this.onSegment(n.id,n.user,n.segmentStream.buffer,r.nextSample,e&&r.nextSample>=r.samples.length),n.segmentStream=null)}if(null!==this.onSamples)for(t=0;t=r.samples.length)&&(c.debug("ISOFile","Sending samples on track #"+s.id+" for sample "+r.nextSample),this.onSamples&&this.onSamples(s.id,s.user,s.samples),s.samples=[],s!==this.extractedTracks[t]))break}}}},x.prototype.getBox=function(e){var t=this.getBoxes(e,!0);return t.length?t[0]:null},x.prototype.getBoxes=function(e,t){var r=[];return x._sweep.call(this,e,r,t),r},x._sweep=function(e,t,r){for(var n in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&r)return;x._sweep.call(this.boxes[n],e,t,r)}},x.prototype.getTrackSamplesInfo=function(e){var t=this.getTrackById(e);return t?t.samples:void 0},x.prototype.getTrackSample=function(e,t){var r=this.getTrackById(e);return this.getSample(r,t)},x.prototype.releaseUsedSamples=function(e,t){var r=0,n=this.getTrackById(e);n.lastValidSample||(n.lastValidSample=0);for(var i=n.lastValidSample;ie*i.timescale){l=n-1;break}t&&i.is_sync&&(s=n)}for(t&&(l=s),e=r.samples[l].cts,r.nextSample=l;l=n[i].last_sample_in_run&&(n[i].last_sample_in_run<0&&(n[i].last_sample_in_run=0),n[i].entry_index++,n[i].entry_index<=n[i].sbgp.entries.length-1&&(n[i].last_sample_in_run+=n[i].sbgp.entries[n[i].entry_index].sample_count)),n[i].entry_index<=n[i].sbgp.entries.length-1?t.sample_groups[i].group_description_index=n[i].sbgp.entries[n[i].entry_index].group_description_index:t.sample_groups[i].group_description_index=-1,0!==t.sample_groups[i].group_description_index)o=n[i].fragment_description?n[i].fragment_description:n[i].description,0>16)-1:t.sample_groups[i].group_description_index-1,o&&0<=a&&(t.sample_groups[i].description=o.entries[a])):o&&2<=o.version&&0>16&1),h.is_leading=p>>26&3,h.depends_on=p>>24&3,h.is_depended_on=p>>22&3,h.has_redundancy=p>>20&3,h.degradation_priority=65535&p;var g=!!(d.tfhd.flags&S.TFHD_FLAG_BASE_DATA_OFFSET),y=!!(d.tfhd.flags&S.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),v=!!(m.flags&S.TRUN_FLAGS_DATA_OFFSET),_=0;_=g?d.tfhd.base_data_offset:y?u.start:0===t?u.start:s,h.offset=0===t&&0===r?v?_+m.data_offset:_:s,s=h.offset+h.size,(0a&&(this.size+=8),"uuid"===this.type&&(this.size+=16),e.log(e.indent+"size:"+this.size),e.log(e.indent+"type:"+this.type)},S.FullBox.prototype.printHeader=function(e){this.size+=4,S.Box.prototype.printHeader.call(this,e),e.log(e.indent+"version:"+this.version),e.log(e.indent+"flags:"+this.flags)},S.Box.prototype.print=function(e){this.printHeader(e)},S.ContainerBox.prototype.print=function(e){this.printHeader(e);for(var t=0;t>8)),e.log(e.indent+"matrix: "+this.matrix.join(", ")),e.log(e.indent+"next_track_id: "+this.next_track_id)},S.tkhdBox.prototype.print=function(e){S.FullBox.prototype.printHeader.call(this,e),e.log(e.indent+"creation_time: "+this.creation_time),e.log(e.indent+"modification_time: "+this.modification_time),e.log(e.indent+"track_id: "+this.track_id),e.log(e.indent+"duration: "+this.duration),e.log(e.indent+"volume: "+(this.volume>>8)),e.log(e.indent+"matrix: "+this.matrix.join(", ")),e.log(e.indent+"layer: "+this.layer),e.log(e.indent+"alternate_group: "+this.alternate_group),e.log(e.indent+"width: "+this.width),e.log(e.indent+"height: "+this.height)};var f={createFile:function(e,t){var r=void 0===e||e,n=new x(t);return n.discardMdatData=!r,n}};t.createFile=f.createFile}(Na={exports:{}},Na.exports),Na.exports);Ga.Log,Ga.MP4BoxStream,Ga.DataStream,Ga.MultiBufferStream,Ga.MPEG4DescriptorParser,Ga.BoxParser,Ga.XMLSubtitlein4Parser,Ga.Textin4Parser,Ga.ISOFile,Ga.createFile;(ja=za||(za={})).INIT_SEGMENT="muxer:init_segment",ja.SEGMENT="muxer:segment",ja.DURATION_UPDATE="muxer:duration_update",ja.SEEK="muxer:seek",ja.ENDED="muxer:ended";var Ha,qa=function(t){function e(e){var o=t.call(this)||this;return o.lastBufferData=new Uint8Array(0),o.keyBoxSize=0,o.appendBuffer=function(e,t,r){if(0!==t.length){e=e-o.keyBoxSize-o.lastBufferData.length;var n=0t&&(t=e.end(r));return t}(a.drmMp4.video.buffered);try{a.mediaSource.endOfStream()}catch(e){Fa(a.drmMp4,Ea.MEDIA,"can not end of stream"+e.toString())}}},a.handleSourceOpen=function(){if(a.endFlag=!1,a.updateDurationFlag&&(a.mediaSource.duration=a.duration,a.updateDurationFlag=!1),a.isFirstSourceOpen){a.isFirstSourceOpen=!1,a.pendingInitSegments.audio&&(a.createSourceBuffer(a.pendingInitSegments.audio.info),a.appendSegment(a.pendingInitSegments.audio.segment,"audio")),a.pendingInitSegments.video&&(a.createSourceBuffer(a.pendingInitSegments.video.info),a.appendSegment(a.pendingInitSegments.video.segment,"video"));for(var e=0,t=a.pendingSegmants.audio;e=e.start(n)&&r<=e.end(n)){if(e.end(n)===t)return;return e.end(n)}return r}(r.media.buffered,r.media.duration,r.media.currentTime);t===r.media.currentTime?(r.lastCurrentTime=r.media.currentTime,r.emit(Va.SEEK,r.media.currentTime)):void 0!==t&&(r.nextUnbufferedTime=t);break;case"timeupdate":r.emit(Va.TIMEUPDATE,r.media.currentTime)}},r.media=e,r.bindMediaEvents(),r}return ha(e,t),e.prototype.release=function(){this.media.removeEventListener("seeking",this.handleMediaEvents),this.media.removeEventListener("timeupdate",this.handleMediaEvents)},e.prototype.bindMediaEvents=function(){this.media.addEventListener("seeking",this.handleMediaEvents),this.media.addEventListener("timeupdate",this.handleMediaEvents)},e}(_a);var Xa=function(n){function e(e,t){var r=n.call(this)||this;return r.config=t,r.video=e,r}return ha(e,n),e.isSupport=function(){return function(){try{return window.fetch&&window.ReadableStream}catch(e){return!1}}()&&MediaSource&&MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')&&("probably"===(e=document.createElement("video").canPlayType("video/mp4"))||"maybe"===e);var e},e.prototype.start=function(e){this.url=e,this.media=new Ka(this.video),this.io=new Ba(this),this.muxer=new qa(this),this.buffer=new Ya(this.video,this),this.io.on(Ta.ON_CHUNK,this.muxer.appendBuffer),this.io.on(Ta.ENDED,this.muxer.flushBuffer),this.muxer.on(za.INIT_SEGMENT,this.buffer.appendInitSegment),this.muxer.on(za.SEGMENT,this.buffer.appendSegment),this.muxer.on(za.DURATION_UPDATE,this.buffer.updateDuration),this.muxer.on(za.ENDED,this.buffer.endStream),this.media.on(Va.SEEK,this.muxer.seek),this.media.on(Va.PRELOAD,this.muxer.seek),this.muxer.on(za.SEEK,this.io.seek),this.media.on(Va.TIMEUPDATE,this.buffer.handleTimeUpdate),this.media.on(Va.SEEK,this.buffer.handleTimeUpdate),this.buffer.on(Ha.BUFFER_IO_STATE_CHANGE,this.io.onBufferIoStateChange),this.io.start(this.url,{start:0,end:-1})},e.prototype.destroy=function(){this.io&&(this.io.removeAllListeners(),this.io.release()),this.muxer&&(this.muxer.removeAllListeners(),this.muxer.release()),this.media&&(this.media.removeAllListeners(),this.media.release()),this.buffer&&(this.buffer.removeAllListeners(),this.buffer.release())},e}(_a),Za=function(n){function e(e,t){var r=n.call(this,e,t,[])||this;if(!t.DRMCompanyKey)throw new Error("no drm key!");return r.core=new Xa(r.render.video,{maxBufferTime:600,maxIoRetry:10,compKey:new Uint8Array(t.DRMCompanyKey)}),r.initEngine(),r}return t(e,n),e.isSupport=function(e){return!!(e&&e.mp4&&e.mp4.DRMCompanyKey)&&Xa.isSupport()},e.probe=function(e,t){return"video/mp4"===t},e.playConfigToEngineConfig=function(e,t){return a({url:e},t.mp4)},e.prototype.reload=function(){this.core.destroy(),this.core.start(this.config.url)},e.prototype.destroy=function(){this.core.destroy(),this.removeAllListeners()},e.prototype.initEngine=function(){var t=this;this.core.on("error",function(e){switch(e.type){case"key":return void t.emit("error",new Yi(ji.MP4,Hi.MP4_DRM_KEY_ERROR,"mp4 drm key is error!"))}}),this.core.start(this.config.url),this.handleRenderEvents()},e}(sa),Qa=function(n){function i(e,t){var r=n.call(this,e,t,[])||this;if(!i.isSupport())throw new Yi(ji.NATIVE,Hi.UNSUPPORT,"not support html5 video/audio");return r.initNative(),r}return t(i,n),i.isSupport=function(){return!!document.createElement("video").canPlayType},i.probe=function(e,t,r){if(r.hls&&r.hls.DRMKey)return!1;if(r.hls&&r.hls.isG711)return!1;if(r.mp4&&r.mp4.DRMCompanyKey)return!1;if(!t)return!1;switch(document.createElement("video").canPlayType(t)){case"maybe":return da.verbose("can't detect if "+e+" can be played"),!0;case"probably":return!0;default:return!1}},i.playConfigToEngineConfig=function(e,t){return{url:e}},i.prototype.reload=function(){var e=this.render.video.src;this.render.video.src="",this.render.video.load(),this.render.video.src=e,this.render.play()},i.prototype.destroy=function(){this.removeAllListeners()},i.prototype.initNative=function(){this.render.video.src=this.config.url,this.handleRenderEvents()},i}(sa);function Ja(e,t){return e(t={exports:{}},t.exports),t.exports}var $a=Ja(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),eo=Ja(function(e){var t=e.exports={version:"2.6.3"};"number"==typeof __e&&(__e=t)}),to=(eo.version,function(e){return"object"==typeof e?null!==e:"function"==typeof e}),ro=function(e){if(!to(e))throw TypeError(e+" is not an object!");return e},no=function(e){try{return!!e()}catch(e){return!0}},io=!no(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),ao=$a.document,oo=to(ao)&&to(ao.createElement),so=!io&&!no(function(){return 7!=Object.defineProperty((e="div",oo?ao.createElement(e):{}),"a",{get:function(){return 7}}).a;var e}),lo=Object.defineProperty,uo={f:io?Object.defineProperty:function(e,t,r){if(ro(e),t=function(e,t){if(!to(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!to(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!to(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!to(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")}(t,!0),ro(r),so)try{return lo(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},fo=io?function(e,t,r){return uo.f(e,t,{enumerable:!((n=1)&n),configurable:!(2&n),writable:!(4&n),value:r});var n}:function(e,t,r){return e[t]=r,e},co={}.hasOwnProperty,ho=function(e,t){return co.call(e,t)},po=0,mo=Math.random(),go=Ja(function(e){var t,a="Symbol(".concat(void 0===(t="src")?"":t,")_",(++po+mo).toString(36)),r="toString",n=Function[r],o=(""+n).split(r);eo.inspectSource=function(e){return n.call(e)},(e.exports=function(e,t,r,n){var i="function"==typeof r;i&&(ho(r,"name")||fo(r,"name",t)),e[t]!==r&&(i&&(ho(r,a)||fo(r,a,e[t]?""+e[t]:o.join(String(t)))),e===$a?e[t]=r:n?e[t]?e[t]=r:fo(e,t,r):(delete e[t],fo(e,t,r)))})(Function.prototype,r,function(){return"function"==typeof this&&this[a]||n.call(this)})}),yo=function(n,i,e){if(function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!")}(n),void 0===i)return n;switch(e){case 1:return function(e){return n.call(i,e)};case 2:return function(e,t){return n.call(i,e,t)};case 3:return function(e,t,r){return n.call(i,e,t,r)}}return function(){return n.apply(i,arguments)}},vo="prototype",_o=function(e,t,r){var n,i,a,o,s=e&_o.F,l=e&_o.G,u=e&_o.S,d=e&_o.P,f=e&_o.B,c=l?$a:u?$a[t]||($a[t]={}):($a[t]||{})[vo],h=l?eo:eo[t]||(eo[t]={}),p=h[vo]||(h[vo]={});for(n in l&&(r=t),r)a=((i=!s&&c&&void 0!==c[n])?c:r)[n],o=f&&i?yo(a,$a):d&&"function"==typeof a?yo(Function.call,a):a,c&&go(c,n,a,e&_o.U),h[n]!=a&&fo(h,n,o),d&&p[n]!=a&&(p[n]=a)};$a.core=eo,_o.F=1,_o.G=2,_o.S=4,_o.P=8,_o.B=16,_o.W=32,_o.U=64,_o.R=128;var bo=_o,So=Math.ceil,Eo=Math.floor,wo=function(e){return isNaN(e=+e)?0:(0>>=1)&&(t+=t))1&n&&(r+=t);return r}.call(s,Math.ceil(u/s.length));return d.length>u&&(d=d.slice(0,u)),n?d+a:a+d},Lo=$a.navigator,Io=Lo&&Lo.userAgent||"";bo(bo.P+bo.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(Io),"String",{padStart:function(e){return xo(this,e,1Math.abs(i))s.setState({gestureType:ms.SEEK_CONTROL,gestureSeekTime:0});else{if(/iPad|iPhone|iPod/.test(navigator.userAgent))break;s.setState({gestureType:ms.VOLUME_CONTROL,gestureVolume:s.props.player.volume}),s.touchStartVolume=s.props.player.volume}s.touchX=r.clientX,s.touchY=r.clientY;break;case"end":switch(s.touchX=void 0,s.touchY=void 0,s.state.gestureType){case ms.SEEK_CONTROL:var o=s.props.player.currentTime+s.state.gestureSeekTime;s.props.player.seek(Math.min(s.props.player.totalTime,Math.max(0,o)))}s.setState({gestureType:void 0})}},s.state={isFullscreen:!1,showSettings:!1,isMuted:e.player.isMuted,volume:e.player.volume,showControlBtn:!e.player.config.isLive,gestureSeekTime:0,gestureVolume:0},s}return ds(e,t),e.prototype.componentDidMount=function(){var t=this;this.props.player.on("fullscreenchange",this.handleFullscreenChange),this.props.player.on("volumechange",this.handleVolumeChange),this.props.player.on("get-quality-list",function(e){1e.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||r){if(r){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function A(e){var t=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i>4,d[l++]=(15&n)<<4|i>>2,d[l++]=(3&i)<<6|63&a;return u}function F(e){var t,r=new Uint8Array(e),n="";for(t=0;t>2],n+=C[(3&r[t])<<4|r[t+1]>>4],n+=C[(15&r[t+1])<<2|r[t+2]>>6],n+=C[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var B={serialize:function(t,r){var e="";if(t&&(e=O.call(t)),t&&("[object ArrayBuffer]"===e||t.buffer&&"[object ArrayBuffer]"===O.call(t.buffer))){var n,i=U;t instanceof ArrayBuffer?(n=t,i+="arbf"):(n=t.buffer,"[object Int8Array]"===e?i+="si08":"[object Uint8Array]"===e?i+="ui08":"[object Uint8ClampedArray]"===e?i+="uic8":"[object Int16Array]"===e?i+="si16":"[object Uint16Array]"===e?i+="ur16":"[object Int32Array]"===e?i+="si32":"[object Uint32Array]"===e?i+="ui32":"[object Float32Array]"===e?i+="fl32":"[object Float64Array]"===e?i+="fl64":r(new Error("Failed to get type for BinaryArray"))),r(i+F(n))}else if("[object Blob]"===e){var a=new FileReader;a.onload=function(){var e="~~local_forage_type~"+t.type+"~"+F(this.result);r(U+"blob"+e)},a.readAsArrayBuffer(t)}else try{r(JSON.stringify(t))}catch(e){console.error("Couldn't convert value into a JSON string: ",t),r(null,e)}},deserialize:function(e){if(e.substring(0,P)!==U)return JSON.parse(e);var t,r=e.substring(k),n=e.substring(P,k);if("blob"===n&&D.test(r)){var i=r.match(D);t=i[1],r=r.substring(i[0].length)}var a=M(r);switch(n){case"arbf":return a;case"blob":return o([a],{type:t});case"si08":return new Int8Array(a);case"ui08":return new Uint8Array(a);case"uic8":return new Uint8ClampedArray(a);case"si16":return new Int16Array(a);case"ur16":return new Uint16Array(a);case"si32":return new Int32Array(a);case"ui32":return new Uint32Array(a);case"fl32":return new Float32Array(a);case"fl64":return new Float64Array(a);default:throw new Error("Unkown type: "+n)}},stringToBuffer:M,bufferToString:F};function N(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function z(e,n,i,a,o,s){e.executeSql(i,a,o,function(e,r){r.code===r.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[n.storeName],function(e,t){t.rows.length?s(e,r):N(e,n,function(){e.executeSql(i,a,o,s)},s)},s):s(e,r)},s)}function j(o,e,s,l){var u=this;o=d(o);var t=new f(function(i,a){u.ready().then(function(){void 0===e&&(e=null);var r=e,n=u._dbInfo;n.serializer.serialize(e,function(t,e){e?a(e):n.db.transaction(function(e){z(e,n,"INSERT OR REPLACE INTO "+n.storeName+" (key, value) VALUES (?, ?)",[o,t],function(){i(r)},function(e,t){a(t)})},function(e){if(e.code===e.QUOTA_ERR){if(0 '__WebKitDatabaseInfoTable__'",[],function(e,t){for(var r=[],n=0;n>2],r=t+e+15&-16;if((P[z>>2]=r,X<=r)&&!Y())return P[z>>2]=t,0;return t}function n(e,t){return t||(t=16),e=Math.ceil(e/t)*t}function g(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return 4;if("i"!==e[0])return 0;var t=parseInt(e.substr(1));return y(t%8==0),t/8}}var i={"f64-rem":function(e,t){return e%t},debugger:function(){}},a=0;function y(e,t){e||ze("Assertion failed: "+t)}function v(e){var t=d["_"+e];return y(t,"Cannot call unknown function "+e+", make sure it is exported"),t}var o={stackSave:function(){Fe()},stackRestore:function(){Me()},arrayToC:function(e){var t,r,n=Oe(e.length);return t=e,r=n,C.set(t,r),n},stringToC:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);t=Oe(r),L(e,D,t,r)}return t}},_={string:o.stringToC,array:o.arrayToC};function s(e,t,r,n,i){var a=v(e),o=[],s=0;if(n)for(var l=0;l>0]=t;break;case"i16":U[e>>1]=t;break;case"i32":P[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,1<=+ie(tempDouble)?0>>0:~~+ae((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],P[e>>2]=tempI64[0],P[e+4>>2]=tempI64[1];break;case"float":k[e>>2]=t;break;case"double":O[e>>3]=t;break;default:ze("invalid type for setValue: "+r)}}var l=0,S=2,E=4;function u(e,t,r,n){var i,a;a="number"==typeof e?(i=!0,e):(i=!1,e.length);var o,s="string"==typeof t?t:null;if(o=r==E?n:["function"==typeof ke?ke:p,Oe,p,m][void 0===r?S:r](Math.max(a,s?1:t.length)),i){var l;for(y(0==(3&(n=o))),l=o+(-4&a);n>2]=0;for(l=o+a;n>0]=0;return o}if("i8"===s)return e.subarray||e.slice?D.set(e,o):D.set(new Uint8Array(e),o),o;for(var u,d,f,c=0;c>0],(0!=r||t)&&(i++,!t||i!=t););t||(t=i);var a="";if(n<128){for(var o;0>10,56320|1023&u)}else l+=String.fromCharCode((31&n)<<6|i);else l+=String.fromCharCode(n)}}function L(e,t,r,n){if(!(0>6,t[r++]=128|63&s}else if(s<=65535){if(a<=r+2)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else if(s<=2097151){if(a<=r+3)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}else if(s<=67108863){if(a<=r+4)break;t[r++]=248|s>>24,t[r++]=128|s>>18&63,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(a<=r+5)break;t[r++]=252|s>>30,t[r++]=128|s>>24&63,t[r++]=128|s>>18&63,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-i}function I(e){for(var t=0,r=0;r>2]>t)return!1;var r=X;for(X=Math.max(X,H);X>2];)X=X<=536870912?q(2*X,e):Math.min(q((3*X+2147483648)/4,e),t);var n=d.reallocBuffer(X);return n&&n.byteLength==X?(V(n),W(),!0):(X=r,!1)}M=B=z=0,F=!1,d.reallocBuffer||(d.reallocBuffer=function(e){var t;try{if(ArrayBuffer.transfer)t=ArrayBuffer.transfer(R,e);else{var r=C;t=new ArrayBuffer(e),new Int8Array(t).set(r)}}catch(e){return!1}return!!Ue(t)&&t});try{Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get)(new ArrayBuffer(4))}catch(e){(function(e){return e.byteLength})}var K=d.TOTAL_STACK||5242880,X=d.TOTAL_MEMORY||268435456;function Z(e){for(;0>0]=e.charCodeAt(n);r||(C[t>>0]=0)}var ie=Math.abs,ae=Math.ceil,oe=Math.floor,se=Math.min,le=Math.trunc,ue=0,de=null,fe=null;d.preloadedImages={},d.preloadedAudios={};var ce="data:application/octet-stream;base64,";function he(e){return String.prototype.startsWith?e.startsWith(ce):0===e.indexOf(ce)}!function(){"function"==typeof d.locateFile&&(he(wasmTextFile)||(wasmTextFile=d.locateFile(wasmTextFile)),he(f)||(f=d.locateFile(f)),he(asmjsCodeFile)||(asmjsCodeFile=d.locateFile(asmjsCodeFile)));var o={global:null,env:null,asm2wasm:i,parent:d},s=null;function l(){try{if(d.wasmBinary)return new Uint8Array(d.wasmBinary);if(d.readBinary)return d.readBinary(f);throw"on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)"}catch(e){ze(e)}}function u(e,t,r){if("object"!=typeof WebAssembly)return h("no native wasm support detected"),!1;if(!(d.wasmMemory instanceof WebAssembly.Memory))return h("no native wasm Memory in use"),!1;function n(e,t){(s=e.exports).memory&&function(e){var t=d.buffer;e.byteLength>2]},getStr:function(){return T(ge.get())},get64:function(){var e=ge.get(),t=ge.get();return y(0<=e?0===t:-1===t),e},getZero:function(){y(0===ge.get())}};function ye(e){return d.___errno_location&&(P[d.___errno_location()>>2]=e),e}function ve(e){!function(e,t){if(t&&d.noExitRuntime&&0===e)return;d.noExitRuntime||(a=!0,B=Le,Z(ee),d.onExit&&d.onExit(e));d.quit(e,new Be(e))}(e)}var _e=ie;var be=u(Ae("GMT"),"i8",S);function Se(e){return Math.pow(2,e)}var Ee=le;function we(){if(!we.called){we.called=!0,P[Ce()>>2]=60*(new Date).getTimezoneOffset();var e=new Date(2e3,0,1),t=new Date(2e3,6,1);P[Re()>>2]=Number(e.getTimezoneOffset()!=t.getTimezoneOffset());var r=o(e),n=o(t),i=u(Ae(r),"i8",l),a=u(Ae(n),"i8",l);t.getTimezoneOffset()>2]=i,P[De()+4>>2]=a):(P[De()>>2]=a,P[De()+4>>2]=i)}function o(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}}var Te=22;function Ae(e,t,r){var n=0>2]=N,F=!0,d.wasmTableSize=432,d.wasmMaxTableSize=432,d.asmGlobalArg={},d.asmLibraryArg={abort:ze,enlargeMemory:Y,getTotalMemory:function(){return X},abortOnCannotGrowMemory:function(){ze("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+X+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")},___buildEnvironment:function e(t){var r,n;e.called?(n=P[t>>2],r=P[n>>2]):(e.called=!0,me.USER=me.LOGNAME="web_user",me.PATH="/",me.PWD="/",me.HOME="/home/web_user",me.LANG="C.UTF-8",me._=d.thisProgram,r=w(1024),n=w(256),P[n>>2]=r,P[t>>2]=n);var i=[],a=0;for(var o in me)if("string"==typeof me[o]){var s=o+"="+me[o];i.push(s),a+=s.length}if(1024>2]=r,r+=s.length+1;P[n+4*i.length>>2]=0},___setErrNo:ye,___syscall140:function(e,t){ge.varargs=t;try{var r=ge.getStreamFromFD(),n=(ge.get(),ge.get()),i=ge.get(),a=ge.get(),o=n;return FS.llseek(r,o,a),P[i>>2]=r.position,r.getdents&&0===o&&0===a&&(r.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||ze(e),-e.errno}},___syscall146:function n(e,t){ge.varargs=t;try{var r=ge.get(),i=ge.get(),a=ge.get(),o=0;n.buffers||(n.buffers=[null,[],[]],n.printChar=function(e,t){var r=n.buffers[e];y(r),0===t||10===t?((1===e?c:h)(x(r,0)),r.length=0):r.push(t)});for(var s=0;s>2],u=P[i+(8*s+4)>>2],d=0;d>2]=t/1e3|0,P[e+4>>2]=t%1e3*1e3|0,0},_gmtime_r:function(e,t){var r=new Date(1e3*P[e>>2]);P[t>>2]=r.getUTCSeconds(),P[t+4>>2]=r.getUTCMinutes(),P[t+8>>2]=r.getUTCHours(),P[t+12>>2]=r.getUTCDate(),P[t+16>>2]=r.getUTCMonth(),P[t+20>>2]=r.getUTCFullYear()-1900,P[t+24>>2]=r.getUTCDay(),P[t+36>>2]=0,P[t+32>>2]=0;var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),i=(r.getTime()-n)/864e5|0;return P[t+28>>2]=i,P[t+40>>2]=be,t},_llvm_exp2_f32:Se,_llvm_exp2_f64:function(){return Se.apply(null,arguments)},_llvm_log2_f32:function(e){return Math.log(e)/Math.LN2},_llvm_trunc_f64:Ee,_localtime_r:function(e,t){we();var r=new Date(1e3*P[e>>2]);P[t>>2]=r.getSeconds(),P[t+4>>2]=r.getMinutes(),P[t+8>>2]=r.getHours(),P[t+12>>2]=r.getDate(),P[t+16>>2]=r.getMonth(),P[t+20>>2]=r.getFullYear()-1900,P[t+24>>2]=r.getDay();var n=new Date(r.getFullYear(),0,1),i=(r.getTime()-n.getTime())/864e5|0;P[t+28>>2]=i,P[t+36>>2]=-60*r.getTimezoneOffset();var a=new Date(2e3,6,1).getTimezoneOffset(),o=n.getTimezoneOffset(),s=0|(a!=o&&r.getTimezoneOffset()==Math.min(o,a));P[t+32>>2]=s;var l=P[De()+(s?4:0)>>2];return P[t+40>>2]=l,t},_mktime:function(e){we();var t=new Date(P[e+20>>2]+1900,P[e+16>>2],P[e+12>>2],P[e+8>>2],P[e+4>>2],P[e>>2],0),r=P[e+32>>2],n=t.getTimezoneOffset(),i=new Date(t.getFullYear(),0,1),a=new Date(2e3,6,1).getTimezoneOffset(),o=i.getTimezoneOffset(),s=Math.min(o,a);if(r<0)P[e+32>>2]=Number(a!=o&&s==n);else if(0>2]=t.getDay();var d=(t.getTime()-i.getTime())/864e5|0;return P[e+28>>2]=d,t.getTime()/1e3|0},_pthread_cond_destroy:function(){return 0},_pthread_cond_init:function(){return 0},_pthread_cond_signal:function(){return 0},_pthread_cond_wait:function(){return 0},_pthread_create:function(){return 11},_pthread_join:function(){},_pthread_mutex_destroy:function(){},_pthread_mutex_init:function(){},_pthread_once:function e(t,r){e.seen||(e.seen={}),t in e.seen||(d.dynCall_v(r),e.seen[t]=1)},_sysconf:function(e){switch(e){case 30:return 16384;case 85:return 131068;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ye(Te),-1},DYNAMICTOP_PTR:z,tempDoublePtr:pe,STACKTOP:B};var xe=d.asm(d.asmGlobalArg,d.asmLibraryArg,R);d.asm=xe;var Le,Ie=d.___emscripten_environ_constructor=function(){return d.asm.___emscripten_environ_constructor.apply(null,arguments)},Re=d.__get_daylight=function(){return d.asm.__get_daylight.apply(null,arguments)},Ce=d.__get_timezone=function(){return d.asm.__get_timezone.apply(null,arguments)},De=d.__get_tzname=function(){return d.asm.__get_tzname.apply(null,arguments)},Ue=d._emscripten_replace_memory=function(){return d.asm._emscripten_replace_memory.apply(null,arguments)},Pe=d._free=function(){return d.asm._free.apply(null,arguments)},ke=d._malloc=function(){return d.asm._malloc.apply(null,arguments)},Oe=(d._pcm2aac=function(){return d.asm._pcm2aac.apply(null,arguments)},d.stackAlloc=function(){return d.asm.stackAlloc.apply(null,arguments)}),Me=d.stackRestore=function(){return d.asm.stackRestore.apply(null,arguments)},Fe=d.stackSave=function(){return d.asm.stackSave.apply(null,arguments)};d.dynCall_v=function(){return d.asm.dynCall_v.apply(null,arguments)},d.dynCall_vi=function(){return d.asm.dynCall_vi.apply(null,arguments)};function Be(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Ne(e){function t(){d.calledRun||(d.calledRun=!0,a||(re||(re=!0,Z(J)),Z($),d.onRuntimeInitialized&&d.onRuntimeInitialized(),function(){if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;)e=d.postRun.shift(),te.unshift(e);var e;Z(te)}()))}e=e||d.arguments,0