key:"stopBeaconPolling",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0]
if(this._isPolling){this._isPolling=!1
this._currentBeaconInterval=null
e&&this._fireBeaconEvent()
this._lastBeaconTime=null}}},{key:"checkBeaconProgress",value:function(){this._currentTime=this.player.currentTime()
if((this._currentTime-(this._lastBeaconTime||0))/this._playbackRate*1e3>=this._currentBeaconInterval){this._fireBeaconEvent()
this._currentBeaconInterval=jg[jg.indexOf(this._currentBeaconInterval)+1]||jg[jg.length-1]}}},{key:"dispose",value:function(){this.stopBeaconPolling()
this._isStalled&&this._endStall()
v(h(n.prototype),"dispose",this).call(this)}},{key:"setIsCcVisible",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0]
this._isCcVisible=e?Ig:Pg}},{key:"_resetFirstAskToPlay",value:function(){this._firstAskToPlayTime=null
this.off(this.player,"play",this._onFirstPlayOfSource)
this.one(this.player,"play",this._onFirstPlayOfSource)}},{key:"_resetHlsStateProperties",value:function(){this._multivariantPlaylistDetails={}
this._mediaPlaylistDetails={}
this._firstSegmentDetails={}}},{key:"_onPlayerReset",value:function(){this._playReason=null
this._pauseReason=null
this._staticMediaHeader=null
this._currentTime=0
this._isStalled&&this._endStall()
this._hasRenderedFirstFrame=!1
this._resetFirstAskToPlay()
this._resetHlsStateProperties()}},{key:"_onSegmentMetadataChange",value:function(){this._setSegmentMetadata()}},{key:"_setSegmentMetadata",value:function(){var e=this._metadataTrack&&this._metadataTrack.activeCues[0]
if(e&&e.value){var t=this.player.tech().vhs.representations().find((function(t){return t.id===e.value.playlist}))
this._currentPlaylist=t&&t.playlist&&t.playlist.resolvedUri}}},{key:"_onLoadedMetadata",value:function(){this._metadataTrack=this.player.textTracks().tracks_.find((function(e){return"segment-metadata"===e.label}))
if(this._metadataTrack){this._setSegmentMetadata()
this.on(this._metadataTrack,"cuechange",this._onSegmentMetadataChange)}}},{key:"_onLoadStart",value:function(){this._getMediaHeader()}},{key:"_onFirstPlayOfSource",value:function(){this._firstAskToPlayTime=Dm()
this._triggerFetchedEventsIfNecessary()}},{key:"_onPlay",value:function(){this._isPlaying=!0
this._volume=this._getVolume()
this._trigger(vg.PLAYER_PLAY_PAUSE_EVENT,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),reason:this._playReason||yg.USER_TRIGGERED,state:this.getPlayerState(),createdTime:Date.now()})
this._trigger(vg.PLAYER_ASK_TO_PLAY_EVENT,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),reason:(e=this._playReason,_g[e]||_g.AUTO_TRIGGERED),createdTime:Date.now()})
var e
this._playReason=null}},{key:"_onPlaying",value:function(){this._isPlaying=!0
this._playbackRate=this.player.playbackRate()
this._hasRenderedFirstFrame=!0
this._isStalled&&this._endStall()
this._isPolling||this.startBeaconPolling()}},{key:"_onError",value:function(){this._firePlaybackExitEvent(bg)
this._isStalled&&this._endStall()}},{key:"_onPause",value:function(){this._isPlaying=!1
this._trigger(vg.PLAYER_PLAY_PAUSE_EVENT,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),reason:this._pauseReason||yg.USER_TRIGGERED,state:this.getPlayerState(),createdTime:Date.now()})
this._firePlaybackExitEvent(this._getPlaybackExitState())
this._isStalled&&this._endStall()
this._pauseReason=null
this.stopBeaconPolling()}},{key:"_endStall",value:function(){this._isStalled=!1
this._firePlaybackStallEvent(Cg)}},{key:"_firePlaybackExitEvent",value:function(e){this._trigger(vg.PLAYER_PLAYBACK_EXIT_EVENT,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),state:e||Eg,createdTime:Date.now()})}},{key:"_firePlaybackStallEvent",value:function(e){this._trigger(vg.PLAYER_PLAYBACK_STALL_EVENT,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),playerState:this.getPlayerState(),stallState:e,createdTime:Date.now()})}},{key:"_onWaiting",value:function(){this._isPlaying=!1
if(!this._isStalled&&this._hasRenderedFirstFrame&&!this._isSeeking){this._isStalled=!0
this._firePlaybackStallEvent(wg)}this.stopBeaconPolling()}},{key:"_onSourceSet",value:function(){this._isPlaying=!1
this.stopBeaconPolling()
this._hasRenderedFirstFrame=!1
this._resetFirstAskToPlay()
this._resetHlsStateProperties()
this._isStalled&&this._endStall()}},{key:"_onVolumeChange",value:function(){var e=this._volume
this.restartBeaconPolling()
this._volume=this._getVolume()
this._trigger(vg.PLAYER_VOLUME_CHANGED_EVENT,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),state:this.getPlayerState(),createdTime:Date.now(),previousVolume:e})}},{key:"_onFullscreenChange",value:function(){this.restartBeaconPolling()
this._fullscreenState=this._getFullScreenState()}},{key:"_onRateChange",value:function(){this.restartBeaconPolling()
this._playbackRate=this.player.playbackRate()}},{key:"_onSeeking",value:function(){this._isSeeking=!0
this._isStalled&&this._endStall()}},{key:"_onTimeupdate",value:function(){this._isSeeking||this.player.seeking()||(this._previousTimeElapsed=this.player.currentTime())
this.player.seeking()||this.player.paused()||!this._isPolling||this.checkBeaconProgress()}},{key:"_onSeeked",value:function(){this._trigger(vg.PLAYER_SEEK_EVENT,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),previousTimeElapsed:this._previousTimeElapsed,state:this.getPlayerState(),createdTime:Date.now()})
this._isSeeking=!1}},{key:"_onPlayerInteraction",value:function(e,t){var i=t.controlId
this._userInteracted=!0
Ag[i]&&this.restartBeaconPolling()}},{key:"_onUnload",value:function(){this.stopBeaconPolling()}},{key:"_onVisibilityChange",value:function(e,t){var i=t.isVisible
this.restartBeaconPolling()
this._isVisible=i}},{key:"_persistXhrResponseDetails",value:function(e){var t=e.vhsPlaylistLoader,n=e.xhr,r=e.performanceStartTime,a=e.performanceEndTime,s=e.responseSource,o=new URL(n.uri,window.location).href,u={fileSize:n.bytesReceived,performanceStartTime:r,performanceEndTime:a,responseSource:s},l=t.master
l&&[{details:this._multivariantPlaylistDetails,doesXhrMatch:function(){return l.uri===o}},{details:this._mediaPlaylistDetails,doesXhrMatch:function(){var e
return(null===(e=t.media())||void 0===e?void 0:e.resolvedUri)===o}},{details:this._firstSegmentDetails,doesXhrMatch:function(){var e
return null===(e=t.media())||void 0===e?void 0:e.segments.find((function(e){return e.resolvedUri===o}))}}].forEach((function(e){var t=e.details,a=e.doesXhrMatch
!t.performanceEndTime&&a()&&(n.aborted||n.status<200||n.status>299?t.performanceStartTime=t.performanceStartTime||r:Object.assign(t,i(i({},u),{},{performanceStartTime:t.performanceStartTime||r})))}))}},{key:"_triggerFetchedEventsIfNecessary",value:function(){var e=this
this._isFetchRequestFiringEnabled&&this._firstAskToPlayTime&&[{details:this._multivariantPlaylistDetails,eventName:vg.MULTIVARIANT_PLAYLIST_FETCHED_EVENT},{details:this._mediaPlaylistDetails,eventName:vg.MEDIA_PLAYLIST_FETCHED_EVENT},{details:this._firstSegmentDetails,eventName:vg.SEGMENT_FETCHED_EVENT}].forEach((function(t){var n=t.details,r=t.eventName
if(n.performanceEndTime&&!n.hasTriggeredFetchedEvent){var a,s,o,u,l,c,d,h,p,f,m=(a=i(i({},n),{},{firstAskToPlayTime:e._firstAskToPlayTime}),s=a.fileSize,o=a.performanceStartTime,u=a.performanceEndTime,l=a.responseSource,c=a.firstAskToPlayTime,h=(d=u<=c||l===Og||l===Lg)||l===Mg?null:l===Dg,p=u-o,f=function(e){var t,i,n,r,a=e.firstAskToPlayTime,s=e.performanceStartTime,o=e.performanceEndTime
return o<=a?0:(i=(t={time:a,startTime:s,endTime:o}).time,n=t.startTime,r=t.endTime,i&&i>n&&i<r?o-a:o-s)}({firstAskToPlayTime:c,performanceStartTime:o,performanceEndTime:u}),{fileSize:s,fetchDuration:p,perceivedFetchDuration:f,wasPreloaded:d,wasCdnCacheHit:h})
e._trigger(r,{mediaTrackingObject:e._mediaTrackingObject,mediaHeader:e._getMediaHeader(),playerState:e.getPlayerState(),mediaFetchObject:m})
n.hasTriggeredFetchedEvent=!0}}))}},{key:"_getVhsPlaylistLoader",value:function(){var e=this.player.tech(!0).vhs
return null==e?void 0:e.playlists}},{key:"_onXhrResponse",value:function(e,t){var i=t.xhr,n=t.performanceStartTime,r=t.performanceEndTime,a=t.responseSource,s=this._getVhsPlaylistLoader()
if(s&&!this._firstSegmentDetails.performanceEndTime){this._persistXhrResponseDetails({vhsPlaylistLoader:s,xhr:i,performanceStartTime:n,performanceEndTime:r,responseSource:a})
this._triggerFetchedEventsIfNecessary()}}},{key:"_runBeaconInterval",value:function(e){var t=this,i=this.getPlayerState().timeElapsed
if(i===this._beaconTimeElapsed&&e>0)this.stopBeaconPolling(!1)
else{this._beaconTimeElapsed=i
var n=jg[jg.indexOf(e)+1]||jg[jg.length-1]
this._fireBeaconEvent()
this._beaconPoll=this.player.setTimeout((function(){return t._runBeaconInterval(n)}),n)}}},{key:"_cancelBeaconInterval",value:function(){if(this._beaconPoll){this.player.clearTimeout(this._beaconPoll)
this._beaconPoll=null}}},{key:"_fireBeaconEvent",value:function(){var e,t=nm(this._lastBeaconTime)?this._lastBeaconTime:this._currentTime
e=Math.round((this._currentTime-t)/this._playbackRate*1e3)
this._lastBeaconTime=this._currentTime
this._trigger(vg.PLAYER_BEACON_EVENT,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),isAutoplaying:this._isAutoplaying(),timeSinceLastBeacon:e,state:this.getPlayerState(),createdTime:Date.now()})}},{key:"_isAutoplaying",value:function(){return!this._userInteracted&&!!this.player.autoplay()}},{key:"_getFullScreenState",value:function(){return this.player.isFullscreen()?Ig:Pg}},{key:"_getDuration",value:function(){var e=this.player.duration()
return e&&isFinite(e)?e:0}},{key:"_getVolume",value:function(){return this.player.muted()?0:Math.round(100*this.player.volume())}},{key:"_getMediaHeader",value:function(){this._staticMediaHeader=this._staticMediaHeader||ug(this.player,this.state.mediaHeader)
return og({staticMediaHeader:this._staticMediaHeader,player:this.player,primaryMediaTrackingId:this._primaryMediaTrackingId})}},{key:"_trigger",value:function(e,t,i){this.trigger(e,t)
this.trigger("track",{eventName:e,eventData:t,meta:i})
Lm(this.state,"onTrack",[e,t,i])}}])
return n}(Fg)
ql.registerPlugin("tracking",Vg)
var Hg=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.allowUnmutedBackgroundPlayback,s=void 0!==a&&a,u=r.visibilityChangeDelay,l=void 0===u?1e3:u
o(this,i)
n=t.apply(this,arguments)
fp("playbackAudit: tracking plugin is required",e.hasPlugin("tracking"))
n._isVisible=null
n._checkVisibilityTimer=null
n._allowUnmutedBackgroundPlayback=s
n._visibilityChangeDelay=l
n.on(e,"timeupdate",n._onTimeupdate)
n.on(e,"pause",n._onPause)
n.on(e,"playerreset",n._onPlayerreset)
e.ready((function(){var t=e.playerVisibility()
t.ready((function(){n._isVisible=t.isVisible()
n.on(t,"visibilityChange",n._onVisibilityChange)}))}))
return n}l(i,[{key:"_isMuted",value:function(){return this.player.muted()||0===this.player.volume()}},{key:"_shouldPause",value:function(){return!this._isVisible&&!this.player.paused()&&!this.player.isFullscreen()&&(!this._allowUnmutedBackgroundPlayback||this._isMuted())}},{key:"_clearVisibilityTimer",value:function(){this.player.clearTimeout(this._checkVisibilityTimer)
this._checkVisibilityTimer=null}},{key:"_onVisibilityChange",value:function(e,t){var i=t.isVisible
this._isVisible=i
i&&this._clearVisibilityTimer()}},{key:"_onPlayerreset",value:function(){this._clearVisibilityTimer()}},{key:"_onPause",value:function(){this._clearVisibilityTimer()}},{key:"_onTimeupdate",value:function(){var e=this
!this._checkVisibilityTimer&&this._shouldPause()&&(this._checkVisibilityTimer=this.player.setTimeout((function(){if(e._shouldPause()){e.player.tracking().setPauseReason(yg.DISALLOW_BACKGROUND_PLAYBACK)
e.player.pause()}e._clearVisibilityTimer()}),this._visibilityChangeDelay))}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("playbackAudit",Hg)
var qg=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).onInteract
o(this,i);(n=t.apply(this,arguments))._registeredControls={}
n.setState({onInteract:r})
e.ready((function(){n._attachControlEventListeners()}))
return n}l(i,[{key:"registerControl",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
fp("playerInteraction: A valid control el must be supplied to the `registerControl` method",e)
fp("playerInteraction: A controlId must be supplied to the `registerControl` method",t)
this._registeredControls[t]||(this._registeredControls[t]=sg({el:e},i))}},{key:"unregisterControl",value:function(e){delete this._registeredControls[e]}},{key:"_attachControlEventListeners",value:function(){this.on(this.player,["click"],this._onInteraction)
var e=this.player.getDescendant("controlBar","volumePanel","volumeControl"),t=this.player.getDescendant("controlBar","progressControl","seekBar"),i=this.player.getDescendant("controlBar","captionsMenuToggle")
e&&this.on(e,["mouseup"],this._onInteraction)
t&&this.on(t,["click"],this._onInteraction)
i&&this.on(i,["captionMenuItemSelected"],this._onCaptionsMenuItemSelected)}},{key:"_onCaptionsMenuItemSelected",value:function(e,t){var i,n=t.el()
n.matches($p)||n.matches(Jp)?i=gf:n.matches(Zp)&&(i=vf)
this._triggerInteract(i)}},{key:"_onInteraction",value:function(e){var t=this._getControlId(e)
t&&this._triggerInteract(t,{isUserInitiated:e.isTrusted})}},{key:"_getControlId",value:function(e){var t=this,i=e.target,n=e.currentTarget
return i.matches(Kp)?this.player.muted()?uf:lf:i.matches(Xp)?this.player.isFullscreen()?pf:hf:i.matches(Hp)?af:i.matches(qp)?sf:i.matches(Wp)?of:i.matches(Yp)?ff:i.matches(Qp)?mf:i.matches(zp)?cf:i.matches(Gp)?df:i.matches(nf)?bf:n.matches(ef)?yf:n.matches(tf)?_f:i.matches(rf)?Tf:Object.keys(this._registeredControls).find((function(e){var n=t._registeredControls[e]
return i===n.el}))}},{key:"_triggerInteract",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
this.trigger("interact",{controlId:e,meta:t})
Lm(this.state,"onInteract",[e,t])}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("playerInteraction",qg)
var Wg=function(e){d(i,e)
var t=g(i)
function i(e){var n
o(this,i);(n=t.apply(this,arguments))._background=e.addChild("PosterBackground")
n.on(e,"sourceset",n._onSourceSet)
return n}l(i,[{key:"_onSourceSet",value:function(){var e=this.player.tech().el()
this.player.el().insertBefore(this._background.el(),e)}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("posterBackground",Wg)
var Gg=ql.getComponent("ModalDialog"),zg=ql.mergeOptions,Kg="vjs-screen-active",Xg=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.id,s=r.classNames
o(this,i);(n=t.apply(this,arguments))._player=e
n.addClass("vjs-screen")
a&&n.contentEl().setAttribute("id",a);(s||[]).forEach((function(e){n.setAttribute("class",e)}))
n.fill()
n.on("modalopen",n._onOpen)
n.on("modalclose",n._onClose)
return n}l(i,[{key:"_onOpen",value:function(){this._player.addClass(Kg)
this.trigger("show")}},{key:"_onClose",value:function(){this._player.removeClass(Kg)
this.trigger("hide")}}])
return i}(Gg)
Xg.prototype.options_=zg(Gg.prototype.options_,{uncloseable:!0,pauseOnOpen:!0,temporary:!1})
ql.registerComponent("Screen",Xg)
var Yg=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
o(this,i);(n=t.apply(this,arguments))._player=e
n._options=r
n.screen=n._createScreen()
n.on(n._player,"play",n._onPlay)
n.on(n._player,"sourceset",n._onSourceset)
n.on("dispose",n._onDispose)
n._player.ready((function(){n.screen&&n.screen.open()}))
return n}l(i,[{key:"_createScreen",value:function(){var e=this,t=new Xg(this._player,this._options)
t.content()
t.addClass("vjs-start-screen")
t.on(["show","hide"],(function(t){e.trigger(t.type,{screen:e.screen})}))
this._player.addChild(t)
return t}},{key:"_onPlay",value:function(){this.screen.close()}},{key:"_onSourceset",value:function(){this.screen.open()}},{key:"_onDispose",value:function(){this._player.removeChild(this.screen)
this.screen=null}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("startScreen",Yg)
var Qg=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
o(this,i);(n=t.apply(this,arguments))._player=e
n.screen=n._createScreen(r)
n.on(n._player,"ended",n._onEnded)
n.on(n._player,"play",n._onPlay)
n.on(n._player,"sourceset",n._onSourceset)
n.on(n._player,"playerreset",n._onPlayerreset)
n.on("dispose",n._onDispose)
n.enable()
return n}l(i,[{key:"enable",value:function(){this._isEnabled=!0
this._isEnded&&this.screen.open()}},{key:"disable",value:function(){this._isEnabled=!1
this._isEnded&&this.screen.close()}},{key:"enabled",value:function(){return this._isEnabled}},{key:"_createScreen",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.id,n=t.classNames,r=t.closeable,a=void 0===r||r,s=new Xg(this._player,{id:i,classNames:n,uncloseable:!a})
s.addClass("vjs-end-screen")
s.on(["show","hide"],(function(t){e.trigger(t.type,{screen:e.screen})}))
this._player.addChild(s)
return s}},{key:"_onEnded",value:function(){this._isEnded=!0
!this._player.loop()&&this.enabled()&&this.screen.open()}},{key:"_onPlay",value:function(){this._isEnded=!1
this.screen.close()}},{key:"_onSourceset",value:function(){this._isEnded=!1
this.screen.close()}},{key:"_onPlayerreset",value:function(){this._isEnded=!1
this.screen.close()}},{key:"_onDispose",value:function(){this._player.removeChild(this.screen)
this.screen=null}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("endScreen",Qg)
var $g=function(e){d(i,e)
var t=g(i)
function i(e,n){var r
o(this,i);(r=t.apply(this,arguments))._player=e
r._options=n
r.screen=r._createScreen()
r._player.ready((function(){r._disableErrorDisplay()}))
r.on(r._player,"error",r._onError)
r.on(r._player,"play",r._onPlay)
r.on(r._player,"sourceset",r._onSourceset)
r.on(r._player,"playerreset",r._onPlayerreset)
r.on("dispose",r._onDispose)
return r}l(i,[{key:"_createScreen",value:function(){var e=this,t=new Xg(this._player,this._options)
t.addClass("vjs-error-screen")
t.on(["show","hide"],(function(t){e.trigger(t.type,{screen:e.screen,error:e._player.error()})}))
this._player.addChild(t)
return t}},{key:"_disableErrorDisplay",value:function(){var e=this._player.getChild("errorDisplay")
e&&e.dispose()}},{key:"_onError",value:function(){this.screen.open()}},{key:"_onPlay",value:function(){this.screen.close()}},{key:"_onSourceset",value:function(){this.screen.close()}},{key:"_onPlayerreset",value:function(){this.screen.close()}},{key:"_onDispose",value:function(){this._player.removeChild(this.screen)
this.screen=null}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("errorScreen",$g)
var Jg=ql.getComponent("Component"),Zg=function(e){d(i,e)
var t=g(i)
function i(e,n){var r
o(this,i);(r=t.call(this,e,n))._player=e
return r}l(i,[{key:"createControl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new Jg(this._player)
e.id&&t.setAttribute("id",e.id)
e.className&&t.setAttribute("class",e.className)
t.addClass("vjs-control")
return this._player.getChild("controlBar").addChild(t,{},e.index)}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("customControl",Zg)
var ev="video_toolbar_mute_unmute",tv="video_toolbar_fullscreen_toggle",iv="video_toolbar_closed_caption_toggle",nv={PLAY_CONTROL:"video_toolbar_play_pause",PAUSE_CONTROL:"video_toolbar_play_pause",REPLAY_CONTROL:"video_toolbar_replay",MUTE_CONTROL:ev,UNMUTE_CONTROL:ev,FULLSCREEN_CONTROL:tv,UNFULLSCREEN_CONTROL:tv,PROGRESS_SCRUBBER_CONTROL:"video_toolbar_scrubber",VOLUME_SLIDER_CONTROL:"video_toolbar_volume_slider",BACK_TO_START_CONTROL:"video_toolbar_back_to_start",THEATER_MODE_CONTROL:"video_toolbar_theater_mode",PLAY_OVERLAY_CONTROL:"video_thumbnail_play",POSTER_CONTROL:"video_thumbnail_play",CAPTIONS_ON_CONTROL:iv,CAPTIONS_OFF_CONTROL:iv,MENU_CAPTIONS_ON_CONTROL:iv,MENU_CAPTIONS_OFF_CONTROL:iv,PLAYBACK_RATE_CONTROL:"video_settings_playback_speed",SKIP_BACK_CONTROL:"video_skip_back",SKIP_AHEAD_CONTROL:"video_skip_ahead"},rv="SHORT_PRESS",av="DRAG",sv="SWIPE_RIGHT",ov="SWIPE_LEFT",uv=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).onTrack
o(this,i);(n=t.apply(this,arguments)).setState({onTrack:r})
fp("control-interaction: playerInteraction plugin is required",e.hasPlugin("playerInteraction"))
n.on(e.playerInteraction(),"interact",n._onPlayerInteraction)
n.on(e,"volumechange",n._onVolumechange)
return n}l(i,[{key:"_onPlayerInteraction",value:function(e,t){var i=t.controlId,n=nv[i]
mp("media-player: control-interaction: controlId ".concat(i," was registered with the playerInteraction plugin but no associated control name was found."),n)
if(n){var r,a={controlName:n}
i===_f?r=this._previousVolume<this._currentVolume?sv:ov:i===yf&&(r=av)
r&&(a.eventInfo={interactionType:r})
this.fireControlInteractionEvent(a)}}},{key:"_onVolumechange",value:function(){var e=this.player.volume()
this._previousVolume=Number.isNaN(this._currentVolume)?e:this._currentVolume
this._currentVolume=e}},{key:"fireControlInteractionEvent",value:function(e){var t=e.controlName,i=e.eventInfo,n=(void 0===i?{}:i).interactionType||rv
fp("controlInteraction: controlName must be a property on eventData",t)
this.trigger("track",e)
Lm(this.state,"onTrack",[t,n])}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("controlInteraction",uv)
var lv=ql.getPlugin("plugin"),cv=ql.mergeOptions,dv={namespace:void 0,disableCaching:void 0},hv="media-player-prefs",pv="rate",fv="volume",mv="muted",gv=function(e){d(i,e)
var t=g(i)
function i(e,n){var r
o(this,i)
r=t.apply(this,arguments)
var a=cv(dv,n).namespace
r._disableCaching=n.disableCaching
r._key=a?"".concat(a,":").concat(hv):hv
r.one(r.player,"loadstart",r._onLoadStart)
r.player.ready((function(){r.on(r.player,"ratechange",r._onRatechange)
r.on(r.player,"volumechange",r._onVolumechange)}))
return r}l(i,[{key:"set",value:function(e,t){if(!this._cache||this._cache[e]!==t){var i=cv(this._cache,c({},e,t))
try{this.localStorage.setItem(this._key,JSON.stringify(i))}catch(e){}this._cache=i}}},{key:"save",value:function(e){try{this.localStorage.setItem(this._key,JSON.stringify(e))}catch(e){}}},{key:"get",value:function(e){if(this._cache&&!this._disableCaching)return this._cache[e]
try{var t=this.localStorage.getItem(this._key)
this._cache=t?JSON.parse(t):{}}catch(e){this._cache={}}return this._cache[e]}},{key:"_onLoadStart",value:function(){this._setInitialRate()
this._setInitialVolume()}},{key:"_onRatechange",value:function(){this.player.isResetting()||this.set(pv,this.player.playbackRate())}},{key:"_onVolumechange",value:function(){if(!this.player.isResetting()){this.set(mv,this.player.muted())
this.set(fv,this.player.volume())}}},{key:"_setInitialVolume",value:function(){var e=this.get(fv),t=this.get(mv)
nm(e)&&this.player.volume(e)
nm(t)&&!nm(this.player.options_.muted)&&this.player.muted(t)}},{key:"_setInitialRate",value:function(){var e=this.get(pv),t=this.player.getChild("controlBar").getChild("playbackRateMenuButton")
if(e&&t&&t.playbackRates().indexOf(e)>-1){this.player.defaultPlaybackRate(e)
this.player.playbackRate(e)}}}])
return i}(lv)
if(S)try{gv.prototype.localStorage=window.localStorage}catch(A_){}ql.registerPlugin("userPreferences",gv)
var vv=function(e){d(i,e)
var t=g(i)
function i(e){var n
o(this,i);(n=t.apply(this,arguments)).on(e,"play",n._onPlay)
n.on(e,"pause",n._onPause)
n.on(e,"ended",n._onEnded)
return n}l(i,[{key:"_onPlay",value:function(){this.setText("Pause tooltip")}},{key:"_onPause",value:function(){this.setText("Play tooltip")}},{key:"_onEnded",value:function(){this.setText("Replay tooltip")}}],[{key:"getDefaultText",value:function(){return"Play tooltip"}}])
return i}(Wf)
ql.registerComponent("PlayToggleTooltip",vv)
var yv=function(e){d(i,e)
var t=g(i)
function i(e){var n
o(this,i);(n=t.apply(this,arguments)).on(e,"fullscreenchange",n._onFullscreenchange)
return n}l(i,[{key:"_onFullscreenchange",value:function(){this.player.isFullscreen()?this.setText("Exit fullscreen tooltip"):this.setText("Fullscreen tooltip")}}],[{key:"getDefaultText",value:function(){return"Fullscreen tooltip"}}])
return i}(Wf)
ql.registerComponent("FullscreenToggleTooltip",yv)
var _v=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).control
o(this,i);(n=t.apply(this,arguments)).on(r,"activate",n._onActivate)
n.on(r,"deactivate",n._onDeactivate)
return n}l(i,[{key:"_onActivate",value:function(){this.setText("Hide captions tooltip")}},{key:"_onDeactivate",value:function(){this.setText("Show captions tooltip")}}],[{key:"getDefaultText",value:function(){return"Show captions tooltip"}}])
return i}(Wf)
ql.registerComponent("CaptionsToggleTooltip",_v)
var bv=function(e){d(i,e)
var t=g(i)
function i(){o(this,i)
return t.apply(this,arguments)}l(i,null,[{key:"getDefaultText",value:function(){return"Captions Menu tooltip"}}])
return i}(Wf)
ql.registerComponent("CaptionsMenuToggleTooltip",bv)
var Tv=function(e){d(i,e)
var t=g(i)
function i(){o(this,i)
return t.apply(this,arguments)}l(i,null,[{key:"getDefaultText",value:function(){return"Skip back tooltip"}}])
return i}(Wf)
ql.registerComponent("SkipBackTooltip",Tv)
var kv=function(e){d(i,e)
var t=g(i)
function i(){o(this,i)
return t.apply(this,arguments)}l(i,null,[{key:"getDefaultText",value:function(){return"Skip ahead tooltip"}}])
return i}(Wf)
ql.registerComponent("SkipAheadTooltip",kv)
var Sv=function(e){d(i,e)
var t=g(i)
function i(){o(this,i)
return t.apply(this,arguments)}l(i,null,[{key:"getDefaultText",value:function(){return"Back to start tooltip"}}])
return i}(Wf)
ql.registerComponent("BackToStartTooltip",Sv)
var Ev=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).control
o(this,i);(n=t.apply(this,arguments)).on(r,"activate",n._onActivate)
n.on(r,"deactivate",n._onDeactivate)
return n}l(i,[{key:"_onActivate",value:function(){this.setText("Deactivate theater mode tooltip")}},{key:"_onDeactivate",value:function(){this.setText("Activate theater mode tooltip")}}],[{key:"getDefaultText",value:function(){return"Activate theater mode tooltip"}}])
return i}(Wf)
ql.registerComponent("TheaterModeTooltip",Ev)
var Cv=function(e){d(i,e)
var t=g(i)
function i(){o(this,i)
return t.apply(this,arguments)}l(i,null,[{key:"getDefaultText",value:function(){return"Previous tooltip"}}])
return i}(Wf)
ql.registerComponent("PreviousTooltip",Cv)
var wv=function(e){d(i,e)
var t=g(i)
function i(){o(this,i)
return t.apply(this,arguments)}l(i,null,[{key:"getDefaultText",value:function(){return"Next tooltip"}}])
return i}(Wf)
ql.registerComponent("NextTooltip",wv)
var Iv=function(e){d(i,e)
var t=g(i)
function i(){o(this,i)
return t.apply(this,arguments)}l(i,null,[{key:"getDefaultText",value:function(){return"Settings tooltip"}}])
return i}(Wf)
ql.registerComponent("SettingsMenuTooltip",Iv)
var Pv=function(e){d(i,e)
var t=g(i)
function i(){o(this,i)
return t.apply(this,arguments)}l(i,null,[{key:"getDefaultText",value:function(){return"Playback speed tooltip"}}])
return i}(Wf)
ql.registerComponent("PlaybackRateMenuTooltip",Pv)
var xv=ql.getPlugin("plugin"),Av=ql.getComponent("ControlTooltip"),Ov={PlayToggle:vv,SkipBackButton:Tv,SkipAheadButton:kv,BackToStartButton:Sv,TheaterModeButton:Ev,PreviousButton:Cv,NextButton:wv,CaptionsToggle:_v,"CaptionsMenuToggle.CaptionsMenuToggle":bv,FullscreenToggle:yv,"SettingsMenuButton.SettingsMenuButton":Iv,"PlaybackRateMenuButton.PlaybackRateMenuButton":Pv},Lv=function(e){d(i,e)
var t=g(i)
function i(e){var n
o(this,i);(n=t.apply(this,arguments))._player=e
e.ready((function(){n._controlBar=e.getChild("controlBar")
n._controls=n._controlBar.children()
n._middleIndex=n._getMiddleIndex()
Object.keys(Ov).forEach((function(e){var t=Ov[e]
fp("tooltip: The tooltip class must provide a getDefaultText method","function"==typeof t.getDefaultText)
var i=n._controlBar.getDescendant(e.split("."))
if(i){var r=i,a=e.split(".")
a.length>1&&(r=n._controlBar.getChild(a[0]))
n.addTooltip(i,{side:n._getSide(r),TooltipClass:t})}}))
n._middleIndex=null}))
return n}l(i,[{key:"addTooltip",value:function(e,t){var i=t.side,n=t.TooltipClass,r=void 0===n?Av:n,a=new r(this._player,{control:e,side:i,text:r.getDefaultText()})
e.addChild(a)}},{key:"_getSide",value:function(e){var t=this._middleIndex||this._getMiddleIndex()
if(t){return this._controls.indexOf(e)>t?Hf:Vf}return null}},{key:"_getMiddleIndex",value:function(){var e=this._controlBar.getChild("CustomControlSpacer"),t=e&&this._controls.indexOf(e)
return t>-1?t:null}}])
return i}(xv)
ql.registerPlugin("controlTooltips",Lv)
var Dv=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).autoplay,a=void 0===r||r
o(this,i);(n=t.apply(this,arguments))._autoplay=a
e.ready((function(){var t=e.getDescendant("controlBar","nextButton"),i=e.getDescendant("controlBar","previousButton")
t&&n.on(t,"next",(function(){n.next({autoplay:a&&!e.paused()})}))
i&&n.on(i,"previous",(function(){n.previous({autoplay:a&&!e.paused()})}))
n.on(e,"ended",n._onEnded)}))
return n}l(i,[{key:"previous",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).autoplay
this.player.options({autoplay:!!e&&"play"})
this.trigger("previous")}},{key:"next",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).autoplay
this.player.options({autoplay:!!e&&"play"})
this.trigger("next")}},{key:"setCurrentItem",value:function(e){var t=this,i=e.source,n=e.autoplay,r=e.plugins,a=void 0===r?{}:r,s=e.poster,o=e.tracks
fp("playlist setCurrentItem(): source is required",i)
this.player.paused()||this.player.pause()
this.player.reset()
nm(n)&&this.player.options({autoplay:n})
Object.keys(a).forEach((function(e){t.player[e]().setState(a[e])}))
this.player.poster(s)
this.player.src(i)
Array.isArray(o)&&o.forEach((function(e){var i=e.label,n=e.srclang,r=e.src
t.player.addRemoteTextTrack({kind:"captions",label:i,srclang:n,src:r})}))
this.trigger("itemchange",e)}},{key:"_onEnded",value:function(){var e=this.player,t=e.getDescendant("controlBar","settingsMenuButton"),i=t&&t.menu.getChild("autoplaySetting"),n=!i||i.selected(),r=this._autoplay&&n&&!e.loop()
this.trigger("ended",{autoplay:r,next:this.next.bind(this)})}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("playlist",Dv)
ql.registerPlugin("disableContextMenu",(function(){this.on("contextmenu",(function(e){e.preventDefault()}))}))
var Rv=ql.getPlugin("plugin"),Mv=function(e){d(i,e)
var t=g(i)
function i(e,n){var r,a=n.topBufferSize,s=void 0===a?5:a
o(this,i);(r=t.apply(this,arguments))._topBufferSize=s
r.on(e,"ready",r._onReady)
r.on(e,"dispose",r._onDispose)
return r}l(i,[{key:"_onReady",value:function(){var e=this
this._controlBar=this.player.getChild("controlBar")
this._controlBarResizeObserver=new ResizeObserver((function(){e._setMaxHeight()}))
this._controlBarResizeObserver.observe(this._controlBar.el())}},{key:"_setMaxHeight",value:function(){if(this._controlBar&&this._controlBar.el()){var e=this.player.el().getBoundingClientRect().top,t=this._controlBar.children().find((function(e){return null!==e.el().offsetParent}))
if(t){var i=t.el().getBoundingClientRect().top,n=Math.abs(e-i)-this._topBufferSize
this._controlBar.el().querySelectorAll(".vjs-slider-vertical").forEach((function(e){e.parentElement.style.maxHeight="".concat(n,"px")}))
this.trigger("heightchange")}}}},{key:"_onDispose",value:function(){this._controlBarResizeObserver&&this._controlBarResizeObserver.unobserve(this._controlBar.el())}}])
return i}(Rv)
ql.registerPlugin("verticalSliderMaxHeight",Mv)
ql.registerPlugin("throwErrors",(function(){var e=ql.log.error
ql.log.error=function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n]
if(i[0]instanceof Error)throw i[0]
e.apply(e,i)}}))
var Nv=function(e){d(i,e)
var t=g(i)
function i(e,n){var r,a=n.checkInterval,s=void 0===a?1e3:a
o(this,i);(r=t.apply(this,arguments)).setRateRanges()
r.on(e,"playbackrateschange",r.setRateRanges)
r.on(e,"ratechange",r.restrictRate)
r.on(e,"timeupdate",function(e,t){fp("throttle requires a wait time",t&&!Number.isNaN(t))
var i=window.performance.now()
return function(){var n=window.performance.now()
if(n-i>=t){e.apply(void 0,arguments)
i=n}}}((function(){return r.restrictRate()}),s))
return r}l(i,[{key:"setRateRanges",value:function(){var e=this.player.playbackRates()
this.maxRate=!!e.length&&Math.max.apply(Math,_(e))
this.minRate=!!e.length&&Math.min.apply(Math,_(e))}},{key:"restrictRate",value:function(){if(!1!==this.maxRate&&!1!==this.minRate){var e=this.player.tech(!0).el().playbackRate
e>this.maxRate&&this.player.playbackRate(this.maxRate)
e<this.minRate&&this.player.playbackRate(this.minRate)}}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("restrictPlaybackRate",Nv)
ql.registerPlugin("useMercado",(function(){this.addClass("media-player--use-mercado")}))
var Uv=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.rootMargin,s=r.threshold,u=void 0===s?0:s
o(this,i)
n=t.apply(this,arguments)
if(!S)return m(n)
n._threshold=u
n._isInViewport=null
n._isDocumentVisible=!document.hidden
var l=n._onDocumentVisibilityChange.bind(f(n))
document.addEventListener("visibilitychange",l)
var c=new window.IntersectionObserver(n._onInViewportChange.bind(f(n)),{rootMargin:a,threshold:u})
c.observe(e.el())
n.on(e,"dispose",(function(){document.removeEventListener("visibilitychange",l)
c.disconnect()
c=void 0}))
return n}l(i,[{key:"ready",value:function(e){this._isReady?e():this.on("ready",e)}},{key:"isVisible",value:function(){fp("player-visibility: isVisible should not be called before `ready`",this._isReady)
return this._isVisible}},{key:"isInViewport",value:function(){fp("player-visibility: isInViewport should not be called before `ready`",this._isReady)
return this._isInViewport}},{key:"isDocumentVisible",value:function(){return this._isDocumentVisible}},{key:"_onInViewportChange",value:function(e){var t=this
e.forEach((function(e){var i=e.isIntersecting,n=e.intersectionRatio
t._isInViewport=i&&n>=t._threshold}))
this._setIsVisible()
if(this._isReady)this.trigger("inViewportChange",{isInViewport:this._isInViewport})
else{this._isReady=!0
this.trigger("ready")}}},{key:"_onDocumentVisibilityChange",value:function(){this._isDocumentVisible=!document.hidden
this._setIsVisible()
this.trigger("documentVisibilityChange",{isDocumentVisible:this._isDocumentVisible})}},{key:"_setIsVisible",value:function(){var e=this._isVisible
this._isVisible=this._isDocumentVisible&&this._isInViewport
this._isReady&&this._isVisible!==e&&this.trigger("visibilityChange",{isVisible:this._isVisible,isDocumentVisible:this._isDocumentVisible,isInViewport:this._isInViewport})}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("playerVisibility",Uv)
var Bv=ql.getPlugin("plugin"),Fv=["ready","loadstart","loadeddata","loadedmetadata","canplay","autoplay-success","autoplay-failure"],jv=function(e){d(i,e)
var t=g(i)
function i(e){var n
o(this,i);(n=t.apply(this,arguments)).Promise=e.options().Promise||window.Promise
n._setupEventPromises()
n.on(e,"playerreset",n._onReset)
return n}l(i,[{key:"waitForEvent",value:function(e){fp("lifecycle: Must be a supported event",Fv.includes(e))
return this._eventPromises[e]}},{key:"_setupEventPromises",value:function(){var e=this
this._eventPromises={}
Fv.forEach((function(t){e._eventPromises[t]=new e.Promise((function(i){e.one(e.player,t,i)
e.one(e.player,"playerreset",(function(){e.off(e.player,t,i)}))}))}))}},{key:"_onReset",value:function(){this._setupEventPromises()}}])
return i}(Bv)
ql.registerPlugin("lifecycle",jv)
var Vv=ql.getPlugin("plugin"),Hv="vjs-is-playing",qv=function(e){d(i,e)
var t=g(i)
function i(e){var n
o(this,i);(n=t.apply(this,arguments))._poster=null
n.on(e,"play",n._onPlay)
n.on(e,"pause",n._onPause)
n.on(e,"playerreset",n._onReset)
n.one(e,"loadstart",(function(){n.on(e,"posterchange",n._onPosterChange)
n.on(e,"autoplay-failure",n._onAutoplayFailure)}))
return n}l(i,[{key:"_onPlay",value:function(){this.player.addClass(Hv)}},{key:"_onPause",value:function(){this.player.removeClass(Hv)}},{key:"_onReset",value:function(){this._poster=null
this.player.autoplay()||this.player.removeClass(Hv)}},{key:"_onPosterChange",value:function(){var e=this.player.poster()
if(e&&this.player.autoplay()&&e!==this._poster){this._poster=e
this.player.poster("")}}},{key:"_onAutoplayFailure",value:function(){if(this._poster){this.player.poster(this._poster)
this._poster=null}}}])
return i}(Vv)
ql.registerPlugin("smoothMediaChange",qv)
ql.registerPlugin("menuOverflow",(function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.offset,n=void 0===i?80:i,r=t.maxHeight
this.on(["ready","playerresize","loadedmetadata"],(function(){var t=e.el().querySelectorAll(".vjs-menu-button-popup .vjs-menu-content"),i=e.currentHeight()
t.forEach((function(e){e.setAttribute("tabindex","-1")
var t=Math.max(i-n,24)
r&&(t=Math.min(t,r))
e.style.maxHeight="".concat(t,"px")}))}))}))
var Wv=ql.getPlugin("plugin"),Gv=function(e){d(i,e)
var t=g(i)
function i(e){var n
o(this,i)
n=t.apply(this,arguments)
e.options({liveTracker:{liveTolerance:2}})
n.on(e,"play",n._onPlay)
n.on(e,"pause",n._onPause)
n.on(e,"ended",n._onEnded)
return n}l(i,[{key:"_onPlay",value:function(){this.player.liveTracker&&this.player.liveTracker.isLive()&&this._maintainLiveEdge()}},{key:"_onPause",value:function(){this.player.clearTimeout(this._maintainLiveEdgeTimeout)}},{key:"_onEnded",value:function(){this.player.clearTimeout(this._maintainLiveEdgeTimeout)
this._startedPlaybackDuringLive=!1}},{key:"_maintainLiveEdge",value:function(){this.player.liveTracker.liveCurrentTime()-this.player.currentTime()>2&&this.player.liveTracker.seekToLiveEdge()
this._maintainLiveEdgeTimeout=this.player.setTimeout(this._maintainLiveEdge.bind(this),1e3)}},{key:"dispose",value:function(){this.player.clearTimeout(this._maintainLiveEdgeTimeout)
v(h(i.prototype),"dispose",this).call(this)}}])
return i}(Wv)
ql.registerPlugin("maintainLiveEdge",Gv)
var zv,Kv=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).events,a=void 0===r?["tap","click","keydown"]:r
o(this,i);(n=t.apply(this,arguments)).on(e,a,(function(e){if(!e.isTrusted){e.preventDefault()
e.stopPropagation()}}))
return n}return l(i)}(ql.getPlugin("plugin"))
ql.registerPlugin("disableScriptInteraction",Kv)
ql.registerPlugin("setAriaLiveToOff",(function(){var e=this
this.ready((function(){e.el().querySelectorAll(".vjs-control-text[aria-live=polite]").forEach((function(e){e.setAttribute("aria-live","off")}))}))}))
var Xv=new Uint8Array(16)
function Yv(){if(!zv&&!(zv="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")
return zv(Xv)}var Qv=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i
for(var $v=[],Jv=0;Jv<256;++Jv)$v.push((Jv+256).toString(16).substr(1))
function Zv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=($v[e[t+0]]+$v[e[t+1]]+$v[e[t+2]]+$v[e[t+3]]+"-"+$v[e[t+4]]+$v[e[t+5]]+"-"+$v[e[t+6]]+$v[e[t+7]]+"-"+$v[e[t+8]]+$v[e[t+9]]+"-"+$v[e[t+10]]+$v[e[t+11]]+$v[e[t+12]]+$v[e[t+13]]+$v[e[t+14]]+$v[e[t+15]]).toLowerCase()
if(!function(e){return"string"==typeof e&&Qv.test(e)}(i))throw TypeError("Stringified UUID is invalid")
return i}function ey(e,t,i){var n=(e=e||{}).random||(e.rng||Yv)()
n[6]=15&n[6]|64
n[8]=63&n[8]|128
if(t){i=i||0
for(var r=0;r<16;++r)t[i+r]=n[r]
return t}return Zv(n)}var ty=function(e){d(i,e)
var t=g(i)
function i(e){var n
o(this,i);(n=t.apply(this,arguments))._sourceSet=!1
n.generateNewTrackingId()
n.on(e,"sourceset",(function(t){if(n._sourceSet){var i=t.src||""
i.length&&n._isSrcInCurrentSources(i,e.currentSources())||n.generateNewTrackingId()}else n._sourceSet=!0}))
return n}l(i,[{key:"generateNewTrackingId",value:function(){this.trackingId=ey()}},{key:"getTrackingId",value:function(){return this.clientTrackingId||this.trackingId}},{key:"setTrackingId",value:function(e){this.clientTrackingId=e}},{key:"_isSrcInCurrentSources",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]
return t.length>1&&t.find((function(t){return t.src.length&&e.indexOf(t.src)>-1}))}}])
return i}(ql.getPlugin("plugin"))
ql.registerPlugin("generateTrackingId",ty)
var iy=function(e){d(r,e)
var t,i=g(r)
function r(e,t){var n
o(this,r);(n=i.call(this,e,t))._player=e
n._animationUri=t.animationUri
n._animationSvg=null
n._fetchAnimationUri()
n.on(n._player,"play",n._onPlay)
n.on(n._player,"pause",n._onPause)
return n}l(r,[{key:"_onPlay",value:function(){if(this._background)this._background.unpauseAnimation()
else{this._background=this._player.addChild("AudioAnimatedBackground")
this._background.setAnimation(this._animationSvg)
this._background.on(["tap","click"],this._handlePlayPauseToggle.bind(this))}}},{key:"_onPause",value:function(){var e
null===(e=this._background)||void 0===e||e.pauseAnimation()}},{key:"_handlePlayPauseToggle",value:function(){this._player.paused()?this._player.play():this._player.pause()}},{key:"_fetchAnimationUri",value:(t=s(n().mark((function e(){var t=this
return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:fetch(this._animationUri).then((function(e){return"image/svg+xml"===e.headers.get("content-type")?e.text():null})).then((function(e){var i=(new DOMParser).parseFromString(e,"image/svg+xml"),n=null==i?void 0:i.querySelector("svg")
if(n){t._animationSvg=document.importNode(n,!0)
t._background&&t._background.setAnimation(t._animationSvg)}})).catch((function(){return null}))
case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}])
return r}(ql.getPlugin("plugin"))
ql.registerPlugin("audioAnimatedBackground",iy)
var ny=function(e,t){if(!e.responseHeaders)return null
var i=t.toLowerCase(),n=Object.entries(e.responseHeaders).find((function(e){return y(e,1)[0].toLowerCase()===i}))
return n&&n[1]},ry=function(e){var t,i,n,r,a=(t=e.uri,null===(i=performance)||void 0===i||null===(n=i.getEntriesByName)||void 0===n||null===(r=n.call(i,t,"resource"))||void 0===r?void 0:r.pop())
return 304===(null==a?void 0:a.responseStatus)||0===(null==a?void 0:a.transferSize)},ay=function(e){return!!ny(e,Bg)},sy=function(e){return function(e){return"*"===ny(e,Ng)}(e)?ry(e)?Lg:function(e){return ay(e)&&"HIT"===ny(e,Ug)}(e)?Dg:ay(e)?Rg:Mg:Mg},oy=ql.getPlugin("plugin"),uy=function(e,t,i){e.beforeRequest=function(e){!function(e,t,i){var n=Dm()
t?i.xhrHooksResponseCallback=function(t,i){e.trigger("response",{xhr:t,performanceStartTime:n,performanceEndTime:Dm(),responseSource:i?Og:sy(t)})}:i.beforeSend=function(t){t.addEventListener("loadend",(function(){e.trigger("response",{xhr:t,performanceStartTime:n,performanceEndTime:Dm(),responseSource:sy(t)})}))}}(t,i,e)
return e}},ly=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
o(this,i);(n=t.apply(this,arguments)).enabled=r.enabled
if(!n.enabled)return m(n)
var a=f(n)
e.ready((function(){var t=ql.Vhs.xhr._fromWebMediaPrefetchingPlugin,i=new window.Proxy(e.tech(!0),{set:function(e,i,n){if("vhs"!==i){var r
return(r=window.Reflect).set.apply(r,arguments)}e[i]=function(e,t,i){return new window.Proxy(e,{set:function(e,n,r){var a
"xhr"===n&&uy(r,t,i)
return(a=window.Reflect).set.apply(a,arguments)}})}(n,a,t)
return!0}})
e.tech_=i}))
return n}return l(i)}(oy)
ql.registerPlugin("xhrHooks",ly)
var cy=ql.getPlugin("plugin"),dy=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
o(this,i);(n=t.apply(this,arguments)).enabled=r.enabled
if(!n.enabled)return m(n)
e.ready((function(){e.on("pause",(function(){return function(e){var t,i=null===(t=e.tech(!0).vhs)||void 0===t?void 0:t.masterPlaylistController_
i&&[i.mainSegmentLoader_,i.audioSegmentLoader_,i.subtitleSegmentLoader_].forEach((function(e){if(e){e.abort()
e.pause()}}))}(e)}))
e.on("play",(function(){return function(e){var t,i=null===(t=e.tech(!0).vhs)||void 0===t?void 0:t.masterPlaylistController_
i&&i.load()}(e)}))}))
return n}return l(i)}(cy)
ql.registerPlugin("stopBufferingHlsOnPause",dy)
var hy=function(e){var t=e.getBoundingClientRect(),i=t.top,n=t.bottom,r=window.innerHeight
return i>=0&&i<r&&n<=window.innerHeight},py=function(e){var t=e.getBoundingClientRect(),i=t.height
return t.top+i/2-window.innerHeight/2},fy=function(e,t){var i=e.player,n=t.player
if(!i.paused()&&n.paused())return-1
if(i.paused()&&!n.paused())return 1
var r=i.tech(!0).el_,a=n.tech(!0).el_,s=hy(r),o=hy(a)
if(s&&!o)return-1
if(!s&&o)return 1
if(s&&o)return 0
var u=py(r),l=py(a)
return u>=0&&l<0?-1:u<0&&l>=0?1:Math.abs(u)-Math.abs(l)},my=function(e){var t=e.duration()
if(t===1/0)return!1
if(!t)return!1
var i=e.buffered()
if(0===i.length)return!1
var n=i.end(i.length-1)
if(t-n<=.09)return!0
var r=e.tech(!0).vhs.masterPlaylistController_.goalBufferLength()
return n-e.currentTime()>=r},gy=function(e){if(0!==e.length){var t=ql.getAllPlayers().filter((function(e){return!e.paused()})),i=e.find((function(e){return!e.player.paused()}))
return t.length>0&&!i&&!t.every(my)?null:function(e){return e.sort(fy).at(0)}(e)}},vy=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).allowMultipleActiveEntries,i=void 0!==t&&t
o(this,e)
this.entries=[]
this.activeEntries=[]
this.allowMultipleActiveEntries=i}l(e,[{key:"push",value:function(e){this.entries.push(e)
this.run()}},{key:"remove",value:function(e){var t=this.entries.indexOf(e)
t<0||this.entries.splice(t,1)}},{key:"run",value:function(){var e=this,t=gy(this.entries)
if(t&&(!this.activeEntries.length||this.allowMultipleActiveEntries&&!t.player.paused())){this.activeEntries.push(t)
this.remove(t)
var i=t.origXhr,n=t.options,r=t.callback,a=t.eventListeners,s=t.returnedRequestObjectProxyHandler,o=i(n,(function(i,n){r(i,n)
e.activeEntries.splice(e.activeEntries.indexOf(t),1)
e.run()}))
s.get=function(i,n){if("abort"===n)return function(){o.abort.apply(o)
e.activeEntries.splice(e.activeEntries.indexOf(t),1)
e.run()}
var r=o[n]
return"function"==typeof r?r.bind(o):r}
a.forEach((function(e){var t=e.event,i=e.callback
o.addEventListener(t,i)}))}}}])
return e}(),yy=ql.getPlugin("plugin"),_y=function(e,t,i){return new window.Proxy(e,{set:function(e,n,r){if("xhr"!==n){var a
return(a=window.Reflect).set.apply(a,arguments)}e[n]=function(e,t,i){return function(n,r){var a={origXhr:e,player:i,options:n,callback:r,eventListeners:[]},s={url:n.uri,uri:n.uri,abort:function(){t.remove(a)},addEventListener:function(e,t){a.eventListeners.push({event:e,callback:t})}},o={},u=new window.Proxy(s,o)
a.returnedRequestObjectProxyHandler=o
t.push(a)
return u}}(r,t,i)
return!0}})},by=function(e){d(i,e)
var t=g(i)
function i(e){var n,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
o(this,i);(r=t.apply(this,arguments)).enabled=a.enabled
if(!r.enabled)return m(r)
null!==(n=ql.requestQueuePlugin)&&void 0!==n&&n.requestQueue||(ql.requestQueuePlugin={requestQueue:new vy({allowMultipleActiveEntries:a.allowMultipleActiveEntries})})
var s=ql.requestQueuePlugin.requestQueue
e.on("play",(function(){return ql.requestQueuePlugin.requestQueue.run()}))
e.on("pause",(function(){return ql.requestQueuePlugin.requestQueue.run()}))
e.ready((function(){var t=new window.Proxy(e.tech(!0),{set:function(t,i,n){if("vhs"!==i){var r
return(r=window.Reflect).set.apply(r,arguments)}t[i]=_y(n,s,e)
return!0}})
e.tech_=t}))
return r}return l(i)}(yy)
ql.registerPlugin("requestQueue",by)
var Ty=ql.getPlugin("plugin"),ky=function(e){var t=e.origVhs,i=e.player,n=e.viewportDistanceForLoading
return new window.Proxy(t,{set:function(e,t,r){var a
"masterPlaylistController_"===t&&function(e){var t=e.player,i=e.mpc,n=e.viewportDistanceForLoading,r=void 0===n?0:n,a=i.goalBufferLength.bind(i)
i.goalBufferLength=function(){return 0}
var s=new window.IntersectionObserver((function(e){e.forEach((function(e){if(e.isIntersecting){i.goalBufferLength=a
s.disconnect()}}))}),{rootMargin:"".concat(r,"px")})
s.observe(t.el())}({player:i,mpc:r,viewportDistanceForLoading:n})
return(a=window.Reflect).set.apply(a,arguments)}})},Sy=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
o(this,i);(n=t.apply(this,arguments)).enabled=r.enabled
if(!n.enabled)return m(n)
e.ready((function(){var t=new window.Proxy(e.tech(!0),{set:function(t,i,n){if("vhs"!==i){var a
return(a=window.Reflect).set.apply(a,arguments)}t[i]=ky({origVhs:n,player:e,viewportDistanceForLoading:r.viewportDistanceForLoading})
return!0}})
e.tech_=t}))
return n}return l(i)}(Ty)
ql.registerPlugin("delayedSegmentLoading",Sy)
var Ey=ql.getPlugin("plugin"),Cy={VIDEO_LOAD_START:"video-load-start-UGC",VIDEO_LOAD_SUCCESS:"video-load-success-UGC",VIDEO_LOAD_FAILURE:"video-load-failure-UGC"},wy={VIDEO_LOAD_START:"video-load-start-Ads",VIDEO_LOAD_SUCCESS:"video-load-success-Ads",VIDEO_LOAD_FAILURE:"video-load-failure-Ads"},Iy={VIDEO_LOAD_START:"video-load-start-Learning",VIDEO_LOAD_SUCCESS:"video-load-success-Learning",VIDEO_LOAD_FAILURE:"video-load-failure-Learning"},Py={VIDEO_LOAD_START:"video-load-start-Messaging",VIDEO_LOAD_SUCCESS:"video-load-success-Messaging",VIDEO_LOAD_FAILURE:"video-load-failure-Messaging"},xy={VIDEO_LOAD_START:"video-load-start-Live",VIDEO_LOAD_SUCCESS:"video-load-success-Live",VIDEO_LOAD_FAILURE:"video-load-failure-Live"},Ay=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
o(this,i)
n=t.apply(this,arguments)
var a=r.clientSensor,s=r.mediaSource,u=r.useOldGroupName
if(!a)return m(n)
var l=u?"media-infra":"media-player",c=function(e){if(!e||"string"!=typeof e)return null
switch(e.toLowerCase()){case"ugc":return Cy
case"ads":return wy
case"learning":return Iy
case"messaging":return Py
case"live_video":return xy
default:return null}}(s)
if(!c)return m(n)
a.incrementMetricCounter({groupName:l,metricName:c.VIDEO_LOAD_START})
e.ready((function(){e.one("error",(function(){return a.incrementMetricCounter({groupName:l,metricName:c.VIDEO_LOAD_FAILURE})}))
e.one("loadedmetadata",(function(){return a.incrementMetricCounter({groupName:l,metricName:c.VIDEO_LOAD_SUCCESS})}))}))
return n}return l(i)}(Ey)
ql.registerPlugin("sensors",Ay)
function Oy(e){return e>=200&&e<=299}var Ly=ql.getPlugin("plugin"),Dy={},Ry=function(e){return[e.uri,e.responseType,e.headers&&e.headers.Range].filter((function(e){return void 0!==e})).join("|||||")},My=function(e){d(i,e)
var t=g(i)
function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
o(this,i);(n=t.apply(this,arguments))._enabled=r.enabled&&ql.Vhs
if(!n._enabled)return m(n)
if(ql.Vhs.xhr._fromXhrCachePlugin)return m(n)
n._overrideVhsXhr()
return n}l(i,[{key:"enabled",get:function(){return this._enabled}},{key:"_overrideVhsXhr",value:function(){ql.Vhs.xhr=function(e,t){var i=Dy[Ry(e)]
if(null!=i&&i.callbacks){i.callbacks.push(t)
return i.request}if(null!=i&&i.error||null==i||!i.response||!Oy(i.response.statusCode))return ql.xhr(e,t)
var n=i.request,r=i.error,a=i.response
ql.log.debug("[XHR-CACHE] Retrieved cache result for: ".concat(n.url))
setTimeout((function(){return t(r,a)}))
return n}
ql.Vhs.xhr._fromXhrCachePlugin=!0}},{key:"requestAndCache",value:function(e,t){var i=Ry(e),n=Dy[i]
if(!n){var r=ql.xhr(e,(function(e,t){var n=Dy[i]
ql.log.debug("[XHR-CACHE] Caching result for: ".concat(r.url))
Dy[i]={request:r,error:e,response:t}
if(null!=n&&n.callbacks){n.callbacks.forEach((function(i){return i(e,t)}))
delete n.callbacks}}))
Dy[i]={request:r,callbacks:[t]}
return r}n.callbacks.push(t)}},{key:"clearCache",value:function(){Object.keys(Dy).forEach((function(e){return delete Dy[e]}))}}])
return i}(Ly)
ql.registerPlugin("xhrCache",My)
var Ny=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Uy=/^application\/dash\+xml/i
const By=function(e){const t={}
e.byterange&&(t.Range=function(e){let t
const i=e.offset
t="bigint"==typeof e.offset||"bigint"==typeof e.length?x.BigInt(e.offset)+x.BigInt(e.length)-x.BigInt(1):e.offset+e.length-1
return"bytes="+i+"-"+t}(e.byterange))
return t}
var Fy=1.2,jy={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},Vy=function(e){void 0===e&&(e="")
return jy.audio.test(e.trim().toLowerCase())}
const{createTimeRange:Hy}=ql,qy=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Wy=function(e){const t=qy(e)
return!e.disabled&&!t},Gy=(e,t)=>!(!e&&!t||!e&&t||e&&!t)&&(e===t||(!(!e.id||!t.id||e.id!==t.id)||(!(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)||!(!e.uri||!t.uri||e.uri!==t.uri)))),zy=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{}
let n=!1
for(const e in i){for(const r in i[e]){n=t(i[e][r])
if(n)break}if(n)break}return!!n}
var Ky=Wy,Xy=function(e){return e.disabled},Yy=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Qy=e=>{if(!e||!e.playlists||!e.playlists.length){return zy(e,(e=>e.playlists&&e.playlists.length||e.uri))}for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t],n=i.attributes&&i.attributes.CODECS
if(n&&n.split(",").every((e=>Vy(e))))continue
if(!zy(e,(e=>Gy(i,e))))return!1}return!0}
const $y=e=>ql.log.debug?ql.log.debug.bind(ql,"VHS:",`${e} >`):function(){},Jy=($y("CodecUtils"),$y("PlaylistSelector")),Zy=function(e){if(!e||!e.playlist)return
const t=e.playlist
return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},e_=function(e,t){if(!e)return""
const i=x.getComputedStyle(e)
return i?i[t]:""},t_=function(e,t){const i=e.slice()
e.sort((function(e,n){const r=t(e,n)
return 0===r?i.indexOf(e)-i.indexOf(n):r}))}
const i_=function(){const e=this.useDevicePixelRatio&&x.devicePixelRatio||1
return function(e,t,i,n,r,a){if(!e)return
const s={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r}
let o=e.playlists
if(Qy(e)){o=a.getAudioTrackPlaylists_()
s.audioOnly=!0}let u=o.map((e=>{let t
const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height
t=e.attributes&&e.attributes.BANDWIDTH
t=t||x.Number.MAX_VALUE
return{bandwidth:t,width:i,height:n,playlist:e}}))
t_(u,((e,t)=>e.bandwidth-t.bandwidth))
u=u.filter((e=>!Yy(e.playlist)))
let l=u.filter((e=>Ky(e.playlist)))
l.length||(l=u.filter((e=>!Xy(e.playlist))))
const c=l.filter((e=>e.bandwidth*Fy<t))
let d=c[c.length-1]
const h=c.filter((e=>e.bandwidth===d.bandwidth))[0]
if(!1===r){const e=h||l[0]||u[0]
if(e&&e.playlist){let t="sortedPlaylistReps"
h&&(t="bandwidthBestRep")
l[0]&&(t="enabledPlaylistReps")
Jy(`choosing ${Zy(e)} using ${t} with options`,s)
return e.playlist}Jy("could not choose a playlist with options",s)
return null}const p=c.filter((e=>e.width&&e.height))
t_(p,((e,t)=>e.width-t.width))
const f=p.filter((e=>e.width===i&&e.height===n))
d=f[f.length-1]
const m=f.filter((e=>e.bandwidth===d.bandwidth))[0]
let g,v,y,_
if(!m){g=p.filter((e=>e.width>i||e.height>n))
v=g.filter((e=>e.width===g[0].width&&e.height===g[0].height))
d=v[v.length-1]
y=v.filter((e=>e.bandwidth===d.bandwidth))[0]}if(a.experimentalLeastPixelDiffSelector){const e=p.map((e=>{e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n)
return e}))
t_(e,((e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff))
_=e[0]}const b=_||y||m||h||l[0]||u[0]
if(b&&b.playlist){let e="sortedPlaylistReps"
_?e="leastPixelDiffRep":y?e="resolutionPlusOneRep":m?e="resolutionBestRep":h?e="bandwidthBestRep":l[0]&&(e="enabledPlaylistReps")
Jy(`choosing ${Zy(b)} using ${e} with options`,s)
return b.playlist}Jy("could not choose a playlist with options",s)
return null}(this.playlists.master,this.systemBandwidth,parseInt(e_(this.tech_.el(),"width"),10)*e,parseInt(e_(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}
var n_=function(e){var t=new je
t.push(e)
t.end()
return t.manifest},r_=function(e){var t=n_(e.body)
t.resolvedUri=e.url
t.playlists.forEach((function(e){e.resolvedUri=tt(t.resolvedUri,e.uri)}))
return t},a_=function(e){var t=n_(e.body)
t.resolvedUri=e.url
t.segments.forEach((function(e){return function(e){var t=e.segment,i=e.playlistUri
t.resolvedUri=tt(i,t.uri)
t.key&&(t.key.resolvedUri=tt(i,t.key.uri))
t.map&&(t.map.resolvedUri=tt(i,t.map.uri))}({segment:e,playlistUri:t.resolvedUri})}))
return t},s_=function(e){var t=e.player,i=e.options
return new window.Promise((function(e){t.xhrCache().requestAndCache(i,(function(t,i){e(t?null:i)}))}))},o_=function(){var e=s(n().mark((function e(t){var i,r,a
return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.player,r=t.uri
e.next=3
return s_({player:i,options:{uri:r}})
case 3:if((a=e.sent)&&Oy(a.statusCode)&&a.body){e.next=6
break}throw new Error("Error prefetching multivariant playlist: ".concat(null==a?void 0:a.statusCode,", ").concat(null==a?void 0:a.body))
case 6:return e.abrupt("return",r_(a))
case 7:case"end":return e.stop()}}),e)})))
return function(t){return e.apply(this,arguments)}}(),u_=function(){var e=s(n().mark((function e(t){var r,a,s,o,u,l
return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.player,a=t.prefetchedMain
s=r.tech(!0),o=s.vhs
e.t0=i_
e.t1=i
e.t2=i({},o)
e.t3={}
e.t4={master:a}
e.t5={get systemBandwidth(){return o.systemBandwidth},playlists:e.t4}
e.t6=(0,e.t1)(e.t2,e.t3,e.t5)
if(!(u=e.t0.apply.call(e.t0,e.t6)).cached){e.next=12
break}return e.abrupt("return",u)
case 12:e.next=14
return s_({player:r,options:{uri:u.resolvedUri}})
case 14:if((l=e.sent)&&Oy(l.statusCode)&&l.body){e.next=17
break}throw new Error("Error variant playlist: ".concat(null==l?void 0:l.statusCode,", ").concat(null==l?void 0:l.body))
case 17:u.segments=a_(l).segments
u.cached=!0
return e.abrupt("return",u)
case 20:case"end":return e.stop()}}),e)})))
return function(t){return e.apply(this,arguments)}}(),l_=function(){var e=s(n().mark((function e(t){var i,r,a,s
return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.player,r=t.prefetchedVariant
if(!(a=r.segments[0]).cached){e.next=4
break}return e.abrupt("return",a)
case 4:e.next=6
return s_({player:i,options:(n=a,{uri:n.resolvedUri,headers:By(n),responseType:"arraybuffer"})})
case 6:if((s=e.sent)&&Oy(s.statusCode)&&s.body){e.next=9
break}throw new Error("Error prefetching segment: ".concat(null==s?void 0:s.statusCode,", ").concat(null==s?void 0:s.body))
case 9:a.cached=!0
return e.abrupt("return",a)
case 11:case"end":return e.stop()}var n}),e)})))
return function(t){return e.apply(this,arguments)}}(),c_=function(e){d(r,e)
var t,i=g(r)
function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
o(this,r);(t=i.apply(this,arguments))._options=n
t._player=e
return t}l(r,[{key:"enabled",get:function(){return this._options.enabled&&this._player.xhrCache()&&this._player.xhrCache().enabled}},{key:"prefetchToFirstSegment",value:(t=s(n().mark((function e(t){var i,r,a,o,u,l,c,d=this
return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.enabled){e.next=2
break}return e.abrupt("return")
case 2:i=this._player
r=i.currentSource()
a=null==r?void 0:r.type.toLowerCase()
if(["hls","dash"].includes((h=a,Ny.test(h)?"hls":Uy.test(h)?"dash":"application/vnd.videojs.vhs+json"===h?"vhs-json":null))){e.next=7
break}return e.abrupt("return")
case 7:if(o=t.find((function(e){return e.type.toLowerCase()===(null==r?void 0:r.type.toLowerCase())}))){e.next=10
break}return e.abrupt("return")
case 10:u=!1
c=function(){var e=s(n().mark((function e(){var t
return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u&&my(i)){e.next=2
break}return e.abrupt("return")
case 2:u=!0
e.prev=3
if(l){e.next=8
break}e.next=7
return o_({player:i,uri:o.src})
case 7:l=e.sent
case 8:if(my(i)){e.next=11
break}u=!1
return e.abrupt("return")
case 11:e.next=13
return u_({player:i,prefetchedMain:l})
case 13:t=e.sent
if(my(i)){e.next=17
break}u=!1
return e.abrupt("return")
case 17:e.next=19
return l_({player:i,prefetchedVariant:t})
case 19:e.next=25
break
case 21:e.prev=21
e.t0=e.catch(3)
ql.log.debug("[PREFETCH] Unable to prefetch, error:",e.t0)
d._player.off("timeupdate",c)
case 25:u=!1
case 26:case"end":return e.stop()}}),e,null,[[3,21]])})))
return function(){return e.apply(this,arguments)}}()
this._player.on("timeupdate",c)
this._player.one("sourceset",(function(){d._player.off("timeupdate",c)}))
case 14:case"end":return e.stop()}var h}),e,this)}))),function(e){return t.apply(this,arguments)})}])
return r}(ql.getPlugin("plugin"))
ql.registerPlugin("prefetch",c_)
var d_=function(){return window.mediaInfraWebMediaPrefetching},h_=function(e){var t={method:e.method,headers:e.headers,body:e.body}
e.withCredentials&&(t.credentials="include")
return new Request(e.uri,t)},p_=function(e){return e&&["arraybuffer","video/mp4","video/mp2t","application/octet-stream"].find((function(t){return e.includes(t)}))?"arraybuffer":"text"},f_=function(){function e(t){var i=t.requestOptions,n=t.callback,r=t.prefetchCacheKey,a=t.shouldHookIntoActiveRequests
o(this,e)
this._callback=n
this._prefetchCacheKey=r
this._shouldHookIntoActiveRequests=a
this.uri=i.uri
this.url=i.uri
this.aborted=!1
this.response=null
this.responseText=null
this.responseType=null
this.responseURL=null
this.status=0
this.timeout=i.timeout
this.requestType=i.requestType
this._fetchPromise=this._fetch(i)}l(e,[{key:"addEventListener",value:function(){}},{key:"removeEventListener",value:function(){}},{key:"abort",value:function(){this.aborted=!0
this._xhrRequest&&this._xhrRequest.abort()}},{key:"_handleCacheResult",value:(i=s(n().mark((function e(t,i){var r,a
return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ql.log.debug("[WEB_MEDIA_PREFETCHING] Retrieved cache result for: ".concat(t.url),t)
r=Array.from(t.headers.entries()).reduce((function(e,t){var i=y(t,2),n=i[0],r=i[1]
e[n]=r
return e}),{})
if("text"!==(a=p_(t.headers.get("content