ranui
Version:
A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.
4 lines • 264 kB
JavaScript
const Jt=require("./rolldown-runtime-DGqZhkpL.cjs");var $t=Jt.__commonJSMin(((Qe,ot)=>{(function(Ze,ze){typeof Qe=="object"&&typeof ot=="object"?ot.exports=ze():typeof define=="function"&&define.amd?define([],ze):typeof Qe=="object"?Qe.mpegts=ze():Ze.mpegts=ze()})(Qe,function(){return(function(){var Ze={964:function(he,te,B){he.exports=(function(){"use strict";function P(N){return typeof N=="function"}var Z=Array.isArray?Array.isArray:function(N){return Object.prototype.toString.call(N)==="[object Array]"},c=0,L=void 0,b=void 0,w=function(N,q){F[c]=N,F[c+1]=q,(c+=2)===2&&(b?b(E):l())},M=typeof window<"u"?window:void 0,g=M||{},O=g.MutationObserver||g.WebKitMutationObserver,T=typeof self>"u"&&typeof process<"u"&&{}.toString.call(process)==="[object process]",A=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function I(){var N=setTimeout;return function(){return N(E,1)}}var F=new Array(1e3);function E(){for(var N=0;N<c;N+=2)(0,F[N])(F[N+1]),F[N]=void 0,F[N+1]=void 0;c=0}var K,V,Y,C,l=void 0;function u(N,q){var J=this,se=new this.constructor(H);se[v]===void 0&&ae(se);var re=J._state;if(re){var pe=arguments[re-1];w(function(){return R(re,se,pe,J._result)})}else k(J,se,N,q);return se}function p(N){if(N&&typeof N=="object"&&N.constructor===this)return N;var q=new this(H);return Se(q,N),q}l=T?function(){return process.nextTick(E)}:O?(V=0,Y=new O(E),C=document.createTextNode(""),Y.observe(C,{characterData:!0}),function(){C.data=V=++V%2}):A?((K=new MessageChannel).port1.onmessage=E,function(){return K.port2.postMessage(0)}):M===void 0?(function(){try{var N=Function("return this")().require("vertx");return(L=N.runOnLoop||N.runOnContext)!==void 0?function(){L(E)}:I()}catch{return I()}})():I();var v=Math.random().toString(36).substring(2);function H(){}var j=void 0,ne=1,ie=2;function ce(N,q,J){q.constructor===N.constructor&&J===u&&q.constructor.resolve===p?(function(se,re){re._state===ne?Re(se,re._result):re._state===ie?ke(se,re._result):k(re,void 0,function(pe){return Se(se,pe)},function(pe){return ke(se,pe)})})(N,q):J===void 0?Re(N,q):P(J)?(function(se,re,pe){w(function(Me){var Oe=!1,Ve=(function(Ie,et,Pe,Ke){try{Ie.call(et,Pe,Ke)}catch(Je){return Je}})(pe,re,function(Ie){Oe||(Oe=!0,re!==Ie?Se(Me,Ie):Re(Me,Ie))},function(Ie){Oe||(Oe=!0,ke(Me,Ie))},Me._label);!Oe&&Ve&&(Oe=!0,ke(Me,Ve))},se)})(N,q,J):Re(N,q)}function Se(N,q){if(N===q)ke(N,new TypeError("You cannot resolve a promise with itself"));else if(re=typeof(se=q),se===null||re!=="object"&&re!=="function")Re(N,q);else{var J=void 0;try{J=q.then}catch(pe){ke(N,pe);return}ce(N,q,J)}var se,re}function Te(N){N._onerror&&N._onerror(N._result),h(N)}function Re(N,q){N._state===j&&(N._result=q,N._state=ne,N._subscribers.length!==0&&w(h,N))}function ke(N,q){N._state===j&&(N._state=ie,N._result=q,w(Te,N))}function k(N,q,J,se){var re=N._subscribers,pe=re.length;N._onerror=null,re[pe]=q,re[pe+ne]=J,re[pe+ie]=se,pe===0&&N._state&&w(h,N)}function h(N){var q=N._subscribers,J=N._state;if(q.length!==0){for(var se=void 0,re=void 0,pe=N._result,Me=0;Me<q.length;Me+=3)se=q[Me],re=q[Me+J],se?R(J,se,re,pe):re(pe);N._subscribers.length=0}}function R(N,q,J,se){var re=P(J),pe=void 0,Me=void 0,Oe=!0;if(re){try{pe=J(se)}catch(Ve){Oe=!1,Me=Ve}if(q===pe)return void ke(q,new TypeError("A promises callback cannot return that same promise."))}else pe=se;q._state!==j||(re&&Oe?Se(q,pe):Oe===!1?ke(q,Me):N===ne?Re(q,pe):N===ie&&ke(q,pe))}var G=0;function ae(N){N[v]=G++,N._state=void 0,N._result=void 0,N._subscribers=[]}var de=(function(){function N(q,J){this._instanceConstructor=q,this.promise=new q(H),this.promise[v]||ae(this.promise),Z(J)?(this.length=J.length,this._remaining=J.length,this._result=new Array(this.length),this.length===0?Re(this.promise,this._result):(this.length=this.length||0,this._enumerate(J),this._remaining===0&&Re(this.promise,this._result))):ke(this.promise,new Error("Array Methods must be provided an Array"))}return N.prototype._enumerate=function(q){for(var J=0;this._state===j&&J<q.length;J++)this._eachEntry(q[J],J)},N.prototype._eachEntry=function(q,J){var se=this._instanceConstructor,re=se.resolve;if(re===p){var pe=void 0,Me=void 0,Oe=!1;try{pe=q.then}catch(Ie){Oe=!0,Me=Ie}if(pe===u&&q._state!==j)this._settledAt(q._state,J,q._result);else if(typeof pe!="function")this._remaining--,this._result[J]=q;else if(se===ge){var Ve=new se(H);Oe?ke(Ve,Me):ce(Ve,q,pe),this._willSettleAt(Ve,J)}else this._willSettleAt(new se(function(Ie){return Ie(q)}),J)}else this._willSettleAt(re(q),J)},N.prototype._settledAt=function(q,J,se){var re=this.promise;re._state===j&&(this._remaining--,q===ie?ke(re,se):this._result[J]=se),this._remaining===0&&Re(re,this._result)},N.prototype._willSettleAt=function(q,J){var se=this;k(q,void 0,function(re){return se._settledAt(ne,J,re)},function(re){return se._settledAt(ie,J,re)})},N})(),ge=(function(){function N(q){this[v]=G++,this._result=this._state=void 0,this._subscribers=[],H!==q&&(typeof q!="function"&&(function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")})(),this instanceof N?(function(J,se){try{se(function(re){Se(J,re)},function(re){ke(J,re)})}catch(re){ke(J,re)}})(this,q):(function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")})())}return N.prototype.catch=function(q){return this.then(null,q)},N.prototype.finally=function(q){var J=this,se=J.constructor;return P(q)?J.then(function(re){return se.resolve(q()).then(function(){return re})},function(re){return se.resolve(q()).then(function(){throw re})}):J.then(q,q)},N})();return ge.prototype.then=u,ge.all=function(N){return new de(this,N).promise},ge.race=function(N){var q=this;return Z(N)?new q(function(J,se){for(var re=N.length,pe=0;pe<re;pe++)q.resolve(N[pe]).then(J,se)}):new q(function(J,se){return se(new TypeError("You must pass an array to race."))})},ge.resolve=p,ge.reject=function(N){var q=new this(H);return ke(q,N),q},ge._setScheduler=function(N){b=N},ge._setAsap=function(N){w=N},ge._asap=w,ge.polyfill=function(){var N=void 0;if(B.g!==void 0)N=B.g;else if(typeof self<"u")N=self;else try{N=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var q=N.Promise;if(q){var J=null;try{J=Object.prototype.toString.call(q.resolve())}catch{}if(J==="[object Promise]"&&!q.cast)return}N.Promise=ge},ge.Promise=ge,ge})()},7:function(he){"use strict";var te,B=typeof Reflect=="object"?Reflect:null,P=B&&typeof B.apply=="function"?B.apply:function(E,K,V){return Function.prototype.apply.call(E,K,V)};te=B&&typeof B.ownKeys=="function"?B.ownKeys:Object.getOwnPropertySymbols?function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:function(E){return Object.getOwnPropertyNames(E)};var Z=Number.isNaN||function(E){return E!=E};function c(){c.init.call(this)}he.exports=c,he.exports.once=function(E,K){return new Promise(function(V,Y){function C(u){E.removeListener(K,l),Y(u)}function l(){typeof E.removeListener=="function"&&E.removeListener("error",C),V([].slice.call(arguments))}F(E,K,l,{once:!0}),K!=="error"&&(function(u,p){typeof u.on=="function"&&F(u,"error",p,{once:!0})})(E,C)})},c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var L=10;function b(E){if(typeof E!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}function w(E){return E._maxListeners===void 0?c.defaultMaxListeners:E._maxListeners}function M(E,K,V,Y){var C,l,u,p;if(b(V),(l=E._events)===void 0?(l=E._events=Object.create(null),E._eventsCount=0):(l.newListener!==void 0&&(E.emit("newListener",K,V.listener?V.listener:V),l=E._events),u=l[K]),u===void 0)u=l[K]=V,++E._eventsCount;else if(typeof u=="function"?u=l[K]=Y?[V,u]:[u,V]:Y?u.unshift(V):u.push(V),(C=w(E))>0&&u.length>C&&!u.warned){u.warned=!0;var v=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(K)+" listeners added. Use emitter.setMaxListeners() to increase limit");v.name="MaxListenersExceededWarning",v.emitter=E,v.type=K,v.count=u.length,p=v,console&&console.warn&&console.warn(p)}return E}function g(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function O(E,K,V){var Y={fired:!1,wrapFn:void 0,target:E,type:K,listener:V},C=g.bind(Y);return C.listener=V,Y.wrapFn=C,C}function T(E,K,V){var Y=E._events;if(Y===void 0)return[];var C=Y[K];return C===void 0?[]:typeof C=="function"?V?[C.listener||C]:[C]:V?(function(l){for(var u=new Array(l.length),p=0;p<u.length;++p)u[p]=l[p].listener||l[p];return u})(C):I(C,C.length)}function A(E){var K=this._events;if(K!==void 0){var V=K[E];if(typeof V=="function")return 1;if(V!==void 0)return V.length}return 0}function I(E,K){for(var V=new Array(K),Y=0;Y<K;++Y)V[Y]=E[Y];return V}function F(E,K,V,Y){if(typeof E.on=="function")Y.once?E.once(K,V):E.on(K,V);else{if(typeof E.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E);E.addEventListener(K,function C(l){Y.once&&E.removeEventListener(K,C),V(l)})}}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return L},set:function(E){if(typeof E!="number"||E<0||Z(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");L=E}}),c.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||Z(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this},c.prototype.getMaxListeners=function(){return w(this)},c.prototype.emit=function(E){for(var K=[],V=1;V<arguments.length;V++)K.push(arguments[V]);var Y=E==="error",C=this._events;if(C!==void 0)Y=Y&&C.error===void 0;else if(!Y)return!1;if(Y){var l;if(K.length>0&&(l=K[0]),l instanceof Error)throw l;var u=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw u.context=l,u}var p=C[E];if(p===void 0)return!1;if(typeof p=="function")P(p,this,K);else{var v=p.length,H=I(p,v);for(V=0;V<v;++V)P(H[V],this,K)}return!0},c.prototype.addListener=function(E,K){return M(this,E,K,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(E,K){return M(this,E,K,!0)},c.prototype.once=function(E,K){return b(K),this.on(E,O(this,E,K)),this},c.prototype.prependOnceListener=function(E,K){return b(K),this.prependListener(E,O(this,E,K)),this},c.prototype.removeListener=function(E,K){var V,Y,C,l,u;if(b(K),(Y=this._events)===void 0)return this;if((V=Y[E])===void 0)return this;if(V===K||V.listener===K)--this._eventsCount===0?this._events=Object.create(null):(delete Y[E],Y.removeListener&&this.emit("removeListener",E,V.listener||K));else if(typeof V!="function"){for(C=-1,l=V.length-1;l>=0;l--)if(V[l]===K||V[l].listener===K){u=V[l].listener,C=l;break}if(C<0)return this;C===0?V.shift():(function(p,v){for(;v+1<p.length;v++)p[v]=p[v+1];p.pop()})(V,C),V.length===1&&(Y[E]=V[0]),Y.removeListener!==void 0&&this.emit("removeListener",E,u||K)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(E){var K,V,Y;if((V=this._events)===void 0)return this;if(V.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):V[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete V[E]),this;if(arguments.length===0){var C,l=Object.keys(V);for(Y=0;Y<l.length;++Y)(C=l[Y])!=="removeListener"&&this.removeAllListeners(C);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(K=V[E])=="function")this.removeListener(E,K);else if(K!==void 0)for(Y=K.length-1;Y>=0;Y--)this.removeListener(E,K[Y]);return this},c.prototype.listeners=function(E){return T(this,E,!0)},c.prototype.rawListeners=function(E){return T(this,E,!1)},c.listenerCount=function(E,K){return typeof E.listenerCount=="function"?E.listenerCount(K):A.call(E,K)},c.prototype.listenerCount=A,c.prototype.eventNames=function(){return this._eventsCount>0?te(this._events):[]}},955:function(he,te){"use strict";te.A=(function(){function B(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return B.prototype.isComplete=function(){var P=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,Z=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&P&&Z},B.prototype.isSeekable=function(){return this.hasKeyframesIndex===!0},B.prototype.getNearestKeyframe=function(P){if(this.keyframesIndex==null)return null;var Z=this.keyframesIndex,c=this._search(Z.times,P);return{index:c,milliseconds:Z.times[c],fileposition:Z.filepositions[c]}},B.prototype._search=function(P,Z){var c=0,L=P.length-1,b=0,w=0,M=L;for(Z<P[0]&&(c=0,w=M+1);w<=M;){if((b=w+Math.floor((M-w)/2))===L||Z>=P[b]&&Z<P[b+1]){c=b;break}P[b]<Z?w=b+1:M=b-1}return c},B})()},47:function(he,te,B){"use strict";B.d(te,{$_:function(){return P},EX:function(){return c},EZ:function(){return Z},Sc:function(){return L}});var P=function(b,w,M,g,O){this.dts=b,this.pts=w,this.duration=M,this.originalDts=g,this.isSyncPoint=O,this.fileposition=null},Z=(function(){function b(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return b.prototype.appendSyncPoint=function(w){w.isSyncPoint=!0,this.syncPoints.push(w)},b})(),c=(function(){function b(){this._list=[]}return b.prototype.clear=function(){this._list=[]},b.prototype.appendArray=function(w){var M=this._list;w.length!==0&&(M.length>0&&w[0].originalDts<M[M.length-1].originalDts&&this.clear(),Array.prototype.push.apply(M,w))},b.prototype.getLastSyncPointBeforeDts=function(w){if(this._list.length==0)return null;var M=this._list,g=0,O=M.length-1,T=0,A=0,I=O;for(w<M[0].dts&&(g=0,A=I+1);A<=I;){if((T=A+Math.floor((I-A)/2))===O||w>=M[T].dts&&w<M[T+1].dts){g=T;break}M[T].dts<w?A=T+1:I=T-1}return this._list[g]},b})(),L=(function(){function b(w){this._type=w,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(b.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),b.prototype.isEmpty=function(){return this._list.length===0},b.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},b.prototype._searchNearestSegmentBefore=function(w){var M=this._list;if(M.length===0)return-2;var g=M.length-1,O=0,T=0,A=g,I=0;if(w<M[0].originalBeginDts)return-1;for(;T<=A;){if((O=T+Math.floor((A-T)/2))===g||w>M[O].lastSample.originalDts&&w<M[O+1].originalBeginDts){I=O;break}M[O].originalBeginDts<w?T=O+1:A=O-1}return I},b.prototype._searchNearestSegmentAfter=function(w){return this._searchNearestSegmentBefore(w)+1},b.prototype.append=function(w){var M=this._list,g=w,O=this._lastAppendLocation,T=0;O!==-1&&O<M.length&&g.originalBeginDts>=M[O].lastSample.originalDts&&(O===M.length-1||O<M.length-1&&g.originalBeginDts<M[O+1].originalBeginDts)?T=O+1:M.length>0&&(T=this._searchNearestSegmentBefore(g.originalBeginDts)+1),this._lastAppendLocation=T,this._list.splice(T,0,g)},b.prototype.getLastSegmentBefore=function(w){var M=this._searchNearestSegmentBefore(w);return M>=0?this._list[M]:null},b.prototype.getLastSampleBefore=function(w){var M=this.getLastSegmentBefore(w);return M!=null?M.lastSample:null},b.prototype.getLastSyncPointBefore=function(w){for(var M=this._searchNearestSegmentBefore(w),g=this._list[M].syncPoints;g.length===0&&M>0;)M--,g=this._list[M].syncPoints;return g.length>0?g[g.length-1]:null},b})()},346:function(he,te,B){"use strict";var P=B(7),Z=B.n(P),c=B(856),L=B(994),b=B(403),w=B(867);te.A=(function(){function M(g){this.TAG="MSEController",this._config=g,this._emitter=new(Z()),this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onStartStreaming:this._onStartStreaming.bind(this),onEndStreaming:this._onEndStreaming.bind(this),onQualityChange:this._onQualityChange.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._useManagedMediaSource=typeof self.ManagedMediaSource=="function"&&typeof self.MediaSource!="function",this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElementProxy=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]}}return M.prototype.destroy=function(){this._mediaSource&&this.shutdown(),this._mediaSourceObjectURL&&this.revokeObjectURL(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},M.prototype.on=function(g,O){this._emitter.addListener(g,O)},M.prototype.off=function(g,O){this._emitter.removeListener(g,O)},M.prototype.initialize=function(g){if(this._mediaSource)throw new w.j4("MediaSource has been attached to an HTMLMediaElement!");this._useManagedMediaSource&&c.A.v(this.TAG,"Using ManagedMediaSource");var O=this._mediaSource=this._useManagedMediaSource?new self.ManagedMediaSource:new self.MediaSource;O.addEventListener("sourceopen",this.e.onSourceOpen),O.addEventListener("sourceended",this.e.onSourceEnded),O.addEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(O.addEventListener("startstreaming",this.e.onStartStreaming),O.addEventListener("endstreaming",this.e.onEndStreaming),O.addEventListener("qualitychange",this.e.onQualityChange)),this._mediaElementProxy=g},M.prototype.shutdown=function(){if(this._mediaSource){var g=this._mediaSource;for(var O in this._sourceBuffers){var T=this._pendingSegments[O];T.splice(0,T.length),this._pendingSegments[O]=null,this._pendingRemoveRanges[O]=null,this._lastInitSegments[O]=null;var A=this._sourceBuffers[O];if(A){if(g.readyState!=="closed"){try{g.removeSourceBuffer(A)}catch(I){c.A.e(this.TAG,I.message)}A.removeEventListener("error",this.e.onSourceBufferError),A.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[O]=null,this._sourceBuffers[O]=null}}if(g.readyState==="open")try{g.endOfStream()}catch(I){c.A.e(this.TAG,I.message)}this._mediaElementProxy=null,g.removeEventListener("sourceopen",this.e.onSourceOpen),g.removeEventListener("sourceended",this.e.onSourceEnded),g.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(g.removeEventListener("startstreaming",this.e.onStartStreaming),g.removeEventListener("endstreaming",this.e.onEndStreaming),g.removeEventListener("qualitychange",this.e.onQualityChange)),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._mediaSource=null}},M.prototype.isManagedMediaSource=function(){return this._useManagedMediaSource},M.prototype.getObject=function(){if(!this._mediaSource)throw new w.j4("MediaSource has not been initialized yet!");return this._mediaSource},M.prototype.getHandle=function(){if(!this._mediaSource)throw new w.j4("MediaSource has not been initialized yet!");return this._mediaSource.handle},M.prototype.getObjectURL=function(){if(!this._mediaSource)throw new w.j4("MediaSource has not been initialized yet!");return this._mediaSourceObjectURL??=URL.createObjectURL(this._mediaSource),this._mediaSourceObjectURL},M.prototype.revokeObjectURL=function(){this._mediaSourceObjectURL&&(URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},M.prototype.appendInitSegment=function(g,O){if(O===void 0&&(O=void 0),!this._mediaSource||this._mediaSource.readyState!=="open"||this._mediaSource.streaming===!1)return this._pendingSourceBufferInit.push(g),void this._pendingSegments[g.type].push(g);var T=g,A="".concat(T.container);T.codec&&T.codec.length>0&&(T.codec==="opus"&&L.A.safari&&(T.codec="Opus"),A+=";codecs=".concat(T.codec));var I=!1;if(c.A.v(this.TAG,"Received Initialization Segment, mimeType: "+A),this._lastInitSegments[T.type]=T,A!==this._mimeTypes[T.type]){if(this._mimeTypes[T.type])c.A.v(this.TAG,"Notice: ".concat(T.type," mimeType changed, origin: ").concat(this._mimeTypes[T.type],", target: ").concat(A));else{I=!0;try{var F=this._sourceBuffers[T.type]=this._mediaSource.addSourceBuffer(A);F.addEventListener("error",this.e.onSourceBufferError),F.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(E){c.A.e(this.TAG,E.message),this._emitter.emit(b.A.ERROR,{code:E.code,msg:E.message});return}}this._mimeTypes[T.type]=A}O||this._pendingSegments[T.type].push(T),I||this._sourceBuffers[T.type]&&!this._sourceBuffers[T.type].updating&&this._doAppendSegments(),L.A.safari&&T.container==="audio/mpeg"&&T.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=T.mediaDuration/1e3,this._updateMediaSourceDuration())},M.prototype.appendMediaSegment=function(g){var O=g;this._pendingSegments[O.type].push(O),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var T=this._sourceBuffers[O.type];!T||T.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},M.prototype.flush=function(){for(var g in this._sourceBuffers)if(this._sourceBuffers[g]){var O=this._sourceBuffers[g];if(this._mediaSource.readyState==="open")try{O.abort()}catch(K){c.A.e(this.TAG,K.message)}var T=this._pendingSegments[g];if(T.splice(0,T.length),this._mediaSource.readyState!=="closed"){for(var A=0;A<O.buffered.length;A++){var I=O.buffered.start(A),F=O.buffered.end(A);this._pendingRemoveRanges[g].push({start:I,end:F})}if(O.updating||this._doRemoveRanges(),L.A.safari){var E=this._lastInitSegments[g];E&&(this._pendingSegments[g].push(E),O.updating||this._doAppendSegments())}}}},M.prototype.endOfStream=function(){var g=this._mediaSource,O=this._sourceBuffers;g&&g.readyState==="open"?O.video&&O.video.updating||O.audio&&O.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,g.endOfStream()):g&&g.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0)},M.prototype._needCleanupSourceBuffer=function(){if(!this._config.autoCleanupSourceBuffer)return!1;var g=this._mediaElementProxy.getCurrentTime();for(var O in this._sourceBuffers){var T=this._sourceBuffers[O];if(T){var A=T.buffered;if(A.length>=1&&g-A.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},M.prototype._doCleanupSourceBuffer=function(){var g=this._mediaElementProxy.getCurrentTime();for(var O in this._sourceBuffers){var T=this._sourceBuffers[O];if(T){for(var A=T.buffered,I=!1,F=0;F<A.length;F++){var E=A.start(F),K=A.end(F);if(E<=g&&g<K+3){if(g-E>=this._config.autoCleanupMaxBackwardDuration){I=!0;var V=g-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[O].push({start:E,end:V})}}else K<g&&(I=!0,this._pendingRemoveRanges[O].push({start:E,end:K}))}I&&!T.updating&&this._doRemoveRanges()}}},M.prototype._updateMediaSourceDuration=function(){var g=this._sourceBuffers;if(this._mediaElementProxy.getReadyState()!==0&&this._mediaSource.readyState==="open"&&!(g.video&&g.video.updating||g.audio&&g.audio.updating)){var O=this._mediaSource.duration,T=this._pendingMediaDuration;T>0&&(isNaN(O)||T>O)&&(c.A.v(this.TAG,"Update MediaSource duration from ".concat(O," to ").concat(T)),this._mediaSource.duration=T),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},M.prototype._doRemoveRanges=function(){for(var g in this._pendingRemoveRanges)if(this._sourceBuffers[g]&&!this._sourceBuffers[g].updating)for(var O=this._sourceBuffers[g],T=this._pendingRemoveRanges[g];T.length&&!O.updating;){var A=T.shift();O.remove(A.start,A.end)}},M.prototype._doAppendSegments=function(){var g=this._pendingSegments;for(var O in g)if(this._sourceBuffers[O]&&!this._sourceBuffers[O].updating&&this._mediaSource.streaming!==!1&&g[O].length>0){var T=g[O].shift();if(typeof T.timestampOffset=="number"&&isFinite(T.timestampOffset)){var A=this._sourceBuffers[O].timestampOffset,I=T.timestampOffset/1e3;Math.abs(A-I)>.1&&(c.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(A," to ").concat(I)),this._sourceBuffers[O].timestampOffset=I),delete T.timestampOffset}if(!T.data||T.data.byteLength===0)continue;try{this._sourceBuffers[O].appendBuffer(T.data),this._isBufferFull=!1}catch(F){this._pendingSegments[O].unshift(T),F.code===22?(this._isBufferFull||this._emitter.emit(b.A.BUFFER_FULL),this._isBufferFull=!0):(c.A.e(this.TAG,F.message),this._emitter.emit(b.A.ERROR,{code:F.code,msg:F.message}))}}},M.prototype._onSourceOpen=function(){if(c.A.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var g=this._pendingSourceBufferInit;g.length;){var O=g.shift();this.appendInitSegment(O,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(b.A.SOURCE_OPEN)},M.prototype._onStartStreaming=function(){c.A.v(this.TAG,"ManagedMediaSource onStartStreaming"),this._emitter.emit(b.A.START_STREAMING)},M.prototype._onEndStreaming=function(){c.A.v(this.TAG,"ManagedMediaSource onEndStreaming"),this._emitter.emit(b.A.END_STREAMING)},M.prototype._onQualityChange=function(){c.A.v(this.TAG,"ManagedMediaSource onQualityChange")},M.prototype._onSourceEnded=function(){c.A.v(this.TAG,"MediaSource onSourceEnded")},M.prototype._onSourceClose=function(){c.A.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(this._mediaSource.removeEventListener("startstreaming",this.e.onStartStreaming),this._mediaSource.removeEventListener("endstreaming",this.e.onEndStreaming),this._mediaSource.removeEventListener("qualitychange",this.e.onQualityChange)))},M.prototype._hasPendingSegments=function(){var g=this._pendingSegments;return g.video.length>0||g.audio.length>0},M.prototype._hasPendingRemoveRanges=function(){var g=this._pendingRemoveRanges;return g.video.length>0||g.audio.length>0},M.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(b.A.UPDATE_END)},M.prototype._onSourceBufferError=function(g){c.A.e(this.TAG,"SourceBuffer Error: ".concat(g))},M})()},527:function(he,te,B){"use strict";var P=B(7),Z=B.n(P),c=B(861),L=B.n(c),b=B(856),w=B(947),M=B(886),g=B(726),O=(B(137),B(955));te.A=(function(){function T(A,I){if(this.TAG="Transmuxer",this._emitter=new(Z()),I.enableWorker&&typeof Worker<"u")try{this._worker=L()(137),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[A,I]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},w.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:w.A.getConfig()})}catch{b.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new M.A(A,I)}else this._controller=new M.A(A,I);if(this._controller){var F=this._controller;F.on(g.A.IO_ERROR,this._onIOError.bind(this)),F.on(g.A.DEMUX_ERROR,this._onDemuxError.bind(this)),F.on(g.A.INIT_SEGMENT,this._onInitSegment.bind(this)),F.on(g.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),F.on(g.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),F.on(g.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),F.on(g.A.MEDIA_INFO,this._onMediaInfo.bind(this)),F.on(g.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),F.on(g.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),F.on(g.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),F.on(g.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,this._onSynchronousKLVMetadataArrived.bind(this)),F.on(g.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,this._onAsynchronousKLVMetadataArrived.bind(this)),F.on(g.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),F.on(g.A.SEI_ARRIVED,this._onSEIArrived.bind(this)),F.on(g.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),F.on(g.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),F.on(g.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),F.on(g.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),F.on(g.A.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return T.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),w.A.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},T.prototype.on=function(A,I){this._emitter.addListener(A,I)},T.prototype.off=function(A,I){this._emitter.removeListener(A,I)},T.prototype.hasWorker=function(){return this._worker!=null},T.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},T.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},T.prototype.seek=function(A){this._worker?this._worker.postMessage({cmd:"seek",param:A}):this._controller.seek(A)},T.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},T.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},T.prototype._onInitSegment=function(A,I){var F=this;Promise.resolve().then(function(){F._emitter.emit(g.A.INIT_SEGMENT,A,I)})},T.prototype._onMediaSegment=function(A,I){var F=this;Promise.resolve().then(function(){F._emitter.emit(g.A.MEDIA_SEGMENT,A,I)})},T.prototype._onLoadingComplete=function(){var A=this;Promise.resolve().then(function(){A._emitter.emit(g.A.LOADING_COMPLETE)})},T.prototype._onRecoveredEarlyEof=function(){var A=this;Promise.resolve().then(function(){A._emitter.emit(g.A.RECOVERED_EARLY_EOF)})},T.prototype._onMediaInfo=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.MEDIA_INFO,A)})},T.prototype._onMetaDataArrived=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.METADATA_ARRIVED,A)})},T.prototype._onScriptDataArrived=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.SCRIPTDATA_ARRIVED,A)})},T.prototype._onTimedID3MetadataArrived=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.TIMED_ID3_METADATA_ARRIVED,A)})},T.prototype._onPGSSubtitleArrived=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.PGS_SUBTITLE_ARRIVED,A)})},T.prototype._onSynchronousKLVMetadataArrived=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,A)})},T.prototype._onAsynchronousKLVMetadataArrived=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,A)})},T.prototype._onSMPTE2038MetadataArrived=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.SMPTE2038_METADATA_ARRIVED,A)})},T.prototype._onSEIArrived=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.SEI_ARRIVED,A)})},T.prototype._onSCTE35MetadataArrived=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.SCTE35_METADATA_ARRIVED,A)})},T.prototype._onPESPrivateDataDescriptor=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.PES_PRIVATE_DATA_DESCRIPTOR,A)})},T.prototype._onPESPrivateDataArrived=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.PES_PRIVATE_DATA_ARRIVED,A)})},T.prototype._onStatisticsInfo=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.STATISTICS_INFO,A)})},T.prototype._onIOError=function(A,I){var F=this;Promise.resolve().then(function(){F._emitter.emit(g.A.IO_ERROR,A,I)})},T.prototype._onDemuxError=function(A,I){var F=this;Promise.resolve().then(function(){F._emitter.emit(g.A.DEMUX_ERROR,A,I)})},T.prototype._onRecommendSeekpoint=function(A){var I=this;Promise.resolve().then(function(){I._emitter.emit(g.A.RECOMMEND_SEEKPOINT,A)})},T.prototype._onLoggingConfigChanged=function(A){this._worker&&this._worker.postMessage({cmd:"logging_config",param:A})},T.prototype._onWorkerMessage=function(A){var I=A.data,F=I.data;if(I.msg==="destroyed"||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(I.msg){case g.A.INIT_SEGMENT:case g.A.MEDIA_SEGMENT:this._emitter.emit(I.msg,F.type,F.data);break;case g.A.LOADING_COMPLETE:case g.A.RECOVERED_EARLY_EOF:this._emitter.emit(I.msg);break;case g.A.MEDIA_INFO:Object.setPrototypeOf(F,O.A.prototype),this._emitter.emit(I.msg,F);break;case g.A.METADATA_ARRIVED:case g.A.SCRIPTDATA_ARRIVED:case g.A.TIMED_ID3_METADATA_ARRIVED:case g.A.PGS_SUBTITLE_ARRIVED:case g.A.SYNCHRONOUS_KLV_METADATA_ARRIVED:case g.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED:case g.A.SMPTE2038_METADATA_ARRIVED:case g.A.SCTE35_METADATA_ARRIVED:case g.A.SEI_ARRIVED:case g.A.PES_PRIVATE_DATA_DESCRIPTOR:case g.A.PES_PRIVATE_DATA_ARRIVED:case g.A.STATISTICS_INFO:this._emitter.emit(I.msg,F);break;case g.A.IO_ERROR:case g.A.DEMUX_ERROR:this._emitter.emit(I.msg,F.type,F.info);break;case g.A.RECOMMEND_SEEKPOINT:this._emitter.emit(I.msg,F);break;case"logcat_callback":b.A.emitter.emit("log",F.type,F.logcat)}},T})()},886:function(he,te,B){"use strict";B.d(te,{A:function(){return Yt}});var P=B(7),Z=B.n(P),c=B(856),L=B(994),b=B(955);function w(n,i,e){var t=n;if(i+e<t.length){for(;e--;)if((192&t[++i])!=128)return!1;return!0}return!1}var M,g=function(n){for(var i=[],e=n,t=0,a=n.length;t<a;)if(e[t]<128)i.push(String.fromCharCode(e[t])),++t;else{if(!(e[t]<192)){if(e[t]<224){if(w(e,t,1)&&(o=(31&e[t])<<6|63&e[t+1])>=128){i.push(String.fromCharCode(65535&o)),t+=2;continue}}else if(e[t]<240){if(w(e,t,2)&&(o=(15&e[t])<<12|(63&e[t+1])<<6|63&e[t+2])>=2048&&(63488&o)!=55296){i.push(String.fromCharCode(65535&o)),t+=3;continue}}else if(e[t]<248){var o;if(w(e,t,3)&&(o=(7&e[t])<<18|(63&e[t+1])<<12|(63&e[t+2])<<6|63&e[t+3])>65536&&o<1114112){o-=65536,i.push(String.fromCharCode(o>>>10|55296)),i.push(String.fromCharCode(1023&o|56320)),t+=4;continue}}}i.push("�"),++t}return i.join("")},O=B(867),T=(M=new ArrayBuffer(2),new DataView(M).setInt16(0,256,!0),new Int16Array(M)[0]===256),A=(function(){function n(){}return n.parseScriptData=function(i,e,t){var a={};try{var o=n.parseValue(i,e,t),r=n.parseValue(i,e+o.size,t-o.size);a[o.data]=r.data}catch(s){c.A.e("AMF",s.toString())}return a},n.parseObject=function(i,e,t){if(t<3)throw new O.j4("Data not enough when parse ScriptDataObject");var a=n.parseString(i,e,t),o=n.parseValue(i,e+a.size,t-a.size),r=o.objectEnd;return{data:{name:a.data,value:o.data},size:a.size+o.size,objectEnd:r}},n.parseVariable=function(i,e,t){return n.parseObject(i,e,t)},n.parseString=function(i,e,t){if(t<2)throw new O.j4("Data not enough when parse String");var a=new DataView(i,e,t).getUint16(0,!T);return{data:a>0?g(new Uint8Array(i,e+2,a)):"",size:2+a}},n.parseLongString=function(i,e,t){if(t<4)throw new O.j4("Data not enough when parse LongString");var a=new DataView(i,e,t).getUint32(0,!T);return{data:a>0?g(new Uint8Array(i,e+4,a)):"",size:4+a}},n.parseDate=function(i,e,t){if(t<10)throw new O.j4("Data size invalid when parse Date");var a=new DataView(i,e,t),o=a.getFloat64(0,!T),r=a.getInt16(8,!T);return{data:new Date(o+=60*r*1e3),size:10}},n.parseValue=function(i,e,t){if(t<1)throw new O.j4("Data not enough when parse Value");var a,o=new DataView(i,e,t),r=1,s=o.getUint8(0),_=!1;try{switch(s){case 0:a=o.getFloat64(1,!T),r+=8;break;case 1:a=!!o.getUint8(1),r+=1;break;case 2:var d=n.parseString(i,e+1,t-1);a=d.data,r+=d.size;break;case 3:a={};var m=0;for((16777215&o.getUint32(t-4,!T))==9&&(m=3);r<t-4;){var f=n.parseObject(i,e+r,t-r-m);if(f.objectEnd)break;a[f.data.name]=f.data.value,r+=f.size}r<=t-3&&(16777215&o.getUint32(r-1,!T))==9&&(r+=3);break;case 8:for(a={},r+=4,m=0,(16777215&o.getUint32(t-4,!T))==9&&(m=3);r<t-8;){var y=n.parseVariable(i,e+r,t-r-m);if(y.objectEnd)break;a[y.data.name]=y.data.value,r+=y.size}r<=t-3&&(16777215&o.getUint32(r-1,!T))==9&&(r+=3);break;case 9:a=void 0,r=1,_=!0;break;case 10:a=[];var S=o.getUint32(1,!T);r+=4;for(var D=0;D<S;D++){var x=n.parseValue(i,e+r,t-r);a.push(x.data),r+=x.size}break;case 11:var z=n.parseDate(i,e+1,t-1);a=z.data,r+=z.size;break;case 12:var X=n.parseString(i,e+1,t-1);a=X.data,r+=X.size;break;default:r=t,c.A.w("AMF","Unsupported AMF value type "+s)}}catch(U){c.A.e("AMF",U.toString())}return{data:a,size:r,objectEnd:_}},n})(),I=(function(){function n(i){this.TAG="ExpGolomb",this._buffer=i,this._buffer_index=0,this._total_bytes=i.byteLength,this._total_bits=8*i.byteLength,this._current_word=0,this._current_word_bits_left=0}return n.prototype.destroy=function(){this._buffer=null},n.prototype._fillCurrentWord=function(){var i=this._total_bytes-this._buffer_index;if(i<=0)throw new O.j4("ExpGolomb: _fillCurrentWord() but no bytes available");var e=Math.min(4,i),t=new Uint8Array(4);t.set(this._buffer.subarray(this._buffer_index,this._buffer_index+e)),this._current_word=new DataView(t.buffer).getUint32(0,!1),this._buffer_index+=e,this._current_word_bits_left=8*e},n.prototype.readBits=function(i){if(i>32)throw new O.Qn("ExpGolomb: readBits() bits exceeded max 32bits!");if(i<=this._current_word_bits_left){var e=this._current_word>>>32-i;return this._current_word<<=i,this._current_word_bits_left-=i,e}var t=this._current_word_bits_left?this._current_word:0;t>>>=32-this._current_word_bits_left;var a=i-this._current_word_bits_left;this._fillCurrentWord();var o=Math.min(a,this._current_word_bits_left),r=this._current_word>>>32-o;return this._current_word<<=o,this._current_word_bits_left-=o,t<<o|r},n.prototype.readBool=function(){return this.readBits(1)===1},n.prototype.readByte=function(){return this.readBits(8)},n.prototype._skipLeadingZero=function(){var i;for(i=0;i<this._current_word_bits_left;i++)if(this._current_word&2147483648>>>i)return this._current_word<<=i,this._current_word_bits_left-=i,i;return this._fillCurrentWord(),i+this._skipLeadingZero()},n.prototype.readUEG=function(){var i=this._skipLeadingZero();return this.readBits(i+1)-1},n.prototype.readSEG=function(){var i=this.readUEG();return 1&i?i+1>>>1:-1*(i>>>1)},n})(),F=(function(){function n(){}return n._ebsp2rbsp=function(i){for(var e=i,t=e.byteLength,a=new Uint8Array(t),o=0,r=0;r<t;r++)r>=2&&e[r]===3&&e[r-1]===0&&e[r-2]===0||(a[o]=e[r],o++);return new Uint8Array(a.buffer,0,o)},n.parseSPS=function(i){for(var e=i.subarray(1,4),t="avc1.",a=0;a<3;a++){var o=e[a].toString(16);o.length<2&&(o="0"+o),t+=o}var r=new I(n._ebsp2rbsp(i));r.readByte();var s=r.readByte();r.readByte();var _=r.readByte();r.readUEG();var d=n.getProfileString(s),m=n.getLevelString(_),f=1,y=420,S=8,D=8;if((s===100||s===110||s===122||s===244||s===44||s===83||s===86||s===118||s===128||s===138||s===144)&&((f=r.readUEG())===3&&r.readBits(1),f<=3&&(y=[0,420,422,444][f]),S=r.readUEG()+8,D=r.readUEG()+8,r.readBits(1),r.readBool()))for(var x=f!==3?8:12,z=0;z<x;z++)r.readBool()&&(z<6?n._skipScalingList(r,16):n._skipScalingList(r,64));r.readUEG();var X=r.readUEG();if(X===0)r.readUEG();else if(X===1){r.readBits(1),r.readSEG(),r.readSEG();var U=r.readUEG();for(z=0;z<U;z++)r.readSEG()}var W=r.readUEG();r.readBits(1);var _e=r.readUEG(),$=r.readUEG(),Q=r.readBits(1);Q===0&&r.readBits(1),r.readBits(1);var me=0,ee=0,fe=0,ve=0;r.readBool()&&(me=r.readUEG(),ee=r.readUEG(),fe=r.readUEG(),ve=r.readUEG());var ye=1,Ee=1,we=0,oe=!0,le=0,be=0;if(r.readBool()){if(r.readBool()){var ue=r.readByte();ue>0&&ue<16?(ye=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][ue-1],Ee=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][ue-1]):ue===255&&(ye=r.readByte()<<8|r.readByte(),Ee=r.readByte()<<8|r.readByte())}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(4),r.readBool()&&r.readBits(24)),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool()){var Ce=r.readBits(32),Ue=r.readBits(32);oe=r.readBool(),we=(le=Ue)/(be=2*Ce)}}var xe=1;ye===1&&Ee===1||(xe=ye/Ee);var Be=0,Ae=0;f===0?(Be=1,Ae=2-Q):(Be=f===3?1:2,Ae=(f===1?2:1)*(2-Q));var De=16*(_e+1),je=16*($+1)*(2-Q);De-=(me+ee)*Be,je-=(fe+ve)*Ae;var qe=Math.ceil(De*xe);return r.destroy(),r=null,{codec_mimetype:t,profile_idc:s,level_idc:_,profile_string:d,level_string:m,chroma_format_idc:f,bit_depth:S,bit_depth_luma:S,bit_depth_chroma:D,ref_frames:W,chroma_format:y,chroma_format_string:n.getChromaFormatString(y),frame_rate:{fixed:oe,fps:we,fps_den:be,fps_num:le},sar_ratio:{width:ye,height:Ee},codec_size:{width:De,height:je},present_size:{width:qe,height:je}}},n._skipScalingList=function(i,e){for(var t=8,a=8,o=0;o<e;o++)a!==0&&(a=(t+i.readSEG()+256)%256),t=a===0?t:a},n.getProfileString=function(i){switch(i){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}},n.getLevelString=function(i){return(i/10).toFixed(1)},n.getChromaFormatString=function(i){switch(i){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},n})(),E=B(827),K=(function(){function n(){}return n._ebsp2rbsp=function(i){for(var e=i,t=e.byteLength,a=new Uint8Array(t),o=0,r=0;r<t;r++)r>=2&&e[r]===3&&e[r-1]===0&&e[r-2]===0||(a[o]=e[r],o++);return new Uint8Array(a.buffer,0,o)},n.parseVPS=function(i){var e=new I(n._ebsp2rbsp(i));return e.readByte(),e.readByte(),e.readBits(4),e.readBits(2),e.readBits(6),{num_temporal_layers:e.readBits(3)+1,temporal_id_nested:e.readBool()}},n.parseSPS=function(i){var e=new I(n._ebsp2rbsp(i));e.readByte(),e.readByte();for(var t=0,a=0,o=0,r=0,s=(e.readBits(4),e.readBits(3)),_=(e.readBool(),e.readBits(2)),d=e.readBool(),m=e.readBits(5),f=e.readByte(),y=e.readByte(),S=e.readByte(),D=e.readByte(),x=e.readByte(),z=e.readByte(),X=e.readByte(),U=e.readByte(),W=e.readByte(),_e=e.readByte(),$=e.readByte(),Q=[],me=[],ee=0;ee<s;ee++)Q.push(e.readBool()),me.push(e.readBool());if(s>0)for(ee=s;ee<8;ee++)e.readBits(2);for(ee=0;ee<s;ee++)Q[ee]&&(e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte()),me[ee]&&e.readByte();e.readUEG();var fe=e.readUEG();fe==3&&e.readBits(1);var ve=e.readUEG(),ye=e.readUEG();e.readBool()&&(t+=e.readUEG(),a+=e.readUEG(),o+=e.readUEG(),r+=e.readUEG());var Ee=e.readUEG(),we=e.readUEG(),oe=e.readUEG();for(ee=e.readBool()?0:s;ee<=s;ee++)e.readUEG(),e.readUEG(),e.readUEG();if(e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readBool()&&e.readBool())for(var le=0;le<4;le++)for(var be=0;be<(le===3?2:6);be++)if(e.readBool()){var ue=Math.min(64,1<<4+(le<<1));for(le>1&&e.readSEG(),ee=0;ee<ue;ee++)e.readSEG()}else e.readUEG();e.readBool(),e.readBool(),e.readBool()&&(e.readByte(),e.readUEG(),e.readUEG(),e.readBool());var Ce=e.readUEG(),Ue=0;for(ee=0;ee<Ce;ee++){var xe=!1;if(ee!==0&&(xe=e.readBool()),xe){ee===Ce&&e.readUEG(),e.readBool(),e.readUEG();for(var Be=0,Ae=0;Ae<=Ue;Ae++){var De=e.readBool(),je=!1;De||(je=e.readBool()),(De||je)&&Be++}Ue=Be}else{var qe=e.readUEG(),lt=e.readUEG();for(Ue=qe+lt,Ae=0;Ae<qe;Ae++)e.readUEG(),e.readBool();for(Ae=0;Ae<lt;Ae++)e.readUEG(),e.readBool()}}if(e.readBool()){var Qt=e.readUEG();for(ee=0;ee<Qt;ee++){for(Ae=0;Ae<oe+4;Ae++)e.readBits(1);e.readBits(1)}}var ut=0,We=1,Xe=1,ft=!1,tt=1,it=1;if(e.readBool(),e.readBool(),e.readBool()){if(e.readBool()){var Ye=e.readByte();Ye>0&&Ye<=16?(We=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][Ye-1],Xe=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][Ye-1]):Ye===255&&(We=e.readBits(16),Xe=e.readBits(16))}if(e.readBool()&&e.readBool(),e.readBool()&&(e.readBits(3),e.readBool(),e.readBool()&&(e.readByte(),e.readByte(),e.readByte())),e.readBool()&&(e.readUEG(),e.readUEG()),e.readBool(),e.readBool(),e.readBool(),e.readBool()&&(e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG()),e.readBool()&&(tt=e.readBits(32),it=e.readBits(32),e.readBool()&&e.readUEG(),e.readBool())){var nt,at,$e=!1;for(nt=e.readBool(),at=e.readBool(),(nt||at)&&(($e=e.readBool())&&(e.readByte(),e.readBits(5),e.readBool(),e.readBits(5)),e.readBits(4),e.readBits(4),$e&&e.readBits(4),e.readBits(5),e.readBits(5),e.readBits(5)),ee=0;ee<=s;ee++){var pt=e.readBool();ft=pt;var mt=!0,rt=1;pt||(mt=e.readBool());var gt=!1;if(mt?e.readUEG():gt=e.readBool(),gt||(rt=e.readUEG()+1),nt){for(Ae=0;Ae<rt;Ae++)e.readUEG(),e.readUEG(),$e&&(e.readUEG(),e.readUEG());e.readBool()}if(at){for(Ae=0;Ae<rt;Ae++)e.readUEG(),e.readUEG(),$e&&(e.readUEG(),e.readUEG());e.readBool()}}}e.readBool()&&(e.readBool(),e.readBool(),e.readBool(),ut=e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG())}e.readBool();var Zt="hvc1.".concat(m,".1.L").concat($,".B0"),vt=ve-(t+a)*(fe===1||fe===2?2:1),yt=ye-(o+r)*(fe===1?2:1),At=1;return We!==1&&Xe!==1&&(At=We/Xe),e.destroy(),e=null,{codec_mimetype:Zt,profile_string:n.getProfileString(m),level_string:n.getLevelString($),profile_idc:m,bit_depth:Ee+8,ref_frames:1,chroma_format:fe,chroma_format_string:n.getChromaFormatString(fe),general_level_idc:$,general_profile_space:_,general_tier_flag:d,general_profile_idc:m,general_profile_compatibility_flags_1:f,general_profile_compatibility_flags_2:y,general_profile_compatibility_flags_3:S,general_profile_compatibility_flags_4:D,general_constraint_indicator_flags_1:x,general_constraint_indicator_flags_2:z,general_constraint_indicator_flags_3:X,general_constraint_indicator_flags_4:U,general_constraint_indicator_flags_5:W,general_constraint_indicator_flags_6:_e,min_spatial_segmentation_idc:ut,constant_frame_rate:0,chroma_format_idc:fe,bit_depth_luma_minus8:Ee,bit_depth_chroma_minus8:we,frame_rate:{fixed:ft,fps:it/tt,fps_den:tt,fps_num:it},sar_ratio:{width:We,height:Xe},codec_size:{width:vt,height:yt},present_size:{width:vt*At,height:yt}}},n.parsePPS=function(i){var e=new I(n._ebsp2rbsp(i));e.readByte(),e.readByte(),e.readUEG(),e.readUEG(),e.readBool(),e.readBool(),e.readBits(3),e.readBool(),e.readBool(),e.readUEG(),e.readUEG(),e.readSEG(),e.readBool(),e.readBool(),e.readBool()&&e.readUEG(),e.readSEG(),e.readSEG(),e.readBool(),e.readBool(),e.readBool(),e.readBool();var t=e.readBool(),a=e.readBool(),o=1;return a&&t?o=0:a?o=3:t&&(o=2),{parallelismType:o}},n.getChromaFormatString=function(i){switch(i){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}},n.getProfileString=function(i){switch(i){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}},n.getLevelString=function(i){return(i/30).toFixed(1)},n})();function V(n){return n.byteOffset%2==0&&n.byteLength%2==0}function Y(n){return n.byteOffset%4==0&&n.byteLength%4==0}function C(n,i){for(var e=0;e<n.length;e++)if(n[e]!==i[e])return!1;return!0}var l=function(n,i){return n.byteLength===i.byteLength&&(Y(n)&&Y(i)?(function(e,t){return C(new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4),new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4))})(n,i):V(n)&&V(i)?(function(e,t){return C(new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2))})(n,i):(function(e,t){return C(e,t)})(n,i))},u=function(){return u=Object.assign||function(n){for(var i,e=1,t=arguments.length;e<t;e++)for(var a in i=arguments[e])Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a]);return n},u.apply(this,arguments)},p=(function(){function n(){}return n.parseOBUs=function(i,e){for(var t=0;t<i.byteLength;){var a=t,o=(i[t],(120&i[t])>>3),r=!!(4&i[t]),s=!!(2&i[t]);i[t],t+=1,r&&(t+=1);var _=Number.POSITIVE_INFINITY;if(s){_=0;for(var d=0;;d++){var m=i[t++];if(_|=(127&m)<<7*d,!(128&m))break}}o===1?e=u(u({},n.parseSeuqneceHeader(i.subarray(t,t+_))),{sequence_header_data:i.subarray(a,t+_)}):(o==3&&e||o==6&&e)&&(e=n.parseOBUFrameHeader(i.subarray(t,t+_),0,0,e)),t+=_}return e},n.parseSeuqneceHeader=function(i){var e=new I(i),t=e.readBits(3),a=(e.readBool(),e.readBool()),o=!0,r=0,s=1,_=void 0,d=[];if(a)d.push({operating_point_idc:0,level:e.readBits(5),tier:0});else{if(e.readBool()){var m=e.readBits(32),f=e.readBits(32),y=e.readBool();if(y){for(var S=0;e.readBits(1)===0;)S+=1;S>=32||e.readBits(S)}r=f,s=m,o=y,e.readBool()&&(e.readBits(5),e.readBits(32),_=e.readBits(5),e.readBits(5))}for(var D=e.readBool(),x=e.readBits(5),z=0;z<=x;z++){var X=e.readBits(12),U=e.readBits(5),W=U>7?e.readBits(1):0;d.push({operating_point_idc:X,level:U,tier:W}),D&&e.readBool()&&e.readBits(4)}}var _e=d[0],$=_e.level,Q=_e.tier,me=e.readBits(4),ee=e.readBits(4),fe=e.readBits(me+1)+1,ve=e.readBits(ee+1)+1,ye=!1;a||(ye=e.readBool()),ye&&(e.readBits(4),e.readBits(4)),e.readBool(),e.readBool(),e.readBool();var Ee=!1,we=2,oe=2,le=0;a||(e.readBool(),e.readBool(),e.readBool(),e.readBool(),(Ee=e.readBool())&&(e.readBool(),e.readBool()),oe=(we=e.readBool()?2:e.readBits(1))?e.readBool()?2:e.readBits(1):2,le=Ee?e.readBits(3)+1:0);var be=e.readBool(),ue=(e.readBool(),e.readBool(),e.readBool()),Ce=8;Ce=t===2&&ue?e.readBool()?12:10:ue?10:8;var Ue=!1;t!==1&&(Ue=e.readBool()),e.readBool()&&(e.readBits(8),e.readBits(8),e.readBits(8));var xe=1,Be=1;return Ue?(e.readBits(1),xe=1,Be=1):(e.readBits(1),t==0?(xe=1,Be=1):t==1?(xe=0,Be=0):Ce==12?e.readBits(1)&&e.readBits(1):(xe=1,Be=0),xe&&Be&&e.readBits(2),e.readBits(1)),e.readBool(),e.destroy(),e=null,{codec_mimetype:"av01.".concat(t,".").concat(n.getLevelString($,Q),".").concat(Ce.toString(10).padStart(2,"0")),level:$,tier:Q,level_string:n.getLevelString($,Q),profile_idc:t,profile_string:"".concat(t),bit_depth:Ce,ref_frames:1,chroma_format:n.getChromaFormat(Ue,xe,Be),chroma_format_string:n.getChromaFormatString(Ue,xe,Be),sequence_header:{frame_id_numbers_present_flag:ye,additional_frame_id_length_minus_1:void 0,delta_frame_id_length_minus_2:void 0,reduced_still_picture_header:a,decoder_model_info_present_flag:!1,operating_points:d,buffer_removal_time_length_minus_1:_,equal_picture_interval:o,seq_force_screen_content_tools:we,seq_force_integer_mv:oe,enable_order_hint:Ee,order_hint_bits:le,enable_superres:be,frame_width_bit:me+1,frame_height_bit:ee+1,max_frame_width:fe,max_frame_height:ve},keyframe:void 0,frame_rate:{fixed:o,fps:r/s,fps_den:s,fps_num:r}}},n.parseOBUFrameHeader=function(i,e,t,a){var o=a.sequence_header,r=new I(i),s=(o.max_frame_width,o.max_frame_height,0);o.frame_id_numbers_present_flag&&(s=o.additional_frame_id_length_minus_1+o.delta_frame_id_length_minus_2+3);var _=0,d=!0,m=!0,f=!1;if(!o.reduced_still_picture_header){if(r.readBool())return a;d=(_=r.readBits(2))===2||_===0,(m=r.readBool())&&o.decoder_model_info_present_flag&&o.equal_picture_interval,m&&r.readBool(),f=!!(_===3||_===0&&m)||r.readBool()}a.keyframe=d,r.readBool();var y=o.seq_force_screen_content_tools;o.seq_force_screen_content_tools===2&&(y=r.readBits(1)),y&&(o.seq_force_integer_mv,o.seq_force_integer_mv==2&&r.readBits(1)),o.frame_id_numbers_present_flag&&r.readBits(s);var S;if(S=_==3||!o.reduced_still_picture_header&&r.readBool(),r.readBits(o.order_hint_bits),d||f||r.readBits(3),o.decoder_model_info_present_flag&&r.readBool()){for(var D=0;D<=o.operating_points_cnt_minus_1;D++)if(o.operating_points[D].decoder_model_present_for_this_op[D]){var x=o.operating_points[D].operating_point_idc;(x===0||x>>e&1&&x>>t+8&1)&&r.readBits(o.buffer_removal_time_length_minus_1+1)}}var z=255;if(_===3||_==0&&m||(z=r.readBits(8)),(d||z!==255)&&f&&o.enable_order_hint)for(var X=0;X<8;X++)r.readBits(o.order_hint_bits);if(d){var U=n.frameSizeAndRenderSize(r,S,o);a.codec_size={width:U.FrameWidth,height:U.FrameHeight},a.present_size={width:U.RenderWidth,height:U.RenderHeight},a.sar_ratio={width:U.RenderWidth/U.FrameWidth,height:U.RenderHeight/U.FrameHeight}}return r.destroy(),r=null,a},n.frameSizeAndRenderSize=function(i,e,t){var a=t.max_frame_width,o=t.max_frame_height;e&&(a=i.readBits(t.frame_width_bit)+1,o=i.readBits(t.frame_height_bit)+1);var r=!1;t.enable_superres&&(r=i.readBool());var s=8;r&&(s=i.readBits(3)+9);var _=a;a=Math.floor((8*_+s/2)/s);var d=_,m=o;if(i.readBool()){var f=i.readBits(16)+1,y=i.readBits(16)+1;d=i.readBits(f)+1,m=i.readBits(y)+1}return{UpscaledWidth:_,FrameWidth:a,FrameHeight:o,RenderWidth:d,RenderHeight:m}},n.getLevelString=function(i,e){return"".concat(i.toString(10).padStart(2,"0")).concat(e===0?"M":"H")},n.getChromaFormat=function(i,e,t){return i?0:e===0&&t===0?3:e===1&&t===0?2:e===1&&t===1?1:NaN},n.getChromaFormatString=function(i,e,t){return i?"4:0:0":e===0&&t===0?"4:4:4":e===1&&t===0?"4:2:2":e===1&&t===1?"4:2:0":"Unknown"},n})(),v=function(){};function H(n,i,e){if(!n||n.byteLength<2)return null;var t=1;e==="h265"&&(t=2);var a=(function(m){for(var f=m,y=f.byteLength,S=new Uint8Array(y),D=0,x=0;x<y;x++)x>=2&&f[x]===3&&f[x-1]===0&&f[x-2]===0||(S[D]=f[x],D++);return new Uint8Array(S.buffer,0,D)})(n.subarray(t)),o=0;if(o===a.byteLength-1&&a[o]===128)return null;for(var r=0;o<a.byteLength&&a[o]===255;)r+=255,o++;if(o>=a.byteLength)return null;r+=a[o++];for(var s=0;o<a.byteLength&&a[o]===255;)s+=255,o++;if(o>=a.byteLength||(s+=a[o++],o+s>a.byteLength))return null;var _=new v;_.type=r,_.size=s;var d=a.subarray(o,o+s);return r===5&&s>=16&&(_.uuid=d.subarray(0,16),_.user_data=d.subarray(16)),i!==void 0&&(_.pts=i),_}var j,ne=(function(){function n(i,e){this.TAG="FLVDemuxer",this._config=e,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._onSeiArrived=null,this._dataOffset=i.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=i.hasAudioTrack,this._hasVideo=i.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new b.A,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=(function(){var t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),new Int16Array(t)[0]===256})()}return n.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._onSeiArrived=null},n.probe=function(i){var e=new Uint8Array(i);if(e.byteLength<9)return{needMoreData:!0};var t={match:!1};if(e[0]!==70||e[1]!==76||e[2]!==86||e[3]!==1)return t;var a,o=(4&e[4])>>>2!=0,r=!!(1&e[4]),s=(a=e)[5]<<24|a[6]<<16|a[7]<<8|a[8];return s<9?t:{match:!0,consumed:s,dataOffset:s,hasAudioTrack:o,hasVideoTrack:r}},n.prototype.bindDataSource=function(i){return i.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(n.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(i){this._onTrackMetadata=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(i){this._onMediaInfo=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(i){this._onMetaDataArrived=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(i){this._onScriptDataArrived=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onSeiArrived",{get:function(){return this._onSeiArrived},set:function(i){this._onSeiArrived=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onError",{get:function(){return this._onError},set:function(i){this._onError=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(i){this._onDataAvailable=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(i){this._timestampBase=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"overridedDuration",{get:function(){return this._duration},set:function(i){this._durationOverrided=!0,this._duration=i,this._mediaInfo.duration=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"overridedHasAudio",{set:function(i){this._hasAudioFlagOverrided=!0,this._hasAudio=i,this._mediaInfo.hasAudio=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"overridedHasVideo",{set:function(i){this._hasVideoFlagOverrided=!0,this._hasVideo=i,this._mediaInfo.hasVideo=i},enumerable:!1,configurable:!0}),n.prototype.resetMediaInfo=function(){this._mediaInfo=new b.A},n.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},n.prototype.parseChunks=function(i,e){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new O.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var t=0,a=this._littleEndian;if(e===0){if(!(i.byteLength>13))return 0;t=n.probe(i).dataOffset}for(this._firstParse&&(this._firstParse=!1,e+t!==this._dataOffset&&c.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),(o=new DataView(i,t)).getUint32(0,!a)!==0&&c.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),t+=4);t<i.byteLength;){this._dispatch=!0;var o=new DataView(i,t);if(t+11+4>i.byteLength)break;var r=o.getUint8(0),s=16777215&o.getUint32(0,!a);if(t+11+s+4>i.byteLength)break;if(r===8||r===9||r===18){var _=o.getUint8(4),d=o.getUint8(5),m=o.getUint8(6)|d<<8|_<<16|o.getUint8(7)<<24;16777215&o.getUint32(7,!a)&&c.A.w(this.TAG,"Meet tag which has StreamID != 0!");var f=t+11;switch(r){case 8:this._parseAudioData(i,f,s,m);break;case 9:this._parseVideoData(i,f,s,m,e+t);break;case 18:this._parseScriptData(i,f,s)}var y=o.getUint32(11+s,!a);y!==11+s&&c.A.w(this.TAG,"Invalid PrevTagSize ".concat(y)),t+=11+s+4}else c.A.w(this.TAG,"Unsupported tag type ".concat(r,", skipped")),t+=11+s+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),t},n.prototype._parseScriptData=function(i,e,t){var a=A.parseScriptData(i,e,t);if(a.hasOwnProperty("onMetaData")){if(a.onMetaData==null||typeof a.onMetaData!="object")return void c.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&c.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=a;var o=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},o)),typeof o.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=o.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof o.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=o.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof o.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=o.audiodatarate),typeof o.videodatarate=="number"&&(this._mediaInfo.videoDataRate=o.videodatarate),typeof o.width=="number"&&(this._mediaInfo.width=o.width),typeof o.height=="number"&&(this._mediaInfo.height=o.height),typeof o.duration=="number"){if(!this._durationOverrided){var r=Math.floor(o.duration*this._timescale);this._duration=r,this._mediaInfo.duration=r}}else this._mediaInfo.duration=0;if(typeof o.framerate=="number"){var s=Math.floor(1e3*o.framerate);if(s>0){var _=s/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=_,this._referenceFrameRate.fps_num=s,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=_}}if(typeof o.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var d=o.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(d),o.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=o,c.A.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(a).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},a))},n.prototype._parseSEIPayload=function(i,e,t){var a=H(i,e,t);a&&typeof this._onSeiArrived=="function"&&this._onSeiArrived(a)},n.prototype._parseKeyframesIndex=function(i){for(var e=[],t=[],a=1;a<i.times.length;a++){var o=this._timestampBase+Math.floor(1e3*i.times[a]);e.push(o),t.push(i.filepositions[a])}return{times:e,filepositions:t}},n.prototype._parseAudioData=function(i,e,t,a){if(t<=1)c.A.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(this._hasAudioFlagOverrided!==!0||this._hasAudio!==!1){this._littleEndian;var o=new DataView(i,e,t).getUint8(0),r=o>>>4;if(r!==9)if(r===2||r===3||r===10){var s=0,_=(12&o)>>>2;if(_>=0&&_<=4){s=this._flvSoundRateTable[_];var d=(2&o)>>>1,m=1&o,f=this._audioMetadata,y=this._audioTrack;if(f||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(f=this._audioMetadata={}).type="audio",f.id=y.id,f.timescale=this._timescale,f.duration=this._duration,f.audioSampleRate=s,f.channelCount=m===0?1:2),r===10){var S=this._parseAACAudioData(i,e+1,t-1);if(S==null)return;if(S.packetType===0){if(f.config){if(l(S.data.config,f.config))return;c.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var D=S.data;f.audioSampleRate=D.samplingRate,f.channelCount=D.channelCount,f.codec=D.codec,f.originalCodec=D.originalCodec,f.config=D.config,f.refSampleDuration=1024/f.audioSampleRate*f.timescale,c.A.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",f),(U=this._mediaInfo).audioCodec=f.originalCodec,U.audioSampleRate=f.audioSampleRate,U.audioChannelCount=f.channelCount,U.hasVideo?U.videoCodec!=null&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.audioCodec+'"',U.isComplete()&&this._onMediaInfo(U)}else if(S.packetType===1){var x=this._timestampBase+a,z={unit:S.data,length:S.data.byteLength,dts:x,pts:x};y.samples.push(z),y.length+=S.data.length}else c.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(S.packetType))}else if(r===2){if(!f.codec){if((D=this._parseMP3AudioData(i,e+1,t-1,!0))==null)return;f.audioSampleRate=D.samplingRate,f.channelCount=D.channelCount,f.codec=D.codec,f.originalCodec=D.originalCodec,f.refSampleDuration=1152/f.audioSampleRate*f.timescale,c.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",f),(U=this._mediaInfo).audioCodec=f.codec,U.audioSampleRate=f.audioSampleRate,U.audioChannelCount=f.channelCount,U.audioDataRate=D.bitRate,U.hasVideo?U.videoCodec!=null&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.audioCodec+'"',U.isComplete()&&this._onMediaInfo(U)}if((W=this._parseMP3AudioData(i,e+1,t-1,!1))==null)return;x=this._timestampBase+a;var X={unit:W,length:W.byteLength,dts:x,pts:x};y.samples.push(X),y.length+=W.length}else if(r===3){var U;f.codec||(f.audioSampleRate=s,f.sampleSize=8*(d+1),f.littleEndian=!0,f.codec="ipcm",f.originalCodec="ipcm",this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",f),(U=this._mediaInfo).audioCodec=f.codec,U.audioSampleRate=f.audioSampleRate,U.audioChannelCount=f.channelCount,U.audioDataRate=f.sampleSize*f.audioSampleRate,U.hasVideo?U.videoCodec!=null&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.audioCodec+'"',U.isComplete()&&this._onMediaInfo(U));var W=new Uint8Array(i,e+1,t-1),_e=(x=this._timestampBase+a,{unit:W,length:W.byteLength,dts:x,pts:x});y.samples.push(_e),y.length+=W.length}}else this._onError(E.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+_)}else this._onError(E.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+r);else{if(t<=5)return void c.A.w(this.TAG,"Flv: Invalid audio packet, missing AudioFourCC in Ehnanced FLV payload!");var $=15&o,Q=String.fromCharCode.apply(String,new Uint8Array(i,e,t).slice(1,5));switch(Q){case"Opus":this._parseOpusAudioPacket(i,e+5,t-5,a,$);break;case"fLaC":this._parseFlacAudioPacket(i,e+5,t-5,a,$);break;default:this._onError(E.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec: "+Q)}}}},n.prototype._parseAACAudioData=function(i,e,t){if(!(t<=1)){var a={},o=new Uint8Array(i,e,t);return a.packetType=o[0],o[0]===0?a.data=this._parseAACAudioSpecificConfig(i,e+1,t-1):a.data=o.subarray(1),a}c.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},n.prototype._parseAACAudioSpecificConfig=function(i,e,t){var a,o,r=new Uint8Array(i,e,t),s=null,_=0,d=null;if(_=a=r[0]>>>3,(o=(7&r[0])<<1|r[1]>>>7)<0||o>=this._mpegSamplingRates.length)this._onError(E.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var m=this._mpegSamplingRates[o],f=(120&r[1])>>>3;if(!(f<0||f>=8)){_===5&&(d=(7&r[1])<<1|r[2]>>>7,r[2]);var y=self.navigator.userAgent.toLowerCase();return y.indexOf("firefox")!==-1?o>=6?(_=5,s=new Array(4),d=o-3):(_=2,s=new Array(2),d=o):y.indexOf("android")!==-1?(_=2,s=new Array(2),d=o):(_=5,d=o,s=new Array(4),o>=6?d=o-3:f===1&&(_=2,s=new Array(2),d=o)),s[0]=_<<3,s[0]|=(15&o)>>>1,s[1]=(15&o)<<7,s[1]|=(15&f)<<3,_===5&&(s[1]|=(15&d)>>>1,s[2]=(1&d)<<7,s[2]|=8,s[3]=0),{config:s,samplingRate:m,channelCount:f,codec:"mp4a.40."+_,originalCodec:"mp4a.40."+a}}this._onError(E.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},n.prototype._parseMP3AudioData=function(i,e,t,a){if(!(t<4)){this._littleEndian;var o=new Uint8Array(i,e,t),r=null;if(a){if(o[0]!==255)return;var s=o[1]>>>3&3,_=(6&o[1])>>1,d=(240&o[2])>>>4,m=(12&o[2])>>>2,f=3&~(o[3]>>>6)?2:1,y=0,S=0;switch(s){case 0:y=this._mpegAudioV25SampleRateTable[m];break;case 2:y=this._mpegAudioV20SampleRateTable[m];break;case 3:y=this._mpegAudioV10SampleRateTable[m]}switch(_){case 1:d<this._mpegAudioL3BitRateTable.length&&(S=this._mpegAudioL3BitRateTable[d]);break;case 2:d<this._mpegAudioL2BitRateTable.length&&(S=this._mpegAudioL2BitRateTable[d]);break;case 3:d<this._mpegAudioL1BitRateTable.length&&(S=this._mpegAudioL1BitRateTable[d])}r={bitRate:S,samplingRate:y,channelCount:f,codec:"mp3",originalCodec:"mp3"}}else r=o;return r}c.A.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},n.prototype._parseOpusAudioPacket=function(i,e,t,a,o){if(o===0)this._parseOpusSequenceHeader(i,e,t);else if(o===1)this._parseOpusAudioData(i,e,t,a);else if(o!==2)return void this._onError(E.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(o))},n.prototype._parseOpusSequenceHeader=function(i,e,t){if(t<=16)c.A.w(this.TAG,"Flv: Invalid OpusSequenceHeader, lack of data!");else{var a=this._audioMetadata,o=this._audioTrack;a||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(a=this._audioMetadata={}).type="audio",a.id=o.id,a.timescale=this._timescale,a.duration=this._duration);var r=new DataView(i,e,t);r.setUint8(8,0);var s=r.getUint8(9);r.setUint16(10,r.getUint16(10,!0),!1);var _=r.getUint32(12,!0);r.setUint32(12,r.getUint32(12,!0),!1);var d={config:new Uint8Array(i,e+8,t-8),channelCount:s,samplingFrequence:_,codec:"opus",originalCodec:"opus"};if(a.config){if(l(d.config,a.config))return;c.A.w(this.TAG,"OpusSequenceHeader has been changed, re-generate initialization segment")}a.audioSampleRate=d.samplingFrequence,a.channelCount=d.channelCount,a.codec=d.codec,a.originalCodec=d.originalCodec,a.config=d.config,a.refSampleDuration=20,c.A.v(this.TAG,"Parsed OpusSequenceHeader"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",a);var m=this._mediaInfo;m.audioCodec=a.originalCodec,m.audioSampleRate=a.audioSampleRate,m.audioChannelCount=a.channelCount,m.hasVideo?m.videoCodec!=null&&(m.mimeType='video/x-flv; codecs="'+m.videoCodec+","+m.audioCodec+'"'):m.mimeType='video/x-flv; codecs="'+m.audioCodec+'"',m.isComplete()&&this._onMediaInfo(m)}},n.prototype._parseOpusAudioData=function(i,e,t,a){var o=this._audioTrack,r=new Uint8Array(i,e,t),s=this._timestampBase+a,_={unit:r,length:r.byteLength,dts:s,pts:s};o.samples.push(_),o.length+=r.length},n.prototype._parseFlacAudioPacket=function(i,e,t,a,o){if(o===0)this._parseFlacSequenceHeader(i,e,t);else if(o===1)this._parseFlacAudioData(i,e,t,a);else if(o!==2)return void this._onError(E.A.FORMAT_ERROR,"Flv: Invalid Flac audio packet type ".concat(o))},n.prototype._parseFlacSequenceHeader=function(i,e,t){var a=this._audioMetadata,o=this._audioTrack;a||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(a=this._audioMetadata={}).type="audio",a.id=o.id,a.timescale=this._timescale,a.duration=this._duration);var r=new Uint8Array(i,e+4,t-4),s=new I(r),_=s.readBits(16),d=s.readBits(16),m=d===_?d:null;s.readBits(24),s.readBits(24);var f=s.readBits(20),y=s.readBits(3)+1,S=s.readBits(5)+1;s.destroy();var D=new Uint8Array(r.byteLength+4);D.set(r,4),D[0]=128,D[1]=r.byteLength>>>16&255,D[2]=r.byteLength>>>8&255,D[3]=r.byteLength>>>0&255;var x={config:D,channelCount:y,samplingFrequence:f,sampleSize:S,codec:"flac",originalCodec:"flac"};if(a.config){if(l(x.config,a.config))return;c.A.w(this.TAG,"FlacSequenceHeader has been changed, re-generate initialization segment")}a.audioSampleRate=x.samplingFrequence,a.channelCount=x.channelCount,a.sampleSize=x.sampleSize,a.codec=x.codec,a.originalCodec=x.originalCodec,a.config=x.config,a.refSampleDuration=m!=null?1e3*m/x.samplingFrequence:null,c.A.v(this.TAG,"Parsed FlacSequenceHeader"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",a);var z=this._mediaInfo;z.audioCodec=a.originalCodec,z.audioSampleRate=a.audioSampleRate,z.audioChannelCount=a.channelCount,z.hasVideo?z.videoCodec!=null&&(z.mimeType='video/x-flv; codecs="'+z.videoCodec+","+z.audioCodec+'"'):z.mimeType='video/x-flv; codecs="'+z.audioCodec+'"',z.isComplete()&&this._onMediaInfo(z)},n.prototype._parseFlacAudioData=function(i,e,t,a){var o=this._audioTrack,r=new Uint8Array(i,e,t),s=this._timestampBase+a,_={unit:r,length:r.byteLength,dts:s,pts:s};o.samples.push(_),o.length+=r.length},n.prototype._parseVideoData=function(i,e,t,a,o){if(t<=1)c.A.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(this._hasVideoFlagOverrided!==!0||this._hasVideo!==!1){var r=new Uint8Array(i,e,t)[0],s=(112&r)>>>4;if(128&r){var _=15&r,d=String.fromCharCode.apply(String,new Uint8Array(i,e,t).slice(1,5));if(d==="hvc1")this._parseEnhancedHEVCVideoPacket(i,e+5,t-5,a,o,s,_);else{if(d!=="av01")return void this._onError(E.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(d));this._parseEnhancedAV1VideoPacket(i,e+5,t-5,a,o,s,_)}}else{var m=15&r;if(m===7)this._parseAVCVideoPacket(i,e+1,t-1,a,o,s);else{if(m!==12)return void this._onError(E.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(m));this._parseHEVCVideoPacket(i,e+1,t-1,a,o,s)}}}},n.prototype._parseAVCVideoPacket=function(i,e,t,a,o,r){if(t<4)c.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var s=this._littleEndian,_=new DataView(i,e,t),d=_.getUint8(0),m=(16777215&_.getUint32(0,!s))<<8>>8;if(d===0)this._parseAVCDecoderConfigurationRecord(i,e+4,t-4);else if(d===1)this._parseAVCVideoData(i,e+4,t-4,a,o,r,m);else if(d!==2)return void this._onError(E.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(d))}},n.prototype._parseHEVCVideoPacket=function(i,e,t,a,o,r){if(t<4)c.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var s=this._littleEndian,_=new DataView(i,e,t),d=_.getUint8(0),m=(16777215&_.getUint32(0,!s))<<8>>8;if(d===0)this._parseHEVCDecoderConfigurationRecord(i,e+4,t-4);else if(d===1)this._parseHEVCVideoData(i,e+4,t-4,a,o,r,m);else if(d!==2)return void this._onError(E.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(d))}},n.prototype._parseEnhancedHEVCVideoPacket=function(i,e,t,a,o,r,s){var _=this._littleEndian,d=new DataView(i,e,t);if(s===0)this._parseHEVCDecoderConfigurationRecord(i,e,t);else if(s===1){var m=(4294967040&d.getUint32(0,!_))>>8;this._parseHEVCVideoData(i,e+3,t-3,a,o,r,m)}else if(s===3)this._parseHEVCVideoData(i,e,t,a,o,r,0);else if(s!==2)return void this._onError(E.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(s))},n.prototype._parseEnhancedAV1VideoPacket=function(i,e,t,a,o,r,s){if(this._littleEndian,new DataView(i,e,t),s===0)this._parseAV1CodecConfigurationRecord(i,e,t);else if(s===1)this._parseAV1VideoData(i,e,t,a,o,r,0);else{if(s===5)return void this._onError(E.A.FORMAT_ERROR,"Flv: Not Supported MP2T AV1 video packet type ".concat(s));if(s!==2)return void this._onError(E.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(s))}},n.prototype._parseAVCDecoderConfigurationRecord=function(i,e,t){if(t<7)c.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var a=this._videoMetadata,o=this._videoTrack,r=this._littleEndian,s=new DataView(i,e,t);if(a){if(a.avcc!==void 0){if(l(new Uint8Array(i,e,t),a.avcc))return;c.A.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(a=this._videoMetadata={}).type="video",a.id=o.id,a.timescale=this._timescale,a.duration=this._duration;var _=s.getUint8(0),d=s.getUint8(1);if(s.getUint8(2),s.getUint8(3),_===1&&d!==0)if(this._naluLengthSize=1+(3&s.getUint8(4)),this._naluLengthSize===3||this._naluLengthSize===4){var m=31&s.getUint8(5);if(m!==0){m>1&&c.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(m));for(var f=6,y=0;y<m;y++){var S=s.getUint16(f,!r);if(f+=2,S!==0){var D=new Uint8Array(i,e+f,S);f+=S;var x=F.parseSPS(D);if(y===0){a.codecWidth=x.codec_size.width,a.codecHeight=x.codec_size.height,a.presentWidth=x.present_size.width,a.presentHeight=x.present_size.height,a.profile=x.profile_string,a.level=x.level_string,a.bitDepth=x.bit_depth,a.chromaFormat=x.chroma_format,a.sarRatio=x.sar_ratio,a.frameRate=x.frame_rate,x.frame_rate.fixed!==!1&&x.frame_rate.fps_num!==0&&x.frame_rate.fps_den!==0||(a.frameRate=this._referenceFrameRate);var z=a.frameRate.fps_den,X=a.frameRate.fps_num;a.refSampleDuration=a.timescale*(z/X);for(var U=D.subarray(1,4),W="avc1.",_e=0;_e<3;_e++){var $=U[_e].toString(16);$.length<2&&($="0"+$),W+=$}a.codec=W;var Q=this._mediaInfo;Q.width=a.codecWidth,Q.height=a.codecHeight,Q.fps=a.frameRate.fps,Q.profile=a.profile,Q.level=a.level,Q.refFrames=x.ref_frames,Q.chromaFormat=x.chroma_format_string,Q.sarNum=a.sarRatio.width,Q.sarDen=a.sarRatio.height,Q.videoCodec=W,Q.hasAudio?Q.audioCodec!=null&&(Q.mimeType='video/x-flv; codecs="'+Q.videoCodec+","+Q.audioCodec+'"'):Q.mimeType='video/x-flv; codecs="'+Q.videoCodec+'"',Q.isComplete()&&this._onMediaInfo(Q)}}}var me=s.getUint8(f);if(me!==0){for(me>1&&c.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(me)),f++,y=0;y<me;y++)S=s.getUint16(f,!r),f+=2,S!==0&&(f+=S);a.avcc=new Uint8Array(t),a.avcc.set(new Uint8Array(i,e,t),0),c.A.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",a)}else this._onError(E.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else this._onError(E.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else this._onError(E.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else this._onError(E.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}},n.prototype._parseHEVCDecoderConfigurationRecord=function(i,e,t){if(t<22)c.A.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var a=this._videoMetadata,o=this._videoTrack,r=this._littleEndian,s=new DataView(i,e,t);if(a){if(a.hvcc!==void 0){if(l(new Uint8Array(i,e,t),a.hvcc))return;c.A.w(this.TAG,"HEVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(a=this._videoMetadata={}).type="video",a.id=o.id,a.timescale=this._timescale,a.duration=this._duration;var _=s.getUint8(0),d=31&s.getUint8(1);if(_!==0&&_!==1||d===0)this._onError(E.A.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord");else if(this._naluLengthSize=1+(3&s.getUint8(21)),this._naluLengthSize===3||this._naluLengthSize===4){for(var m=s.getUint8(22),f=0,y=23;f<m;f++){var S=63&s.getUint8(y+0),D=s.getUint16(y+1,!r);y+=3;for(var x=0;x<D;x++){var z=s.getUint16(y+0,!r);if(x===0)if(S===33){y+=2;var X=new Uint8Array(i,e+y,z),U=K.parseSPS(X);a.codecWidth=U.codec_size.width,a.codecHeight=U.codec_size.height,a.presentWidth=U.present_size.width,a.presentHeight=U.present_size.height,a.profile=U.profile_string,a.level=U.level_string,a.bitDepth=U.bit_depth,a.chromaFormat=U.chroma_format,a.sarRatio=U.sar_ratio,a.frameRate=U.frame_rate,U.frame_rate.fixed!==!1&&U.frame_rate.fps_num!==0&&U.frame_rate.fps_den!==0||(a.frameRate=this._referenceFrameRate);var W=a.frameRate.fps_den,_e=a.frameRate.fps_num;a.refSampleDuration=a.timescale*(W/_e),a.codec=U.codec_mimetype;var $=this._mediaInfo;$.width=a.codecWidth,$.height=a.codecHeight,$.fps=a.frameRate.fps,$.profile=a.profile,$.level=a.level,$.refFrames=U.ref_frames,$.chromaFormat=U.chroma_format_string,$.sarNum=a.sarRatio.width,$.sarDen=a.sarRatio.height,$.videoCodec=U.codec_mimetype,$.hasAudio?$.audioCodec!=null&&($.mimeType='video/x-flv; codecs="'+$.videoCodec+","+$.audioCodec+'"'):$.mimeType='video/x-flv; codecs="'+$.videoCodec+'"',$.isComplete()&&this._onMediaInfo($),y+=z}else y+=2+z;else y+=2+z}}a.hvcc=new Uint8Array(t),a.hvcc.set(new Uint8Array(i,e,t),0),c.A.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",a)}else this._onError(E.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1))}},n.prototype._parseAV1CodecConfigurationRecord=function(i,e,t){if(t<4)c.A.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");else{var a=this._videoMetadata,o=this._videoTrack,r=(this._littleEndian,new DataView(i,e,t));a?a.av1c!==void 0&&c.A.w(this.TAG,"Found another AV1CodecConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(a=this._videoMetadata={}).type="video",a.id=o.id,a.timescale=this._timescale,a.duration=this._duration);var s=127&r.getUint8(0);if(r.getUint8(1),r.getUint8(1),r.getUint8(2),s===1){var _=p.parseOBUs(new Uint8Array(i,e+4,t-4));if(_!=null){a.profile=_.profile_string,a.level=_.level_string,a.bitDepth=_.bit_depth,a.chromaFormat=_.chroma_format,a.frameRate=_.frame_rate,_.frame_rate.fixed!==!1&&_.frame_rate.fps_num!==0&&_.frame_rate.fps_den!==0||(a.frameRate=this._referenceFrameRate);var d=a.frameRate.fps_den,m=a.frameRate.fps_num;a.refSampleDuration=a.timescale*(d/m),a.codec=_.codec_mimetype,a.extra=_;var f=this._mediaInfo;f.fps=a.frameRate.fps,f.profile=a.profile,f.level=a.level,f.refFrames=_.ref_frames,f.chromaFormat=_.chroma_format_string,f.videoCodec=_.codec_mimetype,f.hasAudio?f.audioCodec!=null&&(f.mimeType='video/x-flv; codecs="'+f.videoCodec+","+f.audioCodec+'"'):f.mimeType='video/x-flv; codecs="'+f.videoCodec+'"',f.isComplete()&&this._onMediaInfo(f),a.av1c=new Uint8Array(t),a.av1c.set(new Uint8Array(i,e,t),0),c.A.v(this.TAG,"Preparing AV1CodecConfigurationRecord")}else this._onError(E.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}else this._onError(E.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}},n.prototype._parseAVCVideoData=function(i,e,t,a,o,r,s){for(var _=this._littleEndian,d=new DataView(i,e,t),m=[],f=0,y=0,S=this._naluLengthSize,D=this._timestampBase+a,x=r===1;y<t;){if(y+4>=t){c.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(D,", offset = ").concat(y,", dataSize = ").concat(t));break}var z=d.getUint32(y,!_);if(S===3&&(z>>>=8),z>t-S)return void c.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(D,", NaluSize > DataSize!"));var X=31&d.getUint8(y+S);X===5&&(x=!0);var U=new Uint8Array(i,e+y,S+z),W={type:X,data:U};m.push(W),f+=U.byteLength,X===6&&this._parseSEIPayload(U.subarray(S),D+s,"h264"),y+=S+z}if(m.length){var _e=this._videoTrack,$={units:m,length:f,isKeyframe:x,dts:D,cts:s,pts:D+s};x&&($.fileposition=o),_e.samples.push($),_e.length+=f}},n.prototype._parseHEVCVideoData=function(i,e,t,a,o,r,s){for(var _=this._littleEndian,d=new DataView(i,e,t),m=[],f=0,y=0,S=this._naluLengthSize,D=this._timestampBase+a,x=r===1;y<t;){if(y+4>=t){c.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(D,", offset = ").concat(y,", dataSize = ").concat(t));break}var z=d.getUint32(y,!_);if(S===3&&(z>>>=8),z>t-S)return void c.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(D,", NaluSize > DataSize!"));var X=d.getUint8(y+S)>>1&63;X!==19&&X!==20&&X!==21||(x=!0);var U=new Uint8Array(i,e+y,S+z),W={type:X,data:U};m.push(W),f+=U.byteLength,X!==39&&X!==40||this._parseSEIPayload(U.subarray(S),D+s,"h265"),y+=S+z}if(m.length){var _e=this._videoTrack,$={units:m,length:f,isKeyframe:x,dts:D,cts:s,pts:D+s};x&&($.fileposition=o),_e.samples.push($),_e.length+=f}},n.prototype._parseAV1VideoData=function(i,e,t,a,o,r,s){this._littleEndian,new DataView(i,e,t);var _,d=[],m=this._timestampBase+a,f=r===1;if(f){var y=this._videoMetadata,S=p.parseOBUs(new Uint8Array(i,e,t),y.extra);if(S==null)return void this._onError(E.A.FORMAT_ERROR,"Flv: Invalid AV1 VideoData");y.codecWidth=S.codec_size.width,y.codecHeight=S.codec_size.height,y.presentWidth=S.present_size.width,y.presentHeight=S.present_size.height,y.sarRatio=S.sar_ratio;var D=this._mediaInfo;D.width=y.codecWidth,D.height=y.codecHeight,D.sarNum=y.sarRatio.width,D.sarDen=y.sarRatio.height,c.A.v(this.TAG,"Parsed AV1DecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",y)}if(_=t,d.push({unitType:0,data:new Uint8Array(i,e+0,t)}),d.length){var x=this._videoTrack,z={units:d,length:_,isKeyframe:f,dts:m,cts:s,pts:m+s};f&&(z.fileposition=o),x.samples.push(z),x.length+=_}},n})(),ie=(function(){function n(){}return n.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onPGSSubtitleData=null,this.onSynchronousKLVMetadata=null,this.onAsynchronousKLVMetadata=null,this.onSMPTE2038Metadata=null,this.onSEI=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},n})(),ce=function(){this.program_pmt_pid={}};(function(n){n[n.kMPEG1Audio=3]="kMPEG1Audio",n[n.kMPEG2Audio=4]="kMPEG2Audio",n[n.kPESPrivateData=6]="kPESPrivateData",n[n.kADTSAAC=15]="kADTSAAC",n[n.kLOASAAC=17]="kLOASAAC",n[n.kAC3=129]="kAC3",n[n.kEAC3=135]="kEAC3",n[n.kMetadata=21]="kMetadata",n[n.kSCTE35=134]="kSCTE35",n[n.kPGS=144]="kPGS",n[n.kH264=27]="kH264",n[n.kH265=36]="kH265"})(j||(j={}));var Se,Te=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,av1:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,eac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.pgs_pids={},this.pgs_langs={},this.synchronous_klv_pids={},this.asynchronous_klv_pids={},this.scte_35_pids={},this.smpte2038_pids={}},Re=function(){},ke=function(){},k=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0};(function(n){n[n.kUnspecified=0]="kUnspecified",n[n.kSliceNonIDR=1]="kSliceNonIDR",n[n.kSliceDPA=2]="kSliceDPA",n[n.kSliceDPB=3]="kSliceDPB",n[n.kSliceDPC=4]="kSliceDPC",n[n.kSliceIDR=5]="kSliceIDR",n[n.kSliceSEI=6]="kSliceSEI",n[n.kSliceSPS=7]="kSliceSPS",n[n.kSlicePPS=8]="kSlicePPS",n[n.kSliceAUD=9]="kSliceAUD",n[n.kEndOfSequence=10]="kEndOfSequence",n[n.kEndOfStream=11]="kEndOfStream",n[n.kFiller=12]="kFiller",n[n.kSPSExt=13]="kSPSExt",n[n.kReserved0=14]="kReserved0"})(Se||(Se={}));var h,R,G=function(){},ae=function(n){var i=n.data.byteLength;this.type=n.type,this.data=new Uint8Array(4+i),new DataView(this.data.buffer).setUint32(0,i),this.data.set(n.data,4)},de=(function(){function n(i){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=i,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&c.A.e(this.TAG,"Could not find H264 startcode until payload end!")}return n.prototype.findNextStartCodeOffset=function(i){for(var e=i,t=this.data_;;){if(e+3>=t.byteLength)return this.eof_flag_=!0,t.byteLength;var a=t[e+0]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],o=t[e+0]<<16|t[e+1]<<8|t[e+2];if(a===1||o===1)return e;e++}},n.prototype.readNextNaluPayload=function(){for(var i=this.data_,e=null;e==null&&!this.eof_flag_;){var t=this.current_startcode_offset_,a=31&i[t+=(i[t]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3])==1?4:3],o=(128&i[t])>>>7,r=this.findNextStartCodeOffset(t);if(this.current_startcode_offset_=r,!(a>=Se.kReserved0)&&o===0){var s=i.subarray(t,r);(e=new G).type=a,e.data=s}}return e},n})(),ge=(function(){function n(i,e,t){var a=8+i.byteLength+1+2+e.byteLength,o=!1;i[3]!==66&&i[3]!==77&&i[3]!==88&&(o=!0,a+=4);var r=this.data=new Uint8Array(a);r[0]=1,r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=255,r[5]=225;var s=i.byteLength;r[6]=s>>>8,r[7]=255&s;var _=8;r.set(i,8),r[_+=s]=1;var d=e.byteLength;r[_+1]=d>>>8,r[_+2]=255&d,r.set(e,_+3),_+=3+d,o&&(r[_]=252|t.chroma_format_idc,r[_+1]=248|t.bit_depth_luma-8,r[_+2]=248|t.bit_depth_chroma-8,r[_+3]=0,_+=4)}return n.prototype.getData=function(){return this.data},n})();(function(n){n[n.kNull=0]="kNull",n[n.kAACMain=1]="kAACMain",n[n.kAAC_LC=2]="kAAC_LC",n[n.kAAC_SSR=3]="kAAC_SSR",n[n.kAAC_LTP=4]="kAAC_LTP",n[n.kAAC_SBR=5]="kAAC_SBR",n[n.kAAC_Scalable=6]="kAAC_Scalable",n[n.kLayer1=32]="kLayer1",n[n.kLayer2=33]="kLayer2",n[n.kLayer3=34]="kLayer3"})(h||(h={})),(function(n){n[n.k96000Hz=0]="k96000Hz",n[n.k88200Hz=1]="k88200Hz",n[n.k64000Hz=2]="k64000Hz",n[n.k48000Hz=3]="k48000Hz",n[n.k44100Hz=4]="k44100Hz",n[n.k32000Hz=5]="k32000Hz",n[n.k24000Hz=6]="k24000Hz",n[n.k22050Hz=7]="k22050Hz",n[n.k16000Hz=8]="k16000Hz",n[n.k12000Hz=9]="k12000Hz",n[n.k11025Hz=10]="k11025Hz",n[n.k8000Hz=11]="k8000Hz",n[n.k7350Hz=12]="k7350Hz"})(R||(R={}));var N,q,J=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],se=(N=function(n,i){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},N(n,i)},function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function e(){this.constructor=n}N(n,i),n.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}),re=function(){},pe=(function(n){function i(){return n!==null&&n.apply(this,arguments)||this}return se(i,n),i})(re),Me=(function(){function n(i){this.TAG="AACADTSParser",this.data_=i,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&c.A.e(this.TAG,"Could not found ADTS syncword until payload end")}return n.prototype.findNextSyncwordOffset=function(i){for(var e=i,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if((t[e+0]<<8|t[e+1])>>>4==4095)return e;e++}},n.prototype.readNextAACFrame=function(){for(var i=this.data_,e=null;e==null&&!this.eof_flag_;){var t=this.current_syncword_offset_,a=(8&i[t+1])>>>3,o=(6&i[t+1])>>>1,r=1&i[t+1],s=(192&i[t+2])>>>6,_=(60&i[t+2])>>>2,d=(1&i[t+2])<<2|(192&i[t+3])>>>6,m=(3&i[t+3])<<11|i[t+4]<<3|(224&i[t+5])>>>5;if(i[t+6],t+m>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var f=r===1?7:9,y=m-f;t+=f;var S=this.findNextSyncwordOffset(t+y);if(this.current_syncword_offset_=S,(a===0||a===1)&&o===0){var D=i.subarray(t,t+y);(e=new re).audio_object_type=s+1,e.sampling_freq_index=_,e.sampling_frequency=J[_],e.channel_config=d,e.data=D}}return e},n.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},n.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},n})(),Oe=(function(){function n(i){this.TAG="AACLOASParser",this.data_=i,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&c.A.e(this.TAG,"Could not found LOAS syncword until payload end")}return n.prototype.findNextSyncwordOffset=function(i){for(var e=i,t=this.data_;;){if(e+1>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if((t[e+0]<<3|t[e+1]>>>5)==695)return e;e++}},n.prototype.getLATMValue=function(i){for(var e=i.readBits(2),t=0,a=0;a<=e;a++)t<<=8,t|=i.readByte();return t},n.prototype.readNextAACFrame=function(i){for(var e=this.data_,t=null;t==null&&!this.eof_flag_;){var a=this.current_syncword_offset_,o=(31&e[a+1])<<8|e[a+2];if(a+3+o>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var r=new I(e.subarray(a+3,a+3+o)),s=null;if(r.readBool()){if(i==null){c.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(a+3+o),r.destroy();continue}s=i}else{var _=r.readBool();if(_&&r.readBool()){c.A.e(this.TAG,"audioMuxVersionA is Not Supported"),r.destroy();break}if(_&&this.getLATMValue(r),!r.readBool()){c.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),r.destroy();break}if(r.readBits(6)!==0){c.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),r.destroy();break}if(r.readBits(4)!==0){c.A.e(this.TAG,"more than 2 numProgram Not Supported"),r.destroy();break}if(r.readBits(3)!==0){c.A.e(this.TAG,"more than 2 numLayer Not Supported"),r.destroy();break}var d=_?this.getLATMValue(r):0,m=r.readBits(5);d-=5;var f=r.readBits(4);d-=4;var y=r.readBits(4);d-=4,r.readBits(3),(d-=3)>0&&r.readBits(d);var S=r.readBits(3);if(S!==0){c.A.e(this.TAG,"frameLengthType = ".concat(S,". Only frameLengthType = 0 Supported")),r.destroy();break}r.readByte();var D=r.readBool();if(D)if(_)this.getLATMValue(r);else for(var x=0;;){x<<=8;var z=r.readBool();if(x+=r.readByte(),!z)break}r.readBool()&&r.readByte(),(s=new pe).audio_object_type=m,s.sampling_freq_index=f,s.sampling_frequency=J[s.sampling_freq_index],s.channel_config=y,s.other_data_present=D}for(var X=0;;){var U=r.readByte();if(X+=U,U!==255)break}for(var W=new Uint8Array(X),_e=0;_e<X;_e++)W[_e]=r.readByte();(t=new pe).audio_object_type=s.audio_object_type,t.sampling_freq_index=s.sampling_freq_index,t.sampling_frequency=J[s.sampling_freq_index],t.channel_config=s.channel_config,t.other_data_present=s.other_data_present,t.data=W,this.current_syncword_offset_=this.findNextSyncwordOffset(a+3+o)}return t},n.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},n.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},n})(),Ve=function(n){var i=null,e=n.audio_object_type,t=n.audio_object_type,a=n.sampling_freq_index,o=n.channel_config,r=0,s=navigator.userAgent.toLowerCase();s.indexOf("firefox")!==-1?a>=6?(t=5,i=new Array(4),r=a-3):(t=2,i=new Array(2),r=a):s.indexOf("android")!==-1?(t=2,i=new Array(2),r=a):(t=5,r=a,i=new Array(4),a>=6?r=a-3:o===1&&(t=2,i=new Array(2),r=a)),i[0]=t<<3,i[0]|=(15&a)>>>1,i[1]=(15&a)<<7,i[1]|=(15&o)<<3,t===5&&(i[1]|=(15&r)>>>1,i[2]=(1&r)<<7,i[2]|=8,i[3]=0),this.config=i,this.sampling_rate=J[a],this.channel_count=o,this.codec_mimetype="mp4a.40."+t,this.original_codec_mimetype="mp4a.40."+e},Ie=function(){},et=function(){};(function(n){n[n.kSpliceNull=0]="kSpliceNull",n[n.kSpliceSchedule=4]="kSpliceSchedule",n[n.kSpliceInsert=5]="kSpliceInsert",n[n.kTimeSignal=6]="kTimeSignal",n[n.kBandwidthReservation=7]="kBandwidthReservation",n[n.kPrivateCommand=255]="kPrivateCommand"})(q||(q={}));var Pe,Ke=function(n){var i=n.readBool();return i?(n.readBits(6),{time_specified_flag:i,pts_time:4*n.readBits(31)+n.readBits(2)}):(n.readBits(7),{time_specified_flag:i})},Je=function(n){var i=n.readBool();return n.readBits(6),{auto_return:i,duration:4*n.readBits(31)+n.readBits(2)}},St=function(n,i){var e=i.readBits(8);return n?{component_tag:e}:{component_tag:e,splice_time:Ke(i)}},bt=function(n){return{component_tag:n.readBits(8),utc_splice_time:n.readBits(32)}},Et=function(n){var i=n.readBits(32),e=n.readBool();n.readBits(7);var t={splice_event_id:i,splice_event_cancel_indicator:e};if(e)return t;if(t.out_of_network_indicator=n.readBool(),t.program_splice_flag=n.readBool(),t.duration_flag=n.readBool(),n.readBits(5),t.program_splice_flag)t.utc_splice_time=n.readBits(32);else{t.component_count=n.readBits(8),t.components=[];for(var a=0;a<t.component_count;a++)t.components.push(bt(n))}return t.duration_flag&&(t.break_duration=Je(n)),t.unique_program_id=n.readBits(16),t.avail_num=n.readBits(8),t.avails_expected=n.readBits(8),t},Rt=function(n,i,e,t){return{descriptor_tag:n,descriptor_length:i,identifier:e,provider_avail_id:t.readBits(32)}},Tt=function(n,i,e,t){var a=t.readBits(8),o=t.readBits(3);t.readBits(5);for(var r="",s=0;s<o;s++)r+=String.fromCharCode(t.readBits(8));return{descriptor_tag:n,descriptor_length:i,identifier:e,preroll:a,dtmf_count:o,DTMF_char:r}},kt=function(n){var i=n.readBits(8);return n.readBits(7),{component_tag:i,pts_offset:4*n.readBits(31)+n.readBits(2)}},Lt=function(n,i,e,t){var a=t.readBits(32),o=t.readBool();t.readBits(7);var r={descriptor_tag:n,descriptor_length:i,identifier:e,segmentation_event_id:a,segmentation_event_cancel_indicator:o};if(o)return r;if(r.program_segmentation_flag=t.readBool(),r.segmentation_duration_flag=t.readBool(),r.delivery_not_restricted_flag=t.readBool(),r.delivery_not_restricted_flag?t.readBits(5):(r.web_delivery_allowed_flag=t.readBool(),r.no_regional_blackout_flag=t.readBool(),r.archive_allowed_flag=t.readBool(),r.device_restrictions=t.readBits(2)),!r.program_segmentation_flag){r.component_count=t.readBits(8),r.components=[];for(var s=0;s<r.component_count;s++)r.components.push(kt(t))}r.segmentation_duration_flag&&(r.segmentation_duration=t.readBits(40)),r.segmentation_upid_type=t.readBits(8),r.segmentation_upid_length=t.readBits(8);var _=new Uint8Array(r.segmentation_upid_length);for(s=0;s<r.segmentation_upid_length;s++)_[s]=t.readBits(8);return r.segmentation_upid=_.buffer,r.segmentation_type_id=t.readBits(8),r.segment_num=t.readBits(8),r.segments_expected=t.readBits(8),r.segmentation_type_id!==52&&r.segmentation_type_id!==54&&r.segmentation_type_id!==56&&r.segmentation_type_id!==58||(r.sub_segment_num=t.readBits(8),r.sub_segments_expected=t.readBits(8)),r},wt=function(n,i,e,t){return{descriptor_tag:n,descriptor_length:i,identifier:e,TAI_seconds:t.readBits(48),TAI_ns:t.readBits(32),UTC_offset:t.readBits(16)}},Ct=function(n){return{component_tag:n.readBits(8),ISO_code:String.fromCharCode(n.readBits(8),n.readBits(8),n.readBits(8)),Bit_Stream_Mode:n.readBits(3),Num_Channels:n.readBits(4),Full_Srvc_Audio:n.readBool()}},Mt=function(n,i,e,t){for(var a=t.readBits(4),o=[],r=0;r<a;r++)o.push(Ct(t));return{descriptor_tag:n,descriptor_length:i,identifier:e,audio_count:a,components:o}};(function(n){n[n.kSliceIDR_W_RADL=19]="kSliceIDR_W_RADL",n[n.kSliceIDR_N_LP=20]="kSliceIDR_N_LP",n[n.kSliceCRA_NUT=21]="kSliceCRA_NUT",n[n.kSliceVPS=32]="kSliceVPS",n[n.kSliceSPS=33]="kSliceSPS",n[n.kSlicePPS=34]="kSlicePPS",n[n.kSliceAUD=35]="kSliceAUD",n[n.kSliceSEI=39]="kSliceSEI",n[n.kSliceSEISuffix=40]="kSliceSEISuffix"})(Pe||(Pe={}));var Bt=function(){},Dt=function(n){var i=n.data.byteLength;this.type=n.type,this.data=new Uint8Array(4+i),new DataView(this.data.buffer).setUint32(0,i),this.data.set(n.data,4)},Ot=(function(){function n(i){this.TAG="H265AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=i,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&c.A.e(this.TAG,"Could not find H265 startcode until payload end!")}return n.prototype.findNextStartCodeOffset=function(i){for(var e=i,t=this.data_;;){if(e+3>=t.byteLength)return this.eof_flag_=!0,t.byteLength;var a=t[e+0]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],o=t[e+0]<<16|t[e+1]<<8|t[e+2];if(a===1||o===1)return e;e++}},n.prototype.readNextNaluPayload=function(){for(var i=this.data_,e=null;e==null&&!this.eof_flag_;){var t=this.current_startcode_offset_,a=i[t+=(i[t]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3])==1?4:3]>>1&63,o=(128&i[t])>>>7,r=this.findNextStartCodeOffset(t);if(this.current_startcode_offset_=r,o===0){var s=i.subarray(t,r);(e=new Bt).type=a,e.data=s}}return e},n})(),It=(function(){function n(i,e,t,a){var o=23+(5+i.byteLength)+(5+e.byteLength)+(5+t.byteLength),r=this.data=new Uint8Array(o);r[0]=1,r[1]=(3&a.general_profile_space)<<6|(a.general_tier_flag?1:0)<<5|31&a.general_profile_idc,r[2]=a.general_profile_compatibility_flags_1,r[3]=a.general_profile_compatibility_flags_2,r[4]=a.general_profile_compatibility_flags_3,r[5]=a.general_profile_compatibility_flags_4,r[6]=a.general_constraint_indicator_flags_1,r[7]=a.general_constraint_indicator_flags_2,r[8]=a.general_constraint_indicator_flags_3,r[9]=a.general_constraint_indicator_flags_4,r[10]=a.general_constraint_indicator_flags_5,r[11]=a.general_constraint_indicator_flags_6,r[12]=a.general_level_idc,r[13]=240|(3840&a.min_spatial_segmentation_idc)>>8,r[14]=255&a.min_spatial_segmentation_idc,r[15]=252|3&a.parallelismType,r[16]=252|3&a.chroma_format_idc,r[17]=248|7&a.bit_depth_luma_minus8,r[18]=248|7&a.bit_depth_chroma_minus8,r[19]=0,r[20]=0,r[21]=(3&a.constant_frame_rate)<<6|(7&a.num_temporal_layers)<<3|(a.temporal_id_nested?1:0)<<2|3,r[22]=3,r[23]=128|Pe.kSliceVPS,r[24]=0,r[25]=1,r[26]=(65280&i.byteLength)>>8,r[27]=255&i.byteLength,r.set(i,28),r[23+(5+i.byteLength)+0]=128|Pe.kSliceSPS,r[23+(5+i.byteLength)+1]=0,r[23+(5+i.byteLength)+2]=1,r[23+(5+i.byteLength)+3]=(65280&e.byteLength)>>8,r[23+(5+i.byteLength)+4]=255&e.byteLength,r.set(e,23+(5+i.byteLength)+5),r[23+(5+i.byteLength+5+e.byteLength)+0]=128|Pe.kSlicePPS,r[23+(5+i.byteLength+5+e.byteLength)+1]=0,r[23+(5+i.byteLength+5+e.byteLength)+2]=1,r[23+(5+i.byteLength+5+e.byteLength)+3]=(65280&t.byteLength)>>8,r[23+(5+i.byteLength+5+e.byteLength)+4]=255&t.byteLength,r.set(t,23+(5+i.byteLength+5+e.byteLength)+5)}return n.prototype.getData=function(){return this.data},n})(),Pt=function(){},xt=function(){},Ut=function(){},Nt=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],Vt=(function(){function n(i){this.TAG="AC3Parser",this.data_=i,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&c.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return n.prototype.findNextSyncwordOffset=function(i){for(var e=i,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if((t[e+0]<<8|t[e+1])==2935)return e;e++}},n.prototype.readNextAC3Frame=function(){for(var i=this.data_,e=null;e==null&&!this.eof_flag_;){var t=this.current_syncword_offset_,a=i[t+4]>>6,o=[48e3,44200,33e3][a],r=63&i[t+4],s=2*Nt[a][r];if(isNaN(s)||t+s>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var _=this.findNextSyncwordOffset(t+s);this.current_syncword_offset_=_;var d=i[t+5]>>3,m=7&i[t+5],f=i[t+6]>>5,y=0;1&f&&f!==1&&(y+=2),4&f&&(y+=2),f===2&&(y+=2);var S=(i[t+6]<<8|i[t+7])>>12-y&1,D=[2,1,2,3,3,4,4,5][f]+S;(e=new Ut).sampling_frequency=o,e.channel_count=D,e.channel_mode=f,e.bit_stream_identification=d,e.low_frequency_effects_channel_on=S,e.bit_stream_mode=m,e.frame_size_code=r,e.data=i.subarray(t,t+s)}return e},n.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},n.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},n})(),Gt=function(n){var i=[n.sampling_rate_code<<6|n.bit_stream_identification<<1|n.bit_stream_mode>>2,(3&n.bit_stream_mode)<<6|n.channel_mode<<3|n.low_frequency_effects_channel_on<<2|n.frame_size_code>>4,n.frame_size_code<<4&224];this.config=i,this.sampling_rate=n.sampling_frequency,this.bit_stream_identification=n.bit_stream_identification,this.bit_stream_mode=n.bit_stream_mode,this.low_frequency_effects_channel_on=n.low_frequency_effects_channel_on,this.channel_count=n.channel_count,this.channel_mode=n.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},Ft=function(){},jt=(function(){function n(i){this.TAG="EAC3Parser",this.data_=i,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&c.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return n.prototype.findNextSyncwordOffset=function(i){for(var e=i,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if((t[e+0]<<8|t[e+1])==2935)return e;e++}},n.prototype.readNextEAC3Frame=function(){for(var i=this.data_,e=null;e==null&&!this.eof_flag_;){var t=this.current_syncword_offset_,a=new I(i.subarray(t+2)),o=(a.readBits(2),a.readBits(3),a.readBits(11)+1<<1),r=a.readBits(2),s=null,_=null;r===3?(s=[24e3,22060,16e3][r=a.readBits(2)],_=3):(s=[48e3,44100,32e3][r],_=a.readBits(2));var d=a.readBits(3),m=a.readBits(1),f=a.readBits(5);if(t+o>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var y=this.findNextSyncwordOffset(t+o);this.current_syncword_offset_=y;var S=[2,1,2,3,3,4,4,5][d]+m;a.destroy(),(e=new Ft).sampling_frequency=s,e.channel_count=S,e.channel_mode=d,e.bit_stream_identification=f,e.low_frequency_effects_channel_on=m,e.frame_size=o,e.num_blks=[1,2,3,6][_],e.data=i.subarray(t,t+o)}return e},n.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},n.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},n})(),zt=function(n){var i,e=Math.floor(n.frame_size*n.sampling_frequency/(16*n.num_blks));i=[255&e,248&e,n.sampling_rate_code<<6|n.bit_stream_identification<<1,n.channel_mode<<1|n.low_frequency_effects_channel_on,0],this.config=i,this.sampling_rate=n.sampling_frequency,this.bit_stream_identification=n.bit_stream_identification,this.num_blks=n.num_blks,this.low_frequency_effects_channel_on=n.low_frequency_effects_channel_on,this.channel_count=n.channel_count,this.channel_mode=n.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},qt=function(){},Ht=(function(){function n(i){this.TAG="AV1OBUInMpegTsParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=i,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&c.A.e(this.TAG,"Could not find AV1 startcode until payload end!")}return n._ebsp2rbsp=function(i){for(var e=i,t=e.byteLength,a=new Uint8Array(t),o=0,r=0;r<t;r++)r>=2&&e[r]===3&&e[r-1]===0&&e[r-2]===0||(a[o]=e[r],o++);return new Uint8Array(a.buffer,0,o)},n.prototype.findNextStartCodeOffset=function(i){for(var e=i,t=this.data_;;){if(e+2>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if((t[e+0]<<16|t[e+1]<<8|t[e+2])==1)return e;e++}},n.prototype.readNextOBUPayload=function(){for(var i=this.data_,e=null;e==null&&!this.eof_flag_;){var t=this.current_startcode_offset_+3,a=this.findNextStartCodeOffset(t);this.current_startcode_offset_=a,e=n._ebsp2rbsp(i.subarray(t,a))}return e},n})(),Kt=function(){},Wt=(function(){var n=function(i,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o])},n(i,e)};return function(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=i}n(i,e),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}})(),Fe=function(){return Fe=Object.assign||function(n){for(var i,e=1,t=arguments.length;e<t;e++)for(var a in i=arguments[e])Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a]);return n},Fe.apply(this,arguments)},st=(function(n){function i(e,t){var a=n.call(this)||this;return a.TAG="TSDemuxer",a.first_parse_=!0,a.media_info_=new b.A,a.timescale_=90,a.duration_=0,a.current_pmt_pid_=-1,a.program_pmt_map_={},a.pes_slice_queues_={},a.section_slice_queues_={},a.video_metadata_={vps:void 0,sps:void 0,pps:void 0,av1c:void 0,details:void 0},a.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},a.last_pcr_base_=NaN,a.timestamp_offset_=0,a.audio_last_sample_pts_=void 0,a.aac_last_incomplete_data_=null,a.has_video_=!1,a.has_audio_=!1,a.video_init_segment_dispatched_=!1,a.audio_init_segment_dispatched_=!1,a.video_metadata_changed_=!1,a.audio_metadata_changed_=!1,a.loas_previous_frame=null,a.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},a.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},a.ts_packet_size_=e.ts_packet_size,a.sync_offset_=e.sync_offset,a.config_=t,a}return Wt(i,n),i.prototype.destroy=function(){this.media_info_=null,this.pes_slice_queues_=null,this.section_slice_queues_=null,this.video_metadata_=null,this.audio_metadata_=null,this.aac_last_incomplete_data_=null,this.video_track_=null,this.audio_track_=null,n.prototype.destroy.call(this)},i.probe=function(e){var t=new Uint8Array(e),a=-1,o=188;if(t.byteLength<=3*o)return{needMoreData:!0};for(;a===-1;){for(var r=Math.min(1e3,t.byteLength-3*o),s=0;s<r;){if(t[s]===71&&t[s+o]===71&&t[s+2*o]===71){a=s;break}s++}if(a===-1)if(o===188)o=192;else{if(o!==192)break;o=204}}return a===-1?{match:!1}:(o===192&&a>=4?(c.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),a-=4):o===204&&c.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:o,sync_offset:a})},i.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},i.prototype.resetMediaInfo=function(){this.media_info_=new b.A},i.prototype.parseChunks=function(e,t){if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new O.j4("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var a=0;for(this.first_parse_&&(this.first_parse_=!1,a=this.sync_offset_);a+this.ts_packet_size_<=e.byteLength;){var o=t+a;this.ts_packet_size_===192&&(a+=4);var r=new Uint8Array(e,a,188),s=r[0];if(s!==71){c.A.e(this.TAG,"sync_byte = ".concat(s,", not 0x47"));break}var _=(64&r[1])>>>6,d=(r[1],(31&r[1])<<8|r[2]),m=(48&r[3])>>>4,f=15&r[3],y=!(!this.pmt_||this.pmt_.pcr_pid!==d),S={},D=4;if(m==2||m==3){var x=r[4];if(x>0&&(y||m==3)&&(S.discontinuity_indicator=(128&r[5])>>>7,S.random_access_indicator=(64&r[5])>>>6,S.elementary_stream_priority_indicator=(32&r[5])>>>5,(16&r[5])>>>4)){var z=300*this.getPcrBase(r)+((1&r[10])<<8|r[11]);this.last_pcr_=z}if(m==2||5+x===188){a+=188,this.ts_packet_size_===204&&(a+=16);continue}D=5+x}if(m==1||m==3){if(d===0||d===this.current_pmt_pid_||this.pmt_!=null&&this.pmt_.pid_stream_type[d]===j.kSCTE35){var X=188-D;this.handleSectionSlice(e,a+D,X,{pid:d,file_position:o,payload_unit_start_indicator:_,continuity_conunter:f,random_access_indicator:S.random_access_indicator})}else if(this.pmt_!=null&&this.pmt_.pid_stream_type[d]!=null){X=188-D;var U=this.pmt_.pid_stream_type[d];d!==this.pmt_.common_pids.h264&&d!==this.pmt_.common_pids.h265&&d!==this.pmt_.common_pids.av1&&d!==this.pmt_.common_pids.adts_aac&&d!==this.pmt_.common_pids.loas_aac&&d!==this.pmt_.common_pids.ac3&&d!==this.pmt_.common_pids.eac3&&d!==this.pmt_.common_pids.opus&&d!==this.pmt_.common_pids.mp3&&this.pmt_.pes_private_data_pids[d]!==!0&&this.pmt_.timed_id3_pids[d]!==!0&&this.pmt_.pgs_pids[d]!==!0&&this.pmt_.synchronous_klv_pids[d]!==!0&&this.pmt_.asynchronous_klv_pids[d]!==!0||this.handlePESSlice(e,a+D,X,{pid:d,stream_type:U,file_position:o,payload_unit_start_indicator:_,continuity_conunter:f,random_access_indicator:S.random_access_indicator})}}a+=188,this.ts_packet_size_===204&&(a+=16)}return this.dispatchAudioVideoMediaSegment(),a},i.prototype.handleSectionSlice=function(e,t,a,o){var r=new Uint8Array(e,t,a),s=this.section_slice_queues_[o.pid];if(o.payload_unit_start_indicator){var _=r[0];if(s!=null&&s.total_length!==0){var d=new Uint8Array(e,t+1,Math.min(a,_));s.slices.push(d),s.total_length+=d.byteLength,s.total_length===s.expected_length?this.emitSectionSlices(s,o):this.clearSlices(s,o)}for(var m=1+_;m<r.byteLength&&r[m+0]!==255;){var f=(15&r[m+1])<<8|r[m+2];this.section_slice_queues_[o.pid]=new k,(s=this.section_slice_queues_[o.pid]).expected_length=f+3,s.file_position=o.file_position,s.random_access_indicator=o.random_access_indicator,d=new Uint8Array(e,t+m,Math.min(a-m,s.expected_length-s.total_length)),s.slices.push(d),s.total_length+=d.byteLength,s.total_length===s.expected_length?this.emitSectionSlices(s,o):s.total_length>=s.expected_length&&this.clearSlices(s,o),m+=d.byteLength}}else s!=null&&s.total_length!==0&&(d=new Uint8Array(e,t,Math.min(a,s.expected_length-s.total_length)),s.slices.push(d),s.total_length+=d.byteLength,s.total_length===s.expected_length?this.emitSectionSlices(s,o):s.total_length>=s.expected_length&&this.clearSlices(s,o))},i.prototype.handlePESSlice=function(e,t,a,o){var r=new Uint8Array(e,t,a),s=r[0]<<16|r[1]<<8|r[2],_=(r[3],r[4]<<8|r[5]);if(o.payload_unit_start_indicator){if(s!==1)return void c.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(s));var d=this.pes_slice_queues_[o.pid];d&&(d.expected_length===0||d.expected_length===d.total_length?this.emitPESSlices(d,o):this.clearSlices(d,o)),this.pes_slice_queues_[o.pid]=new k,this.pes_slice_queues_[o.pid].file_position=o.file_position,this.pes_slice_queues_[o.pid].random_access_indicator=o.random_access_indicator}if(this.pes_slice_queues_[o.pid]!=null){var m=this.pes_slice_queues_[o.pid];m.slices.push(r),o.payload_unit_start_indicator&&(m.expected_length=_===0?0:_+6),m.total_length+=r.byteLength,m.expected_length>0&&m.expected_length===m.total_length?this.emitPESSlices(m,o):m.expected_length>0&&m.expected_length<m.total_length&&this.clearSlices(m,o)}},i.prototype.emitSectionSlices=function(e,t){for(var a=new Uint8Array(e.total_length),o=0,r=0;o<e.slices.length;o++){var s=e.slices[o];a.set(s,r),r+=s.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var _=new ke;_.pid=t.pid,_.data=a,_.file_position=e.file_position,_.random_access_indicator=e.random_access_indicator,this.parseSection(_)},i.prototype.emitPESSlices=function(e,t){for(var a=new Uint8Array(e.total_length),o=0,r=0;o<e.slices.length;o++){var s=e.slices[o];a.set(s,r),r+=s.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var _=new Re;_.pid=t.pid,_.data=a,_.stream_type=t.stream_type,_.file_position=e.file_position,_.random_access_indicator=e.random_access_indicator,this.parsePES(_)},i.prototype.clearSlices=function(e,t){e.slices=[],e.expected_length=-1,e.total_length=0},i.prototype.parseSection=function(e){var t=e.data,a=e.pid;a===0?this.parsePAT(t):a===this.current_pmt_pid_?this.parsePMT(t):this.pmt_!=null&&this.pmt_.scte_35_pids[a]&&this.parseSCTE35(t)},i.prototype.parsePES=function(e){var t=e.data,a=t[0]<<16|t[1]<<8|t[2],o=t[3],r=t[4]<<8|t[5];if(a===1)if(o!==188&&o!==190&&o!==191&&o!==240&&o!==241&&o!==255&&o!==242&&o!==248){t[6];var s=(192&t[7])>>>6,_=t[8],d=void 0,m=void 0;s!==2&&s!==3||(d=this.getTimestamp(t,9),m=s===3?this.getTimestamp(t,14):d);var f=9+_,y=void 0;if(r!==0){if(r<3+_)return void c.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");y=r-3-_}else y=t.byteLength-f;var S=t.subarray(f,f+y);switch(e.stream_type){case j.kMPEG1Audio:case j.kMPEG2Audio:this.parseMP3Payload(S,d);break;case j.kPESPrivateData:this.pmt_.common_pids.av1===e.pid?this.parseAV1Payload(S,d,m,e.file_position,e.random_access_indicator):this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(S,d):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(S,d):this.pmt_.common_pids.eac3===e.pid?this.parseEAC3Payload(S,d):this.pmt_.asynchronous_klv_pids[e.pid]?this.parseAsynchronousKLVMetadataPayload(S,e.pid,o):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(S,d,m,e.pid,o):this.parsePESPrivateDataPayload(S,d,m,e.pid,o);break;case j.kADTSAAC:this.parseADTSAACPayload(S,d);break;case j.kLOASAAC:this.parseLOASAACPayload(S,d);break;case j.kAC3:this.parseAC3Payload(S,d);break;case j.kEAC3:this.parseEAC3Payload(S,d);break;case j.kMetadata:this.pmt_.timed_id3_pids[e.pid]?this.parseTimedID3MetadataPayload(S,d,m,e.pid,o):this.pmt_.synchronous_klv_pids[e.pid]&&this.parseSynchronousKLVMetadataPayload(S,d,m,e.pid,o);break;case j.kPGS:this.parsePGSPayload(S,d,m,e.pid,o,this.pmt_.pgs_langs[e.pid]);break;case j.kH264:this.parseH264Payload(S,d,m,e.file_position,e.random_access_indicator);break;case j.kH265:this.parseH265Payload(S,d,m,e.file_position,e.random_access_indicator)}}else o!==188&&o!==191&&o!==240&&o!==241&&o!==255&&o!==242&&o!==248||e.stream_type!==j.kPESPrivateData||(f=6,y=void 0,y=r!==0?r:t.byteLength-f,S=t.subarray(f,f+y),this.parsePESPrivateDataPayload(S,void 0,void 0,e.pid,o));else c.A.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(a))},i.prototype.parsePAT=function(e){var t=e[0];if(t===0){var a=(15&e[1])<<8|e[2],o=(e[3],e[4],(62&e[5])>>>1),r=1&e[5],s=e[6],_=(e[7],null);if(r===1&&s===0)(_=new ce).version_number=o;else if((_=this.pat_)==null)return;for(var d=a-5-4,m=-1,f=-1,y=8;y<8+d;y+=4){var S=e[y]<<8|e[y+1],D=(31&e[y+2])<<8|e[y+3];S===0?_.network_pid=D:(_.program_pmt_pid[S]=D,m===-1&&(m=S),f===-1&&(f=D))}r===1&&s===0&&(this.pat_??c.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(_))),this.pat_=_,this.current_program_=m,this.current_pmt_pid_=f)}else c.A.e(this.TAG,"parsePAT: table_id ".concat(t," is not corresponded to PAT!"))},i.prototype.parsePMT=function(e){var t=e[0];if(t===2){var a=(15&e[1])<<8|e[2],o=e[3]<<8|e[4],r=(62&e[5])>>>1,s=1&e[5],_=e[6],d=(e[7],null);if(s===1&&_===0)(d=new Te).program_number=o,d.version_number=r,this.program_pmt_map_[o]=d;else if((d=this.program_pmt_map_[o])==null)return;d.pcr_pid=(31&e[8])<<8|e[9];for(var m=(15&e[10])<<8|e[11],f=12+m,y=a-9-m-4,S=f;S<f+y;){var D=e[S],x=(31&e[S+1])<<8|e[S+2],z=(15&e[S+3])<<8|e[S+4];d.pid_stream_type[x]=D;var X=d.common_pids.h264||d.common_pids.h265,U=d.common_pids.adts_aac||d.common_pids.loas_aac||d.common_pids.ac3||d.common_pids.eac3||d.common_pids.opus||d.common_pids.mp3;if(D!==j.kH264||X)if(D!==j.kH265||X)if(D!==j.kADTSAAC||U)if(D!==j.kLOASAAC||U)if(D!==j.kAC3||U)if(D!==j.kEAC3||U)if(D!==j.kMPEG1Audio&&D!==j.kMPEG2Audio||U){if(D===j.kPESPrivateData){if(d.pes_private_data_pids[x]=!0,z>0){for(var W=S+5;W<S+5+z;){var _e=e[W+0],$=e[W+1];if(_e===5){var Q=String.fromCharCode.apply(String,Array.from(e.subarray(W+2,W+2+$)));Q==="VANC"?d.smpte2038_pids[x]=!0:Q==="AV01"?d.common_pids.av1=x:Q==="Opus"?d.common_pids.opus=x:Q==="KLVA"&&(d.asynchronous_klv_pids[x]=!0)}else if(_e===127){if(x===d.common_pids.opus){var me=null;if(e[W+2]===128&&(me=e[W+3]),me==null){c.A.e(this.TAG,"Not Supported Opus channel count.");continue}var ee={codec:"opus",channel_count:15&me?15&me:2,channel_config_code:me,sample_rate:48e3},fe={codec:"opus",meta:ee};this.audio_init_segment_dispatched_==0?(this.audio_metadata_=ee,this.dispatchAudioInitSegment(fe)):this.detectAudioMetadataChange(fe)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(fe))}}else _e===128&&x===d.common_pids.av1&&(this.video_metadata_.av1c=e.subarray(W+2,W+2+$));W+=2+$}var ve=e.subarray(S+5,S+5+z);this.dispatchPESPrivateDataDescriptor(x,D,ve)}}else if(D===j.kMetadata){if(z>0)for(W=S+5;W<S+5+z;){_e=e[W+0];var ye=e[W+1];if(_e===38){var Ee=e[W+2]<<8|e[W+3],we=null;Ee===65535&&(we=String.fromCharCode.apply(String,Array.from(e.subarray(W+4,W+4+4))));var oe=null;if(e[W+4+(Ee===65535?4:0)]===255){var le=4+(Ee===65535?4:0)+1;oe=String.fromCharCode.apply(String,Array.from(e.subarray(W+le,W+le+4)))}we==="ID3 "&&oe==="ID3 "?d.timed_id3_pids[x]=!0:oe==="KLVA"&&(d.synchronous_klv_pids[x]=!0)}W+=2+ye}}else if(D===j.kSCTE35)d.scte_35_pids[x]=!0;else if(D===j.kPGS){if(d.pgs_langs[x]="und",z>0)for(W=S+5;W<S+5+z;){_e=e[W+0];var be=e[W+1];if(_e===10){var ue=String.fromCharCode.apply(String,Array.from(e.slice(W+2,W+5)));d.pgs_langs[x]=ue}W+=2+be}d.pgs_pids[x]=!0}}else d.common_pids.mp3=x;else d.common_pids.eac3=x;else d.common_pids.ac3=x;else d.common_pids.loas_aac=x;else d.common_pids.adts_aac=x;else d.common_pids.h265=x;else d.common_pids.h264=x;S+=5+z}o===this.current_program_&&(this.pmt_??c.A.v(this.TAG,"Parsed first PMT: ".concat(JSON.stringify(d))),this.pmt_=d,(d.common_pids.h264||d.common_pids.h265||d.common_pids.av1)&&(this.has_video_=!0),(d.common_pids.adts_aac||d.common_pids.loas_aac||d.common_pids.ac3||d.common_pids.opus||d.common_pids.mp3)&&(this.has_audio_=!0))}else c.A.e(this.TAG,"parsePMT: table_id ".concat(t," is not corresponded to PMT!"))},i.prototype.parseSCTE35=function(e){var t=(function(a){var o=new I(a),r=o.readBits(8),s=o.readBool(),_=o.readBool();o.readBits(2);var d=o.readBits(12),m=o.readBits(8),f=o.readBool(),y=o.readBits(6),S=4*o.readBits(31)+o.readBits(2),D=o.readBits(8),x=o.readBits(12),z=o.readBits(12),X=o.readBits(8),U=null;X===q.kSpliceNull?U={}:X===q.kSpliceSchedule?U=(function(oe){for(var le=oe.readBits(8),be=[],ue=0;ue<le;ue++)be.push(Et(oe));return{splice_count:le,events:be}})(o):X===q.kSpliceInsert?U=(function(oe){var le=oe.readBits(32),be=oe.readBool();oe.readBits(7);var ue={splice_event_id:le,splice_event_cancel_indicator:be};if(be)return ue;if(ue.out_of_network_indicator=oe.readBool(),ue.program_splice_flag=oe.readBool(),ue.duration_flag=oe.readBool(),ue.splice_immediate_flag=oe.readBool(),oe.readBits(4),ue.program_splice_flag&&!ue.splice_immediate_flag&&(ue.splice_time=Ke(oe)),!ue.program_splice_flag){ue.component_count=oe.readBits(8),ue.components=[];for(var Ce=0;Ce<ue.component_count;Ce++)ue.components.push(St(ue.splice_immediate_flag,oe))}return ue.duration_flag&&(ue.break_duration=Je(oe)),ue.unique_program_id=oe.readBits(16),ue.avail_num=oe.readBits(8),ue.avails_expected=oe.readBits(8),ue})(o):X===q.kTimeSignal?U=(function(oe){return{splice_time:Ke(oe)}})(o):X===q.kBandwidthReservation?U={}:X===q.kPrivateCommand?U=(function(oe,le){for(var be=String.fromCharCode(le.readBits(8),le.readBits(8),le.readBits(8),le.readBits(8)),ue=new Uint8Array(oe-4),Ce=0;Ce<oe-4;Ce++)ue[Ce]=le.readBits(8);return{identifier:be,private_data:ue.buffer}})(z,o):o.readBits(8*z);for(var W=[],_e=o.readBits(16),$=0;$<_e;){var Q=o.readBits(8),me=o.readBits(8),ee=String.fromCharCode(o.readBits(8),o.readBits(8),o.readBits(8),o.readBits(8));Q===0?W.push(Rt(Q,me,ee,o)):Q===1?W.push(Tt(Q,me,ee,o)):Q===2?W.push(Lt(Q,me,ee,o)):Q===3?W.push(wt(Q,me,ee,o)):Q===4?W.push(Mt(Q,me,ee,o)):o.readBits(8*(me-4)),$+=2+me}var fe={table_id:r,section_syntax_indicator:s,private_indicator:_,section_length:d,protocol_version:m,encrypted_packet:f,encryption_algorithm:y,pts_adjustment:S,cw_index:D,tier:x,splice_command_length:z,splice_command_type:X,splice_command:U,descriptor_loop_length:_e,splice_descriptors:W,E_CRC32:f?o.readBits(32):void 0,CRC32:o.readBits(32)};if(X===q.kSpliceInsert){var ve=U;if(ve.splice_event_cancel_indicator)return{splice_command_type:X,detail:fe,data:a};if(ve.program_splice_flag&&!ve.splice_immediate_flag){var ye=ve.duration_flag?ve.break_duration.auto_return:void 0,Ee=ve.duration_flag?ve.break_duration.duration/90:void 0;return ve.splice_time.time_specified_flag?{splice_command_type:X,pts:(S+ve.splice_time.pts_time)%Math.pow(2,33),auto_return:ye,duraiton:Ee,detail:fe,data:a}:{splice_command_type:X,auto_return:ye,duraiton:Ee,detail:fe,data:a}}return{splice_command_type:X,auto_return:ye=ve.duration_flag?ve.break_duration.auto_return:void 0,duraiton:Ee=ve.duration_flag?ve.break_duration.duration/90:void 0,detail:fe,data:a}}if(X===q.kTimeSignal){var we=U;return we.splice_time.time_specified_flag?{splice_command_type:X,pts:(S+we.splice_time.pts_time)%Math.pow(2,33),detail:fe,data:a}:{splice_command_type:X,detail:fe,data:a}}return{splice_command_type:X,detail:fe,data:a}})(e);t.pts!=null?t.pts=Math.floor(t.pts/this.timescale_):t.nearest_pts=this.getNearestTimestampMilliseconds(),this.onSCTE35Metadata&&this.onSCTE35Metadata(t)},i.prototype.parseAV1Payload=function(e,t,a,o,r){for(var s=new Ht(e),_=null,d=[],m=0,f=!1,y=null;(_=s.readNextOBUPayload())!=null;){if((y=p.parseOBUs(_,this.video_metadata_.details))&&y.keyframe===!0)if(this.video_init_segment_dispatched_){if(this.detectVideoMetadataChange(null,y)===!0){var S;this.video_metadata_changed_=!0,this.dispatchVideoMediaSegment(),(S=new Uint8Array(new ArrayBuffer(this.video_metadata_.av1c.byteLength+y.sequence_header_data.byteLength))).set(this.video_metadata_.av1c,0),S.set(y.sequence_header_data,this.video_metadata_.av1c.byteLength),y.av1c=S,this.dispatchVideoInitSegment()}}else(S=new Uint8Array(new ArrayBuffer(this.video_metadata_.av1c.byteLength+y.sequence_header_data.byteLength))).set(this.video_metadata_.av1c,0),S.set(y.sequence_header_data,this.video_metadata_.av1c.byteLength),y.av1c=S,this.video_metadata_.details=y,this.dispatchVideoInitSegment();this.video_metadata_.details=y,f||(f=y.keyframe),d.push({data:_}),m+=_.byteLength}var D=Math.floor(t/this.timescale_),x=Math.floor(a/this.timescale_);if(d.length){var z=this.video_track_,X={units:d,length:m,isKeyframe:f,dts:x,pts:D,cts:D-x,file_position:o};z.samples.push(X),z.length+=m}},i.prototype.parseH264Payload=function(e,t,a,o,r){for(var s=new de(e),_=null,d=[],m=0,f=!1;(_=s.readNextNaluPayload())!=null;){var y=new ae(_);if(y.type===Se.kSliceSPS){var S=F.parseSPS(_.data);this.video_init_segment_dispatched_?this.detectVideoMetadataChange(y,S)===!0&&(c.A.v(this.TAG,"H264: Critical h264 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:y,pps:void 0,av1c:void 0,details:S}):(this.video_metadata_.sps=y,this.video_metadata_.details=S)}else y.type===Se.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(this.video_metadata_.pps=y,this.video_metadata_.sps&&this.video_metadata_.pps&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):y.type===Se.kSliceIDR||y.type===Se.kSliceNonIDR&&r===1?f=!0:y.type===Se.kSliceSEI&&this.parseSEIPayload(_.data,t,"h264");this.video_init_segment_dispatched_&&(d.push(y),m+=y.data.byteLength)}var D=Math.floor(t/this.timescale_),x=Math.floor(a/this.timescale_);if(d.length){var z=this.video_track_,X={units:d,length:m,isKeyframe:f,dts:x,pts:D,cts:D-x,file_position:o};z.samples.push(X),z.length+=m}},i.prototype.parseH265Payload=function(e,t,a,o,r){for(var s=new Ot(e),_=null,d=[],m=0,f=!1;(_=s.readNextNaluPayload())!=null;){var y=new Dt(_);if(y.type===Pe.kSliceVPS){if(!this.video_init_segment_dispatched_){var S=K.parseVPS(_.data);this.video_metadata_.vps=y,this.video_metadata_.details=Fe(Fe({},this.video_metadata_.details),S)}}else y.type===Pe.kSliceSPS?(S=K.parseSPS(_.data),this.video_init_segment_dispatched_?this.detectVideoMetadataChange(y,S)===!0&&(c.A.v(this.TAG,"H265: Critical h265 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:y,pps:void 0,av1c:void 0,details:S}):(this.video_metadata_.sps=y,this.video_metadata_.details=Fe(Fe({},this.video_metadata_.details),S))):y.type===Pe.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(S=K.parsePPS(_.data),this.video_metadata_.pps=y,this.video_metadata_.details=Fe(Fe({},this.video_metadata_.details),S),this.video_metadata_.vps&&this.video_metadata_.sps&&this.video_metadata_.pps&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):y.type===Pe.kSliceIDR_W_RADL||y.type===Pe.kSliceIDR_N_LP||y.type===Pe.kSliceCRA_NUT?f=!0:y.type!==Pe.kSliceSEI&&y.type!==Pe.kSliceSEISuffix||this.parseSEIPayload(_.data,t,"h265");this.video_init_segment_dispatched_&&(d.push(y),m+=y.data.byteLength)}var D=Math.floor(t/this.timescale_),x=Math.floor(a/this.timescale_);if(d.length){var z=this.video_track_,X={units:d,length:m,isKeyframe:f,dts:x,pts:D,cts:D-x,file_position:o};z.samples.push(X),z.length+=m}},i.prototype.detectVideoMetadataChange=function(e,t){if(t.codec_mimetype!==this.video_metadata_.details.codec_mimetype)return c.A.v(this.TAG,"Video: Codec mimeType changed from "+"".concat(this.video_metadata_.details.codec_mimetype," to ").concat(t.codec_mimetype)),!0;if(t.codec_size.width!==this.video_metadata_.details.codec_size.width||t.codec_size.height!==this.video_metadata_.details.codec_size.height){var a=this.video_metadata_.details.codec_size,o=t.codec_size;return c.A.v(this.TAG,"Video: Coded Resolution changed from "+"".concat(a.width,"x").concat(a.height," to ").concat(o.width,"x").concat(o.height)),!0}return t.present_size.width!==this.video_metadata_.details.present_size.width&&(c.A.v(this.TAG,"Video: Present resolution width changed from "+"".concat(this.video_metadata_.details.present_size.width," to ").concat(t.present_size.width)),!0)},i.prototype.isInitSegmentDispatched=function(){return this.has_video_&&this.has_audio_?this.video_init_segment_dispatched_&&this.audio_init_segment_dispatched_:this.has_video_&&!this.has_audio_?this.video_init_segment_dispatched_:!(this.has_video_||!this.has_audio_)&&this.audio_init_segment_dispatched_},i.prototype.dispatchVideoInitSegment=function(){var e=this.video_metadata_.details,t={type:"video"};if(t.id=this.video_track_.id,t.timescale=1e3,t.duration=this.duration_,t.codecWidth=e.codec_size.width,t.codecHeight=e.codec_size.height,t.presentWidth=e.present_size.width,t.presentHeight=e.present_size.height,t.profile=e.profile_string,t.level=e.level_string,t.bitDepth=e.bit_depth,t.chromaFormat=e.chroma_format,t.sarRatio=e.sar_ratio,t.frameRate=e.frame_rate,t.refSampleDuration=t.frameRate.fps_den/t.frameRate.fps_num*1e3,t.codec=e.codec_mimetype,this.video_metadata_.av1c)t.av1c=this.video_metadata_.av1c,this.video_init_segment_dispatched_==0&&c.A.v(this.TAG,"Generated first AV1 for mimeType: ".concat(t.codec));else if(this.video_metadata_.vps){var a=this.video_metadata_.vps.data.subarray(4),o=this.video_metadata_.sps.data.subarray(4),r=this.video_metadata_.pps.data.subarray(4);t.hvcc=new It(a,o,r,e).getData(),this.video_init_segment_dispatched_==0&&c.A.v(this.TAG,"Generated first HEVCDecoderConfigurationRecord for mimeType: ".concat(t.codec))}else o=this.video_metadata_.sps.data.subarray(4),r=this.video_metadata_.pps.data.subarray(4),t.avcc=new ge(o,r,e).getData(),this.video_init_segment_dispatched_==0&&c.A.v(this.TAG,"Generated first AVCDecoderConfigurationRecord for mimeType: ".concat(t.codec));this.onTrackMetadata("video",t),this.video_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var s=this.media_info_;s.hasVideo=!0,s.width=t.codecWidth,s.height=t.codecHeight,s.fps=t.frameRate.fps,s.profile=t.profile,s.level=t.level,s.refFrames=e.ref_frames,s.chromaFormat=e.chroma_format_string,s.sarNum=t.sarRatio.width,s.sarDen=t.sarRatio.height,s.videoCodec=t.codec,s.hasAudio&&s.audioCodec?s.mimeType='video/mp2t; codecs="'.concat(s.videoCodec,",").concat(s.audioCodec,'"'):s.mimeType='video/mp2t; codecs="'.concat(s.videoCodec,'"'),s.isComplete()&&this.onMediaInfo(s)},i.prototype.dispatchVideoMediaSegment=function(){this.isInitSegmentDispatched()&&this.video_track_.length&&this.onDataAvailable(null,this.video_track_)},i.prototype.dispatchAudioMediaSegment=function(){this.isInitSegmentDispatched()&&this.audio_track_.length&&this.onDataAvailable(this.audio_track_,null)},i.prototype.dispatchAudioVideoMediaSegment=function(){this.isInitSegmentDispatched()&&(this.audio_track_.length||this.video_track_.length)&&this.onDataAvailable(this.audio_track_,this.video_track_)},i.prototype.parseADTSAACPayload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var a=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);a.set(this.aac_last_incomplete_data_,0),a.set(e,this.aac_last_incomplete_data_.byteLength),e=a}var o,r;if(t!=null&&(r=t/this.timescale_),this.audio_metadata_.codec==="aac"){if(t==null&&this.audio_last_sample_pts_!=null)o=1024/this.audio_metadata_.sampling_frequency*1e3,r=this.audio_last_sample_pts_+o;else if(t==null)return void c.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.audio_last_sample_pts_){o=1024/this.audio_metadata_.sampling_frequency*1e3;var s=this.audio_last_sample_pts_+o;Math.abs(s-r)>1&&(c.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(s,"ms, PES pts: ").concat(r,"ms")),r=s)}}for(var _,d=new Me(e),m=null,f=r;(m=d.readNextAACFrame())!=null;){o=1024/m.sampling_frequency*1e3;var y={codec:"aac",data:m};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"aac",audio_object_type:m.audio_object_type,sampling_freq_index:m.sampling_freq_index,sampling_frequency:m.sampling_frequency,channel_config:m.channel_config},this.dispatchAudioInitSegment(y)):this.detectAudioMetadataChange(y)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(y)),_=f;var S=Math.floor(f),D={unit:m.data,length:m.data.byteLength,pts:S,dts:S};this.audio_track_.samples.push(D),this.audio_track_.length+=m.data.byteLength,f+=o}d.hasIncompleteData()&&(this.aac_last_incomplete_data_=d.getIncompleteData()),_&&(this.audio_last_sample_pts_=_)}},i.prototype.parseLOASAACPayload=function(e,t){var a;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var o=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);o.set(this.aac_last_incomplete_data_,0),o.set(e,this.aac_last_incomplete_data_.byteLength),e=o}var r,s;if(t!=null&&(s=t/this.timescale_),this.audio_metadata_.codec==="aac"){if(t==null&&this.audio_last_sample_pts_!=null)r=1024/this.audio_metadata_.sampling_frequency*1e3,s=this.audio_last_sample_pts_+r;else if(t==null)return void c.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.audio_last_sample_pts_){r=1024/this.audio_metadata_.sampling_frequency*1e3;var _=this.audio_last_sample_pts_+r;Math.abs(_-s)>1&&(c.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(_,"ms, PES pts: ").concat(s,"ms")),s=_)}}for(var d,m=new Oe(e),f=null,y=s;(f=m.readNextAACFrame((a=this.loas_previous_frame)!==null&&a!==void 0?a:void 0))!=null;){this.loas_previous_frame=f,r=1024/f.sampling_frequency*1e3;var S={codec:"aac",data:f};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"aac",audio_object_type:f.audio_object_type,sampling_freq_index:f.sampling_freq_index,sampling_frequency:f.sampling_frequency,channel_config:f.channel_config},this.dispatchAudioInitSegment(S)):this.detectAudioMetadataChange(S)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(S)),d=y;var D=Math.floor(y),x={unit:f.data,length:f.data.byteLength,pts:D,dts:D};this.audio_track_.samples.push(x),this.audio_track_.length+=f.data.byteLength,y+=r}m.hasIncompleteData()&&(this.aac_last_incomplete_data_=m.getIncompleteData()),d&&(this.audio_last_sample_pts_=d)}},i.prototype.parseAC3Payload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var a,o;if(t!=null&&(o=t/this.timescale_),this.audio_metadata_.codec==="ac-3"){if(t==null&&this.audio_last_sample_pts_!=null)a=1536/this.audio_metadata_.sampling_frequency*1e3,o=this.audio_last_sample_pts_+a;else if(t==null)return void c.A.w(this.TAG,"AC3: Unknown pts")}for(var r,s=new Vt(e),_=null,d=o;(_=s.readNextAC3Frame())!=null;){a=1536/_.sampling_frequency*1e3;var m={codec:"ac-3",data:_};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"ac-3",sampling_frequency:_.sampling_frequency,bit_stream_identification:_.bit_stream_identification,bit_stream_mode:_.bit_stream_mode,low_frequency_effects_channel_on:_.low_frequency_effects_channel_on,channel_mode:_.channel_mode},this.dispatchAudioInitSegment(m)):this.detectAudioMetadataChange(m)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(m)),r=d;var f=Math.floor(d),y={unit:_.data,length:_.data.byteLength,pts:f,dts:f};this.audio_track_.samples.push(y),this.audio_track_.length+=_.data.byteLength,d+=a}r&&(this.audio_last_sample_pts_=r)}},i.prototype.parseEAC3Payload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var a,o;if(t!=null&&(o=t/this.timescale_),this.audio_metadata_.codec==="ec-3"){if(t==null&&this.audio_last_sample_pts_!=null)a=256*this.audio_metadata_.num_blks/this.audio_metadata_.sampling_frequency*1e3,o=this.audio_last_sample_pts_+a;else if(t==null)return void c.A.w(this.TAG,"EAC3: Unknown pts")}for(var r,s=new jt(e),_=null,d=o;(_=s.readNextEAC3Frame())!=null;){a=1536/_.sampling_frequency*1e3;var m={codec:"ec-3",data:_};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"ec-3",sampling_frequency:_.sampling_frequency,bit_stream_identification:_.bit_stream_identification,low_frequency_effects_channel_on:_.low_frequency_effects_channel_on,num_blks:_.num_blks,channel_mode:_.channel_mode},this.dispatchAudioInitSegment(m)):this.detectAudioMetadataChange(m)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(m)),r=d;var f=Math.floor(d),y={unit:_.data,length:_.data.byteLength,pts:f,dts:f};this.audio_track_.samples.push(y),this.audio_track_.length+=_.data.byteLength,d+=a}r&&(this.audio_last_sample_pts_=r)}},i.prototype.parseOpusPayload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var a,o;if(t!=null&&(o=t/this.timescale_),this.audio_metadata_.codec==="opus"){if(t==null&&this.audio_last_sample_pts_!=null)a=20,o=this.audio_last_sample_pts_+a;else if(t==null)return void c.A.w(this.TAG,"Opus: Unknown pts")}for(var r,s=o,_=0;_<e.length;){a=20;for(var d=!!(16&e[_+1]),m=!!(8&e[_+1]),f=_+2,y=0;e[f]===255;)y+=255,f+=1;y+=e[f],f+=1,f+=d?2:0,f+=m?2:0,r=s;var S=Math.floor(s),D=e.slice(f,f+y),x={unit:D,length:D.byteLength,pts:S,dts:S};this.audio_track_.samples.push(x),this.audio_track_.length+=D.byteLength,s+=a,_=f+y}r&&(this.audio_last_sample_pts_=r)}},i.prototype.parseMP3Payload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var a=e[1]>>>3&3,o=(6&e[1])>>1,r=(e[2],(12&e[2])>>>2),s=3&~(e[3]>>>6)?2:1,_=0,d=34;switch(a){case 0:_=[11025,12e3,8e3,0][r];break;case 2:_=[22050,24e3,16e3,0][r];break;case 3:_=[44100,48e3,32e3,0][r]}switch(o){case 1:d=34;break;case 2:d=33;break;case 3:d=32}var m=new xt;m.object_type=d,m.sample_rate=_,m.channel_count=s,m.data=e;var f={codec:"mp3",data:m};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"mp3",object_type:d,sample_rate:_,channel_count:s},this.dispatchAudioInitSegment(f)):this.detectAudioMetadataChange(f)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(f));var y={unit:e,length:e.byteLength,pts:t/this.timescale_,dts:t/this.timescale_};this.audio_track_.samples.push(y),this.audio_track_.length+=e.byteLength}},i.prototype.detectAudioMetadataChange=function(e){if(e.codec!==this.audio_metadata_.codec)return c.A.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(this.audio_metadata_.codec," to ").concat(e.codec)),!0;if(e.codec==="aac"&&this.audio_metadata_.codec==="aac"){if((t=e.data).audio_object_type!==this.audio_metadata_.audio_object_type)return c.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(t.audio_object_type)),!0;if(t.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return c.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(t.sampling_freq_index)),!0;if(t.channel_config!==this.audio_metadata_.channel_config)return c.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(this.audio_metadata_.channel_config," to ").concat(t.channel_config)),!0}else if(e.codec==="ac-3"&&this.audio_metadata_.codec==="ac-3"){var t;if((t=e.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return c.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(this.audio_metadata_.sampling_frequency," to ").concat(t.sampling_frequency)),!0;if(t.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return c.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(t.bit_stream_identification)),!0;if(t.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return c.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(t.bit_stream_mode)),!0;if(t.channel_mode!==this.audio_metadata_.channel_mode)return c.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(t.channel_mode)),!0;if(t.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return c.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(t.low_frequency_effects_channel_on)),!0}else if(e.codec==="opus"&&this.audio_metadata_.codec==="opus"){if((a=e.meta).sample_rate!==this.audio_metadata_.sample_rate)return c.A.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(a.sample_rate)),!0;if(a.channel_count!==this.audio_metadata_.channel_count)return c.A.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(a.channel_count)),!0}else if(e.codec==="mp3"&&this.audio_metadata_.codec==="mp3"){var a;if((a=e.data).object_type!==this.audio_metadata_.object_type)return c.A.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(a.object_type)),!0;if(a.sample_rate!==this.audio_metadata_.sample_rate)return c.A.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(a.sample_rate)),!0;if(a.channel_count!==this.audio_metadata_.channel_count)return c.A.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(a.channel_count)),!0}return!1},i.prototype.dispatchAudioInitSegment=function(e){var t={type:"audio"};if(t.id=this.audio_track_.id,t.timescale=1e3,t.duration=this.duration_,this.audio_metadata_.codec==="aac"){var a=new Ve(e.codec==="aac"?e.data:null);t.audioSampleRate=a.sampling_rate,t.channelCount=a.channel_count,t.codec=a.codec_mimetype,t.originalCodec=a.original_codec_mimetype,t.config=a.config,t.refSampleDuration=1024/t.audioSampleRate*t.timescale}else if(this.audio_metadata_.codec==="ac-3"){var o=new Gt(e.codec==="ac-3"?e.data:null);t.audioSampleRate=o.sampling_rate,t.channelCount=o.channel_count,t.codec=o.codec_mimetype,t.originalCodec=o.original_codec_mimetype,t.config=o.config,t.refSampleDuration=1536/t.audioSampleRate*t.timescale}else if(this.audio_metadata_.codec==="ec-3"){var r=new zt(e.codec==="ec-3"?e.data:null);t.audioSampleRate=r.sampling_rate,t.channelCount=r.channel_count,t.codec=r.codec_mimetype,t.originalCodec=r.original_codec_mimetype,t.config=r.config,t.refSampleDuration=256*r.num_blks/t.audioSampleRate*t.timescale}else this.audio_metadata_.codec==="opus"?(t.audioSampleRate=this.audio_metadata_.sample_rate,t.channelCount=this.audio_metadata_.channel_count,t.channelConfigCode=this.audio_metadata_.channel_config_code,t.codec="opus",t.originalCodec="opus",t.config=void 0,t.refSampleDuration=20):this.audio_metadata_.codec==="mp3"&&(t.audioSampleRate=this.audio_metadata_.sample_rate,t.channelCount=this.audio_metadata_.channel_count,t.codec="mp3",t.originalCodec="mp3",t.config=void 0);this.audio_init_segment_dispatched_==0&&c.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(t.codec)),this.onTrackMetadata("audio",t),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var s=this.media_info_;s.hasAudio=!0,s.audioCodec=t.originalCodec,s.audioSampleRate=t.audioSampleRate,s.audioChannelCount=t.channelCount,s.hasVideo&&s.videoCodec?s.mimeType='video/mp2t; codecs="'.concat(s.videoCodec,",").concat(s.audioCodec,'"'):s.mimeType='video/mp2t; codecs="'.concat(s.audioCodec,'"'),s.isComplete()&&this.onMediaInfo(s)},i.prototype.dispatchPESPrivateDataDescriptor=function(e,t,a){var o=new et;o.pid=e,o.stream_type=t,o.descriptor=a,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(o)},i.prototype.parsePESPrivateDataPayload=function(e,t,a,o,r){var s=new Ie;s.pid=o,s.stream_id=r,s.len=e.byteLength,s.data=e,t!=null?s.pts=Math.floor(t/this.timescale_):s.nearest_pts=this.getNearestTimestampMilliseconds(),a!=null&&(s.dts=Math.floor(a/this.timescale_)),this.onPESPrivateData&&this.onPESPrivateData(s)},i.prototype.parseTimedID3MetadataPayload=function(e,t,a,o,r){var s=new Ie;s.pid=o,s.stream_id=r,s.len=e.byteLength,s.data=e,t!=null&&(s.pts=Math.floor(t/this.timescale_)),a!=null&&(s.dts=Math.floor(a/this.timescale_)),this.onTimedID3Metadata&&this.onTimedID3Metadata(s)},i.prototype.parsePGSPayload=function(e,t,a,o,r,s){var _=new Kt;_.pid=o,_.lang=s,_.stream_id=r,_.len=e.byteLength,_.data=e,t!=null&&(_.pts=Math.floor(t/this.timescale_)),a!=null&&(_.dts=Math.floor(a/this.timescale_)),this.onPGSSubtitleData&&this.onPGSSubtitleData(_)},i.prototype.parseSynchronousKLVMetadataPayload=function(e,t,a,o,r){var s=new qt;s.pid=o,s.stream_id=r,s.len=e.byteLength,s.data=e,t!=null&&(s.pts=Math.floor(t/this.timescale_)),a!=null&&(s.dts=Math.floor(a/this.timescale_)),s.access_units=(function(_){for(var d=[],m=0;m+5<_.byteLength;){var f=_[m+0],y=_[m+1],S=_[m+2],D=_[m+3]<<8|_[m+4],x=_.slice(m+5,m+5+D);d.push({service_id:f,sequence_number:y,flags:S,data:x}),m+=5+D}return d})(e),this.onSynchronousKLVMetadata&&this.onSynchronousKLVMetadata(s)},i.prototype.parseAsynchronousKLVMetadataPayload=function(e,t,a){var o=new Ie;o.pid=t,o.stream_id=a,o.len=e.byteLength,o.data=e,this.onAsynchronousKLVMetadata&&this.onAsynchronousKLVMetadata(o)},i.prototype.parseSMPTE2038MetadataPayload=function(e,t,a,o,r){var s=new Pt;s.pid=o,s.stream_id=r,s.len=e.byteLength,s.data=e,t!=null&&(s.pts=Math.floor(t/this.timescale_)),s.nearest_pts=this.getNearestTimestampMilliseconds(),a!=null&&(s.dts=Math.floor(a/this.timescale_)),s.ancillaries=(function(_){for(var d=new I(_),m=0,f=[];m+=6,d.readBits(6)===0;){var y=d.readBool();m+=1;var S=d.readBits(11);m+=11;var D=d.readBits(12);m+=12;var x=255&d.readBits(10);m+=10;var z=255&d.readBits(10);m+=10;var X=255&d.readBits(10);m+=10;for(var U=new Uint8Array(X),W=0;W<X;W++){var _e=255&d.readBits(10);m+=10,U[W]=_e}d.readBits(10),m+=10;var $="User Defined";x===65?z===7&&($="SCTE-104"):x===95?z===220?$="ARIB STD-B37 (1SEG)":z===221?$="ARIB STD-B37 (ANALOG)":z===222?$="ARIB STD-B37 (SD)":z===223&&($="ARIB STD-B37 (HD)"):x===97&&(z===1?$="EIA-708":z===2&&($="EIA-608")),f.push({yc_indicator:y,line_number:S,horizontal_offset:D,did:x,sdid:z,user_data:U,description:$,information:{}}),d.readBits(8-(m-Math.floor(m/8))%8),m+=(8-(m-Math.floor(m/8)))%8}return d.destroy(),d=null,f})(e),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(s)},i.prototype.parseSEIPayload=function(e,t,a){var o=H(e,t!=null?Math.floor(t/this.timescale_):void 0,a);o&&this.onSEI&&this.onSEI(o)},i.prototype.getNearestTimestampMilliseconds=function(){return this.audio_last_sample_pts_!=null?Math.floor(this.audio_last_sample_pts_):this.last_pcr_!=null?Math.floor(this.last_pcr_/300/this.timescale_):void 0},i.prototype.getPcrBase=function(e){var t=33554432*e[6]+131072*e[7]+512*e[8]+2*e[9]+(128&e[10])/128+this.timestamp_offset_;return t+4294967296<this.last_pcr_base_&&(t+=8589934592,this.timestamp_offset_+=8589934592),this.last_pcr_base_=t,t},i.prototype.getTimestamp=function(e,t){var a=536870912*(14&e[t])+4194304*(255&e[t+1])+16384*(254&e[t+2])+128*(255&e[t+3])+(254&e[t+4])/2+this.timestamp_offset_;return a+4294967296<this.last_pcr_base_&&(a+=8589934592),a},i})(ie),dt=function(n,i,e){if(e||arguments.length===2)for(var t,a=0,o=i.length;a<o;a++)!t&&a in i||(t||(t=Array.prototype.slice.call(i,0,a)),t[a]=i[a]);return n.concat(t||Array.prototype.slice.call(i))},_t=(function(){function n(){}return n.init=function(){for(var i in n.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],hvc1:[],hvcC:[],av01:[],av1C:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],chnl:[],".mp3":[],Opus:[],dOps:[],fLaC:[],dfLa:[],ipcm:[],pcmC:[],"ac-3":[],dac3:[],"ec-3":[],dec3:[]},n.types)n.types.hasOwnProperty(i)&&(n.types[i]=[i.charCodeAt(0),i.charCodeAt(1),i.charCodeAt(2),i.charCodeAt(3)]);var e=n.constants={};e.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),e.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),e.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSC=e.STCO=e.STTS,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),e.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),e.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},n.box=function(i){for(var e=8,t=null,a=Array.prototype.slice.call(arguments,1),o=a.length,r=0;r<o;r++)e+=a[r].byteLength;(t=new Uint8Array(e))[0]=e>>>24&255,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=255&e,t.set(i,4);var s=8;for(r=0;r<o;r++)t.set(a[r],s),s+=a[r].byteLength;return t},n.generateInitSegment=function(i){var e=n.box(n.types.ftyp,n.constants.FTYP),t=n.moov(i),a=new Uint8Array(e.byteLength+t.byteLength);return a.set(e,0),a.set(t,e.byteLength),a},n.moov=function(i){var e=n.mvhd(i.timescale,i.duration),t=n.trak(i),a=n.mvex(i);return n.box(n.types.moov,e,t,a)},n.mvhd=function(i,e){return n.box(n.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,e>>>24&255,e>>>16&255,e>>>8&255,255&e,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]))},n.trak=function(i){return n.box(n.types.trak,n.tkhd(i),n.mdia(i))},n.tkhd=function(i){var e=i.id,t=i.duration,a=i.presentWidth,o=i.presentHeight;return n.box(n.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,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,a>>>8&255,255&a,0,0,o>>>8&255,255&o,0,0]))},n.mdia=function(i){return n.box(n.types.mdia,n.mdhd(i),n.hdlr(i),n.minf(i))},n.mdhd=function(i){var e=i.timescale,t=i.duration;return n.box(n.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,85,196,0,0]))},n.hdlr=function(i){var e;return e=i.type==="audio"?n.constants.HDLR_AUDIO:n.constants.HDLR_VIDEO,n.box(n.types.hdlr,e)},n.minf=function(i){var e;return e=i.type==="audio"?n.box(n.types.smhd,n.constants.SMHD):n.box(n.types.vmhd,n.constants.VMHD),n.box(n.types.minf,e,n.dinf(),n.stbl(i))},n.dinf=function(){return n.box(n.types.dinf,n.box(n.types.dref,n.constants.DREF))},n.stbl=function(i){return n.box(n.types.stbl,n.stsd(i),n.box(n.types.stts,n.constants.STTS),n.box(n.types.stsc,n.constants.STSC),n.box(n.types.stsz,n.constants.STSZ),n.box(n.types.stco,n.constants.STCO))},n.stsd=function(i){return i.type==="audio"?i.codec==="mp3"?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.mp3(i)):i.codec==="ac-3"?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.ac3(i)):i.codec==="ec-3"?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.ec3(i)):i.codec==="opus"?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.Opus(i)):i.codec=="flac"?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.fLaC(i)):i.codec=="ipcm"?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.ipcm(i)):n.box(n.types.stsd,n.constants.STSD_PREFIX,n.mp4a(i)):i.type==="video"&&i.codec.startsWith("hvc1")?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.hvc1(i)):i.type==="video"&&i.codec.startsWith("av01")?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.av01(i)):n.box(n.types.stsd,n.constants.STSD_PREFIX,n.avc1(i))},n.mp3=function(i){var e=i.channelCount,t=i.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e,0,16,0,0,0,0,t>>>8&255,255&t,0,0]);return n.box(n.types[".mp3"],a)},n.mp4a=function(i){var e=i.channelCount,t=i.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e,0,16,0,0,0,0,t>>>8&255,255&t,0,0]);return n.box(n.types.mp4a,a,n.esds(i))},n.ac3=function(i){var e=i.channelCount,t=i.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e,0,16,0,0,0,0,t>>>8&255,255&t,0,0]);return n.box(n.types["ac-3"],a,n.box(n.types.dac3,new Uint8Array(i.config)))},n.ec3=function(i){var e=i.channelCount,t=i.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e,0,16,0,0,0,0,t>>>8&255,255&t,0,0]);return n.box(n.types["ec-3"],a,n.box(n.types.dec3,new Uint8Array(i.config)))},n.esds=function(i){var e=i.config||[],t=e.length,a=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).concat([6,1,2]));return n.box(n.types.esds,a)},n.Opus=function(i){var e=i.channelCount,t=i.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e,0,16,0,0,0,0,t>>>8&255,255&t,0,0]);return n.box(n.types.Opus,a,n.dOps(i))},n.dOps=function(i){var e=i.channelCount,t=i.channelConfigCode,a=i.audioSampleRate;if(i.config)return n.box(n.types.dOps,i.config);var o=[];switch(t){case 1:case 2:o=[0];break;case 0:o=[255,1,1,0,1];break;case 128:o=[255,2,0,0,1];break;case 3:o=[1,2,1,0,2,1];break;case 4:o=[1,2,2,0,1,2,3];break;case 5:o=[1,3,2,0,4,1,2,3];break;case 6:o=[1,4,2,0,4,1,2,3,5];break;case 7:o=[1,4,2,0,4,1,2,3,5,6];break;case 8:o=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:o=[1,1,2,0,1];break;case 131:o=[1,1,3,0,1,2];break;case 132:o=[1,1,4,0,1,2,3];break;case 133:o=[1,1,5,0,1,2,3,4];break;case 134:o=[1,1,6,0,1,2,3,4,5];break;case 135:o=[1,1,7,0,1,2,3,4,5,6];break;case 136:o=[1,1,8,0,1,2,3,4,5,6,7]}var r=new Uint8Array(dt([0,e,0,0,a>>>24&255,a>>>17&255,a>>>8&255,a>>>0&255,0,0],o,!0));return n.box(n.types.dOps,r)},n.fLaC=function(i){var e=i.channelCount,t=Math.min(i.audioSampleRate,65535),a=i.sampleSize,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e,0,a,0,0,0,0,t>>>8&255,255&t,0,0]);return n.box(n.types.fLaC,o,n.dfLa(i))},n.dfLa=function(i){var e=new Uint8Array(dt([0,0,0,0],i.config,!0));return n.box(n.types.dfLa,e)},n.ipcm=function(i){var e=i.channelCount,t=Math.min(i.audioSampleRate,65535),a=i.sampleSize,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e,0,a,0,0,0,0,t>>>8&255,255&t,0,0]);return i.channelCount===1?n.box(n.types.ipcm,o,n.pcmC(i)):n.box(n.types.ipcm,o,n.chnl(i),n.pcmC(i))},n.chnl=function(i){var e=new Uint8Array([0,0,0,0,1,i.channelCount,0,0,0,0,0,0,0,0]);return n.box(n.types.chnl,e)},n.pcmC=function(i){var e=i.littleEndian?1:0,t=i.sampleSize,a=new Uint8Array([0,0,0,0,e,t]);return n.box(n.types.pcmC,a)},n.avc1=function(i){var e=i.avcc,t=i.codecWidth,a=i.codecHeight,o=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,t>>>8&255,255&t,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return n.box(n.types.avc1,o,n.box(n.types.avcC,e))},n.hvc1=function(i){var e=i.hvcc,t=i.codecWidth,a=i.codecHeight,o=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,t>>>8&255,255&t,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return n.box(n.types.hvc1,o,n.box(n.types.hvcC,e))},n.av01=function(i){var e=i.av1c,t=i.codecWidth||192,a=i.codecHeight||108,o=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,t>>>8&255,255&t,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return n.box(n.types.av01,o,n.box(n.types.av1C,e))},n.mvex=function(i){return n.box(n.types.mvex,n.trex(i))},n.trex=function(i){var e=i.id,t=new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return n.box(n.types.trex,t)},n.moof=function(i,e){return n.box(n.types.moof,n.mfhd(i.sequenceNumber),n.traf(i,e))},n.mfhd=function(i){var e=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i]);return n.box(n.types.mfhd,e)},n.traf=function(i,e){var t=i.id,a=n.box(n.types.tfhd,new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t])),o=n.box(n.types.tfdt,new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])),r=n.sdtp(i),s=n.trun(i,r.byteLength+16+16+8+16+8+8);return n.box(n.types.traf,a,o,s,r)},n.sdtp=function(i){for(var e=i.samples||[],t=e.length,a=new Uint8Array(4+t),o=0;o<t;o++){var r=e[o].flags;a[o+4]=r.isLeading<<6|r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy}return n.box(n.types.sdtp,a)},n.trun=function(i,e){var t=i.samples||[],a=t.length,o=12+16*a,r=new Uint8Array(o);e+=8+o,r.set([0,0,15,1,a>>>24&255,a>>>16&255,a>>>8&255,255&a,e>>>24&255,e>>>16&255,e>>>8&255,255&e],0);for(var s=0;s<a;s++){var _=t[s].duration,d=t[s].size,m=t[s].flags,f=t[s].cts;r.set([_>>>24&255,_>>>16&255,_>>>8&255,255&_,d>>>24&255,d>>>16&255,d>>>8&255,255&d,m.isLeading<<2|m.dependsOn,m.isDependedOn<<6|m.hasRedundancy<<4|m.isNonSync,0,0,f>>>24&255,f>>>16&255,f>>>8&255,255&f],12+16*s)}return n.box(n.types.trun,r)},n.mdat=function(i){return n.box(n.types.mdat,i)},n})();_t.init();var He=_t,ht=(function(){function n(){}return n.getSilentFrame=function(i,e){if(i==="mp4a.40.2"){if(e===1)return new Uint8Array([0,200,0,128,35,128]);if(e===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(e===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(e===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(e===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(e===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(e===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(e===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(e===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},n})(),Ge=B(47),ct=(function(){function n(i){this.TAG="MP4Remuxer",this._config=i,this._isLive=i.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Ge.Sc("audio"),this._videoSegmentInfoList=new Ge.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!L.A.chrome||!(L.A.version.major<50||L.A.version.major===50&&L.A.version.build<2661)),this._fillSilentAfterSeek=L.A.msedge||L.A.msie,this._mp3UseMpegAudio=!L.A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return n.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},n.prototype.bindDataSource=function(i){return i.onDataAvailable=this.remux.bind(this),i.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(n.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(i){this._onInitSegment=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(i){this._onMediaSegment=i},enumerable:!1,configurable:!0}),n.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},n.prototype.seek=function(i){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},n.prototype.remux=function(i,e){if(!this._onMediaSegment)throw new O.j4("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(i,e),e&&this._remuxVideo(e),i&&this._remuxAudio(i)},n.prototype._onTrackMetadataReceived=function(i,e){var t=null,a="mp4",o=e.codec;if(i==="audio")this._audioMeta=e,e.codec==="mp3"&&this._mp3UseMpegAudio?(a="mpeg",o="",t=new Uint8Array):t=He.generateInitSegment(e);else{if(i!=="video")return;this._videoMeta=e,t=He.generateInitSegment(e)}if(!this._onInitSegment)throw new O.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(i,{type:i,data:t.buffer,codec:o,container:"".concat(i,"/").concat(a),mediaDuration:e.duration})},n.prototype._calculateDtsBase=function(i,e){this._dtsBaseInited||(i&&i.samples&&i.samples.length&&(this._audioDtsBase=i.samples[0].dts),e&&e.samples&&e.samples.length&&(this._videoDtsBase=e.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},n.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},n.prototype.flushStashedSamples=function(){var i=this._videoStashedLastSample,e=this._audioStashedLastSample,t={type:"video",id:1,sequenceNumber:0,samples:[],length:0};i!=null&&(t.samples.push(i),t.length=i.length);var a={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};e!=null&&(a.samples.push(e),a.length=e.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(t,!0),this._remuxAudio(a,!0)},n.prototype._remuxAudio=function(i,e){if(this._audioMeta!=null){var t,a=i,o=a.samples,r=void 0,s=-1,_=this._audioMeta.refSampleDuration,d=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,m=this._dtsBaseInited&&this._audioNextDts===void 0,f=!1;if(o&&o.length!==0&&(o.length!==1||e)){var y=0,S=null,D=0;d?(y=0,D=a.length):(y=8,D=8+a.length);var x=null;if(o.length>1&&(D-=(x=o.pop()).length),this._audioStashedLastSample!=null){var z=this._audioStashedLastSample;this._audioStashedLastSample=null,o.unshift(z),D+=z.length}x!=null&&(this._audioStashedLastSample=x);var X=o[0].dts-this._dtsBase;if(this._audioNextDts)r=X-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())r=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(f=!0);else{var U=this._audioSegmentInfoList.getLastSampleBefore(X);if(U!=null){var W=X-(U.originalDts+U.duration);W<=3&&(W=0),r=X-(U.dts+U.duration+W)}else r=0}if(f){var _e=X-r,$=this._videoSegmentInfoList.getLastSegmentBefore(X);if($!=null&&$.beginDts<_e){if(be=ht.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount)){var Q=$.beginDts,me=_e-$.beginDts;c.A.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(Q,", duration: ").concat(me)),o.unshift({unit:be,dts:Q,pts:Q}),D+=be.byteLength}}else f=!1}for(var ee=[],fe=0;fe<o.length;fe++){var ve=(z=o[fe]).unit,ye=z.dts-this._dtsBase,Ee=(Q=ye,!1),we=null,oe=0;if(!(ye<-.001)){if(this._audioMeta.codec!=="mp3"&&_!=null){var le=ye;if(this._audioNextDts&&(le=this._audioNextDts),(r=ye-le)<=-3*_){c.A.w(this.TAG,"Dropping 1 audio frame (originalDts: ".concat(ye," ms ,curRefDts: ").concat(le," ms) due to dtsCorrection: ").concat(r," ms overlap."));continue}if(r>=3*_&&this._fillAudioTimestampGap){Ee=!0;var be,ue=Math.floor(r/_);c.A.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
`+"originalDts: ".concat(ye," ms, curRefDts: ").concat(le," ms, ")+"dtsCorrection: ".concat(Math.round(r)," ms, generate: ").concat(ue," frames")),Q=Math.floor(le),oe=Math.floor(le+_)-Q,(be=ht.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount))??(c.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),be=ve),we=[];for(var Ce=0;Ce<ue;Ce++){le+=_;var Ue=Math.floor(le),xe=Math.floor(le+_)-Ue,Be={dts:Ue,pts:Ue,cts:0,unit:be,size:be.byteLength,duration:xe,originalDts:ye,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};we.push(Be),D+=Be.size}this._audioNextDts=le+_}else Q=Math.floor(le),oe=Math.floor(le+_)-Q,this._audioNextDts=le+_}else Q=ye-r,oe=fe!==o.length-1?o[fe+1].dts-this._dtsBase-r-Q:x!=null?x.dts-this._dtsBase-r-Q:ee.length>=1?ee[ee.length-1].duration:Math.floor(_),this._audioNextDts=Q+oe;s===-1&&(s=Q),ee.push({dts:Q,pts:Q,cts:0,unit:z.unit,size:z.unit.byteLength,duration:oe,originalDts:ye,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Ee&&ee.push.apply(ee,we)}}if(ee.length===0)return a.samples=[],void(a.length=0);for(d?S=new Uint8Array(D):((S=new Uint8Array(D))[0]=D>>>24&255,S[1]=D>>>16&255,S[2]=D>>>8&255,S[3]=255&D,S.set(He.types.mdat,4)),fe=0;fe<ee.length;fe++)ve=ee[fe].unit,S.set(ve,y),y+=ve.byteLength;var Ae=ee[ee.length-1];t=Ae.dts+Ae.duration;var De=new Ge.EZ;De.beginDts=s,De.endDts=t,De.beginPts=s,De.endPts=t,De.originalBeginDts=ee[0].originalDts,De.originalEndDts=Ae.originalDts+Ae.duration,De.firstSample=new Ge.$_(ee[0].dts,ee[0].pts,ee[0].duration,ee[0].originalDts,!1),De.lastSample=new Ge.$_(Ae.dts,Ae.pts,Ae.duration,Ae.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(De),a.samples=ee,a.sequenceNumber++;var je=d?new Uint8Array:He.moof(a,s);a.samples=[],a.length=0;var qe={type:"audio",data:this._mergeBoxes(je,S).buffer,sampleCount:ee.length,info:De};d&&m&&(qe.timestampOffset=s),this._onMediaSegment("audio",qe)}}},n.prototype._remuxVideo=function(i,e){if(this._videoMeta!=null){var t,a,o=i,r=o.samples,s=void 0,_=-1,d=-1;if(r&&r.length!==0&&(r.length!==1||e)){var m=8,f=null,y=8+i.length,S=null;if(r.length>1&&(y-=(S=r.pop()).length),this._videoStashedLastSample!=null){var D=this._videoStashedLastSample;this._videoStashedLastSample=null,r.unshift(D),y+=D.length}S!=null&&(this._videoStashedLastSample=S);var x=r[0].dts-this._dtsBase;if(this._videoNextDts)s=x-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())s=0;else{var z=this._videoSegmentInfoList.getLastSampleBefore(x);if(z!=null){var X=x-(z.originalDts+z.duration);X<=3&&(X=0),s=x-(z.dts+z.duration+X)}else s=0}for(var U=new Ge.EZ,W=[],_e=0;_e<r.length;_e++){var $=(D=r[_e]).dts-this._dtsBase,Q=D.isKeyframe,me=$-s,ee=D.cts,fe=me+ee;_===-1&&(_=me,d=fe);var ve=0;if(ve=_e!==r.length-1?r[_e+1].dts-this._dtsBase-s-me:S!=null?S.dts-this._dtsBase-s-me:W.length>=1?W[W.length-1].duration:Math.floor(this._videoMeta.refSampleDuration),Q){var ye=new Ge.$_(me,fe,ve,D.dts,!0);ye.fileposition=D.fileposition,U.appendSyncPoint(ye)}W.push({dts:me,pts:fe,cts:ee,units:D.units,size:D.length,isKeyframe:Q,duration:ve,originalDts:$,flags:{isLeading:0,dependsOn:Q?2:1,isDependedOn:Q?1:0,hasRedundancy:0,isNonSync:Q?0:1}})}for((f=new Uint8Array(y))[0]=y>>>24&255,f[1]=y>>>16&255,f[2]=y>>>8&255,f[3]=255&y,f.set(He.types.mdat,4),_e=0;_e<W.length;_e++)for(var Ee=W[_e].units;Ee.length;){var we=Ee.shift().data;f.set(we,m),m+=we.byteLength}var oe=W[W.length-1];if(t=oe.dts+oe.duration,a=oe.pts+oe.duration,this._videoNextDts=t,U.beginDts=_,U.endDts=t,U.beginPts=d,U.endPts=a,U.originalBeginDts=W[0].originalDts,U.originalEndDts=oe.originalDts+oe.duration,U.firstSample=new Ge.$_(W[0].dts,W[0].pts,W[0].duration,W[0].originalDts,W[0].isKeyframe),U.lastSample=new Ge.$_(oe.dts,oe.pts,oe.duration,oe.originalDts,oe.isKeyframe),this._isLive||this._videoSegmentInfoList.append(U),o.samples=W,o.sequenceNumber++,this._forceFirstIDR){var le=W[0].flags;le.dependsOn=2,le.isNonSync=0}var be=He.moof(o,_);o.samples=[],o.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(be,f).buffer,sampleCount:W.length,info:U})}}},n.prototype._mergeBoxes=function(i,e){var t=new Uint8Array(i.byteLength+e.byteLength);return t.set(i,0),t.set(e,i.byteLength),t},n})(),Xt=B(653),Le=B(726),Yt=(B(470),(function(){function n(i,e){this.TAG="TransmuxingController",this._emitter=new(Z()),this._config=e,i.segments||(i.segments=[{duration:i.duration,filesize:i.filesize,url:i.url}]),typeof i.cors!="boolean"&&(i.cors=!0),typeof i.withCredentials!="boolean"&&(i.withCredentials=!1),this._mediaDataSource=i,this._currentSegmentIndex=0;var t=0;this._mediaDataSource.segments.forEach(function(a){a.timestampBase=t,t+=a.duration,a.cors=i.cors,a.withCredentials=i.withCredentials,e.referrerPolicy&&(a.referrerPolicy=e.referrerPolicy)}),isNaN(t)||this._mediaDataSource.duration===t||(this._mediaDataSource.duration=t),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return n.prototype.destroy=function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},n.prototype.on=function(i,e){this._emitter.addListener(i,e)},n.prototype.off=function(i,e){this._emitter.removeListener(i,e)},n.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},n.prototype._loadSegment=function(i,e){this._currentSegmentIndex=i;var t=this._mediaDataSource.segments[i],a=this._ioctl=new Xt.A(t,this._config,i);a.onError=this._onIOException.bind(this),a.onSeeked=this._onIOSeeked.bind(this),a.onComplete=this._onIOComplete.bind(this),a.onRedirect=this._onIORedirect.bind(this),a.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),e?this._demuxer.bindDataSource(this._ioctl):a.onDataArrival=this._onInitChunkArrival.bind(this),a.open(e)},n.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},n.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},n.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},n.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},n.prototype.seek=function(i){if(this._mediaInfo!=null&&this._mediaInfo.isSeekable()){var e=this._searchSegmentIndexContains(i);if(e===this._currentSegmentIndex){var t=this._mediaInfo.segments[e];if(t==null)this._pendingSeekTime=i;else{var a=t.getNearestKeyframe(i);this._remuxer.seek(a.milliseconds),this._ioctl.seek(a.fileposition),this._pendingResolveSeekPoint=a.milliseconds}}else{var o=this._mediaInfo.segments[e];o==null?(this._pendingSeekTime=i,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(e)):(a=o.getNearestKeyframe(i),this._internalAbort(),this._remuxer.seek(i),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[e].timestampBase,this._loadSegment(e,a.fileposition),this._pendingResolveSeekPoint=a.milliseconds,this._reportSegmentMediaInfo(e))}this._enableStatisticsReporter()}},n.prototype._searchSegmentIndexContains=function(i){for(var e=this._mediaDataSource.segments,t=e.length-1,a=0;a<e.length;a++)if(i<e[a].timestampBase){t=a-1;break}return t},n.prototype._onInitChunkArrival=function(i,e){var t=this,a=0;if(e>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,a=this._demuxer.parseChunks(i,e);else{var o=null;(o=ne.probe(i)).match&&(this._setupFLVDemuxerRemuxer(o),a=this._demuxer.parseChunks(i,e)),o.match||o.needMoreData||(o=st.probe(i)).match&&(this._setupTSDemuxerRemuxer(o),a=this._demuxer.parseChunks(i,e)),o.match||o.needMoreData||(o=null,c.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then(function(){t._internalAbort()}),this._emitter.emit(Le.A.DEMUX_ERROR,E.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return a},n.prototype._setupFLVDemuxerRemuxer=function(i){this._demuxer=new ne(i,this._config),this._remuxer||(this._remuxer=new ct(this._config));var e=this._mediaDataSource;e.duration==null||isNaN(e.duration)||(this._demuxer.overridedDuration=e.duration),typeof e.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=e.hasAudio),typeof e.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=e.hasVideo),this._demuxer.timestampBase=e.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._demuxer.onSeiArrived=this._onSEI.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},n.prototype._setupTSDemuxerRemuxer=function(i){var e=this._demuxer=new st(i,this._config);this._remuxer||(this._remuxer=new ct(this._config)),e.onError=this._onDemuxException.bind(this),e.onMediaInfo=this._onMediaInfo.bind(this),e.onMetaDataArrived=this._onMetaDataArrived.bind(this),e.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),e.onPGSSubtitleData=this._onPGSSubtitle.bind(this),e.onSynchronousKLVMetadata=this._onSynchronousKLVMetadata.bind(this),e.onAsynchronousKLVMetadata=this._onAsynchronousKLVMetadata.bind(this),e.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),e.onSEI=this._onSEI.bind(this),e.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),e.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),e.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},n.prototype._onMediaInfo=function(i){var e=this;this._mediaInfo??(this._mediaInfo=Object.assign({},i),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,b.A.prototype));var t=Object.assign({},i);Object.setPrototypeOf(t,b.A.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=t,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var a=e._pendingSeekTime;e._pendingSeekTime=null,e.seek(a)})},n.prototype._onMetaDataArrived=function(i){this._emitter.emit(Le.A.METADATA_ARRIVED,i)},n.prototype._onScriptDataArrived=function(i){this._emitter.emit(Le.A.SCRIPTDATA_ARRIVED,i)},n.prototype._onTimedID3Metadata=function(i){var e=this._remuxer.getTimestampBase();e!=null&&(i.pts!=null&&(i.pts-=e),i.dts!=null&&(i.dts-=e),this._emitter.emit(Le.A.TIMED_ID3_METADATA_ARRIVED,i))},n.prototype._onPGSSubtitle=function(i){var e=this._remuxer.getTimestampBase();e!=null&&(i.pts!=null&&(i.pts-=e),i.dts!=null&&(i.dts-=e),this._emitter.emit(Le.A.PGS_SUBTITLE_ARRIVED,i))},n.prototype._onSynchronousKLVMetadata=function(i){var e=this._remuxer.getTimestampBase();e!=null&&(i.pts!=null&&(i.pts-=e),i.dts!=null&&(i.dts-=e),this._emitter.emit(Le.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,i))},n.prototype._onAsynchronousKLVMetadata=function(i){this._emitter.emit(Le.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,i)},n.prototype._onSMPTE2038Metadata=function(i){var e=this._remuxer.getTimestampBase();e!=null&&(i.pts!=null&&(i.pts-=e),i.dts!=null&&(i.dts-=e),i.nearest_pts!=null&&(i.nearest_pts-=e),this._emitter.emit(Le.A.SMPTE2038_METADATA_ARRIVED,i))},n.prototype._onSEI=function(i){var e=this._remuxer.getTimestampBase();e!=null&&(i.pts!=null&&(i.pts-=e),this._emitter.emit(Le.A.SEI_ARRIVED,i))},n.prototype._onSCTE35Metadata=function(i){var e=this._remuxer.getTimestampBase();e!=null&&(i.pts!=null&&(i.pts-=e),i.nearest_pts!=null&&(i.nearest_pts-=e),this._emitter.emit(Le.A.SCTE35_METADATA_ARRIVED,i))},n.prototype._onPESPrivateDataDescriptor=function(i){this._emitter.emit(Le.A.PES_PRIVATE_DATA_DESCRIPTOR,i)},n.prototype._onPESPrivateData=function(i){var e=this._remuxer.getTimestampBase();e!=null&&(i.pts!=null&&(i.pts-=e),i.nearest_pts!=null&&(i.nearest_pts-=e),i.dts!=null&&(i.dts-=e),this._emitter.emit(Le.A.PES_PRIVATE_DATA_ARRIVED,i))},n.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},n.prototype._onIOComplete=function(i){var e=i+1;e<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(e)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(Le.A.LOADING_COMPLETE),this._disableStatisticsReporter())},n.prototype._onIORedirect=function(i){var e=this._ioctl.extraData;this._mediaDataSource.segments[e].redirectedURL=i},n.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(Le.A.RECOVERED_EARLY_EOF)},n.prototype._onIOException=function(i,e){c.A.e(this.TAG,"IOException: type = ".concat(i,", code = ").concat(e.code,", msg = ").concat(e.msg)),this._emitter.emit(Le.A.IO_ERROR,i,e),this._disableStatisticsReporter()},n.prototype._onDemuxException=function(i,e){c.A.e(this.TAG,"DemuxException: type = ".concat(i,", info = ").concat(e)),this._emitter.emit(Le.A.DEMUX_ERROR,i,e)},n.prototype._onRemuxerInitSegmentArrival=function(i,e){this._emitter.emit(Le.A.INIT_SEGMENT,i,e)},n.prototype._onRemuxerMediaSegmentArrival=function(i,e){if(this._pendingSeekTime==null&&(this._emitter.emit(Le.A.MEDIA_SEGMENT,i,e),this._pendingResolveSeekPoint!=null&&i==="video")){var t=e.info.syncPoints,a=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,L.A.safari&&t.length>0&&t[0].originalDts===a&&(a=t[0].pts),this._emitter.emit(Le.A.RECOMMEND_SEEKPOINT,a)}},n.prototype._enableStatisticsReporter=function(){this._statisticsReporter??=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},n.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},n.prototype._reportSegmentMediaInfo=function(i){var e=this._mediaInfo.segments[i],t=Object.assign({},e);t.duration=this._mediaInfo.duration,t.segmentCount=this._mediaInfo.segmentCount,delete t.segments,delete t.keyframesIndex,this._emitter.emit(Le.A.MEDIA_INFO,t)},n.prototype._reportStatisticsInfo=function(){var i={};i.url=this._ioctl.currentURL,i.hasRedirect=this._ioctl.hasRedirect,i.hasRedirect&&(i.redirectedURL=this._ioctl.currentRedirectedURL),i.speed=this._ioctl.currentSpeed,i.loaderType=this._ioctl.loaderType,i.currentSegmentIndex=this._currentSegmentIndex,i.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Le.A.STATISTICS_INFO,i)},n})())},137:function(he,te,B){"use strict";B(856),B(947),B(811),B(886),B(726)},827:function(he,te){"use strict";te.A={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},976:function(he,te,B){he.exports=B(311).default},653:function(he,te,B){"use strict";B.d(te,{A:function(){return Y}});var P,Z=B(856),c=(function(){function C(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return C.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},C.prototype.addBytes=function(l){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=l,this._totalBytes+=l):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=l,this._totalBytes+=l):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=l,this._totalBytes+=l,this._lastCheckpoint=this._now())},Object.defineProperty(C.prototype,"currentKBps",{get:function(){this.addBytes(0);var l=(this._now()-this._lastCheckpoint)/1e3;return l==0&&(l=1),this._intervalBytes/l/1024},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"averageKBps",{get:function(){var l=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/l/1024},enumerable:!1,configurable:!0}),C})(),L=B(470),b=B(994),w=B(867),M=(P=function(C,l){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var v in p)Object.prototype.hasOwnProperty.call(p,v)&&(u[v]=p[v])},P(C,l)},function(C,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function u(){this.constructor=C}P(C,l),C.prototype=l===null?Object.create(l):(u.prototype=l.prototype,new u)}),g=(function(C){function l(u,p){var v=C.call(this,"fetch-stream-loader")||this;return v.TAG="FetchStreamLoader",v._seekHandler=u,v._config=p,v._needStash=!0,v._requestAbort=!1,v._abortController=null,v._contentLength=null,v._receivedLength=0,v}return M(l,C),l.isSupported=function(){try{var u=b.A.msedge&&b.A.version.minor>=15048,p=!b.A.msedge||u;return self.fetch&&self.ReadableStream&&p}catch{return!1}},l.prototype.destroy=function(){this.isWorking()&&this.abort(),C.prototype.destroy.call(this)},l.prototype.open=function(u,p){var v=this;this._dataSource=u,this._range=p;var H=u.url;this._config.reuseRedirectedURL&&u.redirectedURL!=null&&(H=u.redirectedURL);var j=this._seekHandler.getConfig(H,p),ne=new self.Headers;if(typeof j.headers=="object"){var ie=j.headers;for(var ce in ie)ie.hasOwnProperty(ce)&&ne.append(ce,ie[ce])}var Se={method:"GET",headers:ne,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var ce in this._config.headers)ne.append(ce,this._config.headers[ce]);u.cors===!1&&(Se.mode="same-origin"),u.withCredentials&&(Se.credentials="include"),u.referrerPolicy&&(Se.referrerPolicy=u.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,Se.signal=this._abortController.signal),this._status=L.eO.kConnecting,self.fetch(j.url,Se).then(function(Te){if(v._requestAbort)return v._status=L.eO.kIdle,void Te.body.cancel();if(Te.ok&&Te.status>=200&&Te.status<=299){if(Te.url!==j.url&&v._onURLRedirect){var Re=v._seekHandler.removeURLParameters(Te.url);v._onURLRedirect(Re)}var ke=Te.headers.get("Content-Length");return ke!=null&&(v._contentLength=parseInt(ke),v._contentLength!==0&&v._onContentLengthKnown&&v._onContentLengthKnown(v._contentLength)),v._pump.call(v,Te.body.getReader())}if(v._status=L.eO.kError,!v._onError)throw new w.Al("FetchStreamLoader: Http code invalid, "+Te.status+" "+Te.statusText);v._onError(L.Xv.HTTP_STATUS_CODE_INVALID,{code:Te.status,msg:Te.statusText})}).catch(function(Te){if(!v._abortController||!v._abortController.signal.aborted){if(v._status=L.eO.kError,!v._onError)throw Te;v._onError(L.Xv.EXCEPTION,{code:-1,msg:Te.message})}})},l.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==L.eO.kBuffering||!b.A.chrome)&&this._abortController)try{this._abortController.abort()}catch{}},l.prototype._pump=function(u){var p=this;return u.read().then(function(v){if(v.done)if(p._contentLength!==null&&p._receivedLength<p._contentLength){p._status=L.eO.kError;var H=L.Xv.EARLY_EOF,j={code:-1,msg:"Fetch stream meet Early-EOF"};if(!p._onError)throw new w.Al(j.msg);p._onError(H,j)}else p._status=L.eO.kComplete,p._onComplete&&p._onComplete(p._range.from,p._range.from+p._receivedLength-1);else{if(p._abortController&&p._abortController.signal.aborted)return void(p._status=L.eO.kComplete);if(p._requestAbort===!0)return p._status=L.eO.kComplete,u.cancel();p._status=L.eO.kBuffering;var ne=v.value.buffer,ie=p._range.from+p._receivedLength;p._receivedLength+=ne.byteLength,p._onDataArrival&&p._onDataArrival(ne,ie,p._receivedLength),p._pump(u)}}).catch(function(v){if(p._abortController&&p._abortController.signal.aborted)p._status=L.eO.kComplete;else if(v.code!==11||!b.A.msedge){p._status=L.eO.kError;var H=0,j=null;if(v.code!==19&&v.message!=="network error"||!(p._contentLength===null||p._contentLength!==null&&p._receivedLength<p._contentLength)?(H=L.Xv.EXCEPTION,j={code:v.code,msg:v.message}):(H=L.Xv.EARLY_EOF,j={code:v.code,msg:"Fetch stream meet Early-EOF"}),!p._onError)throw new w.Al(j.msg);p._onError(H,j)}})},l})(L.HC),O=(function(){var C=function(l,u){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,v){p.__proto__=v}||function(p,v){for(var H in v)Object.prototype.hasOwnProperty.call(v,H)&&(p[H]=v[H])},C(l,u)};return function(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function p(){this.constructor=l}C(l,u),l.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}})(),T=(function(C){function l(u,p){var v=C.call(this,"xhr-moz-chunked-loader")||this;return v.TAG="MozChunkedLoader",v._seekHandler=u,v._config=p,v._needStash=!0,v._xhr=null,v._requestAbort=!1,v._contentLength=null,v._receivedLength=0,v}return O(l,C),l.isSupported=function(){try{var u=new XMLHttpRequest;return u.open("GET","https://example.com",!0),u.responseType="moz-chunked-arraybuffer",u.responseType==="moz-chunked-arraybuffer"}catch(p){return Z.A.w("MozChunkedLoader",p.message),!1}},l.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),C.prototype.destroy.call(this)},l.prototype.open=function(u,p){this._dataSource=u,this._range=p;var v=u.url;this._config.reuseRedirectedURL&&u.redirectedURL!=null&&(v=u.redirectedURL);var H=this._seekHandler.getConfig(v,p);this._requestURL=H.url;var j=this._xhr=new XMLHttpRequest;if(j.open("GET",H.url,!0),j.responseType="moz-chunked-arraybuffer",j.onreadystatechange=this._onReadyStateChange.bind(this),j.onprogress=this._onProgress.bind(this),j.onloadend=this._onLoadEnd.bind(this),j.onerror=this._onXhrError.bind(this),u.withCredentials&&(j.withCredentials=!0),typeof H.headers=="object"){var ne=H.headers;for(var ie in ne)ne.hasOwnProperty(ie)&&j.setRequestHeader(ie,ne[ie])}if(typeof this._config.headers=="object")for(var ie in ne=this._config.headers)ne.hasOwnProperty(ie)&&j.setRequestHeader(ie,ne[ie]);this._status=L.eO.kConnecting,j.send()},l.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=L.eO.kComplete},l.prototype._onReadyStateChange=function(u){var p=u.target;if(p.readyState===2){if(p.responseURL!=null&&p.responseURL!==this._requestURL&&this._onURLRedirect){var v=this._seekHandler.removeURLParameters(p.responseURL);this._onURLRedirect(v)}if(p.status!==0&&(p.status<200||p.status>299)){if(this._status=L.eO.kError,!this._onError)throw new w.Al("MozChunkedLoader: Http code invalid, "+p.status+" "+p.statusText);this._onError(L.Xv.HTTP_STATUS_CODE_INVALID,{code:p.status,msg:p.statusText})}else this._status=L.eO.kBuffering}},l.prototype._onProgress=function(u){if(this._status!==L.eO.kError){this._contentLength===null&&u.total!==null&&u.total!==0&&(this._contentLength=u.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var p=u.target.response,v=this._range.from+this._receivedLength;this._receivedLength+=p.byteLength,this._onDataArrival&&this._onDataArrival(p,v,this._receivedLength)}},l.prototype._onLoadEnd=function(u){this._requestAbort!==!0?this._status!==L.eO.kError&&(this._status=L.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},l.prototype._onXhrError=function(u){this._status=L.eO.kError;var p=0,v=null;if(this._contentLength&&u.loaded<this._contentLength?(p=L.Xv.EARLY_EOF,v={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(p=L.Xv.EXCEPTION,v={code:-1,msg:u.constructor.name+" "+u.type}),!this._onError)throw new w.Al(v.msg);this._onError(p,v)},l})(L.HC),A=(function(){var C=function(l,u){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,v){p.__proto__=v}||function(p,v){for(var H in v)Object.prototype.hasOwnProperty.call(v,H)&&(p[H]=v[H])},C(l,u)};return function(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function p(){this.constructor=l}C(l,u),l.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}})(),I=(function(C){function l(u,p){var v=C.call(this,"xhr-range-loader")||this;return v.TAG="RangeLoader",v._seekHandler=u,v._config=p,v._needStash=!1,v._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],v._currentChunkSizeKB=384,v._currentSpeedNormalized=0,v._zeroSpeedChunkCount=0,v._xhr=null,v._speedSampler=new c,v._requestAbort=!1,v._waitForTotalLength=!1,v._totalLengthReceived=!1,v._currentRequestURL=null,v._currentRedirectedURL=null,v._currentRequestRange=null,v._totalLength=null,v._contentLength=null,v._receivedLength=0,v._lastTimeLoaded=0,v}return A(l,C),l.isSupported=function(){try{var u=new XMLHttpRequest;return u.open("GET","https://example.com",!0),u.responseType="arraybuffer",u.responseType==="arraybuffer"}catch(p){return Z.A.w("RangeLoader",p.message),!1}},l.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),C.prototype.destroy.call(this)},Object.defineProperty(l.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),l.prototype.open=function(u,p){this._dataSource=u,this._range=p,this._status=L.eO.kConnecting;var v=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(v=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||v?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))},l.prototype._openSubRange=function(){var u=1024*this._currentChunkSizeKB,p=this._range.from+this._receivedLength,v=p+u;this._contentLength!=null&&v-this._range.from>=this._contentLength&&(v=this._range.from+this._contentLength-1),this._currentRequestRange={from:p,to:v},this._internalOpen(this._dataSource,this._currentRequestRange)},l.prototype._internalOpen=function(u,p){this._lastTimeLoaded=0;var v=u.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?v=this._currentRedirectedURL:u.redirectedURL!=null&&(v=u.redirectedURL));var H=this._seekHandler.getConfig(v,p);this._currentRequestURL=H.url;var j=this._xhr=new XMLHttpRequest;if(j.open("GET",H.url,!0),j.responseType="arraybuffer",j.onreadystatechange=this._onReadyStateChange.bind(this),j.onprogress=this._onProgress.bind(this),j.onload=this._onLoad.bind(this),j.onerror=this._onXhrError.bind(this),u.withCredentials&&(j.withCredentials=!0),typeof H.headers=="object"){var ne=H.headers;for(var ie in ne)ne.hasOwnProperty(ie)&&j.setRequestHeader(ie,ne[ie])}if(typeof this._config.headers=="object")for(var ie in ne=this._config.headers)ne.hasOwnProperty(ie)&&j.setRequestHeader(ie,ne[ie]);j.send()},l.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=L.eO.kComplete},l.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},l.prototype._onReadyStateChange=function(u){var p=u.target;if(p.readyState===2){if(p.responseURL!=null){var v=this._seekHandler.removeURLParameters(p.responseURL);p.responseURL!==this._currentRequestURL&&v!==this._currentRedirectedURL&&(this._currentRedirectedURL=v,this._onURLRedirect&&this._onURLRedirect(v))}if(p.status>=200&&p.status<=299){if(this._waitForTotalLength)return;this._status=L.eO.kBuffering}else{if(this._status=L.eO.kError,!this._onError)throw new w.Al("RangeLoader: Http code invalid, "+p.status+" "+p.statusText);this._onError(L.Xv.HTTP_STATUS_CODE_INVALID,{code:p.status,msg:p.statusText})}}},l.prototype._onProgress=function(u){if(this._status!==L.eO.kError){if(this._contentLength===null){var p=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,p=!0;var v=u.total;this._internalAbort(),v!=null&v!==0&&(this._totalLength=v)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,p)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var H=u.loaded-this._lastTimeLoaded;this._lastTimeLoaded=u.loaded,this._speedSampler.addBytes(H)}},l.prototype._normalizeSpeed=function(u){var p=this._chunkSizeKBList,v=p.length-1,H=0,j=0,ne=v;if(u<p[0])return p[0];for(;j<=ne;){if((H=j+Math.floor((ne-j)/2))===v||u>=p[H]&&u<p[H+1])return p[H];p[H]<u?j=H+1:ne=H-1}},l.prototype._onLoad=function(u){if(this._status!==L.eO.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var p=this._speedSampler.lastSecondKBps;if(p===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(p=this._speedSampler.currentKBps)),p!==0){var v=this._normalizeSpeed(p);this._currentSpeedNormalized!==v&&(this._currentSpeedNormalized=v,this._currentChunkSizeKB=v)}var H=u.target.response,j=this._range.from+this._receivedLength;this._receivedLength+=H.byteLength;var ne=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():ne=!0,this._onDataArrival&&this._onDataArrival(H,j,this._receivedLength),ne&&(this._status=L.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},l.prototype._onXhrError=function(u){this._status=L.eO.kError;var p=0,v=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(p=L.Xv.EARLY_EOF,v={code:-1,msg:"RangeLoader meet Early-Eof"}):(p=L.Xv.EXCEPTION,v={code:-1,msg:u.constructor.name+" "+u.type}),!this._onError)throw new w.Al(v.msg);this._onError(p,v)},l})(L.HC),F=(function(){var C=function(l,u){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,v){p.__proto__=v}||function(p,v){for(var H in v)Object.prototype.hasOwnProperty.call(v,H)&&(p[H]=v[H])},C(l,u)};return function(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function p(){this.constructor=l}C(l,u),l.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}})(),E=(function(C){function l(){var u=C.call(this,"websocket-loader")||this;return u.TAG="WebSocketLoader",u._needStash=!0,u._ws=null,u._requestAbort=!1,u._receivedLength=0,u}return F(l,C),l.isSupported=function(){try{return self.WebSocket!==void 0}catch{return!1}},l.prototype.destroy=function(){this._ws&&this.abort(),C.prototype.destroy.call(this)},l.prototype.open=function(u){try{var p=this._ws=new self.WebSocket(u.url);p.binaryType="arraybuffer",p.onopen=this._onWebSocketOpen.bind(this),p.onclose=this._onWebSocketClose.bind(this),p.onmessage=this._onWebSocketMessage.bind(this),p.onerror=this._onWebSocketError.bind(this),this._status=L.eO.kConnecting}catch(H){this._status=L.eO.kError;var v={code:H.code,msg:H.message};if(!this._onError)throw new w.Al(v.msg);this._onError(L.Xv.EXCEPTION,v)}},l.prototype.abort=function(){var u=this._ws;!u||u.readyState!==0&&u.readyState!==1||(this._requestAbort=!0,u.close()),this._ws=null,this._status=L.eO.kComplete},l.prototype._onWebSocketOpen=function(u){this._status=L.eO.kBuffering},l.prototype._onWebSocketClose=function(u){this._requestAbort!==!0?(this._status=L.eO.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1},l.prototype._onWebSocketMessage=function(u){var p=this;if(u.data instanceof ArrayBuffer)this._dispatchArrayBuffer(u.data);else if(u.data instanceof Blob){var v=new FileReader;v.onload=function(){p._dispatchArrayBuffer(v.result)},v.readAsArrayBuffer(u.data)}else{this._status=L.eO.kError;var H={code:-1,msg:"Unsupported WebSocket message type: "+u.data.constructor.name};if(!this._onError)throw new w.Al(H.msg);this._onError(L.Xv.EXCEPTION,H)}},l.prototype._dispatchArrayBuffer=function(u){var p=u,v=this._receivedLength;this._receivedLength+=p.byteLength,this._onDataArrival&&this._onDataArrival(p,v,this._receivedLength)},l.prototype._onWebSocketError=function(u){this._status=L.eO.kError;var p={code:u.code,msg:u.message};if(!this._onError)throw new w.Al(p.msg);this._onError(L.Xv.EXCEPTION,p)},l})(L.HC),K=(function(){function C(l){this._zeroStart=l||!1}return C.prototype.getConfig=function(l,u){var p={};return u.from!==0||u.to!==-1?p.Range=u.to!==-1?"bytes=".concat(u.from.toString(),"-").concat(u.to.toString()):"bytes=".concat(u.from.toString(),"-"):this._zeroStart&&(p.Range="bytes=0-"),{url:l,headers:p}},C.prototype.removeURLParameters=function(l){return l},C})(),V=(function(){function C(l,u){this._startName=l,this._endName=u}return C.prototype.getConfig=function(l,u){var p=l;if(u.from!==0||u.to!==-1){var v=!0;p.indexOf("?")===-1&&(p+="?",v=!1),v&&(p+="&"),p+="".concat(this._startName,"=").concat(u.from.toString()),u.to!==-1&&(p+="&".concat(this._endName,"=").concat(u.to.toString()))}return{url:p,headers:{}}},C.prototype.removeURLParameters=function(l){var u=l.split("?")[0],p=void 0,v=l.indexOf("?");v!==-1&&(p=l.substring(v+1));var H="";if(p!=null&&p.length>0)for(var j=p.split("&"),ne=0;ne<j.length;ne++){var ie=j[ne].split("="),ce=ne>0;ie[0]!==this._startName&&ie[0]!==this._endName&&(ce&&(H+="&"),H+=j[ne])}return H.length===0?u:u+"?"+H},C})(),Y=(function(){function C(l,u,p){this.TAG="IOController",this._config=u,this._extraData=p,this._stashInitialSize=65536,u.stashInitialSize!=null&&u.stashInitialSize>0&&(this._stashInitialSize=u.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=Math.max(this._stashSize,3145728),this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,u.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=l,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(l.url),this._refTotalLength=l.filesize?l.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new c,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return C.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},C.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},C.prototype.isPaused=function(){return this._paused},Object.defineProperty(C.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"extraData",{get:function(){return this._extraData},set:function(l){this._extraData=l},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(l){this._onDataArrival=l},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(l){this._onSeeked=l},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onError",{get:function(){return this._onError},set:function(l){this._onError=l},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onComplete",{get:function(){return this._onComplete},set:function(l){this._onComplete=l},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(l){this._onRedirect=l},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(l){this._onRecoveredEarlyEof=l},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"hasRedirect",{get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"currentSpeed",{get:function(){return this._loaderClass===I?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),C.prototype._selectSeekHandler=function(){var l=this._config;if(l.seekType==="range")this._seekHandler=new K(this._config.rangeLoadZeroStart);else if(l.seekType==="param"){var u=l.seekParamStart||"bstart",p=l.seekParamEnd||"bend";this._seekHandler=new V(u,p)}else{if(l.seekType!=="custom")throw new w.Qn("Invalid seekType in config: ".concat(l.seekType));if(typeof l.customSeekHandler!="function")throw new w.Qn("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new l.customSeekHandler}},C.prototype._selectLoader=function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=E;else if(g.isSupported())this._loaderClass=g;else if(T.isSupported())this._loaderClass=T;else{if(!I.isSupported())throw new w.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=I}},C.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},C.prototype.open=function(l){this._currentRange={from:0,to:-1},l&&(this._currentRange.from=l),this._speedSampler.reset(),l||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},C.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},C.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},C.prototype.resume=function(){if(this._paused){this._paused=!1;var l=this._resumeFrom;this._resumeFrom=0,this._internalSeek(l,!0)}},C.prototype.seek=function(l){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(l,!0)},C.prototype._internalSeek=function(l,u){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(u),this._loader.destroy(),this._loader=null;var p={from:l,to:-1};this._currentRange={from:p.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,p),this._onSeeked&&this._onSeeked()},C.prototype.updateUrl=function(l){if(!l||typeof l!="string"||l.length===0)throw new w.Qn("Url must be a non-empty string!");this._dataSource.url=l},C.prototype._expandBuffer=function(l){for(var u=this._stashSize;u+1048576<l;)u*=2;if((u+=1048576)!==this._bufferSize){var p=new ArrayBuffer(u);if(this._stashUsed>0){var v=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(p,0,u).set(v,0)}this._stashBuffer=p,this._bufferSize=u}},C.prototype._normalizeSpeed=function(l){var u=this._speedNormalizeList,p=u.length-1,v=0,H=0,j=p;if(l<u[0])return u[0];for(;H<=j;){if((v=H+Math.floor((j-H)/2))===p||l>=u[v]&&l<u[v+1])return u[v];u[v]<l?H=v+1:j=v-1}},C.prototype._adjustStashSize=function(l){var u=0;(u=this._config.isLive?l/8:l<512?l:l>=512&&l<=1024?Math.floor(1.5*l):2*l)>8192&&(u=8192);var p=1024*u+1048576;this._bufferSize<p&&this._expandBuffer(p),this._stashSize=1024*u},C.prototype._dispatchChunks=function(l,u){return this._currentRange.to=u+l.byteLength-1,this._onDataArrival(l,u)},C.prototype._onURLRedirect=function(l){this._redirectedURL=l,this._onRedirect&&this._onRedirect(l)},C.prototype._onContentLengthKnown=function(l){l&&this._fullRequestFlag&&(this._totalLength=l,this._fullRequestFlag=!1)},C.prototype._onLoaderChunkArrival=function(l,u,p){if(!this._onDataArrival)throw new w.j4("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(l.byteLength);var v=this._speedSampler.lastSecondKBps;if(v!==0){var H=this._normalizeSpeed(v);this._speedNormalized!==H&&(this._speedNormalized=H,this._adjustStashSize(H))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=u),this._stashUsed+l.byteLength<=this._stashSize)(ie=new Uint8Array(this._stashBuffer,0,this._stashSize)).set(new Uint8Array(l),this._stashUsed),this._stashUsed+=l.byteLength;else if(ie=new Uint8Array(this._stashBuffer,0,this._bufferSize),this._stashUsed>0){var j=this._stashBuffer.slice(0,this._stashUsed);(ce=this._dispatchChunks(j,this._stashByteStart))<j.byteLength?ce>0&&(Se=new Uint8Array(j,ce),ie.set(Se,0),this._stashUsed=Se.byteLength,this._stashByteStart+=ce):(this._stashUsed=0,this._stashByteStart+=ce),this._stashUsed+l.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+l.byteLength),ie=new Uint8Array(this._stashBuffer,0,this._bufferSize)),ie.set(new Uint8Array(l),this._stashUsed),this._stashUsed+=l.byteLength}else(ce=this._dispatchChunks(l,u))<l.byteLength&&((ne=l.byteLength-ce)>this._bufferSize&&(this._expandBuffer(ne),ie=new Uint8Array(this._stashBuffer,0,this._bufferSize)),ie.set(new Uint8Array(l,ce),0),this._stashUsed+=ne,this._stashByteStart=u+ce);else if(this._stashUsed===0){var ne;(ce=this._dispatchChunks(l,u))<l.byteLength&&((ne=l.byteLength-ce)>this._bufferSize&&this._expandBuffer(ne),(ie=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(l,ce),0),this._stashUsed+=ne,this._stashByteStart=u+ce)}else{var ie,ce;if(this._stashUsed+l.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+l.byteLength),(ie=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(l),this._stashUsed),this._stashUsed+=l.byteLength,(ce=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))<this._stashUsed&&ce>0){var Se=new Uint8Array(this._stashBuffer,ce);ie.set(Se,0)}this._stashUsed-=ce,this._stashByteStart+=ce}}},C.prototype._flushStashBuffer=function(l){if(this._stashUsed>0){var u=this._stashBuffer.slice(0,this._stashUsed),p=this._dispatchChunks(u,this._stashByteStart),v=u.byteLength-p;if(p<u.byteLength){if(!l){if(p>0){var H=new Uint8Array(this._stashBuffer,0,this._bufferSize),j=new Uint8Array(u,p);H.set(j,0),this._stashUsed=j.byteLength,this._stashByteStart+=p}return 0}Z.A.w(this.TAG,"".concat(v," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,v}return 0},C.prototype._onLoaderComplete=function(l,u){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},C.prototype._onLoaderError=function(l,u){switch(Z.A.e(this.TAG,"Loader error, code = ".concat(u.code,", msg = ").concat(u.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,l=L.Xv.UNRECOVERABLE_EARLY_EOF),l){case L.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var p=this._currentRange.to+1;p<this._totalLength&&(Z.A.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(p,!1));return}l=L.Xv.UNRECOVERABLE_EARLY_EOF;case L.Xv.UNRECOVERABLE_EARLY_EOF:case L.Xv.CONNECTING_TIMEOUT:case L.Xv.HTTP_STATUS_CODE_INVALID:case L.Xv.EXCEPTION:}if(!this._onError)throw new w.Al("IOException: "+u.msg);this._onError(l,u)},C})()},470:function(he,te,B){"use strict";B.d(te,{HC:function(){return L},Xv:function(){return c},eO:function(){return Z}});var P=B(867),Z={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},c={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},L=(function(){function b(w){this._type=w||"undefined",this._status=Z.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return b.prototype.destroy=function(){this._status=Z.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},b.prototype.isWorking=function(){return this._status===Z.kConnecting||this._status===Z.kBuffering},Object.defineProperty(b.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(w){this._onContentLengthKnown=w},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(w){this._onURLRedirect=w},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(w){this._onDataArrival=w},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onError",{get:function(){return this._onError},set:function(w){this._onError=w},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onComplete",{get:function(){return this._onComplete},set:function(w){this._onComplete=w},enumerable:!1,configurable:!0}),b.prototype.open=function(w,M){throw new P.Xu("Unimplemented abstract function!")},b.prototype.abort=function(){throw new P.Xu("Unimplemented abstract function!")},b})()},311:function(he,te,B){"use strict";B.d(te,{default:function(){return ke}});var P=B(811),Z=B(653),c={enableWorker:!1,enableWorkerForMSE:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyChasingOnPaused:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,liveSync:!1,liveSyncMaxLatency:1.2,liveSyncTargetLatency:.8,liveSyncPlaybackRate:1.2,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function L(){return Object.assign({},c)}var b=(function(){function k(){}return k.supportMSEH264Playback=function(){var h='video/mp4; codecs="avc1.42E01E,mp4a.40.2"',R=self.MediaSource&&self.MediaSource.isTypeSupported(h),G=self.ManagedMediaSource&&self.ManagedMediaSource.isTypeSupported(h);return R||G},k.supportMSEH265Playback=function(){var h='video/mp4; codecs="hvc1.1.6.L93.B0"',R=self.MediaSource&&self.MediaSource.isTypeSupported(h),G=self.ManagedMediaSource&&self.ManagedMediaSource.isTypeSupported(h);return R||G},k.supportNetworkStreamIO=function(){var h=new Z.A({},L()),R=h.loaderType;return h.destroy(),R=="fetch-stream-loader"||R=="xhr-moz-chunked-loader"},k.getNetworkLoaderTypeName=function(){var h=new Z.A({},L()),R=h.loaderType;return h.destroy(),R},k.supportNativeMediaPlayback=function(h){k.videoElement??=window.document.createElement("video");var R=k.videoElement.canPlayType(h);return R==="probably"||R=="maybe"},k.getFeatureList=function(){var h={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return h.msePlayback=k.supportMSEH264Playback(),h.networkStreamIO=k.supportNetworkStreamIO(),h.networkLoaderName=k.getNetworkLoaderTypeName(),h.mseLivePlayback=h.msePlayback&&h.networkStreamIO,h.mseH265Playback=k.supportMSEH265Playback(),h.nativeMP4H264Playback=k.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),h.nativeMP4H265Playback=k.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),h.nativeWebmVP8Playback=k.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),h.nativeWebmVP9Playback=k.supportNativeMediaPlayback('video/webm; codecs="vp9"'),h},k})(),w=B(470),M=B(856),g=B(7),O=B.n(g),T=B(346),A=B(117),I=B(527),F=B(403),E=B(355),K=B(867),V=B(726),Y=B(994),C=B(47),l=(function(){function k(h,R,G){this.TAG="SeekingHandler",this._config=null,this._media_element=null,this._always_seek_keyframe=!1,this._on_unbuffered_seek=null,this._request_set_current_time=!1,this._seek_request_record_clocktime=null,this._idr_sample_list=new C.EX,this.e=null,this._config=h,this._media_element=R,this._on_unbuffered_seek=G,this.e={onMediaSeeking:this._onMediaSeeking.bind(this)};var ae=Y.A.chrome&&(Y.A.version.major<50||Y.A.version.major===50&&Y.A.version.build<2661);this._always_seek_keyframe=!!(ae||Y.A.msedge||Y.A.msie),this._always_seek_keyframe&&(this._config.accurateSeek=!1),this._media_element.addEventListener("seeking",this.e.onMediaSeeking)}return k.prototype.destroy=function(){this._idr_sample_list.clear(),this._idr_sample_list=null,this._media_element.removeEventListener("seeking",this.e.onMediaSeeking),this._media_element=null,this._on_unbuffered_seek=null},k.prototype.seek=function(h){var R=this._isPositionBuffered(h),G=!1;if(h<1&&this._media_element.buffered.length>0){var ae=this._media_element.buffered.start(0);(ae<1&&h<ae||Y.A.safari)&&(G=!0,h=Y.A.safari?.1:ae)}if(G)this.directSeek(h);else if(R)if(this._always_seek_keyframe){var de=this._getNearestKeyframe(Math.floor(1e3*h));de!=null&&(h=de.dts/1e3),this.directSeek(h)}else this.directSeek(h);else this._idr_sample_list.clear(),this._on_unbuffered_seek(Math.floor(1e3*h)),this._config.accurateSeek&&this.directSeek(h)},k.prototype.directSeek=function(h){this._request_set_current_time=!0,this._media_element.currentTime=h},k.prototype.appendSyncPoints=function(h){this._idr_sample_list.appendArray(h)},k.prototype._onMediaSeeking=function(h){if(this._request_set_current_time)this._request_set_current_time=!1;else{var R=this._media_element.currentTime,G=this._media_element.buffered;if(R<1&&G.length>0){var ae=G.start(0);if(ae<1&&R<ae||Y.A.safari){var de=Y.A.safari?.1:ae;this.directSeek(de);return}}if(this._isPositionBuffered(R)){if(this._always_seek_keyframe){var ge=this._getNearestKeyframe(Math.floor(1e3*R));ge!=null&&(R=ge.dts/1e3,this.directSeek(R))}}else this._seek_request_record_clocktime=k._getClockTime(),window.setTimeout(this._pollAndApplyUnbufferedSeek.bind(this),50)}},k.prototype._pollAndApplyUnbufferedSeek=function(){if(this._seek_request_record_clocktime!=null)if(this._seek_request_record_clocktime<=k._getClockTime()-100){var h=this._media_element.currentTime;this._seek_request_record_clocktime=null,this._isPositionBuffered(h)||(this._idr_sample_list.clear(),this._on_unbuffered_seek(Math.floor(1e3*h)),this._config.accurateSeek&&this.directSeek(h))}else window.setTimeout(this._pollAndApplyUnbufferedSeek.bind(this),50)},k.prototype._isPositionBuffered=function(h){for(var R=this._media_element.buffered,G=0;G<R.length;G++){var ae=R.start(G),de=R.end(G);if(h>=ae&&h<de)return!0}return!1},k.prototype._getNearestKeyframe=function(h){return this._idr_sample_list.getLastSyncPointBeforeDts(h)},k._getClockTime=function(){return self.performance&&self.performance.now?self.performance.now():Date.now()},k})(),u=(function(){function k(h,R,G,ae){this.TAG="LoadingController",this._config=null,this._media_element=null,this._on_pause_transmuxer=null,this._on_resume_transmuxer=null,this._paused=!1,this.e=null,this._config=h,this._media_element=R,this._on_pause_transmuxer=G,this._on_resume_transmuxer=ae,this.e={onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this)}}return k.prototype.destroy=function(){this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this.e=null,this._media_element=null,this._config=null,this._on_pause_transmuxer=null,this._on_resume_transmuxer=null},k.prototype.notifyBufferedPositionChanged=function(h){!this._config.isLive&&this._config.lazyLoad&&(h==null?this._suspendTransmuxerIfNeeded():this._suspendTransmuxerIfBufferedPositionExceeded(h))},k.prototype._onMediaTimeUpdate=function(h){this._paused&&this._resumeTransmuxerIfNeeded()},k.prototype._suspendTransmuxerIfNeeded=function(){for(var h=this._media_element.buffered,R=this._media_element.currentTime,G=0,ae=0;ae<h.length;ae++){var de=h.start(ae),ge=h.end(ae);if(de<=R&&R<ge){G=ge;break}}G>0&&this._suspendTransmuxerIfBufferedPositionExceeded(G)},k.prototype._suspendTransmuxerIfBufferedPositionExceeded=function(h){h>=this._media_element.currentTime+this._config.lazyLoadMaxDuration&&!this._paused&&(M.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this.suspendTransmuxer(),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate))},k.prototype.suspendTransmuxer=function(){this._paused=!0,this._on_pause_transmuxer()},k.prototype._resumeTransmuxerIfNeeded=function(){for(var h=this._media_element.buffered,R=this._media_element.currentTime,G=this._config.lazyLoadRecoverDuration,ae=!1,de=0;de<h.length;de++){var ge=h.start(de),N=h.end(de);if(R>=ge&&R<N){R>=N-G&&(ae=!0);break}}ae&&(M.A.v(this.TAG,"Continue loading from paused position"),this.resumeTransmuxer(),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate))},k.prototype.resumeTransmuxer=function(){this._paused=!1,this._on_resume_transmuxer()},k})(),p=(function(){function k(h,R){this.TAG="StartupStallJumper",this._media_element=null,this._on_direct_seek=null,this._canplay_received=!1,this.e=null,this._media_element=h,this._on_direct_seek=R,this.e={onMediaCanPlay:this._onMediaCanPlay.bind(this),onMediaStalled:this._onMediaStalled.bind(this),onMediaProgress:this._onMediaProgress.bind(this)},this._media_element.addEventListener("canplay",this.e.onMediaCanPlay),this._media_element.addEventListener("stalled",this.e.onMediaStalled),this._media_element.addEventListener("progress",this.e.onMediaProgress)}return k.prototype.destroy=function(){this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay),this._media_element.removeEventListener("stalled",this.e.onMediaStalled),this._media_element.removeEventListener("progress",this.e.onMediaProgress),this._media_element=null,this._on_direct_seek=null},k.prototype._onMediaCanPlay=function(h){this._canplay_received=!0,this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay)},k.prototype._onMediaStalled=function(h){this._detectAndFixStuckPlayback(!0)},k.prototype._onMediaProgress=function(h){this._detectAndFixStuckPlayback()},k.prototype._detectAndFixStuckPlayback=function(h){var R=this._media_element,G=R.buffered;h||!this._canplay_received||R.readyState<2?G.length>0&&R.currentTime<G.start(0)&&(M.A.w(this.TAG,"Playback seems stuck at ".concat(R.currentTime,", seek to ").concat(G.start(0))),this._on_direct_seek(G.start(0)),this._media_element.removeEventListener("progress",this.e.onMediaProgress)):this._media_element.removeEventListener("progress",this.e.onMediaProgress)},k})(),v=(function(){function k(h,R,G){this._config=null,this._media_element=null,this._on_direct_seek=null,this._config=h,this._media_element=R,this._on_direct_seek=G}return k.prototype.destroy=function(){this._on_direct_seek=null,this._media_element=null,this._config=null},k.prototype.notifyBufferedRangeUpdate=function(){this._chaseLiveLatency()},k.prototype._chaseLiveLatency=function(){var h=this._media_element.buffered,R=this._media_element.currentTime,G=this._media_element.paused;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&h.length!=0&&(this._config.liveBufferLatencyChasingOnPaused||!G)){var ae=h.end(h.length-1);if(ae>this._config.liveBufferLatencyMaxLatency&&ae-R>this._config.liveBufferLatencyMaxLatency){var de=ae-this._config.liveBufferLatencyMinRemain;this._on_direct_seek(de)}}},k})(),H=(function(){function k(h,R){this._config=null,this._media_element=null,this.e=null,this._config=h,this._media_element=R,this.e={onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this)},this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate)}return k.prototype.destroy=function(){this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element=null,this._config=null},k.prototype._onMediaTimeUpdate=function(h){if(this._config.isLive&&this._config.liveSync){var R=this._getCurrentLatency();if(R>this._config.liveSyncMaxLatency){var G=Math.min(2,Math.max(1,this._config.liveSyncPlaybackRate));this._media_element.playbackRate=G}else R>this._config.liveSyncTargetLatency||this._media_element.playbackRate!==1&&this._media_element.playbackRate!==0&&(this._media_element.playbackRate=1)}},k.prototype._getCurrentLatency=function(){if(!this._media_element)return 0;var h=this._media_element.buffered,R=this._media_element.currentTime;return h.length==0?0:h.end(h.length-1)-R},k})(),j=(function(){function k(h,R){this.TAG="PlayerEngineMainThread",this._emitter=new g,this._media_element=null,this._mse_controller=null,this._transmuxer=null,this._pending_seek_time=null,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._mse_source_opened=!1,this._has_pending_load=!1,this._loaded_metadata_received=!1,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=h,this._config=L(),typeof R=="object"&&Object.assign(this._config,R),h.isLive===!0&&(this._config.isLive=!0),this.e={onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this)}}return k.prototype.destroy=function(){this._emitter.emit(A.A.DESTROYING),this._transmuxer&&this.unload(),this._media_element&&this.detachMediaElement(),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},k.prototype.on=function(h,R){var G=this;this._emitter.addListener(h,R),h===A.A.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return G._emitter.emit(A.A.MEDIA_INFO,G.mediaInfo)}):h==A.A.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return G._emitter.emit(A.A.STATISTICS_INFO,G.statisticsInfo)})},k.prototype.off=function(h,R){this._emitter.removeListener(h,R)},k.prototype.attachMediaElement=function(h){var R=this;this._media_element=h,h.src="",h.removeAttribute("src"),h.srcObject=null,h.load(),h.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._mse_controller=new T.A(this._config),this._mse_controller.on(F.A.UPDATE_END,this._onMSEUpdateEnd.bind(this)),this._mse_controller.on(F.A.BUFFER_FULL,this._onMSEBufferFull.bind(this)),this._mse_controller.on(F.A.SOURCE_OPEN,this._onMSESourceOpen.bind(this)),this._mse_controller.on(F.A.ERROR,this._onMSEError.bind(this)),this._mse_controller.on(F.A.START_STREAMING,this._onMSEStartStreaming.bind(this)),this._mse_controller.on(F.A.END_STREAMING,this._onMSEEndStreaming.bind(this)),this._mse_controller.initialize({getCurrentTime:function(){return R._media_element.currentTime},getReadyState:function(){return R._media_element.readyState}}),this._mse_controller.isManagedMediaSource()?(h.disableRemotePlayback=!0,h.srcObject=this._mse_controller.getObject()):h.src=this._mse_controller.getObjectURL()},k.prototype.detachMediaElement=function(){this._media_element&&(this._mse_controller.shutdown(),this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null,this._mse_controller.revokeObjectURL()),this._mse_controller&&(this._mse_controller.destroy(),this._mse_controller=null)},k.prototype.load=function(){var h=this;if(!this._media_element)throw new K.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new K.j4("load() has been called, please call unload() first!");this._has_pending_load||(!this._config.deferLoadAfterSourceOpen||this._mse_source_opened?(this._transmuxer=new I.A(this._media_data_source,this._config),this._transmuxer.on(V.A.INIT_SEGMENT,function(R,G){h._mse_controller.appendInitSegment(G)}),this._transmuxer.on(V.A.MEDIA_SEGMENT,function(R,G){h._mse_controller.appendMediaSegment(G),!h._config.isLive&&R==="video"&&G.data&&G.data.byteLength>0&&"info"in G&&h._seeking_handler.appendSyncPoints(G.info.syncPoints),h._loading_controller.notifyBufferedPositionChanged(G.info.endDts/1e3)}),this._transmuxer.on(V.A.LOADING_COMPLETE,function(){h._mse_controller.endOfStream(),h._emitter.emit(A.A.LOADING_COMPLETE)}),this._transmuxer.on(V.A.RECOVERED_EARLY_EOF,function(){h._emitter.emit(A.A.RECOVERED_EARLY_EOF)}),this._transmuxer.on(V.A.IO_ERROR,function(R,G){h._emitter.emit(A.A.ERROR,E.w.NETWORK_ERROR,R,G)}),this._transmuxer.on(V.A.DEMUX_ERROR,function(R,G){h._emitter.emit(A.A.ERROR,E.w.MEDIA_ERROR,R,G)}),this._transmuxer.on(V.A.MEDIA_INFO,function(R){h._media_info=R,h._emitter.emit(A.A.MEDIA_INFO,Object.assign({},R))}),this._transmuxer.on(V.A.STATISTICS_INFO,function(R){h._statistics_info=h._fillStatisticsInfo(R),h._emitter.emit(A.A.STATISTICS_INFO,Object.assign({},R))}),this._transmuxer.on(V.A.RECOMMEND_SEEKPOINT,function(R){h._media_element&&!h._config.accurateSeek&&h._seeking_handler.directSeek(R/1e3)}),this._transmuxer.on(V.A.METADATA_ARRIVED,function(R){h._emitter.emit(A.A.METADATA_ARRIVED,R)}),this._transmuxer.on(V.A.SCRIPTDATA_ARRIVED,function(R){h._emitter.emit(A.A.SCRIPTDATA_ARRIVED,R)}),this._transmuxer.on(V.A.TIMED_ID3_METADATA_ARRIVED,function(R){h._emitter.emit(A.A.TIMED_ID3_METADATA_ARRIVED,R)}),this._transmuxer.on(V.A.PGS_SUBTITLE_ARRIVED,function(R){h._emitter.emit(A.A.PGS_SUBTITLE_ARRIVED,R)}),this._transmuxer.on(V.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,function(R){h._emitter.emit(A.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,R)}),this._transmuxer.on(V.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,function(R){h._emitter.emit(A.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,R)}),this._transmuxer.on(V.A.SMPTE2038_METADATA_ARRIVED,function(R){h._emitter.emit(A.A.SMPTE2038_METADATA_ARRIVED,R)}),this._transmuxer.on(V.A.SEI_ARRIVED,function(R){h._emitter.emit(A.A.SEI_ARRIVED,R)}),this._transmuxer.on(V.A.SCTE35_METADATA_ARRIVED,function(R){h._emitter.emit(A.A.SCTE35_METADATA_ARRIVED,R)}),this._transmuxer.on(V.A.PES_PRIVATE_DATA_DESCRIPTOR,function(R){h._emitter.emit(A.A.PES_PRIVATE_DATA_DESCRIPTOR,R)}),this._transmuxer.on(V.A.PES_PRIVATE_DATA_ARRIVED,function(R){h._emitter.emit(A.A.PES_PRIVATE_DATA_ARRIVED,R)}),this._seeking_handler=new l(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new u(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new p(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new v(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new H(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0),this._transmuxer.open()):this._has_pending_load=!0)},k.prototype.unload=function(){var h,R,G,ae,de,ge,N,q,J;(h=this._media_element)===null||h===void 0||h.pause(),(R=this._live_latency_synchronizer)===null||R===void 0||R.destroy(),this._live_latency_synchronizer=null,(G=this._live_latency_chaser)===null||G===void 0||G.destroy(),this._live_latency_chaser=null,(ae=this._startup_stall_jumper)===null||ae===void 0||ae.destroy(),this._startup_stall_jumper=null,(de=this._loading_controller)===null||de===void 0||de.destroy(),this._loading_controller=null,(ge=this._seeking_handler)===null||ge===void 0||ge.destroy(),this._seeking_handler=null,(N=this._mse_controller)===null||N===void 0||N.flush(),(q=this._transmuxer)===null||q===void 0||q.close(),(J=this._transmuxer)===null||J===void 0||J.destroy(),this._transmuxer=null},k.prototype.play=function(){return this._media_element.play()},k.prototype.pause=function(){this._media_element.pause()},k.prototype.seek=function(h){this._media_element&&this._seeking_handler?this._seeking_handler.seek(h):this._pending_seek_time=h},Object.defineProperty(k.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),k.prototype._onMSESourceOpen=function(){this._mse_source_opened=!0,this._has_pending_load&&(this._has_pending_load=!1,this.load())},k.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},k.prototype._onMSEBufferFull=function(){M.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},k.prototype._onMSEError=function(h){this._emitter.emit(A.A.ERROR,E.w.MEDIA_ERROR,E.v.MEDIA_MSE_ERROR,h)},k.prototype._onMSEStartStreaming=function(){this._loaded_metadata_received&&(this._config.isLive||(M.A.v(this.TAG,"Resume transmuxing task due to ManagedMediaSource onStartStreaming"),this._loading_controller.resumeTransmuxer()))},k.prototype._onMSEEndStreaming=function(){this._config.isLive||(M.A.v(this.TAG,"Suspend transmuxing task due to ManagedMediaSource onEndStreaming"),this._loading_controller.suspendTransmuxer())},k.prototype._onMediaLoadedMetadata=function(h){this._loaded_metadata_received=!0,this._pending_seek_time!=null&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},k.prototype._onRequestDirectSeek=function(h){this._seeking_handler.directSeek(h)},k.prototype._onRequiredUnbufferedSeek=function(h){this._mse_controller.flush(),this._transmuxer.seek(h)},k.prototype._onRequestPauseTransmuxer=function(){this._transmuxer.pause()},k.prototype._onRequestResumeTransmuxer=function(){this._transmuxer.resume()},k.prototype._fillStatisticsInfo=function(h){if(h.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return h;var R=!0,G=0,ae=0;if(this._media_element.getVideoPlaybackQuality){var de=this._media_element.getVideoPlaybackQuality();G=de.totalVideoFrames,ae=de.droppedVideoFrames}else this._media_element.webkitDecodedFrameCount!=null?(G=this._media_element.webkitDecodedFrameCount,ae=this._media_element.webkitDroppedFrameCount):R=!1;return R&&(h.decodedFrames=G,h.droppedFrames=ae),h},k})(),ne=B(861),ie=B(947),ce=(function(){function k(h,R){this.TAG="PlayerEngineDedicatedThread",this._emitter=new g,this._media_element=null,this._worker_destroying=!1,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._pending_seek_time=null,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=h,this._config=L(),typeof R=="object"&&Object.assign(this._config,R),h.isLive===!0&&(this._config.isLive=!0),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this),onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this),onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this),onMediaReadyStateChanged:this._onMediaReadyStateChange.bind(this)},ie.A.registerListener(this.e.onLoggingConfigChanged),this._worker=ne(877,{all:!0}),this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",media_data_source:this._media_data_source,config:this._config}),this._worker.postMessage({cmd:"logging_config",logging_config:ie.A.getConfig()})}return k.isSupported=function(){return!!(self.Worker&&(self.MediaSource&&"canConstructInDedicatedWorker"in self.MediaSource&&self.MediaSource.canConstructInDedicatedWorker===!0||self.ManagedMediaSource&&"canConstructInDedicatedWorker"in self.ManagedMediaSource&&self.ManagedMediaSource.canConstructInDedicatedWorker===!0))},k.prototype.destroy=function(){this._emitter.emit(A.A.DESTROYING),this.unload(),this.detachMediaElement(),this._worker_destroying=!0,this._worker.postMessage({cmd:"destroy"}),ie.A.removeListener(this.e.onLoggingConfigChanged),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},k.prototype.on=function(h,R){var G=this;this._emitter.addListener(h,R),h===A.A.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return G._emitter.emit(A.A.MEDIA_INFO,G.mediaInfo)}):h==A.A.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return G._emitter.emit(A.A.STATISTICS_INFO,G.statisticsInfo)})},k.prototype.off=function(h,R){this._emitter.removeListener(h,R)},k.prototype.attachMediaElement=function(h){this._media_element=h,this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.addEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._worker.postMessage({cmd:"initialize_mse"})},k.prototype.detachMediaElement=function(){this._worker.postMessage({cmd:"shutdown_mse"}),this._media_element&&(this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.removeEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null)},k.prototype.load=function(){this._worker.postMessage({cmd:"load"}),this._seeking_handler=new l(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new u(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new p(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new v(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new H(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0)},k.prototype.unload=function(){var h,R,G,ae,de,ge;(h=this._media_element)===null||h===void 0||h.pause(),this._worker.postMessage({cmd:"unload"}),(R=this._live_latency_synchronizer)===null||R===void 0||R.destroy(),this._live_latency_synchronizer=null,(G=this._live_latency_chaser)===null||G===void 0||G.destroy(),this._live_latency_chaser=null,(ae=this._startup_stall_jumper)===null||ae===void 0||ae.destroy(),this._startup_stall_jumper=null,(de=this._loading_controller)===null||de===void 0||de.destroy(),this._loading_controller=null,(ge=this._seeking_handler)===null||ge===void 0||ge.destroy(),this._seeking_handler=null},k.prototype.play=function(){return this._media_element.play()},k.prototype.pause=function(){this._media_element.pause()},k.prototype.seek=function(h){this._media_element&&this._seeking_handler?this._seeking_handler.seek(h):this._pending_seek_time=h},Object.defineProperty(k.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),k.prototype._onLoggingConfigChanged=function(h){var R;(R=this._worker)===null||R===void 0||R.postMessage({cmd:"logging_config",logging_config:h})},k.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},k.prototype._onMSEBufferFull=function(){M.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},k.prototype._onMediaLoadedMetadata=function(h){this._pending_seek_time!=null&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},k.prototype._onRequestDirectSeek=function(h){this._seeking_handler.directSeek(h)},k.prototype._onRequiredUnbufferedSeek=function(h){this._worker.postMessage({cmd:"unbuffered_seek",milliseconds:h})},k.prototype._onRequestPauseTransmuxer=function(){this._worker.postMessage({cmd:"pause_transmuxer"})},k.prototype._onRequestResumeTransmuxer=function(){this._worker.postMessage({cmd:"resume_transmuxer"})},k.prototype._onMediaTimeUpdate=function(h){this._worker.postMessage({cmd:"timeupdate",current_time:h.target.currentTime})},k.prototype._onMediaReadyStateChange=function(h){this._worker.postMessage({cmd:"readystatechange",ready_state:h.target.readyState})},k.prototype._onWorkerMessage=function(h){var R,G=h.data,ae=G.msg;if(ae=="destroyed"||this._worker_destroying)return this._worker_destroying=!1,(R=this._worker)===null||R===void 0||R.terminate(),void(this._worker=null);switch(ae){case"mse_init":var de=G;typeof self.ManagedMediaSource=="function"&&typeof self.MediaSource!="function"&&(this._media_element.disableRemotePlayback=!0),this._media_element.srcObject=de.handle;break;case"mse_event":(de=G).event==F.A.UPDATE_END?this._onMSEUpdateEnd():de.event==F.A.BUFFER_FULL&&this._onMSEBufferFull();break;case"transmuxing_event":if((de=G).event==V.A.MEDIA_INFO){var ge=G;this._media_info=ge.info,this._emitter.emit(A.A.MEDIA_INFO,Object.assign({},ge.info))}else if(de.event==V.A.STATISTICS_INFO){var N=G;this._statistics_info=this._fillStatisticsInfo(N.info),this._emitter.emit(A.A.STATISTICS_INFO,Object.assign({},N.info))}else if(de.event==V.A.RECOMMEND_SEEKPOINT){var q=G;this._media_element&&!this._config.accurateSeek&&this._seeking_handler.directSeek(q.milliseconds/1e3)}break;case"player_event":if((de=G).event==A.A.ERROR){var J=G;this._emitter.emit(A.A.ERROR,J.error_type,J.error_detail,J.info)}else if("extraData"in de){var se=G;this._emitter.emit(se.event,se.extraData)}break;case"logcat_callback":de=G,M.A.emitter.emit("log",de.type,de.logcat);break;case"buffered_position_changed":de=G,this._loading_controller.notifyBufferedPositionChanged(de.buffered_position_milliseconds/1e3)}},k.prototype._fillStatisticsInfo=function(h){if(h.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return h;var R=!0,G=0,ae=0;if(this._media_element.getVideoPlaybackQuality){var de=this._media_element.getVideoPlaybackQuality();G=de.totalVideoFrames,ae=de.droppedVideoFrames}else this._media_element.webkitDecodedFrameCount!=null?(G=this._media_element.webkitDecodedFrameCount,ae=this._media_element.webkitDroppedFrameCount):R=!1;return R&&(h.decodedFrames=G,h.droppedFrames=ae),h},k})(),Se=(function(){function k(h,R){this.TAG="MSEPlayer",this._type="MSEPlayer",this._media_element=null,this._player_engine=null;var G=h.type.toLowerCase();if(G!=="mse"&&G!=="mpegts"&&G!=="m2ts"&&G!=="flv")throw new K.Qn("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");if(R&&R.enableWorkerForMSE&&ce.isSupported())try{this._player_engine=new ce(h,R)}catch{M.A.e(this.TAG,"Error while initializing PlayerEngineDedicatedThread, fallback to PlayerEngineMainThread"),this._player_engine=new j(h,R)}else this._player_engine=new j(h,R)}return k.prototype.destroy=function(){this._player_engine.destroy(),this._player_engine=null,this._media_element=null},k.prototype.on=function(h,R){this._player_engine.on(h,R)},k.prototype.off=function(h,R){this._player_engine.off(h,R)},k.prototype.attachMediaElement=function(h){this._media_element=h,this._player_engine.attachMediaElement(h)},k.prototype.detachMediaElement=function(){this._media_element=null,this._player_engine.detachMediaElement()},k.prototype.load=function(){this._player_engine.load()},k.prototype.unload=function(){this._player_engine.unload()},k.prototype.play=function(){return this._player_engine.play()},k.prototype.pause=function(){this._player_engine.pause()},Object.defineProperty(k.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"buffered",{get:function(){return this._media_element.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"duration",{get:function(){return this._media_element.duration},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"volume",{get:function(){return this._media_element.volume},set:function(h){this._media_element.volume=h},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"muted",{get:function(){return this._media_element.muted},set:function(h){this._media_element.muted=h},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"currentTime",{get:function(){return this._media_element?this._media_element.currentTime:0},set:function(h){this._player_engine.seek(h)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"mediaInfo",{get:function(){return this._player_engine.mediaInfo},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"statisticsInfo",{get:function(){return this._player_engine.statisticsInfo},enumerable:!1,configurable:!0}),k})(),Te=(function(){function k(h,R){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(O()),this._config=L(),typeof R=="object"&&Object.assign(this._config,R);var G=h.type.toLowerCase();if(G==="mse"||G==="mpegts"||G==="m2ts"||G==="flv")throw new K.Qn("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(h.hasOwnProperty("segments"))throw new K.Qn("NativePlayer(".concat(h.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=h,this._mediaElement=null}return k.prototype.destroy=function(){this._emitter.emit(A.A.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},k.prototype.on=function(h,R){var G=this;h===A.A.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){G._emitter.emit(A.A.MEDIA_INFO,G.mediaInfo)}):h===A.A.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){G._emitter.emit(A.A.STATISTICS_INFO,G.statisticsInfo)}),this._emitter.addListener(h,R)},k.prototype.off=function(h,R){this._emitter.removeListener(h,R)},k.prototype.attachMediaElement=function(h){if(this._mediaElement=h,h.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{h.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch{}},k.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},k.prototype.load=function(){if(!this._mediaElement)throw new K.j4("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},k.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},k.prototype.play=function(){return this._mediaElement.play()},k.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(k.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(h){this._mediaElement.volume=h},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(h){this._mediaElement.muted=h},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(h){this._mediaElement?this._mediaElement.currentTime=h:this._pendingSeekTime=h},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"mediaInfo",{get:function(){var h={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(h.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(h.width=this._mediaElement.videoWidth,h.height=this._mediaElement.videoHeight)),h},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"statisticsInfo",{get:function(){var h={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return h;var R=!0,G=0,ae=0;if(this._mediaElement.getVideoPlaybackQuality){var de=this._mediaElement.getVideoPlaybackQuality();G=de.totalVideoFrames,ae=de.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(G=this._mediaElement.webkitDecodedFrameCount,ae=this._mediaElement.webkitDroppedFrameCount):R=!1;return R&&(h.decodedFrames=G,h.droppedFrames=ae),h},enumerable:!1,configurable:!0}),k.prototype._onvLoadedMetadata=function(h){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(A.A.MEDIA_INFO,this.mediaInfo)},k.prototype._reportStatisticsInfo=function(){this._emitter.emit(A.A.STATISTICS_INFO,this.statisticsInfo)},k})();P.A.install();var Re={createPlayer:function(k,h){var R=k;if(R==null||typeof R!="object")throw new K.Qn("MediaDataSource must be an javascript object!");if(!R.hasOwnProperty("type"))throw new K.Qn("MediaDataSource must has type field to indicate video file type!");switch(R.type){case"mse":case"mpegts":case"m2ts":case"flv":return new Se(R,h);default:return new Te(R,h)}},isSupported:function(){return b.supportMSEH264Playback()},getFeatureList:function(){return b.getFeatureList()}};Re.BaseLoader=w.HC,Re.LoaderStatus=w.eO,Re.LoaderErrors=w.Xv,Re.Events=A.A,Re.ErrorTypes=E.w,Re.ErrorDetails=E.v,Re.MSEPlayer=Se,Re.NativePlayer=Te,Re.LoggingControl=ie.A,Object.defineProperty(Re,"version",{enumerable:!0,get:function(){return"1.8.1"}});var ke=Re},355:function(he,te,B){"use strict";B.d(te,{v:function(){return L},w:function(){return c}});var P=B(470),Z=B(827),c={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},L={NETWORK_EXCEPTION:P.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:P.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:P.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:P.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Z.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Z.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Z.A.CODEC_UNSUPPORTED}},994:function(he,te){"use strict";var B={};(function(){var P=self.navigator.userAgent.toLowerCase(),Z=/(edge)\/([\w.]+)/.exec(P)||/(opr)[\/]([\w.]+)/.exec(P)||/(chrome)[ \/]([\w.]+)/.exec(P)||/(iemobile)[\/]([\w.]+)/.exec(P)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(P)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(P)||/(webkit)[ \/]([\w.]+)/.exec(P)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(P)||/(msie) ([\w.]+)/.exec(P)||P.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(P)||P.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(P)||[],c=/(ipad)/.exec(P)||/(ipod)/.exec(P)||/(windows phone)/.exec(P)||/(iphone)/.exec(P)||/(kindle)/.exec(P)||/(android)/.exec(P)||/(windows)/.exec(P)||/(mac)/.exec(P)||/(linux)/.exec(P)||/(cros)/.exec(P)||[],L={browser:Z[5]||Z[3]||Z[1]||"",version:Z[2]||Z[4]||"0",majorVersion:Z[4]||Z[2]||"0",platform:c[0]||""},b={};if(L.browser){b[L.browser]=!0;var w=L.majorVersion.split(".");b.version={major:parseInt(L.majorVersion,10),string:L.version},w.length>1&&(b.version.minor=parseInt(w[1],10)),w.length>2&&(b.version.build=parseInt(w[2],10))}if(L.platform&&(b[L.platform]=!0),(b.chrome||b.opr||b.safari)&&(b.webkit=!0),b.rv||b.iemobile){b.rv&&delete b.rv;var M="msie";L.browser=M,b[M]=!0}if(b.edge){delete b.edge;var g="msedge";L.browser=g,b[g]=!0}if(b.opr){var O="opera";L.browser=O,b[O]=!0}if(b.safari&&b.android){var T="android";L.browser=T,b[T]=!0}for(var A in b.name=L.browser,b.platform=L.platform,B)B.hasOwnProperty(A)&&delete B[A];Object.assign(B,b)})(),te.A=B},867:function(he,te,B){"use strict";B.d(te,{Al:function(){return c},Qn:function(){return b},Xu:function(){return w},j4:function(){return L}});var P,Z=(P=function(M,g){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,T){O.__proto__=T}||function(O,T){for(var A in T)Object.prototype.hasOwnProperty.call(T,A)&&(O[A]=T[A])},P(M,g)},function(M,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");function O(){this.constructor=M}P(M,g),M.prototype=g===null?Object.create(g):(O.prototype=g.prototype,new O)}),c=(function(){function M(g){this._message=g}return Object.defineProperty(M.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),M.prototype.toString=function(){return this.name+": "+this.message},M})(),L=(function(M){function g(O){return M.call(this,O)||this}return Z(g,M),Object.defineProperty(g.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),g})(c),b=(function(M){function g(O){return M.call(this,O)||this}return Z(g,M),Object.defineProperty(g.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),g})(c),w=(function(M){function g(O){return M.call(this,O)||this}return Z(g,M),Object.defineProperty(g.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),g})(c)},856:function(he,te,B){"use strict";var P=B(7),Z=B.n(P),c=(function(){function L(){}return L.e=function(b,w){b&&!L.FORCE_GLOBAL_TAG||(b=L.GLOBAL_TAG);var M="[".concat(b,"] > ").concat(w);L.ENABLE_CALLBACK&&L.emitter.emit("log","error",M),L.ENABLE_ERROR&&(console.error?console.error(M):console.warn&&console.warn(M))},L.i=function(b,w){b&&!L.FORCE_GLOBAL_TAG||(b=L.GLOBAL_TAG);var M="[".concat(b,"] > ").concat(w);L.ENABLE_CALLBACK&&L.emitter.emit("log","info",M),L.ENABLE_INFO&&console.info&&console.info(M)},L.w=function(b,w){b&&!L.FORCE_GLOBAL_TAG||(b=L.GLOBAL_TAG);var M="[".concat(b,"] > ").concat(w);L.ENABLE_CALLBACK&&L.emitter.emit("log","warn",M),L.ENABLE_WARN&&console.warn&&console.warn(M)},L.d=function(b,w){b&&!L.FORCE_GLOBAL_TAG||(b=L.GLOBAL_TAG);var M="[".concat(b,"] > ").concat(w);L.ENABLE_CALLBACK&&L.emitter.emit("log","debug",M),L.ENABLE_DEBUG&&console.debug&&console.debug(M)},L.v=function(b,w){b&&!L.FORCE_GLOBAL_TAG||(b=L.GLOBAL_TAG);var M="[".concat(b,"] > ").concat(w);L.ENABLE_CALLBACK&&L.emitter.emit("log","verbose",M),L.ENABLE_VERBOSE},L})();c.GLOBAL_TAG="mpegts.js",c.FORCE_GLOBAL_TAG=!1,c.ENABLE_ERROR=!0,c.ENABLE_INFO=!0,c.ENABLE_WARN=!0,c.ENABLE_DEBUG=!0,c.ENABLE_VERBOSE=!0,c.ENABLE_CALLBACK=!1,c.emitter=new(Z()),te.A=c},947:function(he,te,B){"use strict";var P=B(7),Z=B.n(P),c=B(856),L=(function(){function b(){}return Object.defineProperty(b,"forceGlobalTag",{get:function(){return c.A.FORCE_GLOBAL_TAG},set:function(w){c.A.FORCE_GLOBAL_TAG=w,b._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(b,"globalTag",{get:function(){return c.A.GLOBAL_TAG},set:function(w){c.A.GLOBAL_TAG=w,b._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(b,"enableAll",{get:function(){return c.A.ENABLE_VERBOSE&&c.A.ENABLE_DEBUG&&c.A.ENABLE_INFO&&c.A.ENABLE_WARN&&c.A.ENABLE_ERROR},set:function(w){c.A.ENABLE_VERBOSE=w,c.A.ENABLE_DEBUG=w,c.A.ENABLE_INFO=w,c.A.ENABLE_WARN=w,c.A.ENABLE_ERROR=w,b._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(b,"enableDebug",{get:function(){return c.A.ENABLE_DEBUG},set:function(w){c.A.ENABLE_DEBUG=w,b._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(b,"enableVerbose",{get:function(){return c.A.ENABLE_VERBOSE},set:function(w){c.A.ENABLE_VERBOSE=w,b._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(b,"enableInfo",{get:function(){return c.A.ENABLE_INFO},set:function(w){c.A.ENABLE_INFO=w,b._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(b,"enableWarn",{get:function(){return c.A.ENABLE_WARN},set:function(w){c.A.ENABLE_WARN=w,b._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(b,"enableError",{get:function(){return c.A.ENABLE_ERROR},set:function(w){c.A.ENABLE_ERROR=w,b._notifyChange()},enumerable:!1,configurable:!0}),b.getConfig=function(){return{globalTag:c.A.GLOBAL_TAG,forceGlobalTag:c.A.FORCE_GLOBAL_TAG,enableVerbose:c.A.ENABLE_VERBOSE,enableDebug:c.A.ENABLE_DEBUG,enableInfo:c.A.ENABLE_INFO,enableWarn:c.A.ENABLE_WARN,enableError:c.A.ENABLE_ERROR,enableCallback:c.A.ENABLE_CALLBACK}},b.applyConfig=function(w){c.A.GLOBAL_TAG=w.globalTag,c.A.FORCE_GLOBAL_TAG=w.forceGlobalTag,c.A.ENABLE_VERBOSE=w.enableVerbose,c.A.ENABLE_DEBUG=w.enableDebug,c.A.ENABLE_INFO=w.enableInfo,c.A.ENABLE_WARN=w.enableWarn,c.A.ENABLE_ERROR=w.enableError,c.A.ENABLE_CALLBACK=w.enableCallback},b._notifyChange=function(){var w=b.emitter;if(w.listenerCount("change")>0){var M=b.getConfig();w.emit("change",M)}},b.registerListener=function(w){b.emitter.addListener("change",w)},b.removeListener=function(w){b.emitter.removeListener("change",w)},b.addLogListener=function(w){c.A.emitter.addListener("log",w),c.A.emitter.listenerCount("log")>0&&(c.A.ENABLE_CALLBACK=!0,b._notifyChange())},b.removeLogListener=function(w){c.A.emitter.removeListener("log",w),c.A.emitter.listenerCount("log")===0&&(c.A.ENABLE_CALLBACK=!1,b._notifyChange())},b})();L.emitter=new(Z()),te.A=L},811:function(he,te,B){"use strict";var P=(function(){function Z(){}return Z.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(c,L){return c.__proto__=L,c},Object.assign=Object.assign||function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");for(var L=Object(c),b=1;b<arguments.length;b++){var w=arguments[b];if(w!=null)for(var M in w)w.hasOwnProperty(M)&&(L[M]=w[M])}return L},String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(c,L){var b=L>0?0|L:0;return this.substring(b,b+c.length)===c}}),typeof self.Promise!="function"&&B(964).polyfill()},Z})();P.install(),te.A=P},861:function(he,te,B){function P(g){var O={};function T(I){if(O[I])return O[I].exports;var F=O[I]={i:I,id:I,l:!1,loaded:!1,exports:{}};return g[I].call(F.exports,F,F.exports,T),F.l=!0,F.loaded=!0,F.exports}T.m=g,T.c=O,T.d=function(I,F){for(var E in F)T.o(F,E)&&!T.o(I,E)&&Object.defineProperty(I,E,{enumerable:!0,get:F[E]})},T.r=function(I){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(I,"__esModule",{value:!0})},T.n=function(I){var F=I&&I.__esModule?function(){return I.default}:function(){return I};return T.d(F,{a:F}),F},T.o=function(I,F){return Object.prototype.hasOwnProperty.call(I,F)},T.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof self=="object")return self}})(),T.p="/";var A=T(ENTRY_MODULE);return A.default||A}var Z="[\\.|\\-|\\+|\\w|/|@]+",c="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+Z+").*?\\)";function L(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function b(g){return!isNaN(1*g)}function w(g,O,T){var A={};A[T]=[];var I=O.toString(),F=I.match(/^(?:function\s*\w*\s*)?\(\s*\w+\s*,\s*\w+\s*,\s*(\w+)\s*\)/);if(!F)return A;for(var E,K=F[1],V=new RegExp("(\\\\n|\\W)"+L(K)+c,"g");E=V.exec(I);)E[3]!=="dll-reference"&&A[T].push(E[3]);for(V=new RegExp("\\("+L(K)+'\\("(dll-reference\\s('+Z+'))"\\)\\)'+c,"g");E=V.exec(I);)g[E[2]]||(A[T].push(E[1]),g[E[2]]=B(E[1]).m),A[E[2]]=A[E[2]]||[],A[E[2]].push(E[4]);for(var Y=Object.keys(A),C=0;C<Y.length;C++)for(var l=0;l<A[Y[C]].length;l++)b(A[Y[C]][l])&&(A[Y[C]][l]=1*A[Y[C]][l]);return A}function M(g){return Object.keys(g).reduce(function(O,T){return O||g[T].length>0},!1)}he.exports=function(g,O){O=O||{};var T={main:B.m},A=O.all?{main:Object.keys(T.main)}:(function(V,Y){for(var C={main:[Y]},l={main:[]},u={main:{}};M(C);)for(var p=Object.keys(C),v=0;v<p.length;v++){var H=p[v],j=C[H].pop();if(u[H]=u[H]||{},!u[H][j]&&V[H][j]){u[H][j]=!0,l[H]=l[H]||[],l[H].push(j);for(var ne=w(V,V[H][j],H),ie=Object.keys(ne),ce=0;ce<ie.length;ce++)C[ie[ce]]=C[ie[ce]]||[],C[ie[ce]]=C[ie[ce]].concat(ne[ie[ce]])}}return l})(T,g),I="";Object.keys(A).filter(function(V){return V!=="main"}).forEach(function(V){for(var Y=0;A[V][Y];)Y++;A[V].push(Y),T[V][Y]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",I=I+"var "+V+" = ("+P.toString().replace("ENTRY_MODULE",JSON.stringify(Y))+")({"+A[V].map(function(C){return JSON.stringify(C)+": "+T[V][C].toString()}).join(",")+`});
`}),I=I+"new (("+P.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+A.main.map(function(V){return JSON.stringify(V)+": "+T.main[V].toString()}).join(",")+"}))(self);";var F=new self.Blob([I],{type:"text/javascript"});if(O.bare)return F;var E=(self.URL||self.webkitURL||self.mozURL||self.msURL).createObjectURL(F),K=new self.Worker(E);return K.objectURL=E,K}},403:function(he,te){"use strict";var B;(function(P){P.ERROR="error",P.SOURCE_OPEN="source_open",P.UPDATE_END="update_end",P.BUFFER_FULL="buffer_full",P.START_STREAMING="start_streaming",P.END_STREAMING="end_streaming"})(B||(B={})),te.A=B},726:function(he,te){"use strict";var B;(function(P){P.IO_ERROR="io_error",P.DEMUX_ERROR="demux_error",P.INIT_SEGMENT="init_segment",P.MEDIA_SEGMENT="media_segment",P.LOADING_COMPLETE="loading_complete",P.RECOVERED_EARLY_EOF="recovered_early_eof",P.MEDIA_INFO="media_info",P.METADATA_ARRIVED="metadata_arrived",P.SCRIPTDATA_ARRIVED="scriptdata_arrived",P.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",P.PGS_SUBTITLE_ARRIVED="pgs_subtitle_arrived",P.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",P.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",P.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",P.SEI_ARRIVED="sei_arrived",P.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",P.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",P.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",P.STATISTICS_INFO="statistics_info",P.RECOMMEND_SEEKPOINT="recommend_seekpoint"})(B||(B={})),te.A=B},877:function(he,te,B){"use strict";B(856),B(947),B(867),B(403),B(346),B(527),B(726),B(117),B(355)},117:function(he,te){"use strict";var B;(function(P){P.ERROR="error",P.LOADING_COMPLETE="loading_complete",P.RECOVERED_EARLY_EOF="recovered_early_eof",P.MEDIA_INFO="media_info",P.METADATA_ARRIVED="metadata_arrived",P.SCRIPTDATA_ARRIVED="scriptdata_arrived",P.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",P.PGS_SUBTITLE_ARRIVED="pgs_subtitle_arrived",P.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",P.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",P.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",P.SEI_ARRIVED="sei_arrived",P.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",P.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",P.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",P.STATISTICS_INFO="statistics_info",P.DESTROYING="destroying"})(B||(B={})),te.A=B}},ze={};function Ne(he){var te=ze[he];if(te!==void 0)return te.exports;var B=ze[he]={exports:{}};return Ze[he].call(B.exports,B,B.exports,Ne),B.exports}return Ne.m=Ze,Ne.n=function(he){var te=he&&he.__esModule?function(){return he.default}:function(){return he};return Ne.d(te,{a:te}),te},Ne.d=function(he,te){if(Array.isArray(te))for(var B=0;B<te.length;){var P=te[B++],Z=te[B++];Ne.o(he,P)?Z===0&&B++:Z===0?Object.defineProperty(he,P,{enumerable:!0,value:te[B++]}):Object.defineProperty(he,P,{enumerable:!0,get:Z})}else for(var P in te)Ne.o(te,P)&&!Ne.o(he,P)&&Object.defineProperty(he,P,{enumerable:!0,get:te[P]})},Ne.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),Ne.o=function(he,te){return Object.prototype.hasOwnProperty.call(he,te)},Ne(976)})()})}));Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return $t()}});