importwindow$1from"global/window";importdocumentfrom"global/document";import_extendsfrom"@babel/runtime/helpers/extends";importkeycodefrom"keycode";import_assertThisInitializedfrom"@babel/runtime/helpers/assertThisInitialized";import_inheritsLoosefrom"@babel/runtime/helpers/inheritsLoose";importsafeParseTuplefrom"safe-json-parse/tuple";importXHRfrom"@videojs/xhr";importvttfrom"videojs-vtt.js";import_constructfrom"@babel/runtime/helpers/construct";import_inheritsfrom"@babel/runtime/helpers/inherits";import_resolveUrlfrom"@videojs/vhs-utils/es/resolve-url.js";import{Parser}from"m3u8-parser";import{browserSupportsCodec,DEFAULT_VIDEO_CODEC,DEFAULT_AUDIO_CODEC,muxerSupportsCodec,parseCodecs,translateLegacyCodec,codecsFromDefault,getMimeForCodec,isAudioCodec}from"@videojs/vhs-utils/es/codecs.js";import{simpleTypeFromSourceType}from"@videojs/vhs-utils/es/media-types.js";import{isArrayBufferView,concatTypedArrays,stringToBytes,toUint8}from"@videojs/vhs-utils/es/byte-helpers";import{generateSidxKey,parseUTCTiming,parse,addSidxSegmentsToPlaylist}from"mpd-parser";importparseSidxfrom"mux.js/lib/tools/parse-sidx";import{getId3Offset}from"@videojs/vhs-utils/es/id3-helpers";import{detectContainerForBytes,isLikelyFmp4MediaSegment}from"@videojs/vhs-utils/es/containers";import{ONE_SECOND_IN_TS}from"mux.js/lib/utils/clock";for(varbrowserApi,version$5="7.20.2",hooks_={},hooks=function(e,t){returnhooks_[e]=hooks_[e]||[],t&&(hooks_[e]=hooks_[e].concat(t)),hooks_[e]},hook=function(e,t){hooks(e,t)},removeHook=function(e,t){vari=hooks(e).indexOf(t);return!(i<=-1||(hooks_[e]=hooks_[e].slice(),hooks_[e].splice(i,1),0))},hookOnce=function(e,t){hooks(e,[].concat(t).map(function(t){returnfunctioni(){returnremoveHook(e,i),t.apply(void0,arguments)}}))},FullscreenApi={prefixed:!0},apiMap=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],specApi=apiMap[0],i=0;i<apiMap.length;i++)if(apiMap[i][1]indocument){browserApi=apiMap[i];break}if(browserApi){for(var_i=0;_i<browserApi.length;_i++)FullscreenApi[specApi[_i]]=browserApi[_i];FullscreenApi.prefixed=browserApi[0]!==specApi[0]}varhistory=[],LogByTypeFactory=function(e,t){returnfunction(i,n,r){vars=t.levels[n],a=newRegExp("^("+s+")$");if("log"!==i&&r.unshift(i.toUpperCase()+":"),r.unshift(e+":"),history){history.push([].concat(r));varo=history.length-1e3;history.splice(0,o>0?o:0)}if(window$1.console){varl=window$1.console[i];l||"debug"!==i||(l=window$1.console.info||window$1.console.log),l&&s&&a.test(i)&&l[Array.isArray(r)?"apply":"call"](window$1.console,r)}}};functioncreateLogger$1(e){vart,i="info",n=function(){for(vare=arguments.length,n=newArray(e),r=0;r<e;r++)n[r]=arguments[r];t("log",i,n)};returnt=LogByTypeFactory(e,n),n.createLogger=function(t){returncreateLogger$1(e+": "+t)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},n.level=function(e){if("string"==typeofe){if(!n.levels.hasOwnProperty(e))thrownewError('"'+e+'" in not a valid log level');i=e}returni},(n.history=function(){returnhistory?[].concat(history):[]}).filter=function(e){return(history||[]).filter(function(t){returnnewRegExp(".*"+e+".*").test(t[0])})},n.history.clear=function(){history&&(history.length=0)},n.history.disable=function(){null!==history&&(history.length=0,history=null)},n.history.enable=function(){null===history&&(history=[])},n.error=function(){for(vare=arguments.length,n=newArray(e),r=0;r<e;r++)n[r]=arguments[r];returnt("error",i,n)},