1(globalThis.webpackChunk||=[]).push([[5458],{24401(t){"u">typeof window&&(t.exports=function(t){var e={};function i(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(r,a,(function(e){return t[e]}).bind(null,a));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/",i(i.s=20)}([function(t,e,i){var r,a;i.d(e,"a",function(){return r}),(a=r||(r={})).ABR_LEVELS_UPDATED="hlsAbrLevelsUpdated",a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",a.BUFFER_RESET="hlsBufferReset",a.BUFFER_CODECS="hlsBufferCodecs",a.BUFFER_CREATED="hlsBufferCreated",a.BUFFER_APPENDING="hlsBufferAppending",a.BUFFER_APPENDED="hlsBufferAppended",a.BUFFER_EOS="hlsBufferEos",a.BUFFER_EMPTY="hlsBufferEmpty",a.BUFFER_FLUSHING="hlsBufferFlushing",a.BUFFER_FLUSHED="hlsBufferFlushed",a.MANIFEST_LOADING="hlsManifestLoading",a.MANIFEST_LOADED="hlsManifestLoaded",a.MANIFEST_PARSED="hlsManifestParsed",a.LEVEL_SWITCHING="hlsLevelSwitching",a.LEVEL_SWITCHED="hlsLevelSwitched",a.LEVEL_LOADING="hlsLevelLoading",a.LEVEL_LOADED="hlsLevelLoaded",a.LEVEL_UPDATED="hlsLevelUpdated",a.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",a.LEVELS_UPDATED="hlsLevelsUpdated",a.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",a.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",a.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",a.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",a.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",a.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",a.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",a.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",a.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",a.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",a.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",a.CUES_PARSED="hlsCuesParsed",a.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",a.INIT_PTS_FOUND="hlsInitPtsFound",a.FRAG_LOADING="hlsFragLoading",a.FRAG_SAFE_TIMEOUT="hlsFragSafeTimeout",a.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",a.FRAG_LOADED="hlsFragLoaded",a.FRAG_DECRYPTED="hlsFragDecrypted",a.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",a.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",a.FRAG_PARSING_METADATA="hlsFragParsingMetadata",a.FRAG_PARSED="hlsFragParsed",a.FRAG_BUFFERED="hlsFragBuffered",a.FRAG_CHANGED="hlsFragChanged",a.FRAG_SKIPPED="hlsFragSkipped",a.FPS_DROP="hlsFpsDrop",a.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",a.ERROR="hlsError",a.DESTROYING="hlsDestroying",a.KEY_LOADING="hlsKeyLoading",a.KEY_LOADED="hlsKeyLoaded",a.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",a.BACK_BUFFER_REACHED="hlsBackBufferReached",a.PLAYBACK_SEEKING="hlsPlaybackSeeking",a.STREAM_STATE_TRANSITION="hlsStreamStateTransition",a.LEVEL_METADATA_LOADED="hlsLevelMetadataLoaded"},function(t,e,i){i.d(e,"a",function(){return s}),i.d(e,"b",function(){return o});var r=function(){},a={trace:r,debug:r,log:r,warn:r,info:r,error:r},n=a;function s(t){if(self.console&&!0===t||"object"==typeof t){!function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),a=1;a<e;a++)i[a-1]=arguments[a];i.forEach(function(e){var i;n[e]=t[e]?t[e].bind(t):(i=self.console[e])?i.bind(self.console,"["+e+"] >"):r})}(t,"debug","log","info","warn","error");try{n.log()}catch(t){n=a}}else n=a}var o=a},function(t,e,i){var r,a,n,s;i.d(e,"b",function(){return r}),i.d(e,"a",function(){return a}),(n=r||(r={}
vendor: 2,027 bytes, line 1
1)).NETWORK_ERROR="networkError",n.MEDIA_ERROR="mediaError",n.KEY_SYSTEM_ERROR="keySystemError",n.MUX_ERROR="muxError",n.OTHER_ERROR="otherError",(s=a||(a={})).KEY_SYSTEM_NO_KEYS="keySystemNoKeys",s.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",s.KEY_SYSTEM_NO_SESSION="keySystemNoSession",s.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",s.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",s.MANIFEST_LOAD_ERROR="manifestLoadError",s.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",s.MANIFEST_PARSING_ERROR="manifestParsingError",s.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",s.LEVEL_EMPTY_ERROR="levelEmptyError",s.LEVEL_LOAD_ERROR="levelLoadError",s.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",s.LEVEL_SWITCH_ERROR="levelSwitchError",s.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",s.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",s.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",s.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",s.FRAG_LOAD_ERROR="fragLoadError",s.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",s.FRAG_LOAD_SAFE_TIMEOUT="fragLoadSafeTimeout",s.FRAG_DECRYPT_ERROR="fragDecryptError",s.FRAG_PARSING_ERROR="fragParsingError",s.REMUX_ALLOC_ERROR="remuxAllocError",s.KEY_LOAD_ERROR="keyLoadError",s.KEY_LOAD_TIMEOUT="keyLoadTimeOut",s.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",s.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",s.BUFFER_APPEND_ERROR="bufferAppendError",s.BUFFER_APPENDING_ERROR="bufferAppendingError",s.BUFFER_STALLED_ERROR="bufferStalledError",s.BUFFER_FULL_ERROR="bufferFullError",s.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",s.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",s.INTERNAL_EXCEPTION="internalException",s.INTERNAL_ABORTED="aborted",s.UNKNOWN="unknown"},function(t,e,i){i.d(e,"a",function(){return r});var r=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)}},function(t,e,i){var r,a,n,s;i.d(e,"a",function(){return r}),i.d(e,"b",function(){return a}),(n=r||(r={})).MANIFEST="manifest",n.LEVEL="level",n.AUDIO_TRACK="audioTrack",
1n.SUBTITLE_TRACK="subtitleTrack",(s=a||(a={})).MAIN="main",s.AUDIO="audio",s.SUBTITLE="subtitle"},function(t,e,i){i.d(e,"a",function(){return o}),i.d(e,"c",function(){return f}),i.d(e,"k",function(){return g}),i.d(e,"h",function(){return v}),i.d(e,"e",function(){return p}),i.d(e,"d",function(){return m}),i.d(e,"f",function(){return y}),i.d(e,"l",function(){return T}),i.d(e,"b",function(){return E}),i.d(e,"j",function(){return S}),i.d(e,"i",function(){return b}),i.d(e,"g",function(){return _});var r=i(9),a=i(6),n=i(7),s=[].push,o={video:1,audio:2,id3:3,text:4};function l(t){return String.fromCharCode.apply(null,t)}function u(t,e){var i=t[e]<<8|t[e+1];return i<0?65536+i:i}function h(t,e){var i=d(t,e);return i<0?0x100000000+i:i}function d(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function c(t,e,i){t[e]=i>>24,t[e+1]=i>>16&255,t[e+2]=i>>8&255,t[e+3]=255&i}function f(t,e){var i=[];if(!e.length)return i;for(var r=t.byteLength,a=0;a<r;){var n=h(t,a),o=n>1?a+n:r;if(l(t.subarray(a+4,a+8))===e[0])if(1===e.length)i.push(t.subarray(a+8,o));else{var u=f(t.subarray(a+8,o),e.slice(1));u.length&&s.apply(i,u)}a=o}return i}function g(t){var e=f(t,["moov"])[0],i=e?e.length:null,r=f(t,["sidx"]);if(!r||!r[0])return null;var a=[],n=r[0],s=n[0],o=0===s?8:16,l=h(n,o);o+=4,o+=0===s?8:16,o+=2;var d=n.length+0,c=u(n,o);o+=2;for(var g=0;g<c;g++){var v=o,p=h(n,v);v+=4;var m=0x7fffffff&p;if(1==(0x80000000&p)>>>31)return null;var y=h(n,v);v+=4,a.push({referenceSize:m,subsegmentDuration:y,info:{duration:y/l,start:d,end:d+m-1}}),d+=m,o=v+=4}return{earliestPresentationTime:0,timescale:l,version:s,referencesCount:c,references:a,moovEndOffset:i}}function v(t){for(var e=[],i=f(t,["moov","trak"]),r=0;r<i.length;r++){var n=i[r],s=f(n,["tkhd"])[0];if(s){var o=s[0],u=0===o?12:20,d=h(s,u),c=f(n,["mdia","mdhd"])[0];if(c){var g=h(c,u=0===(o=c[0])?12:20),v=f(n,["mdia","hdlr"])[0];if(v){var p=l(v.subarray(8,12)),m={soun:a.a.AUDIO,vide:a.a.VIDEO}[p];if(m){var y=f(n,["mdia","minf","stbl","stsd"])[0],T=void 0;y&&(T=l(y.subarray(12,16))),e[d]={timescale:g,type:m},e[m]={timescale:g,id:d,codec:T}}}}}}return f(t,["moov","mvex","trex"]).forEach(function(t){var i=e[h(t,4)];i&&(i.default={duration:h(t,12),flags:h(t,20)})}),e}function p(t,e){return f(e,["moof","traf"]).reduce(function(e,i){var r=f(i,["tfdt"])[0],a=r[0],n=f(i,["tfhd"]).reduce(function(e,i){var n=t[h(i,4)];if(n){var s=h(r,4);1===a&&(s*=0x100000000,s+=h(r,8));var o=s/(n.timescale||9e4);if(isFinite(o)&&(null===e||o<e))return o}return e},null);return null!==n&&isFinite(n)&&(null===e||n<e)?n:e},null)||0}function m(t,e){for(var i=0,r=0,n=0,s=f(t,["moof","traf"]),o=0;o<s.length;o++){var l=s[o],u=f(l,["tfhd"])[0],d=e[h(u,4)];if(d){var c=d.default,v=h(u,0)|(null==c?void 0:c.flags),p=null==c?void 0:c.duration;8&v&&(p=h(u,2&v?12:8));for(var m=d.timescale||9e4,y=f(l,["trun"]),T=0;T<y.length;T++)(i=function(t){var e=h(t,0),i=8;1&e&&(i+=4),4&e&&(i+=4);for(var r=0,a=h(t,4),n=0;n<a;n++)256&e&&(r+=h(t,i),i+=4),512&e&&(i+=4),1024&e&&(i+=4),2048&e&&(i+=4);return r}(y[T]))||!p||(i=p*h(y[T],4)),d.type===a.a.VIDEO?r+=i/m:d.type===a.a.AUDIO&&(n+=i/m)}}if(0===r&&0===n){var E=g(t);if(null!=E&&E.references)return E.references.reduce(function(t,e){return t+e.info.duration||0},0)}return r||n}function y(t,e,i){f(e,["moof","traf"]).forEach(function(e){f(e,["tfhd"]).forEach(function(r){var a=t[h(r,4)];if(a){var n=a.timescale||9e4;f(e,["tfdt"]).forEach(function(t){var e=t[0],r=h(t,4);if(0===e)c(t,4,r-i*n);else{r*=0x100000000,r+=h(t,8),r-=i*n;var a=Math.floor((r=Math.max(r,0))/0x100000000),s=Math.floor(r%0x100000000);c(t,4,a),c(t,8,s)}})}})})}function T(t){var e={valid:null,remainder:null},i=f(t,["moof"]);if(!i)return e;if(i.length<2)return e.remainder=t,e;var a=i[i.length-1];return e.valid=Object(r.a)(t,0,a.byteOffset-8),e.remainder=Object(r.a)(t,a.byteOffset-8),e}function E(t,e){var i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i}function S(t,e){var i=[],r=e.samples,n=e.timescale,s=e.id,o=!1;return f(r,["moof"]).map(function(l){var u=l.byteOffset-8;f(l,["traf"]).map(function(l){var c=f(l,["tfdt"]).map(function(t){var e=t[0],i=h(t,4);return 1===e&&(i*=0x100000000,i+=h(t,8)),i/n})[0];return void 0!==c&&(t=c),f(l,["tfhd"]).map(function(c){var g=h(c,4),v=0xffffff&h(c,0),p=0,m=0,y=8;g===s&&(0!=(1&v)&&(y+=8),0!=(2&v)&&(y+=4),0!=(8&v)&&(p=h(c,y),y+=4),0!=(16&v)&&(m=h(c,y),y+=4),0!=(32&v)&&(y+=4),"video"===e.type&&(o=function(t){if(!t)return!1;var e=t.indexOf("."),i=e<0?t:t.substring(0,e);return"hvc1"===i||"hev1"===i||"dvh1"===i||"dvhe"===i}(e.codec)),f(l,["trun"]).map(function(s){var l=s[0],c=0xffffff&h(s,0),f=0,g=0!=(256&c),v=0,y=0!=(512&c),T=0,E=0!=(1024&c),S=0!=(2048&c),_=0,A=h(s,4),L=8;0!=(1&c)&&(f=h(s,L),L+=4),0!=(4&c)&&(L+=4);for(var R=f+u,D=0;D<A;D++){if(g?(v=h(s,L),L+=4):v=p,y?(T=h(s,L),L+=4):T=m,E&&(L+=4),S&&(_=0===l?h(s,L):d(s,L),L+=4),e.type===a.a.VIDEO)for(var k=0;k<T;){var I=h(r,R),O=31&r[R+=4];(o?39===O||40===O:6===O)&&b(r.subarray(R,R+I),t+_/n,i),R+=I,k+=I+4}t+=v/n}}))})})}),i}function b(t,e,i){var r=function(t){for(var e=t.byteLength,i=[],r=1;r<e-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(i.push(r+2),r+=2):r++;if(0===i.length)return t;var a=e-i.length,n=new Uint8Array(a),s=0;for(r=0;r<a;s++,r++)s===i[0]&&(s++,i.shift()),n[r]=t[s];return n}(t),a=0;a++;for(var s=0,o=0,l=!1,d=0;a<r.length;){s=0;do{if(a>=r.length)break;s+=d=r[a++]}while(255===d)o=0;do{if(a>=r.length)break;o+=d=r[a++]}while(255===d)var c=r.length-a;if(!l&&4===s&&a<r.length){if(l=!0,181===r[a++]){var f=u(r,a);if(a+=2,49===f){var g=h(r,a);if(a+=4,0x47413934===g){var v=r[a++];if(3===v){var p=r[a++],m=64&p,y=m?2+3*(31&p):0,T=new Uint8Array(y);if(m){T[0]=p;for(var E=1;E<y;E++)T[E]=r[a++]}i.push({type:v,payloadType:s,pts:e,bytes:T})}}}}}else if(5===s&&o<c){if(l=!0,o>16){for(var S=[],b=0;b<16;b++){var _=r[a++].toString(16);S.push(1==_.length?"0"+_:_),3!==b&&5!==b&&7!==b&&9!==b||S.push("-")}for(var A=o-16,L=new Uint8Array(A),R=0;R<A;R++)L[R]=r[a++];i.push({payloadType:s,pts:e,uuid:S.join(""),userData:Object(n.f)(L),userDataBytes:L})}}else if(o<c)a+=o;else if(o>c)break}}function _(t){var e=t[0],i="",r="",a=0,n=0,s=0,o=0,u=0,d=0;if(0===e){for(;"\0"!==l(t.subarray(d,d+1));)i+=l(t.subarray(d,d+1)),d+=1;for(i+=l(t.subarray(d,d+1)),d+=1;"\0"!==l(t.subarray(d,d+1));)r+=l(t.subarray(d,d+1)),d+=1;r+=l(t.subarray(d,d+1)),d+=1,a=h(t,12),n=h(t,16),o=h(t,20),u=h(t,24),d=28}else if(1===e){a=h(t,d+=4);var c=h(t,d+=4),f=h(t,d+=4);for(d+=4,Number.isSafeInteger(s=0x100000000*c+f)||(s=Number.MAX_SAFE_INTEGER),o=h(t,d),u=h(t,d+=4),d+=4;"\0"!==l(t.subarray(d,d+1));)i+=l(t.subarray(d,d+1)),d+=1;for(i+=l(t.subarray(d,d+1)),d+=1;"\0"!==l(t.subarray(d,d+1));)r+=l(t.subarray(d,d+1)),d+=1;r+=l(t.subarray(d,d+1)),d+=1}return{schemeIdUri:i,value:r,timeScale:a,presentationTime:s,presentationTimeDelta:n,eventDuration:o,id:u,payload:t.subarray(d,t.byteLength)}}}
vendor: 8,912 bytes, line 1
1,function(t,e,i){i.d(e,"a",function(){return a}),i.d(e,"b",function(){return v}),i.d(e,"c",function(){return p});var r,a,n=i(3),s=i(11),o=i(1),l=i(17),u=i(13);function h(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,d(t,e)}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t,e,i){return e&&c(t.prototype,e),i&&c(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}(r=a||(a={})).AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo";var g=function(){function t(t){var e;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((e={})[a.AUDIO]=null,e[a.VIDEO]=null,e[a.AUDIOVIDEO]=null,e),this.baseurl=t}return t.prototype.setByteRange=function(t,e){var i=t.split("@",2),r=[];1===i.length?r[0]=e?e.byteRangeEndOffset:0:r[0]=parseInt(i[1]),r[1]=parseInt(i[0])+r[0],this._byteRange=r},f(t,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(s.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(t){this._url=t}}]),t}(),v=function(t){function e(e,i){var r;return(r=t.call(this,i)||this)._decryptdata=null,r.rawProgramDateTime=null,r.programDateTime=null,r.tagList=[],r.duration=0,r.sn=0,r.levelkey=void 0,r.type=void 0,r.loader=null,r.level=-1,r.cc=0,r.startPTS=void 0,r.endPTS=void 0,r.appendedPTS=void 0,r.startDTS=void 0,r.endDTS=void 0,r.start=0,r.deltaPTS=void 0,r.maxStartPTS=void 0,r.minEndPTS=void 0,r.stats=new u.a,r.urlId=0,r.data=void 0,r.bitrateTest=!1,r.title=null,r.initSegment=null,r.type=e,r}h(e,t);var i=e.prototype;return i.createInitializationVector=function(t){for(var e=new Uint8Array(16),i=12;i<16;i++)e[i]=t>>8*(15-i)&255;return e},i.setDecryptDataFromLevelKey=function(t,e){var i=t;return"AES-128"===(null==t?void 0:t.method)&&t.uri&&!t.iv&&((i=l.a.fromURI(t.uri)).method=t.method,i.iv=this.createInitializationVector(e),i.keyFormat="identity"),i},i.setElementaryStreamInfo=function(t,e,i,r,a,n){void 0===n&&(n=!1);var s=this.elementaryStreams,o=s[t];o?(o.startPTS=Math.min(o.startPTS,e),o.endPTS=Math.max(o.endPTS,i),o.startDTS=Math.min(o.startDTS,r),o.endDTS=Math.max(o.endDTS,a)):s[t]={startPTS:e,endPTS:i,startDTS:r,endDTS:a,partial:n}},i.clearElementaryStreamInfo=function(){var t=this.elementaryStreams;t[a.AUDIO]=null,t[a.VIDEO]=null,t[a.AUDIOVIDEO]=null},f(e,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var t=this.sn;"number"!=typeof t&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&o.b.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),t=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,t)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime||!Object(n.a)(this.programDateTime))return null;var t=Object(n.a)(this.duration)?this.duration:0;return this.programDateTime+1e3*t}},{key:"encrypted",get:function(){var t;return!(null==(t=this.decryptdata)||!t.keyFormat||!this.decryptdata.uri)}}]),e}(g),p=function(t){function e(e,i,r,a,n){(s=t.call(this,r)||this).fragOffset=0,s.duration=0,s.gap=!1,s.independent=!1,s.relurl=void 0,s.fragment=void 0,s.index=void 0,s.stats=new u.a,s.duration=e.decimalFloatingPoint("DURATION"),s.gap=e.bool("GAP"),s.independent=e.bool("INDEPENDENT"),s.relurl=e.enumeratedString("URI"),s.fragment=i,s.index=a;var s,o=e.enumeratedString("BYTERANGE");return o&&s.setByteRange(o,n),n&&(s.fragOffset=n.fragOffset+n.duration),s}return h(e,t),f(e,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var t=this.elementaryStreams;return!!(t.audio||t.video||t.audiovideo)}}]),e}(g)},function(t,e,i){i.d(e,"b",function(){return s}),i.d(e,"a",function(){return l}),i.d(e,"d",function(){return u}),i.d(e,"e",function(){return h}),i.d(e,"c",function(){return c}),i.d(e,"f",function(){return y});var r,a=function(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},n=function(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},s=function(t,e){for(var i=e,r=0;a(t,e);)r+=10,r+=o(t,e+6),n(t,e+10)&&(r+=10),e+=r;if(r>0)return t.subarray(i,i+r)},o=function(t,e){return(127&t[e])<<21|(127&t[e+1])<<14|(127&t[e+2])<<7|127&t[e+3]},l=function(t,e){return a(t,e)&&o(t,e+6)+10<=t.length-e},u=function(t){for(var e=c(t),i=0;i<e.length;i++){var r=e[i];if(h(r))return m(r)}},h=function(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info},d=function(t){var e=String.fromCharCode(t[0],t[1],t[2],t[3]),i=o(t,4);return{type:e,size:i,data:t.subarray(10,10+i)}},c=function(t){for(var e=0,i=[];a(t,e);){for(var r=o(t,e+6),s=(e+=10)+r;e+8<s;){var l=d(t.subarray(e)),u=f(l);u&&i.push(u),e+=l.size+10}n(t,e)&&(e+=10)}return i},f=function(t){return"PRIV"===t.type?g(t):"W"===t.type[0]?p(t):v(t)},g=function(t){if(!(t.size<2)){var e=y(t.data,!0),i=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:i.buffer}}},v=function(t){if(!(t.size<2)){if("TXXX"===t.type){var e=1,i=y(t.data.subarray(e),!0);e+=i.length+1;var r=y(t.data.subarray(e));return{key:t.type,info:i,data:r}}var a=y(t.data.subarray(1));return{key:t.type,data:a}}},p=function(t){if("WXXX"===t.type){if(t.size<2)return;var e=1,i=y(t.data.subarray(e),!0);e+=i.length+1;var r=y(t.data.subarray(e));return{key:t.type,info:i,data:r}}var a=y(t.data);return{key:t.type,data:a}},m=function(t){if(8===t.data.byteLength){var e=new Uint8Array(t.data),i=1&e[3],r=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return r/=45,i&&(r+=47721858.84),Math.round(r)}},y=function(t,e){void 0===e&&(e=!1);var i=(r||void 0===self.TextDecoder||(r=new self.TextDecoder("utf-8")),r);if(i){var a=i.decode(t);if(e){var n=a.indexOf("\0");return -1!==n?a.substring(0,n):a}return a.replace(/\0/g,"")}for(var s,o=t.length,l="",u=0;u<o&&(0!==(s=t[u++])||!e);)if(0!==s&&3!==s)switch(s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:l+=String.fromCharCode(s);break;case 12:case 13:l+=String.fromCharCode((31&s)<<6|63&t[u++]);break;case 14:l+=String.fromCharCode((15&s)<<12|(63&t[u++])<<6|63&t[u++])}return l}},function(t,e,i){function r(t,e,i,r){void 0===i&&(i=1),void 0===r&&(r=!1);var a=t*e*i;return r?Math.round(a):a}function a(t,e,i,a){return void 0===i&&(i=1),void 0===a&&(a=!1),r(t,e,1/i,a)}function n(t,e){return void 0===e&&(e=!1),r(t,1e3,1/9e4,e)}function s(t,e){return void 0===e&&(e=1),r(t,9e4,1/e)}i.d(e,"c",function(){return a}),i.d(e,"b",function(){return n}),i.d(e,"a",function(){return s})},function(t,e,i){function r(t,e,i){return Uint8Array.prototype.slice?t.slice(e,i):new Uint8Array(Array.prototype.slice.call(t,e,i))}i.d(e,"a",function(){return r})},function(t,e,i){i.d(e,"c",function(){return $}),i.d(e,"d",function(){return J}),i.d(e,"a",function(){return tt}),i.d(e,"b",function(){return te});var r=i(0),a=i(2),n=i(16),s=i(3),o=i(7);function l(t,e){return void 0===t&&(t=""),void 0===e&&(e=9e4),{type:t,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}var u=i(5),h=i(9),d=function(){function t(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var e=t.prototype;return e.resetInitSegment=function(t,e,i,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},e.resetTimeStamp=function(){},e.resetContiguity=function(){},e.canParse=function(t,e){return!1},e.appendFrame=function(t,e,i){},e.demux=function(t,e){this.cachedData&&(t=Object(u.b)(this.cachedData,t),this.cachedData=null);var i,r,a=o.b(t,0),n=a?a.length:0,s=this._audioTrack,d=this._id3Track,f=a?o.d(a):void 0,g=t.length;for(0!==this.frameIndex&&null!==this.initPTS||(this.initPTS=c(f,e)),a&&a.length>0&&d.samples.push({pts:this.initPTS,dts:this.initPTS,data:a}),r=this.initPTS;n<g;){if(this.canParse(t,n)){var v=this.appendFrame(s,t,n);v?(this.frameIndex++,r=v.sample.pts,i=n+=v.length):n=g}else o.a(t,n)?(a=o.b(t,n),d.samples.push({pts:r,dts:r,data:a}),i=n+=a.length):n++;if(n===g&&i!==g){var p=Object(h.a)(t,i);this.cachedData?this.cachedData=Object(u.b)(this.cachedData,p):this.cachedData=p}}return{audioTrack:s,videoTrack:l(),id3Track:d,textTrack:l()}}
1,e.demuxSampleAes=function(t,e,i){return Promise.reject(Error("["+this+"] This demuxer does not support Sample-AES decryption"))},e.flush=function(t){var e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),this.frameIndex=0,{audioTrack:this._audioTrack,videoTrack:l(),id3Track:this._id3Track,textTrack:l()}},e.destroy=function(){},t}(),c=function(t,e){return Object(s.a)(t)?90*t:9e4*e},f=i(1);function g(t,e){return 255===t[e]&&240==(246&t[e+1])}function v(t,e){return 1&t[e+1]?7:9}function p(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function m(t,e){return e+1<t.length&&g(t,e)}function y(t,e,i,n,s){if(!t.samplerate){var o=function(t,e,i,n){var s,o,l,u,h=navigator.userAgent.toLowerCase(),d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=1+((192&e[i+2])>>>6);var c=(60&e[i+2])>>>2;if(!(c>d.length-1))return l=(1&e[i+2])<<2|(192&e[i+3])>>>6,f.b.log("manifest codec:"+n+", ADTS type:"+s+", samplingIndex:"+c),/firefox/i.test(h)?c>=6?(s=5,u=[,,,,],o=c-3):(s=2,u=[,,],o=c):-1!==h.indexOf("android")?(s=2,u=[,,],o=c):(s=5,u=[,,,,],n&&(-1!==n.indexOf("mp4a.40.29")||-1!==n.indexOf("mp4a.40.5"))||!n&&c>=6?o=c-3:((n&&-1!==n.indexOf("mp4a.40.2")&&(c>=6&&1===l||/vivaldi/i.test(h))||!n&&1===l)&&(s=2,u=[,,]),o=c)),u[0]=s<<3,u[0]|=(14&c)>>1,u[1]|=(1&c)<<7,u[1]|=l<<3,5===s&&(u[1]|=(14&o)>>1,u[2]=(1&o)<<7,u[2]|=8,u[3]=0),{config:u,samplerate:d[c],channelCount:l,codec:"mp4a.40."+s,manifestCodec:n};t.trigger(r.a.ERROR,{type:a.b.MEDIA_ERROR,details:a.a.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+c})}(e,i,n,s);o&&(t.config=o.config,t.samplerate=o.samplerate,t.channelCount=o.channelCount,t.codec=o.codec,t.manifestCodec=o.manifestCodec,f.b.log("parsed codec:"+t.codec+", rate:"+o.samplerate+", channels:"+o.channelCount))}}function T(t,e,i,r,a){var n=function(t,e,i,r,a){var n=v(t,e),s=p(t,e);if((s-=n)>0)return{headerLength:n,frameLength:s,stamp:i+r*a}}(e,i,r,a,9216e4/t.samplerate);if(n){var s,o=n.frameLength,l=n.headerLength,u=n.stamp,h=l+o,d=Math.max(0,i+h-e.length);d?(s=new Uint8Array(h-l)).set(e.subarray(i+l,e.length),0):s=e.subarray(i+l,i+h);var c={unit:s,pts:u};return d||t.samples.push(c),{sample:c,length:h,missing:d}}}function E(t,e){return(E=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var S=function(t){function e(e,i){var r;return(r=t.call(this)||this).observer=void 0,r.config=void 0,r.observer=e,r.config=i,r}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,E(e,t);var i=e.prototype;return i.resetInitSegment=function(e,i,r,a){t.prototype.resetInitSegment.call(this,e,i,r,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:i,duration:a,inputTimeScale:9e4,dropped:0}},e.probe=function(t){if(!t)return!1;for(var e=(o.b(t,0)||[]).length,i=t.length;e<i;e++)if(function(t,e){if(m(t,e)){var i=v(t,e);if(e+i>=t.length)return!1;var r=p(t,e);if(r<=i)return!1;var a=e+r;return a===t.length||m(t,a)}return!1}(t,e))return f.b.log("ADTS sync word found !"),!0;return!1},i.canParse=function(t,e){return e+5<t.length&&g(t,e)&&p(t,e)<=t.length-e},i.appendFrame=function(t,e,i){y(t,this.observer,e,i,t.manifestCodec);var r=T(t,e,i,this.initPTS,this.frameIndex);if(r&&0===r.missing)return r},e}(d);S.minProbeByteLength=9;var b=/\/emsg[-/]ID3/i,_=function(){function t(t,e){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=e}var e=t.prototype;return e.resetTimeStamp=function(){},e.resetInitSegment=function(t,e,i,r){var a=Object(u.h)(t),n=this.videoTrack=l("video",1),s=this.audioTrack=l("audio",1),o=this.txtTrack=l("text",1);if(this.id3Track=l("id3",1),this.timeOffset=0,a.video){var h=a.video,d=h.id,c=h.timescale,f=h.codec;n.id=d,n.timescale=o.timescale=c,n.codec=f}if(a.audio){var g=a.audio,v=g.id,p=g.timescale,m=g.codec;s.id=v,s.timescale=p,s.codec=m}o.id=u.a.text,n.sampleDuration=0,n.duration=s.duration=r},e.resetContiguity=function(){},t.probe=function(t){return t=t.length>16384?t.subarray(0,16384):t,Object(u.c)(t,["moof"]).length>0},e.demux=function(t,e){this.timeOffset=e;var i=t,r=this.videoTrack,a=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=Object(u.b)(this.remainderData,t));var n=Object(u.l)(i);this.remainderData=n.remainder,r.samples=n.valid||new Uint8Array}else r.samples=i;var s=this.extractID3Track(r,e);return a.samples=Object(u.j)(e,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}},e.flush=function(){var t=this.timeOffset,e=this.videoTrack,i=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;var r=this.extractID3Track(e,this.timeOffset);return i.samples=Object(u.j)(t,e),{videoTrack:e,audioTrack:l(),id3Track:r,textTrack:l()}},e.extractID3Track=function(t,e){var i=this.id3Track;if(t.samples.length){var r=Object(u.c)(t.samples,["emsg"]);r&&r.forEach(function(t){var r=Object(u.g)(t);if(b.test(r.schemeIdUri)){var a=Object(s.a)(r.presentationTime)?r.presentationTime/r.timeScale:e+r.presentationTimeDelta/r.timeScale,n=r.payload;i.samples.push({data:n,len:n.byteLength,dts:a,pts:a})}})}return i}
vendor: 46,727 bytes, line 1
1,e.demuxSampleAes=function(t,e,i){return Promise.reject(Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},e.destroy=function(){},t}();_.minProbeByteLength=1024;var A=null,L=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],R=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],D=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],k=[0,1,1,4];function I(t,e,i,r,a){if(!(i+24>e.length)){var n=O(e,i);if(n&&i+n.frameLength<=e.length){var s=r+a*(9e4*n.samplesPerFrame/n.sampleRate),o={unit:e.subarray(i,i+n.frameLength),pts:s,dts:s};return t.config=[],t.channelCount=n.channelCount,t.samplerate=n.sampleRate,t.samples.push(o),{sample:o,length:n.frameLength,missing:0}}}}function O(t,e){var i=t[e+1]>>3&3,r=t[e+1]>>1&3,a=t[e+2]>>4&15,n=t[e+2]>>2&3;if(1!==i&&0!==a&&15!==a&&3!==n){var s=t[e+2]>>1&1,o=t[e+3]>>6,l=1e3*L[14*(3===i?3-r:3===r?3:4)+a-1],u=R[3*(3===i?0:2===i?1:2)+n],h=D[i][r],d=k[r],c=Math.floor(h*l/u+s)*d;if(null===A){var f=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);A=f?parseInt(f[1]):0}return A&&A<=87&&2===r&&l>=224e3&&0===o&&(t[e+3]=128|t[e+3]),{sampleRate:u,channelCount:3===o?1:2,frameLength:c,samplesPerFrame:8*h*d}}}function C(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])}function w(t,e){return e+1<t.length&&C(t,e)}var P=function(){function t(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}var e=t.prototype;return e.loadWord=function(){var t=this.data,e=this.bytesAvailable,i=t.byteLength-e,r=new Uint8Array(4),a=Math.min(4,e);if(0===a)throw Error("no bytes available");r.set(t.subarray(i,i+a)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*a,this.bytesAvailable-=a},e.skipBits=function(t){var e;this.bitsAvailable>t||(t-=this.bitsAvailable,t-=(e=t>>3)>>3,this.bytesAvailable-=e,this.loadWord()),this.word<<=t,this.bitsAvailable-=t},e.readBits=function(t){var e=Math.min(this.bitsAvailable,t),i=this.word>>>32-e;return t>32&&f.b.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),(e=t-e)>0&&this.bitsAvailable?i<<e|this.readBits(e):i},e.skipLZ=function(){var t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&0x80000000>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},e.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.skipEG=function(){this.skipBits(1+this.skipLZ())},e.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},e.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},e.readBoolean=function(){return 1===this.readBits(1)},e.readUByte=function(){return this.readBits(8)},e.readUShort=function(){return this.readBits(16)},e.readUInt=function(){return this.readBits(32)},e.skipScalingList=function(t){for(var e=8,i=8,r=0;r<t;r++)0!==i&&(i=(e+this.readEG()+256)%256),e=0===i?e:i},e.readSPS=function(){var t,e,i,r=0,a=0,n=0,s=0,o=this.readUByte.bind(this),l=this.readBits.bind(this),u=this.readUEG.bind(this),h=this.readBoolean.bind(this),d=this.skipBits.bind(this),c=this.skipEG.bind(this),f=this.skipUEG.bind(this),g=this.skipScalingList.bind(this);o();var v=o();if(l(5),d(3),o(),f(),100===v||110===v||122===v||244===v||44===v||83===v||86===v||118===v||128===v){var p=u();if(3===p&&d(1),f(),f(),d(1),h())for(e=3!==p?8:12,i=0;i<e;i++)h()&&g(i<6?16:64)}f();var m=u();if(0===m)u();else if(1===m)for(d(1),c(),c(),t=u(),i=0;i<t;i++)c();f(),d(1);var y=u(),T=u(),E=l(1);0===E&&d(1),d(1),h()&&(r=u(),a=u(),n=u(),s=u());var S=[1,1];if(h()&&h())switch(o()){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:S=[o()<<8|o(),o()<<8|o()]}return{width:Math.ceil(16*(y+1)-2*r-2*a),height:(2-E)*(T+1)*16-(E?2:4)*(n+s),pixelRatio:S}},e.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},t}(),x=function(){function t(t,e,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new n.a(t,e,{removePKCS7Padding:!1})}var e=t.prototype;return e.decryptBuffer=function(t,e){this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,e)},e.decryptAacSample=function(t,e,i,r){var a=t[e].unit;if(!(a.length<=16)){var n=a.subarray(16,a.length-a.length%16),s=n.buffer.slice(n.byteOffset,n.byteOffset+n.length),o=this;this.decryptBuffer(s,function(n){var s=new Uint8Array(n);a.set(s,16),r||o.decryptAacSamples(t,e+1,i)})}},e.decryptAacSamples=function(t,e,i){for(;;e++){if(e>=t.length)return void i();if(!(t[e].unit.length<32)){var r=this.decrypter.isSync();if(this.decryptAacSample(t,e,i,r),!r)return}}},e.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,i=new Int8Array(e),r=0,a=32;a<t.length-16;a+=160,r+=16)i.set(t.subarray(a,a+16),r);return i},e.getAvcDecryptedUnit=function(t,e){for(var i=new Uint8Array(e),r=0,a=32;a<t.length-16;a+=160,r+=16)t.set(i.subarray(r,r+16),a);return t},e.decryptAvcSample=function(t,e,i,r,a,n){var s=B(a.data),o=this.getAvcEncryptedData(s),l=this;this.decryptBuffer(o.buffer,function(o){a.data=l.getAvcDecryptedUnit(s,o),n||l.decryptAvcSamples(t,e,i+1,r)})},e.decryptAvcSamples=function(t,e,i,r){if(t instanceof Uint8Array)throw Error("Cannot decrypt samples of type Uint8Array");for(;;e++,i=0){if(e>=t.length)return void r();for(var a=t[e].units;!(i>=a.length);i++){var n=a[i];if(!(n.data.length<=48||1!==n.type&&5!==n.type)){var s=this.decrypter.isSync();if(this.decryptAvcSample(t,e,i,r,n,s),!s)return}}}},t}(),M=function(){function t(t,e,i){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=e,this.typeSupported=i}t.probe=function(e){var i=t.syncOffset(e);return!(i<0)&&(i&&f.b.warn("MPEG2-TS detected but first sync word found @ offset "+i+", junk ahead ?"),!0)},t.syncOffset=function(t){for(var e=Math.min(1e3,t.length-564),i=0;i<e;){if(71===t[i]&&71===t[i+188]&&71===t[i+376])return i;i++}return -1},t.createTrack=function(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:u.a[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===t?e:void 0}};var e=t.prototype;return e.resetInitSegment=function(e,i,r,a){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=t.createTrack("video"),this._audioTrack=t.createTrack("audio",a),this._id3Track=t.createTrack("id3"),this._txtTrack=t.createTrack("text"),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.avcSample=null,this.audioCodec=i,this.videoCodec=r,this._duration=a},e.resetTimeStamp=function(){},e.resetContiguity=function(){var t=this._audioTrack,e=this._avcTrack,i=this._id3Track;t&&(t.pesData=null),e&&(e.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null},e.demux=function(e,i,n,s){void 0===n&&(n=!1),void 0===s&&(s=!1),n||(this.sampleAes=null);var o,l=this._avcTrack,h=this._audioTrack,d=this._id3Track,c=this._txtTrack,g=l.pid,v=l.pesData,p=h.pid,m=d.pid,y=h.pesData,T=d.pesData,E=!1,S=this.pmtParsed,b=this._pmtId,_=e.length;if(this.remainderData&&(_=(e=Object(u.b)(this.remainderData,e)).length,this.remainderData=null),_<188&&!s)return this.remainderData=e,{audioTrack:h,videoTrack:l,id3Track:d,textTrack:c};var A=Math.max(0,t.syncOffset(e));(_-=(_+A)%188)<e.byteLength&&!s&&(this.remainderData=new Uint8Array(e.buffer,_,e.buffer.byteLength-_));for(var L=0,R=A;R<_;R+=188)if(71===e[R]){var D,k,I=!!(64&e[R+1]),O=((31&e[R+1])<<8)+e[R+2],C=void 0;if((48&e[R+3])>>4>1){if((C=R+5+e[R+4])===R+188)continue}else C=R+4;switch(O){case g:I&&(v&&(o=N(v))&&this.parseAVCPES(l,c,o,!1),v={data:[],size:0}),v&&(v.data.push(e.subarray(C,R+188)),v.size+=R+188-C);break;case p:I&&(y&&(o=N(y))&&(h.isAAC?this.parseAACPES(h,o):this.parseMPEGPES(h,o)),y={data:[],size:0}),y&&(y.data.push(e.subarray(C,R+188)),y.size+=R+188-C);break;case m:I&&(T&&(o=N(T))&&this.parseID3PES(d,o),T={data:[],size:0}),T&&(T.data.push(e.subarray(C,R+188)),T.size+=R+188-C);break;case 0:I&&(C+=e[C]+1),b=this._pmtId=(31&(D=e)[(k=C)+10])<<8|D[k+11];break;case b:I&&(C+=e[C]+1);var w=function(t,e,i,r){var a={audio:-1,avc:-1,id3:-1,isAAC:!0},n=e+3+((15&t[e+1])<<8|t[e+2])-4;for(e+=12+((15&t[e+10])<<8|t[e+11]);e<n;){var s=(31&t[e+1])<<8|t[e+2];switch(t[e]){case 207:if(!r){f.b.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===a.audio&&(a.audio=s);break;case 21:-1===a.id3&&(a.id3=s);break;case 219:if(!r){f.b.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===a.avc&&(a.avc=s);break;case 3:case 4:i?-1===a.audio&&(a.audio=s,a.isAAC=!1):f.b.log("MPEG audio found, not supported in this browser");break;case 36:f.b.warn("Unsupported HEVC stream type found")}e+=5+((15&t[e+3])<<8|t[e+4])}return a}(e,C,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,n);(g=w.avc)>0&&(l.pid=g),(p=w.audio)>0&&(h.pid=p,h.isAAC=w.isAAC),(m=w.id3)>0&&(d.pid=m),E&&!S&&(f.b.log("reparse from beginning"),E=!1,R=A-188),S=this.pmtParsed=!0;break;case 17:case 8191:break;default:E=!0}}else L++;L>0&&this.observer.emit(r.a.ERROR,r.a.ERROR,{type:a.b.MEDIA_ERROR,details:a.a.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+L+" TS packet/s that do not start with 0x47"}),l.pesData=v,h.pesData=y,d.pesData=T;var P={audioTrack:h,videoTrack:l,id3Track:d,textTrack:c};return s&&this.extractRemainingSamples(P),P},e.flush=function(){var t,e=this.remainderData;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t},e.extractRemainingSamples=function(t){var e,i=t.audioTrack,r=t.videoTrack,a=t.id3Track,n=t.textTrack,s=r.pesData,o=i.pesData,l=a.pesData;s&&(e=N(s))?(this.parseAVCPES(r,n,e,!0),r.pesData=null):r.pesData=s,o&&(e=N(o))?(i.isAAC?this.parseAACPES(i,e):this.parseMPEGPES(i,e),i.pesData=null):(null!=o&&o.size&&f.b.log("last AAC PES packet truncated,might overlap between fragments"),i.pesData=o),l&&(e=N(l))?(this.parseID3PES(a,e),a.pesData=null):a.pesData=l},e.demuxSampleAes=function(t,e,i){var r=this.demux(t,i,!0,!this.config.progressive),a=this.sampleAes=new x(this.observer,this.config,e);return this.decrypt(r,a)},e.decrypt=function(t,e){return new Promise(function(i){var r=t.audioTrack,a=t.videoTrack;r.samples&&r.isAAC?e.decryptAacSamples(r.samples,0,function(){a.samples?e.decryptAvcSamples(a.samples,0,0,function(){i(t)}):i(t)}):a.samples&&e.decryptAvcSamples(a.samples,0,0,function(){i(t)})})},e.destroy=function(){this._duration=0},e.parseAVCPES=function(t,e,i,r){var a,n=this,s=this.parseAVCNALu(t,i.data),o=this.avcSample,l=!1;i.data=null,o&&s.length&&!t.audFound&&(U(o,t),o=this.avcSample=F(!1,i.pts,i.dts,"")),s.forEach(function(r){switch(r.type){case 1:a=!0,o||(o=n.avcSample=F(!0,i.pts,i.dts,"")),o.frame=!0;var s=r.data;if(l&&s.length>4){var h=new P(s).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(o.key=!0)}break;case 5:a=!0,o||(o=n.avcSample=F(!0,i.pts,i.dts,"")),o.key=!0,o.frame=!0;break;case 6:a=!0,Object(u.i)(B(r.data),i.pts,e.samples);break;case 7:if(a=!0,l=!0,!t.sps){var d=new P(r.data).readSPS();t.width=d.width,t.height=d.height,t.pixelRatio=d.pixelRatio,t.sps=[r.data],t.duration=n._duration;for(var c=r.data.subarray(1,4),f="avc1.",g=0;g<3;g++){var v=c[g].toString(16);v.length<2&&(v="0"+v),f+=v}t.codec=f}break;case 8:a=!0,t.pps||(t.pps=[r.data]);break;case 9:a=!1,t.audFound=!0,o&&U(o,t),o=n.avcSample=F(!1,i.pts,i.dts,"");break;case 12:a=!1;break;default:a=!1,o&&(o.debug+="unknown NAL "+r.type+" ")}o&&a&&o.units.push(r)}),r&&o&&(U(o,t),this.avcSample=null)},e.getLastNalUnit=function(t){var e,i,r=this.avcSample;if(r&&0!==r.units.length||(r=t[t.length-1]),null!=(e=r)&&e.units){var a=r.units;i=a[a.length-1]}return i},e.parseAVCNALu=function(t,e){var i,r,a=e.byteLength,n=t.naluState||0,s=n,o=[],l=0,u=-1,h=0;for(-1===n&&(u=0,h=31&e[0],n=0,l=1);l<a;)if(i=e[l++],n)if(1!==n)if(i)if(1===i){if(u>=0){var d={data:e.subarray(u,l-n-1),type:h};o.push(d)}else{var c=this.getLastNalUnit(t.samples);if(c&&(s&&l<=4-s&&c.state&&(c.data=c.data.subarray(0,c.data.byteLength-s)),(r=l-n-1)>0)){var f=new Uint8Array(c.data.byteLength+r);f.set(c.data,0),f.set(e.subarray(0,r),c.data.byteLength),c.data=f,c.state=0}}l<a?(u=l,h=31&e[l],n=0):n=-1}else n=0;else n=3;else n=2*!i;else n=+!i;if(u>=0&&n>=0){var g={data:e.subarray(u,a),type:h,state:n};o.push(g)}if(0===o.length){var v=this.getLastNalUnit(t.samples);if(v){var p=new Uint8Array(v.data.byteLength+e.byteLength);p.set(v.data,0),p.set(e,v.data.byteLength),v.data=p}}return t.naluState=n,o},e.parseAACPES=function(t,e){var i,n,s,o,l,u=0,h=this.aacOverFlow,d=e.data;if(h){this.aacOverFlow=null;var c=h.sample.unit.byteLength,g=Math.min(h.missing,c);h.sample.unit.set(d.subarray(0,g),c-g),t.samples.push(h.sample),u=h.missing}for(i=u,n=d.length;i<n-1&&!m(d,i);i++);if(i===u||(i<n-1?(s="AAC PES did not start with ADTS header,offset:"+i,o=!1):(s="no ADTS header found in AAC PES",o=!0),f.b.warn("parsing error:"+s),this.observer.emit(r.a.ERROR,r.a.ERROR,{type:a.b.MEDIA_ERROR,details:a.a.FRAG_PARSING_ERROR,fatal:o,reason:s}),!o)){if(y(t,this.observer,d,i,this.audioCodec),void 0!==e.pts)l=e.pts;else{if(!h)return void f.b.warn("[tsdemuxer]: AAC PES unknown PTS");var v=9216e4/t.samplerate;l=h.sample.pts+v}for(var p=0;i<n;){if(m(d,i)){if(i+5<n){var E=T(t,d,i,l,p);if(E){if(!E.missing){i+=E.length,p++;continue}this.aacOverFlow=E}}break}i++}}},e.parseMPEGPES=function(t,e){var i=e.data,r=i.length,a=0,n=0,s=e.pts;if(void 0!==s)for(;n<r;)if(w(i,n)){var o=I(t,i,n,s,a);if(!o)break;n+=o.length,a++}else n++;else f.b.warn("[tsdemuxer]: MPEG PES unknown PTS")},e.parseID3PES=function(t,e){void 0!==e.pts?t.samples.push(e):f.b.warn("[tsdemuxer]: ID3 PES unknown PTS")},t}();function F(t,e,i,r){return{key:t,frame:!1,pts:e,dts:i,units:[],debug:r,length:0}}function N(t){var e,i,r,a,n,s=0,o=t.data;if(!t||0===t.size)return null;for(;o[0].length<19&&o.length>1;){var l=new Uint8Array(o[0].length+o[1].length);l.set(o[0]),l.set(o[1],o[0].length),o[0]=l,o.splice(1,1)}if(1===((e=o[0])[0]<<16)+(e[1]<<8)+e[2]){if((i=(e[4]<<8)+e[5])&&i>t.size-6)return null;var u=e[7];192&u&&(a=0x20000000*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&u?a-(n=0x20000000*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(f.b.warn(Math.round((a-n)/9e4)+"s delta between PTS and DTS, align them"),a=n):n=a);var h=(r=e[8])+9;if(t.size<=h)return null;t.size-=h;for(var d=new Uint8Array(t.size),c=0,g=o.length;c<g;c++){var v=(e=o[c]).byteLength;if(h){if(h>v){h-=v;continue}e=e.subarray(h),v-=h,h=0}d.set(e,s),s+=v}return i&&(i-=r+3),{data:d,pts:a,dts:n,len:i}}return null}function U(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){var i=e.samples,r=i.length;if(!r)return void e.dropped++;var a=i[r-1];t.pts=a.pts,t.dts=a.dts}e.samples.push(t)}t.debug.length&&f.b.log(t.pts+"/"+t.dts+":"+t.debug)}function B(t){for(var e=t.byteLength,i=[],r=1;r<e-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(i.push(r+2),r+=2):r++;if(0===i.length)return t;var a=e-i.length,n=new Uint8Array(a),s=0;for(r=0;r<a;s++,r++)s===i[0]&&(s++,i.shift()),n[r]=t[s];return n}function G(t,e){return(G=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}M.minProbeByteLength=188;var H=function(t){function e(){return t.apply(this,arguments)||this}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,G(e,t);var i=e.prototype;return i.resetInitSegment=function(e,i,r,a){t.prototype.resetInitSegment.call(this,e,i,r,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:i,duration:a,inputTimeScale:9e4,dropped:0}},e.probe=function(t){if(!t)return!1;for(var e=(o.b(t,0)||[]).length,i=t.length;e<i;e++)if(function(t,e){if(e+1<t.length&&C(t,e)){var i=O(t,e),r=4;null!=i&&i.frameLength&&(r=i.frameLength);var a=e+r;return a===t.length||w(t,a)}return!1}(t,e))return f.b.log("MPEG Audio sync word found !"),!0;return!1},i.canParse=function(t,e){return C(t,e)&&4<=t.length-e},i.appendFrame=function(t,e,i){if(null!==this.initPTS)return I(t,e,i,this.initPTS,this.frameIndex)},e}(d);H.minProbeByteLength=4;var j=i(12),K=i(6),V=function(){function t(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){this.initPTS=t,this.lastEndDTS=null},e.resetNextTimestamp=function(){this.lastEndDTS=null},e.resetInitSegment=function(t,e,i){this.audioCodec=e,this.videoCodec=i,this.generateInitSegment(t),this.emitInitSegment=!0},e.generateInitSegment=function(t){var e=this.audioCodec,i=this.videoCodec;if(!t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var r=this.initData=Object(u.h)(t);e||(e=Y(r.audio,K.a.AUDIO)),i||(i=Y(r.video,K.a.VIDEO));var a={};r.audio&&r.video?a.audiovideo={container:"video/mp4",codec:e+","+i,initSegment:t,id:"main"}:r.audio?a.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:r.video?a.video={container:"video/mp4",codec:i,initSegment:t,id:"main"}:f.b.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},e.remux=function(t,e,i,r,a){var n,o=this.initPTS,l=this.lastEndDTS,h={audio:void 0,video:void 0,text:r,id3:i,initSegment:void 0};Object(s.a)(l)||(l=this.lastEndDTS=a||0);var d=e.samples;if(!d||!d.length)return h;var c={initPTS:void 0,timescale:1},g=this.initData;if(g&&g.length||(this.generateInitSegment(d),g=this.initData),!g||!g.length)return f.b.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(c.tracks=this.initTracks,this.emitInitSegment=!1),Object(s.a)(o)||(this.initPTS=c.initPTS=o=W(g,d,l));var v=Object(u.d)(d,g),p=l,m=v+p;Object(u.f)(g,d,o),v>0?this.lastEndDTS=m:(f.b.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var y=!!g.audio,T=!!g.video,E="";y&&(E+="audio"),T&&(E+="video");var S={data1:d,startPTS:p,startDTS:p,endPTS:m,endDTS:m,type:E,hasAudio:y,hasVideo:T,nb:1,dropped:0};h.audio="audio"===S.type?S:void 0,h.video="audio"!==S.type?S:void 0,h.initSegment=c;var b=null!=(n=this.initPTS)?n:0;return h.id3=Object(j.b)(i,a,b,b),r.samples.length&&(h.text=Object(j.c)(r,a,b)),h},t}(),W=function(t,e,i){return Object(u.e)(t,e)-i};function Y(t,e){var i=null==t?void 0:t.codec;return i&&i.length>4?i:"hvc1"===i?"hvc1.1.c.L120.90":"av01"===i?"av01.0.04M.08":"avc1"===i||e===K.a.VIDEO?"avc1.42e01e":"mp4a.40.5"}var q,X=i(14);try{q=self.performance.now.bind(self.performance)}catch(t){f.b.debug("Unable to use Performance API on this environment"),q=self.Date.now}var z=[{demux:M,remux:j.a},{demux:_,remux:V},{demux:S,remux:j.a},{demux:H,remux:j.a}],Q=1024;z.forEach(function(t){var e=t.demux;Q=Math.max(Q,e.minProbeByteLength)});var $=function(){function t(t,e,i,r,a){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new X.a,this.observer=t,this.typeSupported=e,this.config=i,this.vendor=r,this.id=a}var e=t.prototype;return e.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},e.push=function(t,e,i,r){var a,n=this,s=i.transmuxing;s.executeStart=q();var o=new Uint8Array(t),l=this.cache,h=this.config,d=this.currentTransmuxState,c=this.transmuxConfig;r&&(this.currentTransmuxState=r);var f=(a=null,o.byteLength>0&&null!=e&&null!=e.key&&null!==e.iv&&null!=e.method&&(a=e),a);if(f&&"AES-128"===f.method){var g=this.getDecrypter();if(!h.enableSoftwareAES)return this.decryptionPromise=g.webCryptoDecrypt(o,f.key.buffer,f.iv.buffer).then(function(t){var e=n.push(t,null,i);return n.decryptionPromise=null,e}),this.decryptionPromise;var v=g.softwareDecrypt(o,f.key.buffer,f.iv.buffer);if(!v)return s.executeEnd=q(),Z(i);o=new Uint8Array(v)}var p=r||d,m=p.contiguous,y=p.discontinuity,T=p.trackSwitch,E=p.accurateTimeOffset,S=p.timeOffset,b=p.initSegmentChange,_=c.audioCodec,A=c.videoCodec,L=c.defaultInitPts,R=c.duration,D=c.initSegmentData;if((y||T||b)&&this.resetInitSegment(D,_,A,R),(y||b)&&this.resetInitialTimestamp(L),m||this.resetContiguity(),this.needsProbing(o,y,T)){if(l.dataLength){var k=l.flush();o=Object(u.b)(k,o)}this.configureTransmuxer(o,c)}var I=this.transmux(o,f,S,E,i),O=this.currentTransmuxState;return O.contiguous=!0,O.discontinuity=!1,O.trackSwitch=!1,s.executeEnd=q(),I},e.flush=function(t){var e=this,i=t.transmuxing;i.executeStart=q();var n=this.decrypter,s=this.cache,o=this.currentTransmuxState,l=this.decryptionPromise;if(l)return l.then(function(){return e.flush(t)});var u=[],h=o.timeOffset;if(n){var d=n.flush();d&&u.push(this.push(d,null,t))}var c=s.dataLength;s.reset();var f=this.demuxer,g=this.remuxer;if(!f||!g)return c>=Q&&this.observer.emit(r.a.ERROR,r.a.ERROR,{type:a.b.MEDIA_ERROR,details:a.a.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),i.executeEnd=q(),[Z(t)];var v=f.flush(h);return J(v)?v.then(function(i){return e.flushRemux(u,i,t),u}):(this.flushRemux(u,v,t),u)},e.flushRemux=function(t,e,i){var r=e.audioTrack,a=e.videoTrack,n=e.id3Track,s=e.textTrack,o=this.currentTransmuxState,l=o.accurateTimeOffset,u=o.timeOffset;f.b.log("[transmuxer.ts]: Flushed fragment "+i.sn+(i.part>-1?" p: "+i.part:"")+" of level "+i.level);var h=this.remuxer.remux(r,a,n,s,u,l,!0,this.id);t.push({remuxResult:h,chunkMeta:i}),i.transmuxing.executeEnd=q()},e.resetInitialTimestamp=function(t){var e=this.demuxer,i=this.remuxer;e&&i&&(e.resetTimeStamp(t),i.resetTimeStamp(t))},e.resetContiguity=function(){var t=this.demuxer,e=this.remuxer;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())},e.resetInitSegment=function(t,e,i,r){var a=this.demuxer,n=this.remuxer;a&&n&&(a.resetInitSegment(t,e,i,r),n.resetInitSegment(t,e,i))},e.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},e.transmux=function(t,e,i,r,a){return e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,i,r,a):this.transmuxUnencrypted(t,i,r,a)},e.transmuxUnencrypted=function(t,e,i,r){var a=this.demuxer.demux(t,e,!1,!this.config.progressive),n=a.audioTrack,s=a.videoTrack,o=a.id3Track,l=a.textTrack;return{remuxResult:this.remuxer.remux(n,s,o,l,e,i,!1,this.id),chunkMeta:r}},e.transmuxSampleAes=function(t,e,i,r,a){var n=this;return this.demuxer.demuxSampleAes(t,e,i).then(function(t){return{remuxResult:n.remuxer.remux(t.audioTrack,t.videoTrack,t.id3Track,t.textTrack,i,r,!1,n.id),chunkMeta:a}})},e.configureTransmuxer=function(t,e){for(var i,r=this.config,a=this.observer,n=this.typeSupported,s=this.vendor,o=e.audioCodec,l=e.defaultInitPts,u=e.duration,h=e.initSegmentData,d=e.videoCodec,c=0,g=z.length;c<g;c++)if(z[c].demux.probe(t)){i=z[c];break}i||(f.b.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),i={demux:_,remux:V});var v=this.demuxer,p=this.remuxer,m=i.remux,y=i.demux;p&&p instanceof m||(this.remuxer=new m(a,r,n,s)),v&&v instanceof y||(this.demuxer=new y(a,r,n),this.probe=y.probe),this.resetInitSegment(h,o,d,u),this.resetInitialTimestamp(l)},e.needsProbing=function(t,e,i){return!this.demuxer||!this.remuxer||e||i},e.getDecrypter=function(){var t=this.decrypter;return t||(t=this.decrypter=new n.a(this.observer,this.config)),t},t}(),Z=function(t){return{remuxResult:{},chunkMeta:t}};function J(t){return"then"in t&&t.then instanceof Function}var tt=function(t,e,i,r,a){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=i,this.duration=r,this.defaultInitPts=a},te=function(t,e,i,r,a,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=t,this.contiguous=e,this.accurateTimeOffset=i,this.trackSwitch=r,this.timeOffset=a,this.initSegmentChange=n}},function(t,e,i){var r,a,n,s,o;r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,a=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,t.exports=o={buildAbsoluteURL:function(t,e,i){if(i=i||{},t=t.trim(),!(e=e.trim())){if(!i.alwaysNormalize)return t;var r=o.parseURL(t);if(!r)throw Error("Error trying to parse base URL.");return r.path=o.normalizePath(r.path),o.buildURLFromParts(r)}var n=o.parseURL(e);if(!n)throw Error("Error trying to parse relative URL.");if(n.scheme)return i.alwaysNormalize?(n.path=o.normalizePath(n.path),o.buildURLFromParts(n)):e;var s=o.parseURL(t);if(!s)throw Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=a.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(u.netLoc=s.netLoc,"/"!==n.path[0]))if(n.path){var h=s.path,d=h.substring(0,h.lastIndexOf("/")+1)+n.path;u.path=o.normalizePath(d)}else u.path=s.path,n.params||(u.params=s.params,n.query||(u.query=s.query));return null===u.path&&(u.path=i.alwaysNormalize?o.normalizePath(n.path):n.path),o.buildURLFromParts(u)},parseURL:function(t){var e=r.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(n,"");t.length!==(t=t.replace(s,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}}},function(t,e,i){i.d(e,"a",function(){return v}),i.d(e,"d",function(){return p}),i.d(e,"b",function(){return m}),i.d(e,"c",function(){return y});var r=i(3),a=function(){function t(){}return t.getSilentFrame=function(t,e){if("mp4a.40.2"===t){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)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(6===e)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(1===e)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(2===e||3===e)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])}},t}(),n=function(){function t(){}return t.init=function(){for(e in t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);t.HDLR_TYPES={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]),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])};var e,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);t.STTS=t.STSC=t.STCO=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var r=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),n=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,r,n,r,a),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,i))},t.box=function(t){for(var e=8,i=arguments.length,r=Array(i>1?i-1:0),a=1;a<i;a++)r[a-1]=arguments[a];for(var n=r.length,s=n;n--;)e+=r[n].byteLength;var o=new Uint8Array(e);for(o[0]=e>>24&255,o[1]=e>>16&255,o[2]=e>>8&255,o[3]=255&e,o.set(t,4),n=0,e=8;n<s;n++)o.set(r[n],e),e+=r[n].byteLength;return o},t.hdlr=function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])},t.mdat=function(e){return t.box(t.types.mdat,e)},t.mdhd=function(e,i){var r=Math.floor((i*=e)/0x100000000),a=Math.floor(i%0x100000000);return t.box(t.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,a>>24,a>>16&255,a>>8&255,255&a,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,i,r){return t.box(t.types.moof,t.mfhd(e),t.traf(r,i))},t.moov=function(e){for(var i=e.length,r=[];i--;)r[i]=t.trak(e[i]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(r).concat(t.mvex(e)))},t.mvex=function(e){for(var i=e.length,r=[];i--;)r[i]=t.trex(e[i]);return t.box.apply(null,[t.types.mvex].concat(r))},t.mvhd=function(e,i){var r=Math.floor((i*=e)/0x100000000),a=Math.floor(i%0x100000000),n=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,a>>24,a>>16&255,a>>8&255,255&a,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,n)},t.sdtp=function(e){var i,r,a=e.samples||[],n=new Uint8Array(4+a.length);for(i=0;i<a.length;i++)r=a[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return t.box(t.types.sdtp,n)},t.stbl=function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))},t.avc1=function(e){var i,r,a,n=[],s=[];for(i=0;i<e.sps.length;i++)a=(r=e.sps[i]).byteLength,n.push(a>>>8&255),n.push(255&a),n=n.concat(Array.prototype.slice.call(r));for(i=0;i<e.pps.length;i++)a=(r=e.pps[i]).byteLength,s.push(a>>>8&255),s.push(255&a),s=s.concat(Array.prototype.slice.call(r));var o=t.box(t.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|e.sps.length].concat(n).concat([e.pps.length]).concat(s))),l=e.width,u=e.height,h=e.pixelRatio[0],d=e.pixelRatio[1];return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,255&h,d>>24,d>>16&255,d>>8&255,255&d])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var i=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,i>>8&255,255&i,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var i=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,i>>8&255,255&i,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var i=e.id,r=e.duration*e.timescale,a=e.width,n=e.height,s=Math.floor(r/0x100000000),o=Math.floor(r%0x100000000);return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,255&i,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,o>>24,o>>16&255,o>>8&255,255&o,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,n>>8&255,255&n,0,0]))},t.traf=function(e,i){var r=t.sdtp(e),a=e.id,n=Math.floor(i/0x100000000),s=Math.floor(i%0x100000000);return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,s>>24,s>>16&255,s>>8&255,255&s])),t.trun(e,r.length+16+20+8+16+8+8),r)},t.trak=function(e){return e.duration=e.duration||0xffffffff,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var i=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,i){var r,a,n,s,o,l,u=e.samples||[],h=u.length,d=12+16*h,c=new Uint8Array(d);for(i+=8+d,c.set([0,0,15,1,h>>>24&255,h>>>16&255,h>>>8&255,255&h,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0),r=0;r<h;r++)n=(a=u[r]).duration,s=a.size,o=a.flags,l=a.cts,c.set([n>>>24&255,n>>>16&255,n>>>8&255,255&n,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*r);return t.box(t.types.trun,c)},t.initSegment=function(e){t.types||t.init();var i=t.moov(e),r=new Uint8Array(t.FTYP.byteLength+i.byteLength);return r.set(t.FTYP),r.set(i,t.FTYP.byteLength),r},t}();n.types=void 0,n.HDLR_TYPES=void 0,n.STTS=void 0,n.STSC=void 0,n.STCO=void 0,n.STSZ=void 0,n.VMHD=void 0,n.SMHD=void 0,n.STSD=void 0,n.FTYP=void 0,n.DINF=void 0;var s=i(0),o=i(2),l=i(1),u=i(4),h=i(8);function d(){return(d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}var c=null,f=null,g=!1,v=function(){function t(t,e,i,r){if(void 0===r&&(r=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=t,this.config=e,this.typeSupported=i,this.ISGenerated=!1,null===c){var a=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);c=a?parseInt(a[1]):0}if(null===f){var n=navigator.userAgent.match(/Safari\/(\d+)/i);f=n?parseInt(n[1]):0}g=!!c&&c<75||!!f&&f<600}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){l.b.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=t},e.resetNextTimestamp=function(){l.b.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},e.resetInitSegment=function(){l.b.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},e.getVideoStartPts=function(t){var e=!1,i=t.reduce(function(t,i){var r=i.pts-t;return r<-0x100000000?(e=!0,p(t,i.pts)):r>0?t:i.pts},t[0].pts);return e&&l.b.debug("PTS rollover detected"),i},e.remux=function(t,e,i,r,a,n,s,o){var h,d,c,f,g,v,T=a,E=a,S=t.pid>-1,b=e.pid>-1,_=e.samples.length,A=t.samples.length>0,L=_>1;if((!S||A)&&(!b||L)||this.ISGenerated||s){this.ISGenerated||(c=this.generateIS(t,e,a));var R=this.isVideoContiguous,D=-1;if(L&&(D=function(t){for(var e=0;e<t.length;e++)if(t[e].key)return e;return -1}(e.samples),!R&&this.config.forceKeyFrameOnDiscontinuity))if(v=!0,D>0){l.b.warn("[mp4-remuxer]: Dropped "+D+" out of "+_+" video samples due to a missing keyframe");var k=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(D),e.dropped+=D,E+=(e.samples[0].pts-k)/(e.timescale||9e4)}else -1===D&&(l.b.warn("[mp4-remuxer]: No keyframe found out of "+_+" video samples"),v=!1);if(this.ISGenerated){if(A&&L){var I=this.getVideoStartPts(e.samples),O=(p(t.samples[0].pts,I)-I)/e.inputTimeScale;T+=Math.max(0,O),E+=Math.max(0,-O)}if(A){if(t.samplerate||(l.b.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),c=this.generateIS(t,e,a)),d=this.remuxAudio(t,T,this.isAudioContiguous,n,b||L||o===u.b.AUDIO?E:void 0),L){var C=d?d.endPTS-d.startPTS:0;e.inputTimeScale||(l.b.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),c=this.generateIS(t,e,a)),h=this.remuxVideo(e,E,R,C)}}else L&&(h=this.remuxVideo(e,E,R,0));h&&(h.firstKeyFrame=D,h.independent=-1!==D)}}return this.ISGenerated&&(i.samples.length&&(g=m(i,a,this._initPTS,this._initDTS)),r.samples.length&&(f=y(r,a,this._initPTS))),{audio:d,video:h,initSegment:c,independent:v,text:f,id3:g}},e.generateIS=function(t,e,i){var a,s,o,l=t.samples,u=e.samples,h=this.typeSupported,d={},c=!Object(r.a)(this._initPTS),f="audio/mp4";if(c&&(a=s=1/0),t.config&&l.length&&(t.timescale=t.samplerate,t.isAAC||(h.mpeg?(f="audio/mpeg",t.codec=""):h.mp3&&(t.codec="mp3")),d.audio={id:"audio",container:f,codec:t.codec,initSegment:!t.isAAC&&h.mpeg?new Uint8Array(0):n.initSegment([t]),metadata:{channelCount:t.channelCount}},c&&(o=t.inputTimeScale,a=s=l[0].pts-Math.round(o*i))),e.sps&&e.pps&&u.length&&(e.timescale=e.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:n.initSegment([e]),metadata:{width:e.width,height:e.height}},c)){o=e.inputTimeScale;var g=this.getVideoStartPts(u),v=Math.round(o*i);s=Math.min(s,p(u[0].dts,g)-v),a=Math.min(a,g-v)}if(Object.keys(d).length)return this.ISGenerated=!0,c&&(this._initPTS=a,this._initDTS=s),{tracks:d,initPTS:a,timescale:o}},e.remuxVideo=function(t,e,i,r){var a,u,f,v=t.inputTimeScale,m=t.samples,y=[],E=m.length,S=this._initPTS,b=this.nextAvcDts,_=8,A=1/0,L=-1/0,R=0,D=!1;i&&null!==b||(b=e*v-(m[0].pts-p(m[0].dts,m[0].pts)));for(var k=0;k<E;k++){var I=m[k];I.pts=p(I.pts-S,b),I.dts=p(I.dts-S,b),I.dts>I.pts&&(R=Math.max(Math.min(R,I.pts-I.dts),-18e3)),I.dts<m[k>0?k-1:k].dts&&(D=!0)}D&&m.sort(function(t,e){var i=t.dts-e.dts,r=t.pts-e.pts;return i||r}),u=m[0].dts;var O=Math.round(((f=m[m.length-1].dts)-u)/(E-1));if(R<0){if(R<-2*O){l.b.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(h.b)(-O,!0)+" ms");for(var C=R,w=0;w<E;w++)m[w].dts=C=Math.max(C,m[w].pts-O),m[w].pts=Math.max(C,m[w].pts)}else{l.b.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(h.b)(R,!0)+" ms to overcome this issue");for(var P=0;P<E;P++)m[P].dts=m[P].dts+R}u=m[0].dts}if(i){var x=u-b,M=x>O;if(M||x<-1){M?l.b.warn("AVC: "+Object(h.b)(x,!0)+" ms ("+x+"dts) hole between fragments detected, filling it"):l.b.warn("AVC: "+Object(h.b)(-x,!0)+" ms ("+x+"dts) overlapping between fragments detected"),u=b;var F=m[0].pts-x;m[0].dts=u,m[0].pts=F,l.b.log("Video: First PTS/DTS adjusted: "+Object(h.b)(F,!0)+"/"+Object(h.b)(u,!0)+", delta: "+Object(h.b)(x,!0)+" ms")}}g&&(u=Math.max(0,u));for(var N=0,U=0,B=0;B<E;B++){for(var G=m[B],H=G.units,j=H.length,K=0,V=0;V<j;V++)K+=H[V].data.length;U+=K,N+=j,G.length=K,G.dts=Math.max(G.dts,u),G.pts=Math.max(G.pts,G.dts,0),A=Math.min(G.pts,A),L=Math.max(G.pts,L)}f=m[E-1].dts;var W,Y=U+4*N+8;try{W=new Uint8Array(Y)}catch(t){return void this.observer.emit(s.a.ERROR,s.a.ERROR,{type:o.b.MUX_ERROR,details:o.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:Y,reason:"fail allocating video mdat "+Y})}var q=new DataView(W.buffer);q.setUint32(0,Y),W.set(n.types.mdat,4);for(var X=0;X<E;X++){for(var z=m[X],Q=z.units,$=0,Z=0,J=Q.length;Z<J;Z++){var tt=Q[Z],te=tt.data,ti=tt.data.byteLength;q.setUint32(_,ti),_+=4,W.set(te,_),_+=ti,$+=4+ti}if(X<E-1)a=m[X+1].dts-z.dts;else{var tr=this.config,ta=z.dts-m[X>0?X-1:X].dts;if(tr.stretchShortVideoTrack&&null!==this.nextAudioPts){var tn=Math.floor(tr.maxBufferHole*v),ts=(r?A+r*v:this.nextAudioPts)-z.pts;ts>tn?((a=ts-ta)<0&&(a=ta),l.b.log("[mp4-remuxer]: It is approximately "+ts/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=ta}else a=ta}var to=Math.round(z.pts-z.dts);y.push(new T(z.key,a,$,to))}if(y.length&&c&&c<70){var tl=y[0].flags;tl.dependsOn=2,tl.isNonSync=0}this.nextAvcDts=b=f+a,this.isVideoContiguous=!0;var tu={data1:n.moof(t.sequenceNumber++,u,d({},t,{samples:y})),data2:W,startPTS:A/v,endPTS:(L+a)/v,startDTS:u/v,endDTS:b/v,type:"video",hasAudio:!1,hasVideo:!0,nb:y.length,dropped:t.dropped};return t.samples=[],t.dropped=0,tu},e.remuxAudio=function(t,e,i,r,u){var h=t.inputTimeScale,c=h/(t.samplerate?t.samplerate:h),f=t.isAAC?1024:1152,g=f*c,v=this._initPTS,m=!t.isAAC&&this.typeSupported.mpeg,y=[],E=t.samples,S=8*!m,b=this.nextAudioPts||-1,_=e*h;if(this.isAudioContiguous=i=i||E.length&&b>0&&(r&&9e3>Math.abs(_-b)||Math.abs(p(E[0].pts-v,_)-b)<20*g),E.forEach(function(t){t.pts=p(t.pts-v,_)}),!i||b<0){if(!(E=E.filter(function(t){return t.pts>=0})).length)return;b=0===u?0:r?Math.max(0,_):E[0].pts}if(t.isAAC)for(var A=void 0!==u,L=this.config.maxAudioFramesDrift,R=0,D=b;R<E.length;R++){var k=E[R],I=k.pts,O=I-D,C=Math.abs(1e3*O/h);if(O<=-L*g&&A)0===R&&(l.b.warn("Audio frame @ "+(I/h).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*O/h)+" ms."),this.nextAudioPts=b=D=I);else if(O>=L*g&&C<1e4&&A){var w=Math.round(O/g);(D=I-w*g)<0&&(w--,D+=g),0===R&&(this.nextAudioPts=b=D),l.b.warn("[mp4-remuxer]: Injecting "+w+" audio frame @ "+(D/h).toFixed(3)+"s due to "+Math.round(1e3*O/h)+" ms gap.");for(var P=0;P<w;P++){var x=Math.max(D,0),M=a.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);M||(l.b.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),M=k.unit.subarray()),E.splice(R,0,{unit:M,pts:x}),D+=g,R++}}k.pts=D,D+=g}for(var F,N=null,U=null,B=0,G=E.length;G--;)B+=E[G].unit.byteLength;for(var H=0,j=E.length;H<j;H++){var K=E[H],V=K.unit,W=K.pts;if(null!==U)y[H-1].duration=Math.round((W-U)/c);else{if(i&&t.isAAC&&(W=b),N=W,!(B>0))return;B+=S;try{F=new Uint8Array(B)}catch(t){return void this.observer.emit(s.a.ERROR,s.a.ERROR,{type:o.b.MUX_ERROR,details:o.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:B,reason:"fail allocating audio mdat "+B})}m||(new DataView(F.buffer).setUint32(0,B),F.set(n.types.mdat,4))}F.set(V,S);var Y=V.byteLength;S+=Y,y.push(new T(!0,f,Y,0)),U=W}var q=y.length;if(q){var X=y[y.length-1];this.nextAudioPts=b=U+c*X.duration;var z=m?new Uint8Array(0):n.moof(t.sequenceNumber++,N/c,d({},t,{samples:y}));t.samples=[];var Q=N/h,$=b/h,Z={data1:z,data2:F,startPTS:Q,endPTS:$,startDTS:Q,endDTS:$,type:"audio",hasAudio:!0,hasVideo:!1,nb:q};return this.isAudioContiguous=!0,Z}},e.remuxEmptyAudio=function(t,e,i,r){var n=t.inputTimeScale,s=n/(t.samplerate?t.samplerate:n),o=this.nextAudioPts,u=(null!==o?o:r.startDTS*n)+this._initDTS,h=r.endDTS*n+this._initDTS,d=1024*s,c=Math.ceil((h-u)/d),f=a.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(l.b.warn("[mp4-remuxer]: remux empty Audio"),f){for(var g=[],v=0;v<c;v++){var p=u+v*d;g.push({unit:f,pts:p,dts:p})}return t.samples=g,this.remuxAudio(t,e,i,!1)}l.b.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")},t}();function p(t,e){var i;if(null===e)return t;for(i=e<t?-0x200000000:0x200000000;Math.abs(t-e)>0x100000000;)t+=i;return t}function m(t,e,i,r){var a=t.samples.length;if(a){for(var n=t.inputTimeScale,s=0;s<a;s++){var o=t.samples[s];o.pts=p(o.pts-i,e*n)/n,o.dts=p(o.dts-r,e*n)/n}var l=t.samples;return t.samples=[],{samples:l}}}function y(t,e,i){var r=t.samples.length;if(r){for(var a=t.inputTimeScale,n=0;n<r;n++){var s=t.samples[n];s.pts=p(s.pts-i,e*a)/a}t.samples.sort(function(t,e){return t.pts-e.pts});var o=t.samples;return t.samples=[],{samples:o}}}var T=function(t,e,i,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=i,this.cts=r,this.flags=new E(t)},E=function(t){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=+!t}},function(t,e,i){i.d(e,"a",function(){return r});var r=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},function(t,e,i){i.d(e,"a",function(){return r});var r=function(){function t(){this.chunks=[],this.dataLength=0}var e=t.prototype;return e.push=function(t){this.chunks.push(t),this.dataLength+=t.length},e.flush=function(){var t,e=this.chunks,i=this.dataLength;return e.length?(t=1===e.length?e[0]:function(t,e){for(var i=new Uint8Array(e),r=0,a=0;a<t.length;a++){var n=t[a];i.set(n,r),r+=n.length}return i}(e,i),this.reset(),t):new Uint8Array(0)},e.reset=function(){this.chunks.length=0,this.dataLength=0},t}()},function(t,e,i){var r=Object.prototype.hasOwnProperty,a="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,i,r,n){if("function"!=typeof i)throw TypeError("The listener must be a function");var o=new s(i,r||t,n),l=a?a+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function l(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function u(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(a=!1)),u.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)r.call(t,e)&&i.push(a?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},u.prototype.listeners=function(t){var e=a?a+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,n=i.length,s=Array(n);r<n;r++)s[r]=i[r].fn;return s},u.prototype.listenerCount=function(t){var e=a?a+t:t,i=this._events[e];return i?i.fn?1:i.length:0}
vendor: 4,147 bytes, line 1
1,u.prototype.emit=function(t,e,i,r,n,s){var o=a?a+t:t;if(!this._events[o])return!1;var l,u,h=this._events[o],d=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),d){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,i),!0;case 4:return h.fn.call(h.context,e,i,r),!0;case 5:return h.fn.call(h.context,e,i,r,n),!0;case 6:return h.fn.call(h.context,e,i,r,n,s),!0}for(u=1,l=Array(d-1);u<d;u++)l[u-1]=arguments[u];h.fn.apply(h.context,l)}else{var c,f=h.length;for(u=0;u<f;u++)switch(h[u].once&&this.removeListener(t,h[u].fn,void 0,!0),d){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,e);break;case 3:h[u].fn.call(h[u].context,e,i);break;case 4:h[u].fn.call(h[u].context,e,i,r);break;default:if(!l)for(c=1,l=Array(d-1);c<d;c++)l[c-1]=arguments[c];h[u].fn.apply(h[u].context,l)}}return!0},u.prototype.on=function(t,e,i){return o(this,t,e,i,!1)},u.prototype.once=function(t,e,i){return o(this,t,e,i,!0)},u.prototype.removeListener=function(t,e,i,r){var n=a?a+t:t;if(!this._events[n])return this;if(!e)return l(this,n),this;var s=this._events[n];if(s.fn)s.fn!==e||r&&!s.once||i&&s.context!==i||l(this,n);else{for(var o=0,u=[],h=s.length;o<h;o++)(s[o].fn!==e||r&&!s[o].once||i&&s[o].context!==i)&&u.push(s[o]);u.length?this._events[n]=1===u.length?u[0]:u:l(this,n)}return this},u.prototype.removeAllListeners=function(t){var e;return t?(e=a?a+t:t,this._events[e]&&l(this,e)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=a,u.EventEmitter=u,t.exports=u},function(t,e,i){i.d(e,"a",function(){return u});var r=function(){function t(t,e){this.subtle=void 0,this.aesIV=void 0,this.subtle=t,this.aesIV=e}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)},t}(),a=function(){function t(t,e){this.subtle=void 0,this.key=void 0,this.subtle=t,this.key=e}return t.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},t}(),n=i(9),s=function(){function t(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var e=t.prototype;return e.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),i=new Uint32Array(4),r=0;r<4;r++)i[r]=e.getUint32(4*r);return i},e.initTable=function(){var t=this.sBox,e=this.invSBox,i=this.subMix,r=i[0],a=i[1],n=i[2],s=i[3],o=this.invSubMix,l=o[0],u=o[1],h=o[2],d=o[3],c=new Uint32Array(256),f=0,g=0,v=0;for(v=0;v<256;v++)c[v]=v<128?v<<1:v<<1^283;for(v=0;v<256;v++){var p=g^g<<1^g<<2^g<<3^g<<4;p=p>>>8^255&p^99,t[f]=p,e[p]=f;var m=c[f],y=c[m],T=c[y],E=257*c[p]^0x1010100*p;r[f]=E<<24|E>>>8,a[f]=E<<16|E>>>16,n[f]=E<<8|E>>>24,s[f]=E,E=0x1010101*T^65537*y^257*m^0x1010100*f,l[p]=E<<24|E>>>8,u[p]=E<<16|E>>>16,h[p]=E<<8|E>>>24,d[p]=E,f?(f=m^c[c[c[T^m]]],g^=c[c[g]]):f=g=1}},e.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),i=!0,r=0;r<e.length&&i;)i=e[r]===this.key[r],r++;if(!i){this.key=e;var a=this.keySize=e.length;if(4!==a&&6!==a&&8!==a)throw Error("Invalid aes key size="+a);var n,s,o,l,u=this.ksRows=4*(a+6+1),h=this.keySchedule=new Uint32Array(u),d=this.invKeySchedule=new Uint32Array(u),c=this.sBox,f=this.rcon,g=this.invSubMix,v=g[0],p=g[1],m=g[2],y=g[3];for(n=0;n<u;n++)n<a?o=h[n]=e[n]:(l=o,n%a==0?l=(c[(l=l<<8|l>>>24)>>>24]<<24|c[l>>>16&255]<<16|c[l>>>8&255]<<8|c[255&l])^f[n/a|0]<<24:a>6&&n%a==4&&(l=c[l>>>24]<<24|c[l>>>16&255]<<16|c[l>>>8&255]<<8|c[255&l]),h[n]=o=(h[n-a]^l)>>>0);for(s=0;s<u;s++)n=u-s,l=3&s?h[n]:h[n-4],d[s]=s<4||n<=4?l:v[c[l>>>24]]^p[c[l>>>16&255]]^m[c[l>>>8&255]]^y[c[255&l]],d[s]=d[s]>>>0}},e.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<<8|(0xff0000&t)>>8|t>>>24}
vendor: 40,920 bytes, line 1
1,e.decrypt=function(t,e,i){for(var r,a,n,s,o,l,u,h,d,c,f,g,v,p,m=this.keySize+6,y=this.invKeySchedule,T=this.invSBox,E=this.invSubMix,S=E[0],b=E[1],_=E[2],A=E[3],L=this.uint8ArrayToUint32Array_(i),R=L[0],D=L[1],k=L[2],I=L[3],O=new Int32Array(t),C=new Int32Array(O.length),w=this.networkToHostOrderSwap;e<O.length;){for(d=w(O[e]),c=w(O[e+1]),f=w(O[e+2]),g=w(O[e+3]),o=d^y[0],l=g^y[1],u=f^y[2],h=c^y[3],v=4,p=1;p<m;p++)r=S[o>>>24]^b[l>>16&255]^_[u>>8&255]^A[255&h]^y[v],a=S[l>>>24]^b[u>>16&255]^_[h>>8&255]^A[255&o]^y[v+1],n=S[u>>>24]^b[h>>16&255]^_[o>>8&255]^A[255&l]^y[v+2],s=S[h>>>24]^b[o>>16&255]^_[l>>8&255]^A[255&u]^y[v+3],o=r,l=a,u=n,h=s,v+=4;r=T[o>>>24]<<24^T[l>>16&255]<<16^T[u>>8&255]<<8^T[255&h]^y[v],a=T[l>>>24]<<24^T[u>>16&255]<<16^T[h>>8&255]<<8^T[255&o]^y[v+1],n=T[u>>>24]<<24^T[h>>16&255]<<16^T[o>>8&255]<<8^T[255&l]^y[v+2],s=T[h>>>24]<<24^T[o>>16&255]<<16^T[l>>8&255]<<8^T[255&u]^y[v+3],C[e]=w(r^R),C[e+1]=w(s^D),C[e+2]=w(n^k),C[e+3]=w(a^I),R=d,D=c,k=f,I=g,e+=4}return C.buffer},t}(),o=i(1),l=i(5),u=function(){function t(t,e,i){var r=(void 0===i?{}:i).removePKCS7Padding,a=void 0===r||r;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=t,this.config=e,this.removePKCS7Padding=a,a)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(t){}null===this.subtle&&(this.config.enableSoftwareAES=!0)}var e=t.prototype;return e.destroy=function(){this.observer=null},e.isSync=function(){return this.config.enableSoftwareAES},e.flush=function(){var t=this.currentResult;if(t){var e,i,r=new Uint8Array(t);return this.reset(),this.removePKCS7Padding&&(i=(e=r.byteLength)&&new DataView(r.buffer).getUint8(e-1))?Object(n.a)(r,0,e-i):r}this.reset()},e.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},e.decrypt=function(t,e,i,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(t),e,i);var a=this.flush();a&&r(a.buffer)}else this.webCryptoDecrypt(new Uint8Array(t),e,i).then(r)},e.softwareDecrypt=function(t,e,i){var r=this.currentIV,a=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(t=Object(l.b)(o,t),this.remainderData=null);var u=this.getValidChunk(t);if(!u.length)return null;r&&(i=r);var h=this.softwareDecrypter;return h||(h=this.softwareDecrypter=new s),h.expandKey(e),this.currentResult=h.decrypt(u.buffer,0,i),this.currentIV=Object(n.a)(u,-16).buffer,a||null},e.webCryptoDecrypt=function(t,e,i){var n=this,s=this.subtle;return this.key===e&&this.fastAesKey||(this.key=e,this.fastAesKey=new a(s,e)),this.fastAesKey.expandKey().then(function(e){return s?new r(s,i).decrypt(t.buffer,e):Promise.reject(Error("web crypto not initialized"))}).catch(function(r){return n.onWebCryptoError(r,t,e,i)})},e.onWebCryptoError=function(t,e,i,r){return o.b.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",t),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(e,i,r)},e.getValidChunk=function(t){var e=t,i=t.length-t.length%16;return i!==t.length&&(e=Object(n.a)(t,0,i),this.remainderData=Object(n.a)(t,i)),e},e.logOnce=function(t){this.logEnabled&&(o.b.log("[decrypter.ts]: "+t),this.logEnabled=!1)},t}()},function(t,e,i){i.d(e,"a",function(){return n});var r=i(11);function a(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var n=function(){var t,e;function i(t,e){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,this._uri=e?Object(r.buildAbsoluteURL)(t,e,{alwaysNormalize:!0}):t}return i.fromURL=function(t,e){return new i(t,e)},i.fromURI=function(t){return new i(t)},t=[{key:"uri",get:function(){return this._uri}}],a(i.prototype,t),e&&a(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}()},function(t,e,i){function r(t){var e={};function i(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i.oe=function(t){throw t};var r=i(i.s=ENTRY_MODULE);return r.default||r}function a(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}t.exports=function(t,e){e=e||{};var n={main:i.m},s=e.all?{main:Object.keys(n.main)}:function(t,e){for(var r={main:[e]},n={main:[]},s={main:{}};function(t){return Object.keys(t).reduce(function(e,i){return e||t[i].length>0},!1)}(r);)for(var o=Object.keys(r),l=0;l<o.length;l++){var u=o[l],h=r[u].pop();if(s[u]=s[u]||{},!s[u][h]&&t[u][h]){s[u][h]=!0,n[u]=n[u]||[],n[u].push(h);for(var d=function(t,e,r){var n={};n[r]=[];var s=e.toString(),o=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return n;for(var l,u=o[1],h=RegExp("(\\\\n|\\W)"+a(u)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");l=h.exec(s);)"dll-reference"!==l[3]&&n[r].push(l[3]);for(h=RegExp("\\("+a(u)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");l=h.exec(s);)t[l[2]]||(n[r].push(l[1]),t[l[2]]=i(l[1]).m),n[l[2]]=n[l[2]]||[],n[l[2]].push(l[4]);for(var d=Object.keys(n),c=0;c<d.length;c++)for(var f=0;f<n[d[c]].length;f++)isNaN(+n[d[c]][f])||(n[d[c]][f]=+n[d[c]][f]);return n}(t,t[u][h],u),c=Object.keys(d),f=0;f<c.length;f++)r[c[f]]=r[c[f]]||[],r[c[f]]=r[c[f]].concat(d[c[f]])}}return n}(n,t),o="";Object.keys(s).filter(function(t){return"main"!==t}).forEach(function(t){for(var e=0;s[t][e];)e++;s[t].push(e),n[t][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+t+" = ("+r.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+s[t].map(function(e){return JSON.stringify(e)+": "+n[t][e].toString()}).join(",")+"});\n"}),o=o+"new (("+r.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+s.main.map(function(t){return JSON.stringify(t)+": "+n.main[t].toString()}).join(",")+"}))(self);";var l=new window.Blob([o],{type:"text/javascript"});if(e.bare)return l;var u=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(l),h=new window.Worker(u);return h.objectURL=u,h}},function(t,e,i){i.r(e),i.d(e,"default",function(){return o});var r=i(10),a=i(0),n=i(1),s=i(15);function o(t){var e=new s.EventEmitter,i=function(e,i){t.postMessage({event:e,data:i})};e.on(a.a.FRAG_DECRYPTED,i),e.on(a.a.ERROR,i),t.addEventListener("message",function(a){var s=a.data;switch(s.cmd){case"init":var o=JSON.parse(s.config);t.transmuxer=new r.c(e,s.typeSupported,o,s.vendor,s.id),Object(n.a)(o.debug),i("init",null);break;case"configure":t.transmuxer.configure(s.config);break;case"demux":var u=t.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(r.d)(u)?u.then(function(e){l(t,e)}):l(t,u);break;case"flush":var d=s.chunkMeta,c=t.transmuxer.flush(d);Object(r.d)(c)?c.then(function(e){h(t,e,d)}):h(t,c,d)}})}function l(t,e){if((i=e.remuxResult).audio||i.video||i.text||i.id3||i.initSegment){var i,r=[],a=e.remuxResult,n=a.audio,s=a.video;n&&u(r,n),s&&u(r,s),t.postMessage({event:"transmuxComplete",data:e},r)}}function u(t,e){e.data1&&t.push(e.data1.buffer),e.data2&&t.push(e.data2.buffer)}function h(t,e,i){e.forEach(function(e){l(t,e)}),t.postMessage({event:"flush",data:i})}},function(t,e,i){i.r(e),i.d(e,"default",function(){return ra});var r=i(11),a=i(3),n=i(0),s=i(2),o=i(1),l=i(5),u=i(6);function h(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var d=function(){var t,e;function i(t){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=t}return i.prototype.reloaded=function(t){if(!t)return this.advanced=!0,void(this.updated=!0);var e=this.lastPartSn-t.lastPartSn,i=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!i||!!e,this.advanced=this.endSN>t.endSN||e>0||0===e&&i>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay},t=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(a.a)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var t=this.driftEndTime-this.driftStartTime;return t>0?1e3*(this.driftEnd-this.driftStart)/t:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var t;return null!=(t=this.fragments)&&t.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}],h(i.prototype,t),e&&h(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}(),c=i(17),f=/^(\d+)x(\d+)$/,g=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,v=function(){function t(e){for(var i in"string"==typeof e&&(e=t.parseAttrList(e)),e)e.hasOwnProperty(i)&&(this[i]=e[i])}var e=t.prototype;return e.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var i=new Uint8Array(e.length/2),r=0;r<e.length/2;r++)i[r]=parseInt(e.slice(2*r,2*r+2),16);return i}return null},e.hexadecimalIntegerAsNumber=function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.optionalFloat=function(t,e){var i=this[t];return i?parseFloat(i):e},e.enumeratedString=function(t){return this[t]},e.bool=function(t){return"YES"===this[t]},e.decimalResolution=function(t){var e=f.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,i={};for(g.lastIndex=0;null!==(e=g.exec(t));){var r=e[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),i[e[1]]=r}return i},t}(),p={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function m(t,e){return MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}var y=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,T=/#EXT-X-MEDIA:(.*)/g,E=RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),S=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),b=/\.(mp4|m4s|m4v|m4a)$/i,_=/#EXT-X-(MEDIA|DISCONTINUITY)-SEQUENCE:(\d+)/g,A=function(){function t(){}return t.findGroup=function(t,e){for(var i=0;i<t.length;i++){var r=t[i];if(r.id===e)return r}},t.convertAVC1ToAVCOTI=function(t){var e=t.split(".");if(e.length>2){var i=e.shift()+".";return i+=parseInt(e.shift()).toString(16),i+=("000"+parseInt(e.shift()).toString(16)).substr(-4)}return t},t.checkMediaDiscontinuitySequence=function(t){var e=null,i={};for(_.lastIndex=0;null!==(e=_.exec(t));)i[e[1].toLowerCase()]=Number(e[2]);return Object.keys(i).length<2?null:i},t.resolve=function(t,e){return r.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,i){var r,a=[],n={},s=!1;for(y.lastIndex=0;null!=(r=y.exec(e));)if(r[1]){var o=new v(r[1]),l={attrs:o,bitrate:o.decimalInteger("AVERAGE-BANDWIDTH")||o.decimalInteger("BANDWIDTH"),name:o.NAME,url:t.resolve(r[2],i)},u=o.decimalResolution("RESOLUTION");u&&(l.width=u.width,l.height=u.height),function(t,e){["video","audio","text"].forEach(function(i){var r=t.filter(function(t){var e;return!!(e=p[i])&&!0===e[t.slice(0,4)]});if(r.length){var a=r.filter(function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)});e[i+"Codec"]=a.length>0?a[0]:r[0],t=t.filter(function(t){return -1===r.indexOf(t)})}}),e.unknownCodecs=t}((o.CODECS||"").split(/[ ,]+/).filter(function(t){return t}),l),l.videoCodec&&-1!==l.videoCodec.indexOf("avc1")&&(l.videoCodec=t.convertAVC1ToAVCOTI(l.videoCodec)),a.push(l)}else if(r[3]){var h=new v(r[3]);h["DATA-ID"]&&(s=!0,n[h["DATA-ID"]]=h)}return{levels:a,sessionData:s?n:null}},t.parseMasterPlaylistMedia=function(e,i,r,a){void 0===a&&(a=[]);var n,s=[],o=0;for(T.lastIndex=0;null!==(n=T.exec(e));){var l=new v(n[1]);if(l.TYPE===r){var u={attrs:l,bitrate:0,id:o++,groupId:l["GROUP-ID"],instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:r,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?t.resolve(l.URI,i):""};if(a.length){var h=t.findGroup(a,u.groupId)||a[0];L(u,h,"audioCodec"),L(u,h,"textCodec")}s.push(u)}}return s},t.parseLevelPlaylist=function(t,e,i,n,s){var l,h,f,g=new d(e),p=g.fragments,m=null,y=0,T=0,_=0,A=0,L=null,D=new u.b(n,e),k=-1,I=!1;for(E.lastIndex=0,g.m3u8=t;null!==(l=E.exec(t));){I&&(I=!1,(D=new u.b(n,e)).start=_,D.sn=y,D.cc=A,D.level=i,m&&(D.initSegment=m,D.rawProgramDateTime=m.rawProgramDateTime,m.rawProgramDateTime=null));var O=l[1];if(O){D.duration=parseFloat(O);var C=(" "+l[2]).slice(1);D.title=C||null,D.tagList.push(C?["INF",O,C]:["INF",O])}else if(l[3])Object(a.a)(D.duration)&&(D.start=_,f&&(D.levelkey=f),D.sn=y,D.level=i,D.cc=A,D.urlId=s,p.push(D),D.relurl=(" "+l[3]).slice(1),R(D,L),L=D,_+=D.duration,y++,T=0,I=!0);else if(l[4]){var w=(" "+l[4]).slice(1);L?D.setByteRange(w,L):D.setByteRange(w)}else if(l[5])D.rawProgramDateTime=(" "+l[5]).slice(1),D.tagList.push(["PROGRAM-DATE-TIME",D.rawProgramDateTime]),-1===k&&(k=p.length);else{if(!(l=l[0].match(S))){o.b.warn("No matches on slow regex match for level playlist!");continue}for(h=1;h<l.length&&void 0===l[h];h++);var P=(" "+l[h]).slice(1),x=(" "+l[h+1]).slice(1),M=l[h+2]?(" "+l[h+2]).slice(1):"";switch(P){case"PLAYLIST-TYPE":g.type=x.toUpperCase();break;case"MEDIA-SEQUENCE":y=g.startSN=parseInt(x);break;case"SKIP":var F=new v(x),N=F.decimalInteger("SKIPPED-SEGMENTS");if(Object(a.a)(N)){g.skippedSegments=N;for(var U=N;U--;)p.unshift(null);y+=N}var B=F.enumeratedString("RECENTLY-REMOVED-DATERANGES");B&&(g.recentlyRemovedDateranges=B.split(" "));break;case"TARGETDURATION":g.targetduration=parseFloat(x);break;case"VERSION":g.version=parseInt(x);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(x||M)&&D.tagList.push(M?[x,M]:[x]);break;case"DIS":A++;case"GAP":D.tagList.push([P]);break;case"BITRATE":D.tagList.push([P,x]);break;case"DISCONTINUITY-SEQ":A=parseInt(x);break;case"KEY":var G,H=new v(x),j=H.enumeratedString("METHOD"),K=H.URI,V=H.hexadecimalInteger("IV"),W=H.enumeratedString("KEYFORMATVERSIONS"),Y=H.enumeratedString("KEYID"),q=null!=(G=H.enumeratedString("KEYFORMAT"))?G:"identity";if(["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"].indexOf(q)>-1){o.b.warn("Keyformat "+q+" is not supported from the manifest");continue}if("identity"!==q)continue;j&&(f=c.a.fromURL(e,K),K&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(j)>=0&&(f.method=j,f.keyFormat=q,Y&&(f.keyID=Y),W&&(f.keyFormatVersions=W),f.iv=V));break;case"START":var X=new v(x).decimalFloatingPoint("TIME-OFFSET");Object(a.a)(X)&&(g.startTimeOffset=X);break;case"MAP":var z=new v(x);D.relurl=z.URI,z.BYTERANGE&&D.setByteRange(z.BYTERANGE),D.level=i,D.sn="initSegment",f&&(D.levelkey=f),D.initSegment=null,m=D,I=!0;break;case"SERVER-CONTROL":var Q=new v(x);g.canBlockReload=Q.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=Q.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&Q.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=Q.optionalFloat("PART-HOLD-BACK",0),g.holdBack=Q.optionalFloat("HOLD-BACK",0);break;case"PART-INF":g.partTarget=new v(x).decimalFloatingPoint("PART-TARGET");break;case"PART":var $=g.partList;$||($=g.partList=[]);var Z=T>0?$[$.length-1]:void 0,J=T++,tt=new u.c(new v(x),D,e,J,Z);$.push(tt),D.duration+=tt.duration;break;case"PRELOAD-HINT":g.preloadHint=new v(x);break;case"RENDITION-REPORT":var te=new v(x);g.renditionReports=g.renditionReports||[],g.renditionReports.push(te);break;default:o.b.warn("line parsed but not handled: "+l)}}}L&&!L.relurl?(p.pop(),_-=L.duration,g.partList&&(g.fragmentHint=L)):g.partList&&(R(D,L),D.cc=A,g.fragmentHint=D);var ti=p.length,tr=p[0],ta=p[ti-1];if((_+=g.skippedSegments*g.targetduration)>0&&ti&&ta){g.averagetargetduration=_/ti;var tn=ta.sn;g.endSN="initSegment"!==tn?tn:0,tr&&(g.startCC=tr.cc,tr.initSegment||g.fragments.every(function(t){var e,i,a;return t.relurl&&(e=t.relurl,b.test(null!=(i=null==(a=r.parseURL(e))?void 0:a.path)?i:""))})&&(o.b.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(D=new u.b(n,e)).relurl=ta.relurl,D.level=i,D.sn="initSegment",tr.initSegment=D,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(_+=g.fragmentHint.duration),g.totalduration=_,g.endCC=A,k>0&&function(t,e){for(var i=t[e],r=e;r--;){var a=t[r];if(!a)return;a.programDateTime=i.programDateTime-1e3*a.duration,i=a}}(p,k),g},t}();function L(t,e,i){var r=e[i];r&&(t[i]=r)}function R(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),Object(a.a)(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}var D=i(4);function k(t,e){var i=t.url;return void 0!==i&&0!==i.indexOf("data:")||(i=e.url),i}var I=function(){function t(t){this.hls=void 0,this.loaders=Object.create(null),this.hls=t,this.registerListeners()}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(n.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(n.a.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(n.a.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.unregisterListeners=function(){var t=this.hls;t.off(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(n.a.LEVEL_LOADING,this.onLevelLoading,this),t.off(n.a.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(n.a.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.createInternalLoader=function(t){var e=this.hls.config,i=e.pLoader,r=e.loader,a=new(i||r)(e);return t.loader=a,this.loaders[t.type]=a,a},e.getInternalLoader=function(t){return this.loaders[t.type]},e.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},e.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},e.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},e.onManifestLoading=function(t,e){var i=e.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.a.MANIFEST,url:i,deliveryDirectives:null})},e.onLevelLoading=function(t,e){var i=e.id,r=e.level,a=e.url,n=e.deliveryDirectives;this.load({id:i,groupId:null,level:r,responseType:"text",type:D.a.LEVEL,url:a,deliveryDirectives:n})},e.onAudioTrackLoading=function(t,e){var i=e.id,r=e.groupId,a=e.url,n=e.deliveryDirectives;this.load({id:i,groupId:r,level:null,responseType:"text",type:D.a.AUDIO_TRACK,url:a,deliveryDirectives:n})},e.onSubtitleTrackLoading=function(t,e){var i=e.id,r=e.groupId,a=e.url,n=e.deliveryDirectives;this.load({id:i,groupId:r,level:null,responseType:"text",type:D.a.SUBTITLE_TRACK,url:a,deliveryDirectives:n})},e.load=function(t){var e,i,r,a,n,s,l=this.hls.config,u=this.getInternalLoader(t);if(u){var h=u.context;if(h&&h.url===t.url)return void o.b.trace("[playlist-loader]: playlist request ongoing");o.b.log("[playlist-loader]: aborting previous loader for type: "+t.type),u.abort()}switch(t.type){case D.a.MANIFEST:i=l.manifestLoadingMaxRetry,r=l.manifestLoadingTimeOut,a=l.manifestLoadingRetryDelay,n=l.manifestLoadingMaxRetryTimeout;break;case D.a.LEVEL:case D.a.AUDIO_TRACK:case D.a.SUBTITLE_TRACK:i=0,r=l.levelLoadingTimeOut;break;default:i=l.levelLoadingMaxRetry,r=l.levelLoadingTimeOut,a=l.levelLoadingRetryDelay,n=l.levelLoadingMaxRetryTimeout}if(u=this.createInternalLoader(t),null!=(e=t.deliveryDirectives)&&e.part&&(t.type===D.a.LEVEL&&null!==t.level?s=this.hls.levels[t.level].details:t.type===D.a.AUDIO_TRACK&&null!==t.id?s=this.hls.audioTracks[t.id].details:t.type===D.a.SUBTITLE_TRACK&&null!==t.id&&(s=this.hls.subtitleTracks[t.id].details),s)){var d=s.partTarget,c=s.targetduration;d&&c&&(r=Math.min(1e3*Math.max(3*d,.8*c),r))}var f={timeout:r,maxRetry:i,retryDelay:a,maxRetryDelay:n,highWaterMark:0,safeTimeout:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(t,f,g)},e.loadsuccess=function(t,e,i,r){if(void 0===r&&(r=null),i.isSidxRequest)return this.handleSidxRequest(t,i),void this.handlePlaylistLoaded(t,e,i,r);this.resetInternalLoader(i.type);var a=t.data;0===a.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),a.indexOf("#EXTINF:")>0||a.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,e,i,r):this.handleMasterPlaylist(t,e,i,r)):this.handleManifestParsingError(t,i,"no EXTM3U delimiter",r)},e.loaderror=function(t,e,i){void 0===i&&(i=null),this.handleNetworkError(e,i,!1,t)},e.loadtimeout=function(t,e,i){void 0===i&&(i=null),this.handleNetworkError(e,i,!0)},e.handleMasterPlaylist=function(t,e,i,r){var a=this.hls,s=t.data,l=k(t,i),u=A.parseMasterPlaylist(s,l),h=u.levels,d=u.sessionData,c=A.checkMediaDiscontinuitySequence(s);if(c&&a.trigger(n.a.LEVEL_METADATA_LOADED,c),h.length){var f=h.map(function(t){return{id:t.attrs.AUDIO,audioCodec:t.audioCodec}}),g=h.map(function(t){return{id:t.attrs.SUBTITLES,textCodec:t.textCodec}}),p=A.parseMasterPlaylistMedia(s,l,"AUDIO",f),m=A.parseMasterPlaylistMedia(s,l,"SUBTITLES",g),y=A.parseMasterPlaylistMedia(s,l,"CLOSED-CAPTIONS");p.length&&(p.some(function(t){return!t.url})||!h[0].audioCodec||h[0].attrs.AUDIO||(o.b.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),p.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v({}),bitrate:0,url:""}))),a.trigger(n.a.MANIFEST_LOADED,{levels:h,audioTracks:p,subtitles:m,captions:y,url:l,stats:e,networkDetails:r,sessionData:d})}else this.handleManifestParsingError(t,i,"no level found in manifest",r)},e.handleTrackOrLevelPlaylist=function(t,e,i,r){var o=this.hls,l=i.id,u=i.level,h=i.type,d=k(t,i),c=Object(a.a)(l)?l:0,f=Object(a.a)(u)?u:c,g=function(t){switch(t.type){case D.a.AUDIO_TRACK:return D.b.AUDIO;case D.a.SUBTITLE_TRACK:return D.b.SUBTITLE;default:return D.b.MAIN}}(i),p=A.parseLevelPlaylist(t.data,d,f,g,c),m=A.checkMediaDiscontinuitySequence(t.data);if(m&&o.trigger(n.a.LEVEL_METADATA_LOADED,m),p.fragments.length){if(h===D.a.MANIFEST){var y={attrs:new v({}),bitrate:0,details:p,name:"",url:d};o.trigger(n.a.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:d,stats:e,networkDetails:r,sessionData:null})}if(e.parsing.end=performance.now(),p.needSidxRanges){var T,E=null==(T=p.fragments[0].initSegment)?void 0:T.url;this.load({url:E,isSidxRequest:!0,type:h,level:u,levelDetails:p,id:l,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else i.levelDetails=p,this.handlePlaylistLoaded(t,e,i,r)}else o.trigger(n.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.LEVEL_EMPTY_ERROR,fatal:!1,url:d,reason:"no fragments found in level",level:"number"==typeof i.level?i.level:void 0})},e.handleSidxRequest=function(t,e){var i=Object(l.k)(new Uint8Array(t.data));if(i){var r=i.references,a=e.levelDetails;r.forEach(function(t,e){var r=t.info,n=a.fragments[e];0===n.byteRange.length&&n.setByteRange(String(1+r.end-r.start)+"@"+String(r.start)),n.initSegment&&n.initSegment.setByteRange(String(i.moovEndOffset)+"@0")})}},e.handleManifestParsingError=function(t,e,i,r){this.hls.trigger(n.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.MANIFEST_PARSING_ERROR,fatal:e.type===D.a.MANIFEST,url:t.url,reason:i,response:t,context:e,networkDetails:r})},e.handleNetworkError=function(t,e,i,r){void 0===i&&(i=!1),o.b.warn("[playlist-loader]: A network "+(i?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var a=s.a.UNKNOWN,l=!1,u=this.getInternalLoader(t);switch(t.type){case D.a.MANIFEST:a=i?s.a.MANIFEST_LOAD_TIMEOUT:s.a.MANIFEST_LOAD_ERROR,l=!0;break;case D.a.LEVEL:a=i?s.a.LEVEL_LOAD_TIMEOUT:s.a.LEVEL_LOAD_ERROR,l=!1;break;case D.a.AUDIO_TRACK:a=i?s.a.AUDIO_TRACK_LOAD_TIMEOUT:s.a.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case D.a.SUBTITLE_TRACK:a=i?s.a.SUBTITLE_TRACK_LOAD_TIMEOUT:s.a.SUBTITLE_LOAD_ERROR,l=!1}u&&this.resetInternalLoader(t.type);var h={type:s.b.NETWORK_ERROR,details:a,fatal:l,url:t.url,loader:u,context:t,networkDetails:e};r&&(h.response=r),this.hls.trigger(n.a.ERROR,h)},e.handlePlaylistLoaded=function(t,e,i,r){var a=i.type,s=i.level,o=i.id,l=i.groupId,u=i.loader,h=i.levelDetails,d=i.deliveryDirectives;if(null!=h&&h.targetduration){if(u)switch(h.live&&(u.getCacheAge&&(h.ageHeader=u.getCacheAge()||0),u.getCacheAge&&!isNaN(h.ageHeader)||(h.ageHeader=0)),a){case D.a.MANIFEST:case D.a.LEVEL:this.hls.trigger(n.a.LEVEL_LOADED,{details:h,level:s||0,id:o||0,stats:e,networkDetails:r,deliveryDirectives:d});break;case D.a.AUDIO_TRACK:this.hls.trigger(n.a.AUDIO_TRACK_LOADED,{details:h,id:o||0,groupId:l||"",stats:e,networkDetails:r,deliveryDirectives:d});break;case D.a.SUBTITLE_TRACK:this.hls.trigger(n.a.SUBTITLE_TRACK_LOADED,{details:h,id:o||0,groupId:l||"",stats:e,networkDetails:r,deliveryDirectives:d})}}else this.handleManifestParsingError(t,i,"invalid target duration",r)},t}(),O=function(){function t(t){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){this.hls.on(n.a.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(n.a.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){for(var t in this._unregisterListeners(),this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={}},e.onKeyLoading=function(t,e){var i=e.frag,r=i.type,a=this.loaders[r];if(i.decryptdata){var s=i.decryptdata.uri;if(s!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;if(a&&(o.b.warn("abort previous key loader for type:"+r),a.abort()),!s)return void o.b.warn("key uri is falsy");var u=l.loader,h=i.loader=this.loaders[r]=new u(l);this.decrypturl=s,this.decryptkey=null;var d={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0,safeTimeout:0},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};h.load({url:s,frag:i,responseType:"arraybuffer"},d,c)}else this.decryptkey&&(i.decryptdata.key=this.decryptkey,this.hls.trigger(n.a.KEY_LOADED,{frag:i}))}else o.b.warn("Missing decryption data on fragment in onKeyLoading")},e.loadsuccess=function(t,e,i){var r=i.frag;r.decryptdata?(this.decryptkey=r.decryptdata.key=new Uint8Array(t.data),r.loader=null,delete this.loaders[r.type],this.hls.trigger(n.a.KEY_LOADED,{frag:r})):o.b.error("after key load, decryptdata unset")},e.loaderror=function(t,e){var i=e.frag,r=i.loader;r&&r.abort(),delete this.loaders[i.type],this.hls.trigger(n.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.KEY_LOAD_ERROR,fatal:!1,frag:i,response:t})},e.loadtimeout=function(t,e){var i=e.frag,r=i.loader;r&&r.abort(),delete this.loaders[i.type],this.hls.trigger(n.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.KEY_LOAD_TIMEOUT,fatal:!1,frag:i})},t}();function C(t,e){var i;try{i=new Event("addtrack")}catch(t){(i=document.createEvent("Event")).initEvent("addtrack",!1,!1)}i.track=t,e.dispatchEvent(i)}function w(t,e){var i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw Error("addCue is failed for: "+e)}catch(i){o.b.debug("[texttrack-utils]: "+i);var r=new self.TextTrackCue(e.startTime,e.endTime,e.text);r.id=e.id,t.addCue(r)}"disabled"===i&&(t.mode=i)}function P(t){var e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues)for(var i=t.cues.length;i--;)t.removeCue(t.cues[i]);"disabled"===e&&(t.mode=e)}function x(t,e,i){var r=t.mode;if("disabled"===r&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var a=function(t,e,i){var r=[],a=function(t,e){if(e<t[0].startTime)return 0;var i=t.length-1;if(e>t[i].endTime)return -1;for(var r=0,a=i;r<=a;){var n=Math.floor((a+r)/2);if(e<t[n].startTime)a=n-1;else{if(!(e>t[n].startTime&&r<i))return n;r=n+1}}return t[r].startTime-e<e-t[a].startTime?r:a}(t,e);if(a>-1)for(var n=a,s=t.length;n<s;n++){var o=t[n];if(o.startTime>=e&&o.endTime<=i)r.push(o);else if(o.startTime>i)break}return r}(t.cues,e,i),n=0;n<a.length;n++)t.removeCue(a[n]);"disabled"===r&&(t.mode=r)}var M=i(7),F=function(){function t(t){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=t,this._registerListeners()}var e=t.prototype;return e.destroy=function(){this._unregisterListeners()},e._registerListeners=function(){var t=this.hls;t.on(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(n.a.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(n.a.BUFFER_FLUSHING,this.onBufferFlushing,this)},e._unregisterListeners=function(){var t=this.hls;t.off(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(n.a.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(n.a.BUFFER_FLUSHING,this.onBufferFlushing,this)},e.onMediaAttached=function(t,e){this.media=e.media},e.onMediaDetaching=function(){this.id3Track&&(P(this.id3Track),this.id3Track=null,this.media=null)},e.getID3Track=function(t){if(this.media){for(var e=0;e<t.length;e++){var i=t[e];if("metadata"===i.kind&&"id3"===i.label)return C(i,this.media),i}return this.media.addTextTrack("metadata","id3")}},e.onFragParsingMetadata=function(t,e){if(this.media){var i=e.frag,r=e.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var a=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,n=0;n<r.length;n++){var s=M.c(r[n].data);if(s){var o=r[n].pts,l=n<r.length-1?r[n+1].pts:i.end;l-o<=0&&(l=o+.25);for(var u=0;u<s.length;u++){var h=s[u];if(!M.e(h)){var d=new a(o,l,"");d.value=h,this.id3Track.addCue(d)}}}}}},e.onBufferFlushing=function(t,e){var i=e.startOffset,r=e.endOffset,a=e.type;if(!a||"audio"===a){var n=this.id3Track;n&&x(n,i,r)}},t}();function N(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var U,B=function(){function t(t){var e=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return e.timeupdate()},this.hls=t,this.config=t.config,this.registerListeners()}var e,i,r=t.prototype;return r.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},r.registerListeners=function(){this.hls.on(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(n.a.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(n.a.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(n.a.ERROR,this.onError,this)},r.unregisterListeners=function(){this.hls.off(n.a.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(n.a.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(n.a.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(n.a.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(n.a.ERROR,this.onError)},r.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},r.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},r.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},r.onLevelUpdated=function(t,e){var i=e.details;this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},r.onError=function(t,e){e.details===s.a.BUFFER_STALLED_ERROR&&(this.stallCount++,o.b.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},r.timeupdate=function(){var t=this.media,e=this.levelDetails;if(t&&e){this.currentTime=t.currentTime;var i=this.computeLatency();if(null!==i){this._latency=i;var r=this.config,a=r.lowLatencyMode,n=r.maxLiveSyncPlaybackRate;if(a&&1!==n){var s=this.targetLatency;if(null!==s){var o=i-s,l=o<Math.min(this.maxLatency,s+e.targetduration);e.live&&l&&o>.05&&this.forwardBufferLength>1?t.playbackRate=Math.min(Math.min(2,Math.max(1,n)),Math.max(1,Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20)):1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}}}}},r.estimateLiveEdge=function(){var t=this.levelDetails;return null===t?null:t.edge+t.age},r.computeLatency=function(){var t=this.estimateLiveEdge();return null===t?null:t-this.currentTime},e=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,e=this.levelDetails;return void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(null===t)return null;var e=t.holdBack,i=t.partHoldBack,r=t.targetduration,a=this.config,n=a.liveSyncDuration,s=a.liveSyncDurationCount,o=a.lowLatencyMode,l=this.hls.userConfig,u=o&&i||e;return(l.liveSyncDuration||l.liveSyncDurationCount||0===u)&&(u=void 0!==n?n:s*r),u+Math.min(+this.stallCount,r)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),e=this.targetLatency,i=this.levelDetails;if(null===t||null===e||null===i)return null;var r=i.edge,a=t-e-this.edgeStalled;return Math.min(Math.max(r-i.totalduration,a),r-(this.config.lowLatencyMode&&i.partTarget||i.targetduration))}},{key:"drift",get:function(){var t=this.levelDetails;return null===t?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(null===t)return 0;var e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,e=this.levelDetails;if(!t||!e)return 0;var i=t.buffered.length;return i?t.buffered.end(i-1):e.edge-this.currentTime}}],N(t.prototype,e),i&&N(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}();function G(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(J=U||(U={})).No="",J.Yes="YES",J.v2="v2";var H=function(){function t(t,e,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=e,this.skip=i}return t.prototype.addDirectives=function(t){var e=new self.URL(t);return void 0!==this.msn&&e.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.toString()},t}(),j=function(){var t,e;function i(t){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[t.url],this.attrs=t.attrs,this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.unknownCodecs=t.unknownCodecs,this.codecSet=[t.videoCodec,t.audioCodec].filter(function(t){return t}).join(",").replace(/\.[^.,]+/g,"")}return t=[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(t){var e=t%this.url.length;this._urlId!==e&&(this.details=void 0,this._urlId=e)}}],G(i.prototype,t),e&&G(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}();function K(t,e,i){switch(e){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(i);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(i)}}function V(t){var e={};t.forEach(function(t){var i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++})}function W(t,e){var i=e.startPTS;if(Object(a.a)(i)){var r,n=0;e.sn>t.sn?(n=i-t.start,r=t):(n=t.start-i,r=e),r.duration!==n&&(r.duration=n)}else e.sn>t.sn?t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration:e.start=Math.max(t.start-e.duration,0)}function Y(t,e,i,r,n,s){r-i<=0&&(o.b.warn("Fragment should have a positive duration",e),r=i+e.duration,s=n+e.duration);var l=i,u=r,h=e.startPTS,d=e.endPTS;if(Object(a.a)(h)){var c=Math.abs(h-i);Object(a.a)(e.deltaPTS)?e.deltaPTS=Math.max(c,e.deltaPTS):e.deltaPTS=c,l=Math.max(i,h),i=Math.min(i,h),n=Math.min(n,e.startDTS),u=Math.min(r,d),r=Math.max(r,d),s=Math.max(s,e.endDTS)}e.duration=r-i;var f=i-e.start;e.appendedPTS=r,e.start=e.startPTS=i,e.maxStartPTS=l,e.startDTS=n,e.endPTS=r,e.minEndPTS=u,e.endDTS=s;var g,v=e.sn;if(!t||v<t.startSN||v>t.endSN)return 0;var p=v-t.startSN,m=t.fragments;for(m[p]=e,g=p;g>0;g--)W(m[g],m[g-1]);for(g=p;g<m.length-1;g++)W(m[g],m[g+1]);return t.fragmentHint&&W(m[m.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,f}function q(t,e){var i=e.startSN+e.skippedSegments-t.startSN,r=t.fragments;i<0||i>=r.length||X(e,r[i].start)}function X(t,e){if(e){for(var i=t.fragments,r=t.skippedSegments;r<i.length;r++)i[r].start+=e;t.fragmentHint&&(t.fragmentHint.start+=e)}}var z=function(){function t(t,e){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=o.b.log.bind(o.b,e+":"),this.warn=o.b.warn.bind(o.b,e+":"),this.hls=t}var e=t.prototype;return e.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null}
1,e.onError=function(t,e){e.fatal&&e.type===s.b.NETWORK_ERROR&&this.clearTimer()},e.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},e.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},e.stopLoad=function(){this.canLoad=!1,this.clearTimer()},e.switchParams=function(t,e){var i=null==e?void 0:e.renditionReports;if(i)for(var r=0;r<i.length;r++){var n=i[r],s=""+n.URI;if(s===t.substr(-s.length)){var o=parseInt(n["LAST-MSN"]),l=parseInt(n["LAST-PART"]);if(e&&this.hls.config.lowLatencyMode){var u=Math.min(e.age-e.partTarget,e.targetduration);void 0!==l&&u>e.partTarget&&(l+=1)}if(Object(a.a)(o))return new H(o,Object(a.a)(l)?l:void 0,U.No)}}},e.loadPlaylist=function(t){},e.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},e.playlistLoaded=function(t,e,i){var r=this,n=e.details,s=e.stats,l=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(n.advancedDateTime=Date.now()-l,n.live||null!=i&&i.live){if(n.reloaded(i),i&&this.log("live playlist "+t+" "+(n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED")),i&&n.fragments.length>0&&function(t,e){for(var i=null,r=t.fragments,n=r.length-1;n>=0;n--){var s=r[n].initSegment;if(s){i=s;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var l,u=0;if(function(t,e,i){for(var r=e.skippedSegments,a=Math.max(t.startSN,e.startSN)-e.startSN,n=+!!t.fragmentHint+(r?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,s=e.startSN-t.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,u=a;u<=n;u++){var h=l[s+u],d=o[u];r&&!d&&u<r&&(d=e.fragments[u]=h),h&&d&&i(h,d)}}(t,e,function(t,r){t.relurl&&(u=t.cc-r.cc),Object(a.a)(t.startPTS)&&Object(a.a)(t.endPTS)&&(r.start=r.startPTS=t.startPTS,r.startDTS=t.startDTS,r.appendedPTS=t.appendedPTS,r.maxStartPTS=t.maxStartPTS,r.endPTS=t.endPTS,r.endDTS=t.endDTS,r.minEndPTS=t.minEndPTS,r.duration=t.endPTS-t.startPTS,r.duration&&(l=r),e.PTSKnown=e.alignedSliding=!0),r.elementaryStreams=t.elementaryStreams,r.loader=t.loader,r.stats=t.stats,r.urlId=t.urlId,t.initSegment&&(r.initSegment=t.initSegment,i=t.initSegment)}),i&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(function(t){var e;t.initSegment&&t.initSegment.relurl!==(null==(e=i)?void 0:e.relurl)||(t.initSegment=i)}),e.skippedSegments&&(e.deltaUpdateFailed=e.fragments.some(function(t){return!t}),e.deltaUpdateFailed)){o.b.warn("[level-helper] Previous playlist missing segments ski
1pped in delta playlist");for(var h=e.skippedSegments;h--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}var d=e.fragments;if(u){o.b.warn("discontinuity sliding from playlist, take drift into account");for(var c=0;c<d.length;c++)d[c].cc+=u}e.skippedSegments&&(e.startCC=e.fragments[0].cc),function(t,e,i){if(t&&e)for(var r=0,a=0,n=t.length;a<=n;a++){var s=t[a],o=e[a+r];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?i(s,o):r--}}(t.partList,e.partList,function(t,e){e.elementaryStreams=t.elementaryStreams,e.stats=t.stats}),l?Y(e,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS):q(t,e),d.length&&(e.totalduration=e.edge-d[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;var f=e.advancedDateTime;if(e.advanced&&f){var g=e.edge;e.driftStart||(e.driftStartTime=f,e.driftStart=g),e.driftEndTime=f,e.driftEnd=g}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime}(i,n),!this.canLoad||!n.live)return;var u,h,d,c,f,g,v,p,m=void 0,y=void 0;if(n.canBlockReload&&n.endSN&&n.advanced){var T=this.hls.config.lowLatencyMode,E=n.lastPartSn,S=n.endSN,b=n.lastPartIndex,_=E===S;-1!==b?(m=_?S+1:E,y=_?T?0:b:b+1):m=S+1;var A=n.age,L=Math.min(A+n.ageHeader-n.partTarget,1.5*n.targetduration);if(L>0){if(i&&L>i.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+i.tuneInGoal+" to: "+L+" with playlist age: "+n.age),L=0;else{var R=Math.floor(L/n.targetduration);m+=R,void 0!==y&&(y+=Math.round(L%n.targetduration/n.partTarget)),this.log("CDN Tune-in age: "+n.ageHeader+"s last advanced "+A.toFixed(2)+"s goal: "+L+" skip sn "+R+" to part "+y)}n.tuneInGoal=L}if(p=this.getDeliveryDirectives(n,e.deliveryDirectives,m,y),T||!_)return void this.loadPlaylist(p)}else p=this.getDeliveryDirectives(n,e.deliveryDirectives,m,y);var D=(d=(h=1e3*n.levelTargetDuration)/2,f=(c=n.age)>0&&c<3*h,g=s.loading.end-s.loading.start,v=n.availabilityDelay,!1===n.updated?f?(u=Math.max(Math.min(d,2*g),333*n.misses),n.availabilityDelay=(n.availabilityDelay||0)+u):u=d:f?(n.availabilityDelay=v=Math.min(v||h/2,c),u=v+h-c):u=h-g,Math.round(u));void 0!==m&&n.canBlockReload&&(D-=n.partTarget||1),this.log("reload live playlist "+t+" in "+Math.round(D)+" ms"),this.timer=self.setTimeout(function(){return r.loadPlaylist(p)},D)}else this.clearTimer()},e.getDeliveryDirectives=function(t,e,i,r){var a,n,s,o,l=(a=i,n=t.canSkipUntil,s=t.canSkipDateRanges,o=t.endSN,n&&(void 0!==a?a-o:0)<n?s?U.v2:U.Yes:U.No);return null!=e&&e.skip&&t.deltaUpdateFailed&&(i=e.msn,r=e.part,l=U.No),new H(i,r,l)},e.retryLoadingOrFail=function(t){var e,i=this,r=this.hls.config,a=this.retryCount<r.levelLoadingMaxRetry;if(a)if(this.retryCount++,t.details.indexOf("LoadTimeOut")>-1&&null!=(e=t.context)&&e.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return i.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+t.details+'"')}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return a},t}();function Q(){return(Q=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}function $(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Z(t,e){return(Z=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var J,tt,te=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),ti=function(t){function e(e){var i;return(i=t.call(this,e,"[level-controller]")||this)._levels=[],i._firstLevel=-1,i._startLevel=void 0,i.currentLevelIndex=-1,i.manualLevelIndex=-1,i.onParsedComplete=void 0,i._registerListeners(),i}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Z(e,t);var i,r,a=e.prototype;return a._registerListeners=function(){var t=this.hls;t.on(n.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(n.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(n.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(n.a.FRAG_LOADED,this.onFragLoaded,this),t.on(n.a.ERROR,this.onError,this)},a._unregisterListeners=function(){var t=this.hls;t.off(n.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(n.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(n.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(n.a.FRAG_LOADED,this.onFragLoaded,this),t.off(n.a.ERROR,this.onError,this)},a.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)}
vendor: 13,181 bytes, line 1
1,a.startLoad=function(){this._levels.forEach(function(t){t.loadError=0}),t.prototype.startLoad.call(this)},a.onManifestLoaded=function(t,e){var i,r,a=[],o=[],l=[],u={},h=!1,d=!1,c=!1;if(e.levels.forEach(function(t){var e=t.attrs;h=h||!(!t.width||!t.height),d=d||!!t.videoCodec,c=c||!!t.audioCodec,te&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec=void 0);var i=t.bitrate+"-"+t.attrs.RESOLUTION+"-"+t.attrs.CODECS;(r=u[i])?r.url.push(t.url):(r=new j(t),u[i]=r,a.push(r)),e&&(e.AUDIO&&K(r,"audio",e.AUDIO),e.SUBTITLES&&K(r,"text",e.SUBTITLES))}),(h||d)&&c&&(a=a.filter(function(t){var e=t.videoCodec,i=t.width,r=t.height;return!!e||!(!i||!r)})),a=a.filter(function(t){var e=t.audioCodec,i=t.videoCodec;return(!e||m(e,"audio"))&&(!i||m(i,"video"))}),e.audioTracks&&V(o=e.audioTracks.filter(function(t){return!t.audioCodec||m(t.audioCodec,"audio")})),e.subtitles&&V(l=e.subtitles),a.length>0){i=a[0].bitrate,a.sort(function(t,e){return t.bitrate-e.bitrate}),this._levels=a;for(var f=0;f<a.length;f++)if(a[f].bitrate===i){this._firstLevel=f,this.log("manifest loaded, "+a.length+" level(s) found, first bitrate: "+i);break}var g=c&&!d,v={levels:a,audioTracks:o,subtitleTracks:l,firstLevel:this._firstLevel,stats:e.stats,audio:c,video:d,altAudio:!g&&o.some(function(t){return!!t.url})};this.hls.trigger(n.a.MANIFEST_PARSED,v),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(n.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(e,i){if(t.prototype.onError.call(this,e,i),!i.fatal){var r=i.context,a=this._levels[this.currentLevelIndex];if(r&&(r.type===D.a.AUDIO_TRACK&&a.audioGroupIds&&r.groupId===a.audioGroupIds[a.urlId]||r.type===D.a.SUBTITLE_TRACK&&a.textGroupIds&&r.groupId===a.textGroupIds[a.urlId]))this.redundantFailover(this.currentLevelIndex);else{var n,o=!1,l=!0;switch(i.details){case s.a.FRAG_LOAD_ERROR:case s.a.FRAG_LOAD_TIMEOUT:case s.a.KEY_LOAD_ERROR:case s.a.KEY_LOAD_TIMEOUT:if(i.frag){var u=this._levels[i.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(n=i.frag.level)):n=i.frag.level}break;case s.a.LEVEL_LOAD_ERROR:case s.a.LEVEL_LOAD_TIMEOUT:r&&(r.deliveryDirectives&&(l=!1),n=r.level),o=!0;break;case s.a.REMUX_ALLOC_ERROR:n=i.level,o=!0}void 0!==n&&this.recoverLevel(i,n,o,l)}}},a.recoverLevel=function(t,e,i,r){var a=t.details,n=this._levels[e];if(n.loadError++,i){if(!this.retryLoadingOrFail(t))return void(this.currentLevelIndex=-1);t.levelRetry=!0}if(r){var s=n.url.length;if(s>1&&n.loadError<s)t.levelRetry=!0,this.redundantFailover(e);else if(-1===this.manualLevelIndex){var o=0===e?this._levels.length-1:e-1;this.currentLevelIndex!==o&&0===this._levels[o].loadError&&(this.warn(a+": switch to "+o),t.levelRetry=!0,this.hls.nextAutoLevel=o)}}},a.redundantFailover=function(t){var e=this._levels[t],i=e.url.length;if(i>1){var r=(e.urlId+1)%i;this.warn("Switching to redundant URL-id "+r),this._levels.forEach(function(t){t.urlId=r}),this.level=t}},a.onFragLoaded=function(t,e){var i=e.frag;if(void 0!==i&&i.type===D.b.MAIN){var r=this._levels[i.level];void 0!==r&&(r.fragmentError=0,r.loadError=0)}},a.onLevelLoaded=function(t,e){var i,r,a=e.level,n=e.details,s=this._levels[a];s?a===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0,this.retryCount=0),this.playlistLoaded(a,e,s.details)):null!=(i=e.deliveryDirectives)&&i.skip&&(n.deltaUpdateFailed=!0):(this.warn("Invalid level index "+a),null!=(r=e.deliveryDirectives)&&r.skip&&(n.deltaUpdateFailed=!0))},a.onAudioTrackSwitched=function(t,e){var i=this.hls.levels[this.currentLevelIndex];if(i&&i.audioGroupIds){for(var r=-1,a=this.hls.audioTracks[e.id].groupId,n=0;n<i.audioGroupIds.length;n++)if(i.audioGroupIds[n]===a){r=n;break}r!==i.urlId&&(i.urlId=r,this.startLoad())}},a.loadPlaylist=function(t){var e=this.currentLevelIndex,i=this._levels[e];if(this.canLoad&&i&&i.url.length>0){var r=i.urlId,a=i.url[r];if(t)try{a=t.addDirectives(a)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Attempt loading level index "+e+(t?" at sn "+t.msn+" part "+t.part:"")+" with URL-id "+r+" "+a),this.clearTimer(),this.hls.trigger(n.a.LEVEL_LOADING,{url:a,level:e,id:r,deliveryDirectives:t||null})}},a.removeLevel=function(t,e){var i=function(t,i){return i!==e},r=this._levels.filter(function(r,a){return a!==t||r.url.length>1&&void 0!==e&&(r.url=r.url.filter(i),r.audioGroupIds&&(r.audioGroupIds=r.audioGroupIds.filter(i)),r.textGroupIds&&(r.textGroupIds=r.textGroupIds.filter(i)),r.urlId=0,!0)}).map(function(t,e){var i=t.details;return null!=i&&i.fragments&&i.fragments.forEach(function(t){t.level=e}),t});this._levels=r,this.hls.trigger(n.a.LEVELS_UPDATED,{levels:r})},i=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e,i=this._levels;if(0!==i.length&&(this.currentLevelIndex!==t||null==(e=i[t])||!e.details)){if(t<0||t>=i.length){var r=t<0;if(this.hls.trigger(n.a.ERROR,{type:s.b.OTHER_ERROR,details:s.a.LEVEL_SWITCH_ERROR,level:t,fatal:r,reason:"invalid level idx"}),r)return;t=Math.min(t,i.length-1)}this.clearTimer();var a=this.currentLevelIndex,o=i[a],l=i[t];this.log("switching to level "+t+" from "+a),this.currentLevelIndex=t;var u=Q({},l,{level:t,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete u._urlId,this.hls.trigger(n.a.LEVEL_SWITCHING,u);var h=l.details;if(!h||h.live){var d=this.switchParams(l.uri,null==o?void 0:o.details);this.loadPlaylist(d)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return -1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}],$(e.prototype,i),r&&$(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(z);(en=tt||(tt={})).NOT_LOADED="NOT_LOADED",en.BACKTRACKED="BACKTRACKED",en.APPENDING="APPENDING",en.PARTIAL="PARTIAL",en.SKIPPED="SKIPPED",en.OK="OK";var tr=function(){function t(t){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.log=o.b.log.bind(o.b,"[Fragment-tracker]:"),this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){var t=this.hls;t.on(n.a.BUFFER_APPENDED,this.onBufferAppended,this),t.on(n.a.FRAG_BUFFERED,this.onFragBuffered,this),t.on(n.a.FRAG_LOADED,this.onFragLoaded,this)},e._unregisterListeners=function(){var t=this.hls;t.off(n.a.BUFFER_APPENDED,this.onBufferAppended,this),t.off(n.a.FRAG_BUFFERED,this.onFragBuffered,this),t.off(n.a.FRAG_LOADED,this.onFragLoaded,this)},e.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},e.getAppendedFrag=function(t,e){if(e===D.b.MAIN){var i=this.activeFragment,r=this.activeParts;if(!i)return null;if(r)for(var a=r.length;a--;){var n=r[a],s=n?n.end:i.appendedPTS;if(n.start<=t&&void 0!==s&&t<=s)return a>9&&(this.activeParts=r.slice(a-9)),n}else if(i.start<=t&&void 0!==i.appendedPTS&&t<=i.appendedPTS)return i}return this.getBufferedFrag(t,e)},e.getBufferedFrag=function(t,e){for(var i=this.fragments,r=Object.keys(i),a=r.length;a--;){var n=i[r[a]];if((null==n?void 0:n.body.type)===e&&n.buffered&&!n.isSkipped){var s=n.body;if(s.start<=t&&t<=s.end)return s}}return null},e.detectEvictedFragments=function(t,e,i){var r=this;Object.keys(this.fragments).forEach(function(a){var n=r.fragments[a];if(n)if(n.buffered){var s=n.range[t];s&&s.time.some(function(t){var i=!r.isTimeBuffered(t.startPTS,t.endPTS,e);return i&&r.removeFragment(n.body),i})}else n.body.type===i&&r.removeFragment(n.body)})},e.detectPartialFragments=function(t){var e=this,i=this.timeRanges,r=t.frag,a=t.part;if(i&&"initSegment"!==r.sn){var n=tn(r),s=this.fragments[n];s&&(Object.keys(i).forEach(function(t){var n=r.elementaryStreams[t];if(n){var o=i[t],l=null!==a||!0===n.partial;s.range[t]=e.getBufferedTimes(r,a,l,o)}}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body))}},e.fragBuffered=function(t){var e=tn(t),i=this.fragments[e];i&&(i.backtrack=i.loaded=null,i.buffered=!0)},e.getBufferedTimes=function(t,e,i,r){for(var a={time:[],partial:i},n=e?e.start:t.start,s=e?e.end:t.end,o=t.minEndPTS||s,l=t.maxStartPTS||n,u=0;u<r.length;u++){var h=r.start(u)-this.bufferPadding,d=r.end(u)+this.bufferPadding;if(l>=h&&o<=d){a.time.push({startPTS:Math.max(n,r.start(u)),endPTS:Math.min(s,r.end(u))});break}if(n<d&&s>h)a.partial=!0,a.time.push({startPTS:Math.max(n,r.start(u)),endPTS:Math.min(s,r.end(u))});else if(s<=h)break}return a},e.getPartialFragment=function(t){var e,i,r,a=null,n=0,s=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach(function(l){var u=o[l];u&&ta(u)&&(i=u.body.start-s,r=u.body.end+s,t>=i&&t<=r&&n<=(e=Math.min(t-i,r-t))&&(a=u.body,n=e))}),a},e.getState=function(t){var e=tn(t),i=this.fragments[e];return i?i.isSkipped?tt.SKIPPED:i.buffered?ta(i)?tt.PARTIAL:tt.OK:i.backtrack?tt.BACKTRACKED:tt.APPENDING:tt.NOT_LOADED},e.backtrack=function(t,e){var i=tn(t),r=this.fragments[i];if(!r||r.backtrack)return null;var a=r.backtrack=e||r.loaded;return r.loaded=null,a},e.getBacktrackData=function(t){var e=tn(t),i=this.fragments[e];if(i){var r,a=i.backtrack;if(null!=a&&null!=(r=a.payload)&&r.byteLength)return a;this.removeFragment(t)}return null},e.onFragSkipped=function(t){var e=t.frag;this.log("Frag skipped",e);var i=tn(e),r=this.fragments[i];r&&(r.isSkipped=!0)},e.isTimeBuffered=function(t,e,i){for(var r,a,n=0;n<i.length;n++){if(r=i.start(n)-this.bufferPadding,a=i.end(n)+this.bufferPadding,t>=r&&e<=a)return!0;if(e<=r)break}return!1},e.onFragLoaded=function(t,e){var i=e.frag,r=e.part;if("initSegment"!==i.sn&&!i.bitrateTest&&!r){var a=tn(i);this.fragments[a]={body:i,loaded:e,backtrack:null,buffered:!1,range:Object.create(null)}}},e.onBufferAppended=function(t,e){var i=this,r=e.frag,a=e.part,n=e.timeRanges;if(r.type===D.b.MAIN)if(this.activeFragment=r,a){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(a)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(t){var e=n[t];if(i.detectEvictedFragments(t,e),!a)for(var s=0;s<e.length;s++)r.appendedPTS=Math.max(e.end(s),r.appendedPTS||0)})},e.onFragBuffered=function(t,e){this.detectPartialFragments(e)},e.hasFragment=function(t){var e=tn(t);return!!this.fragments[e]},e.removeFragmentsInRange=function(t,e,i){var r=this;Object.keys(this.fragments).forEach(function(a){var n=r.fragments[a];if(n&&n.buffered){var s=n.body;s.type===i&&s.start<e&&s.end>t&&r.removeFragment(s)}})},e.removeFragment=function(t){var e=tn(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),delete this.fragments[e]},e.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},t}();function ta(t){var e,i;return t.buffered&&((null==(e=t.range.video)?void 0:e.partial)||(null==(i=t.range.audio)?void 0:i.partial))}function tn(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn}var ts=function(){function t(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var e=t.prototype;return e.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},e.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.onHandlerDestroyed=function(){},e.hasInterval=function(){return!!this._tickInterval},e.hasNextTick=function(){return!!this._tickTimer},e.setInterval=function(t){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,t),!0)},e.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},e.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},e.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},e.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},e.doTick=function(){},t}(),to={length:0,start:function(){return 0},end:function(){return 0}},tl=function(){function t(){}return t.isBuffered=function(e,i){try{if(e){for(var r=t.getBuffered(e),a=0;a<r.length;a++)if(i>=r.start(a)&&i<=r.end(a))return!0}}catch(t){}return!1},t.bufferInfo=function(e,i,r){try{if(e){var a,n=t.getBuffered(e),s=[];for(a=0;a<n.length;a++)s.push({start:n.start(a),end:n.end(a)});return this.bufferedInfo(s,i,r)}}catch(t){}return{len:0,start:i,end:i,nextStart:void 0}}
1,t.bufferedInfo=function(t,e,i){e=Math.max(0,e),t.sort(function(t,e){return t.start-e.start||e.end-t.end});var r=[];if(i)for(var a=0;a<t.length;a++){var n=r.length;if(n){var s=r[n-1].end;t[a].start-s<i?t[a].end>s&&(r[n-1].end=t[a].end):r.push(t[a])}else r.push(t[a])}else r=t;for(var o,l=0,u=e,h=e,d=0;d<r.length;d++){var c=r[d].start,f=r[d].end;if(e+i>=c&&e<f)u=c,l=(h=f)-e;else if(e+i<c){o=c;break}}return{len:l,start:u||0,end:h||0,nextStart:o}},t.getBuffered=function(t){try{return t.buffered}catch(t){return o.b.log("failed to get media.buffered",t),to}},t}(),tu=function(t,e,i,r,a,n){void 0===r&&(r=0),void 0===a&&(a=-1),void 0===n&&(n=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=e,this.id=i,this.size=r,this.part=a,this.partial=n};function th(t,e){if(t){var i=t.start+e;t.start=t.startPTS=i,t.endPTS=i+t.duration}}function td(t,e){for(var i=e.fragments,r=0,a=i.length;r<a;r++)th(i[r],t);e.fragmentHint&&th(e.fragmentHint,t),e.alignedSliding=!0}function tc(t,e){var i=t.programDateTime;if(i){var r=(i-e)/1e3;t.start=t.startPTS=r,t.endPTS=r+t.duration}}function tf(t,e){if(e.fragments.length&&t.hasProgramDateTime&&e.hasProgramDateTime){var i=e.fragments[0].programDateTime-1e3*e.fragments[0].start;t.fragments.forEach(function(t){tc(t,i)}),t.fragmentHint&&tc(t.fragmentHint,i),t.alignedSliding=!0}}var tg=function(t,e){for(var i=0,r=t.length-1,a=null,n=null;i<=r;){var s=e(n=t[a=(i+r)/2|0]);if(s>0)i=a+1;else{if(!(s<0))return n;r=a-1}}return null};function tv(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var a=null;return(t?a=e[t.sn-e[0].sn+1]||null:0===i&&0===e[0].start&&(a=e[0]),a&&0===tp(i,r,a))?a:tg(e,tp.bind(null,i,r))||a}function tp(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0);var r=Math.min(e,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-r<=t?1:i.start-r>t&&i.start?-1:0}function tm(t){var e="function"==typeof Map?new Map:void 0;return(tm=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return ty(t,arguments,tE(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),tT(i,t)})(t)}function ty(t,e,i){return(ty=!function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}()?function(t,e,i){var r=[null];r.push.apply(r,e);var a=new(Function.bind.apply(t,r));return i&&tT(a,i.prototype),a}:Reflect.construct).apply(null,arguments)}function tT(t,e){return(tT=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function tE(t){return(tE=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var tS=function(){function t(t,e){void 0===e&&(e=0),this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.blockSafeTimeout=!0,this.timeout=void 0,this.config=t,this.timeout=e}var e=t.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(t,e){var i=this,r=t.url;if(!r)return Promise.reject(new t_({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(r?"part list":"url")));this.abort();var a=this.config,n=a.fLoader,o=a.loader;return new Promise(function(r,l){i.loader&&i.loader.destroy();var u=i.loader=t.loader=n?new n(a):new o(a),h=tb(t),d=2.5*i.timeout,c={timeout:a.fragLoadingTimeOut,maxRetry:0,safeTimeout:d,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:131072};t.stats=u.stats,u.load(h,c,{onSuccess:function(e,a,n,s){i.blockSafeTimeout&&(i.blockSafeTimeout=!1),i.resetLoader(t,u),r({frag:t,part:null,payload:e.data,networkDetails:s})},onError:function(e,r,a){i.resetLoader(t,u),l(new t_({type:s.b.NETWORK_E
vendor: 5,279 bytes, line 1
1RROR,details:s.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:e,networkDetails:a}))},onAbort:function(e,r,a){i.resetLoader(t,u),l(new t_({type:s.b.NETWORK_ERROR,details:s.a.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:a}))},onTimeout:function(e,r,a){i.resetLoader(t,u),l(new t_({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:a}))},onSafeTimeout:function(e,r,a){i.blockSafeTimeout||(i.blockSafeTimeout=!0,i.resetLoader(t,u),l(new t_({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_SAFE_TIMEOUT,fatal:!1,frag:t,networkDetails:a})))},onProgress:function(i,r,a,n){e&&e({frag:t,part:null,payload:a,networkDetails:n})}})})},e.loadPart=function(t,e,i){var r=this;this.abort();var a=this.config,n=a.fLoader,o=a.loader;return new Promise(function(l,u){r.loader&&r.loader.destroy();var h=2.5*r.timeout,d=r.loader=t.loader=n?new n(a):new o(a),c=tb(t,e),f={timeout:a.fragLoadingTimeOut,maxRetry:0,safeTimeout:h,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:131072};e.stats=d.stats,d.load(c,f,{onSuccess:function(a,n,s,o){r.resetLoader(t,d),r.updateStatsFromPart(t,e);var u={frag:t,part:e,payload:a.data,networkDetails:o};i(u),l(u)},onError:function(i,a,n){r.resetLoader(t,d),u(new t_({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:i,networkDetails:n}))},onAbort:function(i,a,n){t.stats.aborted=e.stats.aborted,r.resetLoader(t,d),u(new t_({type:s.b.NETWORK_ERROR,details:s.a.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,networkDetails:n}))},onTimeout:function(i,a,n){r.resetLoader(t,d),u(new t_({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,networkDetails:n}))}})})},e.updateStatsFromPart=function(t,e){var i=t.stats,r=e.stats,a=r.total;if(i.loaded+=r.loaded,a){var n=Math.round(t.duration/e.duration),s=Math.min(Math.round(i.loaded/a),n),o=(n-s)*Math.round(i.loaded/s);i.total=i.loaded+o}else i.total=Math.max(i.loaded,i.total);var l=i.loading,u=r.loading;l.start?l.first+=u.first-u.start:(l.start=u.start,l.first=u.first),l.end=u.end},e.resetLoader=function(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()},t}();function tb(t,e){void 0===e&&(e=null);var i=e||t,r={frag:t,part:e,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},n=i.byteRangeStartOffset,s=i.byteRangeEndOffset;return Object(a.a)(n)&&Object(a.a)(s)&&(r.rangeStart=n,r.rangeEnd=s),r}var t_=function(t){function e(e){for(var i,r=arguments.length,a=Array(r>1?r-1:0),n=1;n<r;n++)a[n-1]=arguments[n];return(i=t.call.apply(t,[this].concat(a))||this).data=void 0,i.data=e,i}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,tT(e,t),e}(tm(Error)),tA=i(16),tL=function(t){for(var e="",i=t.length,r=0;r<i;r++)e+="["+t.start(r).toFixed(3)+","+t.end(r).toFixed(3)+"]";return e};function tR(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function tD(t,e){return(tD=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var tk="STOPPED",tI="IDLE",tO="KEY_LOADING",tC="FRAG_LOADING",tw="FRAG_LOADING_WAITING_RETRY",tP="WAITING_TRACK",tx="PARSING",tM="PARSED",tF="BACKTRACKING",tN="ENDED",tU="ERROR",tB="WAITING_INIT_PTS",tG="WAITING_LEVEL",tH=function(t){function e(e,i,r){var a;return(a=t.call(this)||this).hls=void 0,a.fragPrevious=null,a.fragCurrent=null,a.fragmentTracker=void 0,a.transmuxer=null,a._state=tk,a.media=void 0,a.mediaBuffer=void 0,a.config=void 0,a.bitrateTest=!1,a.lastCurrentTime=0,a.nextLoadPosition=0,a.startPosition=0,a.loadedmetadata=!1,a.fragLoadError=0,a.retryDate=0,a.levels=null,a.fragmentLoader=void 0,a.levelLastLoaded=null,a.startFragRequested=!1,a.decrypter=void 0,a.initPTS=[],a.onvseeking=null,a.onvended=null,a.logPrefix="",a.log=void 0,a.warn=void 0,a.logPrefix=r,a.log=o.b.log.bind(o.b,r+":"),a.warn=o.b.warn.bind(o.b,r+":"),a.hls=e,a.fragmentLoader=new tS(e.config),a.fragmentTracker=i,a.config=e.config,a.decrypter=new tA.a(e,e.config),e.on(n.a.KEY_LOADED,a.onKeyLoaded,function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(a)),a}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,tD(e,t);var i,r,u=e.prototype;return u.doTick=function(){this.onTickEnd()},u.onTickEnd=function(){},u.startLoad=function(t){},u.stopLoad=function(){this.fragmentLoader.abort();var t=this.fragCurrent;t&&this.fragmentTracker.removeFragment(t),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=tk},u._streamEnded=function(t,e){var i=this.fragCurrent,r=this.fragmentTracker;if(!e.live&&i&&i.sn>=e.endSN&&!t.nextStart){var a=e.partList;if(null!=a&&a.length){var n=a[a.length-1];return tl.isBuffered(this.media,n.start+n.duration/2)}var s=r.getState(i);return s===tt.PARTIAL||s===tt.OK}return!1},u.onMediaAttached=function(t,e){var i=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),i.addEventListener("seeking",this.onvseeking),i.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.state===tk&&this.startLoad(r.
1startPosition)},u.onMediaDetaching=function(){var t=this.media;null!=t&&t.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},u.onMediaSeeking=function(){var t=this.config,e=this.fragCurrent,i=this.media,r=this.mediaBuffer,n=this.state,s=i?i.currentTime:0,o=tl.bufferInfo(r||i,s,t.maxBufferHole);if(this.log("media seeking to "+(Object(a.a)(s)?s.toFixed(3):s)+", state: "+n),n===tN)this.resetLoadingState();else if(e&&!o.len){var l=t.maxFragLookUpTolerance,u=e.start-l,h=s>e.start+e.duration+l;(s<u||h)&&(h&&e.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),e.loader.abort()),this.resetLoadingState())}i&&(this.lastCurrentTime=s),this.loadedmetadata||o.len||(this.nextLoadPosition=this.startPosition=s),this.tickImmediate()},u.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},u.onKeyLoaded=function(t,e){if(this.state===tO&&e.frag===this.fragCurrent&&this.levels){this.state=tI;var i=this.levels[e.frag.level].details;i&&this.loadFragment(e.frag,i,e.frag.start)}},u.onHandlerDestroying=function(){this.stopLoad(),t.prototype.onHandlerDestroying.call(this)},u.onHandlerDestroyed=function(){this.state=tk,this.hls.off(n.a.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,t.prototype.onHandlerDestroyed.call(this)},u.loadKey=function(t,e){this.log("Loading key for "+t.sn+" of ["+e.startSN+"-"+e.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level),this.state=tO,this.fragCurrent=t,this.hls.trigger(n.a.KEY_LOADING,{frag:t})},u.loadFragment=function(t,e,i){this._loadFragForPlayback(t,e,i)},u._loadFragForPlayback=function(t,e,i){var r=this;this._doFragLoad(t,e,i,function(e){var i,a,n;r.fragContextChanged(t)?(r.warn("FragContextChanged, "+JSON.stringify({prev:{level:null==(i=r.fragCurrent)?void 0:i.level,sn:null==(a=r.fragCurrent)?void 0:a.sn,urlId:null==(n=r.fragCurrent)?void 0:n.urlId},next:{level:null==t?void 0:t.level,sn:null==t?void 0:t.sn,urlId:null==t?void 0:t.urlId}})),r.warn("Fragment "+t.sn+(e.part?" p: "+e.part.index:"")+" of level "+t.level+" was dropped during download."),r.fragmentTracker.removeFragment(t)):(t.stats.chunkCount++,r._handleFragmentLoadProgress(e))}).then(function(e){if(e){r.fragLoadError=0;var i=r.state;if(!r.fragContextChanged(t))return"payload"in e&&(r.log("Loaded fragment "+t.sn+" of level "+t.level),r.hls.trigger(n.a.FRAG_LOADED,e),r.state===tF)?(r.fragmentTracker.backtrack(t,e),void r.resetFragmentLoading(t)):void r._handleFragmentLoadComplete(e);i!==tC&&i!==tF&&(r.fragCurrent||i!==tx)||(r.fragmentTracker.removeFragment(t),r.state=tI)}}).catch(function(e){r&&(r.warn(e),r.resetFragmentLoading(t))})},u.flushMainBuffer=function(t,e,i){if(void 0===i&&(i=null),t-e){var r={startOffset:t,endOffset:e,type:i};this.fragLoadError=0,this.hls.trigger(n.a.BUFFER_FLUSHING,r)}},u._loadInitSegment=function(t){var e=this;this._doFragLoad(t).then(function(i){if(!i||e.fragContextChanged(t)||!e.levels)throw Error("init load aborted");return i}).then(function(i){var r=e.hls,a=i.payload,s=t.decryptdata;if(a&&a.byteLength>0&&s&&s.key&&s.iv&&"AES-128"===s.method){var o=self.performance.now();return e.decrypter.webCryptoDecrypt(new Uint8Array(a),s.key.buffer,s.iv.buffer).then(function(e){var a=self.performance.now();return r.trigger(n.a.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:o,tdecrypt:a}}),i.payload=e,i})}return i}).then(function(i){var r=e.fragCurrent,a=e.hls,s=e.levels;if(!s)throw Error("init load aborted, missing levels");s[t.level].details;var o=t.stats;e.state=tI,e.fragLoadError=0,t.data=new Uint8Array(i.payload),o.parsing.start=o.buffering.start=self.performance.now(),o.parsing.end=o.buffering.end=self.performance.now(),i.frag===r&&a.trigger(n.a.FRAG_BUFFERED,{stats:o,frag:r,part:null,id:t.type}),e.tick()}).catch(function(i){e.warn(i),e.resetFragmentLoading(t)}
vendor: 11,279 bytes, line 1
1)},u.fragContextChanged=function(t){var e=this.fragCurrent;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId},u.fragBufferedComplete=function(t,e){var i=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+t.type+" sn: "+t.sn+(e?" part: "+e.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level+" "+tL(tl.getBuffered(i))),this.state=tI,this.tick()},u._handleFragmentLoadComplete=function(t){var e=this.transmuxer;if(e){var i=t.frag,r=t.part,a=t.partsLoaded,n=!a||0===a.length||a.some(function(t){return!t}),s=new tu(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!n);e.flush(s)}},u._handleFragmentLoadProgress=function(t){},u._doFragLoad=function(t,e,i,r){var s=this;if(void 0===i&&(i=null),!this.levels)throw Error("frag load aborted, missing levels");if(i=Math.max(t.start,i||0),this.config.lowLatencyMode&&e){var o=e.partList;if(o&&r){i>t.end&&e.fragmentHint&&(t=e.fragmentHint);var l=this.getNextPart(o,t,i);if(l>-1){var u=o[l];return this.log("Loading part sn: "+t.sn+" p: "+u.index+" cc: "+t.cc+" of playlist ["+e.startSN+"-"+e.endSN+"] parts [0-"+l+"-"+(o.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(i.toFixed(3))),this.nextLoadPosition=u.start+u.duration,this.state=tC,this.hls.trigger(n.a.FRAG_LOADING,{frag:t,part:o[l],targetBufferTime:i}),this.doFragPartsLoad(t,o,l,r).catch(function(t){return s.handleFragLoadError(t)})}if(!t.url||this.loadedEndOfParts(o,i))return Promise.resolve(null)}}return this.log("Loading fragment "+t.sn+" cc: "+t.cc+" "+(e?"of ["+e.startSN+"-"+e.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(i.toFixed(3))),Object(a.a)(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=tC,this.hls.trigger(n.a.FRAG_LOADING,{frag:t,targetBufferTime:i}),this.fragmentLoader.load(t,r).catch(function(t){return s.handleFragLoadError(t)})},u.doFragPartsLoad=function(t,e,i,r){var a=this;return new Promise(function(s,o){var l=[];!function i(u){var h=e[u];a.fragmentLoader.loadPart(t,h,r).then(function(r){l[h.index]=r;var o=r.part;a.hls.trigger(n.a.FRAG_LOADED,r);var d=e[u+1];if(!d||d.fragment!==t)return s({frag:t,part:o,partsLoaded:l});i(u+1)}).catch(o)}(i)})},u.handleFragLoadError=function(t){var e=t.data;return e&&e.details===s.a.FRAG_LOAD_SAFE_TIMEOUT?this.hls.trigger(n.a.FRAG_SAFE_TIMEOUT,null):e&&e.details===s.a.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):e&&[s.a.FRAG_LOAD_ERROR,s.a.FRAG_LOAD_TIMEOUT].includes(e.details)?this.hls.trigger(n.a.FRAG_SKIPPED,{frag:e.frag}):this.hls.trigger(n.a.ERROR,e),null},u._handleTransmuxerFlush=function(t){var e=this.getCurrentContext(t);if(e&&this.state===tx){var i=e.frag,r=e.part,a=e.level,n=self.performance.now();i.stats.parsing.end=n,r&&(r.stats.parsing.end=n),this.updateLevelTiming(i,r,a,t.partial)}else this.fragCurrent||(this.state=tI)},u.getCurrentContext=function(t){var e=this.levels,i=t.level,r=t.sn,a=t.part;if(!e||!e[i])return this.warn("Levels object was unset while buffering fragment "+r+" of level "+i+". The current chunk will not be buffered."),null;var n=e[i],s=a>-1?function(t,e,i){if(!t||!t.details)return null;var r=t.details.partList;if(r)for(var a=r.length;a--;){var n=r[a];if(n.index===i&&n.fragment.sn===e)return n}return null}(n,r,a):null,o=s?s.fragment:function(t,e,i){if(!t||!t.details)return null;var r=t.details,a=r.fragments[e-r.startSN];return a||((a=r.fragmentHint)&&a.sn===e?a:e<r.startSN&&i&&i.sn===e?i:null)}(n,r,this.fragCurrent);return o?{frag:o,part:s,level:n}:null},u.bufferFragmentData=function(t,e,i,r){if(t&&this.state===tx){var a=t.data1,s=t.data2,o=a;if(a&&s&&(o=Object(l.b)(a,s)),o&&o.length){var u={type:t.type,frag:e,part:i,chunkMeta:r,parent:e.type,data:o};this.hls.trigger(n.a.BUFFER_APPENDING,u),t.dropped&&t.independent&&!i&&this.flushBufferGap(e)}}},u.flushBufferGap=function(t){var e=this.media;if(e)if(tl.isBuffered(e,e.currentTime)){var i=e.currentTime,r=tl.bufferInfo(e,i,0),a=t.duration,n=Math.min(2*this.config.maxFragLookUpTolerance,.25*a),s=Math.max(Math.min(t.start-n,r.end-n),i+n);t.start-s>n&&this.flushMainBuffer(s,t.start)}else this.flushMainBuffer(0,t.start)},u.getFwdBufferInfo=function(t,e){var i=this.config,r=this.getLoadPosition();if(!Object(a.a)(r))return null;var n=tl.bufferInfo(t,r,i.maxBufferHole);if(0===n.len&&void 0!==n.nextStart){var s=this.fragmentTracker.getBufferedFrag(r,e);if(s&&n.nextStart<s.end)return tl.bufferInfo(t,r,Math.max(n.nextStart,i.maxBufferHole))}return n},u.getMaxBufferLength=function(t){var e=this.config;return Math.min(t?Math.max(8*e.maxBufferSize/t,e.maxBufferLength):e.maxBufferLength,e.maxMaxBufferLength)},u.reduceMaxBufferLength=function(t){var e=this.config,i=t||e.maxBufferLength;return e.maxMaxBufferLength>=i&&(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},u.getNextFragment=function(t,e){var i,r,a=e.fragments,n=a.length;if(!n)return null;var s,o=this.config,l=a[0].start;if(e.live){var u=o.initialLiveManifestSize;if(n<u)return this.warn("Not enough fragments to start playback (have: "+n+", need: "+u+")"),null;e.PTSKnown||this.startFragRequested||-1!==this.startPosition||(s=this.getInitialLiveFragment(e,a),this.startPosition=s?this.hls.liveSyncPosition||s.start:t)}else t<=l&&(s=a[0]);if(!s){var h=o.lowLatencyMode?e.partEnd:e.fragmentEnd;s=this.getFragmentAtPosition(t,h,e)}return null==(i=s)||!i.initSegment||null!=(r=s)&&r.initSegment.data||this.bitrateTest||(s=s.initSegment),s},u.getNextPart=function(t,e,i){for(var r=-1,a=!1,n=!0,s=0,o=t.length;s<o;s++){var l=t[s];if(n=n&&!l.independent,r>-1&&i<l.start)break;var u=l.loaded;!u&&(a||l.independent||n)&&l.fragment===e&&(r=s),a=u}return r},u.loadedEndOfParts=function(t,e){var i=t[t.length-1];return i&&e>i.start&&i.loaded},u.getInitialLiveFragment=function(t,e){var i=this.fragPrevious,r=null;if(i){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+i.programDateTime),r=function(t,e,i){if(null===e||!Array.isArray(t)||!t.length||!Object(a.a)(e)||e<(t[0].programDateTime||0)||e>=(t[t.length-1].endProgramDateTime||0))return null;i=i||0;for(var r=0;r<t.length;++r){var n=t[r];if(function(t,e,i){var r=1e3*Math.min(e,i.duration+(i.deltaPTS?i.deltaPTS:0));return(i.endProgramDateTime||0)-r>t}(e,i,n))return n}return null}(e,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){var n,s=i.sn+1;if(s>=t.startSN&&s<=t.endSN){var o=e[s-t.startSN];i.cc===o.cc&&(r=o,this.log("Live playlist, switching playlist, load frag with next SN: "+r.sn))}r||(n=i.cc,(r=tg(e,function(t){return t.cc<n?1:t.cc>n?-1:0}))&&this.log("Live playlist, switching playlist, load frag with same CC: "+r.sn))}}else{var l=this.hls.liveSyncPosition;null!==l&&(r=this.getFragmentAtPosition(l,this.bitrateTest?t.fragmentEnd:t.edge,t))}return r},u.getFragmentAtPosition=function(t,e,i){var r,a=this.config,n=this.fragPrevious,s=i.fragments,o=i.endSN,l=i.fragmentHint,u=a.maxFragLookUpTolerance,h=!!(a.lowLatencyMode&&i.partList&&l);if(h&&l&&!this.bitrateTest&&(s=s.concat(l),o=l.sn),r=t<e?tv(n,s,t,t>e-u?0:u):s[s.length-1]){var d=r.sn-i.startSN,c=n&&r.level===n.level,f=s[d+1];if(this.fragmentTracker.getState(r)===tt.BACKTRACKED){r=null;for(var g=d;s[g]&&this.fragmentTracker.getState(s[g])===tt.BACKTRACKED;)r=n?s[g--]:s[--g];r||(r=f)}else n&&r.sn===n.sn&&!h&&c&&(r.sn<o&&this.fragmentTracker.getState(f)!==tt.OK?(this.log("SN "+r.sn+" just loaded, load next one: "+f.sn),r=f):r=null)}return r},u.synchronizeToLiveEdge=function(t){var e=this.config,i=this.media;if(i){var r=this.hls.liveSyncPosition,a=i.currentTime,n=t.fragments[0].start,s=t.edge,o=a>=n-e.maxFragLookUpTolerance&&a<=s;if(null!==r&&i.duration>r&&(a<r||!o)){var l=void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;(!o&&i.readyState<4||a<s-l)&&(this.loadedmetadata||(this.nextLoadPosition=r),i.readyState&&(this.warn("Playback: "+a.toFixed(3)+" is located too far from the end of live sliding playlist: "+s+", reset currentTime to : "+r.toFixed(3)),i.currentTime=r))}}},u.alignPlaylists=function(t,e){var i=this.levels,r=this.levelLastLoaded,n=this.fragPrevious,s=null!==r?i[r]:null,l=t.fragments.length;if(!l)return this.warn("No fragments in live playlist"),0;var u=t.fragments[0].start,h=!e,d=t.alignedSliding&&Object(a.a)(u);if(h||!d&&!u){s&&(!function(t,e,i){if(!(!i.details||!(e.endCC>e.startCC||t&&t.cc<e.startCC))){var r=function(t,e){var i=t.fragments,r=e.fragments;if(r.length&&i.length){var a=function(t,e){for(var i=null,r=0,a=t.length;r<a;r++){var n=t[r];if(n&&n.cc===e){i=n;break}}return i}(i,r[0].cc);if(a&&(!a||a.startPTS))return a;o.b.log("No frag in previous level to align on")}else o.b.log("No fragments to align")}(i.details,e);r&&Object(a.a)(r.start)&&(o.b.log("Adjusting PTS using last level due to CC increase within current level "+e.url),td(r.start,e))}}(n,t,s),!t.alignedSliding&&s.details&&function(t,e){if(e.fragments.length&&t.hasProgramDateTime&&e.hasProgramDateTime){var i=e.fragments[0].programDateTime,r=t.fragments[0].programDateTime,n=(r-i)/1e3+e.fragments[0].start;n&&Object(a.a)(n)&&(o.b.log("Adjusting PTS using programDateTime delta "+(r-i)+"ms, sliding:"+n.toFixed(3)+" "+t.url+" "),td(n,t))}}(t,s.details),t.alignedSliding||!s.details||t.skippedSegments||q(s.details,t));var c=t.fragments[0].start;return this.log("Live playlist sliding: "+c.toFixed(2)+" start-sn: "+(e?e.startSN:"na")+"->"+t.startSN+" prev-sn: "+(n?n.sn:"na")+" fragments: "+l),c}return u},u.waitForCdnTuneIn=function(t){return t.live&&t.canBlockReload&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)},u.setStartPosition=function(t,e){var i=this.startPosition;if(i<e&&(i=-1),-1===i||-1===this.lastCurrentTime){var r=t.startTimeOffset;Object(a.a)(r)?(i=e+r,r<0&&(i+=t.totalduration),i=Math.min(Math.max(e,i),e+t.totalduration),this.log("Start time offset "+r+" found in playlist, adjust startPosition to "+i),this.startPosition=i):t.live?i=this.hls.liveSyncPosition||e:this.startPosition=i=0,this.lastCurrentTime=i}this.nextLoadPosition=i},u.getLoadPosition=function(){var t=this.media,e=0;return this.loadedmetadata&&t?e=t.currentTime:this.nextLoadPosition&&(e=this.nextLoadPosition),e},u.handleFragLoadAborted=function(t,e){this.transmuxer&&"initSegment"!==t.sn&&t.stats.aborted&&(this.warn("Fragment "+t.sn+(e?" part"+e.index:"")+" of level "+t.level+" was aborted"),this.resetFragmentLoading(t))},u.resetFragmentLoading=function(t){this.fragCurrent&&this.fragContextChanged(t)||(this.state=tI)},u.onFragmentOrKeyLoadError=function(t,e){if(!e.fatal){var i=e.frag;if(i&&i.type===t){this.fragCurrent;var r=this.config;if(this.fragLoadError+1<=r.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(i.level))return;var a=Math.min(Math.pow(2,this.fragLoadError)*r.fragLoadingRetryDelay,r.fragLoadingMaxRetryTimeout);this.warn("Fragment "+i.sn+" of "+t+" "+i.level+" failed to load, retrying in "+a+"ms"),this.retryDate=self.performance.now()+a,this.fragLoadError++,this.state=tw}else e.levelRetry?(t===D.b.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=tI):(o.b.error(e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.hls.stopLoad(),this.state=tU)}}}
1,u.afterBufferFlushed=function(t,e,i){if(t){var r=tl.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,r,i),this.state===tN&&this.resetLoadingState()}},u.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=tI},u.resetLiveStartWhenNotLoaded=function(t){if(!this.loadedmetadata){this.startFragRequested=!1;var e=this.levels?this.levels[t].details:null;if(null!=e&&e.live)return this.startPosition=-1,this.setStartPosition(e,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},u.updateLevelTiming=function(t,e,i,r){var a=this,s=i.details;Object.keys(t.elementaryStreams).reduce(function(e,o){var l=t.elementaryStreams[o];if(l){var u=l.endPTS-l.startPTS;if(u<=0)return a.warn("Could not parse fragment "+t.sn+" "+o+" duration reliably ("+u+") resetting transmuxer to fallback to playlist timing"),a.resetTransmuxer(),e||!1;var h=r?0:Y(s,t,l.startPTS,l.endPTS,l.startDTS,l.endDTS);return a.hls.trigger(n.a.LEVEL_PTS_UPDATED,{details:s,level:i,drift:h,type:o,frag:t,start:l.startPTS,end:l.endPTS}),!0}return e},!1)?(this.state=tM,this.hls.trigger(n.a.FRAG_PARSED,{frag:t,part:e})):this.resetLoadingState()},u.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},i=[{key:"state",get:function(){return this._state},set:function(t){if(this){var e=this._state;e!==t&&(this.hls.trigger(n.a.STREAM_STATE_TRANSITION,{previousState:e,state:t}),this._state=t,this.log(e+"->"+t))}}}],tR(e.prototype,i),r&&tR(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(ts);function tj(){return self.MediaSource||self.WebKitMediaSource}function tK(){return self.SourceBuffer||self.WebKitSourceBuffer}var tV=i(18),tW=i(10),tY=i(15),tq=tj()||{isTypeSupported:function(){return!1}},tX=function(){function t(t,e,i,r){var a,l=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=t,this.id=e,this.onTransmuxComplete=i,this.onFlush=r;var u=t.config,h=function(e,i){(i=i||{}).frag=l.frag,i.id=l.id,t.trigger(e,i)};this.observer=new tY.EventEmitter,this.observer.on(n.a.FRAG_DECRYPTED,h),this.observer.on(n.a.ERROR,h);var d={mp4:tq.isTypeSupported("video/mp4"),mpeg:tq.isTypeSupported("audio/mpeg"),mp3:tq.isTypeSupported('audio/mp4; codecs="mp3"')},c=navigator.vendor;if(u.enableWorker&&"u">typeof Worker){o.b.log("demuxing in webworker");try{a=this.worker=tV(19),this.onwmsg=this.onWorkerMessage.bind(this),a.addEventListener("message",this.onwmsg),a.onerror=function(e){t.trigger(n.a.ERROR,{type:s.b.OTHER_ERROR,details:s.a.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:Error(e.message+" ("+e.filename+":"+e.lineno+")")})},a.postMessage({cmd:"init",typeSupported:d,vendor:c,id:e,config:JSON.stringify(u)})}catch(t){o.b.warn("Error in worker:",t),o.b.error("Error while initializing DemuxerWorker, fallback to inline"),a&&self.URL.revokeObjectURL(a.objectURL),this.transmuxer=new tW.c(this.observer,d,u,c,e),this.worker=null}}else this.transmuxer=new tW.c(this.observer,d,u,c,e)}var e=t.prototype;return e.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.observer=null},e.push=function(t,e,i,r,a,n,s,l,u,h){var d,c,f=this;u.transmuxing.start=self.performance.now();var g=this.transmuxer,v=this.worker,p=n?n.start:a.start,m=a.decryptdata,y=this.frag,T=!(y&&a.cc===y.cc),E=!(y&&u.level===y.level),S=y?u.sn-y.sn:-1,b=this.part?u.part-this.part.index:1,_=!E&&(1===S||0===S&&1===b),A=self.performance.now();(E||S||0===a.stats.parsing.start)&&(a.stats.parsing.start=A),n&&(b||!_)&&(n.stats.parsing.start=A);var L=!(y&&(null==(d=a.initSegment)?void 0:d.url)===(null==(c=y.initSegment)?void 0:c.url)),R=new tW.b(T,_,l,E,p,L);if(!_||T||L){o.b.log("[transmuxer-interface, "+a.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+"\n discontinuity: "+T+"\n trackSwitch: "+E+"\
1n contiguous: "+_+"\n accurateTimeOffset: "+l+"\n timeOffset: "+p+"\n initSegmentChange: "+L);var D=new tW.a(i,r,e,s,h);this.configureTransmuxer(D)}if(this.frag=a,this.part=n,v)v.postMessage({cmd:"demux",data:t,decryptdata:m,chunkMeta:u,state:R},t instanceof ArrayBuffer?[t]:[]);else if(g){var k=g.push(t,m,u,R);Object(tW.d)(k)?k.then(function(t){f.handleTransmuxComplete(t)}):this.handleTransmuxComplete(k)}},e.flush=function(t){var e=this;t.transmuxing.start=self.performance.now();var i=this.transmuxer,r=this.worker;if(r)r.postMessage({cmd:"flush",chunkMeta:t});else if(i){var a=i.flush(t);Object(tW.d)(a)?a.then(function(i){e.handleFlushResult(i,t)}):this.handleFlushResult(a,t)}},e.handleFlushResult=function(t,e){var i=this;t.forEach(function(t){i.handleTransmuxComplete(t)}),this.onFlush(e)},e.onWorkerMessage=function(t){var e=t.data,i=this.hls;switch(e.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,i.trigger(e.event,e.data)}},e.configureTransmuxer=function(t){var e=this.worker,i=this.transmuxer;e?e.postMessage({cmd:"configure",config:t}):i&&i.configure(t)},e.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},t}(),tz=function(){function t(t,e,i,r){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=e,this.fragmentTracker=i,this.hls=r}var e=t.prototype;return e.destroy=function(){this.hls=this.fragmentTracker=this.media=null},e.poll=function(t){var e=this.config,i=this.media,r=this.stalled,a=i.currentTime,n=i.seeking,s=this.seeking&&!n,l=!this.seeking&&n;if(this.seeking=n,a===t){if((l||s)&&(this.stalled=null),!i.paused&&!i.ended&&0!==i.playbackRate&&tl.getBuffered(i).length){var u=tl.bufferInfo(i,a,0),h=u.len>0,d=u.nextStart||0;if(h||d){if(n){var c=u.len>2,f=!d||d-a>2&&!this.fragmentTracker.getPartialFragment(a);if(c||f)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var g,v=Math.max(d,u.start||0)-a,p=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,m=(null==p||null==(g=p.details)?void 0:g.live)?2*p.details.targetduration:2;if(v>0&&v<=m)return void this._trySkipBufferHole(null)}var y=self.performance.now();if(null!==r){var T=y-r;!n&&T>=250&&this._reportStall(u.len);var E=tl.bufferInfo(i,a,e.maxBufferHole);this._tryFixBufferStall(E,T)}else this.stalled=y}}}else if(this.moved=!0,null!==r){if(this.stallReported){var S=self.performance.now()-r;o.b.warn("playback not stuck anymore @"+a+", after "+Math.round(S)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}},e._tryFixBufferStall=function(t,e){var i=this.config,r=this.fragmentTracker,a=this.media;if(this.media){var n=a.currentTime,s=r.getPartialFragment(n);if(s&&this._trySkipBufferHole(s))return;t.len>i.maxBufferHole&&e>1e3*i.highBufferWatchdogPeriod&&(o.b.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},e._reportStall=function(t){var e=this.hls,i=this.media;this.stallReported||(this.stallReported=!0,o.b.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+t+")"),e.trigger(n.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:t}))},e._trySkipBufferHole=function(t){for(var e=this.config,i=this.hls,r=this.media,a=r.currentTime,l=0,u=tl.getBuffered(r),h=0;h<u.length;h++){var d=u.start(h);if(a+e.maxBufferHole>=l&&a<d){var c=Math.max(d+.05,r.currentTime+.1);return o.b.warn("skipping hole, adjusting currentTime from "+a+" to "+c),this.moved=!0,this.stalled=null,r.currentTime=c,t&&i.trigger(n.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+c,frag:t}),c}l=u.end(h)}return 0},e._tryNudgeBuffer=function(){var t=this.config,e=this.hls,i=this.media,r=this.nudgeRetry,a=i.currentTime;if(this.nudgeRetry++,r<t.nudgeMaxRetry){var l=a+(r+1)*t.nudgeOffset;o.b.warn("Nudging 'currentTime' from "+a+" to "+l),i.currentTime=l,e.trigger(n.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_NUDGE_ON_STALL,fatal:!1})}else o.b.error("Playhead still not moving while enough data buffered @"+a+" after "+t.
vendor: 35,150 bytes, line 1
1nudgeMaxRetry+" nudges"),e.trigger(n.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_STALLED_ERROR,fatal:!0})},t}();function tQ(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function t$(t,e){return(t$=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var tZ=function(t){function e(e,i){var r;return(r=t.call(this,e,i,"[stream-controller]")||this).audioCodecSwap=!1,r.gapController=null,r.level=-1,r._forceStartLoad=!1,r.altAudio=!1,r.audioOnly=!1,r.fragPlaying=null,r.onvplaying=null,r.onvseeked=null,r.fragLastKbps=0,r.stalled=!1,r.couldBacktrack=!1,r.audioCodecSwitch=!1,r.videoBuffer=null,r._registerListeners(),r}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,t$(e,t);var i,r,l=e.prototype;return l._registerListeners=function(){var t=this.hls;t.on(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(n.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(n.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(n.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(n.a.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(n.a.ERROR,this.onError,this),t.on(n.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(n.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(n.a.BUFFER_CREATED,this.onBufferCreated,this),t.on(n.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(n.a.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(n.a.FRAG_BUFFERED,this.onFragBuffered,this),t.on(n.a.FRAG_SKIPPED,this.onFragmentSkipped,this)},l._unregisterListeners=function(){var t=this.hls;t.off(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(n.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(n.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(n.a.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(n.a.ERROR,this.onError,this),t.off(n.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(n.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(n.a.BUFFER_CREATED,this.onBufferCreated,this),t.off(n.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(n.a.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(n.a.FRAG_BUFFERED,this.onFragBuffered,this)},l.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},l.startLoad=function(t){if(this.levels){var e=this.lastCurrentTime,i=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var r=i.startLevel;-1===r&&(i.config.testBandwidth?(r=0,this.bitrateTest=!0):r=i.nextAutoLevel),this.level=i.nextLoadLevel=r,this.loadedmetadata=!1}e>0&&-1===t&&(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=tI,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=tk},l.stopLoad=function(){this._forceStartLoad=!1,t.prototype.stopLoad.call(this)},l.doTick=function(){switch(this.state){case tI:this.doTickIdle();break;case tG:var t,e=this.levels,i=this.level,r=null==e||null==(t=e[i])?void 0:t.details;if(r&&(!r.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(r))break;this.state=tI}break;case tw:var a,n=self.performance.now(),s=this.retryDate;(!s||n>=s||null!=(a=this.media)&&a.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=tI)}this.onTickEnd()},l.onTickEnd=function(){t.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},l.doTickIdle=function(){var t,e,i=this.hls,r=this.levelLastLoaded,a=this.levels,s=this.media,o=i.config,l=i.nextLoadLevel;if(null!==r&&(s||!this.startFragRequested&&o.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&a&&a[l]){var h=a[l];this.level=i.nextLoadLevel=l;var d=h.details;if(!d||this.state===tG||d.live&&this.levelLastLoaded!==l)this.state=tG;else{var c=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:s,D.b.MAIN);if(null!==c&&!(c.len>=this.getMaxBufferLength(h.maxBitrate))){if(this._streamEnded(c,d)){var f={};return this.altAudio&&(f.type="video"),this.hls.trigger(n.a.BUFFER_EOS,f),void(this.state=tN)}var g=c.end,v=this.getNextFragment(g,d);if(this.couldBacktrack&&!this.fragPrevious&&v&&"initSegment"!==v.sn){var p=v.sn-d.startSN;p>1&&(v=d.fragments[p-1],this.fragmentTracker.removeFragment(v))}if(v&&this.fragmentTracker.getState(v)===tt.OK&&this.nextLoadPosition>g){var m=this.audioOnly&&!this.altAudio?u.a.AUDIO:u.a.VIDEO;this.afterBufferFlushed(s,m,D.b.MAIN),v=this.getNextFragment(this.nextLoadPosition,d)}v&&(!v.initSegment||v.initSegment.data||this.bitrateTest||(v=v.initSegment),"identity"!==(null==(t=v.decryptdata)?void 0:t.keyFormat)||null!=(e=v.decryptdata)&&e.key?this.loadFragment(v,d,g):this.loadKey(v,d))}}}},l.loadFragment=function(e,i,r){var a,n=this.fragmentTracker.getState(e);if(this.fragCurrent=e,n===tt.BACKTRACKED){var s=this.fragmentTracker.getBacktrackData(e);if(s)return this._handleFragmentLoadProgress(s),void this._handleFragmentLoadComplete(s);n=tt.NOT_LOADED}n===tt.NOT_LOADED||n===tt.PARTIAL?"initSegment"===e.sn?this._loadInitSegment(e):this.bitrateTest?(e.bitrateTest=!0,this.log("Fragment "+e.sn+" of level "+e.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(e)):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,i,r)):n===tt.APPENDING?this.reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e):0===(null==(a=this.media)?void 0:a.buffered.length)&&this.fragmentTracker.removeAllFragments()},l.getAppendedFrag=function(t){var e=this.fragmentTracker.getAppendedFrag(t,D.b.MAIN);return e&&"fragment"in e?e.fragment:e},l.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,D.b.MAIN)},l.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.end+.5):null},l.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,1/0)},l.nextLevelSwitch=function(){var t=this.levels,e=this.media;if(null!=e&&e.readyState){var i,r=this.getAppendedFrag(e.currentTime);if(r&&r.start>1&&this.flushMainBuffer(0,r.start-1),!e.paused&&t){var a=t[this.hls.nextLoadLevel],n=this.fragLastKbps;i=n&&this.fragCurrent?this.fragCurrent.duration*a.maxBitrate/(1e3*n)+1:0}else i=0;var s=this.getBufferedFrag(e.currentTime+i);if(s){var o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();var l=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,h=Math.max(s.end,l+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,.5*u),.75*u));this.flushMainBuffer(h,1/0)}}}},l.abortCurrentFrag=function(){var t=this.fragCurrent;this.fragCurrent=null,null!=t&&t.loader&&t.loader.abort(),this.state===tO&&(this.state=tI),this.nextLoadPosition=this.getLoadPosition()},l.flushMainBuffer=function(e,i){t.prototype.flushMainBuffer.call(this,e,i,this.altAudio?"video":null)},l.onMediaAttached=function(e,i){t.prototype.onMediaAttached.call(this,e,i);var r=i.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),r.addEventListener("playing",this.onvplaying),r.addEventListener("seeked",this.onvseeked),this.gapController=new tz(this.config,r,this.fragmentTracker,this.hls)},l.onMediaDetaching=function(){var e=this.media;e&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),t.prototype.onMediaDetaching.call(this)},l.onMediaPlaying=function(){this.tick()},l.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:null;Object(a.a)(e)&&this.log("Media seeked to "+e.toFixed(3)),this.tick()},l.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(n.a.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},l.onManifestParsed=function(t,e){var i,r,a,n=!1,s=!1;e.levels.forEach(function(t){(i=t.audioCodec)&&(-1!==i.indexOf("mp4a.40.2")&&(n=!0),-1!==i.indexOf("mp4a.40.5")&&(s=!0))}),this.audioCodecSwitch=n&&s&&"function"!=typeof(null==(a=tK())||null==(r=a.prototype)?void 0:r.changeType),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1},l.onLevelLoading=function(t,e){var i=this.levels;if(i&&this.state===tI){var r=i[e.level];(!r.details||r.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(r.details))&&(this.state=tG)}},l.onFragmentSkipped=function(t,e){this.fragmentTracker.onFragSkipped(e),this.state=tI,this.startFragRequested=!1,this.tick()},l.onLevelLoaded=function(t,e){var i,r=this.levels,a=e.level,s=e.details,o=s.totalduration;if(r){this.log("Level "+a+" loaded ["+s.startSN+","+s.endSN+"], cc ["+s.startCC+", "+s.endCC+"] duration:"+o);var l=this.fragCurrent;!l||this.state!==tC&&this.state!==tw||l.level!==e.level&&l.loader&&(this.state=tI,l.loader.abort());var u=r[a],h=0;if(s.live||null!=(i=u.details)&&i.live){if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed)return;h=this.alignPlaylists(s,u.details)}if(u.details=s,this.levelLastLoaded=a,this.hls.trigger(n.a.LEVEL_UPDATED,{details:s,level:a}),this.state===tG){if(this.waitForCdnTuneIn(s))return;this.state=tI}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,h),this.tick()}else this.warn("Levels were reset while loading level "+a)},l._handleFragmentLoadProgress=function(t){var e,i=t.frag,r=t.part,a=t.payload,n=this.levels;if(n){var s=n[i.level],o=s.details;if(o){var l=s.videoCodec,u=o.PTSKnown||!o.live,h=null==(e=i.initSegment)?void 0:e.data,d=this._getAudioCodec(s),c=this.transmuxer=this.transmuxer||new tX(this.hls,D.b.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=r?r.index:-1,g=new tu(i.level,i.sn,i.stats.chunkCount,a.byteLength,f,-1!==f),v=this.initPTS[i.cc];c.push(a,h,d,l,i,r,o.totalduration,u,g,v)}else this.warn("Dropping fragment "+i.sn+" of level "+i.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+i.sn+" of level "+i.level+" will not be buffered")},l.onAudioTrackSwitching=function(t,e){var i=this.altAudio,r=!!e.url,a=e.id;if(!r){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var s=this.fragCurrent;null!=s&&s.loader&&(this.log("Switching to main audio track, cancel main fragment load"),s.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var o=this.hls;i&&o.trigger(n.a.BUFFER_FLUSHING,{startOffset:0,endOffset:1/0,type:"audio"}),o.trigger(n.a.AUDIO_TRACK_SWITCHED,{id:a})}},l.onAudioTrackSwitched=function(t,e){var i=e.id,r=!!this.hls.audioTracks[i].url;if(r){var a=this.videoBuffer;a&&this.mediaBuffer!==a&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=a)}this.altAudio=r,this.tick()},l.onBufferCreated=function(t,e){var i,r,a=e.tracks,n=!1;for(var s in a){var o=a[s];if("main"===o.id){if(r=s,i=o,"video"===s){var l=a[s];l&&(this.videoBuffer=l.buffer)}}else n=!0}n&&i?(this.log("Alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media},l.onFragBuffered=function(t,e){var i=e.frag,r=e.part;if(!i||i.type===D.b.MAIN){if(this.fragContextChanged(i))return this.warn("Fragment "+i.sn+(r?" p: "+r.index:"")+" of level "+i.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===tM&&(this.state=tI));var a=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),"initSegment"!==i.sn&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}},l.onError=function(t,e){switch(e.details){case s.a.FRAG_LOAD_ERROR:case s.a.FRAG_LOAD_TIMEOUT:case s.a.KEY_LOAD_ERROR:case s.a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.b.MAIN,e);break;case s.a.LEVEL_LOAD_ERROR:case s.a.LEVEL_LOAD_TIMEOUT:this.state!==tU&&(e.fatal?(this.warn(""+e.details),this.state=tU):e.levelRetry||this.state!==tG||(this.state=tI));break;case s.a.BUFFER_FULL_ERROR:if("main"===e.parent&&(this.state===tx||this.state===tM)){var i=!0,r=this.getFwdBufferInfo(this.media,D.b.MAIN);r&&r.len>.5&&(i=!this.reduceMaxBufferLength(r.len)),i&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},l.checkBuffer=function(){var t=this.media,e=this.gapController;if(t&&e&&t.readyState){var i=tl.getBuffered(t);!this.loadedmetadata&&i.length?(this.loadedmetadata=!0,this.seekToStartPos()):e.poll(this.lastCurrentTime),this.lastCurrentTime=t.currentTime}},l.onFragLoadEmergencyAborted=function(){this.state=tI,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},l.onBufferFlushed=function(t,e){var i=e.type;if(i!==u.a.AUDIO||this.audioOnly&&!this.altAudio){var r=(i===u.a.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(r,i,D.b.MAIN)}},l.onLevelsUpdated=function(t,e){this.levels=e.levels},l.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},l.seekToStartPos=function(){var t=this.media,e=t.currentTime,i=this.startPosition;if(i>=0&&e<i){if(t.seeking)return void o.b.log("could not seek to "+i+", already seeking at "+e);var r=tl.getBuffered(t),a=(r.length?r.start(0):0)-i;a>0&&(a<this.config.maxBufferHole||a<this.config.maxFragLookUpTolerance)&&(o.b.log("adjusting start position by "+a+" to match buffer start"),i+=a,this.startPosition=i),this.log("seek to target start position "+i+" from current time "+e),t.currentTime=i}},l._getAudioCodec=function(t){var e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),e},l._loadBitrateTestFrag=function(t){var e=this;this._doFragLoad(t).then(function(i){var r=e.hls;if(i&&!r.nextLoadLevel&&!e.fragContextChanged(t)){e.fragLoadError=0,e.state=tI,e.startFragRequested=!1,e.bitrateTest=!1;var a=t.stats;a.parsing.start=a.parsing.end=a.buffering.start=a.buffering.end=self.performance.now(),r.trigger(n.a.FRAG_LOADED,i)}})},l._handleTransmuxComplete=function(t){var e,i="main",r=this.hls,s=t.remuxResult,o=t.chunkMeta,l=this.getCurrentContext(o);if(!l)return this.warn("The loading context changed while buffering fragment "+o.sn+" of level "+o.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(o.level);var h=l.frag,d=l.part,c=l.level,f=s.video,g=s.text,v=s.id3,p=s.initSegment,m=this.altAudio?void 0:s.audio;if(!this.fragContextChanged(h)){if(this.state=tx,p){p.tracks&&(this._bufferInitSegment(c,p.tracks,h,o),r.trigger(n.a.FRAG_PARSING_INIT_SEGMENT,{frag:h,id:i,tracks:p.tracks}));var y=p.initPTS,T=p.timescale;Object(a.a)(y)&&(this.initPTS[h.cc]=y,r.trigger(n.a.INIT_PTS_FOUND,{frag:h,id:i,initPTS:y,timescale:T}))}if(f&&!1!==s.independent){if(c.details){var E=f.startPTS,S=f.endPTS,b=f.startDTS,_=f.endDTS;if(d)d.elementaryStreams[f.type]={startPTS:E,endPTS:S,startDTS:b,endDTS:_};else if(f.firstKeyFrame&&f.independent&&(this.couldBacktrack=!0),f.dropped&&f.independent){if(this.getLoadPosition()+this.config.maxBufferHole<E)return void this.backtrack(h);h.setElementaryStreamInfo(f.type,h.start,S,h.start,_,!0)}h.setElementaryStreamInfo(f.type,E,S,b,_),this.bufferFragmentData(f,h,d,o)}}else if(!1===s.independent)return void this.backtrack(h);if(m){var A=m.startPTS,L=m.endPTS,R=m.startDTS,D=m.endDTS;d&&(d.elementaryStreams[u.a.AUDIO]={startPTS:A,endPTS:L,startDTS:R,endDTS:D}),h.setElementaryStreamInfo(u.a.AUDIO,A,L,R,D),this.bufferFragmentData(m,h,d,o)}if(null!=v&&null!=(e=v.samples)&&e.length){var k={frag:h,id:i,samples:v.samples};r.trigger(n.a.FRAG_PARSING_METADATA,k)}if(g){var I={frag:h,id:i,samples:g.samples};r.trigger(n.a.FRAG_PARSING_USERDATA,I)}}},l._bufferInitSegment=function(t,e,i,r){var a=this;if(this.state===tx){this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&delete e.audio;var s=e.audio,o=e.video,l=e.audiovideo;if(s){var u=t.audioCodec,h=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==s.metadata.channelCount&&-1===h.indexOf("firefox")&&(u="mp4a.40.5")),-1!==h.indexOf("android")&&"audio/mpeg"!==s.container&&(u="mp4a.40.2",this.log("Android: force audio codec to "+u)),t.audioCodec&&t.audioCodec!==u&&this.log('Swapping manifest audio codec "'+t.audioCodec+'" for "'+u+'"'),s.levelCodec=u,s.id="main",this.log("Init audio buffer, container:"+s.container+", codecs[selected/level/parsed]=["+(u||"")+"/"+(t.audioCodec||"")+"/"+s.codec+"]")}o&&(o.levelCodec=t.videoCodec,o.id="main",this.log("Init video buffer, container:"+o.container+", codecs[level/parsed]=["+(t.videoCodec||"")+"/"+o.codec+"]")),l&&this.log("Init audiovideo buffer, container:"+l.container+", codecs[level/parsed]=["+(t.attrs.CODECS||"")+"/"+l.codec+"]"),this.hls.trigger(n.a.BUFFER_CODECS,e),Object.keys(e).forEach(function(t){var s=e[t].initSegment;null!=s&&s.byteLength&&a.hls.trigger(n.a.BUFFER_APPENDING,{type:t,data:s,frag:i,part:null,chunkMeta:r,parent:i.type})}),this.tick()}},l.backtrack=function(t){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(t);var e=this.fragmentTracker.backtrack(t);this.fragPrevious=null,this.nextLoadPosition=t.start,e?this.resetFragmentLoading(t):this.state=tF},l.checkFragmentChanged=function(){var t=this.media,e=null;if(t&&t.readyState>1&&!1===t.seeking){var i=t.currentTime;if(tl.isBuffered(t,i)?e=this.getAppendedFrag(i):tl.isBuffered(t,i+.1)&&(e=this.getAppendedFrag(i+.1)),e){var r=this.fragPlaying,a=e.level;r&&e.sn===r.sn&&r.level===a&&e.urlId===r.urlId||(this.hls.trigger(n.a.FRAG_CHANGED,{frag:e}),r&&r.level===a||this.hls.trigger(n.a.LEVEL_SWITCHED,{level:a}),this.fragPlaying=e)}}},i=[{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);if(e)return e.level}return -1}},{key:"nextBufferedFrag",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);return this.followingBufferedFrag(e)}return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}],tQ(e.prototype,i),r&&tQ(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(tH),tJ=i(14);function t0(){return(t0=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}function t1(t,e){return(t1=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var t2=function(t){function e(e,i){var r;return(r=t.call(this,e,i,"[audio-stream-controller]")||this).videoBuffer=null,r.videoTrackCC=-1,r.waitingVideoCC=-1,r.audioSwitch=!1,r.trackId=-1,r.waitingData=null,r.mainDetails=null,r.bufferFlushed=!1,r._registerListeners(),r}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,t1(e,t);var i=e.prototype;return i.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},i._registerListeners=function(){var t=this.hls;t.on(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(n.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(n.a.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(n.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(n.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(n.a.ERROR,this.onError,this),t.on(n.a.BUFFER_RESET,this.onBufferReset,this),t.on(n.a.BUFFER_CREATED,this.onBufferCreated,this),t.on(n.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(n.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(n.a.FRAG_BUFFERED,this.onFragBuffered,this)},i._unregisterListeners=function(){var t=this.hls;t.off(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(n.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(n.a.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(n.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(n.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(n.a.ERROR,this.onError,this),t.off(n.a.BUFFER_RESET,this.onBufferReset,this),t.off(n.a.BUFFER_CREATED,this.onBufferCreated,this),t.off(n.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(n.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(n.a.FRAG_BUFFERED,this.onFragBuffered,this)},i.onInitPtsFound=function(t,e){var i=e.frag,r=e.id,a=e.initPTS;if("main"===r){var n=i.cc;this.initPTS[i.cc]=a,this.log("InitPTS for cc: "+n+" found from main: "+a),this.videoTrackCC=n,this.state===tB&&this.tick()}},i.startLoad=function(t){if(!this.levels)return this.startPosition=t,void(this.state=tk);var e=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,e>0&&-1===t?(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=tI):(this.loadedmetadata=!1,this.state=tP),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},i.doTick=function(){switch(this.state){case tI:this.doTickIdle();break;case tP:var e,i=this.levels,r=this.trackId,a=null==i||null==(e=i[r])?void 0:e.details;if(a){if(this.waitForCdnTuneIn(a))break;this.state=tB}break;case tw:var n,s=performance.now(),l=this.retryDate;(!l||s>=l||null!=(n=this.media)&&n.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=tI);break;case tB:var u=this.waitingData;if(u){var h=u.frag,d=u.part,c=u.cache,f=u.complete;if(void 0!==this.initPTS[h.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=tC;var g={frag:h,part:d,payload:c.flush(),networkDetails:null};this._handleFragmentLoadProgress(g),f&&t.prototype._handleFragmentLoadComplete.call(this,g)}else if(this.videoTrackCC!==this.waitingVideoCC)o.b.log("Waiting fragment cc ("+h.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var v=this.getLoadPosition(),p=tl.bufferInfo(this.mediaBuffer,v,this.config.maxBufferHole);0>tp(p.end,this.config.maxFragLookUpTolerance,h)&&(o.b.log("Waiting fragment cc ("+h.cc+") @ "+h.start+" cancelled because another fragment at "+p.end+" is needed"),this.clearWaitingFragment())}}else this.state=tI}this.onTickEnd()},i.clearWaitingFragment=function(){var t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=tI)},i.onTickEnd=function(){var t=this.media;if(t&&t.readyState){var e=(this.mediaBuffer?this.mediaBuffer:t).buffered;!this.loadedmetadata&&e.length&&(this.loadedmetadata=!0),this.lastCurrentTime=t.currentTime}},i.doTickIdle=function(){var t,e,i=this.hls,r=this.levels,a=this.media,s=this.trackId,o=i.config;if(r&&r[s]&&(a||!this.startFragRequested&&o.startFragPrefetch)){var l=r[s].details;if(!l||l.live&&this.levelLastLoaded!==s||this.waitForCdnTuneIn(l))this.state=tP;else{this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,u.a.AUDIO,D.b.AUDIO));var h=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.b.AUDIO);if(null!==h){var d=h.len,c=this.getMaxBufferLength(),f=this.audioSwitch;if(!(d>=c)||f){if(!f&&this._streamEnded(h,l))return i.trigger(n.a.BUFFER_EOS,{type:"audio"}),void(this.state=tN);var g=l.fragments[0].start,v=h.end;if(f){var p=this.getLoadPosition();v=p,l.PTSKnown&&p<g&&(h.end>g||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),a.currentTime=g+.05)}var m=this.getNextFragment(v,l);m?"identity"!==(null==(t=m.decryptdata)?void 0:t.keyFormat)||null!=(e=m.decryptdata)&&e.key?this.loadFragment(m,l,v):this.loadKey(m,l):this.bufferFlushed=!0}}}}},i.getMaxBufferLength=function(){var e=t.prototype.getMaxBufferLength.call(this),i=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.b.MAIN);return null===i?e:Math.max(e,i.len)},i.onMediaDetaching=function(){this.videoBuffer=null,t.prototype.onMediaDetaching.call(this)},i.onAudioTracksUpdated=function(t,e){var i=e.audioTracks;this.resetTransmuxer(),this.levels=i.map(function(t){return new j(t)})},i.onAudioTrackSwitching=function(t,e){var i=!!e.url;this.trackId=e.id;var r=this.fragCurrent;null!=r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),i?this.setInterval(100):this.resetTransmuxer(),i?(this.audioSwitch=!0,this.state=tI):this.state=tk,this.tick()},i.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},i.onLevelLoaded=function(t,e){this.mainDetails=e.details},i.onAudioTrackLoaded=function(t,e){var i,r=this.levels,a=e.details,n=e.id;if(r){this.log("Track "+n+" loaded ["+a.startSN+","+a.endSN+"],duration:"+a.totalduration);var s=r[n],o=0;if(a.live||null!=(i=s.details)&&i.live){var l=this.mainDetails;if(a.fragments[0]||(a.deltaUpdateFailed=!0),a.deltaUpdateFailed||!l)return;!s.details&&a.hasProgramDateTime&&l.hasProgramDateTime?(tf(a,l),o=a.fragments[0].start):o=this.alignPlaylists(a,s.details)}s.details=a,this.levelLastLoaded=n,this.startFragRequested||!this.mainDetails&&a.live||this.setStartPosition(s.details,o),this.state!==tP||this.waitForCdnTuneIn(a)||(this.state=tI),this.tick()}else this.warn("Audio tracks were reset while loading level "+n)},i._handleFragmentLoadProgress=function(t){var e,i=t.frag,r=t.part,a=t.payload,n=this.config,s=this.trackId,l=this.levels;if(l){var u=l[s],h=u.details,d=n.defaultAudioCodec||u.audioCodec||"mp4a.40.2",c=this.transmuxer;c||(c=this.transmuxer=new tX(this.hls,D.b.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var f=this.initPTS[i.cc],g=null==(e=i.initSegment)?void 0:e.data;if(void 0!==f){var v=r?r.index:-1,p=new tu(i.level,i.sn,i.stats.chunkCount,a.byteLength,v,-1!==v);c.push(a,g,d,"",i,r,h.totalduration,!1,p,f)}else o.b.log("Unknown video PTS for cc "+i.cc+", waiting for video PTS before demuxing audio frag "+i.sn+" of ["+h.startSN+" ,"+h.endSN+"],track "+s),(this.waitingData=this.waitingData||{frag:i,part:r,cache:new tJ.a,complete:!1}).cache.push(new Uint8Array(a)),this.waitingVideoCC=this.videoTrackCC,this.state=tB}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+i.sn+" of level "+i.level+" will not be buffered")},i._handleFragmentLoadComplete=function(e){this.waitingData?this.waitingData.complete=!0:t.prototype._handleFragmentLoadComplete.call(this,e)},i.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},i.onBufferCreated=function(t,e){var i=e.tracks.audio;i&&(this.mediaBuffer=i.buffer),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},i.onFragBuffered=function(t,e){var i=e.frag,r=e.part;i.type===D.b.AUDIO&&(this.fragContextChanged(i)?this.warn("Fragment "+i.sn+(r?" p: "+r.index:"")+" of level "+i.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==i.sn&&(this.fragPrevious=i,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(n.a.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(i,r)))},i.onError=function(e,i){switch(i.details){case s.a.FRAG_LOAD_ERROR:case s.a.FRAG_LOAD_TIMEOUT:case s.a.KEY_LOAD_ERROR:case s.a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.b.AUDIO,i);break;case s.a.AUDIO_TRACK_LOAD_ERROR:case s.a.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==tU&&this.state!==tk&&(this.state=i.fatal?tU:tI,this.warn(i.details+" while loading frag, switching to "+this.state+" state"));break;case s.a.BUFFER_FULL_ERROR:if("audio"===i.parent&&(this.state===tx||this.state===tM)){var r=!0,a=this.getFwdBufferInfo(this.mediaBuffer,D.b.AUDIO);a&&a.len>.5&&(r=!this.reduceMaxBufferLength(a.len)),r&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,t.prototype.flushMainBuffer.call(this,0,1/0,"audio")),this.resetLoadingState()}}},i.onBufferFlushed=function(t,e){e.type===u.a.AUDIO&&(this.bufferFlushed=!0)},i._handleTransmuxComplete=function(t){var e,i="audio",r=this.hls,a=t.remuxResult,s=t.chunkMeta,o=this.getCurrentContext(s);if(!o)return this.warn("The loading context changed while buffering fragment "+s.sn+" of level "+s.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(s.level);var l=o.frag,h=o.part,d=a.audio,c=a.text,f=a.id3,g=a.initSegment;if(!this.fragContextChanged(l)){if(this.state=tx,this.audioSwitch&&d&&this.completeAudioSwitch(),null!=g&&g.tracks&&(this._bufferInitSegment(g.tracks,l,s),r.trigger(n.a.FRAG_PARSING_INIT_SEGMENT,{frag:l,id:i,tracks:g.tracks})),d){var v=d.startPTS,p=d.endPTS,m=d.startDTS,y=d.endDTS;h&&(h.elementaryStreams[u.a.AUDIO]={startPTS:v,endPTS:p,startDTS:m,endDTS:y}),l.setElementaryStreamInfo(u.a.AUDIO,v,p,m,y),this.bufferFragmentData(d,l,h,s)}if(null!=f&&null!=(e=f.samples)&&e.length){var T=t0({frag:l,id:i},f);r.trigger(n.a.FRAG_PARSING_METADATA,T)}if(c){var E=t0({frag:l,id:i},c);r.trigger(n.a.FRAG_PARSING_USERDATA,E)}}},i._bufferInitSegment=function(t,e,i){if(this.state===tx){t.video&&delete t.video;var r=t.audio;if(r){r.levelCodec=r.codec,r.id="audio",this.log("Init audio buffer, container:"+r.container+", codecs[parsed]=["+r.codec+"]"),this.hls.trigger(n.a.BUFFER_CODECS,t);var a=r.initSegment;if(null!=a&&a.byteLength){var s={type:"audio",frag:e,part:null,chunkMeta:i,parent:e.type,data:a};this.hls.trigger(n.a.BUFFER_APPENDING,s)}this.tick()}}},i.loadFragment=function(e,i,r){var n=this.fragmentTracker.getState(e);this.fragCurrent=e,(this.audioSwitch||n===tt.NOT_LOADED||n===tt.PARTIAL)&&("initSegment"===e.sn?this._loadInitSegment(e):i.live&&!Object(a.a)(this.initPTS[e.cc])?(this.log("Waiting for video PTS in continuity counter "+e.cc+" of live stream before loading audio fragment "+e.sn+" of level "+this.trackId),this.state=tB):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,i,r)))},i.completeAudioSwitch=function(){var e=this.hls,i=this.media,r=this.trackId;i&&(this.log("Switching audio track : flushing all audio"),t.prototype.flushMainBuffer.call(this,0,1/0,"audio")),this.audioSwitch=!1,e.trigger(n.a.AUDIO_TRACK_SWITCHED,{id:r})},e}(tH);function t4(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function t5(t,e){return(t5=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var t3=function(t){function e(e){var i;return(i=t.call(this,e,"[audio-track-controller]")||this).tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,t5(e,t);var i,r,a=e.prototype;return a.registerListeners=function(){var t=this.hls;t.on(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(n.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(n.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(n.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(n.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(n.a.ERROR,this.onError,this)},a.unregisterListeners=function(){var t=this.hls;t.off(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(n.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(n.a.LEVEL_LOADING,this.onLevelLoading,this),t.off(n.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(n.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(n.a.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,t.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(t,e){this.tracks=e.audioTracks||[]},a.onAudioTrackLoaded=function(t,e){var i=e.id,r=e.details,a=this.tracksInGroup[i];if(a){var n=a.details;a.details=e.details,this.log("audioTrack "+i+" loaded ["+r.startSN+"-"+r.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,e,n))}else this.warn("Invalid audio track id "+i)},a.onLevelLoading=function(t,e){this.switchLevel(e.level)},a.onLevelSwitching=function(t,e){this.switchLevel(e.level)},a.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.audioGroupIds){var i=e.audioGroupIds[e.urlId];if(this.groupId!==i){this.groupId=i;var r=this.tracks.filter(function(t){return!i||t.groupId===i});this.selectDefaultTrack&&!r.some(function(t){return t.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=r,this.log("Updating audio tracks, "+r.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(n.a.AUDIO_TRACKS_UPDATED,{audioTracks:r}),this.selectInitialTrack()}}},a.onError=function(e,i){t.prototype.onError.call(this,e,i),!i.fatal&&i.context&&i.context.type===D.a.AUDIO_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},a.setAudioTrack=function(t){var e=this.tracksInGroup;if(t<0||t>=e.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var i=e[this.trackId];this.log("Now switching to audio-track index "+t);var r=e[t],a=r.id,s=r.groupId,o=r.name,l=r.type,u=r.url;if(this.trackId=t,this.trackName=o,this.selectDefaultTrack=!1,this.hls.trigger(n.a.AUDIO_TRACK_SWITCHING,{id:a,groupId:void 0===s?"":s,name:o,type:l,url:u}),!r.details||r.details.live){var h=this.switchParams(r.url,null==i?void 0:i.details);this.loadPlaylist(h)}}},a.selectInitialTrack=function(){this.tracksInGroup;var t=this.trackName,e=this.findTrackId(t)||this.findTrackId();-1!==e?this.setAudioTrack(e):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(n.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(t){for(var e=this.tracksInGroup,i=0;i<e.length;i++){var r=e[i];if((!this.selectDefaultTrack||r.default)&&(!t||t===r.name))return r.id}return -1},a.loadPlaylist=function(t){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var i=e.id,r=e.groupId,a=e.url;if(t)try{a=t.addDirectives(a)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(n.a.AUDIO_TRACK_LOADING,{url:a,id:i,groupId:r,deliveryDirectives:t||null})}},i=[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}}
1],t4(e.prototype,i),r&&t4(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(z);function t8(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function t6(t,e){return(t6=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var t9=function(t){function e(e,i){var r;return(r=t.call(this,e,i,"[subtitle-stream-controller]")||this).levels=[],r.currentTrackId=-1,r.tracksBuffered=[],r.mainDetails=null,r._registerListeners(),r}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,t6(e,t);var i,r,a=e.prototype;return a.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},a._registerListeners=function(){var t=this.hls;t.on(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(n.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(n.a.ERROR,this.onError,this),t.on(n.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(n.a.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(n.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(n.a.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(n.a.BUFFER_FLUSHING,this.onBufferFlushing,this)},a._unregisterListeners=function(){var t=this.hls;t.off(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(n.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(n.a.ERROR,this.onError,this),t.off(n.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(n.a.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(n.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(n.a.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(n.a.BUFFER_FLUSHING,this.onBufferFlushing,this)},a.startLoad=function(){this.stopLoad(),this.state=tI,this.setInterval(500),this.tick()},a.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},a.onLevelLoaded=function(t,e){this.mainDetails=e.details},a.onSubtitleFragProcessed=function(t,e){var i=e.frag,r=e.success;if(this.fragPrevious=i,this.state=tI,r){var a=this.tracksBuffered[this.currentTrackId];if(a){for(var n,s=i.start,o=0;o<a.length;o++)if(s>=a[o].start&&s<=a[o].end){n=a[o];break}var l=i.start+i.duration;n?n.end=l:(n={start:s,end:l},a.push(n)),this.fragmentTracker.fragBuffered(i)}}},a.onBufferFlushing=function(t,e){var i=e.startOffset,r=e.endOffset;if(0===i&&1/0!==r){var a=this.currentTrackId,n=this.levels;if(!n.length||!n[a]||!n[a].details)return;var s=r-n[a].details.targetduration;if(s<=0)return;e.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach(function(t){for(var e=0;e<t.length;)if(t[e].end<=s)t.shift();else{if(!(t[e].start<s))break;t[e].start=s,e++}}),this.fragmentTracker.removeFragmentsInRange(i,s,D.b.SUBTITLE)}},a.onError=function(t,e){var i,r=e.frag;r&&r.type===D.b.SUBTITLE&&(null!=(i=this.fragCurrent)&&i.loader&&this.fragCurrent.loader.abort(),this.state=tI)},a.onSubtitleTracksUpdated=function(t,e){var i=this,r=e.subtitleTracks;this.tracksBuffered=[],this.levels=r.map(function(t){return new j(t)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(t){i.tracksBuffered[t.id]=[]}),this.mediaBuffer=null},a.onSubtitleTrackSwitch=function(t,e){if(this.currentTrackId=e.id,this.levels.length&&-1!==this.currentTrackId){var i=this.levels[this.currentTrackId];null!=i&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(500)}else this.clearInterval()},a.onSubtitleTrackLoaded=function(t,e){var i,r=e.details,a=e.id,n=this.currentTrackId,s=this.levels;if(s.length){var o=s[n];if(!(a>=s.length||a!==n)&&o){if(this.mediaBuffer=this.mediaBufferTimeRanges,r.live||null!=(i=o.details)&&i.live){var l=this.mainDetails;if(r.deltaUpdateFailed||!l)return;var u=l.fragments[0];o.details?0===this.alignPlaylists(r,o.details)&&u&&X(r,u.start):r.hasProgramDateTime&&l.hasProgramDateTime?tf(r,l):u&&X(r,u.start)}o.details=r,this.levelLastLoaded=a,this.tick(),r.live&&!this.fragCurrent&&this.media&&this.state===tI&&(tv(null,r.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0))}}},a._handleFragmentLoadComplete=function(t){var e=t.frag,i=t.payload,r=e.decryptdata,a=this.hls;if(!this.fragContextChanged(e)&&i&&i.byteLength>0&&r&&r.key&&r.iv&&"AES-128"===r.method){var s=performance.now();
vendor: 33,044 bytes, line 1
1this.decrypter.webCryptoDecrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer).then(function(t){var i=performance.now();a.trigger(n.a.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:s,tdecrypt:i}})})}},a.doTick=function(){if(this.media){if(this.state===tI){var t,e=this.currentTrackId,i=this.levels;if(!i.length||!i[e]||!i[e].details)return;var r=i[e].details,a=r.targetduration,n=this.config,s=this.media,o=tl.bufferedInfo(this.mediaBufferTimeRanges,s.currentTime-a,n.maxBufferHole),l=o.end;if(o.len>this.getMaxBufferLength()+a)return;var u,h=r.fragments,d=h.length,c=r.edge,f=this.fragPrevious;l<c?(u=tv(f,h,l,n.maxFragLookUpTolerance))||!f||!(f.start<h[0].start)||(u=h[0]):u=h[d-1],null!=(t=u)&&t.encrypted?this.loadKey(u,r):u&&this.fragmentTracker.getState(u)===tt.NOT_LOADED&&this.loadFragment(u,r,l)}}else this.state=tI},a.loadFragment=function(e,i,r){this.fragCurrent=e,t.prototype.loadFragment.call(this,e,i,r)},i=[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}],t8(e.prototype,i),r&&t8(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(tH);function t7(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function et(t,e){return(et=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ee(t){for(var e=[],i=0;i<t.length;i++){var r=t[i];"subtitles"===r.kind&&r.label&&e.push(t[i])}return e}var ei=function(t){function e(e){var i;return(i=t.call(this,e,"[subtitle-track-controller]")||this).media=null,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.selectDefaultTrack=!0,i.queuedDefaultTrack=-1,i.trackChangeListener=function(){return i.onTextTracksChanged()},i.asyncPollTrackChange=function(){return i.pollTrackChange(0)},i.useTextTrackPolling=!1,i.subtitlePollingInterval=-1,i.subtitleDisplay=!0,i.registerListeners(),i}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,et(e,t);var i,r,a=e.prototype;return a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,t.prototype.destroy.call(this)},a.registerListeners=function(){var t=this.hls;t.on(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(n.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(n.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(n.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(n.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(n.a.ERROR,this.onError,this)},a.unregisterListeners=function(){var t=this.hls;t.off(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(n.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(n.a.LEVEL_LOADING,this.onLevelLoading,this),t.off(n.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(n.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(n.a.ERROR,this.onError,this)},a.onMediaAttached=function(t,e){this.media=e.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},a.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},a.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),ee(this.media.textTracks).forEach(function(t){P(t)}),this.subtitleTrack=-1,this.media=null)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},a.onManifestParsed=function(t,e){this.tracks=e.subtitleTracks},a.onSubtitleTrackLoaded=function(t,e){var i=e.id,r=e.details,a=this.trackId,n=this.tracksInGroup[a];if(n){var s=n.details;n.details=e.details,this.log("subtitle track "+i+" loaded ["+r.startSN+"-"+r.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,e,s))}else this.warn("Invalid subtitle track id "+i)},a.onLevelLoading=function(t,e){this.switchLevel(e.level)},a.onLevelSwitching=function(t,e){this.switchLevel(e.level)},a.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.textGroupIds){var i=e.textGroupIds[e.urlId];if(this.groupId!==i){var r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,a=this.tracks.filter(function(t){return!i||t.groupId===i});this.tracksInGroup=a;var s=this.findTrackId(null==r?void 0:r.name)||this.findTrackId();this.groupId=i,this.log("Updating subtitle tracks, "+a.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(n.a.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:a}),-1!==s&&this.setSubtitleTrack(s,r)}}},a.findTrackId=function(t){for(var e=this.tracksInGroup,i=0;i<e.length;i++){var r=e[i];if((!this.selectDefaultTrack||r.default)&&(!t||t===r.name))return r.id}return -1},a.onError=function(e,i){t.prototype.onError.call(this,e,i),!i.fatal&&i.context&&i.context.type===D.a.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},a.loadPlaylist=function(t){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var i=e.id,r=e.groupId,a=e.url;if(t)try{a=t.addDirectives(a)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(n.a.SUBTITLE_TRACK_LOADING,{url:a,id:i,groupId:r,deliveryDirectives:t||null})}},a.toggleTrackModes=function(t){var e=this,i=this.media,r=this.subtitleDisplay,a=this.trackId;if(i){var n=ee(i.textTracks),s=n.filter(function(t){return t.groupId===e.groupId});if(-1===t)[].slice.call(n).forEach(function(t){t.mode="disabled"});else{var o=s[a];o&&(o.mode="disabled")}var l=s[t];l&&(l.mode=r?"showing":"hidden")}},a.setSubtitleTrack=function(t,e){var i,r=this.tracksInGroup;if(this.media){if(this.trackId!==t&&this.toggleTrackModes(t),!(this.trackId===t&&(-1===t||null!=(i=r[t])&&i.details)||t<-1||t>=r.length)){this.clearTimer();var a=r[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,a){var s=a.id,o=a.groupId,l=a.name,u=a.type,h=a.url;this.hls.trigger(n.a.SUBTITLE_TRACK_SWITCH,{id:s,groupId:void 0===o?"":o,name:l,type:u,url:h});var d=this.switchParams(a.url,null==e?void 0:e.details);this.loadPlaylist(d)}else this.hls.trigger(n.a.SUBTITLE_TRACK_SWITCH,{id:t})}}else this.queuedDefaultTrack=t},a.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var t=-1,e=ee(this.media.textTracks),i=0;i<e.length;i++)if("hidden"===e[i].mode)t=i;else if("showing"===e[i].mode){t=i;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)}},i=[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var e=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,e)}}],t7(e.prototype,i),r&&t7(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(z),er=function(){function t(t){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=t}var e=t.prototype;return e.append=function(t,e){var i=this.queues[e];i.push(t),1===i.length&&this.buffers[e]&&this.executeNext(e)},e.insertAbort=function(t,e){this.queues[e].unshift(t),this.executeNext(e)},e.appendBlocker=function(t){var e,i=new Promise(function(t){e=t}),r={execute:e,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(r,t),i},e.executeNext=function(t){var e=this.buffers,i=this.queues,r=e[t],a=i[t];if(a.length){var n=a[0];try{n.execute()}catch(e){o.b.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),n.onError(e),r&&r.updating||(a.shift(),this.executeNext(t))}}},e.shiftAndExecuteNext=function(t){this.queues[t].shift(),this.executeNext(t)},e.current=function(t){return this.queues[t][0]},t}();function ea(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var en,es,eo=tj(),el=/([ha]vc.)(?:\.[^.,]+)+/;(eu=es||(es={}))[eu.EMPTY=0]="EMPTY",eu[eu.FULLFILLED=1]="FULLFILLED";var eu,eh,ed=function(){function t(t){var e=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this._levelTargetDuration=10,this._previousBufferState=es.EMPTY,this._fragmentWasReceived=!1,this._safeBufferDuration=.75,this._lastBufferState=es.EMPTY,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var t=e.hls,i=e.media,r=e.mediaSource;o.b.log("[buffer-controller]: Media source opened"),i&&(e.updateMediaElementDuration(),t.trigger(n.a.MEDIA_ATTACHED,{media:i})),r&&r.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){o.b.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){o.b.log("[buffer-controller]: Media source ended")},this.hls=t,this._initSourceBuffer(),this.registerListeners()}var e,i,r=t.prototype;return r.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},r.destroy=function(){this.unregisterListeners(),this.details=null},r.registerListeners=function(){var t=this.hls;t.on(n.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(n.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(n.a.BUFFER_RESET,this.onBufferReset,this),t.on(n.a.BUFFER_APPENDING,this.onBufferAppending,this),t.on(n.a.BUFFER_CODECS,this.onBufferCodecs,this),t.on(n.a.BUFFER_EOS,this.onBufferEos,this),t.on(n.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(n.a.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(n.a.FRAG_PARSED,this.onFragParsed,this),t.on(n.a.FRAG_CHANGED,this.onFragChanged,this)},r.unregisterListeners=function(){var t=this.hls;t.off(n.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(n.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(n.a.BUFFER_RESET,this.onBufferReset,this),t.off(n.a.BUFFER_APPENDING,this.onBufferAppending,this),t.off(n.a.BUFFER_CODECS,this.onBufferCodecs,this),t.off(n.a.BUFFER_EOS,this.onBufferEos,this),t.off(n.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(n.a.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(n.a.FRAG_PARSED,this.onFragParsed,this),t.off(n.a.FRAG_CHANGED,this.onFragChanged,this)},r._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new er(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},r.onManifestParsed=function(t,e){var i=2;(!e.audio||e.video)&&e.altAudio||(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,o.b.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},r.onMediaAttaching=function(t,e){var i=this.media=e.media;if(i&&eo){var r=this.mediaSource=new eo;r.addEventListener("sourceopen",this._onMediaSourceOpen),r.addEventListener("sourceended",this._onMediaSourceEnded),r.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(r),this._objectUrl=i.src}},r.onMediaDetaching=function(){var t=this.media,e=this.mediaSource,i=this._objectUrl;if(e){if(o.b.log("[buffer-controller]: media source detaching"),"open"===e.readyState)try{e.endOfStream()}catch(t){o.b.warn("[buffer-controller]: onMediaDetaching: "+t.message+" while calling endOfStream")}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(i&&self.URL.revokeObjectURL(i),t.src===i?(t.removeAttribute("src"),t.load()):o.b.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(n.a.MEDIA_DETACHED,void 0)},r.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach(function(e){var i=t.sourceBuffer[e];try{i&&(t.removeBufferListeners(e),t.mediaSource&&t.mediaSource.removeSourceBuffer(i),t.sourceBuffer[e]=void 0)}catch(t){o.b.warn("[buffer-controller]: Failed to reset the "+e+" buffer",t)}}),this._initSourceBuffer()},r.onBufferCodecs=function(t,e){var i=this,r=this.getSourceBufferTypes().length;Object.keys(e).forEach(function(t){if(r){var a=i.tracks[t];if(a&&"function"==typeof a.buffer.changeType){var n=e[t],s=n.id,l=n.codec,u=n.levelCodec,h=n.container,d=n.metadata,c=(a.levelCodec||a.codec).replace(el,"$1"),f=(u||l).replace(el,"$1");if(c!==f){var g=h+";codecs="+(u||l);i.appendChangeType(t,g),o.b.log("[buffer-controller]: switching codec "+c+" to "+f),i.tracks[t]={buffer:a.buffer,codec:l,container:h,levelCodec:u,metadata:d,id:s}}}}else i.pendingTracks[t]=e[t]}),r||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},r.appendChangeType=function(t,e){var i=this,r=this.operationQueue;r.append({execute:function(){var a=i.sourceBuffer[t];a&&(o.b.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+e),a.changeType(e)),r.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(e){o.b.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",e)}},t)},r.onBufferAppending=function(t,e){var i=this,r=this.hls,a=this.operationQueue,l=this.tracks,u=e.data,h=e.type,d=e.frag,c=e.part,f=e.chunkMeta,g=f.buffering[h],v=self.performance.now();g.start=v;var p=d.stats.buffering,m=c?c.stats.buffering:null;0===p.start&&(p.start=v),m&&0===m.start&&(m.start=v);var y=l.audio,T="audio"===h&&1===f.id&&"audio/mpeg"===(null==y?void 0:y.container);a.append({execute:function(){if(g.executeStart=self.performance.now(),T){var t=i.sourceBuffer[h];if(t){var e=d.start-t.timestampOffset;Math.abs(e)>=.1&&(o.b.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+e+") sn: "+d.sn+")"),t.timestampOffset=d.start)}}i.appendExecutor(u,h)},onStart:function(){},onComplete:function(){var t=self.performance.now();g.executeEnd=g.end=t,0===p.first&&(p.first=t),m&&0===m.first&&(m.first=t),i._lastBufferState=es.FULLFILLED;var e=i.sourceBuffer,r={};for(var a in e)r[a]=tl.getBuffered(e[a]);i.appendError=0,i.hls.trigger(n.a.BUFFER_APPENDED,{type:h,frag:d,part:c,chunkMeta:f,parent:d.type,timeRanges:r})},onError:function(t){o.b.error("[buffer-controller]: Error encountered while trying to append to the "+h+" SourceBuffer",t);var e={type:s.b.MEDIA_ERROR,parent:d.type,details:s.a.BUFFER_APPEND_ERROR,err:t,fatal:!1};t.code===DOMException.QUOTA_EXCEEDED_ERR?e.details=s.a.BUFFER_FULL_ERROR:(i.appendError++,e.details=s.a.BUFFER_APPEND_ERROR,i.appendError>r.config.appendErrorMaxRetry&&(o.b.error("[buffer-controller]: Failed "+r.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),e.fatal=!0)),r.trigger(n.a.ERROR,e)}},h)},r.onBufferFlushing=function(t,e){var i=this,r=this.operationQueue,a=function(t){return{execute:i.removeExecutor.bind(i,t,e.startOffset,e.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(n.a.BUFFER_FLUSHED,{type:t})},onError:function(e){o.b.warn("[buffer-controller]: Failed to remove from "+t+" SourceBuffer",e)}}};e.type?r.append(a(e.type),e.type):this.getSourceBufferTypes().forEach(function(t){r.append(a(t),t)})},r.onFragParsed=function(t,e){var i=this,r=e.frag,a=e.part,s=[],l=a?a.elementaryStreams:r.elementaryStreams;l[u.a.AUDIOVIDEO]?s.push("audiovideo"):(l[u.a.AUDIO]&&s.push("audio"),l[u.a.VIDEO]&&s.push("video")),0===s.length&&o.b.warn("Fragments must have at least one ElementaryStreamType set. type: "+r.type+" level: "+r.level+" sn: "+r.sn),this.blockBuffers(function(){var t=self.performance.now();r.stats.buffering.end=t,a&&(a.stats.buffering.end=t);var e=a?a.stats:r.stats;i.hls.trigger(n.a.FRAG_BUFFERED,{frag:r,part:a,stats:e,id:r.type})},s)},r.onFragChanged=function(t,e){this.flushBackBuffer()},r.onBufferEos=function(t,e){var i=this;this.getSourceBufferTypes().reduce(function(t,r){var a=i.sourceBuffer[r];return e.type&&e.type!==r||a&&!a.ended&&(a.ended=!0,o.b.log("[buffer-controller]: "+r+" sourceBuffer now EOS")),t&&!(a&&!a.ended)},!0)&&this.blockBuffers(function(){var t=i.mediaSource;t&&"open"===t.readyState&&t.endOfStream()})},r.onLevelUpdated=function(t,e){var i=e.details;i.fragments.length&&(this.details=i,this._levelTargetDuration=i.averagetargetduration||i.targetduration||10,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},r.flushBackBuffer=function(){var t=this.hls,e=this.details,i=this.media,r=this.sourceBuffer;if(i&&null!==e){var s=this.getSourceBufferTypes();if(s.length){var o=e.live&&null!==t.config.liveBackBufferLength?t.config.liveBackBufferLength:t.config.backBufferLength;if(Object(a.a)(o)&&!(o<0)){var l=i.currentTime,u=e.levelTargetDuration,h=Math.max(o,u),d=Math.floor(l/u)*u-h;s.forEach(function(i){var a=r[i];if(a){var s=tl.getBuffered(a);s.length>0&&d>s.start(0)&&(t.trigger(n.a.BACK_BUFFER_REACHED,{bufferEnd:d}),e.live&&t.trigger(n.a.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),t.trigger(n.a.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:i}))}})}}}},r.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var t=this.details,e=this.hls,i=this.media,r=this.mediaSource,n=t.fragments[0].start+t.totalduration,s=i.duration,l=Object(a.a)(r.duration)?r.duration:0;t.live&&e.config.liveDurationInfinity?(o.b.log("[buffer-controller]: Media Source duration is set to Infinity"),r.duration=1/0,this.updateSeekableRange(t)):(n>l&&n>s||!Object(a.a)(s))&&(o.b.log("[buffer-controller]: Updating Media Source duration to "+n.toFixed(3)),r.duration=n)}},r.updateSeekableRange=function(t){var e=this.mediaSource,i=t.fragments;if(i.length&&t.live&&null!=e&&e.setLiveSeekableRange){var r=Math.max(0,i[0].start),a=Math.max(r,r+t.totalduration);e.setLiveSeekableRange(r,a)}},r.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,e=this.operationQueue,i=this.pendingTracks,r=Object.keys(i).length;if(r&&!t||2===r){this.createSourceBuffers(i),this.pendingTracks={};var a=this.getSourceBufferTypes();if(0===a.length)return void this.hls.trigger(n.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});a.forEach(function(t){e.executeNext(t)})}},r.createSourceBuffers=function(t){var e=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");var r=0;for(var a in t)if(!e[a]){var l=t[a];if(!l)throw Error("source buffer exists for track "+a+", however track does not");var u=l.levelCodec||l.codec,h=l.container+";codecs="+u;o.b.log("[buffer-controller]: creating sourceBuffer("+h+")");try{var d=e[a]=i.addSourceBuffer(h);this.addBufferListener(a,"updatestart",this._onSBUpdateStart),this.addBufferListener(a,"updateend",this._onSBUpdateEnd),this.addBufferListener(a,"error",this._onSBUpdateError),this.tracks[a]={buffer:d,codec:u,container:l.container,levelCodec:l.levelCodec,metadata:l.metadata,id:l.id},r++}catch(t){o.b.error("[buffer-controller]: error while trying to add sourceBuffer: "+t.message),this.hls.trigger(n.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,mimeType:h})}}r&&this.hls.trigger(n.a.BUFFER_CREATED,{tracks:this.tracks})},r._onSBUpdateStart=function(t){this.operationQueue.current(t).onStart()},r._onSBUpdateEnd=function(t){var e=this.operationQueue;e.current(t).onComplete(),e.shiftAndExecuteNext(t)},r._onSBUpdateError=function(t,e){o.b.error("[buffer-controller]: "+t+" SourceBuffer error",e),this.hls.trigger(n.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_APPENDING_ERROR,fatal:!1});var i=this.operationQueue.current(t);i&&i.onError(e)},r.removeExecutor=function(t,e,i){var r=this.media,n=this.mediaSource,s=this.operationQueue,l=this.sourceBuffer[t];if(!r||!n||!l)return o.b.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),void s.shiftAndExecuteNext(t);var u=Object(a.a)(r.duration)?r.duration:1/0,h=Object(a.a)(n.duration)?n.duration:1/0,d=Math.max(0,e),c=Math.min(i,u,h);c>d?(o.b.log("[buffer-controller]: Removing ["+d+","+c+"] from the "+t+" SourceBuffer"),l.remove(d,c)):s.shiftAndExecuteNext(t)},r.appendExecutor=function(t,e){var i=this.operationQueue,r=this.sourceBuffer[e];r?(r.ended=!1,r.appendBuffer(t)):(o.b.warn("[buffer-controller]: Attempting to append to the "+e+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(e))},r.blockBuffers=function(t,e){var i=this;if(void 0===e&&(e=this.getSourceBufferTypes()),!e.length)return o.b.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve(t);var r=this.operationQueue;Promise.all(e.map(function(t){return r.appendBlocker(t)})).then(function(){t(),e.forEach(function(t){var e=i.sourceBuffer[t];e&&e.updating||r.shiftAndExecuteNext(t)})})},r.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},r.addBufferListener=function(t,e,i){var r=this.sourceBuffer[t];if(r){var a=i.bind(this,t);this.listeners[t].push({event:e,listener:a}),r.addEventListener(e,a)}},r.removeBufferListeners=function(t){var e=this.sourceBuffer[t];e&&this.listeners[t].forEach(function(t){e.removeEventListener(t.event,t.listener)})},e=[{key:"bufferDuration",get:function(){if(!this.media)return 0;var t=this.media,e=t.buffered,i=t.currentTime;if(0===e.length)return 0;for(var r=0,a=0;a<e.length;a++)e.start(a)<=i&&i<=e.end(a)&&(r=a);return e.end(r)-i}},{key:"bufferSize",get:function(){var t=this.bufferDuration;return t<this._safeBufferDuration&&this._lastBufferState===es.FULLFILLED&&(this._lastBufferState=es.EMPTY,this.hls.trigger(n.a.BUFFER_EMPTY,null)),t>0?Math.ceil(this.bufferDuration/this._levelTargetDuration):0}}],ea(t.prototype,e),i&&ea(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}(),ec={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},ef=function(t){var e=t;return ec.hasOwnProperty(t)&&(e=ec[t]),String.fromCharCode(e)},eg={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ev={17:2,18:4,21:6,22:8,23:10,19:13,20:15},ep={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},em={25:2,26:4,29:6,30:8,31:10,27:13,28:15},ey=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];(e4=eh||(eh={}))[e4.ERROR=0]="ERROR",e4[e4.TEXT=1]="TEXT",e4[e4.WARNING=2]="WARNING",e4[e4.INFO=2]="INFO",e4[e4.DEBUG=3]="DEBUG",e4[e4.DATA=3]="DATA";var eT=function(){function t(){this.time=null,this.verboseLevel=eh.ERROR}return t.prototype.log=function(t,e){this.verboseLevel>=t&&o.b.log(this.time+" ["+t+"] "+e)},t}(),eE=function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i].toString(16));return e},eS=function(){function t(t,e,i,r,a){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=t||"white",this.underline=e||!1,this.italics=i||!1,this.background=r||"black",this.flash=a||!1}var e=t.prototype;return e.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},e.setStyles=function(t){for(var e=["foreground","underline","italics","background","flash"],i=0;i<e.length;i++){var r=e[i];t.hasOwnProperty(r)&&(this[r]=t[r])}},e.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},e.equals=function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash},e.copy=function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash},e.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},t}(),eb=function(){function t(t,e,i,r,a,n){this.uchar=void 0,this.penState=void 0,this.uchar=t||" ",this.penState=new eS(e,i,r,a,n)}var e=t.prototype;return e.reset=function(){this.uchar=" ",this.penState.reset()},e.setChar=function(t,e){this.uchar=t,this.penState.copy(e)},e.setPenState=function(t){this.penState.copy(t)},e.equals=function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)},e.copy=function(t){this.uchar=t.uchar,this.penState.copy(t.penState)},e.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},t}(),e_=function(){function t(t){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var e=0;e<100;e++)this.chars.push(new eb);this.logger=t,this.pos=0,this.currPenState=new eS}var e=t.prototype;return e.equals=function(t){for(var e=!0,i=0;i<100;i++)if(!this.chars[i].equals(t.chars[i])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<100;e++)this.chars[e].copy(t.chars[e])},e.isEmpty=function(){for(var t=!0,e=0;e<100;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t},e.setCursor=function(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(eh.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>100&&(this.logger.log(eh.DEBUG,"Too large cursor position "+this.pos),this.pos=100)},e.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var i=this.pos+1;i<e+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(e)},e.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},e.insertChar=function(t){t>=144&&this.backSpace();var e=ef(t);this.pos>=100?this.logger.log(eh.ERROR,"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))},e.clearFromPos=function(t){var e;for(e=t;e<100;e++)this.chars[e].reset()},e.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},e.clearToEndOfRow=function(){this.clearFromPos(this.pos)},e.getTextString=function(){for(var t=[],e=!0,i=0;i<100;i++){var r=this.chars[i].uchar;" "!==r&&(e=!1),t.push(r)}return e?"":t.join("")},e.setPenStyles=function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)},t}(),eA=function(){function t(t){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var e=0;e<15;e++)this.rows.push(new e_(t));this.logger=t,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var e=t.prototype;return e.reset=function(){for(var t=0;t<15;t++)this.rows[t].clear();this.currRow=14},e.equals=function(t){for(var e=!0,i=0;i<15;i++)if(!this.rows[i].equals(t.rows[i])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<15;e++)this.rows[e].copy(t.rows[e])},e.isEmpty=function(){for(var t=!0,e=0;e<15;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t},e.backSpace=function(){this.rows[this.currRow].backSpace()},e.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},e.insertChar=function(t){this.rows[this.currRow].insertChar(t)},e.setPen=function(t){this.rows[this.currRow].setPenStyles(t)},e.moveCursor=function(t){this.rows[this.currRow].moveCursor(t)},e.setCursor=function(t){this.logger.log(eh.INFO,"setCursor: "+t),this.rows[this.currRow].setCursor(t)},e.setPAC=function(t){this.logger.log(eh.INFO,"pacData = "+JSON.stringify(t));var e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(var i=0;i<15;i++)this.rows[i].clear();var r=this.currRow+1-this.nrRollUpRows,a=this.lastOutputScreen;if(a){var n=a.rows[r].cueStartTime,s=this.logger.time;if(n&&null!==s&&n<s)for(var o=0;o<this.nrRollUpRows;o++)this.rows[e-this.nrRollUpRows+o+1].copy(a.rows[r+o])}}this.currRow=e;var l=this.rows[this.currRow];if(null!==t.indent){var u=Math.max(t.indent-1,0);l.setCursor(t.indent),t.color=l.chars[u].penState.foreground}var h={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(h)},e.setBkgData=function(t){this.logger.log(eh.INFO,"bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)},e.setRollUpRows=function(t){this.nrRollUpRows=t},e.rollUp=function(){if(null!==this.nrRollUpRows){this.logger.log(eh.TEXT,this.getDisplayText());var t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(eh.INFO,"Rolling up")}else this.logger.log(eh.DEBUG,"roll_up but nrRollUpRows not set yet")},e.getDisplayText=function(t){t=t||!1;for(var e=[],i="",r=-1,a=0;a<15;a++){var n=this.rows[a].getTextString();n&&(r=a+1,t?e.push("Row "+r+": '"+n+"'"):e.push(n.trim()))}return e.length>0&&(i=t?"["+e.join(" | ")+"]":e.join("\n")),i},e.getTextAndFormat=function(){return this.rows},t}(),eL=function(){function t(t,e,i){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new eA(i),this.nonDisplayedMemory=new eA(i),this.lastOutputScreen=new eA(i),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}var e=t.prototype;return e.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},e.getHandler=function(){return this.outputFilter},e.setHandler=function(t){this.outputFilter=t},e.setPAC=function(t){this.writeScreen.setPAC(t)},e.setBkgData=function(t){this.writeScreen.setBkgData(t)},e.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(eh.INFO,"MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)},e.insertChars=function(t){for(var e=0;e<t.length;e++)this.writeScreen.insertChar(t[e]);var i=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(eh.INFO,i+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(eh.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},e.ccRCL=function(){this.logger.log(eh.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},e.ccBS=function(){this.logger.log(eh.INFO,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},e.ccAOF=function(){},e.ccAON=function(){},e.ccDER=function(){this.logger.log(eh.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},e.ccRU=function(t){this.logger.log(eh.INFO,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)},e.ccFON=function(){this.logger.log(eh.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},e.ccRDC=function(){this.logger.log(eh.INFO,"RDC - Resume Direct
1Captioning"),this.setMode("MODE_PAINT-ON")},e.ccTR=function(){this.logger.log(eh.INFO,"TR"),this.setMode("MODE_TEXT")},e.ccRTD=function(){this.logger.log(eh.INFO,"RTD"),this.setMode("MODE_TEXT")},e.ccEDM=function(){this.logger.log(eh.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},e.ccCR=function(){this.logger.log(eh.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},e.ccENM=function(){this.logger.log(eh.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},e.ccEOC=function(){if(this.logger.log(eh.INFO,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(eh.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},e.ccTO=function(t){this.logger.log(eh.INFO,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)},e.ccMIDROW=function(t){var e={flash:!1};(e.underline=t%2==1,e.italics=t>=46,e.italics)?e.foreground="white":e.foreground=["white","green","blue","cyan","red","yellow","magenta"][Math.floor(t/2)-16],this.logger.log(eh.INFO,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},e.outputDataUpdate=function(t){void 0===t&&(t=!1);var e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},e.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}();function eR(t,e,i){i.a=t,i.b=e}function eD(t,e,i){return i.a===t&&i.b===e}var ek=function(){function t(t,e,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var r=new eT;this.channels=[null,new eL(t,e,r),new eL(t+1,i,r)],this.cmdHistory={a:null,b:null},this.logger=r}var e=t.prototype;return e.getHandler=function(t){return this.channels[t].getHandler()},e.setHandler=function(t,e){this.channels[t].setHandler(e)},e.addData=function(t,e){var i,r,a,n=!1;this.logger.time=t;for(var s=0;s<e.length;s+=2)if(r=127&e[s],a=127&e[s+1],0!==r||0!==a){if(this.logger.log(eh.DATA,"["+eE([e[s],e[s+1]])+"] -> ("+eE([r,a])+")"),(i=this.parseCmd(r,a))||(i=this.parseMidrow(r,a)),i||(i=this.parsePAC(r,a)),i||(i=this.parseBackgroundAttributes(r,a)),!i&&(n=this.parseChars(r,a))){var o=this.currentChannel;o&&o>0?this.channels[o].insertChars(n):this.logger.log(eh.WARNING,"No channel found yet. TEXT-MODE?")}i||n||this.logger.log(eh.WARNING,"Couldn't parse cleaned data "+eE([r,a])+" orig: "+eE([e[s],e[s+1]]))}},e.parseCmd=function(t,e){var i=this.cmdHistory;if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=33&&e<=35))return!1;if(eD(t,e,i))return eR(null,null,i),this.logger.log(eh.DEBUG,"Repeated command ("+eE([t,e])+") is dropped"),!0;var r=20===t||21===t||23===t?1:2,a=this.channels[r];return 20===t||21===t||28===t||29===t?32===e?a.ccRCL():33===e?a.ccBS():34===e?a.ccAOF():35===e?a.ccAON():36===e?a.ccDER():37===e?a.ccRU(2):38===e?a.ccRU(3):39===e?a.ccRU(4):40===e?a.ccFON():41===e?a.ccRDC():42===e?a.ccTR():43===e?a.ccRTD():44===e?a.ccEDM():45===e?a.ccCR():46===e?a.ccENM():47===e&&a.ccEOC():a.ccTO(e-32),eR(t,e,i),this.currentChannel=r,!0},e.parseMidrow=function(t,e){var i=0;if((17===t||25===t)&&e>=32&&e<=47){if((i=17===t?1:2)!==this.currentChannel)return this.logger.log(eh.ERROR,"Mismatch channel in midrow parsing"),!1;var r=this.channels[i];return!!r&&(r.ccMIDROW(e),this.logger.log(eh.DEBUG,"MIDROW ("+eE([t,e])+")"),!0)}return!1},e.parsePAC=function(t,e){var i,r=this.cmdHistory;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127)&&!((16===t||24===t)&&e>=64&&e<=95))return!1;if(eD(t,e,r))return eR(null,null,r),!0;var a=t<=23?1:2;i=e>=64&&e<=95?1===a?eg[t]:ep[t]:1===a?ev[t]:em[t];var n=this.channels[a];return!!n&&(n.setPAC(this.interpretPAC(i,e)),eR(t,e,r),this.currentChannel=a,!0)},e.interpretPAC=function(t,e){var i,r={color:null,italics:!1,indent:null,underline:!1,row:t};return r.underline=1==(1&(i=e>95?e-96:e-64)),i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((i-16)/2),r},e.parseChars=function(t,e){var i,r,a=null,n=null;if((t>=25?(i=2,n=t-8):(i=1,n=t),n>=17&&n<=19)?(r=17===n?e+80:18===n?e+112:e+144,this.logger.log(eh.INFO,"Special char '"+ef(r)+"' in channel "+i),a=[r]):t>=32&&t<=127&&(a=0===e?[t]:[t,e]),a){var s=eE(a);this.logger.log(eh.DEBUG,"Char codes = "+s.join(",")),eR(t,e,this.cmdHistory)}return a}
1,e.parseBackgroundAttributes=function(t,e){if(!((16===t||24===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=45&&e<=47))return!1;var i={};16===t||24===t?(i.background=ey[Math.floor((e-32)/2)],e%2==1&&(i.background=i.background+"_semi")):45===e?i.background="transparent":(i.foreground="black",47===e&&(i.underline=!0));var r=t<=23?1:2;return this.channels[r].setBkgData(i),eR(t,e,this.cmdHistory),!0},e.reset=function(){for(var t=0;t<Object.keys(this.channels).length;t++){var e=this.channels[t];e&&e.reset()}this.cmdHistory={a:null,b:null}},e.cueSplitAtTime=function(t){for(var e=0;e<this.channels.length;e++){var i=this.channels[e];i&&i.cueSplitAtTime(t)}},t}(),eI=function(){function t(t,e){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=e}var e=t.prototype;return e.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},e.newCue=function(t,e,i){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)},e.reset=function(){this.cueRanges=[],this.startTime=null},t}(),eO=function(){if("u">typeof self&&self.VTTCue)return self.VTTCue;var t=["","lr","rl"],e=["start","middle","end","left","right"];function i(t,e){if("string"!=typeof e||!Array.isArray(t))return!1;var i=e.toLowerCase();return!!~t.indexOf(i)&&i}function r(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var s in n)t[s]=n[s]}return t}function a(a,n,s){var o={enumerable:!0};this.hasBeenReset=!1;var l="",u=!1,h=a,d=n,c=s,f=null,g="",v=!0,p="auto",m="start",y=50,T="middle",E=50,S="middle";Object.defineProperty(this,"id",r({},o,{get:function(){return l},set:function(t){l=""+t}})),Object.defineProperty(this,"pauseOnExit",r({},o,{get:function(){return u},set:function(t){u=!!t}})),Object.defineProperty(this,"startTime",r({},o,{get:function(){return h},set:function(t){if("number"!=typeof t)throw TypeError("Start time must be set to a number.");h=t,this.hasBeenReset=!0}})),Object.defineProperty(this,"endTime",r({},o,{get:function(){return d},set:function(t){if("number"!=typeof t)throw TypeError("End time must be set to a number.");d=t,this.hasBeenReset=!0}})),Object.defineProperty(this,"text",r({},o,{get:function(){return c},set:function(t){c=""+t,this.hasBeenReset=!0}})),Object.defineProperty(this,"region",r({},o,{get:function(){return f},set:function(t){f=t,this.hasBeenReset=!0}})),Object.defineProperty(this,"vertical",r({},o,{get:function(){return g},set:function(e){var r=i(t,e);if(!1===r)throw SyntaxError("An invalid or illegal string was specified.");g=r,this.hasBeenReset=!0}})),Object.defineProperty(this,"snapToLines",r({},o,{get:function(){return v},set:function(t){v=!!t,this.hasBeenReset=!0}})),Object.defineProperty(this,"line",r({},o,{get:function(){return p},set:function(t){if("number"!=typeof t&&"auto"!==t)throw SyntaxError("An invalid number or illegal string was specified.");p=t,this.hasBeenReset=!0}})),Object.defineProperty(this,"lineAlign",r({},o,{get:function(){return m},set:function(t){var r=i(e,t);if(!r)throw SyntaxError("An invalid or illegal string was specified.");m=r,this.hasBeenReset=!0}})),Object.defineProperty(this,"position",r({},o,{get:function(){return y},set:function(t){if(t<0||t>100)throw Error("Position must be between 0 and 100.");y=t,this.hasBeenReset=!0}})),Object.defineProperty(this,"positionAlign",r({},o,{get:function(){return T},set:function(t){var r=i(e,t);if(!r)throw SyntaxError("An invalid or illegal string was specified.");T=r,this.hasBeenReset=!0}})),Object.defineProperty(this,"size",r({},o,{get:function(){return E},set:function(t){if(t<0||t>100)throw Error("Size must be between 0 and 100.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(this,"align",r({},o,{get:function(){return S},set:function(t){var r=i(e,t);if(!r)throw SyntaxError("An invalid or illegal string was specified.");S=r,this.hasBeenReset=!0}})),this.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}(),eC=function(){function t(){}return t.prototype.decode=function(t,e){if(!t)return"";if("string"!=typeof t)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},t}();function ew(t){function e(t,e,i,r){return 3600*(0|t)+60*(0|e)+(0|i)+parseFloat(r||0)}var i=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?e(i[2],i[3],0,i[4]):e(i[1],i[2],i[3],i[4]):null}var eP=function(){function t(){this.values=Object.create(null)}var e=t.prototype;return e.set=function(t,e){this.get(t)||""===e||(this.values[t]=e)}
vendor: 4,667 bytes, line 1
1,e.get=function(t,e,i){return i?this.has(t)?this.values[t]:e[i]:this.has(t)?this.values[t]:e},e.has=function(t){return t in this.values},e.alt=function(t,e,i){for(var r=0;r<i.length;++r)if(e===i[r]){this.set(t,e);break}},e.integer=function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},e.percent=function(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var i=parseFloat(e);if(i>=0&&i<=100)return this.set(t,i),!0}return!1},t}();function ex(t,e,i,r){var a=r?t.split(r):[t];for(var n in a)if("string"==typeof a[n]){var s=a[n].split(i);2===s.length&&e(s[0],s[1])}}var eM=new eO(0,0,""),eF="middle"===eM.align?"middle":"center";function eN(t){return t.replace(/<br(?: \/)?>/gi,"\n")}var eU=function(){function t(){this.state="INITIAL",this.buffer="",this.decoder=new eC,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=t.prototype;return e.parse=function(t){var e=this;function i(){var t=e.buffer,i=0;for(t=eN(t);i<t.length&&"\r"!==t[i]&&"\n"!==t[i];)++i;var r=t.substr(0,i);return"\r"===t[i]&&++i,"\n"===t[i]&&++i,e.buffer=t.substr(i),r}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{var r="";if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;var a=(r=i()).match(/^()?WEBVTT([ \t].*)?$/);if(!a||!a[0])throw Error("Malformed WebVTT signature.");e.state="HEADER"}for(var n=!1;e.buffer&&/\r\n|\n/.test(e.buffer);)switch(n?n=!1:r=i(),e.state){case"HEADER":/:/.test(r)?ex(r,function(t,e){},/:/):r||(e.state="ID");continue;case"NOTE":r||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){e.state="NOTE";break}if(!r)continue;if(e.cue=new eO(0,0,""),e.state="CUE",-1===r.indexOf("--\x3e")){e.cue.id=r;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{!function(t,e,i){var r,a,n,s,o=t;function l(){var e=ew(t);if(null===e)throw Error("Malformed timestamp: "+o);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function u(){t=t.replace(/^\s+/,"")}if(u(),e.startTime=l(),u(),"--\x3e"!==t.substr(0,3))throw Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);t=t.substr(3),u(),e.endTime=l(),u(),r=t,a=new eP,ex(r,function(t,e){var r;switch(t){case"region":for(var n=i.length-1;n>=0;n--)if(i[n].id===e){a.set(t,i[n].region);break}break;case"vertical":a.alt(t,e,["rl","lr"]);break;case"line":r=e.split(","),a.integer(t,r[0]),a.percent(t,r[0])&&a.set("snapToLines",!1),a.alt(t,r[0],["auto"]),2===r.length&&a.alt("lineAlign",r[1],["start",eF,"end"]);break;case"position":r=e.split(","),a.percent(t,r[0]),2===r.length&&a.alt("positionAlign",r[1],["start",eF,"end","line-left","line-right","auto"]);break;case"size":a.percent(t,e);break;case"align":a.alt(t,e,["start",eF,"end","left","right"])}},/:/,/\s/),e.region=a.get("region",null),e.vertical=a.get("vertical",""),"auto"===(n=a.get("line","auto"))&&-1===eM.line&&(n=-1),e.line=n,e.lineAlign=a.get("lineAlign","start"),e.snapToLines=a.get("snapToLines",!0),e.size=a.get("size",100),e.align=a.get("align",eF),"auto"===(s=a.get("position","auto"))&&50===eM.position&&(s="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=s}(r,e.cue,e.regionList)}catch(t){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var s=-1!==r.indexOf("--\x3e");if(!r||s&&(n=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(null===e.cue)continue;e.cue.text&&(e.cue.text+="\n"),e.cue.text+=r;continue;case"BADCUE":r||(e.state="ID")}}catch(t){"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this},e.flush=function(){try{if((this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state||"BADWEBVTT"===this.state)throw Error("Malformed WebVTT signature.")}catch(t){this.onparsingerror&&this.onparsingerror(t)}return this.onflush&&this.onflush(),this},t}(),eB=i(8),eG=i(12),eH=/\r\n|\n\r|\n|\r/g,ej=function(t,e,i){return void 0===i&&(i=0),t.substr(i,e.length)===e},eK=function(t){for(var e=5381,i=t.length;i;)e=33*e^t.charCodeAt(--i);return(e>>>0).toString()};function eV(t,e,i){return eK(t.toString())+eK(e.toString())+eK(i)}function eW(){return(eW=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}var eY=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,eq=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,eX={left:"start",center:"center",right:"end",start:"start",end:"end"};function ez(t,e,i,r,a){var n=Object(l.c)(new Uint8Array(t),["mdat"]);if(0!==n.length){var s=n.map(function(t){return Object(M.f)(t)}),o=Object(eB.c)(e,1,i);
1try{s.forEach(function(t){return r(function(t,e){var i=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("tt")[0];if(!i)throw Error("Invalid ttml");var r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(r).reduce(function(t,e){return t[e]=i.getAttribute("ttp:"+e)||r[e],t},{}),n="preserve"!==i.getAttribute("xml:space"),s=e$(eQ(i,"styling","style")),o=e$(eQ(i,"layout","region")),l=eQ(i,"body","[begin]");return[].map.call(l,function(t){var i,r,l,u=function t(e,i){return[].slice.call(e.childNodes).reduce(function(e,r,a){var n;return"br"===r.nodeName&&a?e+"\n":null!=(n=r.childNodes)&&n.length?t(r,i):i?e+r.textContent.trim().replace(/\s+/g," "):e+r.textContent},"")}(t,n);if(!u||!t.hasAttribute("begin"))return null;var h=e0(t.getAttribute("begin"),a),d=e0(t.getAttribute("dur"),a),c=e0(t.getAttribute("end"),a);if(null===h)throw eJ(t);if(null===c){if(null===d)throw eJ(t);c=h+d}var f=new eO(h-e,c-e,u);f.id=eV(f.startTime,f.endTime,f.text);var g=o[t.getAttribute("region")],v=s[t.getAttribute("style")];f.position=10,f.size=80;var p=(i="http://www.w3.org/ns/ttml#styling",r=null,(l=null!=g&&g.hasAttribute("style")?g.getAttribute("style"):null)&&s.hasOwnProperty(l)&&(r=s[l]),["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce(function(t,e){var a=eZ(v,i,e)||eZ(g,i,e)||eZ(r,i,e);return a&&(t[e]=a),t},{})),m=p.textAlign;if(m){var y=eX[m];y&&(f.lineAlign=y),f.align=m}return eW(f,p),f}).filter(function(t){return null!==t})}(t,o))})}catch(t){a(t)}}else a(Error("Could not parse IMSC1 mdat"))}function eQ(t,e,i){var r=t.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(i)):[]}function e$(t){return t.reduce(function(t,e){var i=e.getAttribute("xml:id");return i&&(t[i]=e),t},{})}function eZ(t,e,i){return t&&t.hasAttributeNS(e,i)?t.getAttributeNS(e,i):null}function eJ(t){return Error("Could not parse ttml timestamp "+t)}function e0(t,e){if(!t)return null;var i,r,a=ew(t);return null===a&&(eY.test(t)?(r=(0|(i=eY.exec(t))[4])+(0|i[5])/e.subFrameRate,a=3600*(0|i[1])+60*(0|i[2])+(0|i[3])+r/e.frameRate):eq.test(t)&&(a=function(t,e){var i=eq.exec(t),r=Number(i[1]);switch(i[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/e.frameRate;case"t":return r/e.tickRate}return r}(t,e))),a}var e1=function(){function t(t){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var e=new eI(this,"textTrack1"),i=new eI(this,"textTrack2"),r=new eI(this,"textTrack3"),a=new eI(this,"textTrack4");this.cea608Parser1=new ek(1,e,i),this.cea608Parser2=new ek(3,r,a)}t.on(n.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(n.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(n.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(n.a.FRAG_LOADING,this.onFragLoading,this),t.on(n.a.FRAG_LOADED,this.onFragLoaded,this),t.on(n.a.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(n.a.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(n.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(n.a.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(n.a.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=t.prototype;return e.destroy=function(){var t=this.hls;
vendor: 5,332 bytes, line 1
1t.off(n.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(n.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(n.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(n.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(n.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(n.a.FRAG_LOADING,this.onFragLoading,this),t.off(n.a.FRAG_LOADED,this.onFragLoaded,this),t.off(n.a.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(n.a.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(n.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(n.a.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(n.a.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(t,e,i,r,a){for(var s,o=!1,l=a.length;l--;){var u=a[l],h=(s=u[0],Math.min(u[1],i)-Math.max(s,e));if(h>=0&&(u[0]=Math.min(u[0],e),u[1]=Math.max(u[1],i),o=!0,h/(i-e)>.5))return}if(o||a.push([e,i]),this.config.renderTextTracksNatively){var d=this.captionsTracks[t];this.Cues.newCue(d,e,i,r)}else{var c=this.Cues.newCue(null,e,i,r);this.hls.trigger(n.a.CUES_PARSED,{type:"captions",cues:c,track:t})}},e.onInitPtsFound=function(t,e){var i=this,r=e.frag,a=e.id,s=e.initPTS,o=e.timescale,l=this.unparsedVttFrags;"main"===a&&(this.initPTS[r.cc]=s,this.timescale[r.cc]=o),l.length&&(this.unparsedVttFrags=[],l.forEach(function(t){i.onFragLoaded(n.a.FRAG_LOADED,t)}))},e.getExistingTrack=function(t){var e=this.media;if(e)for(var i=0;i<e.textTracks.length;i++){var r=e.textTracks[i];if(r[t])return r}return null},e.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},e.createNativeTrack=function(t){if(!this.captionsTracks[t]){var e=this.captionsProperties,i=this.captionsTracks,r=this.media,a=e[t],n=a.label,s=a.languageCode,o=this.getExistingTrack(t);if(o)i[t]=o,P(i[t]),C(i[t],r);else{var l=this.createTextTrack("captions",n,s);l&&(l[t]=!0,i[t]=l)}}},e.createNonNativeTrack=function(t){if(!this.nonNativeCaptionsTracks[t]){var e=this.captionsProperties[t];if(e){var i={_id:t,label:e.label,kind:"captions",default:!!e.media&&!!e.media.default,closedCaptions:e.media};this.nonNativeCaptionsTracks[t]=i,this.hls.trigger(n.a.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}}},e.createTextTrack=function(t,e,i){var r=this.media;if(r)return r.addTextTrack(t,e,i)},e.onMediaAttaching=function(t,e){this.media=e.media,this._cleanTracks()},e.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(e){P(t[e]),delete t[e]}),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},e._cleanTracks=function(){var t=this.media;if(t){var e=t.textTracks;if(e)for(var i=0;i<e.length;i++)P(e[i])}},e.onSubtitleTracksUpdated=function(t,e){var i=this;this.textTracks=[];var r=e.subtitleTracks||[],a=r.some(function(t){return"stpp.ttml.im1t"===t.textCodec});if(this.config.enableWebVTT||a&&this.config.enableIMSC1){var s=this.tracks&&r&&this.tracks.length===r.length;if(this.tracks=r||[],this.config.renderTextTracksNatively){var o=this.media?this.media.textTracks:[];this.tracks.forEach(function(t,e){var r;if(e<o.length){for(var a,n=null,s=0;s<o.length;s++)if((a=o[s])&&a.label===t.name&&!(a.textTrack1||a.textTrack2)){n=o[s];break}n&&(r=n)}r?P(r):(r=i.createTextTrack("subtitles",t.name,t.lang))&&(r.mode="disabled"),r&&(r.groupId=t.groupId,i.textTracks.push(r))})}else if(!s&&this.tracks&&this.tracks.length){var l=this.tracks.map(function(t){return{label:t.name,kind:t.type.toLowerCase(),default:t.default,subtitleTrack:t}});this.hls.trigger(n.a.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:l})}}},e.onManifestLoaded=function(t,e){var i=this;this.config.enableCEA708Captions&&e.captions&&e.captions.forEach(function(t){var e=/(?:CC|SERVICE)([1-4])/.exec(t.instreamId);if(e){var r="textTrack"+e[1],a=i.captionsProperties[r];a&&(a.label=t.name,t.lang&&(a.languageCode=t.lang),a.media=t)}})},e.onFragLoading=function(t,e){var i=this.cea608Parser1,r=this.cea608Parser2,a=this.lastSn,n=this.lastPartIndex;if(this.enabled&&i&&r&&e.frag.type===D.b.MAIN){var s,o,l=e.frag.sn,u=null!=(s=null==e||null==(o=e.part)?void 0:o.index)?s:-1;l===a+1||l===a&&u===n+1||(i.reset(),r.reset()),this.lastSn=l,this.lastPartIndex=u}},e.onFragLoaded=function(t,e){var i=e.frag,r=e.payload,s=this.initPTS,o=this.unparsedVttFrags;if(i.type===D.b.SUBTITLE)if(r.byteLength){if(!Object(a.a)(s[i.cc]))return o.push(e),void(s.length&&this.hls.trigger(n.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:Error("Missing initial subtitle PTS")}));var l=i.decryptdata,u="stats"in e;if(null==l||null==l.key||"AES-128"!==l.method||u){var h=this.tracks[i.level],d=this.vttCCs;d[i.cc]||(d[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),h&&"stpp.ttml.im1t"===h.textCodec?this._parseIMSC1(i,r):this._parseVTTs(i,r,d)}}else this.hls.trigger(n.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:Error("Empty subt
1itle payload")})},e._parseIMSC1=function(t,e){var i=this,r=this.hls;ez(e,this.initPTS[t.cc],this.timescale[t.cc],function(e){i._appendCues(e,t.level),r.trigger(n.a.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(e){o.b.log("Failed to parse IMSC1: "+e),r.trigger(n.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:e})})},e._parseVTTs=function(t,e,i){var r,s,l,u,h,d,c,f,g,v,p,m,y,T,E,S,b=this,_=this.hls;r=this.initPTS[t.cc],s=this.timescale[t.cc],l=t.cc,u=t.start,h=function(e){b._appendCues(e,t.level),_.trigger(n.a.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},d=function(i){b._fallbackToIMSC1(t,e),o.b.log("Failed to parse VTT cue: "+i),_.trigger(n.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:i})},f=new eU,g=Object(M.f)(new Uint8Array(e)).trim().replace(eH,"\n").split("\n"),v=[],p=Object(eB.a)(r,s),m="00:00.000",y=0,T=0,E=!0,S=!1,f.oncue=function(t){var e=i[l],r=i.ccOffset,a=(y-p)/9e4;if(null!=e&&e.new&&(void 0!==T?r=i.ccOffset=e.start:function(t,e,i){var r,a=t[e],n=t[a.prevCC];if(!n||!n.new&&a.new)return t.ccOffset=t.presentationOffset=a.start,a.new=!1;for(;null!=(r=n)&&r.new;)t.ccOffset+=a.start-n.start,a.new=!1,n=t[(a=n).prevCC];t.presentationOffset=i}(i,l,a)),a&&(r=a-i.presentationOffset),S){var n=t.endTime-t.startTime,s=Object(eG.d)(9e4*(t.startTime+r-T),9e4*u)/9e4;t.startTime=s,t.endTime=s+n}var o=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(o)),t.id||(t.id=eV(t.startTime,t.endTime,o)),t.endTime>0&&v.push(t)},f.onparsingerror=function(t){c=t},f.onflush=function(){c?d(c):h(v)},g.forEach(function(t){if(E){if(ej(t,"X-TIMESTAMP-MAP=")){E=!1,S=!0,t.substr(16).split(",").forEach(function(t){ej(t,"LOCAL:")?m=t.substr(6):ej(t,"MPEGTS:")&&(y=parseInt(t.substr(7)))});try{T=function(t){var e=parseInt(t.substr(-3)),i=parseInt(t.substr(-6,2)),r=parseInt(t.substr(-9,2)),n=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;if(!(Object(a.a)(e)&&Object(a.a)(i)&&Object(a.a)(r)&&Object(a.a)(n)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return e+=1e3*i,e+=6e4*r,e+=36e5*n}(m)/1e3}catch(t){S=!1,c=t}return}""===t&&(E=!1)}f.parse(t+"\n")}),f.flush()},e._fallbackToIMSC1=function(t,e){var i=this,r=this.tracks[t.level];r.textCodec||ez(e,this.initPTS[t.cc],this.timescale[t.cc],function(){r.textCodec="stpp.ttml.im1t",i._parseIMSC1(t,e)},function(){r.textCodec="wvtt"})},e._appendCues=function(t,e){var i=this.hls;if(this.config.renderTextTracksNatively){var r=this.textTracks[e];if("disabled"===r.mode)return;t.forEach(function(t){return w(r,t)})}else{var a=this.tracks[e].default?"default":"subtitles"+e;i.trigger(n.a.CUES_PARSED,{type:"subtitles",cues:t,track:a})}},e.onFragDecrypted=function(t,e){var i=e.frag;if(i.type===D.b.SUBTITLE){if(!Object(a.a)(this.initPTS[i.cc]))return void this.unparsedVttFrags.push(e);this.onFragLoaded(n.a.FRAG_LOADED,e)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(t,e){var i=this.cea608Parser1,r=this.cea608Parser2;if(this.enabled&&i&&r)for(var a=0;a<e.samples.length;a++){var n=e.samples[a].bytes;if(n){var s=this.extractCea608Data(n);i.addData(e.samples[a].pts,s[0]),r.addData(e.samples[a].pts,s[1])}}},e.onBufferFlushing=function(t,e){var i=e.startOffset,r=e.endOffset,a=e.endOffsetSubtitles,n=e.type,s=this.media;if(s&&!(s.currentTime<r)){if(!n||"video"===n){var o=this.captionsTracks;Object.keys(o).forEach(function(t){return x(o[t],i,r)})}if(this.config.renderTextTracksNatively&&0===i&&void 0!==a){var l=this.textTracks;Object.keys(l).forEach(function(t){return x(l[t],i,a)})}}},e.extractCea608Data=function(t){for(var e=[[],[]],i=31&t[0],r=2,a=0;a<i;a++){var n=t[r++],s=127&t[r++],o=127&t[r++];if((0!==s||0!==o)&&0!=(4&n)){var l=3&n;0!==l&&1!==l||(e[l].push(s),e[l].push(o))}}return e},t}();function e2(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var e4,e5,e3=function(){function t(t){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=t,this.autoLevelCapping=1/0,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e,i,r=t.prototype;return r.setStreamController=function(t){this.streamController=t},r.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},r.registerListeners=function(){var t=this.hls;t.on(n.a.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(n.a.MEDIA_ATTA
vendor: 4,095 bytes, line 1
1CHING,this.onMediaAttaching,this),t.on(n.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(n.a.BUFFER_CODECS,this.onBufferCodecs,this),t.on(n.a.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var t=this.hls;t.off(n.a.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(n.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(n.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(n.a.BUFFER_CODECS,this.onBufferCodecs,this),t.off(n.a.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(e,i){t.isLevelAllowed(i.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(i.droppedLevel)},r.onMediaAttaching=function(t,e){this.media=e.media instanceof HTMLVideoElement?e.media:null},r.onManifestParsed=function(t,e){var i=this.hls;this.restrictedLevels=[],this.firstLevel=e.firstLevel,i.config.capLevelToPlayerSize&&e.video&&this.startCapping()},r.onBufferCodecs=function(t,e){this.hls.config.capLevelToPlayerSize&&e.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var t=this.hls.levels;if(t.length){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},r.getMaxLevel=function(e){var i=this,r=this.hls.levels;if(!r.length)return -1;var a=r.filter(function(r,a){return t.isLevelAllowed(a,i.restrictedLevels)&&a<=e});return this.clientRect=null,t.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)},r.startCapping=function(){this.timer||(this.autoLevelCapping=1/0,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=1/0,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var t=this.media,e={width:0,height:0};if(t){var i=t.getBoundingClientRect();e.width=i.width,e.height=i.height,e.width||e.height||(e.width=i.right-i.left||t.width||0,e.height=i.bottom-i.top||t.height||0)}return this.clientRect=e,e},t.isLevelAllowed=function(t,e){return void 0===e&&(e=[]),-1===e.indexOf(t)},t.getMaxLevelByMediaSize=function(t,e,i){if(!t||!t.length)return -1;for(var r,a=t.length-1,n=0;n<t.length;n+=1){var s=t[n];if((s.width>=e||s.height>=i)&&(!(r=t[n+1])||s.width!==r.width||s.height!==r.height)){a=n;break}}return a},e=[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch(t){}return t}}],e2(t.prototype,e),i&&e2(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}(),e8=function(){function t(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}var e=t.prototype;return e.setStreamController=function(t){this.streamController=t},e.registerListeners=function(){this.hls.on(n.a.MEDIA_ATTACHING,this.onMediaAttaching,this)},e.unregisterListeners=function(){this.hls.off(n.a.MEDIA_ATTACHING,this.onMediaAttaching)},e.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},e.onMediaAttaching=function(t,e){var i=this.hls.config;if(i.capLevelOnFPSDrop){var r=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=r,r&&"function"==typeof r.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}
1,e.checkFPS=function(t,e,i){var r=performance.now();if(e){if(this.lastTime){var a=r-this.lastTime,s=i-this.lastDroppedFrames,l=e-this.lastDecodedFrames,u=1e3*s/a,h=this.hls;if(h.trigger(n.a.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:i}),u>0&&s>h.config.fpsDroppedMonitoringThreshold*l){var d=h.currentLevel;o.b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===h.autoLevelCapping||h.autoLevelCapping>=d)&&(d-=1,h.trigger(n.a.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:h.currentLevel}),h.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=i,this.lastDecodedFrames=e}},e.checkFPSInterval=function(){var t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},t}();(e7=e5||(e5={})).WIDEVINE="com.widevine.alpha",e7.PLAYREADY="com.microsoft.playready";var e6="u">typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function e9(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var e7,it,ie,ii,ir=function(){function t(t){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=t,this._config=t.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var e,i,r=t.prototype;return r.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},r._registerListeners=function(){this.hls.on(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(n.a.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(n.a.MANIFEST_PARSED,this.onManifestParsed,this)},r._unregisterListeners=function(){this.hls.off(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(n.a.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(n.a.MANIFEST_PARSED,this.onManifestParsed,this)},r.getLicenseServerUrl=function(t){switch(t){case e5.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw Error('no license server URL configured for key-system "'+t+'"')},r._attemptKeySystemAccess=function(t,e,i){var r=this,a=function(t,e,i,r){if(t===e5.WIDEVINE){var a;return a={audioCapabilities:[],videoCapabilities:[]},e.forEach(function(t){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+t+'"',robustness:r.audioRobustness||""})}
vendor: 4,145 bytes, line 1
1),i.forEach(function(t){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:r.videoRobustness||""})}),[a]}throw Error("Unknown key-system: "+t)}(t,e,i,this._drmSystemOptions);o.b.log("Requesting encrypted media key-system access");var n=this.requestMediaKeySystemAccess(t,a);this.mediaKeysPromise=n.then(function(e){return r._onMediaKeySystemAccessObtained(t,e)}),n.catch(function(e){o.b.error('Failed to obtain key-system "'+t+'" access:',e)})},r._onMediaKeySystemAccessObtained=function(t,e){var i=this;o.b.log('Access for key-system "'+t+'" obtained');var r={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:t};this._mediaKeysList.push(r);var a=Promise.resolve().then(function(){return e.createMediaKeys()}).then(function(e){return r.mediaKeys=e,o.b.log('Media-keys created for key-system "'+t+'"'),i._onMediaKeysCreated(),e});return a.catch(function(t){o.b.error("Failed to create media-keys:",t)}),a},r._onMediaKeysCreated=function(){var t=this;this._mediaKeysList.forEach(function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),t._onNewMediaKeySession(e.mediaKeysSession))})},r._onNewMediaKeySession=function(t){var e=this;o.b.log("New key-system session "+t.sessionId),t.addEventListener("message",function(i){e._onKeySessionMessage(t,i.message)},!1)},r._onKeySessionMessage=function(t,e){o.b.log("Got EME message event, creating license request"),this._requestLicense(e,function(e){o.b.log("Received license data (length: "+(e?e.byteLength:e)+"), updating key-session"),t.update(e)})},r.onMediaEncrypted=function(t){var e=this;if(o.b.log('Media is encrypted using "'+t.initDataType+'" init data type'),!this.mediaKeysPromise)return o.b.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),void this.hls.trigger(n.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_KEYS,fatal:!0});var i=function(i){e._media&&(e._attemptSetMediaKeys(i),e._generateRequestWithPreferredKeySession(t.initDataType,t.initData))};this.mediaKeysPromise.then(i).catch(i)},r._attemptSetMediaKeys=function(t){if(!this._media)throw Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys)return o.b.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.hls.trigger(n.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_KEYS,fatal:!0});o.b.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},r._generateRequestWithPreferredKeySession=function(t,e){var i=this,r=this._mediaKeysList[0];if(!r)return o.b.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.hls.trigger(n.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_ACCESS,fatal:!0});if(r.mediaKeysSessionInitialized)o.b.warn("Key-Session already initialized but requested again");else{var a=r.mediaKeysSession;if(!a)return o.b.error("Fatal: Media is encrypted but no key-session existing"),void this.hls.trigger(n.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_SESSION,fatal:!0});if(!e)return o.b.warn("Fatal: initData required for generating a key session is null"),void this.hls.trigger(n.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});o.b.log('Generating key-session request for "'+t+'" init data type'),r.mediaKeysSessionInitialized=!0,a.generateRequest(t,e).then(function(){o.b.debug("Key-session generation succeeded")}).catch(function(t){o.b.error("Error generating key-session request:",t),i.hls.trigger(n.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_SESSION,fatal:!1})})}},r._createLicenseXhr=function(t,e,i){var r=new XMLHttpRequest;r.responseType="arraybuffer",r.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,r,t,e,i);var a=this._licenseXhrSetup;if(a)try{a.call(this.hls,r,t),a=void 0}catch(t){o.b.error(t)}try{r.readyState||r.open("POST",t,!0),a&&a.call(this.hls,r,t)}catch(t){throw Error("issue setting up KeySystem license XHR "+t)}return r}
1,r._onLicenseRequestReadyStageChange=function(t,e,i,r){if(4===t.readyState)if(200===t.status){this._requestLicenseFailureCount=0,o.b.log("License request succeeded");var a=t.response,l=this._licenseResponseCallback;if(l)try{a=l.call(this.hls,t,e)}catch(t){o.b.error(t)}r(a)}else{if(o.b.error("License Request XHR failed ("+e+"). Status: "+t.status+" ("+t.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>3)return void this.hls.trigger(n.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var u=3-this._requestLicenseFailureCount+1;o.b.warn("Retrying license request, "+u+" attempts left"),this._requestLicense(i,r)}},r._generateLicenseRequestChallenge=function(t,e){if(t.mediaKeySystemDomain===e5.WIDEVINE)return e;throw Error("unsupported key-system: "+t.mediaKeySystemDomain)},r._requestLicense=function(t,e){o.b.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i)return o.b.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(n.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var r=this.getLicenseServerUrl(i.mediaKeySystemDomain),a=this._createLicenseXhr(r,t,e);o.b.log("Sending license request to URL: "+r);var l=this._generateLicenseRequestChallenge(i,t);a.send(l)}catch(t){o.b.error("Failure requesting DRM license: "+t),this.hls.trigger(n.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},r.onMediaAttached=function(t,e){if(this._emeEnabled){var i=e.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)}},r.onMediaDetached=function(){var t=this._media,e=this._mediaKeysList;t&&(t.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map(function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch(function(){})})).then(function(){return t.setMediaKeys(null)}).catch(function(){}))},r.onManifestParsed=function(t,e){if(this._emeEnabled){var i=e.levels.map(function(t){return t.audioCodec}).filter(function(t){return!!t}),r=e.levels.map(function(t){return t.videoCodec}).filter(function(t){return!!t});this._attemptKeySystemAccess(e5.WIDEVINE,i,r)}},e=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}],e9(t.prototype,e),i&&e9(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}();function ia(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function is(t,e,i){return e&&ia(t.prototype,e),i&&ia(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function io(t,e){var i="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t){if(t){if("string"==typeof t)return il(t,void 0);var e=Object.prototype.toString.call(t).slice(8,-1);if("Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return il(t,void 0)}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function il(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function iu(){return(iu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}(ib=it||(it={})).MANIFEST="m",ib.AUDIO="a",ib.VIDEO="v",ib.MUXED="av",ib.INIT="i",ib.CAPTION="c",ib.TIMED_TEXT="tt",ib.KEY="k",ib.OTHER="o",(i_=ie||(ie={})).DASH="d",i_.HLS="h",i_.SMOOTH="s",i_.OTHER="o",(iA=ii||(ii={})).VOD="v",iA.LIVE="l";var ih=function(){function t(e){var i=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){i.initialized&&(i.starved=!0),i.buffering=!0},this.onPlaying=function(){i.initialized||(i.initialized=!0),i.buffering=!1},this.applyPlaylistData=function(t){try{i.apply(t,{ot:it.MANIFEST,su:!i.initialized})}catch(t){o.b.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=function(t){try{var e=t.frag,r=i.hls.levels[e.level],a=i.getObjectType(e),n={d:1e3*e.duration,ot:a};a!==it.VIDEO&&a!==it.AUDIO&&a!=it.MUXED||(n.br=r.bitrate/1e3,n.tb=i.getTopBandwidth(a)/1e3,n.bl=i.getBufferLength(a)),i.apply(t,n)}catch(t){o.b.warn("Could not generate segment CMCD data.",t)}},this.hls=e;var r=this.config=e.config,a=r.cmcd;null!=a&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||t.uuid(),this.cid=a.contentId,this.useHeaders=!0===a.useHeaders,this.registerListeners())}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;
1t.on(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(n.a.MEDIA_DETACHED,this.onMediaDetached,this),t.on(n.a.BUFFER_CREATED,this.onBufferCreated,this)},e.unregisterListeners=function(){var t=this.hls;t.off(n.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(n.a.MEDIA_DETACHED,this.onMediaDetached,this),t.off(n.a.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},e.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},e.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},e.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},e.onBufferCreated=function(t,e){var i,r;this.audioBuffer=null==(i=e.tracks.audio)?void 0:i.buffer,this.videoBuffer=null==(r=e.tracks.video)?void 0:r.buffer},e.createData=function(){var t;return{v:1,sf:ie.HLS,sid:this.sid,cid:this.cid,pr:null==(t=this.media)?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},e.apply=function(e,i){void 0===i&&(i={}),iu(i,this.createData());var r=i.ot===it.INIT||i.ot===it.VIDEO||i.ot===it.MUXED;if(this.starved&&r&&(i.bs=!0,i.su=!0,this.starved=!1),null==i.su&&(i.su=this.buffering),this.useHeaders){var a=t.toHeaders(i);if(!Object.keys(a).length)return;e.headers||(e.headers={}),iu(e.headers,a)}else{var n=t.toQuery(i);if(!n)return;e.url=t.appendQueryToUri(e.url,n)}},e.getObjectType=function(t){var e=t.type;return"subtitle"===e?it.TIMED_TEXT:"initSegment"===t.sn?it.INIT:"audio"===e?it.AUDIO:"main"===e?this.hls.audioTracks.length?it.VIDEO:it.MUXED:void 0},e.getTopBandwidth=function(t){var e,i=0,r=this.hls;if(t===it.AUDIO)e=r.audioTracks;else{var a=r.maxAutoLevel,n=a>-1?a+1:r.levels.length;e=r.levels.slice(0,n)}for(var s,o=io(e);!(s=o()).done;){var l=s.value;l.bitrate>i&&(i=l.bitrate)}return i>0?i:0/0},e.getBufferLength=function(t){var e=this.hls.media,i=t===it.AUDIO?this.audioBuffer:this.videoBuffer;return i&&e?1e3*tl.bufferInfo(i,e.currentTime,this.config.maxBufferHole).len:0/0},e.createPlaylistLoader=function(){var t=this.config.pLoader,e=this.applyPlaylistData,i=t||this.config.loader;function r(t){this.loader=void 0,this.loader=new i(t)}var a=r.prototype;return a.destroy=function(){this.loader.destroy()},a.abort=function(){this.loader.abort()},a.load=function(t,i,r){e(t),this.loader.load(t,i,r)},is(r,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),r},e.createFragmentLoader=function(){var t=this.config.fLoader,e=this.applyFragmentData,i=t||this.config.loader;function r(t){this.loader=void 0,this.loader=new i(t)}var a=r.prototype;return a.destroy=function(){this.loader.destroy()},a.abort=function(){this.loader.abort()},a.load=function(t,i,r){e(t),this.loader.load(t,i,r)},is(r,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),r},t.uuid=function(){var t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.substr(e.lastIndexOf("/")+1)},t.serialize=function(t){for(var e,i=[],r=function(t){return Math.round(t)},a=function(t){return 100*r(t/100)},n={br:r,d:r,bl:a,dl:a,mtp:a,nor:function(t){return encodeURIComponent(t)},rtp:a,tb:r},s=io(Object.keys(t||{}).sort());!(e=s()).done;){var o,l=e.value,u=t[l];if(!Number.isNaN(o=u)&&null!=o&&""!==o&&!1!==o&&("v"!==l||1!==u)&&("pr"!=l||1!==u)){var h=n[l];h&&(u=h(u));var d=typeof u,c=void 0;c="ot"===l||"sf"===l||"st"===l?l+"="+u:"boolean"===d?l:"number"===d?l+"="+u:l+"="+JSON.stringify(u),i.push(c)}}return i.join(",")},t.toHeaders=function(e){for(var i={},r=["Object","Request","Session","Status"],a=[{},{},{},{}],n={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},s=0,o=Object.keys(e);s<o.length;s++){var l=o[s];a[null!=n[l]?n[l]:1][l]=e[l]}for(var u=0;u<a.length;u++){var h=t.serialize(a[u]);h&&(i["CMCD-"+r[u]]=h)}return i},t.toQuery=function(e){return"CMCD="+encodeURIComponent(t.serialize(e))},t.appendQueryToUri=function(t,e){if(!e)return t;var i=t.includes("?")?"&":"?";return""+t+i+e},t}(),id=i(13),ic=/^age:\s*[\d.]+\s*$/m,ig=function(){function t(t){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.safeRequestTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=t?t.xhrSetup:null,this.stats=new id.a,this.retryDelay=0}var e=t.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),self.clearTimeout(this.safeRequestTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,4!==t.readyState&&(this.stats.aborted=!0,t.abort()))},e.abort=function(){var t;this.abortInternal(),null!=(t=this.callbacks)&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}
1,e.load=function(t,e,i){if(this.stats.loading.start)throw Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=i,this.retryDelay=e.retryDelay,this.loadInternal()},e.loadInternal=function(){var t,e=this.config,i=this.context;if(e){var r=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var n=this.xhrSetup;try{if(n)try{n(r,i.url)}catch(t){r.open("GET",i.url,!0),n(r,i.url)}r.readyState||r.open("GET",i.url,!0);var s=this.context.headers;if(s)for(var o in s)r.setRequestHeader(o,s[o])}catch(t){return void this.callbacks.onError({code:r.status,text:t.message},i,r)}i.rangeEnd&&r.setRequestHeader("Range","bytes="+i.rangeStart+"-"+(i.rangeEnd-1)),r.onreadystatechange=this.readystatechange.bind(this),r.onprogress=this.loadprogress.bind(this),r.responseType=i.responseType,self.clearTimeout(this.requestTimeout),self.clearTimeout(this.safeRequestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),e.timeout),null!=(t=this.config)&&t.safeTimeout&&this.config.safeTimeout>0&&(this.safeRequestTimeout=self.setTimeout(this.loadSafeTimeout.bind(this),this.config.safeTimeout)),r.send()}},e.readystatechange=function(){var t=this.context,e=this.loader,i=this.stats;if(t&&e){var r=e.readyState,a=this.config;if(!i.aborted&&r>=2)if(self.clearTimeout(this.requestTimeout),0===i.loading.first&&(i.loading.first=Math.max(self.performance.now(),i.loading.start)),4===r){e.onreadystatechange=null,e.onprogress=null;var n=e.status;if(n>=200&&n<300){if(i.loading.end=Math.max(self.performance.now(),i.loading.first),i.loaded=i.total="arraybuffer"===t.responseType?(s=e.response).byteLength:(s=e.responseText).length,!this.callbacks)return;var s,l=this.callbacks.onProgress;if(l&&l(i,t,s,e),!this.callbacks)return;var u={url:e.responseURL,data:s};this.callbacks.onSuccess(u,i,t,e)}else i.retry>=a.maxRetry||n>=400&&n<499?(o.b.error(n+" while loading "+t.url),this.callbacks.onError({code:n,text:e.statusText},t,e)):(o.b.warn(n+" while loading "+t.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,a.maxRetryDelay),i.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)}},e.loadtimeout=function(){o.b.warn("timeout while loading "+this.context.url);var t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)},e.getCacheAge=function(){var t=null;if(this.loader&&ic.test(this.loader.getAllResponseHeaders())){var e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t},e.loadSafeTimeout=function(){o.b.warn("safe timeout while loading "+this.context.url);var t=this.callbacks;null!=t&&t.onSafeTimeout&&(this.abortInternal(),t.onSafeTimeout(this.stats,this.context,this.loader))},t}();function iv(t){var e="function"==typeof Map?new Map:void 0;return(iv=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return ip(t,arguments,iy(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),im(i,t)})(t)}function ip(t,e,i){return(ip=!function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}()?function(t,e,i){var r=[null];r.push.apply(r,e);var a=new(Function.bind.apply(t,r));return i&&im(a,i.prototype),a}:Reflect.construct).apply(null,arguments)}function im(t,e){return(im=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}
1function iy(t){return(iy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function iT(){return(iT=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}var iE=function(){function t(t){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||iS,this.controller=new self.AbortController,this.stats=new id.a}var e=t.prototype;return e.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},e.abortInternal=function(){var t=this.response;t&&t.ok||(this.stats.aborted=!0,this.controller.abort())},e.abort=function(){var t;this.abortInternal(),null!=(t=this.callbacks)&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},e.load=function(t,e,i){var r,n=this,s=this.stats;if(s.loading.start)throw Error("Loader can only be used once.");s.loading.start=self.performance.now();var o=(r={method:"GET",mode:"cors",credentials:"same-origin",signal:this.controller.signal,headers:new self.Headers(iT({},t.headers))},t.rangeEnd&&r.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),r),l=i.onProgress,u="arraybuffer"===t.responseType,h=u?"byteLength":"length";this.context=t,this.config=e,this.callbacks=i,this.request=this.fetchSetup(t,o),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){n.abortInternal(),i.onTimeout(s,t,n.response)},e.timeout),self.fetch(this.request).then(function(i){if(n.response=n.loader=i,!i.ok){var r=i.status;throw new ik(i.statusText||"fetch, bad network response",r,i)}return s.loading.first=Math.max(self.performance.now(),s.loading.start),s.total=parseInt(i.headers.get("Content-Length")||"0"),l&&Object(a.a)(e.highWaterMark)?n.loadProgressively(i,s,t,e.highWaterMark,l):u?i.arrayBuffer():i.text()}).then(function(r){var o=n.response;self.clearTimeout(n.requestTimeout),s.loading.end=Math.max(self.performance.now(),s.loading.first),s.loaded=s.total=r[h];var u={url:o.url,data:r};l&&!Object(a.a)(e.highWaterMark)&&l(s,t,r,o),i.onSuccess(u,s,t,o)}).catch(function(e){if(self.clearTimeout(n.requestTimeout),!s.aborted){var r=e.code||0;i.onError({code:r,text:e.message},t,e.details)}})},e.getCacheAge=function(){var t=null;if(this.response){var e=this.response.headers.get("age");t=e?parseFloat(e):null}return t},e.loadProgressively=function(t,e,i,r,a){void 0===r&&(r=0);var n=new tJ.a,s=t.body.getReader();return function o(){return s.read().then(function(s){if(s.done)return n.dataLength&&a(e,i,n.flush(),t),Promise.resolve(new ArrayBuffer(0));var l=s.value,u=l.length;return e.loaded+=u,u<r||n.dataLength?(n.push(l),n.dataLength>=r&&a(e,i,n.flush(),t)):a(e,i,l,t),o()}).catch(function(){return Promise.reject()})}()},t}();function iS(t,e){return new self.Request(t.url,e)}var ib,i_,iA,iL,iR,iD,ik=function(t){function e(e,i,r){var a;return(a=t.call(this,e)||this).code=void 0,a.details=void 0,a.code=i,a.details=r,a}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,im(e,t),e}(iv(Error)),iI=/\s/;(iO=iL||(iL={})).STREAM="stream",iO.VIDEO="video",iO.AUDIO="audio",(iC=iR||(iR={})).MOVING_AVERAGE_SLIDING_WINDOW="movingAverageSlidingWindow",iC.EWMA="EWMA",(iw=iD||(iD={})).ABR_STRATEGY_INSUFFICIENT_BUFFER="insufficientBuffer",iw.ABR_STRATEGY_L2A="l2a",iw.ABR_STRATEGY_IMMEDIATE_DROP_LEVEL="immediateDropLevel",iw.ABR_STRATEGY_BOLA="bola",iw.ABR_STRATEGY_SWITCH_REQUEST="switchRequest",iw.ABR_STRATEGY_THROUGHPUT="throughput",iw.ABR_STRATEGY_DROPPED_FRAMES="droppedFrames";var iO,iC,iw,iP,ix=function(){function t(){this._values={},this._lastDroppedFrames={},this._lastTotalFrames={}}var e=t.prototype;return e.push=function(t,e,i){if(e){this._values[t]||(this._values[t]=[],this._lastDroppedFrames[t]=0,this._lastTotalFrames[t]=0);var r=null!=i&&i.droppedVideoFrames?i.droppedVideoFrames:0,a=null!=i&&i.totalVideoFrames?i.totalVideoFrames:0,n=r-this._lastDroppedFrames[t];this._lastTotalFrames[t]=r;var s=a-this._lastTotalFrames[t];this._lastTotalFrames[t]=a;var o=this._values[t];isNaN(e)||(o[e]?(o[e].droppedVideoFrames+=n,o[e].totalVideoFrames+=s):o[e]={droppedVideoFrames:n,totalVideoFrames:s})}},e.getFrameHistory=function(t){return this._values[t]},e.clearForStream=function(t){try{delete this._values[t],delete this._lastDroppedFrames[t],delete this._lastTotalFrames[t]}catch(t){}},e.reset=function(){this._values={},this._lastDroppedFrames={},this._lastTotalFrames={}},t}(),iM=function(){function t(t,e){this.hlsInstance=void 0,this.config=void 0,this.MAX_MEASUREMENTS_TO_KEEP=20,this.AVERAGE_THROUGHPUT_SAMPLE_AMOUNT_LIVE=3,this.AVERAGE_THROUGHPUT_SAMPLE_AMOUNT_VOD=4,this.AVERAGE_LATENCY_SAMPLE_AMOUNT=4,this.THROUGHPUT_DECREASE_SCALE=1.3,this.THROUGHPUT_INCREASE_SCALE=1.3,this.EWMA_THROUGHPUT_SLOW_HALF_LIFE_SECONDS=8,this.EWMA_THROUGHPUT_FAST_HALF_LIFE_SECONDS=3,this.EWMA_LATENCY_SLOW_HALF_LIFE_COUNT=2,this.EWMA_LATENCY_FAST_HALF_LIFE_COUNT=1,this._throughputHistory=[],this._latencyHistory=[],this._sizeHistory=[],this._ewmaThroughputState={slowEstimate:0,totalWeight:0,fastEstimate:0},this._ewmaLatencyState=void 0,this._ewmaHalfLife=void 0,this.hlsInstance=t,this.config=e,this.reset(),this._attachEventListeners()}var e=t.prototype;return e.setup=function(){},e._attachEventListeners=function(){this.hlsInstance.on(n.a.FRAG_LOADED,this._onFragLoaded,this)},e._onFragLoaded=function(t,e){var i,r=e.frag.stats,a=r.loading.first-r.loading.start||1,n=r.loading.end-r.loading.start||1,s=r.total,o=0;0!==(i=this.config.useDeadTimeLatency?n:a+n)&&(o=Math.round(8*s/i)),this._throughputHistory.push(o),this._latencyHistory.push(a),this._sizeHistory.push(s),this._sizeHistory.length>this.MAX_MEASUREMENTS_TO_KEEP&&this._sizeHistory.shift(),this._throughputHistory.length>this.MAX_MEASUREMENTS_TO_KEEP&&this._throughputHistory.shift(),this._latencyHistory.length>this.MAX_MEASUREMENTS_TO_KEEP&&this._latencyHistory.shift(),this._updateEWMAEstimate(this._ewmaThroughputState,o,.001*n,this._ewmaHalfLife.throughputHalfLife),this._updateEWMAEstimate(this._ewmaLatencyState,a,1,this._ewmaHalfLife.latencyHalfLife)}
1,e._updateEWMAEstimate=function(t,e,i,r){var a=Math.pow(.5,i/r.fast);t.fastEstimate=(1-a)*e+a*t.fastEstimate;var n=Math.pow(.5,i/r.slow);t.slowEstimate=(1-n)*e+n*t.slowEstimate,t.totalWeight+=i},e._getSampleSize=function(t,e){var i,r=t?this._throughputHistory:this._latencyHistory;if(i=t?e?this.AVERAGE_THROUGHPUT_SAMPLE_AMOUNT_LIVE:this.AVERAGE_THROUGHPUT_SAMPLE_AMOUNT_VOD:this.AVERAGE_LATENCY_SAMPLE_AMOUNT,r||(i=0),i>=r.length&&(i=r.length),t)for(var a=1;a<i;++a){var n=r[r.length-a]/r[r.length-a-1];if((n>=this.THROUGHPUT_INCREASE_SCALE||n<=1/this.THROUGHPUT_DECREASE_SCALE)&&(i+=1)===r.length)break}return i},e._getAverage=function(t,e){return this.config.averageCalculationMethod===iR.EWMA?this._getAverageEWMA(t):this._getAverageSlidingWindow(t,e)},e._getAverageSlidingWindow=function(t,e){var i=this._getSampleSize(t,e),r=t?this._throughputHistory:this._latencyHistory;return 0!==i&&r&&r.length?r.slice(-i).reduce(function(t,e){return t+e})/r.length:0/0},e._getAverageEWMA=function(t){var e=t?this._ewmaHalfLife.throughputHalfLife:this._ewmaHalfLife.latencyHalfLife,i=t?this._ewmaThroughputState:this._ewmaLatencyState;if(!i||i.totalWeight<=0)return 0/0;var r=i.fastEstimate/(1-Math.pow(.5,i.totalWeight/e.fast)),a=i.slowEstimate/(1-Math.pow(.5,i.totalWeight/e.slow));return t?Math.min(r,a):Math.max(r,a)},e.getAverageThroughput=function(t){return this._getAverage(!0,t)},e.getSafeAverageThroughput=function(t){var e=this.getAverageThroughput(t);return isNaN(e)?e:e*this.config.bandwidthSafetyFactor},e.getAverageLatency=function(){return this._getAverage(!1,!1)},e.getLastThroughput=function(){return this._throughputHistory.slice(-1)[0]},e.getLastLatency=function(){return this._latencyHistory.slice(-1)[0]},e.getLastSize=function(){return this._sizeHistory.slice(-1)[0]},e.reset=function(){this._throughputHistory=[],this._latencyHistory=[],this._ewmaThroughputState={slowEstimate:0,totalWeight:0,fastEstimate:0},this._ewmaLatencyState={fastEstimate:0,totalWeight:0,slowEstimate:0},this._ewmaHalfLife={throughputHalfLife:{fast:this.EWMA_THROUGHPUT_FAST_HALF_LIFE_SECONDS,slow:this.EWMA_THROUGHPUT_SLOW_HALF_LIFE_SECONDS},latencyHalfLife:{fast:this.EWMA_LATENCY_FAST_HALF_LIFE_COUNT,slow:this.EWMA_LATENCY_SLOW_HALF_LIFE_COUNT}}},t}(),iF=function(t,e){for(var i=e.length-1;i>=0;i--)if(1e3*t>=e[i].bitrate)return i;return 0},iN=function(){function t(t,e){this.INSUFFICIENT_BUFFER_SAFETY_FACTOR=.5,this.SEGMENT_IGNORE_COUNT=2,this._hlsInstance=void 0,this.bufferState={ignoreCount:this.SEGMENT_IGNORE_COUNT},this._throughputHistory=void 0,this._resetInitialSettings(),this._hlsInstance=t,this._throughputHistory=e().throughputHistory,this._attachEvents()}var e=t.prototype;return e._attachEvents=function(){this._hlsInstance.on(n.a.PLAYBACK_SEEKING,this._onPlaybackSeeking,this),this._hlsInstance.on(n.a.FRAG_LOADED,this._onFragLoaded,this)},e._detachEvents=function(){this._hlsInstance.off(n.a.PLAYBACK_SEEKING,this._onPlaybackSeeking,this),this._hlsInstance.off(n.a.FRAG_LOADED,this._onFragLoaded,this)},e._onPlaybackSeeking=function(){this._resetInitialSettings()},e._onFragLoaded=function(t,e){!isNaN(e.frag.start)&&this.bufferState.ignoreCount>0&&this.bufferState.ignoreCount--},e._resetInitialSettings=function(){this.bufferState.ignoreCount=this.SEGMENT_IGNORE_COUNT},e._shouldIgnore=function(){return this.bufferState.ignoreCount>0},e.getMaxIndex=function(){var t=this._hlsInstance.bufferController.bufferSize;if(this._shouldIgnore())return -1;if(0===t)return 0;var e=this._hlsInstance.levels;return iF(this._throughputHistory.getAverageThroughput(!0)*t*this.INSUFFICIENT_BUFFER_SAFETY_FACTOR,e)},e.reset=function(){this._resetInitialSettings(),this._detachEvents()},e.setup=function(){this._resetInitialSettings(),this._detachEvents(),this._attachEvents()},t}(),iU=function(){function t(t,e){this._hlsInstance=void 0,this._throughputHistory=void 0,this._hlsInstance=t,this._throughputHistory=e().throughputHistory}var e=t.prototype;return e.setup=function(){},e.reset=function(){},e.getMaxIndex=function(){var t=this._throughputHistory.getAverageThroughput(!0);return t?iF(t,this._hlsInstance.levels):-1},t}(),iB=function(){function t(){this._switchRequests={},this._srHistory=[],this.SWITCH_REQUEST_HISTORY_DEPTH=8}var e=t.prototype;return e.push=function(t){-1===t.newValue&&(t.newValue=t.oldValue),this._switchRequests[t.oldValue]||(this._switchRequests[t.oldValue]={noDrops:0,drops:0,dropSize:0});var e=t.newValue-t.oldValue,i=+(e<0),r=i?-e:0,a=+!i;if(this._switchRequests[t.oldValue].drops+=i,this._switchRequests[t.oldValue].dropSize+=r,this._switchRequests[t.oldValue].noDrops+=a,this._srHistory.push({idx:t.oldValue,noDrop:a,drop:i,dropSize:r}),this._srHistory.length>this.SWITCH_REQUEST_HISTORY_DEPTH){var n=this._srHistory.shift();this._switchRequests[n.idx].drops-=n.drop,this._switchRequests[n.idx].dropSize-=n.dropSize,this._switchRequests[n.idx].noDrops-=n.noDrop}},e.getSwitchRequests=function(){return this._switchRequests},t}(),iG=function(){function t(t,e){this._hlsInstance=void 0,this._switchRequestHistory=void 0,this.SAMPLE_SIZE=6,this.MAX_SWITCH=.075,this._hlsInstance=t,this._switchRequestHistory=e().switchRequestHistory}var e=t.prototype;return e.getMaxIndex=function(){for(var t=this._switchRequestHistory?this._switchRequestHistory.getSwitchRequests():[],e=0,i=0,r=-1,a=0;a<t.length;a++)if(void 0!==t[a]&&(e+=t[a].drops)+(i+=t[a].noDrops)>=this.SAMPLE_SIZE&&e/i>
1this.MAX_SWITCH){r=a>0&&t[a].drops>0?a-1:a;break}return r},e.reset=function(){},e.setup=function(){},t}(),iH=function(){function t(t,e){this.DROPPED_PERCENTAGE_FORBID=.15,this.GOOD_SAMPLE_SIZE=375,this._hlsInstance=void 0,this._droppedFramesHistory=void 0,this._hlsInstance=t,this._droppedFramesHistory=e().droppedFramesHistory}var e=t.prototype;return e.getMaxIndex=function(){var t=this;if(!this._droppedFramesHistory)return -1;var e=this._droppedFramesHistory.getFrameHistory(this._hlsInstance.currentLevel.toString());if(!e||!e.length)return -1;var i=e.findIndex(function(e){return e.totalVideoFrames>t.GOOD_SAMPLE_SIZE&&e.droppedVideoFrames/e.totalVideoFrames>t.DROPPED_PERCENTAGE_FORBID});return i>0?i-1:i},e.reset=function(){},e.setup=function(){},t}();function ij(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)}return i}(iK=iP||(iP={}))[iK.BOLA_STATE_ONE_BITRATE=0]="BOLA_STATE_ONE_BITRATE",iK[iK.BOLA_STATE_STARTUP=1]="BOLA_STATE_STARTUP",iK[iK.BOLA_STATE_STEADY=2]="BOLA_STATE_STEADY";var iK,iV,iW={placeholderBuffer:0,mostAdvancedSegmentStart:0/0,lastSegmentWasReplacement:!1,lastSegmentStart:0/0,lastSegmentDurationS:0/0,lastSegmentRequestTimeMs:0/0,lastSegmentFinishTimeMs:0/0,lastCallTimeMs:0/0},iY=function(){function t(t,e){this._hlsInstance=void 0,this.MINIMUM_BUFFER_S=10,this.MINI
1MUM_BUFFER_PER_BITRATE_LEVEL_S=2,this.PLACEHOLDER_BUFFER_DECAY=.99,this.DEFAULT_MIN_BUFFER_TIME=12,this._bolaState=void 0,this._throughputHistory=void 0,this._hlsInstance=t,this._throughputHistory=e().throughputHistory,this._attachListeners()}var e=t.prototype;return e._attachListeners=function(){this._hlsInstance.on(n.a.BUFFER_EMPTY,this._onBufferEmpty,this),this._hlsInstance.on(n.a.PLAYBACK_SEEKING,this._onPlaybackSeeking,this),this._hlsInstance.on(n.a.FRAG_LOADED,this._onMediaFragmentLoaded,this)},e._detachListeners=function(){this._hlsInstance.off(n.a.BUFFER_EMPTY,this._onBufferEmpty,this),this._hlsInstance.off(n.a.PLAYBACK_SEEKING,this._onPlaybackSeeking,this),this._hlsInstance.off(n.a.FRAG_LOADED,this._onMediaFragmentLoaded,this)},e._utilitiesFromBitrates=function(t){return t.map(function(t){return Math.log(t)})},e._calculateBolaParameters=function(t,e){var i=this._utilitiesFromBitrates(e),r=i.reduce(function(t,e,r){return e>i[t]?r:t},0);if(0===r)return null;var a=Math.max(t,this.MINIMUM_BUFFER_S+this.MINIMUM_BUFFER_PER_BITRATE_LEVEL_S*e.length),n=(i[r]-1)/(a/this.MINIMUM_BUFFER_S-1);return{gp:n,Vp:this.MINIMUM_BUFFER_S/n}},e._initBolaState=function(){var t=this._hlsInstance.levels.map(function(t){return t.bitrate}),e=this._calculateBolaParameters(this.DEFAULT_MIN_BUFFER_TIME,t);if(e){var i=this._utilitiesFromBitrates(t).map(function(t,e,i){return t-i[0]+1});this._bolaState=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ij(Object(i),!0).forEach(function(e){var r;r=i[e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ij(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({state:iP.BOLA_STATE_STARTUP,bitrates:t,utilities:i,stableBufferTime:this.DEFAULT_MIN_BUFFER_TIME,Vp:e.Vp,gp:e.gp,lastQuality:0},iW)}else this._bolaState={state:iP.BOLA_STATE_ONE_BITRATE}},e._clearBolaStateOnSeek=function(){this._bolaState&&this._bolaState.state!==iP.BOLA_STATE_ONE_BITRATE&&this._initBolaState()},e._getQualityFromBufferLevel=function(t){var e=this._bolaState;return e.bitrates.reduce(function(i,r,a){var n=(e.Vp*(e.utilities[a]+e.gp)-t)/r;return isNaN(i.score)||n>=i.score?{score:n,quality:a}:i},{score:0/0,quality:0/0}).quality},e._maxBufferLevelForQuality=function(t){var e=this._bolaState;return e.Vp*(e.utilities[t]+e.gp)},e._minBufferLevelForQuality=function(t){var e=this._bolaState,i=e.bitrates[t],r=e.utilities[t];return e.bitrates.slice(0,t).reduceRight(function(t,a,n){return Math.max(t,e.Vp*(e.gp+(i*e.utilities[n]-a*r)/(i-a)))},0)},e._updatePlaceholderBuffer=function(){var t=this._bolaState,e=Date.now();if(isNaN(t.lastSegmentFinishTimeMs)){if(!isNaN(t.lastCallTimeMs)){var i=.001*(e-t.lastCallTimeMs);t.placeholderBuffer+=Math.max(0,i)}}else{var r=.001*(e-t.lastSegmentFinishTimeMs);t.placeholderBuffer+=Math.max(0,r)}t.lastCallTimeMs=e,t.lastSegmentStart=0/0,t.lastSegmentRequestTimeMs=0/0,t.lastSegmentFinishTimeMs=0/0},e._onBufferEmpty=function(){var t=this._bolaState;t.state===iP.BOLA_STATE_STEADY&&(t.placeholderBuffer=0)},e._onPlaybackSeeking=function(){var t=this._bolaState;t.state!==iP.BOLA_STATE_ONE_BITRATE&&(t.state=iP.BOLA_STATE_STARTUP,this._clearBolaStateOnSeek())},e._onMediaFragmentLoaded=function(t,e){if(this._bolaState&&this._bolaState.state!==iP.BOLA_STATE_ONE_BITRATE){var i=e.frag.start;isNaN(this._bolaState.mostAdvancedSegmentStart)||i>this._bolaState.mostAdvancedSegmentStart?(this._bolaState.mostAdvancedSegmentStart=i,this._bolaState.lastSegmentWasReplacement=!1):this._bolaState.lastSegmentWasReplacement=!0,this._bolaState.lastSegmentStart=i,this._bolaState.lastSegmentDurationS=e.frag.duration,this._bolaState.lastQuality=e.frag.level,this._bolaState.lastSegmentRequestTimeMs=e.frag.stats.loading.start,this._bolaState.lastSegmentFinishTimeMs=e.frag.stats.loading.end,this._checkNewSegment()}},e._checkNewSegment=function(){if(this._bolaState&&this._bolaState.state!==iP.BOLA_STATE_ONE_BITRATE&&!isNaN(this._bolaState.lastSegmentStart)&&!isNaN(this._bolaState.lastSegmentRequestTimeMs)&&!isNaN(this._bolaState.placeholderBuffer)){if(this._bolaState.placeholderBuffer*=this.PLACEHOLDER_BUFFER_DECAY,!isNaN(this._bolaState.lastSegmentFinishTimeMs)){var t=this._hlsInstance.bufferController.bufferDuration+.001*(this._bolaState.lastSegmentFinishTimeMs-this._bolaState.lastSegmentRequestTimeMs),e=Math.max(0,this._maxBufferLevelForQuality(this._bolaState.lastQuality)-t);this._bolaState.placeholderBuffer=Math.min(e,this._bolaState.placeholderBuffer)}this._bolaState.lastSegmentWasReplacement&&!isNaN(this._bolaState.lastSegmentDurationS)&&(this._bolaState.placeholderBuffer+=this._bolaState.lastSegmentDurationS),this._bolaState.lastSegmentStart=0/0,this._bolaState.lastSegmentRequestTimeMs=0/0}},e.getMaxIndex=function(){this._bolaState||this._initBolaState();var t=this._bolaState;if(t.state===iP.BOLA_STATE_ONE_BITRATE)return -1;var e,i=this._hlsInstance.bufferController.bufferDuration,r=this._throughputHistory.getAverageThroughput(!0),a=this._throughputHistory.getSafeAverageThroughput(!0);if(isNaN(r))return -1;
1switch(t.state){case iP.BOLA_STATE_STARTUP:e=iF(a,this._hlsInstance.levels),t.placeholderBuffer=Math.max(0,this._minBufferLevelForQuality(e)-i),t.lastQuality=e;break;case iP.BOLA_STATE_STEADY:this._updatePlaceholderBuffer(),e=this._getQualityFromBufferLevel(i+t.placeholderBuffer);var n=iF(a,this._hlsInstance.levels);e>t.lastQuality&&e>n&&(e=Math.max(n,t.lastQuality))}return e},e.setup=function(){this._detachListeners(),this._attachListeners(),this._initBolaState()},e.reset=function(){this._detachListeners()},t}();function iq(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)}return i}(iX=iV||(iV={}))[iX.L2A_STATE_ONE_BITRATE=0]="L2A_STATE_ONE_BITRATE",iX[iX.L2A_STATE_STARTUP=1]="L2A_STATE_STARTUP",iX[iX.L2A_STATE_STEADY=2]="L2A_STATE_STEADY";var iX,iz,iQ={w:[],prevW:[],Q:0,segmentDownloadFinishS:0,segmentRequestStartS:0,BTarget:1.5},i$={placeholderBuffer:0,mostAdvancedSegmentStart:0/0,lastSegmentWasReplacement:!1,lastSegmentStart:0/0,lastSegmentDurationS:0/0,lastSegmentRequestTimeMs:0/0,lastSegmentFinishTimeMs:0/0,lastQuality:0},iZ=function(){function t(t,e){this._hlsInstance=void 0,this._l2aState=void 0,this._l2aParams=iQ,this._throughputHistory=void 0,this._hlsInstance=t,this._throughputHistory=e().throughputHistory,this._attachListeners()}var e=t.prototype;return e._attachListeners=function(){this._hlsInstance.on(n.a.PLAYBACK_SEEKING,this._onSeek,this),this._hlsInstance.on(n.a.FRAG_LOADED,this._onFragmentLoaded,this)},e._detachListeners=function(){this._hlsInstance.off(n.a.PLAYBACK_SEEKING,this._onSeek,this),this._hlsInstance.off(n.a.FRAG_LOADED,this._onFragmentLoaded,this)},e._initL2AState=function(){this._l2aState=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?iq(Object(i),!0).forEach(function(e){var r;r=i[e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):iq(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({state:iV.L2A_STATE_STARTUP,bitrates:this._hlsInstance.levels.map(function(t){return t.bitrate/1e3})},i$)},e._initL2AParams=function(){this._l2aParams=iQ},e._getL2AState=function(){return this._l2aState||this._initL2AState(),this._initL2AParams(),this._l2aState},e._onSeek=function(){var t;(null==(t=this._l2aState)?void 0:t.state)!==iV.L2A_STATE_ONE_BITRATE&&this._initL2AState()},e._onFragmentLoaded=function(t,e){if(this._l2aState&&this._l2aState.state!==iV.L2A_STATE_ONE_BITRATE){var i=e.frag.start;isNaN(this._l2aState.mostAdvancedSegmentStart)||i>this._l2aState.mostAdvancedSegmentStart?(this._l2aState.mostAdvancedSegmentStart=i,this._l2aState.lastSegmentWasReplacement=!1):this._l2aState.lastSegmentWasReplacement=!0,this._l2aState.lastSegmentStart=i,this._l2aState.lastSegmentDurationS=e.frag.duration,this._l2aState.lastQuality=e.frag.level,this._l2aState.lastSegmentRequestTimeMs=e.frag.stats.loading.start,this._l2aState.lastSegmentFinishTimeMs=e.frag.stats.loading.end,this._checkNewSegment()}},e._checkNewSegment=function(){!this._l2aState||this._l2aState.state===iV.L2A_STATE_ONE_BITRATE||isNaN(this._l2aState.lastSegmentStart)||isNaN(this._l2aState.lastSegmentRequestTimeMs)||(this._l2aParams.segmentRequestStartS=.001*this._l2aState.lastSegmentRequestTimeMs,this._l2aParams.segmentDownloadFinishS=.001*this._l2aState.lastSegmentFinishTimeMs,this._l2aState.lastSegmentStart=0/0,this._l2aState.lastSegmentRequestTimeMs=0/0)},e._dotMultiply=function(t,e){return t.length!==e.length?-1:t.map(function(i,r){return t[r]*e[r]}).reduce(function(t,e){return t+e})},e._euclideanProjection=function(t){for(var e=t.length,i=t.sort(function(t,e){return e-t}),r=!1,a=0,n=0,s=0;s<e-1;++s)if(a+=i[s],(n=(a-1)/(s+1))>=i[s+1]){r=!0;break}return r||(n=(a+i[e-1]-1)/e),t.map(function(t){return Math.max(t-n,0)})},e.getMaxIndex=function(){var t,e=this,i=this._hlsInstance.levels.map(function(t){return t.bitrate}),r=i.length,a=this._hlsInstance.bufferController.bufferDuration,n=this._throughputHistory.getSafeAverageThroughput(!0),s=(null==(t=this._hlsInstance.bufferController.media)?void 0:t.playbackRate)||1,o=-1,l=this._getL2AState();if(!this._l2aParams||l.state===iV.L2A_STATE_ONE_BITRATE||!n||!i)return -1;switch(l.state){case iV.L2A_STATE_STARTUP:l.lastQuality=o=iF(n,this._hlsInstance.levels),!isNaN(l.lastSegmentDurationS)&&a>=this._l2aParams.BTarget&&(l.state=iV.L2A_STATE_STEADY,this._l2aParams.Q=3.944930817973437,this._l2aParams.prevW=Array(r).fill(0).map(function(t,e){return+(e===l.lastQuality)}));break;case iV.L2A_STATE_STEADY:var u=this._throughputHistory.getLastThroughput(),h=Math.max(Math.round(8*this._throughputHistory.getLastSize()/u),1),d=l.lastSegmentDurationS;this._l2aParams.w=this._euclideanProjection(this._l2aParams.prevW.map(function(t,r){return t+(s*i[r]>h?-1:1)*(l.lastSegmentDurationS/15.779723271893747)*((e._l2aParams.Q+3.944930817973437)*(s*i[r]/h))}));var c=this._l2aParams.w.map(function(t,i){return t-e._l2aParams.prevW[i]});this._l2aParams.prevW=[].concat(this._l2aParams.w),this._l2aParams.Q=Math.max(0,this._l2aParams.Q-d+d*s*((this._dotMultiply(i,this._l2aParams.prevW)+this._dotMultiply(i,c))/h));var f=this._dotMultiply(this._l2aParams.w,i),g=i.map(function(t){return Math.abs(t-f)});(o=g.indexOf(Math.min.apply(Math,g)))>l.lastQuality&&i[l.lastQuality+1]<=h&&(o=l.lastQuality+1),i[o]>=h&&(this._l2aParams.Q=2*Math.max(3.944930817973437,this._l2aParams.Q)),l.lastQuality=o}return o},e.setup=function(){this._detachListeners(),this._initL2AParams(),this._initL2AState(),this._attachListeners()},e.reset=function(){this._detachListeners(),this._initL2AParams(),this._initL2AState()},t}(),iJ=function(){function t(t){this._hlsInstance=void 0,this.levelWasDropped=!1,this.dropReason="",this._ignoreCount=4,this._ignoreEmptyBufferPeriod=3,this._bufferTimeout=void 0,this._hlsInstance=t,this._attachListeners()}var e=t.prototype;return e._attachListeners=function(){this._hlsInstance.on(n.a.BUFFER_EMPTY,this._onBufferEmpty,this),this._hlsInstance.on(n.a.BUFFER_APPENDED,this._onBufferAppended,this),this._hlsInstance.on(n.a.FRAG_LOADED,this._onFragLoaded,this),this._hlsInstance.on(n.a.FRAG_SAFE_TIMEOUT,this._onFragSafeTimeout,this),this._hlsInstance.on(n.a.LEVEL_SWITCHED,this._onLevelSwitched,this)},e._detachListeners=function(){this._hlsInstance.off(n.a.BUFFER_EMPTY,this._onBufferEmpty,this),this._hlsInstance.off(n.a.BUFFER_APPENDED,this._onBufferAppended,this),this._hlsInstance.off(n.a.FRAG_LOADED,this._onFragLoaded,this),this._hlsInstance.off(n.a.FRAG_SAFE_TIMEOUT,this._onFragSafeTimeout,this),this._hlsInstance.off(n.a.LEVEL_SWITCHED,this._onLevelSwitched,this)},e._onLevelSwitched=function(t){},e._forceLevelDecrease=function(t){this.levelWasDropped||0!==this._ignoreCount||(this.dropReason=t,this.levelWasDropped=!0,this._hlsInstance.currentLevel=0)},e._stopLevelForcing=function(){this._bufferTimeout&&self.clearTimeout(this._bufferTimeout),this.levelWasDropped&&(this.levelWasDropped=!1,this._hlsInstance.currentLevel=-1)},e._onBufferEmpty=function(){var t=this;0!==this._hlsInstance.currentLevel&&(this._bufferTimeout=self.setTimeout(function(){t._forceLevelDecrease("Buffer is empty")},this._ignoreEmptyBufferPeriod))},e._onBufferAppended=function(){this._stopLevelForcing()},e._onFragLoaded=function(t,e){var i=e.frag;this._ignoreEmptyBufferPeriod=i.duration/2,this._ignoreCount>0&&this._ignoreCount--,this._stopLevelForcing()},e._onFragSafeTimeout=function(){this._forceLevelDecrease("Fragment loading timeout")},e.getMaxIndex=function(){return -1},e.setup=function(){this._detachListeners(),this._attachListeners()},e.reset=function(){this._detachListeners(),this._bufferTimeout&&self.clearTimeout(this._bufferTimeout)},t}(),i0=function(t,e){if(self){var i=self.open("","ABR Debug","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=340,height=680");self.addEventListener("close",function(){return i.close()}),i.document.head.innerHTML+="<style>\n body {\n font-family: 'Helvetica Neue', Helvetica, sans-serif;\n }\n .rules--row {\n padding: 10px;\n max-width: 250px;\n font-size: 16px;\n font-weight: bold;\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid #dedede;\n }\n .rules--row_active {\n background-color: antiquewhite;\n }",i.document.body.innerHTML='\n <h1>ABR Debug</h1>\n <h3>Applied rules:</h3>\n <div id="rules"></div>\n <h3>Immediate drop level state</h3>\n <div id="immediateState"></div>\n <h3>Immediate drop level reason</h3>\n <div id="immediateReason"></div>\n <h3>Rules result</h3>\n <div id="results"></div>';var r=i.document.getElementById("results"),a=i.document.getElementById("immediateState"),n=i.document.getElementById("immediateReason");i.document.getElementById("rules").innerHTML=Array.from(e.keys()).join(", "),t.on(ra.Events.ABR_LEVELS_UPDATED,function(t,i){var s;return(s=e.get(iD.ABR_STRATEGY_IMMEDIATE_DROP_LEVEL))?(a.innerHTML=s.levelWasDropped?"Dropped":"Auto",n.innerHTML=s.levelWasDropped?s.dropReason:"N/A"):(a.innerHTML="N/A",n.innerHTML="N/A"),r.innerHTML="",void Object.entries(i).forEac
1h(function(t){var e=t[0],a=t[1],n=document.createElement("div");n.classList.add("rules--row"),"summaryLevel"!==e&&a===i.summaryLevel&&n.classList.add("rules--row_active");var s=document.createElement("div");s.innerText=e,n.appendChild(s);var o=document.createElement("div");o.innerText=-1===a?"=":a.toString(),n.appendChild(o),r.appendChild(n)})})}},i1=function(){function t(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=i}var e=t.prototype;return e.sample=function(t,e){var i=Math.pow(this.alpha_,t);this.estimate_=e*(1-i)+i*this.estimate_,this.totalWeight_+=t},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_},t}(),i2=function(){function t(t,e,i){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_
1=new i1(t),this.fast_=new i1(e)}var e=t.prototype;return e.update=function(t,e){var i=this.slow_,r=this.fast_;this.slow_.halfLife!==t&&(this.slow_=new i1(t,i.getEstimate(),i.getTotalWeight())),this.fast_.halfLife!==e&&(this.fast_=new i1(e,r.getEstimate(),r.getTotalWeight()))},e.sample=function(t,e){var i=(t=Math.max(t,this.minDelayMs_))/1e3,r=8*e/i;this.fast_.sample(i,r),this.slow_.sample(i,r)},e.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},e.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.destroy=function(){},t}();function i4(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)}return i}function i5(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?i4(Object(i),!0).forEach(function(e){var r;r=i[e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):i4(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function i3(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i8=((iz={})[iD.ABR_STRATEGY_INSUFFICIENT_BUFFER]=iN,iz[iD.ABR_STRATEGY_THROUGHPUT]=iU,iz[iD.ABR_STRATEGY_SWITCH_REQUEST]=iG,iz[iD.ABR_STRATEGY_DROPPED_FRAMES]=iH,iz[iD.ABR_STRATEGY_BOLA]=iY,iz[iD.ABR_STRATEGY_L2A]=iZ,iz[iD.ABR_STRATEGY_IMMEDIATE_DROP_LEVEL]=iJ,iz),i6=function(){function t(t,e){this._hlsInstance=void 0,this._droppedFramesHistory=void 0,this._throughputHistory=void 0,this._switchRequestHistory=void 0,this._config=void 0,this._nextAutoLevel=3,this._rules=new Map,this._ignoreCount=4,this.bwEstimator=void 0,this._hlsInstance=t,this._config=e,this._droppedFramesHistory=new ix,this._throughputHistory=new iM(this._hlsInstance,this._config),this._switchRequestHistory=new iB,this._populateRules(),this._attachListeners(),self&&e.debug&&(self.showAbrDebugWindow=this.debug.bind(this)),this.bwEstimator=new i2(t.config.abrEwmaSlowVoD,t.config.abrEwmaFastVoD,t.config.abrEwmaDefaultEstimate)}var e,i,r=t.prototype;return r.onLevelLoaded=function(t,e){var i=performance.now()-e.stats.loading.start;this.bwEstimator.sample(i,e.stats.loaded);var r=this._hlsInstance.config;e.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},r._attachListeners=function(){this._hlsInstance.on(n.a.FRAG_LOADED,this._onFragLoaded,this),this._hlsInstance.on(n.a.LEVEL_LOADED,this.onLevelLoaded,this)},r._detachListeners=function(){this._hlsInstance.off(n.a.FRAG_LOADED,this._onFragLoaded,this),this._hlsInstance.off(n.a.LEVEL_LOADED,this.onLevelLoaded,this)},r._populateRules=function(){var t=this;Object.entries(i8).filter(function(e){var i=e[0];return t._config.strategies.includes(i)}).forEach(function(e){var i=e[0],r=e[1];t._rules.set(i,new r(t._hlsInstance,t.getContext.bind(t)))})},r.getContext=function(){return{droppedFramesHistory:this._droppedFramesHistory,throughputHistory:this._throughputHistory,switchRequestHistory:this._switchRequestHistory}},r.clearTimer=function(){}
1,r.destroy=function(){this._rules.forEach(function(t){return t.reset()}),this._detachListeners()},r.debug=function(){i0(this._hlsInstance,this._rules)},r._getRulesResults=function(){var t={};return this._rules.forEach(function(e,i){t[i]=e.getMaxIndex()}),t},r._onFragLoaded=function(){this._ignoreCount>0&&this._ignoreCount--},i=[{key:"AverageCalculationMethods",get:function(){return iR}},{key:"AbrStrategies",get:function(){return iD}}],e=[{key:"nextAutoLevel",get:function(){var t=this._getRulesResults(),e=Object.values(t).filter(function(t){return t>-1});if(0===e.length)return this._nextAutoLevel;var i=Math.min.apply(Math,e);return this._hlsInstance.trigger(n.a.ABR_LEVELS_UPDATED,i5(i5({},t),{},{summaryLevel:i})),i!==this._hlsInstance.currentLevel&&this._switchRequestHistory.push({oldValue:this._hlsInstance.currentLevel,newValue:i}),i||this._nextAutoLevel},set:function(t){this._nextAutoLevel=t}}],i3(t.prototype,e),i&&i3(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}();function i9(){return(i9=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}function i7(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)}return i}function rt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?i7(Object(i),!0).forEach(function(e){var r;r=i[e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):i7(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var re={debug:!1,useDeadTimeLatency:!0,cacheLoadThreshold:50,averageCalculationMethod:iR.EWMA,bandwidthSafetyFactor:.9,strategies:[iD.ABR_STRATEGY_INSUFFICIENT_BUFFER,iD.ABR_STRATEGY_THROUGHPUT,iD.ABR_STRATEGY_SWITCH_REQUEST,iD.ABR_STRATEGY_DROPPED_FRAMES]},ri=rt(rt({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:ig,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:function(t){return new i6(t,re)},bufferController:ed,capLevelController:e3,fpsController:e8,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:e6,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},{cueHandler:{newCue:function(t,e,i,r){for(var a,n,s,o,l,u=[],h=self.VTTCue||self.TextTrackCue,d=0;d<r.rows.length;d++)if(s=!0,o=0,l="",!(a=r.rows[d]).isEmpty()){for(var c=0;c<a.chars.length;c++)iI.test(a.chars[c].uchar)&&s?o++:(l+=a.chars[c].uchar,s=!1);a.cueStartTime=e,e===i&&(i+=1e-4),o>=16?o--:o++;var f=eN(l.trim()),g=eV(e,i,f);t&&t.cues&&t.cues.getCueById(g)||((n=new h(e,i,f)).id=g,n.line=d+1,n.align="left",n.position=10+Math.min(80,10*Math.floor(8*o/32)),u.push(n))}return t&&u.length&&(u.sort(function(t,e){return"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line}),u.forEach(function(e){return w(t,e)})),u}},enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:t9,subtitleTrackController:ei,timelineController:e1,audioStreamController:t2,audioTrackController:t3,emeController:ir,cmcdController:ih});function rr(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ra=function(){function t(e){void 0===e&&(e={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new tY.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var i,r=this.config=function(t,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==e.liveMaxLatencyDurationCount&&(void 0===e.liveSyncDurationCount||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(void 0===e.liveSyncDuration||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return i9({},t,e)}(t.DefaultConfig,e);this.userConfig=e,Object(o.a)(r.debug),this._autoLevelCapping=-1,r.progressive&&((i=r.loader)!==iE&&i!==ig?(o.b.log("[config]: Custom loader detected, cannot enable progressive streaming"),r.progressive=!1):function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}
vendor: 7,188 bytes, line 1
1()&&(r.loader=iE,r.progressive=!0,r.enableSoftwareAES=!0,o.b.log("[config]: Progressive streaming enabled, using FetchLoader")));var a=r.abrController,n=r.bufferController,s=r.capLevelController,l=r.fpsController,u=this.abrController=a(this),h=this.bufferController=new n(this),d=this.capLevelController=new s(this),c=new l(this),f=new I(this),g=new O(this),v=new F(this),p=this.levelController=new ti(this),m=new tr(this),y=this.streamController=new tZ(this,m);d.setStreamController(y),c.setStreamController(y);var T=[p,y];this.networkControllers=T;var E=[f,g,u,h,d,c,v,m];this.audioTrackController=this.createController(r.audioTrackController,null,T),this.createController(r.audioStreamController,m,T),this.subtitleTrackController=this.createController(r.subtitleTrackController,null,T),this.createController(r.subtitleStreamController,m,T),this.createController(r.timelineController,null,E),this.emeController=this.createController(r.emeController,null,E),this.cmcdController=this.createController(r.cmcdController,null,E),this.latencyController=this.createController(B,null,E),this.coreComponents=E}t.isSupported=function(){var t=tj();if(!t)return!1;var e=tK(),i=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove;return!!i&&!!r};var e,i,a=t.prototype;return a.createController=function(t,e,i){if(t){var r=e?new t(this,e):new t(this);return i&&i.push(r),r}return null},a.on=function(t,e,i){void 0===i&&(i=this),this._emitter.on(t,e,i)},a.once=function(t,e,i){void 0===i&&(i=this),this._emitter.once(t,e,i)},a.removeAllListeners=function(t){this._emitter.removeAllListeners(t)},a.off=function(t,e,i,r){void 0===i&&(i=this),this._emitter.off(t,e,i,r)},a.listeners=function(t){return this._emitter.listeners(t)},a.emit=function(t,e,i){return this._emitter.emit(t,e,i)},a.trigger=function(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(e){o.b.error("An internal error happened while handling event "+t+'. Error message: "'+e.message+'". Here is a stacktrace:',e),this.trigger(n.a.ERROR,{type:s.b.OTHER_ERROR,details:s.a.INTERNAL_EXCEPTION,fatal:!1,event:t,error:e})}return!1},a.listenerCount=function(t){return this._emitter.listenerCount(t)},a.destroy=function(){o.b.log("destroy"),this.trigger(n.a.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(t){return t.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(t){return t.destroy()}),this.coreComponents.length=0},a.attachMedia=function(t){o.b.log("attachMedia"),this._media=t,this.trigger(n.a.MEDIA_ATTACHING,{media:t})},a.detachMedia=function(){o.b.log("detachMedia"),this.trigger(n.a.MEDIA_DETACHING,void 0),this._media=null},a.loadSource=function(t){this.stopLoad();var e=this.media,i=this.url,a=this.url=r.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});o.b.log("loadSource:"+a),e&&i&&i!==a&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(e)),this.trigger(n.a.MANIFEST_LOADING,{url:t})},a.startLoad=function(t){void 0===t&&(t=-1),o.b.log("startLoad("+t+")"),this.networkControllers.forEach(function(e){e.startLoad(t)})},a.stopLoad=function(){o.b.log("stopLoad"),this.networkControllers.forEach(function(t){t.stopLoad()})},a.swapAudioCodec=function(){o.b.log("swapAudioCodec"),this.streamController.swapAudioCodec()},a.recoverMediaError=function(){o.b.log("recoverMediaError");var t=this._media;this.detachMedia(),t&&this.attachMedia(t)},a.removeLevel=function(t,e){void 0===e&&(e=0),this.levelController.removeLevel(t,e)},i=[{key:"version",get:function(){}},{key:"Events",get:function(){return n.a}},{key:"AbrAdapter",get:function(){return i6}},{key:"ErrorTypes",get:function(){return s.b}},{key:"ErrorDetails",get:function(){return s.a}},{key:"DefaultConfig",get:function(){return t.defaultConfig?t.defaultConfig:ri},set:function(e){t.defaultConfig=e}}],e=[{key:"levels",get:function(){return this.levelController.levels||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(t){o.b.log("set currentLevel:"+t),this.loadLevel=t,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(t){o.b.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){o.b.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){o.b.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){o.b.log("set startLevel:"+t),-1!==t&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(t){var e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(t){this._autoLevelCapping!==t&&(o.b.log("set autoLevelCapping:"+t),this._autoLevelCapping=t)}},{key:"bandwidthEstimate",get:function(){var t=this.abrController.bwEstimator;return t?t.getEstimate():0/0}},{key:"autoLevelEnabled",get:function(){return -1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var t=this.levels,e=this.config.minAutoBitrate;if(!t)return 0;for(var i=t.length,r=0;r<i;r++)if(t[r].maxBitrate>e)return r;return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,e=this.autoLevelCapping;return -1===e&&t&&t.length?t.length-1:e}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay}
1,set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(t){this.config.lowLatencyMode=t}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],rr(t.prototype,e),i&&rr(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}();ra.defaultConfig=void 0}]).default)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.